#!/usr/bin/env node
'use strict';

var events = require('events');
var Nq = require('crypto');
var xv = require('path');
var _P = require('os');
var aO = require('tls');
var RZ = require('readline');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var Nq__default = /*#__PURE__*/_interopDefault(Nq);
var xv__default = /*#__PURE__*/_interopDefault(xv);
var _P__default = /*#__PURE__*/_interopDefault(_P);
var aO__default = /*#__PURE__*/_interopDefault(aO);
var RZ__default = /*#__PURE__*/_interopDefault(RZ);

/**
 * Tabby Agent
 * https://github.com/tabbyml/tabby/tree/main/clients/tabby-agent
 * Copyright (c) 2023-2024 TabbyML, Inc.
 * Licensed under the Apache License 2.0.
 */
var Cq=Object.create;var Ic=Object.defineProperty;var xq=Object.getOwnPropertyDescriptor;var Tq=Object.getOwnPropertyNames;var Aq=Object.getPrototypeOf,Rq=Object.prototype.hasOwnProperty;var he=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),nS=e=>t=>{var r=e[t];if(r)return r();throw new Error("Module not found in bundle: "+t)};var iS=(e,t)=>()=>(e&&(t=e(e=0)),t);var P=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Iq=(e,t)=>{for(var r in t)Ic(e,r,{get:t[r],enumerable:!0});},sS=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Tq(t))!Rq.call(e,i)&&i!==r&&Ic(e,i,{get:()=>t[i],enumerable:!(n=xq(t,i))||n.enumerable});return e};var ar=(e,t,r)=>(r=e!=null?Cq(Aq(e)):{},sS(t||!e||!e.__esModule?Ic(r,"default",{value:e,enumerable:!0}):r,e)),Pq=e=>sS(Ic({},"__esModule",{value:!0}),e);var Xh=P((cee,uS)=>{var oS=Object.prototype.toString;uS.exports=function(t){var r=oS.call(t),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&oS.call(t.callee)==="[object Function]"),n};});var yS=P((lee,mS)=>{var gS;Object.keys||(Uo=Object.prototype.hasOwnProperty,Jh=Object.prototype.toString,cS=Xh(),ep=Object.prototype.propertyIsEnumerable,lS=!ep.call({toString:null},"toString"),fS=ep.call(function(){},"prototype"),jo=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Dc=function(e){var t=e.constructor;return t&&t.prototype===e},dS={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},hS=function(){if(typeof window>"u")return !1;for(var e in window)try{if(!dS["$"+e]&&Uo.call(window,e)&&window[e]!==null&&typeof window[e]=="object")try{Dc(window[e]);}catch{return !0}}catch{return !0}return !1}(),pS=function(e){if(typeof window>"u"||!hS)return Dc(e);try{return Dc(e)}catch{return !1}},gS=function(t){var r=t!==null&&typeof t=="object",n=Jh.call(t)==="[object Function]",i=cS(t),s=r&&Jh.call(t)==="[object String]",a=[];if(!r&&!n&&!i)throw new TypeError("Object.keys called on a non-object");var o=fS&&n;if(s&&t.length>0&&!Uo.call(t,0))for(var c=0;c<t.length;++c)a.push(String(c));if(i&&t.length>0)for(var l=0;l<t.length;++l)a.push(String(l));else for(var u in t)!(o&&u==="prototype")&&Uo.call(t,u)&&a.push(String(u));if(lS)for(var f=pS(t),h=0;h<jo.length;++h)!(f&&jo[h]==="constructor")&&Uo.call(t,jo[h])&&a.push(jo[h]);return a});var Uo,Jh,cS,ep,lS,fS,jo,Dc,dS,hS,pS;mS.exports=gS;});var Oc=P((fee,bS)=>{var Oq=Array.prototype.slice,Lq=Xh(),vS=Object.keys,kc=vS?function(t){return vS(t)}:yS(),_S=Object.keys;kc.shim=function(){if(Object.keys){var t=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);t||(Object.keys=function(n){return Lq(n)?_S(Oq.call(n)):_S(n)});}else Object.keys=kc;return Object.keys||kc};bS.exports=kc;});var Lc=P((dee,SS)=>{SS.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return !1;if(typeof Symbol.iterator=="symbol")return !0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return !1;var i=42;t[r]=i;for(r in t)return !1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return !1;var s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return !1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,r);if(a.value!==i||a.enumerable!==!0)return !1}return !0};});var tp=P((hee,wS)=>{var ES=typeof Symbol<"u"&&Symbol,Bq=Lc();wS.exports=function(){return typeof ES!="function"||typeof Symbol!="function"||typeof ES("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Bq()};});var TS=P((pee,xS)=>{var CS={foo:{}},Fq=Object;xS.exports=function(){return {__proto__:CS}.foo===CS.foo&&!({__proto__:null}instanceof Fq)};});var IS=P((gee,RS)=>{var Mq="Function.prototype.bind called on incompatible ",qq=Object.prototype.toString,Uq=Math.max,jq="[object Function]",AS=function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},$q=function(t,r){for(var n=[],i=r||0,s=0;i<t.length;i+=1,s+=1)n[s]=t[i];return n},Vq=function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r};RS.exports=function(t){var r=this;if(typeof r!="function"||qq.apply(r)!==jq)throw new TypeError(Mq+r);for(var n=$q(arguments,1),i,s=function(){if(this instanceof i){var u=r.apply(this,AS(n,arguments));return Object(u)===u?u:this}return r.apply(t,AS(n,arguments))},a=Uq(0,r.length-n.length),o=[],c=0;c<a;c++)o[c]="$"+c;if(i=Function("binder","return function ("+Vq(o,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var l=function(){};l.prototype=r.prototype,i.prototype=new l,l.prototype=null;}return i};});var Bc=P((mee,PS)=>{var Hq=IS();PS.exports=Function.prototype.bind||Hq;});var DS=P((yee,NS)=>{var Wq=Function.prototype.call,Kq=Object.prototype.hasOwnProperty,zq=Bc();NS.exports=zq.call(Wq,Kq);});var qn=P((vee,MS)=>{var ut,Ca=SyntaxError,BS=Function,wa=TypeError,rp=function(e){try{return BS('"use strict"; return ('+e+").constructor;")()}catch{}},Ds=Object.getOwnPropertyDescriptor;var np=function(){throw new wa},Gq=Ds?function(){try{return np}catch{try{return Ds(arguments,"callee").get}catch{return np}}}():np,Sa=tp()(),Yq=TS()(),or=Object.getPrototypeOf||(Yq?function(e){return e.__proto__}:null),Ea={},Qq=typeof Uint8Array>"u"||!or?ut:or(Uint8Array),ks={"%AggregateError%":typeof AggregateError>"u"?ut:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ut:ArrayBuffer,"%ArrayIteratorPrototype%":Sa&&or?or([][Symbol.iterator]()):ut,"%AsyncFromSyncIteratorPrototype%":ut,"%AsyncFunction%":Ea,"%AsyncGenerator%":Ea,"%AsyncGeneratorFunction%":Ea,"%AsyncIteratorPrototype%":Ea,"%Atomics%":typeof Atomics>"u"?ut:Atomics,"%BigInt%":typeof BigInt>"u"?ut:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ut:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ut:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ut:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?ut:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ut:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ut:FinalizationRegistry,"%Function%":BS,"%GeneratorFunction%":Ea,"%Int8Array%":typeof Int8Array>"u"?ut:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ut:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ut:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Sa&&or?or(or([][Symbol.iterator]())):ut,"%JSON%":typeof JSON=="object"?JSON:ut,"%Map%":typeof Map>"u"?ut:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Sa||!or?ut:or(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ut:Promise,"%Proxy%":typeof Proxy>"u"?ut:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?ut:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ut:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Sa||!or?ut:or(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ut:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Sa&&or?or(""[Symbol.iterator]()):ut,"%Symbol%":Sa?Symbol:ut,"%SyntaxError%":Ca,"%ThrowTypeError%":Gq,"%TypedArray%":Qq,"%TypeError%":wa,"%Uint8Array%":typeof Uint8Array>"u"?ut:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ut:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ut:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ut:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?ut:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ut:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ut:WeakSet};var Zq=function e(t){var r;if(t==="%AsyncFunction%")r=rp("async function () {}");else if(t==="%GeneratorFunction%")r=rp("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=rp("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype);}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&or&&(r=or(i.prototype));}return ks[t]=r,r},OS={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},$o=Bc(),Fc=DS(),Xq=$o.call(Function.call,Array.prototype.concat),Jq=$o.call(Function.apply,Array.prototype.splice),LS=$o.call(Function.call,String.prototype.replace),Mc=$o.call(Function.call,String.prototype.slice),e4=$o.call(Function.call,RegExp.prototype.exec),t4=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,r4=/\\(\\)?/g,n4=function(t){var r=Mc(t,0,1),n=Mc(t,-1);if(r==="%"&&n!=="%")throw new Ca("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ca("invalid intrinsic syntax, expected opening `%`");var i=[];return LS(t,t4,function(s,a,o,c){i[i.length]=o?LS(c,r4,"$1"):a||s;}),i},i4=function(t,r){var n=t,i;if(Fc(OS,n)&&(i=OS[n],n="%"+i[0]+"%"),Fc(ks,n)){var s=ks[n];if(s===Ea&&(s=Zq(n)),typeof s>"u"&&!r)throw new wa("intrinsic "+t+" exists, but is not available. Please file an issue!");return {alias:i,name:n,value:s}}throw new Ca("intrinsic "+t+" does not exist!")};MS.exports=function(t,r){if(typeof t!="string"||t.length===0)throw new wa("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new wa('"allowMissing" argument must be a boolean');if(e4(/^%?[^%]*%?$/,t)===null)throw new Ca("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=n4(t),i=n.length>0?n[0]:"",s=i4("%"+i+"%",r),a=s.name,o=s.value,c=!1,l=s.alias;l&&(i=l[0],Jq(n,Xq([0,1],l)));for(var u=1,f=!0;u<n.length;u+=1){var h=n[u],p=Mc(h,0,1),m=Mc(h,-1);if((p==='"'||p==="'"||p==="`"||m==='"'||m==="'"||m==="`")&&p!==m)throw new Ca("property names with quotes must have matching quotes");if((h==="constructor"||!f)&&(c=!0),i+="."+h,a="%"+i+"%",Fc(ks,a))o=ks[a];else if(o!=null){if(!(h in o)){if(!r)throw new wa("base intrinsic for "+t+" exists, but the property is not available.");return}if(Ds&&u+1>=n.length){var _=Ds(o,h);f=!!_,f&&"get"in _&&!("originalValue"in _.get)?o=_.get:o=o[h];}else f=Fc(o,h),o=o[h];f&&!c&&(ks[a]=o);}}return o};});var Vo=P((_ee,qS)=>{var s4=qn(),ip=s4("%Object.defineProperty%",!0),sp=function(){if(ip)try{return ip({},"a",{value:1}),!0}catch{return !1}return !1};sp.hasArrayLengthDefineBug=function(){if(!sp())return null;try{return ip([],"length",{value:1}).length!==1}catch{return !0}};qS.exports=sp;});var Uc=P((bee,US)=>{var a4=qn(),qc=a4("%Object.getOwnPropertyDescriptor%",!0);if(qc)try{qc([],"length");}catch{qc=null;}US.exports=qc;});var jc=P((See,$S)=>{var o4=Vo()(),ap=qn(),Ho=o4&&ap("%Object.defineProperty%",!0);if(Ho)try{Ho({},"a",{value:1});}catch{Ho=!1;}var u4=ap("%SyntaxError%"),xa=ap("%TypeError%"),jS=Uc();$S.exports=function(t,r,n){if(!t||typeof t!="object"&&typeof t!="function")throw new xa("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new xa("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new xa("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new xa("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new xa("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new xa("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,o=arguments.length>6?arguments[6]:!1,c=!!jS&&jS(t,r);if(Ho)Ho(t,r,{configurable:a===null&&c?c.configurable:!a,enumerable:i===null&&c?c.enumerable:!i,value:n,writable:s===null&&c?c.writable:!s});else if(o||!i&&!s&&!a)t[r]=n;else throw new u4("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")};});var $i=P((Eee,KS)=>{var c4=Oc(),l4=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",f4=Object.prototype.toString,d4=Array.prototype.concat,VS=jc(),h4=function(e){return typeof e=="function"&&f4.call(e)==="[object Function]"},HS=Vo()(),p4=function(e,t,r,n){if(t in e){if(n===!0){if(e[t]===r)return}else if(!h4(n)||!n())return}HS?VS(e,t,r,!0):VS(e,t,r);},WS=function(e,t){var r=arguments.length>2?arguments[2]:{},n=c4(t);l4&&(n=d4.call(n,Object.getOwnPropertySymbols(t)));for(var i=0;i<n.length;i+=1)p4(e,n[i],t[n[i]],r[n[i]]);};WS.supportsDescriptors=!!HS;KS.exports=WS;});var XS=P((wee,ZS)=>{var QS=qn(),zS=jc(),g4=Vo()(),GS=Uc(),YS=QS("%TypeError%"),m4=QS("%Math.floor%");ZS.exports=function(t,r){if(typeof t!="function")throw new YS("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||m4(r)!==r)throw new YS("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,s=!0;if("length"in t&&GS){var a=GS(t,"length");a&&!a.configurable&&(i=!1),a&&!a.writable&&(s=!1);}return (i||s||!n)&&(g4?zS(t,"length",r,!0,!0):zS(t,"length",r)),t};});var Os=P((Cee,$c)=>{var op=Bc(),Ta=qn(),y4=XS(),v4=Ta("%TypeError%"),eE=Ta("%Function.prototype.apply%"),tE=Ta("%Function.prototype.call%"),rE=Ta("%Reflect.apply%",!0)||op.call(tE,eE),Wo=Ta("%Object.defineProperty%",!0),_4=Ta("%Math.max%");if(Wo)try{Wo({},"a",{value:1});}catch{Wo=null;}$c.exports=function(t){if(typeof t!="function")throw new v4("a function is required");var r=rE(op,tE,arguments);return y4(r,1+_4(0,t.length-(arguments.length-1)),!0)};var JS=function(){return rE(op,eE,arguments)};Wo?Wo($c.exports,"apply",{value:JS}):$c.exports.apply=JS;});var En=P((xee,sE)=>{var nE=qn(),iE=Os(),b4=iE(nE("String.prototype.indexOf"));sE.exports=function(t,r){var n=nE(t,!!r);return typeof n=="function"&&b4(t,".prototype.")>-1?iE(n):n};});var up=P((Tee,lE)=>{var S4=Oc(),uE=Lc()(),cE=En(),aE=Object,E4=cE("Array.prototype.push"),oE=cE("Object.prototype.propertyIsEnumerable"),w4=uE?Object.getOwnPropertySymbols:null;lE.exports=function(t,r){if(t==null)throw new TypeError("target must be an object");var n=aE(t);if(arguments.length===1)return n;for(var i=1;i<arguments.length;++i){var s=aE(arguments[i]),a=S4(s),o=uE&&(Object.getOwnPropertySymbols||w4);if(o)for(var c=o(s),l=0;l<c.length;++l){var u=c[l];oE(s,u)&&E4(a,u);}for(var f=0;f<a.length;++f){var h=a[f];if(oE(s,h)){var p=s[h];n[h]=p;}}}return n};});var lp=P((Aee,fE)=>{var cp=up(),C4=function(){if(!Object.assign)return !1;for(var e="abcdefghijklmnopqrst",t=e.split(""),r={},n=0;n<t.length;++n)r[t[n]]=t[n];var i=Object.assign({},r),s="";for(var a in i)s+=a;return e!==s},x4=function(){if(!Object.assign||!Object.preventExtensions)return !1;var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy");}catch{return e[1]==="y"}return !1};fE.exports=function(){return !Object.assign||C4()||x4()?cp:Object.assign};});var hE=P((Ree,dE)=>{var T4=$i(),A4=lp();dE.exports=function(){var t=A4();return T4(Object,{assign:t},{assign:function(){return Object.assign!==t}}),t};});var yE=P((Iee,mE)=>{var R4=$i(),I4=Os(),P4=up(),pE=lp(),N4=hE(),D4=I4.apply(pE()),gE=function(t,r){return D4(Object,arguments)};R4(gE,{getPolyfill:pE,implementation:P4,shim:N4});mE.exports=gE;});var _E=P((Pee,vE)=>{var zo=function(){return typeof function(){}.name=="string"},Ko=Object.getOwnPropertyDescriptor;zo.functionsHaveConfigurableNames=function(){if(!zo()||!Ko)return !1;var t=Ko(function(){},"name");return !!t&&!!t.configurable};var k4=Function.prototype.bind;zo.boundFunctionsHaveNames=function(){return zo()&&typeof k4=="function"&&function(){}.bind().name!==""};vE.exports=zo;});var EE=P((Nee,SE)=>{var bE=jc(),O4=Vo()(),L4=_E().functionsHaveConfigurableNames(),B4=TypeError;SE.exports=function(t,r){if(typeof t!="function")throw new B4("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return (!n||L4)&&(O4?bE(t,"name",r,!0,!0):bE(t,"name",r)),t};});var fp=P((Dee,wE)=>{var F4=EE(),M4=Object,q4=TypeError;wE.exports=F4(function(){if(this!=null&&this!==M4(this))throw new q4("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0);});var dp=P((kee,CE)=>{var U4=fp(),j4=$i().supportsDescriptors,$4=Object.getOwnPropertyDescriptor;CE.exports=function(){if(j4&&/a/mig.flags==="gim"){var t=$4(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var r="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){r+="d";}}),Object.defineProperty(n,"sticky",{get:function(){r+="y";}}),r==="dy")return t.get}}return U4};});var AE=P((Oee,TE)=>{var V4=$i().supportsDescriptors,H4=dp(),W4=Object.getOwnPropertyDescriptor,K4=Object.defineProperty,z4=TypeError,xE=Object.getPrototypeOf,G4=/a/;TE.exports=function(){if(!V4||!xE)throw new z4("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=H4(),r=xE(G4),n=W4(r,"flags");return (!n||n.get!==t)&&K4(r,"flags",{configurable:!0,enumerable:!1,get:t}),t};});var NE=P((Lee,PE)=>{var Y4=$i(),Q4=Os(),Z4=fp(),RE=dp(),X4=AE(),IE=Q4(RE());Y4(IE,{getPolyfill:RE,implementation:Z4,shim:X4});PE.exports=IE;});var OE=P((Bee,kE)=>{var DE=Symbol.iterator;kE.exports=function(t){if(t!=null&&typeof t[DE]<"u")return t[DE]()};});var BE=P((Fee,LE)=>{LE.exports=he("util").inspect;});var rw=P((Mee,tw)=>{var Ep=typeof Map=="function"&&Map.prototype,hp=Object.getOwnPropertyDescriptor&&Ep?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Hc=Ep&&hp&&typeof hp.get=="function"?hp.get:null,FE=Ep&&Map.prototype.forEach,wp=typeof Set=="function"&&Set.prototype,pp=Object.getOwnPropertyDescriptor&&wp?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Wc=wp&&pp&&typeof pp.get=="function"?pp.get:null,ME=wp&&Set.prototype.forEach,J4=typeof WeakMap=="function"&&WeakMap.prototype,Yo=J4?WeakMap.prototype.has:null,e3=typeof WeakSet=="function"&&WeakSet.prototype,Qo=e3?WeakSet.prototype.has:null,t3=typeof WeakRef=="function"&&WeakRef.prototype,qE=t3?WeakRef.prototype.deref:null,r3=Boolean.prototype.valueOf,n3=Object.prototype.toString,i3=Function.prototype.toString,s3=String.prototype.match,Cp=String.prototype.slice,Hi=String.prototype.replace,a3=String.prototype.toUpperCase,UE=String.prototype.toLowerCase,YE=RegExp.prototype.test,jE=Array.prototype.concat,Jn=Array.prototype.join,o3=Array.prototype.slice,$E=Math.floor,yp=typeof BigInt=="function"?BigInt.prototype.valueOf:null,gp=Object.getOwnPropertySymbols,vp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Aa=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ar=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Aa||!0)?Symbol.toStringTag:null,QE=Object.prototype.propertyIsEnumerable,VE=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function HE(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||YE.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-$E(-e):$E(e);if(n!==e){var i=String(n),s=Cp.call(t,i.length+1);return Hi.call(i,r,"$&_")+"."+Hi.call(Hi.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Hi.call(t,r,"$&_")}var _p=BE(),WE=_p.custom,KE=XE(WE)?WE:null;tw.exports=function e(t,r,n,i){var s=r||{};if(Vi(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Vi(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=Vi(s,"customInspect")?s.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Vi(s,"indent")&&s.indent!==null&&s.indent!=="	"&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Vi(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var o=s.numericSeparator;if(typeof t>"u")return "undefined";if(t===null)return "null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return ew(t,s);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return o?HE(t,c):c}if(typeof t=="bigint"){var l=String(t)+"n";return o?HE(t,l):l}var u=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=u&&u>0&&typeof t=="object")return bp(t)?"[Array]":"[Object]";var f=x3(s,n);if(typeof i>"u")i=[];else if(JE(i,t)>=0)return "[Circular]";function h(me,Pe,W){if(Pe&&(i=o3.call(i),i.push(Pe)),W){var K={depth:s.depth};return Vi(s,"quoteStyle")&&(K.quoteStyle=s.quoteStyle),e(me,K,n+1,i)}return e(me,s,n+1,i)}if(typeof t=="function"&&!zE(t)){var p=m3(t),m=Vc(t,h);return "[Function"+(p?": "+p:" (anonymous)")+"]"+(m.length>0?" { "+Jn.call(m,", ")+" }":"")}if(XE(t)){var _=Aa?Hi.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):vp.call(t);return typeof t=="object"&&!Aa?Go(_):_}if(E3(t)){for(var E="<"+UE.call(String(t.nodeName)),w=t.attributes||[],y=0;y<w.length;y++)E+=" "+w[y].name+"="+ZE(u3(w[y].value),"double",s);return E+=">",t.childNodes&&t.childNodes.length&&(E+="..."),E+="</"+UE.call(String(t.nodeName))+">",E}if(bp(t)){if(t.length===0)return "[]";var b=Vc(t,h);return f&&!C3(b)?"["+Sp(b,f)+"]":"[ "+Jn.call(b,", ")+" ]"}if(l3(t)){var N=Vc(t,h);return !("cause"in Error.prototype)&&"cause"in t&&!QE.call(t,"cause")?"{ ["+String(t)+"] "+Jn.call(jE.call("[cause]: "+h(t.cause),N),", ")+" }":N.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Jn.call(N,", ")+" }"}if(typeof t=="object"&&a){if(KE&&typeof t[KE]=="function"&&_p)return _p(t,{depth:u-n});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(y3(t)){var L=[];return FE&&FE.call(t,function(me,Pe){L.push(h(Pe,t,!0)+" => "+h(me,t));}),GE("Map",Hc.call(t),L,f)}if(b3(t)){var V=[];return ME&&ME.call(t,function(me){V.push(h(me,t));}),GE("Set",Wc.call(t),V,f)}if(v3(t))return mp("WeakMap");if(S3(t))return mp("WeakSet");if(_3(t))return mp("WeakRef");if(d3(t))return Go(h(Number(t)));if(p3(t))return Go(h(yp.call(t)));if(h3(t))return Go(r3.call(t));if(f3(t))return Go(h(String(t)));if(typeof window<"u"&&t===window)return "{ [object Window] }";if(t===global)return "{ [object globalThis] }";if(!c3(t)&&!zE(t)){var X=Vc(t,h),z=VE?VE(t)===Object.prototype:t instanceof Object||t.constructor===Object,G=t instanceof Object?"":"null prototype",ee=!z&&Ar&&Object(t)===t&&Ar in t?Cp.call(Wi(t),8,-1):G?"Object":"",U=z||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",ie=U+(ee||G?"["+Jn.call(jE.call([],ee||[],G||[]),": ")+"] ":"");return X.length===0?ie+"{}":f?ie+"{"+Sp(X,f)+"}":ie+"{ "+Jn.call(X,", ")+" }"}return String(t)};function ZE(e,t,r){var n=(r.quoteStyle||t)==="double"?'"':"'";return n+e+n}function u3(e){return Hi.call(String(e),/"/g,"&quot;")}function bp(e){return Wi(e)==="[object Array]"&&(!Ar||!(typeof e=="object"&&Ar in e))}function c3(e){return Wi(e)==="[object Date]"&&(!Ar||!(typeof e=="object"&&Ar in e))}function zE(e){return Wi(e)==="[object RegExp]"&&(!Ar||!(typeof e=="object"&&Ar in e))}function l3(e){return Wi(e)==="[object Error]"&&(!Ar||!(typeof e=="object"&&Ar in e))}function f3(e){return Wi(e)==="[object String]"&&(!Ar||!(typeof e=="object"&&Ar in e))}function d3(e){return Wi(e)==="[object Number]"&&(!Ar||!(typeof e=="object"&&Ar in e))}function h3(e){return Wi(e)==="[object Boolean]"&&(!Ar||!(typeof e=="object"&&Ar in e))}function XE(e){if(Aa)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return !0;if(!e||typeof e!="object"||!vp)return !1;try{return vp.call(e),!0}catch{}return !1}function p3(e){if(!e||typeof e!="object"||!yp)return !1;try{return yp.call(e),!0}catch{}return !1}var g3=Object.prototype.hasOwnProperty||function(e){return e in this};function Vi(e,t){return g3.call(e,t)}function Wi(e){return n3.call(e)}function m3(e){if(e.name)return e.name;var t=s3.call(i3.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function JE(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return -1}function y3(e){if(!Hc||!e||typeof e!="object")return !1;try{Hc.call(e);try{Wc.call(e);}catch{return !0}return e instanceof Map}catch{}return !1}function v3(e){if(!Yo||!e||typeof e!="object")return !1;try{Yo.call(e,Yo);try{Qo.call(e,Qo);}catch{return !0}return e instanceof WeakMap}catch{}return !1}function _3(e){if(!qE||!e||typeof e!="object")return !1;try{return qE.call(e),!0}catch{}return !1}function b3(e){if(!Wc||!e||typeof e!="object")return !1;try{Wc.call(e);try{Hc.call(e);}catch{return !0}return e instanceof Set}catch{}return !1}function S3(e){if(!Qo||!e||typeof e!="object")return !1;try{Qo.call(e,Qo);try{Yo.call(e,Yo);}catch{return !0}return e instanceof WeakSet}catch{}return !1}function E3(e){return !e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function ew(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return ew(Cp.call(e,0,t.maxStringLength),t)+n}var i=Hi.call(Hi.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,w3);return ZE(i,"single",t)}function w3(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+a3.call(t.toString(16))}function Go(e){return "Object("+e+")"}function mp(e){return e+" { ? }"}function GE(e,t,r,n){var i=n?Sp(r,n):Jn.call(r,", ");return e+" ("+t+") {"+i+"}"}function C3(e){for(var t=0;t<e.length;t++)if(JE(e[t],`
`)>=0)return !1;return !0}function x3(e,t){var r;if(e.indent==="	")r="	";else if(typeof e.indent=="number"&&e.indent>0)r=Jn.call(Array(e.indent+1)," ");else return null;return {base:r,prev:Jn.call(Array(t+1),r)}}function Sp(e,t){if(e.length===0)return "";var r=`
`+t.prev+t.base;return r+Jn.call(e,","+r)+`
`+t.prev}function Vc(e,t){var r=bp(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=Vi(e,i)?t(e[i],e):"";}var s=typeof gp=="function"?gp(e):[],a;if(Aa){a={};for(var o=0;o<s.length;o++)a["$"+s[o]]=s[o];}for(var c in e)Vi(e,c)&&(r&&String(Number(c))===c&&c<e.length||Aa&&a["$"+c]instanceof Symbol||(YE.call(/[^\w$]/,c)?n.push(t(c,e)+": "+t(e[c],e)):n.push(c+": "+t(e[c],e))));if(typeof gp=="function")for(var l=0;l<s.length;l++)QE.call(e,s[l])&&n.push("["+t(s[l])+"]: "+t(e[s[l]],e));return n}});var iw=P((qee,nw)=>{var xp=qn(),Ra=En(),T3=rw(),A3=xp("%TypeError%"),Kc=xp("%WeakMap%",!0),zc=xp("%Map%",!0),R3=Ra("WeakMap.prototype.get",!0),I3=Ra("WeakMap.prototype.set",!0),P3=Ra("WeakMap.prototype.has",!0),N3=Ra("Map.prototype.get",!0),D3=Ra("Map.prototype.set",!0),k3=Ra("Map.prototype.has",!0),Tp=function(e,t){for(var r=e,n;(n=r.next)!==null;r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n},O3=function(e,t){var r=Tp(e,t);return r&&r.value},L3=function(e,t,r){var n=Tp(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r};},B3=function(e,t){return !!Tp(e,t)};nw.exports=function(){var t,r,n,i={assert:function(s){if(!i.has(s))throw new A3("Side channel does not contain "+T3(s))},get:function(s){if(Kc&&s&&(typeof s=="object"||typeof s=="function")){if(t)return R3(t,s)}else if(zc){if(r)return N3(r,s)}else if(n)return O3(n,s)},has:function(s){if(Kc&&s&&(typeof s=="object"||typeof s=="function")){if(t)return P3(t,s)}else if(zc){if(r)return k3(r,s)}else if(n)return B3(n,s);return !1},set:function(s,a){Kc&&s&&(typeof s=="object"||typeof s=="function")?(t||(t=new Kc),I3(t,s,a)):zc?(r||(r=new zc),D3(r,s,a)):(n||(n={key:{},next:null}),L3(n,s,a));}};return i};});var Ap=P((Uee,aw)=>{var sw=function(e){return e!==e};aw.exports=function(t,r){return t===0&&r===0?1/t===1/r:!!(t===r||sw(t)&&sw(r))};});var Rp=P((jee,ow)=>{var F3=Ap();ow.exports=function(){return typeof Object.is=="function"?Object.is:F3};});var cw=P(($ee,uw)=>{var M3=Rp(),q3=$i();uw.exports=function(){var t=M3();return q3(Object,{is:t},{is:function(){return Object.is!==t}}),t};});var hw=P((Vee,dw)=>{var U3=$i(),j3=Os(),$3=Ap(),lw=Rp(),V3=cw(),fw=j3(lw(),Object);U3(fw,{getPolyfill:lw,implementation:$3,shim:V3});dw.exports=fw;});var Ki=P((Hee,pw)=>{var H3=Lc();pw.exports=function(){return H3()&&!!Symbol.toStringTag};});var yw=P((Wee,mw)=>{var W3=Ki()(),K3=En(),Ip=K3("Object.prototype.toString"),Gc=function(t){return W3&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:Ip(t)==="[object Arguments]"},gw=function(t){return Gc(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Ip(t)!=="[object Array]"&&Ip(t.callee)==="[object Function]"},z3=function(){return Gc(arguments)}();Gc.isLegacyArguments=gw;mw.exports=z3?Gc:gw;});var _w=P((Kee,vw)=>{var G3={}.toString;vw.exports=Array.isArray||function(e){return G3.call(e)=="[object Array]"};});var ww=P((zee,Ew)=>{var Sw=Function.prototype.toString,Ia=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Np,Yc;if(typeof Ia=="function"&&typeof Object.defineProperty=="function")try{Np=Object.defineProperty({},"length",{get:function(){throw Yc}}),Yc={},Ia(function(){throw 42},null,Np);}catch(e){e!==Yc&&(Ia=null);}else Ia=null;var Y3=/^\s*class\b/,Dp=function(t){try{var r=Sw.call(t);return Y3.test(r)}catch{return !1}},Pp=function(t){try{return Dp(t)?!1:(Sw.call(t),!0)}catch{return !1}},Qc=Object.prototype.toString,Q3="[object Object]",Z3="[object Function]",X3="[object GeneratorFunction]",J3="[object HTMLAllCollection]",e8="[object HTML document.all class]",t8="[object HTMLCollection]",r8=typeof Symbol=="function"&&!!Symbol.toStringTag,n8=!(0 in[,]),kp=function(){return !1};typeof document=="object"&&(bw=document.all,Qc.call(bw)===Qc.call(document.all)&&(kp=function(t){if((n8||!t)&&(typeof t>"u"||typeof t=="object"))try{var r=Qc.call(t);return (r===J3||r===e8||r===t8||r===Q3)&&t("")==null}catch{}return !1}));var bw;Ew.exports=Ia?function(t){if(kp(t))return !0;if(!t||typeof t!="function"&&typeof t!="object")return !1;try{Ia(t,null,Np);}catch(r){if(r!==Yc)return !1}return !Dp(t)&&Pp(t)}:function(t){if(kp(t))return !0;if(!t||typeof t!="function"&&typeof t!="object")return !1;if(r8)return Pp(t);if(Dp(t))return !1;var r=Qc.call(t);return r!==Z3&&r!==X3&&!/^\[object HTML/.test(r)?!1:Pp(t)};});var Tw=P((Gee,xw)=>{var i8=ww(),s8=Object.prototype.toString,Cw=Object.prototype.hasOwnProperty,a8=function(t,r,n){for(var i=0,s=t.length;i<s;i++)Cw.call(t,i)&&(n==null?r(t[i],i,t):r.call(n,t[i],i,t));},o8=function(t,r,n){for(var i=0,s=t.length;i<s;i++)n==null?r(t.charAt(i),i,t):r.call(n,t.charAt(i),i,t);},u8=function(t,r,n){for(var i in t)Cw.call(t,i)&&(n==null?r(t[i],i,t):r.call(n,t[i],i,t));},c8=function(t,r,n){if(!i8(r))throw new TypeError("iterator must be a function");var i;arguments.length>=3&&(i=n),s8.call(t)==="[object Array]"?a8(t,r,i):typeof t=="string"?o8(t,r,i):u8(t,r,i);};xw.exports=c8;});var Rw=P((Yee,Aw)=>{var Op=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],l8=typeof globalThis>"u"?global:globalThis;Aw.exports=function(){for(var t=[],r=0;r<Op.length;r++)typeof l8[Op[r]]=="function"&&(t[t.length]=Op[r]);return t};});var qp=P((Qee,Dw)=>{var Xc=Tw(),f8=Rw(),Iw=Os(),Fp=En(),Zc=Uc(),d8=Fp("Object.prototype.toString"),Nw=Ki()(),Pw=typeof globalThis>"u"?global:globalThis,Bp=f8(),Mp=Fp("String.prototype.slice"),Lp=Object.getPrototypeOf,h8=Fp("Array.prototype.indexOf",!0)||function(t,r){for(var n=0;n<t.length;n+=1)if(t[n]===r)return n;return -1},Jc={__proto__:null};Nw&&Zc&&Lp?Xc(Bp,function(e){var t=new Pw[e];if(Symbol.toStringTag in t){var r=Lp(t),n=Zc(r,Symbol.toStringTag);if(!n){var i=Lp(r);n=Zc(i,Symbol.toStringTag);}Jc["$"+e]=Iw(n.get);}}):Xc(Bp,function(e){var t=new Pw[e],r=t.slice||t.set;r&&(Jc["$"+e]=Iw(r));});var p8=function(t){var r=!1;return Xc(Jc,function(n,i){if(!r)try{"$"+n(t)===i&&(r=Mp(i,1));}catch{}}),r},g8=function(t){var r=!1;return Xc(Jc,function(n,i){if(!r)try{n(t),r=Mp(i,1);}catch{}}),r};Dw.exports=function(t){if(!t||typeof t!="object")return !1;if(!Nw){var r=Mp(d8(t),8,-1);return h8(Bp,r)>-1?r:r!=="Object"?!1:g8(t)}return Zc?p8(t):null};});var Ow=P((Zee,kw)=>{var m8=qp();kw.exports=function(t){return !!m8(t)};});var Up=P((Xee,Uw)=>{var y8=Os(),v8=En(),qw=qn(),_8=Ow(),Lw=qw("ArrayBuffer",!0),Bw=qw("Float32Array",!0),el=v8("ArrayBuffer.prototype.byteLength",!0),Fw=Lw&&!el&&new Lw().slice,Mw=Fw&&y8(Fw);Uw.exports=el||Mw?function(t){if(!t||typeof t!="object")return !1;try{return el?el(t):Mw(t,0),!0}catch{return !1}}:Bw?function(t){try{return new Bw(t).buffer===t&&!_8(t)}catch(r){return typeof t=="object"&&r.name==="RangeError"}}:function(t){return !1};});var $w=P((Jee,jw)=>{var b8=Date.prototype.getDay,S8=function(t){try{return b8.call(t),!0}catch{return !1}},E8=Object.prototype.toString,w8="[object Date]",C8=Ki()();jw.exports=function(t){return typeof t!="object"||t===null?!1:C8?S8(t):E8.call(t)===w8};});var zw=P((ete,Kw)=>{var jp=En(),Vw=Ki()(),Hw,Ww,$p,Vp;Vw&&(Hw=jp("Object.prototype.hasOwnProperty"),Ww=jp("RegExp.prototype.exec"),$p={},tl=function(){throw $p},Vp={toString:tl,valueOf:tl},typeof Symbol.toPrimitive=="symbol"&&(Vp[Symbol.toPrimitive]=tl));var tl,x8=jp("Object.prototype.toString"),T8=Object.getOwnPropertyDescriptor,A8="[object RegExp]";Kw.exports=Vw?function(t){if(!t||typeof t!="object")return !1;var r=T8(t,"lastIndex"),n=r&&Hw(r,"value");if(!n)return !1;try{Ww(t,Vp);}catch(i){return i===$p}}:function(t){return !t||typeof t!="object"&&typeof t!="function"?!1:x8(t)===A8};});var Qw=P((tte,Yw)=>{var R8=En(),Gw=R8("SharedArrayBuffer.prototype.byteLength",!0);Yw.exports=Gw?function(t){if(!t||typeof t!="object")return !1;try{return Gw(t),!0}catch{return !1}}:function(t){return !1};});var Xw=P((rte,Zw)=>{var I8=String.prototype.valueOf,P8=function(t){try{return I8.call(t),!0}catch{return !1}},N8=Object.prototype.toString,D8="[object String]",k8=Ki()();Zw.exports=function(t){return typeof t=="string"?!0:typeof t!="object"?!1:k8?P8(t):N8.call(t)===D8};});var eC=P((nte,Jw)=>{var O8=Number.prototype.toString,L8=function(t){try{return O8.call(t),!0}catch{return !1}},B8=Object.prototype.toString,F8="[object Number]",M8=Ki()();Jw.exports=function(t){return typeof t=="number"?!0:typeof t!="object"?!1:M8?L8(t):B8.call(t)===F8};});var nC=P((ite,rC)=>{var tC=En(),q8=tC("Boolean.prototype.toString"),U8=tC("Object.prototype.toString"),j8=function(t){try{return q8(t),!0}catch{return !1}},$8="[object Boolean]",V8=Ki()();rC.exports=function(t){return typeof t=="boolean"?!0:t===null||typeof t!="object"?!1:V8&&Symbol.toStringTag in t?j8(t):U8(t)===$8};});var oC=P((ste,Hp)=>{var H8=Object.prototype.toString,W8=tp()();W8?(iC=Symbol.prototype.toString,sC=/^Symbol\(.*\)$/,aC=function(t){return typeof t.valueOf()!="symbol"?!1:sC.test(iC.call(t))},Hp.exports=function(t){if(typeof t=="symbol")return !0;if(H8.call(t)!=="[object Symbol]")return !1;try{return aC(t)}catch{return !1}}):Hp.exports=function(t){return !1};var iC,sC,aC;});var lC=P((ate,cC)=>{var uC=typeof BigInt<"u"&&BigInt;cC.exports=function(){return typeof uC=="function"&&typeof BigInt=="function"&&typeof uC(42)=="bigint"&&typeof BigInt(42)=="bigint"};});var hC=P((ote,Wp)=>{var K8=lC()();K8?(fC=BigInt.prototype.valueOf,dC=function(t){try{return fC.call(t),!0}catch{}return !1},Wp.exports=function(t){return t===null||typeof t>"u"||typeof t=="boolean"||typeof t=="string"||typeof t=="number"||typeof t=="symbol"||typeof t=="function"?!1:typeof t=="bigint"?!0:dC(t)}):Wp.exports=function(t){return !1};var fC,dC;});var gC=P((ute,pC)=>{var z8=Xw(),G8=eC(),Y8=nC(),Q8=oC(),Z8=hC();pC.exports=function(t){if(t==null||typeof t!="object"&&typeof t!="function")return null;if(z8(t))return "String";if(G8(t))return "Number";if(Y8(t))return "Boolean";if(Q8(t))return "Symbol";if(Z8(t))return "BigInt"};});var _C=P((cte,vC)=>{var Kp=typeof Map=="function"&&Map.prototype?Map:null,X8=typeof Set=="function"&&Set.prototype?Set:null,rl;Kp||(rl=function(t){return !1});var yC=Kp?Map.prototype.has:null,mC=X8?Set.prototype.has:null;!rl&&!yC&&(rl=function(t){return !1});vC.exports=rl||function(t){if(!t||typeof t!="object")return !1;try{if(yC.call(t),mC)try{mC.call(t);}catch{return !0}return t instanceof Kp}catch{}return !1};});var wC=P((lte,EC)=>{var J8=typeof Map=="function"&&Map.prototype?Map:null,zp=typeof Set=="function"&&Set.prototype?Set:null,nl;zp||(nl=function(t){return !1});var bC=J8?Map.prototype.has:null,SC=zp?Set.prototype.has:null;!nl&&!SC&&(nl=function(t){return !1});EC.exports=nl||function(t){if(!t||typeof t!="object")return !1;try{if(SC.call(t),bC)try{bC.call(t);}catch{return !0}return t instanceof zp}catch{}return !1};});var TC=P((fte,xC)=>{var il=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,CC=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,sl;il||(sl=function(t){return !1});var Yp=il?il.prototype.has:null,Gp=CC?CC.prototype.has:null;!sl&&!Yp&&(sl=function(t){return !1});xC.exports=sl||function(t){if(!t||typeof t!="object")return !1;try{if(Yp.call(t,Yp),Gp)try{Gp.call(t,Gp);}catch{return !0}return t instanceof il}catch{}return !1};});var RC=P((dte,Zp)=>{var eU=qn(),AC=En(),tU=eU("%WeakSet%",!0),Qp=AC("WeakSet.prototype.has",!0);Qp?(al=AC("WeakMap.prototype.has",!0),Zp.exports=function(t){if(!t||typeof t!="object")return !1;try{if(Qp(t,Qp),al)try{al(t,al);}catch{return !0}return t instanceof tU}catch{}return !1}):Zp.exports=function(t){return !1};var al;});var PC=P((hte,IC)=>{var rU=_C(),nU=wC(),iU=TC(),sU=RC();IC.exports=function(t){if(t&&typeof t=="object"){if(rU(t))return "Map";if(nU(t))return "Set";if(iU(t))return "WeakMap";if(sU(t))return "WeakSet"}return !1};});var kC=P((pte,DC)=>{var aU=En(),NC=aU("ArrayBuffer.prototype.byteLength",!0),oU=Up();DC.exports=function(t){return oU(t)?NC?NC(t):t.byteLength:NaN};});var Zo=P((gte,n1)=>{var e1=yE(),ei=En(),OC=NE(),uU=qn(),Pa=OE(),cU=iw(),LC=hw(),BC=yw(),FC=_w(),MC=Up(),qC=$w(),UC=zw(),jC=Qw(),$C=Oc(),VC=gC(),HC=PC(),WC=qp(),KC=kC(),zC=ei("SharedArrayBuffer.prototype.byteLength",!0),GC=ei("Date.prototype.getTime"),Xp=Object.getPrototypeOf,YC=ei("Object.prototype.toString"),ul=uU("%Set%",!0),Jp=ei("Map.prototype.has",!0),cl=ei("Map.prototype.get",!0),QC=ei("Map.prototype.size",!0),ll=ei("Set.prototype.add",!0),t1=ei("Set.prototype.delete",!0),fl=ei("Set.prototype.has",!0),ol=ei("Set.prototype.size",!0);function ZC(e,t,r,n){for(var i=Pa(e),s;(s=i.next())&&!s.done;)if(Un(t,s.value,r,n))return t1(e,s.value),!0;return !1}function r1(e){if(typeof e>"u")return null;if(typeof e!="object")return typeof e=="symbol"?!1:typeof e=="string"||typeof e=="number"?+e==+e:!0}function lU(e,t,r,n,i,s){var a=r1(r);if(a!=null)return a;var o=cl(t,a),c=e1({},i,{strict:!1});return typeof o>"u"&&!Jp(t,a)||!Un(n,o,c,s)?!1:!Jp(e,a)&&Un(n,o,c,s)}function fU(e,t,r){var n=r1(r);return n??(fl(t,n)&&!fl(e,n))}function XC(e,t,r,n,i,s){for(var a=Pa(e),o,c;(o=a.next())&&!o.done;)if(c=o.value,Un(r,c,i,s)&&Un(n,cl(t,c),i,s))return t1(e,c),!0;return !1}function Un(e,t,r,n){var i=r||{};if(i.strict?LC(e,t):e===t)return !0;var s=VC(e),a=VC(t);if(s!==a)return !1;if(!e||!t||typeof e!="object"&&typeof t!="object")return i.strict?LC(e,t):e==t;var o=n.has(e),c=n.has(t),l;if(o&&c){if(n.get(e)===n.get(t))return !0}else l={};return o||n.set(e,l),c||n.set(t,l),pU(e,t,i,n)}function JC(e){return !e||typeof e!="object"||typeof e.length!="number"||typeof e.copy!="function"||typeof e.slice!="function"||e.length>0&&typeof e[0]!="number"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function dU(e,t,r,n){if(ol(e)!==ol(t))return !1;for(var i=Pa(e),s=Pa(t),a,o,c;(a=i.next())&&!a.done;)if(a.value&&typeof a.value=="object")c||(c=new ul),ll(c,a.value);else if(!fl(t,a.value)){if(r.strict||!fU(e,t,a.value))return !1;c||(c=new ul),ll(c,a.value);}if(c){for(;(o=s.next())&&!o.done;)if(o.value&&typeof o.value=="object"){if(!ZC(c,o.value,r.strict,n))return !1}else if(!r.strict&&!fl(e,o.value)&&!ZC(c,o.value,r.strict,n))return !1;return ol(c)===0}return !0}function hU(e,t,r,n){if(QC(e)!==QC(t))return !1;for(var i=Pa(e),s=Pa(t),a,o,c,l,u,f;(a=i.next())&&!a.done;)if(l=a.value[0],u=a.value[1],l&&typeof l=="object")c||(c=new ul),ll(c,l);else if(f=cl(t,l),typeof f>"u"&&!Jp(t,l)||!Un(u,f,r,n)){if(r.strict||!lU(e,t,l,u,r,n))return !1;c||(c=new ul),ll(c,l);}if(c){for(;(o=s.next())&&!o.done;)if(l=o.value[0],f=o.value[1],l&&typeof l=="object"){if(!XC(c,e,l,f,r,n))return !1}else if(!r.strict&&(!e.has(l)||!Un(cl(e,l),f,r,n))&&!XC(c,e,l,f,e1({},r,{strict:!1}),n))return !1;return ol(c)===0}return !0}function pU(e,t,r,n){var i,s;if(typeof e!=typeof t||e==null||t==null||YC(e)!==YC(t)||BC(e)!==BC(t))return !1;var a=FC(e),o=FC(t);if(a!==o)return !1;var c=e instanceof Error,l=t instanceof Error;if(c!==l||(c||l)&&(e.name!==t.name||e.message!==t.message))return !1;var u=UC(e),f=UC(t);if(u!==f||(u||f)&&(e.source!==t.source||OC(e)!==OC(t)))return !1;var h=qC(e),p=qC(t);if(h!==p||(h||p)&&GC(e)!==GC(t)||r.strict&&Xp&&Xp(e)!==Xp(t))return !1;var m=WC(e),_=WC(t);if(m!==_)return !1;if(m||_){if(e.length!==t.length)return !1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return !1;return !0}var E=JC(e),w=JC(t);if(E!==w)return !1;if(E||w){if(e.length!==t.length)return !1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return !1;return !0}var y=MC(e),b=MC(t);if(y!==b)return !1;if(y||b)return KC(e)!==KC(t)?!1:typeof Uint8Array=="function"&&Un(new Uint8Array(e),new Uint8Array(t),r,n);var N=jC(e),L=jC(t);if(N!==L)return !1;if(N||L)return zC(e)!==zC(t)?!1:typeof Uint8Array=="function"&&Un(new Uint8Array(e),new Uint8Array(t),r,n);if(typeof e!=typeof t)return !1;var V=$C(e),X=$C(t);if(V.length!==X.length)return !1;for(V.sort(),X.sort(),i=V.length-1;i>=0;i--)if(V[i]!=X[i])return !1;for(i=V.length-1;i>=0;i--)if(s=V[i],!Un(e[s],t[s],r,n))return !1;var z=HC(e),G=HC(t);return z!==G?!1:z==="Set"||G==="Set"?dU(e,t,r,n):z==="Map"?hU(e,t,r,n):!0}n1.exports=function(t,r,n){return Un(t,r,n,cU())};});var ur=P(ig=>{ig.fromCallback=function(e){return Object.defineProperty(function(...t){if(typeof t[t.length-1]=="function")e.apply(this,t);else return new Promise((r,n)=>{t.push((i,s)=>i!=null?n(i):r(s)),e.apply(this,t);})},"name",{value:e.name})};ig.fromPromise=function(e){return Object.defineProperty(function(...t){let r=t[t.length-1];if(typeof r!="function")return e.apply(this,t);t.pop(),e.apply(this,t).then(n=>r(null,n),r);},"name",{value:e.name})};});var d1=P((Ste,f1)=>{var Gi=he("constants"),LU=process.cwd,gl=null,BU=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return gl||(gl=LU.call(process)),gl};try{process.cwd();}catch{}typeof process.chdir=="function"&&(sg=process.chdir,process.chdir=function(e){gl=null,sg.call(process,e);},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,sg));var sg;f1.exports=FU;function FU(e){Gi.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||r(e),e.chown=s(e.chown),e.fchown=s(e.fchown),e.lchown=s(e.lchown),e.chmod=n(e.chmod),e.fchmod=n(e.fchmod),e.lchmod=n(e.lchmod),e.chownSync=a(e.chownSync),e.fchownSync=a(e.fchownSync),e.lchownSync=a(e.lchownSync),e.chmodSync=i(e.chmodSync),e.fchmodSync=i(e.fchmodSync),e.lchmodSync=i(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=c(e.statSync),e.fstatSync=c(e.fstatSync),e.lstatSync=c(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(u,f,h){h&&process.nextTick(h);},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(u,f,h,p){p&&process.nextTick(p);},e.lchownSync=function(){}),BU==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:function(u){function f(h,p,m){var _=Date.now(),E=0;u(h,p,function w(y){if(y&&(y.code==="EACCES"||y.code==="EPERM"||y.code==="EBUSY")&&Date.now()-_<6e4){setTimeout(function(){e.stat(p,function(b,N){b&&b.code==="ENOENT"?u(h,p,w):m(y);});},E),E<100&&(E+=10);return}m&&m(y);});}return Object.setPrototypeOf&&Object.setPrototypeOf(f,u),f}(e.rename)),e.read=typeof e.read!="function"?e.read:function(u){function f(h,p,m,_,E,w){var y;if(w&&typeof w=="function"){var b=0;y=function(N,L,V){if(N&&N.code==="EAGAIN"&&b<10)return b++,u.call(e,h,p,m,_,E,y);w.apply(this,arguments);};}return u.call(e,h,p,m,_,E,y)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,u),f}(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:function(u){return function(f,h,p,m,_){for(var E=0;;)try{return u.call(e,f,h,p,m,_)}catch(w){if(w.code==="EAGAIN"&&E<10){E++;continue}throw w}}}(e.readSync);function t(u){u.lchmod=function(f,h,p){u.open(f,Gi.O_WRONLY|Gi.O_SYMLINK,h,function(m,_){if(m){p&&p(m);return}u.fchmod(_,h,function(E){u.close(_,function(w){p&&p(E||w);});});});},u.lchmodSync=function(f,h){var p=u.openSync(f,Gi.O_WRONLY|Gi.O_SYMLINK,h),m=!0,_;try{_=u.fchmodSync(p,h),m=!1;}finally{if(m)try{u.closeSync(p);}catch{}else u.closeSync(p);}return _};}function r(u){Gi.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(f,h,p,m){u.open(f,Gi.O_SYMLINK,function(_,E){if(_){m&&m(_);return}u.futimes(E,h,p,function(w){u.close(E,function(y){m&&m(w||y);});});});},u.lutimesSync=function(f,h,p){var m=u.openSync(f,Gi.O_SYMLINK),_,E=!0;try{_=u.futimesSync(m,h,p),E=!1;}finally{if(E)try{u.closeSync(m);}catch{}else u.closeSync(m);}return _}):u.futimes&&(u.lutimes=function(f,h,p,m){m&&process.nextTick(m);},u.lutimesSync=function(){});}function n(u){return u&&function(f,h,p){return u.call(e,f,h,function(m){l(m)&&(m=null),p&&p.apply(this,arguments);})}}function i(u){return u&&function(f,h){try{return u.call(e,f,h)}catch(p){if(!l(p))throw p}}}function s(u){return u&&function(f,h,p,m){return u.call(e,f,h,p,function(_){l(_)&&(_=null),m&&m.apply(this,arguments);})}}function a(u){return u&&function(f,h,p){try{return u.call(e,f,h,p)}catch(m){if(!l(m))throw m}}}function o(u){return u&&function(f,h,p){typeof h=="function"&&(p=h,h=null);function m(_,E){E&&(E.uid<0&&(E.uid+=4294967296),E.gid<0&&(E.gid+=4294967296)),p&&p.apply(this,arguments);}return h?u.call(e,f,h,m):u.call(e,f,m)}}function c(u){return u&&function(f,h){var p=h?u.call(e,f,h):u.call(e,f);return p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),p}}function l(u){if(!u||u.code==="ENOSYS")return !0;var f=!process.getuid||process.getuid()!==0;return !!(f&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var g1=P((Ete,p1)=>{var h1=he("stream").Stream;p1.exports=MU;function MU(e){return {ReadStream:t,WriteStream:r};function t(n,i){if(!(this instanceof t))return new t(n,i);h1.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,i=i||{};for(var a=Object.keys(i),o=0,c=a.length;o<c;o++){var l=a[o];this[l]=i[l];}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start;}if(this.fd!==null){process.nextTick(function(){s._read();});return}e.open(this.path,this.flags,this.mode,function(u,f){if(u){s.emit("error",u),s.readable=!1;return}s.fd=f,s.emit("open",f),s._read();});}function r(n,i){if(!(this instanceof r))return new r(n,i);h1.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var s=Object.keys(i),a=0,o=s.length;a<o;a++){var c=s[a];this[c]=i[c];}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start;}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush());}}});var y1=P((wte,m1)=>{m1.exports=UU;var qU=Object.getPrototypeOf||function(e){return e.__proto__};function UU(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:qU(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r));}),t}});var Da=P((Cte,ug)=>{var Gt=he("fs"),jU=d1(),$U=g1(),VU=y1(),ml=he("util"),Er,vl;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Er=Symbol.for("graceful-fs.queue"),vl=Symbol.for("graceful-fs.previous")):(Er="___graceful-fs.queue",vl="___graceful-fs.previous");function HU(){}function b1(e,t){Object.defineProperty(e,Er,{get:function(){return t}});}var Fs=HU;ml.debuglog?Fs=ml.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Fs=function(){var e=ml.format.apply(ml,arguments);e="GFS4: "+e.split(/\n/).join(`
GFS4: `),console.error(e);});Gt[Er]||(v1=global[Er]||[],b1(Gt,v1),Gt.close=function(e){function t(r,n){return e.call(Gt,r,function(i){i||_1(),typeof n=="function"&&n.apply(this,arguments);})}return Object.defineProperty(t,vl,{value:e}),t}(Gt.close),Gt.closeSync=function(e){function t(r){e.apply(Gt,arguments),_1();}return Object.defineProperty(t,vl,{value:e}),t}(Gt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Fs(Gt[Er]),he("assert").equal(Gt[Er].length,0);}));var v1;global[Er]||b1(global,Gt[Er]);ug.exports=ag(VU(Gt));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Gt.__patched&&(ug.exports=ag(Gt),Gt.__patched=!0);function ag(e){jU(e),e.gracefulify=ag,e.createReadStream=L,e.createWriteStream=V;var t=e.readFile;e.readFile=r;function r(G,ee,U){return typeof ee=="function"&&(U=ee,ee=null),ie(G,ee,U);function ie(me,Pe,W,K){return t(me,Pe,function(se){se&&(se.code==="EMFILE"||se.code==="ENFILE")?Na([ie,[me,Pe,W],se,K||Date.now(),Date.now()]):typeof W=="function"&&W.apply(this,arguments);})}}var n=e.writeFile;e.writeFile=i;function i(G,ee,U,ie){return typeof U=="function"&&(ie=U,U=null),me(G,ee,U,ie);function me(Pe,W,K,se,Ae){return n(Pe,W,K,function(Fe){Fe&&(Fe.code==="EMFILE"||Fe.code==="ENFILE")?Na([me,[Pe,W,K,se],Fe,Ae||Date.now(),Date.now()]):typeof se=="function"&&se.apply(this,arguments);})}}var s=e.appendFile;s&&(e.appendFile=a);function a(G,ee,U,ie){return typeof U=="function"&&(ie=U,U=null),me(G,ee,U,ie);function me(Pe,W,K,se,Ae){return s(Pe,W,K,function(Fe){Fe&&(Fe.code==="EMFILE"||Fe.code==="ENFILE")?Na([me,[Pe,W,K,se],Fe,Ae||Date.now(),Date.now()]):typeof se=="function"&&se.apply(this,arguments);})}}var o=e.copyFile;o&&(e.copyFile=c);function c(G,ee,U,ie){return typeof U=="function"&&(ie=U,U=0),me(G,ee,U,ie);function me(Pe,W,K,se,Ae){return o(Pe,W,K,function(Fe){Fe&&(Fe.code==="EMFILE"||Fe.code==="ENFILE")?Na([me,[Pe,W,K,se],Fe,Ae||Date.now(),Date.now()]):typeof se=="function"&&se.apply(this,arguments);})}}var l=e.readdir;e.readdir=f;var u=/^v[0-5]\./;function f(G,ee,U){typeof ee=="function"&&(U=ee,ee=null);var ie=u.test(process.version)?function(W,K,se,Ae){return l(W,me(W,K,se,Ae))}:function(W,K,se,Ae){return l(W,K,me(W,K,se,Ae))};return ie(G,ee,U);function me(Pe,W,K,se){return function(Ae,Fe){Ae&&(Ae.code==="EMFILE"||Ae.code==="ENFILE")?Na([ie,[Pe,W,K],Ae,se||Date.now(),Date.now()]):(Fe&&Fe.sort&&Fe.sort(),typeof K=="function"&&K.call(this,Ae,Fe));}}}if(process.version.substr(0,4)==="v0.8"){var h=$U(e);w=h.ReadStream,b=h.WriteStream;}var p=e.ReadStream;p&&(w.prototype=Object.create(p.prototype),w.prototype.open=y);var m=e.WriteStream;m&&(b.prototype=Object.create(m.prototype),b.prototype.open=N),Object.defineProperty(e,"ReadStream",{get:function(){return w},set:function(G){w=G;},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return b},set:function(G){b=G;},enumerable:!0,configurable:!0});var _=w;Object.defineProperty(e,"FileReadStream",{get:function(){return _},set:function(G){_=G;},enumerable:!0,configurable:!0});var E=b;Object.defineProperty(e,"FileWriteStream",{get:function(){return E},set:function(G){E=G;},enumerable:!0,configurable:!0});function w(G,ee){return this instanceof w?(p.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function y(){var G=this;z(G.path,G.flags,G.mode,function(ee,U){ee?(G.autoClose&&G.destroy(),G.emit("error",ee)):(G.fd=U,G.emit("open",U),G.read());});}function b(G,ee){return this instanceof b?(m.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}function N(){var G=this;z(G.path,G.flags,G.mode,function(ee,U){ee?(G.destroy(),G.emit("error",ee)):(G.fd=U,G.emit("open",U));});}function L(G,ee){return new e.ReadStream(G,ee)}function V(G,ee){return new e.WriteStream(G,ee)}var X=e.open;e.open=z;function z(G,ee,U,ie){return typeof U=="function"&&(ie=U,U=null),me(G,ee,U,ie);function me(Pe,W,K,se,Ae){return X(Pe,W,K,function(Fe,Ke){Fe&&(Fe.code==="EMFILE"||Fe.code==="ENFILE")?Na([me,[Pe,W,K,se],Fe,Ae||Date.now(),Date.now()]):typeof se=="function"&&se.apply(this,arguments);})}}return e}function Na(e){Fs("ENQUEUE",e[0].name,e[1]),Gt[Er].push(e),og();}var yl;function _1(){for(var e=Date.now(),t=0;t<Gt[Er].length;++t)Gt[Er][t].length>2&&(Gt[Er][t][3]=e,Gt[Er][t][4]=e);og();}function og(){if(clearTimeout(yl),yl=void 0,Gt[Er].length!==0){var e=Gt[Er].shift(),t=e[0],r=e[1],n=e[2],i=e[3],s=e[4];if(i===void 0)Fs("RETRY",t.name,r),t.apply(null,r);else if(Date.now()-i>=6e4){Fs("TIMEOUT",t.name,r);var a=r.pop();typeof a=="function"&&a.call(null,n);}else {var o=Date.now()-s,c=Math.max(s-i,1),l=Math.min(c*1.2,100);o>=l?(Fs("RETRY",t.name,r),t.apply(null,r.concat([i]))):Gt[Er].push(e);}yl===void 0&&(yl=setTimeout(og,0));}}});var Mr=P(Ei=>{var S1=ur().fromCallback,Fr=Da(),WU=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(e=>typeof Fr[e]=="function");Object.assign(Ei,Fr);WU.forEach(e=>{Ei[e]=S1(Fr[e]);});Ei.exists=function(e,t){return typeof t=="function"?Fr.exists(e,t):new Promise(r=>Fr.exists(e,r))};Ei.read=function(e,t,r,n,i,s){return typeof s=="function"?Fr.read(e,t,r,n,i,s):new Promise((a,o)=>{Fr.read(e,t,r,n,i,(c,l,u)=>{if(c)return o(c);a({bytesRead:l,buffer:u});});})};Ei.write=function(e,t,...r){return typeof r[r.length-1]=="function"?Fr.write(e,t,...r):new Promise((n,i)=>{Fr.write(e,t,...r,(s,a,o)=>{if(s)return i(s);n({bytesWritten:a,buffer:o});});})};Ei.readv=function(e,t,...r){return typeof r[r.length-1]=="function"?Fr.readv(e,t,...r):new Promise((n,i)=>{Fr.readv(e,t,...r,(s,a,o)=>{if(s)return i(s);n({bytesRead:a,buffers:o});});})};Ei.writev=function(e,t,...r){return typeof r[r.length-1]=="function"?Fr.writev(e,t,...r):new Promise((n,i)=>{Fr.writev(e,t,...r,(s,a,o)=>{if(s)return i(s);n({bytesWritten:a,buffers:o});});})};typeof Fr.realpath.native=="function"?Ei.realpath.native=S1(Fr.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003");});var w1=P((Tte,E1)=>{var KU=he("path");E1.exports.checkPath=function(t){if(process.platform==="win32"&&/[<>:"|?*]/.test(t.replace(KU.parse(t).root,""))){let n=new Error(`Path contains invalid characters: ${t}`);throw n.code="EINVAL",n}};});var A1=P((Ate,cg)=>{var C1=Mr(),{checkPath:x1}=w1(),T1=e=>{let t={mode:511};return typeof e=="number"?e:{...t,...e}.mode};cg.exports.makeDir=async(e,t)=>(x1(e),C1.mkdir(e,{mode:T1(t),recursive:!0}));cg.exports.makeDirSync=(e,t)=>(x1(e),C1.mkdirSync(e,{mode:T1(t),recursive:!0}));});var jn=P((Rte,R1)=>{var zU=ur().fromPromise,{makeDir:GU,makeDirSync:lg}=A1(),fg=zU(GU);R1.exports={mkdirs:fg,mkdirsSync:lg,mkdirp:fg,mkdirpSync:lg,ensureDir:fg,ensureDirSync:lg};});var Yi=P((Ite,P1)=>{var YU=ur().fromPromise,I1=Mr();function QU(e){return I1.access(e).then(()=>!0).catch(()=>!1)}P1.exports={pathExists:YU(QU),pathExistsSync:I1.existsSync};});var dg=P((Pte,N1)=>{var ka=Mr(),ZU=ur().fromPromise;async function XU(e,t,r){let n=await ka.open(e,"r+"),i=null;try{await ka.futimes(n,t,r);}finally{try{await ka.close(n);}catch(s){i=s;}}if(i)throw i}function JU(e,t,r){let n=ka.openSync(e,"r+");return ka.futimesSync(n,t,r),ka.closeSync(n)}N1.exports={utimesMillis:ZU(XU),utimesMillisSync:JU};});var Ms=P((Nte,L1)=>{var Oa=Mr(),cr=he("path"),D1=ur().fromPromise;function e6(e,t,r){let n=r.dereference?i=>Oa.stat(i,{bigint:!0}):i=>Oa.lstat(i,{bigint:!0});return Promise.all([n(e),n(t).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,s])=>({srcStat:i,destStat:s}))}function t6(e,t,r){let n,i=r.dereference?a=>Oa.statSync(a,{bigint:!0}):a=>Oa.lstatSync(a,{bigint:!0}),s=i(e);try{n=i(t);}catch(a){if(a.code==="ENOENT")return {srcStat:s,destStat:null};throw a}return {srcStat:s,destStat:n}}async function r6(e,t,r,n){let{srcStat:i,destStat:s}=await e6(e,t,n);if(s){if(Jo(i,s)){let a=cr.basename(e),o=cr.basename(t);if(r==="move"&&a!==o&&a.toLowerCase()===o.toLowerCase())return {srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(i.isDirectory()&&hg(e,t))throw new Error(_l(e,t,r));return {srcStat:i,destStat:s}}function n6(e,t,r,n){let{srcStat:i,destStat:s}=t6(e,t,n);if(s){if(Jo(i,s)){let a=cr.basename(e),o=cr.basename(t);if(r==="move"&&a!==o&&a.toLowerCase()===o.toLowerCase())return {srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(i.isDirectory()&&hg(e,t))throw new Error(_l(e,t,r));return {srcStat:i,destStat:s}}async function k1(e,t,r,n){let i=cr.resolve(cr.dirname(e)),s=cr.resolve(cr.dirname(r));if(s===i||s===cr.parse(s).root)return;let a;try{a=await Oa.stat(s,{bigint:!0});}catch(o){if(o.code==="ENOENT")return;throw o}if(Jo(t,a))throw new Error(_l(e,r,n));return k1(e,t,s,n)}function O1(e,t,r,n){let i=cr.resolve(cr.dirname(e)),s=cr.resolve(cr.dirname(r));if(s===i||s===cr.parse(s).root)return;let a;try{a=Oa.statSync(s,{bigint:!0});}catch(o){if(o.code==="ENOENT")return;throw o}if(Jo(t,a))throw new Error(_l(e,r,n));return O1(e,t,s,n)}function Jo(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function hg(e,t){let r=cr.resolve(e).split(cr.sep).filter(i=>i),n=cr.resolve(t).split(cr.sep).filter(i=>i);return r.every((i,s)=>n[s]===i)}function _l(e,t,r){return `Cannot ${r} '${e}' to a subdirectory of itself, '${t}'.`}L1.exports={checkPaths:D1(r6),checkPathsSync:n6,checkParentPaths:D1(k1),checkParentPathsSync:O1,isSrcSubdir:hg,areIdentical:Jo};});var U1=P((Dte,q1)=>{var Rr=Mr(),eu=he("path"),{mkdirs:i6}=jn(),{pathExists:s6}=Yi(),{utimesMillis:a6}=dg(),tu=Ms();async function o6(e,t,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:i}=await tu.checkPaths(e,t,"copy",r);if(await tu.checkParentPaths(e,n,t,"copy"),!await F1(e,t,r))return;let a=eu.dirname(t);await s6(a)||await i6(a),await M1(i,e,t,r);}async function F1(e,t,r){return r.filter?r.filter(e,t):!0}async function M1(e,t,r,n){let s=await(n.dereference?Rr.stat:Rr.lstat)(t);if(s.isDirectory())return f6(s,e,t,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return u6(s,e,t,r,n);if(s.isSymbolicLink())return d6(e,t,r,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${t}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${t}`):new Error(`Unknown file: ${t}`)}async function u6(e,t,r,n,i){if(!t)return B1(e,r,n,i);if(i.overwrite)return await Rr.unlink(n),B1(e,r,n,i);if(i.errorOnExist)throw new Error(`'${n}' already exists`)}async function B1(e,t,r,n){if(await Rr.copyFile(t,r),n.preserveTimestamps){c6(e.mode)&&await l6(r,e.mode);let i=await Rr.stat(t);await a6(r,i.atime,i.mtime);}return Rr.chmod(r,e.mode)}function c6(e){return (e&128)===0}function l6(e,t){return Rr.chmod(e,t|128)}async function f6(e,t,r,n,i){t||await Rr.mkdir(n);let s=await Rr.readdir(r);await Promise.all(s.map(async a=>{let o=eu.join(r,a),c=eu.join(n,a);if(!await F1(o,c,i))return;let{destStat:u}=await tu.checkPaths(o,c,"copy",i);return M1(u,o,c,i)})),t||await Rr.chmod(n,e.mode);}async function d6(e,t,r,n){let i=await Rr.readlink(t);if(n.dereference&&(i=eu.resolve(process.cwd(),i)),!e)return Rr.symlink(i,r);let s=null;try{s=await Rr.readlink(r);}catch(a){if(a.code==="EINVAL"||a.code==="UNKNOWN")return Rr.symlink(i,r);throw a}if(n.dereference&&(s=eu.resolve(process.cwd(),s)),tu.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(tu.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return await Rr.unlink(r),Rr.symlink(i,r)}q1.exports=o6;});var W1=P((kte,H1)=>{var qr=Da(),ru=he("path"),h6=jn().mkdirsSync,p6=dg().utimesMillisSync,nu=Ms();function g6(e,t,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:i}=nu.checkPathsSync(e,t,"copy",r);if(nu.checkParentPathsSync(e,n,t,"copy"),r.filter&&!r.filter(e,t))return;let s=ru.dirname(t);return qr.existsSync(s)||h6(s),j1(i,e,t,r)}function j1(e,t,r,n){let s=(n.dereference?qr.statSync:qr.lstatSync)(t);if(s.isDirectory())return E6(s,e,t,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return m6(s,e,t,r,n);if(s.isSymbolicLink())return x6(e,t,r,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${t}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${t}`):new Error(`Unknown file: ${t}`)}function m6(e,t,r,n,i){return t?y6(e,r,n,i):$1(e,r,n,i)}function y6(e,t,r,n){if(n.overwrite)return qr.unlinkSync(r),$1(e,t,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function $1(e,t,r,n){return qr.copyFileSync(t,r),n.preserveTimestamps&&v6(e.mode,t,r),pg(r,e.mode)}function v6(e,t,r){return _6(e)&&b6(r,e),S6(t,r)}function _6(e){return (e&128)===0}function b6(e,t){return pg(e,t|128)}function pg(e,t){return qr.chmodSync(e,t)}function S6(e,t){let r=qr.statSync(e);return p6(t,r.atime,r.mtime)}function E6(e,t,r,n,i){return t?V1(r,n,i):w6(e.mode,r,n,i)}function w6(e,t,r,n){return qr.mkdirSync(r),V1(t,r,n),pg(r,e)}function V1(e,t,r){qr.readdirSync(e).forEach(n=>C6(n,e,t,r));}function C6(e,t,r,n){let i=ru.join(t,e),s=ru.join(r,e);if(n.filter&&!n.filter(i,s))return;let{destStat:a}=nu.checkPathsSync(i,s,"copy",n);return j1(a,i,s,n)}function x6(e,t,r,n){let i=qr.readlinkSync(t);if(n.dereference&&(i=ru.resolve(process.cwd(),i)),e){let s;try{s=qr.readlinkSync(r);}catch(a){if(a.code==="EINVAL"||a.code==="UNKNOWN")return qr.symlinkSync(i,r);throw a}if(n.dereference&&(s=ru.resolve(process.cwd(),s)),nu.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(nu.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return T6(i,r)}else return qr.symlinkSync(i,r)}function T6(e,t){return qr.unlinkSync(t),qr.symlinkSync(e,t)}H1.exports=g6;});var bl=P((Ote,K1)=>{var A6=ur().fromPromise;K1.exports={copy:A6(U1()),copySync:W1()};});var iu=P((Lte,G1)=>{var z1=Da(),R6=ur().fromCallback;function I6(e,t){z1.rm(e,{recursive:!0,force:!0},t);}function P6(e){z1.rmSync(e,{recursive:!0,force:!0});}G1.exports={remove:R6(I6),removeSync:P6};});var rx=P((Bte,tx)=>{var N6=ur().fromPromise,Z1=Mr(),X1=he("path"),J1=jn(),ex=iu(),Y1=N6(async function(t){let r;try{r=await Z1.readdir(t);}catch{return J1.mkdirs(t)}return Promise.all(r.map(n=>ex.remove(X1.join(t,n))))});function Q1(e){let t;try{t=Z1.readdirSync(e);}catch{return J1.mkdirsSync(e)}t.forEach(r=>{r=X1.join(e,r),ex.removeSync(r);});}tx.exports={emptyDirSync:Q1,emptydirSync:Q1,emptyDir:Y1,emptydir:Y1};});var ax=P((Fte,sx)=>{var D6=ur().fromPromise,nx=he("path"),wi=Mr(),ix=jn();async function k6(e){let t;try{t=await wi.stat(e);}catch{}if(t&&t.isFile())return;let r=nx.dirname(e),n=null;try{n=await wi.stat(r);}catch(i){if(i.code==="ENOENT"){await ix.mkdirs(r),await wi.writeFile(e,"");return}else throw i}n.isDirectory()?await wi.writeFile(e,""):await wi.readdir(r);}function O6(e){let t;try{t=wi.statSync(e);}catch{}if(t&&t.isFile())return;let r=nx.dirname(e);try{wi.statSync(r).isDirectory()||wi.readdirSync(r);}catch(n){if(n&&n.code==="ENOENT")ix.mkdirsSync(r);else throw n}wi.writeFileSync(e,"");}sx.exports={createFile:D6(k6),createFileSync:O6};});var fx=P((Mte,lx)=>{var L6=ur().fromPromise,ox=he("path"),Qi=Mr(),ux=jn(),{pathExists:B6}=Yi(),{areIdentical:cx}=Ms();async function F6(e,t){let r;try{r=await Qi.lstat(t);}catch{}let n;try{n=await Qi.lstat(e);}catch(a){throw a.message=a.message.replace("lstat","ensureLink"),a}if(r&&cx(n,r))return;let i=ox.dirname(t);await B6(i)||await ux.mkdirs(i),await Qi.link(e,t);}function M6(e,t){let r;try{r=Qi.lstatSync(t);}catch{}try{let s=Qi.lstatSync(e);if(r&&cx(s,r))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=ox.dirname(t);return Qi.existsSync(n)||ux.mkdirsSync(n),Qi.linkSync(e,t)}lx.exports={createLink:L6(F6),createLinkSync:M6};});var hx=P((qte,dx)=>{var Zi=he("path"),su=Mr(),{pathExists:q6}=Yi(),U6=ur().fromPromise;async function j6(e,t){if(Zi.isAbsolute(e)){try{await su.lstat(e);}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return {toCwd:e,toDst:e}}let r=Zi.dirname(t),n=Zi.join(r,e);if(await q6(n))return {toCwd:n,toDst:e};try{await su.lstat(e);}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return {toCwd:e,toDst:Zi.relative(r,e)}}function $6(e,t){if(Zi.isAbsolute(e)){if(!su.existsSync(e))throw new Error("absolute srcpath does not exist");return {toCwd:e,toDst:e}}let r=Zi.dirname(t),n=Zi.join(r,e);if(su.existsSync(n))return {toCwd:n,toDst:e};if(!su.existsSync(e))throw new Error("relative srcpath does not exist");return {toCwd:e,toDst:Zi.relative(r,e)}}dx.exports={symlinkPaths:U6(j6),symlinkPathsSync:$6};});var mx=P((Ute,gx)=>{var px=Mr(),V6=ur().fromPromise;async function H6(e,t){if(t)return t;let r;try{r=await px.lstat(e);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}function W6(e,t){if(t)return t;let r;try{r=px.lstatSync(e);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}gx.exports={symlinkType:V6(H6),symlinkTypeSync:W6};});var bx=P((jte,_x)=>{var K6=ur().fromPromise,yx=he("path"),ti=Mr(),{mkdirs:z6,mkdirsSync:G6}=jn(),{symlinkPaths:Y6,symlinkPathsSync:Q6}=hx(),{symlinkType:Z6,symlinkTypeSync:X6}=mx(),{pathExists:J6}=Yi(),{areIdentical:vx}=Ms();async function e5(e,t,r){let n;try{n=await ti.lstat(t);}catch{}if(n&&n.isSymbolicLink()){let[o,c]=await Promise.all([ti.stat(e),ti.stat(t)]);if(vx(o,c))return}let i=await Y6(e,t);e=i.toDst;let s=await Z6(i.toCwd,r),a=yx.dirname(t);return await J6(a)||await z6(a),ti.symlink(e,t,s)}function t5(e,t,r){let n;try{n=ti.lstatSync(t);}catch{}if(n&&n.isSymbolicLink()){let o=ti.statSync(e),c=ti.statSync(t);if(vx(o,c))return}let i=Q6(e,t);e=i.toDst,r=X6(i.toCwd,r);let s=yx.dirname(t);return ti.existsSync(s)||G6(s),ti.symlinkSync(e,t,r)}_x.exports={createSymlink:K6(e5),createSymlinkSync:t5};});var Rx=P(($te,Ax)=>{var{createFile:Sx,createFileSync:Ex}=ax(),{createLink:wx,createLinkSync:Cx}=fx(),{createSymlink:xx,createSymlinkSync:Tx}=bx();Ax.exports={createFile:Sx,createFileSync:Ex,ensureFile:Sx,ensureFileSync:Ex,createLink:wx,createLinkSync:Cx,ensureLink:wx,ensureLinkSync:Cx,createSymlink:xx,createSymlinkSync:Tx,ensureSymlink:xx,ensureSymlinkSync:Tx};});var Sl=P((Vte,Ix)=>{function r5(e,{EOL:t=`
`,finalEOL:r=!0,replacer:n=null,spaces:i}={}){let s=r?t:"";return JSON.stringify(e,n,i).replace(/\n/g,t)+s}function n5(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}Ix.exports={stringify:r5,stripBom:n5};});var kx=P((Hte,Dx)=>{var La;try{La=Da();}catch{La=he("fs");}var El=ur(),{stringify:Px,stripBom:Nx}=Sl();async function i5(e,t={}){typeof t=="string"&&(t={encoding:t});let r=t.fs||La,n="throws"in t?t.throws:!0,i=await El.fromCallback(r.readFile)(e,t);i=Nx(i);let s;try{s=JSON.parse(i,t?t.reviver:null);}catch(a){if(n)throw a.message=`${e}: ${a.message}`,a;return null}return s}var s5=El.fromPromise(i5);function a5(e,t={}){typeof t=="string"&&(t={encoding:t});let r=t.fs||La,n="throws"in t?t.throws:!0;try{let i=r.readFileSync(e,t);return i=Nx(i),JSON.parse(i,t.reviver)}catch(i){if(n)throw i.message=`${e}: ${i.message}`,i;return null}}async function o5(e,t,r={}){let n=r.fs||La,i=Px(t,r);await El.fromCallback(n.writeFile)(e,i,r);}var u5=El.fromPromise(o5);function c5(e,t,r={}){let n=r.fs||La,i=Px(t,r);return n.writeFileSync(e,i,r)}var l5={readFile:s5,readFileSync:a5,writeFile:u5,writeFileSync:c5};Dx.exports=l5;});var Lx=P((Wte,Ox)=>{var wl=kx();Ox.exports={readJson:wl.readFile,readJsonSync:wl.readFileSync,writeJson:wl.writeFile,writeJsonSync:wl.writeFileSync};});var Cl=P((Kte,Mx)=>{var f5=ur().fromPromise,gg=Mr(),Bx=he("path"),Fx=jn(),d5=Yi().pathExists;async function h5(e,t,r="utf-8"){let n=Bx.dirname(e);return await d5(n)||await Fx.mkdirs(n),gg.writeFile(e,t,r)}function p5(e,...t){let r=Bx.dirname(e);gg.existsSync(r)||Fx.mkdirsSync(r),gg.writeFileSync(e,...t);}Mx.exports={outputFile:f5(h5),outputFileSync:p5};});var Ux=P((zte,qx)=>{var{stringify:g5}=Sl(),{outputFile:m5}=Cl();async function y5(e,t,r={}){let n=g5(t,r);await m5(e,n,r);}qx.exports=y5;});var $x=P((Gte,jx)=>{var{stringify:v5}=Sl(),{outputFileSync:_5}=Cl();function b5(e,t,r){let n=v5(t,r);_5(e,n,r);}jx.exports=b5;});var Hx=P((Yte,Vx)=>{var S5=ur().fromPromise,Ur=Lx();Ur.outputJson=S5(Ux());Ur.outputJsonSync=$x();Ur.outputJSON=Ur.outputJson;Ur.outputJSONSync=Ur.outputJsonSync;Ur.writeJSON=Ur.writeJson;Ur.writeJSONSync=Ur.writeJsonSync;Ur.readJSON=Ur.readJson;Ur.readJSONSync=Ur.readJsonSync;Vx.exports=Ur;});var Yx=P((Qte,Gx)=>{var E5=Mr(),Wx=he("path"),{copy:w5}=bl(),{remove:zx}=iu(),{mkdirp:C5}=jn(),{pathExists:x5}=Yi(),Kx=Ms();async function T5(e,t,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:s=!1}=await Kx.checkPaths(e,t,"move",r);await Kx.checkParentPaths(e,i,t,"move");let a=Wx.dirname(t);return Wx.parse(a).root!==a&&await C5(a),A5(e,t,n,s)}async function A5(e,t,r,n){if(!n){if(r)await zx(t);else if(await x5(t))throw new Error("dest already exists.")}try{await E5.rename(e,t);}catch(i){if(i.code!=="EXDEV")throw i;await R5(e,t,r);}}async function R5(e,t,r){return await w5(e,t,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),zx(e)}Gx.exports=T5;});var eT=P((Zte,Jx)=>{var Zx=Da(),yg=he("path"),I5=bl().copySync,Xx=iu().removeSync,P5=jn().mkdirpSync,Qx=Ms();function N5(e,t,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:s=!1}=Qx.checkPathsSync(e,t,"move",r);return Qx.checkParentPathsSync(e,i,t,"move"),D5(t)||P5(yg.dirname(t)),k5(e,t,n,s)}function D5(e){let t=yg.dirname(e);return yg.parse(t).root===t}function k5(e,t,r,n){if(n)return mg(e,t,r);if(r)return Xx(t),mg(e,t,r);if(Zx.existsSync(t))throw new Error("dest already exists.");return mg(e,t,r)}function mg(e,t,r){try{Zx.renameSync(e,t);}catch(n){if(n.code!=="EXDEV")throw n;return O5(e,t,r)}}function O5(e,t,r){return I5(e,t,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),Xx(e)}Jx.exports=N5;});var rT=P((Xte,tT)=>{var L5=ur().fromPromise;tT.exports={move:L5(Yx()),moveSync:eT()};});var xl=P((Jte,nT)=>{nT.exports={...Mr(),...bl(),...rx(),...Rx(),...Hx(),...jn(),...rT(),...Cl(),...Yi(),...iu()};});var au=P((ere,uT)=>{var B5=he("path"),ri="\\\\/",iT=`[^${ri}]`,Ci="\\.",F5="\\+",M5="\\?",Tl="\\/",q5="(?=.)",sT="[^/]",vg=`(?:${Tl}|$)`,aT=`(?:^|${Tl})`,_g=`${Ci}{1,2}${vg}`,U5=`(?!${Ci})`,j5=`(?!${aT}${_g})`,$5=`(?!${Ci}{0,1}${vg})`,V5=`(?!${_g})`,H5=`[^.${Tl}]`,W5=`${sT}*?`,oT={DOT_LITERAL:Ci,PLUS_LITERAL:F5,QMARK_LITERAL:M5,SLASH_LITERAL:Tl,ONE_CHAR:q5,QMARK:sT,END_ANCHOR:vg,DOTS_SLASH:_g,NO_DOT:U5,NO_DOTS:j5,NO_DOT_SLASH:$5,NO_DOTS_SLASH:V5,QMARK_NO_DOT:H5,STAR:W5,START_ANCHOR:aT},K5={...oT,SLASH_LITERAL:`[${ri}]`,QMARK:iT,STAR:`${iT}*?`,DOTS_SLASH:`${Ci}{1,2}(?:[${ri}]|$)`,NO_DOT:`(?!${Ci})`,NO_DOTS:`(?!(?:^|[${ri}])${Ci}{1,2}(?:[${ri}]|$))`,NO_DOT_SLASH:`(?!${Ci}{0,1}(?:[${ri}]|$))`,NO_DOTS_SLASH:`(?!${Ci}{1,2}(?:[${ri}]|$))`,QMARK_NO_DOT:`[^.${ri}]`,START_ANCHOR:`(?:^|[${ri}])`,END_ANCHOR:`(?:[${ri}]|$)`},z5={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"};uT.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:z5,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:{"***":"*","**/**":"**","**/**/**":"**"},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,SEP:B5.sep,extglobChars(e){return {"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?K5:oT}};});var Al=P(zr=>{var G5=he("path"),Y5=process.platform==="win32",{REGEX_BACKSLASH:Q5,REGEX_REMOVE_BACKSLASH:Z5,REGEX_SPECIAL_CHARS:X5,REGEX_SPECIAL_CHARS_GLOBAL:J5}=au();zr.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);zr.hasRegexChars=e=>X5.test(e);zr.isRegexChar=e=>e.length===1&&zr.hasRegexChars(e);zr.escapeRegex=e=>e.replace(J5,"\\$1");zr.toPosixSlashes=e=>e.replace(Q5,"/");zr.removeBackslashes=e=>e.replace(Z5,t=>t==="\\"?"":t);zr.supportsLookbehinds=()=>{let e=process.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10};zr.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:Y5===!0||G5.sep==="\\";zr.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);return n===-1?e:e[n-1]==="\\"?zr.escapeLast(e,t,n-1):`${e.slice(0,n)}\\${e.slice(n)}`};zr.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r};zr.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",s=`${n}(?:${e})${i}`;return t.negated===!0&&(s=`(?:^(?!${s}).*$)`),s};});var mT=P((rre,gT)=>{var cT=Al(),{CHAR_ASTERISK:bg,CHAR_AT:ej,CHAR_BACKWARD_SLASH:ou,CHAR_COMMA:tj,CHAR_DOT:Sg,CHAR_EXCLAMATION_MARK:Eg,CHAR_FORWARD_SLASH:pT,CHAR_LEFT_CURLY_BRACE:wg,CHAR_LEFT_PARENTHESES:Cg,CHAR_LEFT_SQUARE_BRACKET:rj,CHAR_PLUS:nj,CHAR_QUESTION_MARK:lT,CHAR_RIGHT_CURLY_BRACE:ij,CHAR_RIGHT_PARENTHESES:fT,CHAR_RIGHT_SQUARE_BRACKET:sj}=au(),dT=e=>e===pT||e===ou,hT=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1);},aj=(e,t)=>{let r=t||{},n=e.length-1,i=r.parts===!0||r.scanToEnd===!0,s=[],a=[],o=[],c=e,l=-1,u=0,f=0,h=!1,p=!1,m=!1,_=!1,E=!1,w=!1,y=!1,b=!1,N=!1,L=!1,V=0,X,z,G={value:"",depth:0,isGlob:!1},ee=()=>l>=n,U=()=>c.charCodeAt(l+1),ie=()=>(X=z,c.charCodeAt(++l));for(;l<n;){z=ie();let se;if(z===ou){y=G.backslashes=!0,z=ie(),z===wg&&(w=!0);continue}if(w===!0||z===wg){for(V++;ee()!==!0&&(z=ie());){if(z===ou){y=G.backslashes=!0,ie();continue}if(z===wg){V++;continue}if(w!==!0&&z===Sg&&(z=ie())===Sg){if(h=G.isBrace=!0,m=G.isGlob=!0,L=!0,i===!0)continue;break}if(w!==!0&&z===tj){if(h=G.isBrace=!0,m=G.isGlob=!0,L=!0,i===!0)continue;break}if(z===ij&&(V--,V===0)){w=!1,h=G.isBrace=!0,L=!0;break}}if(i===!0)continue;break}if(z===pT){if(s.push(l),a.push(G),G={value:"",depth:0,isGlob:!1},L===!0)continue;if(X===Sg&&l===u+1){u+=2;continue}f=l+1;continue}if(r.noext!==!0&&(z===nj||z===ej||z===bg||z===lT||z===Eg)===!0&&U()===Cg){if(m=G.isGlob=!0,_=G.isExtglob=!0,L=!0,z===Eg&&l===u&&(N=!0),i===!0){for(;ee()!==!0&&(z=ie());){if(z===ou){y=G.backslashes=!0,z=ie();continue}if(z===fT){m=G.isGlob=!0,L=!0;break}}continue}break}if(z===bg){if(X===bg&&(E=G.isGlobstar=!0),m=G.isGlob=!0,L=!0,i===!0)continue;break}if(z===lT){if(m=G.isGlob=!0,L=!0,i===!0)continue;break}if(z===rj){for(;ee()!==!0&&(se=ie());){if(se===ou){y=G.backslashes=!0,ie();continue}if(se===sj){p=G.isBracket=!0,m=G.isGlob=!0,L=!0;break}}if(i===!0)continue;break}if(r.nonegate!==!0&&z===Eg&&l===u){b=G.negated=!0,u++;continue}if(r.noparen!==!0&&z===Cg){if(m=G.isGlob=!0,i===!0){for(;ee()!==!0&&(z=ie());){if(z===Cg){y=G.backslashes=!0,z=ie();continue}if(z===fT){L=!0;break}}continue}break}if(m===!0){if(L=!0,i===!0)continue;break}}r.noext===!0&&(_=!1,m=!1);let me=c,Pe="",W="";u>0&&(Pe=c.slice(0,u),c=c.slice(u),f-=u),me&&m===!0&&f>0?(me=c.slice(0,f),W=c.slice(f)):m===!0?(me="",W=c):me=c,me&&me!==""&&me!=="/"&&me!==c&&dT(me.charCodeAt(me.length-1))&&(me=me.slice(0,-1)),r.unescape===!0&&(W&&(W=cT.removeBackslashes(W)),me&&y===!0&&(me=cT.removeBackslashes(me)));let K={prefix:Pe,input:e,start:u,base:me,glob:W,isBrace:h,isBracket:p,isGlob:m,isExtglob:_,isGlobstar:E,negated:b,negatedExtglob:N};if(r.tokens===!0&&(K.maxDepth=0,dT(z)||a.push(G),K.tokens=a),r.parts===!0||r.tokens===!0){let se;for(let Ae=0;Ae<s.length;Ae++){let Fe=se?se+1:u,Ke=s[Ae],Ve=e.slice(Fe,Ke);r.tokens&&(Ae===0&&u!==0?(a[Ae].isPrefix=!0,a[Ae].value=Pe):a[Ae].value=Ve,hT(a[Ae]),K.maxDepth+=a[Ae].depth),(Ae!==0||Ve!=="")&&o.push(Ve),se=Ke;}if(se&&se+1<e.length){let Ae=e.slice(se+1);o.push(Ae),r.tokens&&(a[a.length-1].value=Ae,hT(a[a.length-1]),K.maxDepth+=a[a.length-1].depth);}K.slashes=s,K.parts=o;}return K};gT.exports=aj;});var _T=P((nre,vT)=>{var Rl=au(),fn=Al(),{MAX_LENGTH:Il,POSIX_REGEX_SOURCE:oj,REGEX_NON_SPECIAL_CHARS:uj,REGEX_SPECIAL_CHARS_BACKREF:cj,REPLACEMENTS:yT}=Rl,lj=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;return r},Ba=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,xg=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=yT[e]||e;let r={...t},n=typeof r.maxLength=="number"?Math.min(Il,r.maxLength):Il,i=e.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:r.prepend||""},a=[s],o=r.capture?"":"?:",c=fn.isWindows(t),l=Rl.globChars(c),u=Rl.extglobChars(l),{DOT_LITERAL:f,PLUS_LITERAL:h,SLASH_LITERAL:p,ONE_CHAR:m,DOTS_SLASH:_,NO_DOT:E,NO_DOT_SLASH:w,NO_DOTS_SLASH:y,QMARK:b,QMARK_NO_DOT:N,STAR:L,START_ANCHOR:V}=l,X=ye=>`(${o}(?:(?!${V}${ye.dot?_:f}).)*?)`,z=r.dot?"":E,G=r.dot?b:N,ee=r.bash===!0?X(r):L;r.capture&&(ee=`(${ee})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let U={input:e,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:a};e=fn.removePrefix(e,U),i=e.length;let ie=[],me=[],Pe=[],W=s,K,se=()=>U.index===i-1,Ae=U.peek=(ye=1)=>e[U.index+ye],Fe=U.advance=()=>e[++U.index]||"",Ke=()=>e.slice(U.index+1),Ve=(ye="",je=0)=>{U.consumed+=ye,U.index+=je;},ot=ye=>{U.output+=ye.output!=null?ye.output:ye.value,Ve(ye.value);},Dt=()=>{let ye=1;for(;Ae()==="!"&&(Ae(2)!=="("||Ae(3)==="?");)Fe(),U.start++,ye++;return ye%2===0?!1:(U.negated=!0,U.start++,!0)},bt=ye=>{U[ye]++,Pe.push(ye);},ft=ye=>{U[ye]--,Pe.pop();},Oe=ye=>{if(W.type==="globstar"){let je=U.braces>0&&(ye.type==="comma"||ye.type==="brace"),le=ye.extglob===!0||ie.length&&(ye.type==="pipe"||ye.type==="paren");ye.type!=="slash"&&ye.type!=="paren"&&!je&&!le&&(U.output=U.output.slice(0,-W.output.length),W.type="star",W.value="*",W.output=ee,U.output+=W.output);}if(ie.length&&ye.type!=="paren"&&(ie[ie.length-1].inner+=ye.value),(ye.value||ye.output)&&ot(ye),W&&W.type==="text"&&ye.type==="text"){W.value+=ye.value,W.output=(W.output||"")+ye.value;return}ye.prev=W,a.push(ye),W=ye;},Rt=(ye,je)=>{let le={...u[je],conditions:1,inner:""};le.prev=W,le.parens=U.parens,le.output=U.output;let Ie=(r.capture?"(":"")+le.open;bt("parens"),Oe({type:ye,value:je,output:U.output?"":m}),Oe({type:"paren",extglob:!0,value:Fe(),output:Ie}),ie.push(le);},qt=ye=>{let je=ye.close+(r.capture?")":""),le;if(ye.type==="negate"){let Ie=ee;if(ye.inner&&ye.inner.length>1&&ye.inner.includes("/")&&(Ie=X(r)),(Ie!==ee||se()||/^\)+$/.test(Ke()))&&(je=ye.close=`)$))${Ie}`),ye.inner.includes("*")&&(le=Ke())&&/^\.[^\\/.]+$/.test(le)){let He=xg(le,{...t,fastpaths:!1}).output;je=ye.close=`)${He})${Ie})`;}ye.prev.type==="bos"&&(U.negatedExtglob=!0);}Oe({type:"paren",extglob:!0,value:K,output:je}),ft("parens");};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let ye=!1,je=e.replace(cj,(le,Ie,He,et,ze,vn)=>et==="\\"?(ye=!0,le):et==="?"?Ie?Ie+et+(ze?b.repeat(ze.length):""):vn===0?G+(ze?b.repeat(ze.length):""):b.repeat(He.length):et==="."?f.repeat(He.length):et==="*"?Ie?Ie+et+(ze?ee:""):ee:Ie?le:`\\${le}`);return ye===!0&&(r.unescape===!0?je=je.replace(/\\/g,""):je=je.replace(/\\+/g,le=>le.length%2===0?"\\\\":le?"\\":"")),je===e&&r.contains===!0?(U.output=e,U):(U.output=fn.wrapOutput(je,U,t),U)}for(;!se();){if(K=Fe(),K==="\0")continue;if(K==="\\"){let le=Ae();if(le==="/"&&r.bash!==!0||le==="."||le===";")continue;if(!le){K+="\\",Oe({type:"text",value:K});continue}let Ie=/^\\+/.exec(Ke()),He=0;if(Ie&&Ie[0].length>2&&(He=Ie[0].length,U.index+=He,He%2!==0&&(K+="\\")),r.unescape===!0?K=Fe():K+=Fe(),U.brackets===0){Oe({type:"text",value:K});continue}}if(U.brackets>0&&(K!=="]"||W.value==="["||W.value==="[^")){if(r.posix!==!1&&K===":"){let le=W.value.slice(1);if(le.includes("[")&&(W.posix=!0,le.includes(":"))){let Ie=W.value.lastIndexOf("["),He=W.value.slice(0,Ie),et=W.value.slice(Ie+2),ze=oj[et];if(ze){W.value=He+ze,U.backtrack=!0,Fe(),!s.output&&a.indexOf(W)===1&&(s.output=m);continue}}}(K==="["&&Ae()!==":"||K==="-"&&Ae()==="]")&&(K=`\\${K}`),K==="]"&&(W.value==="["||W.value==="[^")&&(K=`\\${K}`),r.posix===!0&&K==="!"&&W.value==="["&&(K="^"),W.value+=K,ot({value:K});continue}if(U.quotes===1&&K!=='"'){K=fn.escapeRegex(K),W.value+=K,ot({value:K});continue}if(K==='"'){U.quotes=U.quotes===1?0:1,r.keepQuotes===!0&&Oe({type:"text",value:K});continue}if(K==="("){bt("parens"),Oe({type:"paren",value:K});continue}if(K===")"){if(U.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Ba("opening","("));let le=ie[ie.length-1];if(le&&U.parens===le.parens+1){qt(ie.pop());continue}Oe({type:"paren",value:K,output:U.parens?")":"\\)"}),ft("parens");continue}if(K==="["){if(r.nobracket===!0||!Ke().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Ba("closing","]"));K=`\\${K}`;}else bt("brackets");Oe({type:"bracket",value:K});continue}if(K==="]"){if(r.nobracket===!0||W&&W.type==="bracket"&&W.value.length===1){Oe({type:"text",value:K,output:`\\${K}`});continue}if(U.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Ba("opening","["));Oe({type:"text",value:K,output:`\\${K}`});continue}ft("brackets");let le=W.value.slice(1);if(W.posix!==!0&&le[0]==="^"&&!le.includes("/")&&(K=`/${K}`),W.value+=K,ot({value:K}),r.literalBrackets===!1||fn.hasRegexChars(le))continue;let Ie=fn.escapeRegex(W.value);if(U.output=U.output.slice(0,-W.value.length),r.literalBrackets===!0){U.output+=Ie,W.value=Ie;continue}W.value=`(${o}${Ie}|${W.value})`,U.output+=W.value;continue}if(K==="{"&&r.nobrace!==!0){bt("braces");let le={type:"brace",value:K,output:"(",outputIndex:U.output.length,tokensIndex:U.tokens.length};me.push(le),Oe(le);continue}if(K==="}"){let le=me[me.length-1];if(r.nobrace===!0||!le){Oe({type:"text",value:K,output:K});continue}let Ie=")";if(le.dots===!0){let He=a.slice(),et=[];for(let ze=He.length-1;ze>=0&&(a.pop(),He[ze].type!=="brace");ze--)He[ze].type!=="dots"&&et.unshift(He[ze].value);Ie=lj(et,r),U.backtrack=!0;}if(le.comma!==!0&&le.dots!==!0){let He=U.output.slice(0,le.outputIndex),et=U.tokens.slice(le.tokensIndex);le.value=le.output="\\{",K=Ie="\\}",U.output=He;for(let ze of et)U.output+=ze.output||ze.value;}Oe({type:"brace",value:K,output:Ie}),ft("braces"),me.pop();continue}if(K==="|"){ie.length>0&&ie[ie.length-1].conditions++,Oe({type:"text",value:K});continue}if(K===","){let le=K,Ie=me[me.length-1];Ie&&Pe[Pe.length-1]==="braces"&&(Ie.comma=!0,le="|"),Oe({type:"comma",value:K,output:le});continue}if(K==="/"){if(W.type==="dot"&&U.index===U.start+1){U.start=U.index+1,U.consumed="",U.output="",a.pop(),W=s;continue}Oe({type:"slash",value:K,output:p});continue}if(K==="."){if(U.braces>0&&W.type==="dot"){W.value==="."&&(W.output=f);let le=me[me.length-1];W.type="dots",W.output+=K,W.value+=K,le.dots=!0;continue}if(U.braces+U.parens===0&&W.type!=="bos"&&W.type!=="slash"){Oe({type:"text",value:K,output:f});continue}Oe({type:"dot",value:K,output:f});continue}if(K==="?"){if(!(W&&W.value==="(")&&r.noextglob!==!0&&Ae()==="("&&Ae(2)!=="?"){Rt("qmark",K);continue}if(W&&W.type==="paren"){let Ie=Ae(),He=K;if(Ie==="<"&&!fn.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(W.value==="("&&!/[!=<:]/.test(Ie)||Ie==="<"&&!/<([!=]|\w+>)/.test(Ke()))&&(He=`\\${K}`),Oe({type:"text",value:K,output:He});continue}if(r.dot!==!0&&(W.type==="slash"||W.type==="bos")){Oe({type:"qmark",value:K,output:N});continue}Oe({type:"qmark",value:K,output:b});continue}if(K==="!"){if(r.noextglob!==!0&&Ae()==="("&&(Ae(2)!=="?"||!/[!=<:]/.test(Ae(3)))){Rt("negate",K);continue}if(r.nonegate!==!0&&U.index===0){Dt();continue}}if(K==="+"){if(r.noextglob!==!0&&Ae()==="("&&Ae(2)!=="?"){Rt("plus",K);continue}if(W&&W.value==="("||r.regex===!1){Oe({type:"plus",value:K,output:h});continue}if(W&&(W.type==="bracket"||W.type==="paren"||W.type==="brace")||U.parens>0){Oe({type:"plus",value:K});continue}Oe({type:"plus",value:h});continue}if(K==="@"){if(r.noextglob!==!0&&Ae()==="("&&Ae(2)!=="?"){Oe({type:"at",extglob:!0,value:K,output:""});continue}Oe({type:"text",value:K});continue}if(K!=="*"){(K==="$"||K==="^")&&(K=`\\${K}`);let le=uj.exec(Ke());le&&(K+=le[0],U.index+=le[0].length),Oe({type:"text",value:K});continue}if(W&&(W.type==="globstar"||W.star===!0)){W.type="star",W.star=!0,W.value+=K,W.output=ee,U.backtrack=!0,U.globstar=!0,Ve(K);continue}let ye=Ke();if(r.noextglob!==!0&&/^\([^?]/.test(ye)){Rt("star",K);continue}if(W.type==="star"){if(r.noglobstar===!0){Ve(K);continue}let le=W.prev,Ie=le.prev,He=le.type==="slash"||le.type==="bos",et=Ie&&(Ie.type==="star"||Ie.type==="globstar");if(r.bash===!0&&(!He||ye[0]&&ye[0]!=="/")){Oe({type:"star",value:K,output:""});continue}let ze=U.braces>0&&(le.type==="comma"||le.type==="brace"),vn=ie.length&&(le.type==="pipe"||le.type==="paren");if(!He&&le.type!=="paren"&&!ze&&!vn){Oe({type:"star",value:K,output:""});continue}for(;ye.slice(0,3)==="/**";){let Or=e[U.index+4];if(Or&&Or!=="/")break;ye=ye.slice(3),Ve("/**",3);}if(le.type==="bos"&&se()){W.type="globstar",W.value+=K,W.output=X(r),U.output=W.output,U.globstar=!0,Ve(K);continue}if(le.type==="slash"&&le.prev.type!=="bos"&&!et&&se()){U.output=U.output.slice(0,-(le.output+W.output).length),le.output=`(?:${le.output}`,W.type="globstar",W.output=X(r)+(r.strictSlashes?")":"|$)"),W.value+=K,U.globstar=!0,U.output+=le.output+W.output,Ve(K);continue}if(le.type==="slash"&&le.prev.type!=="bos"&&ye[0]==="/"){let Or=ye[1]!==void 0?"|$":"";U.output=U.output.slice(0,-(le.output+W.output).length),le.output=`(?:${le.output}`,W.type="globstar",W.output=`${X(r)}${p}|${p}${Or})`,W.value+=K,U.output+=le.output+W.output,U.globstar=!0,Ve(K+Fe()),Oe({type:"slash",value:"/",output:""});continue}if(le.type==="bos"&&ye[0]==="/"){W.type="globstar",W.value+=K,W.output=`(?:^|${p}|${X(r)}${p})`,U.output=W.output,U.globstar=!0,Ve(K+Fe()),Oe({type:"slash",value:"/",output:""});continue}U.output=U.output.slice(0,-W.output.length),W.type="globstar",W.output=X(r),W.value+=K,U.output+=W.output,U.globstar=!0,Ve(K);continue}let je={type:"star",value:K,output:ee};if(r.bash===!0){je.output=".*?",(W.type==="bos"||W.type==="slash")&&(je.output=z+je.output),Oe(je);continue}if(W&&(W.type==="bracket"||W.type==="paren")&&r.regex===!0){je.output=K,Oe(je);continue}(U.index===U.start||W.type==="slash"||W.type==="dot")&&(W.type==="dot"?(U.output+=w,W.output+=w):r.dot===!0?(U.output+=y,W.output+=y):(U.output+=z,W.output+=z),Ae()!=="*"&&(U.output+=m,W.output+=m)),Oe(je);}for(;U.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Ba("closing","]"));U.output=fn.escapeLast(U.output,"["),ft("brackets");}for(;U.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Ba("closing",")"));U.output=fn.escapeLast(U.output,"("),ft("parens");}for(;U.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Ba("closing","}"));U.output=fn.escapeLast(U.output,"{"),ft("braces");}if(r.strictSlashes!==!0&&(W.type==="star"||W.type==="bracket")&&Oe({type:"maybe_slash",value:"",output:`${p}?`}),U.backtrack===!0){U.output="";for(let ye of U.tokens)U.output+=ye.output!=null?ye.output:ye.value,ye.suffix&&(U.output+=ye.suffix);}return U};xg.fastpaths=(e,t)=>{let r={...t},n=typeof r.maxLength=="number"?Math.min(Il,r.maxLength):Il,i=e.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);e=yT[e]||e;let s=fn.isWindows(t),{DOT_LITERAL:a,SLASH_LITERAL:o,ONE_CHAR:c,DOTS_SLASH:l,NO_DOT:u,NO_DOTS:f,NO_DOTS_SLASH:h,STAR:p,START_ANCHOR:m}=Rl.globChars(s),_=r.dot?f:u,E=r.dot?h:u,w=r.capture?"":"?:",y={negated:!1,prefix:""},b=r.bash===!0?".*?":p;r.capture&&(b=`(${b})`);let N=z=>z.noglobstar===!0?b:`(${w}(?:(?!${m}${z.dot?l:a}).)*?)`,L=z=>{switch(z){case"*":return `${_}${c}${b}`;case".*":return `${a}${c}${b}`;case"*.*":return `${_}${b}${a}${c}${b}`;case"*/*":return `${_}${b}${o}${c}${E}${b}`;case"**":return _+N(r);case"**/*":return `(?:${_}${N(r)}${o})?${E}${c}${b}`;case"**/*.*":return `(?:${_}${N(r)}${o})?${E}${b}${a}${c}${b}`;case"**/.*":return `(?:${_}${N(r)}${o})?${a}${c}${b}`;default:{let G=/^(.*?)\.(\w+)$/.exec(z);if(!G)return;let ee=L(G[1]);return ee?ee+a+G[2]:void 0}}},V=fn.removePrefix(e,y),X=L(V);return X&&r.strictSlashes!==!0&&(X+=`${o}?`),X};vT.exports=xg;});var ST=P((ire,bT)=>{var fj=he("path"),dj=mT(),Tg=_T(),Ag=Al(),hj=au(),pj=e=>e&&typeof e=="object"&&!Array.isArray(e),er=(e,t,r=!1)=>{if(Array.isArray(e)){let u=e.map(h=>er(h,t,r));return h=>{for(let p of u){let m=p(h);if(m)return m}return !1}}let n=pj(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=t||{},s=Ag.isWindows(t),a=n?er.compileRe(e,t):er.makeRe(e,t,!1,!0),o=a.state;delete a.state;let c=()=>!1;if(i.ignore){let u={...t,ignore:null,onMatch:null,onResult:null};c=er(i.ignore,u,r);}let l=(u,f=!1)=>{let{isMatch:h,match:p,output:m}=er.test(u,a,t,{glob:e,posix:s}),_={glob:e,state:o,regex:a,posix:s,input:u,output:m,match:p,isMatch:h};return typeof i.onResult=="function"&&i.onResult(_),h===!1?(_.isMatch=!1,f?_:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(_),_.isMatch=!1,f?_:!1):(typeof i.onMatch=="function"&&i.onMatch(_),f?_:!0)};return r&&(l.state=o),l};er.test=(e,t,r,{glob:n,posix:i}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return {isMatch:!1,output:""};let s=r||{},a=s.format||(i?Ag.toPosixSlashes:null),o=e===n,c=o&&a?a(e):e;return o===!1&&(c=a?a(e):e,o=c===n),(o===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?o=er.matchBase(e,t,r,i):o=t.exec(c)),{isMatch:!!o,match:o,output:c}};er.matchBase=(e,t,r,n=Ag.isWindows(r))=>(t instanceof RegExp?t:er.makeRe(t,r)).test(fj.basename(e));er.isMatch=(e,t,r)=>er(t,r)(e);er.parse=(e,t)=>Array.isArray(e)?e.map(r=>er.parse(r,t)):Tg(e,{...t,fastpaths:!1});er.scan=(e,t)=>dj(e,t);er.compileRe=(e,t,r=!1,n=!1)=>{if(r===!0)return e.output;let i=t||{},s=i.contains?"":"^",a=i.contains?"":"$",o=`${s}(?:${e.output})${a}`;e&&e.negated===!0&&(o=`^(?!${o}).*$`);let c=er.toRegex(o,t);return n===!0&&(c.state=e),c};er.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(i.output=Tg.fastpaths(e,t)),i.output||(i=Tg(e,t)),er.compileRe(i,t,r,n)};er.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(r){if(t&&t.debug===!0)throw r;return /$^/}};er.constants=hj;bT.exports=er;});var Rg=P((sre,ET)=>{ET.exports=ST();});var PT=P((are,IT)=>{var cu=he("fs"),{Readable:gj}=he("stream"),uu=he("path"),{promisify:kl}=he("util"),Ig=Rg(),mj=kl(cu.readdir),yj=kl(cu.stat),wT=kl(cu.lstat),vj=kl(cu.realpath),_j="!",AT="READDIRP_RECURSIVE_ERROR",bj=new Set(["ENOENT","EPERM","EACCES","ELOOP",AT]),Pg="files",RT="directories",Nl="files_directories",Pl="all",CT=[Pg,RT,Nl,Pl],Sj=e=>bj.has(e.code),[xT,Ej]=process.versions.node.split(".").slice(0,2).map(e=>Number.parseInt(e,10)),wj=process.platform==="win32"&&(xT>10||xT===10&&Ej>=5),TT=e=>{if(e!==void 0){if(typeof e=="function")return e;if(typeof e=="string"){let t=Ig(e.trim());return r=>t(r.basename)}if(Array.isArray(e)){let t=[],r=[];for(let n of e){let i=n.trim();i.charAt(0)===_j?r.push(Ig(i.slice(1))):t.push(Ig(i));}return r.length>0?t.length>0?n=>t.some(i=>i(n.basename))&&!r.some(i=>i(n.basename)):n=>!r.some(i=>i(n.basename)):n=>t.some(i=>i(n.basename))}}},Dl=class e extends gj{static get defaultOptions(){return {root:".",fileFilter:t=>!0,directoryFilter:t=>!0,type:Pg,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(t={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:t.highWaterMark||4096});let r={...e.defaultOptions,...t},{root:n,type:i}=r;this._fileFilter=TT(r.fileFilter),this._directoryFilter=TT(r.directoryFilter);let s=r.lstat?wT:yj;wj?this._stat=a=>s(a,{bigint:!0}):this._stat=s,this._maxDepth=r.depth,this._wantsDir=[RT,Nl,Pl].includes(i),this._wantsFile=[Pg,Nl,Pl].includes(i),this._wantsEverything=i===Pl,this._root=uu.resolve(n),this._isDirent="Dirent"in cu&&!r.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0;}async _read(t){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&t>0;){let{path:r,depth:n,files:i=[]}=this.parent||{};if(i.length>0){let s=i.splice(0,t).map(a=>this._formatEntry(a,r));for(let a of await Promise.all(s)){if(this.destroyed)return;let o=await this._getEntryType(a);o==="directory"&&this._directoryFilter(a)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(a.fullPath,n+1)),this._wantsDir&&(this.push(a),t--)):(o==="file"||this._includeAsFile(a))&&this._fileFilter(a)&&this._wantsFile&&(this.push(a),t--);}}else {let s=this.parents.pop();if(!s){this.push(null);break}if(this.parent=await s,this.destroyed)return}}}catch(r){this.destroy(r);}finally{this.reading=!1;}}}async _exploreDir(t,r){let n;try{n=await mj(t,this._rdOptions);}catch(i){this._onError(i);}return {files:n,depth:r,path:t}}async _formatEntry(t,r){let n;try{let i=this._isDirent?t.name:t,s=uu.resolve(uu.join(r,i));n={path:uu.relative(this._root,s),fullPath:s,basename:i},n[this._statsProp]=this._isDirent?t:await this._stat(s);}catch(i){this._onError(i);}return n}_onError(t){Sj(t)&&!this.destroyed?this.emit("warn",t):this.destroy(t);}async _getEntryType(t){let r=t&&t[this._statsProp];if(r){if(r.isFile())return "file";if(r.isDirectory())return "directory";if(r&&r.isSymbolicLink()){let n=t.fullPath;try{let i=await vj(n),s=await wT(i);if(s.isFile())return "file";if(s.isDirectory()){let a=i.length;if(n.startsWith(i)&&n.substr(a,1)===uu.sep){let o=new Error(`Circular symlink detected: "${n}" points to "${i}"`);return o.code=AT,this._onError(o)}return "directory"}}catch(i){this._onError(i);}}}}_includeAsFile(t){let r=t&&t[this._statsProp];return r&&this._wantsEverything&&!r.isDirectory()}},Fa=(e,t={})=>{let r=t.entryType||t.type;if(r==="both"&&(r=Nl),r&&(t.type=r),e){if(typeof e!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(r&&!CT.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${CT.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return t.root=e,new Dl(t)},Cj=(e,t={})=>new Promise((r,n)=>{let i=[];Fa(e,t).on("data",s=>i.push(s)).on("end",()=>r(i)).on("error",s=>n(s));});Fa.promise=Cj;Fa.ReaddirpStream=Dl;Fa.default=Fa;IT.exports=Fa;});var Ng=P((ore,NT)=>{NT.exports=function(e,t){if(typeof e!="string")throw new TypeError("expected path to be a string");if(e==="\\"||e==="/")return "/";var r=e.length;if(r<=1)return e;var n="";if(r>4&&e[3]==="\\"){var i=e[2];(i==="?"||i===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),n="//");}var s=e.split(/[/\\]+/);return t!==!1&&s[s.length-1]===""&&s.pop(),n+s.join("/")};});var FT=P((LT,BT)=>{Object.defineProperty(LT,"__esModule",{value:!0});var OT=Rg(),xj=Ng(),DT="!",Tj={returnIndex:!1},Aj=e=>Array.isArray(e)?e:[e],Rj=(e,t)=>{if(typeof e=="function")return e;if(typeof e=="string"){let r=OT(e,t);return n=>e===n||r(n)}return e instanceof RegExp?r=>e.test(r):r=>!1},kT=(e,t,r,n)=>{let i=Array.isArray(r),s=i?r[0]:r;if(!i&&typeof s!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(s));let a=xj(s,!1);for(let c=0;c<t.length;c++){let l=t[c];if(l(a))return n?-1:!1}let o=i&&[a].concat(r.slice(1));for(let c=0;c<e.length;c++){let l=e[c];if(i?l(...o):l(a))return n?c:!0}return n?-1:!1},Dg=(e,t,r=Tj)=>{if(e==null)throw new TypeError("anymatch: specify first argument");let n=typeof r=="boolean"?{returnIndex:r}:r,i=n.returnIndex||!1,s=Aj(e),a=s.filter(c=>typeof c=="string"&&c.charAt(0)===DT).map(c=>c.slice(1)).map(c=>OT(c,n)),o=s.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==DT).map(c=>Rj(c,n));return t==null?(c,l=!1)=>kT(o,a,c,typeof l=="boolean"?l:!1):kT(o,a,t,i)};Dg.default=Dg;BT.exports=Dg;});var qT=P((ure,MT)=>{MT.exports=function(t){if(typeof t!="string"||t==="")return !1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(r[2])return !0;t=t.slice(r.index+r[0].length);}return !1};});var kg=P((cre,jT)=>{var Ij=qT(),UT={"{":"}","(":")","[":"]"},Pj=function(e){if(e[0]==="!")return !0;for(var t=0,r=-2,n=-2,i=-2,s=-2,a=-2;t<e.length;){if(e[t]==="*"||e[t+1]==="?"&&/[\].+)]/.test(e[t])||n!==-1&&e[t]==="["&&e[t+1]!=="]"&&(n<t&&(n=e.indexOf("]",t)),n>t&&(a===-1||a>n||(a=e.indexOf("\\",t),a===-1||a>n)))||i!==-1&&e[t]==="{"&&e[t+1]!=="}"&&(i=e.indexOf("}",t),i>t&&(a=e.indexOf("\\",t),a===-1||a>i))||s!==-1&&e[t]==="("&&e[t+1]==="?"&&/[:!=]/.test(e[t+2])&&e[t+3]!==")"&&(s=e.indexOf(")",t),s>t&&(a=e.indexOf("\\",t),a===-1||a>s))||r!==-1&&e[t]==="("&&e[t+1]!=="|"&&(r<t&&(r=e.indexOf("|",t)),r!==-1&&e[r+1]!==")"&&(s=e.indexOf(")",r),s>r&&(a=e.indexOf("\\",r),a===-1||a>s))))return !0;if(e[t]==="\\"){var o=e[t+1];t+=2;var c=UT[o];if(c){var l=e.indexOf(c,t);l!==-1&&(t=l+1);}if(e[t]==="!")return !0}else t++;}return !1},Nj=function(e){if(e[0]==="!")return !0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return !0;if(e[t]==="\\"){var r=e[t+1];t+=2;var n=UT[r];if(n){var i=e.indexOf(n,t);i!==-1&&(t=i+1);}if(e[t]==="!")return !0}else t++;}return !1};jT.exports=function(t,r){if(typeof t!="string"||t==="")return !1;if(Ij(t))return !0;var n=Pj;return r&&r.strict===!1&&(n=Nj),n(t)};});var VT=P((lre,$T)=>{var Dj=kg(),kj=he("path").posix.dirname,Oj=he("os").platform()==="win32",Og="/",Lj=/\\/g,Bj=/[\{\[].*[\}\]]$/,Fj=/(^|[^\\])([\{\[]|\([^\)]+$)/,Mj=/\\([\!\*\?\|\[\]\(\)\{\}])/g;$T.exports=function(t,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&Oj&&t.indexOf(Og)<0&&(t=t.replace(Lj,Og)),Bj.test(t)&&(t+=Og),t+="a";do t=kj(t);while(Dj(t)||Fj.test(t));return t.replace(Mj,"$1")};});var Ol=P(wn=>{wn.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;wn.find=(e,t)=>e.nodes.find(r=>r.type===t);wn.exceedsLimit=(e,t,r=1,n)=>n===!1||!wn.isInteger(e)||!wn.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=n;wn.escapeNode=(e,t=0,r)=>{let n=e.nodes[t];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0);};wn.encloseBrace=e=>e.type!=="brace"||e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0);wn.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1;wn.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;wn.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);wn.flatten=(...e)=>{let t=[],r=n=>{for(let i=0;i<n.length;i++){let s=n[i];Array.isArray(s)?r(s):s!==void 0&&t.push(s);}return t};return r(e),t};});var Ll=P((dre,WT)=>{var HT=Ol();WT.exports=(e,t={})=>{let r=(n,i={})=>{let s=t.escapeInvalid&&HT.isInvalidBrace(i),a=n.invalid===!0&&t.escapeInvalid===!0,o="";if(n.value)return (s||a)&&HT.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)o+=r(c);return o};return r(e)};});var zT=P((hre,KT)=>{KT.exports=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1};});var rA=P((pre,tA)=>{var GT=zT(),qs=(e,t,r)=>{if(GT(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(GT(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let i=String(n.relaxZeros),s=String(n.shorthand),a=String(n.capture),o=String(n.wrap),c=e+":"+t+"="+i+s+a+o;if(qs.cache.hasOwnProperty(c))return qs.cache[c].result;let l=Math.min(e,t),u=Math.max(e,t);if(Math.abs(l-u)===1){let _=e+"|"+t;return n.capture?`(${_})`:n.wrap===!1?_:`(?:${_})`}let f=eA(e)||eA(t),h={min:e,max:t,a:l,b:u},p=[],m=[];if(f&&(h.isPadded=f,h.maxLen=String(h.max).length),l<0){let _=u<0?Math.abs(u):1;m=YT(_,Math.abs(l),h,n),l=h.a=0;}return u>=0&&(p=YT(l,u,h,n)),h.negatives=m,h.positives=p,h.result=qj(m,p),n.capture===!0?h.result=`(${h.result})`:n.wrap!==!1&&p.length+m.length>1&&(h.result=`(?:${h.result})`),qs.cache[c]=h,h.result};function qj(e,t,r){let n=Lg(e,t,"-",!1)||[],i=Lg(t,e,"",!1)||[],s=Lg(e,t,"-?",!0)||[];return n.concat(s).concat(i).join("|")}function Uj(e,t){let r=1,n=1,i=ZT(e,r),s=new Set([t]);for(;e<=i&&i<=t;)s.add(i),r+=1,i=ZT(e,r);for(i=XT(t+1,n)-1;e<i&&i<=t;)s.add(i),n+=1,i=XT(t+1,n)-1;return s=[...s],s.sort(Vj),s}function jj(e,t,r){if(e===t)return {pattern:e,count:[],digits:0};let n=$j(e,t),i=n.length,s="",a=0;for(let o=0;o<i;o++){let[c,l]=n[o];c===l?s+=c:c!=="0"||l!=="9"?s+=Hj(c,l):a++;}return a&&(s+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[a],digits:i}}function YT(e,t,r,n){let i=Uj(e,t),s=[],a=e,o;for(let c=0;c<i.length;c++){let l=i[c],u=jj(String(a),String(l),n),f="";if(!r.isPadded&&o&&o.pattern===u.pattern){o.count.length>1&&o.count.pop(),o.count.push(u.count[0]),o.string=o.pattern+JT(o.count),a=l+1;continue}r.isPadded&&(f=Wj(l,r,n)),u.string=f+u.pattern+JT(u.count),s.push(u),a=l+1,o=u;}return s}function Lg(e,t,r,n,i){let s=[];for(let a of e){let{string:o}=a;!n&&!QT(t,"string",o)&&s.push(r+o),n&&QT(t,"string",o)&&s.push(r+o);}return s}function $j(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function Vj(e,t){return e>t?1:t>e?-1:0}function QT(e,t,r){return e.some(n=>n[t]===r)}function ZT(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function XT(e,t){return e-e%Math.pow(10,t)}function JT(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function Hj(e,t,r){return `[${e}${t-e===1?"":"-"}${t}]`}function eA(e){return /^-?(0+)\d/.test(e)}function Wj(e,t,r){if(!t.isPadded)return e;let n=Math.abs(t.maxLen-String(e).length),i=r.relaxZeros!==!1;switch(n){case 0:return "";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${n}}`:`0{${n}}`}}qs.cache={};qs.clearCache=()=>qs.cache={};tA.exports=qs;});var Mg=P((gre,lA)=>{var Kj=he("util"),sA=rA(),nA=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),zj=e=>t=>e===!0?Number(t):String(t),Bg=e=>typeof e=="number"||typeof e=="string"&&e!=="",lu=e=>Number.isInteger(+e),Fg=e=>{let t=`${e}`,r=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return !1;for(;t[++r]==="0";);return r>0},Gj=(e,t,r)=>typeof e=="string"||typeof t=="string"?!0:r.stringify===!0,Yj=(e,t,r)=>{if(t>0){let n=e[0]==="-"?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0");}return r===!1?String(e):e},iA=(e,t)=>{let r=e[0]==="-"?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},Qj=(e,t)=>{e.negatives.sort((a,o)=>a<o?-1:a>o?1:0),e.positives.sort((a,o)=>a<o?-1:a>o?1:0);let r=t.capture?"":"?:",n="",i="",s;return e.positives.length&&(n=e.positives.join("|")),e.negatives.length&&(i=`-(${r}${e.negatives.join("|")})`),n&&i?s=`${n}|${i}`:s=n||i,t.wrap?`(${r}${s})`:s},aA=(e,t,r,n)=>{if(r)return sA(e,t,{wrap:!1,...n});let i=String.fromCharCode(e);if(e===t)return i;let s=String.fromCharCode(t);return `[${i}-${s}]`},oA=(e,t,r)=>{if(Array.isArray(e)){let n=r.wrap===!0,i=r.capture?"":"?:";return n?`(${i}${e.join("|")})`:e.join("|")}return sA(e,t,r)},uA=(...e)=>new RangeError("Invalid range arguments: "+Kj.inspect(...e)),cA=(e,t,r)=>{if(r.strictRanges===!0)throw uA([e,t]);return []},Zj=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return []},Xj=(e,t,r=1,n={})=>{let i=Number(e),s=Number(t);if(!Number.isInteger(i)||!Number.isInteger(s)){if(n.strictRanges===!0)throw uA([e,t]);return []}i===0&&(i=0),s===0&&(s=0);let a=i>s,o=String(e),c=String(t),l=String(r);r=Math.max(Math.abs(r),1);let u=Fg(o)||Fg(c)||Fg(l),f=u?Math.max(o.length,c.length,l.length):0,h=u===!1&&Gj(e,t,n)===!1,p=n.transform||zj(h);if(n.toRegex&&r===1)return aA(iA(e,f),iA(t,f),!0,n);let m={negatives:[],positives:[]},_=y=>m[y<0?"negatives":"positives"].push(Math.abs(y)),E=[],w=0;for(;a?i>=s:i<=s;)n.toRegex===!0&&r>1?_(i):E.push(Yj(p(i,w),f,h)),i=a?i-r:i+r,w++;return n.toRegex===!0?r>1?Qj(m,n):oA(E,null,{wrap:!1,...n}):E},Jj=(e,t,r=1,n={})=>{if(!lu(e)&&e.length>1||!lu(t)&&t.length>1)return cA(e,t,n);let i=n.transform||(h=>String.fromCharCode(h)),s=`${e}`.charCodeAt(0),a=`${t}`.charCodeAt(0),o=s>a,c=Math.min(s,a),l=Math.max(s,a);if(n.toRegex&&r===1)return aA(c,l,!1,n);let u=[],f=0;for(;o?s>=a:s<=a;)u.push(i(s,f)),s=o?s-r:s+r,f++;return n.toRegex===!0?oA(u,null,{wrap:!1,options:n}):u},Bl=(e,t,r,n={})=>{if(t==null&&Bg(e))return [e];if(!Bg(e)||!Bg(t))return cA(e,t,n);if(typeof r=="function")return Bl(e,t,1,{transform:r});if(nA(r))return Bl(e,t,0,r);let i={...n};return i.capture===!0&&(i.wrap=!0),r=r||i.step||1,lu(r)?lu(e)&&lu(t)?Xj(e,t,r,i):Jj(e,t,Math.max(Math.abs(r),1),i):r!=null&&!nA(r)?Zj(r,i):Bl(e,t,1,r)};lA.exports=Bl;});var hA=P((mre,dA)=>{var e$=Mg(),fA=Ol(),t$=(e,t={})=>{let r=(n,i={})=>{let s=fA.isInvalidBrace(i),a=n.invalid===!0&&t.escapeInvalid===!0,o=s===!0||a===!0,c=t.escapeInvalid===!0?"\\":"",l="";if(n.isOpen===!0||n.isClose===!0)return c+n.value;if(n.type==="open")return o?c+n.value:"(";if(n.type==="close")return o?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":o?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let u=fA.reduce(n.nodes),f=e$(...u,{...t,wrap:!1,toRegex:!0});if(f.length!==0)return u.length>1&&f.length>1?`(${f})`:f}if(n.nodes)for(let u of n.nodes)l+=r(u,n);return l};return r(e)};dA.exports=t$;});var mA=P((yre,gA)=>{var r$=Mg(),pA=Ll(),Ma=Ol(),Us=(e="",t="",r=!1)=>{let n=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return r?Ma.flatten(t).map(i=>`{${i}}`):t;for(let i of e)if(Array.isArray(i))for(let s of i)n.push(Us(s,t,r));else for(let s of t)r===!0&&typeof s=="string"&&(s=`{${s}}`),n.push(Array.isArray(s)?Us(i,s,r):i+s);return Ma.flatten(n)},n$=(e,t={})=>{let r=t.rangeLimit===void 0?1e3:t.rangeLimit,n=(i,s={})=>{i.queue=[];let a=s,o=s.queue;for(;a.type!=="brace"&&a.type!=="root"&&a.parent;)a=a.parent,o=a.queue;if(i.invalid||i.dollar){o.push(Us(o.pop(),pA(i,t)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){o.push(Us(o.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){let f=Ma.reduce(i.nodes);if(Ma.exceedsLimit(...f,t.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let h=r$(...f,t);h.length===0&&(h=pA(i,t)),o.push(Us(o.pop(),h)),i.nodes=[];return}let c=Ma.encloseBrace(i),l=i.queue,u=i;for(;u.type!=="brace"&&u.type!=="root"&&u.parent;)u=u.parent,l=u.queue;for(let f=0;f<i.nodes.length;f++){let h=i.nodes[f];if(h.type==="comma"&&i.type==="brace"){f===1&&l.push(""),l.push("");continue}if(h.type==="close"){o.push(Us(o.pop(),l,c));continue}if(h.value&&h.type!=="open"){l.push(Us(l.pop(),h.value));continue}h.nodes&&n(h,i);}return l};return Ma.flatten(n(e))};gA.exports=n$;});var vA=P((vre,yA)=>{yA.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"	",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"};});var wA=P((_re,EA)=>{var i$=Ll(),{MAX_LENGTH:_A,CHAR_BACKSLASH:qg,CHAR_BACKTICK:s$,CHAR_COMMA:a$,CHAR_DOT:o$,CHAR_LEFT_PARENTHESES:u$,CHAR_RIGHT_PARENTHESES:c$,CHAR_LEFT_CURLY_BRACE:l$,CHAR_RIGHT_CURLY_BRACE:f$,CHAR_LEFT_SQUARE_BRACKET:bA,CHAR_RIGHT_SQUARE_BRACKET:SA,CHAR_DOUBLE_QUOTE:d$,CHAR_SINGLE_QUOTE:h$,CHAR_NO_BREAK_SPACE:p$,CHAR_ZERO_WIDTH_NOBREAK_SPACE:g$}=vA(),m$=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(_A,r.maxLength):_A;if(e.length>n)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${n})`);let i={type:"root",input:e,nodes:[]},s=[i],a=i,o=i,c=0,l=e.length,u=0,f=0,h,m=()=>e[u++],_=E=>{if(E.type==="text"&&o.type==="dot"&&(o.type="text"),o&&o.type==="text"&&E.type==="text"){o.value+=E.value;return}return a.nodes.push(E),E.parent=a,E.prev=o,o=E,E};for(_({type:"bos"});u<l;)if(a=s[s.length-1],h=m(),!(h===g$||h===p$)){if(h===qg){_({type:"text",value:(t.keepEscaping?h:"")+m()});continue}if(h===SA){_({type:"text",value:"\\"+h});continue}if(h===bA){c++;let w;for(;u<l&&(w=m());){if(h+=w,w===bA){c++;continue}if(w===qg){h+=m();continue}if(w===SA&&(c--,c===0))break}_({type:"text",value:h});continue}if(h===u$){a=_({type:"paren",nodes:[]}),s.push(a),_({type:"text",value:h});continue}if(h===c$){if(a.type!=="paren"){_({type:"text",value:h});continue}a=s.pop(),_({type:"text",value:h}),a=s[s.length-1];continue}if(h===d$||h===h$||h===s$){let E=h,w;for(t.keepQuotes!==!0&&(h="");u<l&&(w=m());){if(w===qg){h+=w+m();continue}if(w===E){t.keepQuotes===!0&&(h+=w);break}h+=w;}_({type:"text",value:h});continue}if(h===l$){f++;let w={type:"brace",open:!0,close:!1,dollar:o.value&&o.value.slice(-1)==="$"||a.dollar===!0,depth:f,commas:0,ranges:0,nodes:[]};a=_(w),s.push(a),_({type:"open",value:h});continue}if(h===f$){if(a.type!=="brace"){_({type:"text",value:h});continue}let E="close";a=s.pop(),a.close=!0,_({type:E,value:h}),f--,a=s[s.length-1];continue}if(h===a$&&f>0){if(a.ranges>0){a.ranges=0;let E=a.nodes.shift();a.nodes=[E,{type:"text",value:i$(a)}];}_({type:"comma",value:h}),a.commas++;continue}if(h===o$&&f>0&&a.commas===0){let E=a.nodes;if(f===0||E.length===0){_({type:"text",value:h});continue}if(o.type==="dot"){if(a.range=[],o.value+=h,o.type="range",a.nodes.length!==3&&a.nodes.length!==5){a.invalid=!0,a.ranges=0,o.type="text";continue}a.ranges++,a.args=[];continue}if(o.type==="range"){E.pop();let w=E[E.length-1];w.value+=o.value+h,o=w,a.ranges--;continue}_({type:"dot",value:h});continue}_({type:"text",value:h});}do if(a=s.pop(),a.type!=="root"){a.nodes.forEach(y=>{y.nodes||(y.type==="open"&&(y.isOpen=!0),y.type==="close"&&(y.isClose=!0),y.nodes||(y.type="text"),y.invalid=!0);});let E=s[s.length-1],w=E.nodes.indexOf(a);E.nodes.splice(w,1,...a.nodes);}while(s.length>0);return _({type:"eos"}),i};EA.exports=m$;});var TA=P((bre,xA)=>{var CA=Ll(),y$=hA(),v$=mA(),_$=wA(),dn=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let i=dn.create(n,t);Array.isArray(i)?r.push(...i):r.push(i);}else r=[].concat(dn.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};dn.parse=(e,t={})=>_$(e,t);dn.stringify=(e,t={})=>CA(typeof e=="string"?dn.parse(e,t):e,t);dn.compile=(e,t={})=>(typeof e=="string"&&(e=dn.parse(e,t)),y$(e,t));dn.expand=(e,t={})=>{typeof e=="string"&&(e=dn.parse(e,t));let r=v$(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};dn.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?dn.compile(e,t):dn.expand(e,t);xA.exports=dn;});var AA=P((Sre,b$)=>{b$.exports=["3dm","3ds","3g2","3gp","7z","a","aac","adp","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"];});var IA=P((Ere,RA)=>{RA.exports=AA();});var NA=P((wre,PA)=>{var S$=he("path"),E$=IA(),w$=new Set(E$);PA.exports=e=>w$.has(S$.extname(e).slice(1).toLowerCase());});var Fl=P(Le=>{var{sep:C$}=he("path"),{platform:Ug}=process,x$=he("os");Le.EV_ALL="all";Le.EV_READY="ready";Le.EV_ADD="add";Le.EV_CHANGE="change";Le.EV_ADD_DIR="addDir";Le.EV_UNLINK="unlink";Le.EV_UNLINK_DIR="unlinkDir";Le.EV_RAW="raw";Le.EV_ERROR="error";Le.STR_DATA="data";Le.STR_END="end";Le.STR_CLOSE="close";Le.FSEVENT_CREATED="created";Le.FSEVENT_MODIFIED="modified";Le.FSEVENT_DELETED="deleted";Le.FSEVENT_MOVED="moved";Le.FSEVENT_CLONED="cloned";Le.FSEVENT_UNKNOWN="unknown";Le.FSEVENT_TYPE_FILE="file";Le.FSEVENT_TYPE_DIRECTORY="directory";Le.FSEVENT_TYPE_SYMLINK="symlink";Le.KEY_LISTENERS="listeners";Le.KEY_ERR="errHandlers";Le.KEY_RAW="rawEmitters";Le.HANDLER_KEYS=[Le.KEY_LISTENERS,Le.KEY_ERR,Le.KEY_RAW];Le.DOT_SLASH=`.${C$}`;Le.BACK_SLASH_RE=/\\/g;Le.DOUBLE_SLASH_RE=/\/\//;Le.SLASH_OR_BACK_SLASH_RE=/[/\\]/;Le.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;Le.REPLACER_RE=/^\.[/\\]/;Le.SLASH="/";Le.SLASH_SLASH="//";Le.BRACE_START="{";Le.BANG="!";Le.ONE_DOT=".";Le.TWO_DOTS="..";Le.STAR="*";Le.GLOBSTAR="**";Le.ROOT_GLOBSTAR="/**/*";Le.SLASH_GLOBSTAR="/**";Le.DIR_SUFFIX="Dir";Le.ANYMATCH_OPTS={dot:!0};Le.STRING_TYPE="string";Le.FUNCTION_TYPE="function";Le.EMPTY_STR="";Le.EMPTY_FN=()=>{};Le.IDENTITY_FN=e=>e;Le.isWindows=Ug==="win32";Le.isMacos=Ug==="darwin";Le.isLinux=Ug==="linux";Le.isIBMi=x$.type()==="OS400";});var FA=P((xre,BA)=>{var xi=he("fs"),lr=he("path"),{promisify:pu}=he("util"),T$=NA(),{isWindows:A$,isLinux:R$,EMPTY_FN:I$,EMPTY_STR:P$,KEY_LISTENERS:qa,KEY_ERR:jg,KEY_RAW:fu,HANDLER_KEYS:N$,EV_CHANGE:ql,EV_ADD:Ml,EV_ADD_DIR:D$,EV_ERROR:kA,STR_DATA:k$,STR_END:O$,BRACE_START:L$,STAR:B$}=Fl(),F$="watch",M$=pu(xi.open),OA=pu(xi.stat),q$=pu(xi.lstat),U$=pu(xi.close),$g=pu(xi.realpath),j$={lstat:q$,stat:OA},Hg=(e,t)=>{e instanceof Set?e.forEach(t):t(e);},du=(e,t,r)=>{let n=e[t];n instanceof Set||(e[t]=n=new Set([n])),n.add(r);},$$=e=>t=>{let r=e[t];r instanceof Set?r.clear():delete e[t];},hu=(e,t,r)=>{let n=e[t];n instanceof Set?n.delete(r):n===r&&delete e[t];},LA=e=>e instanceof Set?e.size===0:!e,Ul=new Map;function DA(e,t,r,n,i){let s=(a,o)=>{r(e),i(a,o,{watchedPath:e}),o&&e!==o&&jl(lr.resolve(e,o),qa,lr.join(e,o));};try{return xi.watch(e,t,s)}catch(a){n(a);}}var jl=(e,t,r,n,i)=>{let s=Ul.get(e);s&&Hg(s[t],a=>{a(r,n,i);});},V$=(e,t,r,n)=>{let{listener:i,errHandler:s,rawEmitter:a}=n,o=Ul.get(t),c;if(!r.persistent)return c=DA(e,r,i,s,a),c.close.bind(c);if(o)du(o,qa,i),du(o,jg,s),du(o,fu,a);else {if(c=DA(e,r,jl.bind(null,t,qa),s,jl.bind(null,t,fu)),!c)return;c.on(kA,async l=>{let u=jl.bind(null,t,jg);if(o.watcherUnusable=!0,A$&&l.code==="EPERM")try{let f=await M$(e,"r");await U$(f),u(l);}catch{}else u(l);}),o={listeners:i,errHandlers:s,rawEmitters:a,watcher:c},Ul.set(t,o);}return ()=>{hu(o,qa,i),hu(o,jg,s),hu(o,fu,a),LA(o.listeners)&&(o.watcher.close(),Ul.delete(t),N$.forEach($$(o)),o.watcher=void 0,Object.freeze(o));}},Vg=new Map,H$=(e,t,r,n)=>{let {listener:i,rawEmitter:s}=n,a=Vg.get(t),l=a&&a.options;return l&&(l.persistent<r.persistent||l.interval>r.interval)&&(xi.unwatchFile(t),a=void 0),a?(du(a,qa,i),du(a,fu,s)):(a={listeners:i,rawEmitters:s,options:r,watcher:xi.watchFile(t,r,(u,f)=>{Hg(a.rawEmitters,p=>{p(ql,t,{curr:u,prev:f});});let h=u.mtimeMs;(u.size!==f.size||h>f.mtimeMs||h===0)&&Hg(a.listeners,p=>p(e,u));})},Vg.set(t,a)),()=>{hu(a,qa,i),hu(a,fu,s),LA(a.listeners)&&(Vg.delete(t),xi.unwatchFile(t),a.options=a.watcher=void 0,Object.freeze(a));}},Wg=class{constructor(t){this.fsw=t,this._boundHandleError=r=>t._handleError(r);}_watchWithNodeFs(t,r){let n=this.fsw.options,i=lr.dirname(t),s=lr.basename(t);this.fsw._getWatchedDir(i).add(s);let o=lr.resolve(t),c={persistent:n.persistent};r||(r=I$);let l;return n.usePolling?(c.interval=n.enableBinaryInterval&&T$(s)?n.binaryInterval:n.interval,l=H$(t,o,c,{listener:r,rawEmitter:this.fsw._emitRaw})):l=V$(t,o,c,{listener:r,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),l}_handleFile(t,r,n){if(this.fsw.closed)return;let i=lr.dirname(t),s=lr.basename(t),a=this.fsw._getWatchedDir(i),o=r;if(a.has(s))return;let c=async(u,f)=>{if(this.fsw._throttle(F$,t,5)){if(!f||f.mtimeMs===0)try{let h=await OA(t);if(this.fsw.closed)return;let p=h.atimeMs,m=h.mtimeMs;(!p||p<=m||m!==o.mtimeMs)&&this.fsw._emit(ql,t,h),R$&&o.ino!==h.ino?(this.fsw._closeFile(u),o=h,this.fsw._addPathCloser(u,this._watchWithNodeFs(t,c))):o=h;}catch{this.fsw._remove(i,s);}else if(a.has(s)){let h=f.atimeMs,p=f.mtimeMs;(!h||h<=p||p!==o.mtimeMs)&&this.fsw._emit(ql,t,f),o=f;}}},l=this._watchWithNodeFs(t,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(t)){if(!this.fsw._throttle(Ml,t,0))return;this.fsw._emit(Ml,t,r);}return l}async _handleSymlink(t,r,n,i){if(this.fsw.closed)return;let s=t.fullPath,a=this.fsw._getWatchedDir(r);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let o;try{o=await $g(n);}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(a.has(i)?this.fsw._symlinkPaths.get(s)!==o&&(this.fsw._symlinkPaths.set(s,o),this.fsw._emit(ql,n,t.stats)):(a.add(i),this.fsw._symlinkPaths.set(s,o),this.fsw._emit(Ml,n,t.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(s))return !0;this.fsw._symlinkPaths.set(s,!0);}_handleRead(t,r,n,i,s,a,o){if(t=lr.join(t,P$),!n.hasGlob&&(o=this.fsw._throttle("readdir",t,1e3),!o))return;let c=this.fsw._getWatchedDir(n.path),l=new Set,u=this.fsw._readdirp(t,{fileFilter:f=>n.filterPath(f),directoryFilter:f=>n.filterDir(f),depth:0}).on(k$,async f=>{if(this.fsw.closed){u=void 0;return}let h=f.path,p=lr.join(t,h);if(l.add(h),!(f.stats.isSymbolicLink()&&await this._handleSymlink(f,t,p,h))){if(this.fsw.closed){u=void 0;return}(h===i||!i&&!c.has(h))&&(this.fsw._incrReadyCount(),p=lr.join(s,lr.relative(s,p)),this._addToNodeFs(p,r,n,a+1));}}).on(kA,this._boundHandleError);return new Promise(f=>u.once(O$,()=>{if(this.fsw.closed){u=void 0;return}let h=o?o.clear():!1;f(),c.getChildren().filter(p=>p!==t&&!l.has(p)&&(!n.hasGlob||n.filterPath({fullPath:lr.resolve(t,p)}))).forEach(p=>{this.fsw._remove(t,p);}),u=void 0,h&&this._handleRead(t,!1,n,i,s,a,o);}))}async _handleDir(t,r,n,i,s,a,o){let c=this.fsw._getWatchedDir(lr.dirname(t)),l=c.has(lr.basename(t));!(n&&this.fsw.options.ignoreInitial)&&!s&&!l&&(!a.hasGlob||a.globFilter(t))&&this.fsw._emit(D$,t,r),c.add(lr.basename(t)),this.fsw._getWatchedDir(t);let u,f,h=this.fsw.options.depth;if((h==null||i<=h)&&!this.fsw._symlinkPaths.has(o)){if(!s&&(await this._handleRead(t,n,a,s,t,i,u),this.fsw.closed))return;f=this._watchWithNodeFs(t,(p,m)=>{m&&m.mtimeMs===0||this._handleRead(p,!1,a,s,t,i,u);});}return f}async _addToNodeFs(t,r,n,i,s){let a=this.fsw._emitReady;if(this.fsw._isIgnored(t)||this.fsw.closed)return a(),!1;let o=this.fsw._getWatchHelpers(t,i);!o.hasGlob&&n&&(o.hasGlob=n.hasGlob,o.globFilter=n.globFilter,o.filterPath=c=>n.filterPath(c),o.filterDir=c=>n.filterDir(c));try{let c=await j$[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,c))return a(),!1;let l=this.fsw.options.followSymlinks&&!t.includes(B$)&&!t.includes(L$),u;if(c.isDirectory()){let f=lr.resolve(t),h=l?await $g(t):t;if(this.fsw.closed||(u=await this._handleDir(o.watchPath,c,r,i,s,o,h),this.fsw.closed))return;f!==h&&h!==void 0&&this.fsw._symlinkPaths.set(f,h);}else if(c.isSymbolicLink()){let f=l?await $g(t):t;if(this.fsw.closed)return;let h=lr.dirname(o.watchPath);if(this.fsw._getWatchedDir(h).add(o.watchPath),this.fsw._emit(Ml,o.watchPath,c),u=await this._handleDir(h,c,r,i,t,o,f),this.fsw.closed)return;f!==void 0&&this.fsw._symlinkPaths.set(lr.resolve(t),f);}else u=this._handleFile(o.watchPath,c,r);return a(),this.fsw._addPathCloser(t,u),!1}catch(c){if(this.fsw._handleError(c))return a(),t}}};BA.exports=Wg;});var HA=P((Tre,Jg)=>{var Zg=he("fs"),fr=he("path"),{promisify:Xg}=he("util"),Ua;try{Ua=he("fsevents");}catch(e){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(e);}if(Ua){let e=process.version.match(/v(\d+)\.(\d+)/);if(e&&e[1]&&e[2]){let t=Number.parseInt(e[1],10),r=Number.parseInt(e[2],10);t===8&&r<16&&(Ua=void 0);}}var{EV_ADD:Kg,EV_CHANGE:W$,EV_ADD_DIR:MA,EV_UNLINK:$l,EV_ERROR:K$,STR_DATA:z$,STR_END:G$,FSEVENT_CREATED:Y$,FSEVENT_MODIFIED:Q$,FSEVENT_DELETED:Z$,FSEVENT_MOVED:X$,FSEVENT_UNKNOWN:J$,FSEVENT_TYPE_FILE:eV,FSEVENT_TYPE_DIRECTORY:gu,FSEVENT_TYPE_SYMLINK:VA,ROOT_GLOBSTAR:qA,DIR_SUFFIX:tV,DOT_SLASH:UA,FUNCTION_TYPE:zg,EMPTY_FN:rV,IDENTITY_FN:nV}=Fl(),iV=e=>isNaN(e)?{}:{depth:e},Yg=Xg(Zg.stat),sV=Xg(Zg.lstat),jA=Xg(Zg.realpath),aV={stat:Yg,lstat:sV},js=new Map,oV=10,uV=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),cV=(e,t)=>({stop:Ua.watch(e,t)});function lV(e,t,r,n){let i=fr.extname(t)?fr.dirname(t):t,s=fr.dirname(i),a=js.get(i);fV(s)&&(i=s);let o=fr.resolve(e),c=o!==t,l=(f,h,p)=>{c&&(f=f.replace(t,o)),(f===o||!f.indexOf(o+fr.sep))&&r(f,h,p);},u=!1;for(let f of js.keys())if(t.indexOf(fr.resolve(f)+fr.sep)===0){i=f,a=js.get(i),u=!0;break}return a||u?a.listeners.add(l):(a={listeners:new Set([l]),rawEmitter:n,watcher:cV(i,(f,h)=>{if(!a.listeners.size)return;let p=Ua.getInfo(f,h);a.listeners.forEach(m=>{m(f,h,p);}),a.rawEmitter(p.event,f,p);})},js.set(i,a)),()=>{let f=a.listeners;if(f.delete(l),!f.size&&(js.delete(i),a.watcher))return a.watcher.stop().then(()=>{a.rawEmitter=a.watcher=void 0,Object.freeze(a);})}}var fV=e=>{let t=0;for(let r of js.keys())if(r.indexOf(e)===0&&(t++,t>=oV))return !0;return !1},dV=()=>Ua&&js.size<128,Gg=(e,t)=>{let r=0;for(;!e.indexOf(t)&&(e=fr.dirname(e))!==t;)r++;return r},$A=(e,t)=>e.type===gu&&t.isDirectory()||e.type===VA&&t.isSymbolicLink()||e.type===eV&&t.isFile(),Qg=class{constructor(t){this.fsw=t;}checkIgnored(t,r){let n=this.fsw._ignoredPaths;if(this.fsw._isIgnored(t,r))return n.add(t),r&&r.isDirectory()&&n.add(t+qA),!0;n.delete(t),n.delete(t+qA);}addOrChange(t,r,n,i,s,a,o,c){let l=s.has(a)?W$:Kg;this.handleEvent(l,t,r,n,i,s,a,o,c);}async checkExists(t,r,n,i,s,a,o,c){try{let l=await Yg(t);if(this.fsw.closed)return;$A(o,l)?this.addOrChange(t,r,n,i,s,a,o,c):this.handleEvent($l,t,r,n,i,s,a,o,c);}catch(l){l.code==="EACCES"?this.addOrChange(t,r,n,i,s,a,o,c):this.handleEvent($l,t,r,n,i,s,a,o,c);}}handleEvent(t,r,n,i,s,a,o,c,l){if(!(this.fsw.closed||this.checkIgnored(r)))if(t===$l){let u=c.type===gu;(u||a.has(o))&&this.fsw._remove(s,o,u);}else {if(t===Kg){if(c.type===gu&&this.fsw._getWatchedDir(r),c.type===VA&&l.followSymlinks){let f=l.depth===void 0?void 0:Gg(n,i)+1;return this._addToFsEvents(r,!1,!0,f)}this.fsw._getWatchedDir(s).add(o);}let u=c.type===gu?t+tV:t;this.fsw._emit(u,r),u===MA&&this._addToFsEvents(r,!1,!0);}}_watchWithFsEvents(t,r,n,i){if(this.fsw.closed||this.fsw._isIgnored(t))return;let s=this.fsw.options,o=lV(t,r,async(c,l,u)=>{if(this.fsw.closed||s.depth!==void 0&&Gg(c,r)>s.depth)return;let f=n(fr.join(t,fr.relative(t,c)));if(i&&!i(f))return;let h=fr.dirname(f),p=fr.basename(f),m=this.fsw._getWatchedDir(u.type===gu?f:h);if(uV.has(l)||u.event===J$)if(typeof s.ignored===zg){let _;try{_=await Yg(f);}catch{}if(this.fsw.closed||this.checkIgnored(f,_))return;$A(u,_)?this.addOrChange(f,c,r,h,m,p,u,s):this.handleEvent($l,f,c,r,h,m,p,u,s);}else this.checkExists(f,c,r,h,m,p,u,s);else switch(u.event){case Y$:case Q$:return this.addOrChange(f,c,r,h,m,p,u,s);case Z$:case X$:return this.checkExists(f,c,r,h,m,p,u,s)}},this.fsw._emitRaw);return this.fsw._emitReady(),o}async _handleFsEventsSymlink(t,r,n,i){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(r))){this.fsw._symlinkPaths.set(r,!0),this.fsw._incrReadyCount();try{let s=await jA(t);if(this.fsw.closed)return;if(this.fsw._isIgnored(s))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(s||t,a=>{let o=t;return s&&s!==UA?o=a.replace(s,t):a!==UA&&(o=fr.join(t,a)),n(o)},!1,i);}catch(s){if(this.fsw._handleError(s))return this.fsw._emitReady()}}}emitAdd(t,r,n,i,s){let a=n(t),o=r.isDirectory(),c=this.fsw._getWatchedDir(fr.dirname(a)),l=fr.basename(a);o&&this.fsw._getWatchedDir(a),!c.has(l)&&(c.add(l),(!i.ignoreInitial||s===!0)&&this.fsw._emit(o?MA:Kg,a,r));}initWatch(t,r,n,i){if(this.fsw.closed)return;let s=this._watchWithFsEvents(n.watchPath,fr.resolve(t||n.watchPath),i,n.globFilter);this.fsw._addPathCloser(r,s);}async _addToFsEvents(t,r,n,i){if(this.fsw.closed)return;let s=this.fsw.options,a=typeof r===zg?r:nV,o=this.fsw._getWatchHelpers(t);try{let c=await aV[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,c))throw null;if(c.isDirectory()){if(o.globFilter||this.emitAdd(a(t),c,a,s,n),i&&i>s.depth)return;this.fsw._readdirp(o.watchPath,{fileFilter:l=>o.filterPath(l),directoryFilter:l=>o.filterDir(l),...iV(s.depth-(i||0))}).on(z$,l=>{if(this.fsw.closed||l.stats.isDirectory()&&!o.filterPath(l))return;let u=fr.join(o.watchPath,l.path),{fullPath:f}=l;if(o.followSymlinks&&l.stats.isSymbolicLink()){let h=s.depth===void 0?void 0:Gg(u,fr.resolve(o.watchPath))+1;this._handleFsEventsSymlink(u,f,a,h);}else this.emitAdd(u,l.stats,a,s,n);}).on(K$,rV).on(G$,()=>{this.fsw._emitReady();});}else this.emitAdd(o.watchPath,c,a,s,n),this.fsw._emitReady();}catch(c){(!c||this.fsw._handleError(c))&&(this.fsw._emitReady(),this.fsw._emitReady());}if(s.persistent&&n!==!0)if(typeof r===zg)this.initWatch(void 0,t,o,a);else {let c;try{c=await jA(o.watchPath);}catch{}this.initWatch(c,t,o,a);}}};Jg.exports=Qg;Jg.exports.canUse=dV;});var gm=P(pm=>{var{EventEmitter:hV}=he("events"),dm=he("fs"),At=he("path"),{promisify:ZA}=he("util"),pV=PT(),sm=FT().default,gV=VT(),em=kg(),mV=TA(),yV=Ng(),vV=FA(),WA=HA(),{EV_ALL:tm,EV_READY:_V,EV_ADD:Vl,EV_CHANGE:mu,EV_UNLINK:KA,EV_ADD_DIR:bV,EV_UNLINK_DIR:SV,EV_RAW:EV,EV_ERROR:rm,STR_CLOSE:wV,STR_END:CV,BACK_SLASH_RE:xV,DOUBLE_SLASH_RE:zA,SLASH_OR_BACK_SLASH_RE:TV,DOT_RE:AV,REPLACER_RE:RV,SLASH:nm,SLASH_SLASH:IV,BRACE_START:PV,BANG:am,ONE_DOT:XA,TWO_DOTS:NV,GLOBSTAR:DV,SLASH_GLOBSTAR:im,ANYMATCH_OPTS:om,STRING_TYPE:hm,FUNCTION_TYPE:kV,EMPTY_STR:um,EMPTY_FN:OV,isWindows:LV,isMacos:BV,isIBMi:FV}=Fl(),MV=ZA(dm.stat),qV=ZA(dm.readdir),cm=(e=[])=>Array.isArray(e)?e:[e],JA=(e,t=[])=>(e.forEach(r=>{Array.isArray(r)?JA(r,t):t.push(r);}),t),GA=e=>{let t=JA(cm(e));if(!t.every(r=>typeof r===hm))throw new TypeError(`Non-string provided as watch path: ${t}`);return t.map(eR)},YA=e=>{let t=e.replace(xV,nm),r=!1;for(t.startsWith(IV)&&(r=!0);t.match(zA);)t=t.replace(zA,nm);return r&&(t=nm+t),t},eR=e=>YA(At.normalize(YA(e))),QA=(e=um)=>t=>typeof t!==hm?t:eR(At.isAbsolute(t)?t:At.join(e,t)),UV=(e,t)=>At.isAbsolute(e)?e:e.startsWith(am)?am+At.join(t,e.slice(1)):At.join(t,e),$n=(e,t)=>e[t]===void 0,lm=class{constructor(t,r){this.path=t,this._removeWatcher=r,this.items=new Set;}add(t){let{items:r}=this;r&&t!==XA&&t!==NV&&r.add(t);}async remove(t){let{items:r}=this;if(!r||(r.delete(t),r.size>0))return;let n=this.path;try{await qV(n);}catch{this._removeWatcher&&this._removeWatcher(At.dirname(n),At.basename(n));}}has(t){let{items:r}=this;if(r)return r.has(t)}getChildren(){let{items:t}=this;if(t)return [...t.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this);}},jV="stat",$V="lstat",fm=class{constructor(t,r,n,i){this.fsw=i,this.path=t=t.replace(RV,um),this.watchPath=r,this.fullWatchPath=At.resolve(r),this.hasGlob=r!==t,t===um&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?sm(t,void 0,om):!1,this.dirParts=this.getDirParts(t),this.dirParts.forEach(s=>{s.length>1&&s.pop();}),this.followSymlinks=n,this.statMethod=n?jV:$V;}checkGlobSymlink(t){return this.globSymlink===void 0&&(this.globSymlink=t.fullParentDir===this.fullWatchPath?!1:{realPath:t.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?t.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):t.fullPath}entryPath(t){return At.join(this.watchPath,At.relative(this.watchPath,this.checkGlobSymlink(t)))}filterPath(t){let{stats:r}=t;if(r&&r.isSymbolicLink())return this.filterDir(t);let n=this.entryPath(t);return (this.hasGlob&&typeof this.globFilter===kV?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,r)&&this.fsw._hasReadPermissions(r)}getDirParts(t){if(!this.hasGlob)return [];let r=[];return (t.includes(PV)?mV.expand(t):[t]).forEach(i=>{r.push(At.relative(this.watchPath,i).split(TV));}),r}filterDir(t){if(this.hasGlob){let r=this.getDirParts(this.checkGlobSymlink(t)),n=!1;this.unmatchedGlob=!this.dirParts.some(i=>i.every((s,a)=>(s===DV&&(n=!0),n||!r[0][a]||sm(s,r[0][a],om))));}return !this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(t),t.stats)}},Hl=class extends hV{constructor(t){super();let r={};t&&Object.assign(r,t),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,$n(r,"persistent")&&(r.persistent=!0),$n(r,"ignoreInitial")&&(r.ignoreInitial=!1),$n(r,"ignorePermissionErrors")&&(r.ignorePermissionErrors=!1),$n(r,"interval")&&(r.interval=100),$n(r,"binaryInterval")&&(r.binaryInterval=300),$n(r,"disableGlobbing")&&(r.disableGlobbing=!1),r.enableBinaryInterval=r.binaryInterval!==r.interval,$n(r,"useFsEvents")&&(r.useFsEvents=!r.usePolling),WA.canUse()||(r.useFsEvents=!1),$n(r,"usePolling")&&!r.useFsEvents&&(r.usePolling=BV),FV&&(r.usePolling=!0);let i=process.env.CHOKIDAR_USEPOLLING;if(i!==void 0){let c=i.toLowerCase();c==="false"||c==="0"?r.usePolling=!1:c==="true"||c==="1"?r.usePolling=!0:r.usePolling=!!c;}let s=process.env.CHOKIDAR_INTERVAL;s&&(r.interval=Number.parseInt(s,10)),$n(r,"atomic")&&(r.atomic=!r.usePolling&&!r.useFsEvents),r.atomic&&(this._pendingUnlinks=new Map),$n(r,"followSymlinks")&&(r.followSymlinks=!0),$n(r,"awaitWriteFinish")&&(r.awaitWriteFinish=!1),r.awaitWriteFinish===!0&&(r.awaitWriteFinish={});let a=r.awaitWriteFinish;a&&(a.stabilityThreshold||(a.stabilityThreshold=2e3),a.pollInterval||(a.pollInterval=100),this._pendingWrites=new Map),r.ignored&&(r.ignored=cm(r.ignored));let o=0;this._emitReady=()=>{o++,o>=this._readyCount&&(this._emitReady=OV,this._readyEmitted=!0,process.nextTick(()=>this.emit(_V)));},this._emitRaw=(...c)=>this.emit(EV,...c),this._readyEmitted=!1,this.options=r,r.useFsEvents?this._fsEventsHandler=new WA(this):this._nodeFsHandler=new vV(this),Object.freeze(r);}add(t,r,n){let{cwd:i,disableGlobbing:s}=this.options;this.closed=!1;let a=GA(t);return i&&(a=a.map(o=>{let c=UV(o,i);return s||!em(o)?c:yV(c)})),a=a.filter(o=>o.startsWith(am)?(this._ignoredPaths.add(o.slice(1)),!1):(this._ignoredPaths.delete(o),this._ignoredPaths.delete(o+im),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=a.length),this.options.persistent&&(this._readyCount*=2),a.forEach(o=>this._fsEventsHandler._addToFsEvents(o))):(this._readyCount||(this._readyCount=0),this._readyCount+=a.length,Promise.all(a.map(async o=>{let c=await this._nodeFsHandler._addToNodeFs(o,!n,0,0,r);return c&&this._emitReady(),c})).then(o=>{this.closed||o.filter(c=>c).forEach(c=>{this.add(At.dirname(c),At.basename(r||c));});})),this}unwatch(t){if(this.closed)return this;let r=GA(t),{cwd:n}=this.options;return r.forEach(i=>{!At.isAbsolute(i)&&!this._closers.has(i)&&(n&&(i=At.join(n,i)),i=At.resolve(i)),this._closePath(i),this._ignoredPaths.add(i),this._watched.has(i)&&this._ignoredPaths.add(i+im),this._userIgnored=void 0;}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let t=[];return this._closers.forEach(r=>r.forEach(n=>{let i=n();i instanceof Promise&&t.push(i);})),this._streams.forEach(r=>r.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(r=>r.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(r=>{this[`_${r}`].clear();}),this._closePromise=t.length?Promise.all(t).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let t={};return this._watched.forEach((r,n)=>{let i=this.options.cwd?At.relative(this.options.cwd,n):n;t[i||XA]=r.getChildren().sort();}),t}emitWithAll(t,r){this.emit(...r),t!==rm&&this.emit(tm,...r);}async _emit(t,r,n,i,s){if(this.closed)return;let a=this.options;LV&&(r=At.normalize(r)),a.cwd&&(r=At.relative(a.cwd,r));let o=[t,r];s!==void 0?o.push(n,i,s):i!==void 0?o.push(n,i):n!==void 0&&o.push(n);let c=a.awaitWriteFinish,l;if(c&&(l=this._pendingWrites.get(r)))return l.lastChange=new Date,this;if(a.atomic){if(t===KA)return this._pendingUnlinks.set(r,o),setTimeout(()=>{this._pendingUnlinks.forEach((u,f)=>{this.emit(...u),this.emit(tm,...u),this._pendingUnlinks.delete(f);});},typeof a.atomic=="number"?a.atomic:100),this;t===Vl&&this._pendingUnlinks.has(r)&&(t=o[0]=mu,this._pendingUnlinks.delete(r));}if(c&&(t===Vl||t===mu)&&this._readyEmitted){let u=(f,h)=>{f?(t=o[0]=rm,o[1]=f,this.emitWithAll(t,o)):h&&(o.length>2?o[2]=h:o.push(h),this.emitWithAll(t,o));};return this._awaitWriteFinish(r,c.stabilityThreshold,t,u),this}if(t===mu&&!this._throttle(mu,r,50))return this;if(a.alwaysStat&&n===void 0&&(t===Vl||t===bV||t===mu)){let u=a.cwd?At.join(a.cwd,r):r,f;try{f=await MV(u);}catch{}if(!f||this.closed)return;o.push(f);}return this.emitWithAll(t,o),this}_handleError(t){let r=t&&t.code;return t&&r!=="ENOENT"&&r!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||r!=="EPERM"&&r!=="EACCES")&&this.emit(rm,t),t||this.closed}_throttle(t,r,n){this._throttled.has(t)||this._throttled.set(t,new Map);let i=this._throttled.get(t),s=i.get(r);if(s)return s.count++,!1;let a,o=()=>{let l=i.get(r),u=l?l.count:0;return i.delete(r),clearTimeout(a),l&&clearTimeout(l.timeoutObject),u};a=setTimeout(o,n);let c={timeoutObject:a,clear:o,count:0};return i.set(r,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(t,r,n,i){let s,a=t;this.options.cwd&&!At.isAbsolute(t)&&(a=At.join(this.options.cwd,t));let o=new Date,c=l=>{dm.stat(a,(u,f)=>{if(u||!this._pendingWrites.has(t)){u&&u.code!=="ENOENT"&&i(u);return}let h=Number(new Date);l&&f.size!==l.size&&(this._pendingWrites.get(t).lastChange=h);let p=this._pendingWrites.get(t);h-p.lastChange>=r?(this._pendingWrites.delete(t),i(void 0,f)):s=setTimeout(c,this.options.awaitWriteFinish.pollInterval,f);});};this._pendingWrites.has(t)||(this._pendingWrites.set(t,{lastChange:o,cancelWait:()=>(this._pendingWrites.delete(t),clearTimeout(s),n)}),s=setTimeout(c,this.options.awaitWriteFinish.pollInterval));}_getGlobIgnored(){return [...this._ignoredPaths.values()]}_isIgnored(t,r){if(this.options.atomic&&AV.test(t))return !0;if(!this._userIgnored){let{cwd:n}=this.options,i=this.options.ignored,s=i&&i.map(QA(n)),a=cm(s).filter(c=>typeof c===hm&&!em(c)).map(c=>c+im),o=this._getGlobIgnored().map(QA(n)).concat(s,a);this._userIgnored=sm(o,void 0,om);}return this._userIgnored([t,r])}_isntIgnored(t,r){return !this._isIgnored(t,r)}_getWatchHelpers(t,r){let n=r||this.options.disableGlobbing||!em(t)?t:gV(t),i=this.options.followSymlinks;return new fm(t,n,i,this)}_getWatchedDir(t){this._boundRemove||(this._boundRemove=this._remove.bind(this));let r=At.resolve(t);return this._watched.has(r)||this._watched.set(r,new lm(r,this._boundRemove)),this._watched.get(r)}_hasReadPermissions(t){if(this.options.ignorePermissionErrors)return !0;let n=(t&&Number.parseInt(t.mode,10))&511;return !!(4&Number.parseInt(n.toString(8)[0],10))}_remove(t,r,n){let i=At.join(t,r),s=At.resolve(i);if(n=n??(this._watched.has(i)||this._watched.has(s)),!this._throttle("remove",i,100))return;!n&&!this.options.useFsEvents&&this._watched.size===1&&this.add(t,r,!0),this._getWatchedDir(i).getChildren().forEach(h=>this._remove(i,h));let c=this._getWatchedDir(t),l=c.has(r);c.remove(r),this._symlinkPaths.has(s)&&this._symlinkPaths.delete(s);let u=i;if(this.options.cwd&&(u=At.relative(this.options.cwd,i)),this.options.awaitWriteFinish&&this._pendingWrites.has(u)&&this._pendingWrites.get(u).cancelWait()===Vl)return;this._watched.delete(i),this._watched.delete(s);let f=n?SV:KA;l&&!this._isIgnored(i)&&this._emit(f,i),this.options.useFsEvents||this._closePath(i);}_closePath(t){this._closeFile(t);let r=At.dirname(t);this._getWatchedDir(r).remove(At.basename(t));}_closeFile(t){let r=this._closers.get(t);r&&(r.forEach(n=>n()),this._closers.delete(t));}_addPathCloser(t,r){if(!r)return;let n=this._closers.get(t);n||(n=[],this._closers.set(t,n)),n.push(r);}_readdirp(t,r){if(this.closed)return;let n={type:tm,alwaysStat:!0,lstat:!0,...r},i=pV(t,n);return this._streams.add(i),i.once(wV,()=>{i=void 0;}),i.once(CV,()=>{i&&(this._streams.delete(i),i=void 0);}),i}};pm.FSWatcher=Hl;var VV=(e,t)=>{let r=new Hl(t);return r.add(e),r};pm.watch=VV;});var sR={};Iq(sR,{closest:()=>YV,distance:()=>iR});var Ti,zV,GV,iR,YV,aR=iS(()=>{Ti=new Uint32Array(65536),zV=(e,t)=>{let r=e.length,n=t.length,i=1<<r-1,s=-1,a=0,o=r,c=r;for(;c--;)Ti[e.charCodeAt(c)]|=1<<c;for(c=0;c<n;c++){let l=Ti[t.charCodeAt(c)],u=l|a;l|=(l&s)+s^s,a|=~(l|s),s&=l,a&i&&o++,s&i&&o--,a=a<<1|1,s=s<<1|~(u|a),a&=u;}for(c=r;c--;)Ti[e.charCodeAt(c)]=0;return o},GV=(e,t)=>{let r=t.length,n=e.length,i=[],s=[],a=Math.ceil(r/32),o=Math.ceil(n/32);for(let m=0;m<a;m++)s[m]=-1,i[m]=0;let c=0;for(;c<o-1;c++){let m=0,_=-1,E=c*32,w=Math.min(32,n)+E;for(let y=E;y<w;y++)Ti[e.charCodeAt(y)]|=1<<y;for(let y=0;y<r;y++){let b=Ti[t.charCodeAt(y)],N=s[y/32|0]>>>y&1,L=i[y/32|0]>>>y&1,V=b|m,X=((b|L)&_)+_^_|b|L,z=m|~(X|_),G=_&X;z>>>31^N&&(s[y/32|0]^=1<<y),G>>>31^L&&(i[y/32|0]^=1<<y),z=z<<1|N,G=G<<1|L,_=G|~(V|z),m=z&V;}for(let y=E;y<w;y++)Ti[e.charCodeAt(y)]=0;}let l=0,u=-1,f=c*32,h=Math.min(32,n-f)+f;for(let m=f;m<h;m++)Ti[e.charCodeAt(m)]|=1<<m;let p=n;for(let m=0;m<r;m++){let _=Ti[t.charCodeAt(m)],E=s[m/32|0]>>>m&1,w=i[m/32|0]>>>m&1,y=_|l,b=((_|w)&u)+u^u|_|w,N=l|~(b|u),L=u&b;p+=N>>>n-1&1,p-=L>>>n-1&1,N>>>31^E&&(s[m/32|0]^=1<<m),L>>>31^w&&(i[m/32|0]^=1<<m),N=N<<1|E,L=L<<1|w,u=L|~(y|N),l=N&y;}for(let m=f;m<h;m++)Ti[e.charCodeAt(m)]=0;return p},iR=(e,t)=>{if(e.length<t.length){let r=t;t=e,e=r;}return t.length===0?e.length:e.length<=32?zV(e,t):GV(e,t)},YV=(e,t)=>{let r=1/0,n=0;for(let i=0;i<t.length;i++){let s=iR(e,t[i]);s<r&&(r=s,n=i);}return t[n]};});var oR=P((bm,yu)=>{(function(){var e;try{e=typeof Intl<"u"&&typeof Intl.Collator<"u"?Intl.Collator("generic",{sensitivity:"base"}):null;}catch{console.log("Collator could not be initialized and wouldn't be used");}var t=(aR(),Pq(sR)),r=[],n=[],i={get:function(s,a,o){var c=o&&e&&o.useCollator;if(c){var l=s.length,u=a.length;if(l===0)return u;if(u===0)return l;var f,h,p,m,_;for(p=0;p<u;++p)r[p]=p,n[p]=a.charCodeAt(p);r[u]=u;var E;for(p=0;p<l;++p){for(h=p+1,m=0;m<u;++m)f=h,E=e.compare(s.charAt(p),String.fromCharCode(n[m]))===0,h=r[m]+(E?0:1),_=f+1,h>_&&(h=_),_=r[m+1]+1,h>_&&(h=_),r[m]=f;r[m]=h;}return h}return t.distance(s,a)}};typeof define<"u"&&define!==null&&define.amd?define(function(){return i}):typeof yu<"u"&&yu!==null&&typeof bm<"u"&&yu.exports===bm?yu.exports=i:typeof self<"u"&&typeof self.postMessage=="function"&&typeof self.importScripts=="function"?self.Levenshtein=i:typeof window<"u"&&window!==null&&(window.Levenshtein=i);})();});var Tm=P((Bre,hR)=>{var bu=e=>e&&typeof e.message=="string",xm=e=>{if(!e)return;let t=e.cause;if(typeof t=="function"){let r=e.cause();return bu(r)?r:void 0}else return bu(t)?t:void 0},fR=(e,t)=>{if(!bu(e))return "";let r=e.stack||"";if(t.has(e))return r+`
causes have become circular...`;let n=xm(e);return n?(t.add(e),r+`
caused by: `+fR(n,t)):r},XV=e=>fR(e,new Set),dR=(e,t,r)=>{if(!bu(e))return "";let n=r?"":e.message||"";if(t.has(e))return n+": ...";let i=xm(e);if(i){t.add(e);let s=typeof e.cause=="function";return n+(s?"":": ")+dR(i,t,s)}else return n},JV=e=>dR(e,new Set);hR.exports={isErrorLike:bu,getErrorCause:xm,stackWithCauses:XV,messageWithCauses:JV};});var Am=P((Fre,gR)=>{var eH=Symbol("circular-ref-tag"),Yl=Symbol("pino-raw-err-ref"),pR=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[Yl]},set:function(e){this[Yl]=e;}}});Object.defineProperty(pR,Yl,{writable:!0,value:{}});gR.exports={pinoErrProto:pR,pinoErrorSymbols:{seen:eH,rawSymbol:Yl}};});var vR=P((Mre,yR)=>{yR.exports=Im;var{messageWithCauses:tH,stackWithCauses:rH,isErrorLike:mR}=Tm(),{pinoErrProto:nH,pinoErrorSymbols:iH}=Am(),{seen:Rm}=iH,{toString:sH}=Object.prototype;function Im(e){if(!mR(e))return e;e[Rm]=void 0;let t=Object.create(nH);t.type=sH.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=tH(e),t.stack=rH(e),Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(r=>Im(r)));for(let r in e)if(t[r]===void 0){let n=e[r];mR(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,Rm)&&(t[r]=Im(n)):t[r]=n;}return delete e[Rm],t.raw=e,t}});var bR=P((qre,_R)=>{_R.exports=Zl;var{isErrorLike:Pm}=Tm(),{pinoErrProto:aH,pinoErrorSymbols:oH}=Am(),{seen:Ql}=oH,{toString:uH}=Object.prototype;function Zl(e){if(!Pm(e))return e;e[Ql]=void 0;let t=Object.create(aH);t.type=uH.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=e.message,t.stack=e.stack,Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(r=>Zl(r))),Pm(e.cause)&&!Object.prototype.hasOwnProperty.call(e.cause,Ql)&&(t.cause=Zl(e.cause));for(let r in e)if(t[r]===void 0){let n=e[r];Pm(n)?Object.prototype.hasOwnProperty.call(n,Ql)||(t[r]=Zl(n)):t[r]=n;}return delete e[Ql],t.raw=e,t}});var CR=P((Ure,wR)=>{wR.exports={mapHttpRequest:cH,reqSerializer:ER};var Nm=Symbol("pino-raw-req-ref"),SR=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Nm]},set:function(e){this[Nm]=e;}}});Object.defineProperty(SR,Nm,{writable:!0,value:{}});function ER(e){let t=e.info||e.socket,r=Object.create(SR);if(r.id=typeof e.id=="function"?e.id():e.id||(e.info?e.info.id:void 0),r.method=e.method,e.originalUrl)r.url=e.originalUrl;else {let n=e.path;r.url=typeof n=="string"?n:e.url?e.url.path||e.url:void 0;}return e.query&&(r.query=e.query),e.params&&(r.params=e.params),r.headers=e.headers,r.remoteAddress=t&&t.remoteAddress,r.remotePort=t&&t.remotePort,r.raw=e.raw||e,r}function cH(e){return {req:ER(e)}}});var RR=P((jre,AR)=>{AR.exports={mapHttpResponse:lH,resSerializer:TR};var Dm=Symbol("pino-raw-res-ref"),xR=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Dm]},set:function(e){this[Dm]=e;}}});Object.defineProperty(xR,Dm,{writable:!0,value:{}});function TR(e){let t=Object.create(xR);return t.statusCode=e.headersSent?e.statusCode:null,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function lH(e){return {res:TR(e)}}});var Om=P(($re,IR)=>{var km=vR(),fH=bR(),Xl=CR(),Jl=RR();IR.exports={err:km,errWithCause:fH,mapHttpRequest:Xl.mapHttpRequest,mapHttpResponse:Jl.mapHttpResponse,req:Xl.reqSerializer,res:Jl.resSerializer,wrapErrorSerializer:function(t){return t===km?t:function(n){return t(km(n))}},wrapRequestSerializer:function(t){return t===Xl.reqSerializer?t:function(n){return t(Xl.reqSerializer(n))}},wrapResponseSerializer:function(t){return t===Jl.resSerializer?t:function(n){return t(Jl.resSerializer(n))}}};});var Lm=P((Vre,PR)=>{function dH(e,t){return t}PR.exports=function(){let t=Error.prepareStackTrace;Error.prepareStackTrace=dH;let r=new Error().stack;if(Error.prepareStackTrace=t,!Array.isArray(r))return;let n=r.slice(2),i=[];for(let s of n)s&&i.push(s.getFileName());return i};});var DR=P((Hre,NR)=>{NR.exports=hH;function hH(e={}){let{ERR_PATHS_MUST_BE_STRINGS:t=()=>"fast-redact - Paths must be (non-empty) strings",ERR_INVALID_PATH:r=n=>`fast-redact \u2013 Invalid path (${n})`}=e;return function({paths:i}){i.forEach(s=>{if(typeof s!="string")throw Error(t());try{if(/〇/.test(s))throw Error();let a=(s[0]==="["?"":".")+s.replace(/^\*/,"\u3007").replace(/\.\*/g,".\u3007").replace(/\[\*\]/g,"[\u3007]");if(/\n|\r|;/.test(a)||/\/\*/.test(a))throw Error();Function(`
            'use strict'
            const o = new Proxy({}, { get: () => o, set: () => { throw Error() } });
            const \u3007 = null;
            o${a}
            if ([o${a}].length !== 1) throw Error()`)();}catch{throw Error(r(s))}});}}});var ef=P((Wre,kR)=>{kR.exports=/[^.[\]]+|\[((?:.)*?)\]/g;});var LR=P((Kre,OR)=>{var pH=ef();OR.exports=gH;function gH({paths:e}){let t=[];var r=0;let n=e.reduce(function(i,s,a){var o=s.match(pH).map(u=>u.replace(/'|"|`/g,""));let c=s[0]==="[";o=o.map(u=>u[0]==="["?u.substr(1,u.length-2):u);let l=o.indexOf("*");if(l>-1){let u=o.slice(0,l),f=u.join("."),h=o.slice(l+1,o.length),p=h.length>0;r++,t.push({before:u,beforeStr:f,after:h,nested:p});}else i[s]={path:o,val:void 0,precensored:!1,circle:"",escPath:JSON.stringify(s),leadingBracket:c};return i},{});return {wildcards:t,wcLen:r,secret:n}}});var FR=P((zre,BR)=>{var mH=ef();BR.exports=yH;function yH({secret:e,serialize:t,wcLen:r,strict:n,isCensorFct:i,censorFctTakesPath:s},a){let o=Function("o",`
    if (typeof o !== 'object' || o == null) {
      ${SH(n,t)}
    }
    const { censor, secret } = this
    ${vH(e,i,s)}
    this.compileRestore()
    ${_H(r>0,i,s)}
    ${bH(t)}
  `).bind(a);return t===!1&&(o.restore=c=>a.restore(c)),o}function vH(e,t,r){return Object.keys(e).map(n=>{let{escPath:i,leadingBracket:s,path:a}=e[n],o=s?1:0,c=s?"":".",l=[];for(var u;(u=mH.exec(n))!==null;){let[,m]=u,{index:_,input:E}=u;_>o&&l.push(E.substring(0,_-(m?0:1)));}var f=l.map(m=>`o${c}${m}`).join(" && ");f.length===0?f+=`o${c}${n} != null`:f+=` && o${c}${n} != null`;let h=`
      switch (true) {
        ${l.reverse().map(m=>`
          case o${c}${m} === censor:
            secret[${i}].circle = ${JSON.stringify(m)}
            break
        `).join(`
`)}
      }
    `,p=r?`val, ${JSON.stringify(a)}`:"val";return `
      if (${f}) {
        const val = o${c}${n}
        if (val === censor) {
          secret[${i}].precensored = true
        } else {
          secret[${i}].val = val
          o${c}${n} = ${t?`censor(${p})`:"censor"}
          ${h}
        }
      }
    `}).join(`
`)}function _H(e,t,r){return e===!0?`
    {
      const { wildcards, wcLen, groupRedact, nestedRedact } = this
      for (var i = 0; i < wcLen; i++) {
        const { before, beforeStr, after, nested } = wildcards[i]
        if (nested === true) {
          secret[beforeStr] = secret[beforeStr] || []
          nestedRedact(secret[beforeStr], o, before, after, censor, ${t}, ${r})
        } else secret[beforeStr] = groupRedact(o, before, censor, ${t}, ${r})
      }
    }
  `:""}function bH(e){return e===!1?"return o":`
    var s = this.serialize(o)
    this.restore(o)
    return s
  `}function SH(e,t){return e===!0?"throw Error('fast-redact: primitives cannot be redacted')":t===!1?"return o":"return this.serialize(o)"}});var Fm=P((Gre,UR)=>{UR.exports={groupRedact:wH,groupRestore:EH,nestedRedact:xH,nestedRestore:CH};function EH({keys:e,values:t,target:r}){if(r==null)return;let n=e.length;for(var i=0;i<n;i++){let s=e[i];r[s]=t[i];}}function wH(e,t,r,n,i){let s=MR(e,t);if(s==null)return {keys:null,values:null,target:null,flat:!0};let a=Object.keys(s),o=a.length,c=t.length,l=i?[...t]:void 0,u=new Array(o);for(var f=0;f<o;f++){let h=a[f];u[f]=s[h],i?(l[c]=h,s[h]=r(s[h],l)):n?s[h]=r(s[h]):s[h]=r;}return {keys:a,values:u,target:s,flat:!0}}function CH(e){for(let t=0;t<e.length;t++){let{target:r,path:n,value:i}=e[t],s=r;for(let a=n.length-1;a>0;a--)s=s[n[a]];s[n[0]]=i;}}function xH(e,t,r,n,i,s,a){let o=MR(t,r);if(o==null)return;let c=Object.keys(o),l=c.length;for(var u=0;u<l;u++){let f=c[u];TH(e,o,f,r,n,i,s,a);}return e}function Bm(e,t){return e!=null?"hasOwn"in Object?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t):!1}function TH(e,t,r,n,i,s,a,o){let c=i.length,l=c-1,u=r;var f=-1,h,p,m,E=null,w,y,b=!1,N=0,L=0,V=AH();if(m=h=t[r],typeof h=="object"){for(;h!=null&&++f<c&&(L+=1,r=i[f],!(r!=="*"&&!E&&!(typeof h=="object"&&r in h)));)if(!(r==="*"&&(E==="*"&&(b=!0),E=r,f!==l))){if(E){let z=Object.keys(h);for(var X=0;X<z.length;X++){let G=z[X];if(y=h[G],w=r==="*",b)V=Ri(V,G,L),N=f,m=qR(y,N-1,r,n,i,s,a,o,u,h,p,m,w,G,f,l,V,e,t[u],L+1);else if(w||typeof y=="object"&&y!==null&&r in y){if(w?m=y:m=y[r],p=f!==l?m:a?o?s(m,[...n,u,...i]):s(m):s,w){let ee=Su(Ri(V,G,L),m,t[u]);e.push(ee),h[G]=p;}else if(y[r]!==p)if(p===void 0&&s!==void 0||Bm(y,r)&&p===m)V=Ri(V,G,L);else {V=Ri(V,G,L);let ee=Su(Ri(V,r,L+1),m,t[u]);e.push(ee),y[r]=p;}}}E=null;}else {if(m=h[r],V=Ri(V,r,L),p=f!==l?m:a?o?s(m,[...n,u,...i]):s(m):s,!(Bm(h,r)&&p===m||p===void 0&&s!==void 0)){let z=Su(V,m,t[u]);e.push(z),h[r]=p;}h=h[r];}if(typeof h!="object")break}}}function MR(e,t){for(var r=-1,n=t.length,i=e;i!=null&&++r<n;)i=i[t[r]];return i}function qR(e,t,r,n,i,s,a,o,c,l,u,f,h,p,m,_,E,w,y,b){if(t===0&&(h||typeof e=="object"&&e!==null&&r in e)){if(h?f=e:f=e[r],u=m!==_?f:a?o?s(f,[...n,c,...i]):s(f):s,h){let N=Su(E,f,y);w.push(N),l[p]=u;}else if(e[r]!==u){if(!(u===void 0&&s!==void 0||Bm(e,r)&&u===f)){let N=Su(Ri(E,r,b+1),f,y);w.push(N),e[r]=u;}}}for(let N in e)typeof e[N]=="object"&&(E=Ri(E,N,b),qR(e[N],t-1,r,n,i,s,a,o,c,l,u,f,h,p,m,_,E,w,y,b+1));}function AH(){return {parent:null,key:null,children:[],depth:0}}function Ri(e,t,r){if(e.depth===r)return Ri(e.parent,t,r);var n={parent:e,key:t,depth:r,children:[]};return e.children.push(n),n}function Su(e,t,r){let n=e,i=[];do i.push(n.key),n=n.parent;while(n.parent!=null);return {path:i,value:t,target:r}}});var $R=P((Yre,jR)=>{var{groupRestore:RH,nestedRestore:IH}=Fm();jR.exports=PH;function PH({secret:e,wcLen:t}){return function(){if(this.restore)return;let n=Object.keys(e),i=NH(e,n),s=t>0,a=s?{secret:e,groupRestore:RH,nestedRestore:IH}:{secret:e};this.restore=Function("o",DH(i,n,s)).bind(a);}}function NH(e,t){return t.map(r=>{let{circle:n,escPath:i,leadingBracket:s}=e[r],o=n?`o.${n} = secret[${i}].val`:`o${s?"":"."}${r} = secret[${i}].val`,c=`secret[${i}].val = undefined`;return `
      if (secret[${i}].val !== undefined) {
        try { ${o} } catch (e) {}
        ${c}
      }
    `}).join("")}function DH(e,t,r){return `
    const secret = this.secret
    ${r===!0?`
    const keys = Object.keys(secret)
    const len = keys.length
    for (var i = len - 1; i >= ${t.length}; i--) {
      const k = keys[i]
      const o = secret[k]
      if (o.flat === true) this.groupRestore(o)
      else this.nestedRestore(o)
      secret[k] = null
    }
  `:""}
    ${e}
    return o
  `}});var HR=P((Qre,VR)=>{VR.exports=kH;function kH(e){let{secret:t,censor:r,compileRestore:n,serialize:i,groupRedact:s,nestedRedact:a,wildcards:o,wcLen:c}=e,l=[{secret:t,censor:r,compileRestore:n}];return i!==!1&&l.push({serialize:i}),c>0&&l.push({groupRedact:s,nestedRedact:a,wildcards:o,wcLen:c}),Object.assign(...l)}});var zR=P((Zre,KR)=>{var WR=DR(),OH=LR(),LH=FR(),BH=$R(),{groupRedact:FH,nestedRedact:MH}=Fm(),qH=HR(),UH=ef(),jH=WR(),Mm=e=>e;Mm.restore=Mm;var $H="[REDACTED]";qm.rx=UH;qm.validator=WR;KR.exports=qm;function qm(e={}){let t=Array.from(new Set(e.paths||[])),r="serialize"in e&&(e.serialize===!1||typeof e.serialize=="function")?e.serialize:JSON.stringify,n=e.remove;if(n===!0&&r!==JSON.stringify)throw Error("fast-redact \u2013 remove option may only be set when serializer is JSON.stringify");let i=n===!0?void 0:"censor"in e?e.censor:$H,s=typeof i=="function",a=s&&i.length>1;if(t.length===0)return r||Mm;jH({paths:t,serialize:r,censor:i});let{wildcards:o,wcLen:c,secret:l}=OH({paths:t,censor:i}),u=BH({secret:l,wcLen:c}),f="strict"in e?e.strict:!0;return LH({secret:l,wcLen:c,serialize:r,strict:f,isCensorFct:s,censorFctTakesPath:a},qH({secret:l,censor:i,compileRestore:u,serialize:r,groupRedact:FH,nestedRedact:MH,wildcards:o,wcLen:c}))}});var $a=P((Xre,GR)=>{var VH=Symbol("pino.setLevel"),HH=Symbol("pino.getLevel"),WH=Symbol("pino.levelVal"),KH=Symbol("pino.useLevelLabels"),zH=Symbol("pino.useOnlyCustomLevels"),GH=Symbol("pino.mixin"),YH=Symbol("pino.lsCache"),QH=Symbol("pino.chindings"),ZH=Symbol("pino.asJson"),XH=Symbol("pino.write"),JH=Symbol("pino.redactFmt"),e9=Symbol("pino.time"),t9=Symbol("pino.timeSliceIndex"),r9=Symbol("pino.stream"),n9=Symbol("pino.stringify"),i9=Symbol("pino.stringifySafe"),s9=Symbol("pino.stringifiers"),a9=Symbol("pino.end"),o9=Symbol("pino.formatOpts"),u9=Symbol("pino.messageKey"),c9=Symbol("pino.errorKey"),l9=Symbol("pino.nestedKey"),f9=Symbol("pino.nestedKeyStr"),d9=Symbol("pino.mixinMergeStrategy"),h9=Symbol("pino.msgPrefix"),p9=Symbol("pino.wildcardFirst"),g9=Symbol.for("pino.serializers"),m9=Symbol.for("pino.formatters"),y9=Symbol.for("pino.hooks"),v9=Symbol.for("pino.metadata");GR.exports={setLevelSym:VH,getLevelSym:HH,levelValSym:WH,useLevelLabelsSym:KH,mixinSym:GH,lsCacheSym:YH,chindingsSym:QH,asJsonSym:ZH,writeSym:XH,serializersSym:g9,redactFmtSym:JH,timeSym:e9,timeSliceIndexSym:t9,streamSym:r9,stringifySym:n9,stringifySafeSym:i9,stringifiersSym:s9,endSym:a9,formatOptsSym:o9,messageKeySym:u9,errorKeySym:c9,nestedKeySym:l9,wildcardFirstSym:p9,needsMetadataGsym:v9,useOnlyCustomLevelsSym:zH,formattersSym:m9,hooksSym:y9,nestedKeyStrSym:f9,mixinMergeStrategySym:d9,msgPrefixSym:h9};});var $m=P((Jre,XR)=>{var jm=zR(),{redactFmtSym:_9,wildcardFirstSym:tf}=$a(),{rx:Um,validator:b9}=jm,YR=b9({ERR_PATHS_MUST_BE_STRINGS:()=>"pino \u2013 redacted paths must be strings",ERR_INVALID_PATH:e=>`pino \u2013 redact paths array contains an invalid path (${e})`}),QR="[Redacted]",ZR=!1;function S9(e,t){let{paths:r,censor:n}=E9(e),i=r.reduce((o,c)=>{Um.lastIndex=0;let l=Um.exec(c),u=Um.exec(c),f=l[1]!==void 0?l[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):l[0];if(f==="*"&&(f=tf),u===null)return o[f]=null,o;if(o[f]===null)return o;let{index:h}=u,p=`${c.substr(h,c.length-1)}`;return o[f]=o[f]||[],f!==tf&&o[f].length===0&&o[f].push(...o[tf]||[]),f===tf&&Object.keys(o).forEach(function(m){o[m]&&o[m].push(p);}),o[f].push(p),o},{}),s={[_9]:jm({paths:r,censor:n,serialize:t,strict:ZR})},a=(...o)=>t(typeof n=="function"?n(...o):n);return [...Object.keys(i),...Object.getOwnPropertySymbols(i)].reduce((o,c)=>{if(i[c]===null)o[c]=l=>a(l,[c]);else {let l=typeof n=="function"?(u,f)=>n(u,[c,...f]):n;o[c]=jm({paths:i[c],censor:l,serialize:t,strict:ZR});}return o},s)}function E9(e){if(Array.isArray(e))return e={paths:e,censor:QR},YR(e),e;let{paths:t,censor:r=QR,remove:n}=e;if(Array.isArray(t)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),YR({paths:t,censor:r}),{paths:t,censor:r}}XR.exports=S9;});var eI=P((ene,JR)=>{var w9=()=>"",C9=()=>`,"time":${Date.now()}`,x9=()=>`,"time":${Math.round(Date.now()/1e3)}`,T9=()=>`,"time":"${new Date(Date.now()).toISOString()}"`;JR.exports={nullTime:w9,epochTime:C9,unixTime:x9,isoTime:T9};});var rI=P((tne,tI)=>{function A9(e){try{return JSON.stringify(e)}catch{return '"[Circular]"'}}tI.exports=R9;function R9(e,t,r){var n=r&&r.stringify||A9,i=1;if(typeof e=="object"&&e!==null){var s=t.length+i;if(s===1)return e;var a=new Array(s);a[0]=n(e);for(var o=1;o<s;o++)a[o]=n(t[o]);return a.join(" ")}if(typeof e!="string")return e;var c=t.length;if(c===0)return e;for(var l="",u=1-i,f=-1,h=e&&e.length||0,p=0;p<h;){if(e.charCodeAt(p)===37&&p+1<h){switch(f=f>-1?f:0,e.charCodeAt(p+1)){case 100:case 102:if(u>=c||t[u]==null)break;f<p&&(l+=e.slice(f,p)),l+=Number(t[u]),f=p+2,p++;break;case 105:if(u>=c||t[u]==null)break;f<p&&(l+=e.slice(f,p)),l+=Math.floor(Number(t[u])),f=p+2,p++;break;case 79:case 111:case 106:if(u>=c||t[u]===void 0)break;f<p&&(l+=e.slice(f,p));var m=typeof t[u];if(m==="string"){l+="'"+t[u]+"'",f=p+2,p++;break}if(m==="function"){l+=t[u].name||"<anonymous>",f=p+2,p++;break}l+=n(t[u]),f=p+2,p++;break;case 115:if(u>=c)break;f<p&&(l+=e.slice(f,p)),l+=String(t[u]),f=p+2,p++;break;case 37:f<p&&(l+=e.slice(f,p)),l+="%",f=p+2,p++,u--;break}++u;}++p;}return f===-1?e:(f<h&&(l+=e.slice(f)),l)}});var Hm=P((rne,Vm)=>{if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let t=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(e,0,0,Number(r));},e=new Int32Array(new SharedArrayBuffer(4));Vm.exports=t;}else {let e=function(t){if((t>0&&t<1/0)===!1)throw typeof t!="number"&&typeof t!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");};Vm.exports=e;}});var lI=P((nne,cI)=>{var tr=he("fs"),I9=he("events"),P9=he("util").inherits,nI=he("path"),Wm=Hm(),rf=100,nf=Buffer.allocUnsafe(0),N9=16*1024,iI="buffer",sI="utf8";function aI(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function r(s,a){if(s){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount("error")>0&&t.emit("error",s);}):t.emit("error",s);return}t.fd=a,t.file=e,t._reopening=!1,t._opening=!1,t._writing=!1,t.sync?process.nextTick(()=>t.emit("ready")):t.emit("ready"),!(t._reopening||t.destroyed)&&(!t._writing&&t._len>t.minLength||t._flushPending)&&t._actualWrite();}let n=t.append?"a":"w",i=t.mode;if(t.sync)try{t.mkdir&&tr.mkdirSync(nI.dirname(e),{recursive:!0});let s=tr.openSync(e,n,i);r(null,s);}catch(s){throw r(s),s}else t.mkdir?tr.mkdir(nI.dirname(e),{recursive:!0},s=>{if(s)return r(s);tr.open(e,n,i,r);}):tr.open(e,n,i,r);}function Vn(e){if(!(this instanceof Vn))return new Vn(e);let{fd:t,dest:r,minLength:n,maxLength:i,maxWrite:s,sync:a,append:o=!0,mkdir:c,retryEAGAIN:l,fsync:u,contentMode:f,mode:h}=e||{};t=t||r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=i||0,this.maxWrite=s||N9,this.sync=a||!1,this.writable=!0,this._fsync=u||!1,this.append=o||!1,this.mode=h,this.retryEAGAIN=l||(()=>!0),this.mkdir=c||!1;let p,m;if(f===iI)this._writingBuf=nf,this.write=O9,this.flush=B9,this.flushSync=M9,this._actualWrite=U9,p=()=>tr.writeSync(this.fd,this._writingBuf),m=()=>tr.write(this.fd,this._writingBuf,this.release);else if(f===void 0||f===sI)this._writingBuf="",this.write=k9,this.flush=L9,this.flushSync=F9,this._actualWrite=q9,p=()=>tr.writeSync(this.fd,this._writingBuf,"utf8"),m=()=>tr.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${sI}" and "${iI}", but passed ${f}`);if(typeof t=="number")this.fd=t,process.nextTick(()=>this.emit("ready"));else if(typeof t=="string")aI(t,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(_,E)=>{if(_){if((_.code==="EAGAIN"||_.code==="EBUSY")&&this.retryEAGAIN(_,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{Wm(rf),this.release(void 0,0);}catch(y){this.release(y);}else setTimeout(m,rf);else this._writing=!1,this.emit("error",_);return}if(this.emit("write",E),this._len-=E,this._len<0&&(this._len=0),this._writingBuf=this._writingBuf.slice(E),this._writingBuf.length){if(!this.sync){m();return}try{do{let y=p();this._len-=y,this._writingBuf=this._writingBuf.slice(y);}while(this._writingBuf.length)}catch(y){this.release(y);return}}this._fsync&&tr.fsyncSync(this.fd);let w=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):w>this.minLength?this._actualWrite():this._ending?w>0?this._actualWrite():(this._writing=!1,sf(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(D9,this)):this.emit("drain"));},this.on("newListener",function(_){_==="drain"&&(this._asyncDrainScheduled=!1);});}function D9(e){e.listenerCount("drain")>0&&(e._asyncDrainScheduled=!1,e.emit("drain"));}P9(Vn,I9);function oI(e,t){return e.length===0?nf:e.length===1?e[0]:Buffer.concat(e,t)}function k9(e){if(this.destroyed)throw new Error("SonicBoom destroyed");let t=this._len+e.length,r=this._bufs;return this.maxLength&&t>this.maxLength?(this.emit("drop",e),this._len<this._hwm):(r.length===0||r[r.length-1].length+e.length>this.maxWrite?r.push(""+e):r[r.length-1]+=e,this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function O9(e){if(this.destroyed)throw new Error("SonicBoom destroyed");let t=this._len+e.length,r=this._bufs,n=this._lens;return this.maxLength&&t>this.maxLength?(this.emit("drop",e),this._len<this._hwm):(r.length===0||n[n.length-1]+e.length>this.maxWrite?(r.push([e]),n.push(e.length)):(r[r.length-1].push(e),n[n.length-1]+=e.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function uI(e){this._flushPending=!0;let t=()=>{this._fsync?(this._flushPending=!1,e()):tr.fsync(this.fd,n=>{this._flushPending=!1,e(n);}),this.off("error",r);},r=n=>{this._flushPending=!1,e(n),this.off("drain",t);};this.once("drain",t),this.once("error",r);}function L9(e){if(e!=null&&typeof e!="function")throw new Error("flush cb must be a function");if(this.destroyed){let t=new Error("SonicBoom destroyed");if(e){e(t);return}throw t}if(this.minLength<=0){e?.();return}e&&uI.call(this,e),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite());}function B9(e){if(e!=null&&typeof e!="function")throw new Error("flush cb must be a function");if(this.destroyed){let t=new Error("SonicBoom destroyed");if(e){e(t);return}throw t}if(this.minLength<=0){e?.();return}e&&uI.call(this,e),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite());}Vn.prototype.reopen=function(e){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(e);});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(this._reopening=!0,this._writing)return;let t=this.fd;this.once("ready",()=>{t!==this.fd&&tr.close(t,r=>{if(r)return this.emit("error",r)});}),aI(e||this.file,this);};Vn.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end();});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():sf(this)));};function F9(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let e="";for(;this._bufs.length||e;){e.length<=0&&(e=this._bufs[0]);try{let t=tr.writeSync(this.fd,e,"utf8");e=e.slice(t),this._len=Math.max(this._len-t,0),e.length<=0&&this._bufs.shift();}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;Wm(rf);}}try{tr.fsyncSync(this.fd);}catch{}}function M9(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=nf);let e=nf;for(;this._bufs.length||e.length;){e.length<=0&&(e=oI(this._bufs[0],this._lens[0]));try{let t=tr.writeSync(this.fd,e);e=e.subarray(t),this._len=Math.max(this._len-t,0),e.length<=0&&(this._bufs.shift(),this._lens.shift());}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;Wm(rf);}}}Vn.prototype.destroy=function(){this.destroyed||sf(this);};function q9(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf||this._bufs.shift()||"",this.sync)try{let t=tr.writeSync(this.fd,this._writingBuf,"utf8");e(null,t);}catch(t){e(t);}else tr.write(this.fd,this._writingBuf,"utf8",e);}function U9(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:oI(this._bufs.shift(),this._lens.shift()),this.sync)try{let t=tr.writeSync(this.fd,this._writingBuf);e(null,t);}catch(t){e(t);}else tr.write(this.fd,this._writingBuf,e);}function sf(e){if(e.fd===-1){e.once("ready",sf.bind(null,e));return}e.destroyed=!0,e._bufs=[],e._lens=[],tr.fsync(e.fd,t);function t(){e.fd!==1&&e.fd!==2?tr.close(e.fd,r):r();}function r(n){if(n){e.emit("error",n);return}e._ending&&!e._writing&&e.emit("finish"),e.emit("close");}}Vn.SonicBoom=Vn;Vn.default=Vn;cI.exports=Vn;});var Km=P((ine,gI)=>{var Hn={exit:[],beforeExit:[]},fI={exit:V9,beforeExit:H9},Va;function j9(){Va===void 0&&(Va=new FinalizationRegistry(W9));}function $9(e){Hn[e].length>0||process.on(e,fI[e]);}function dI(e){Hn[e].length>0||(process.removeListener(e,fI[e]),Hn.exit.length===0&&Hn.beforeExit.length===0&&(Va=void 0));}function V9(){hI("exit");}function H9(){hI("beforeExit");}function hI(e){for(let t of Hn[e]){let r=t.deref(),n=t.fn;r!==void 0&&n(r,e);}Hn[e]=[];}function W9(e){for(let t of ["exit","beforeExit"]){let r=Hn[t].indexOf(e);Hn[t].splice(r,r+1),dI(t);}}function pI(e,t,r){if(t===void 0)throw new Error("the object can't be undefined");$9(e);let n=new WeakRef(t);n.fn=r,j9(),Va.register(t,n),Hn[e].push(n);}function K9(e,t){pI("exit",e,t);}function z9(e,t){pI("beforeExit",e,t);}function G9(e){if(Va!==void 0){Va.unregister(e);for(let t of ["exit","beforeExit"])Hn[t]=Hn[t].filter(r=>{let n=r.deref();return n&&n!==e}),dI(t);}}gI.exports={register:K9,registerBeforeExit:z9,unregister:G9};});var mI=P((sne,Y9)=>{Y9.exports={name:"thread-stream",version:"2.4.1",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^20.1.0","@types/tap":"^15.0.0",desm:"^1.3.0",fastbench:"^1.0.1",husky:"^8.0.1","pino-elasticsearch":"^6.0.0","sonic-boom":"^3.0.0",standard:"^17.0.0",tap:"^16.2.0","ts-node":"^10.8.0",typescript:"^4.7.2","why-is-node-running":"^2.2.2"},scripts:{test:"standard && npm run transpile && tap test/*.test.*js && tap --ts test/*.test.*ts","test:ci":"standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts","test:ci:js":'tap --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*js"',"test:ci:ts":'tap --ts --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*ts"',"test:yarn":'npm run transpile && tap "test/**/*.test.js" --no-check-coverage',transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},standard:{ignore:["test/ts/**/*"]},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina <hello@matteocollina.com>",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"};});var vI=P((ane,yI)=>{function Q9(e,t,r,n,i){let s=Date.now()+n,a=Atomics.load(e,t);if(a===r){i(null,"ok");return}let o=a,c=l=>{Date.now()>s?i(null,"timed-out"):setTimeout(()=>{o=a,a=Atomics.load(e,t),a===o?c(l>=1e3?1e3:l*2):a===r?i(null,"ok"):i(null,"not-equal");},l);};c(1);}function Z9(e,t,r,n,i){let s=Date.now()+n,a=Atomics.load(e,t);if(a!==r){i(null,"ok");return}let o=c=>{Date.now()>s?i(null,"timed-out"):setTimeout(()=>{a=Atomics.load(e,t),a!==r?i(null,"ok"):o(c>=1e3?1e3:c*2);},c);};o(1);}yI.exports={wait:Q9,waitDiff:Z9};});var bI=P((one,_I)=>{_I.exports={WRITE_INDEX:4,READ_INDEX:8};});var xI=P((une,CI)=>{var{version:X9}=mI(),{EventEmitter:J9}=he("events"),{Worker:eW}=he("worker_threads"),{join:tW}=he("path"),{pathToFileURL:rW}=he("url"),{wait:nW}=vI(),{WRITE_INDEX:Yr,READ_INDEX:ii}=bI(),iW=he("buffer"),sW=he("assert"),ue=Symbol("kImpl"),aW=iW.constants.MAX_STRING_LENGTH,Eu=class{constructor(t){this._value=t;}deref(){return this._value}},of=class{register(){}unregister(){}},oW=process.env.NODE_V8_COVERAGE?of:global.FinalizationRegistry||of,uW=process.env.NODE_V8_COVERAGE?Eu:global.WeakRef||Eu,SI=new oW(e=>{e.exited||e.terminate();});function cW(e,t){let{filename:r,workerData:n}=t,s=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||tW(__dirname,"lib","worker.js"),a=new eW(s,{...t.workerOpts,trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:rW(r).href,dataBuf:e[ue].dataBuf,stateBuf:e[ue].stateBuf,workerData:{$context:{threadStreamVersion:X9},...n}}});return a.stream=new Eu(e),a.on("message",lW),a.on("exit",wI),SI.register(e,a),a}function EI(e){sW(!e[ue].sync),e[ue].needDrain&&(e[ue].needDrain=!1,e.emit("drain"));}function af(e){let t=Atomics.load(e[ue].state,Yr),r=e[ue].data.length-t;if(r>0){if(e[ue].buf.length===0){e[ue].flushing=!1,e[ue].ending?Zm(e):e[ue].needDrain&&process.nextTick(EI,e);return}let n=e[ue].buf.slice(0,r),i=Buffer.byteLength(n);i<=r?(e[ue].buf=e[ue].buf.slice(r),uf(e,n,af.bind(null,e))):e.flush(()=>{if(!e.destroyed){for(Atomics.store(e[ue].state,ii,0),Atomics.store(e[ue].state,Yr,0);i>e[ue].data.length;)r=r/2,n=e[ue].buf.slice(0,r),i=Buffer.byteLength(n);e[ue].buf=e[ue].buf.slice(r),uf(e,n,af.bind(null,e));}});}else if(r===0){if(t===0&&e[ue].buf.length===0)return;e.flush(()=>{Atomics.store(e[ue].state,ii,0),Atomics.store(e[ue].state,Yr,0),af(e);});}else si(e,new Error("overwritten"));}function lW(e){let t=this.stream.deref();if(t===void 0){this.exited=!0,this.terminate();return}switch(e.code){case"READY":this.stream=new uW(t),t.flush(()=>{t[ue].ready=!0,t.emit("ready");});break;case"ERROR":si(t,e.err);break;case"EVENT":Array.isArray(e.args)?t.emit(e.name,...e.args):t.emit(e.name,e.args);break;case"WARNING":process.emitWarning(e.err);break;default:si(t,new Error("this should not happen: "+e.code));}}function wI(e){let t=this.stream.deref();t!==void 0&&(SI.unregister(t),t.worker.exited=!0,t.worker.off("exit",wI),si(t,e!==0?new Error("the worker thread exited"):null));}var Gm=class extends J9{constructor(t={}){if(super(),t.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[ue]={},this[ue].stateBuf=new SharedArrayBuffer(128),this[ue].state=new Int32Array(this[ue].stateBuf),this[ue].dataBuf=new SharedArrayBuffer(t.bufferSize||4*1024*1024),this[ue].data=Buffer.from(this[ue].dataBuf),this[ue].sync=t.sync||!1,this[ue].ending=!1,this[ue].ended=!1,this[ue].needDrain=!1,this[ue].destroyed=!1,this[ue].flushing=!1,this[ue].ready=!1,this[ue].finished=!1,this[ue].errored=null,this[ue].closed=!1,this[ue].buf="",this.worker=cW(this,t);}write(t){if(this[ue].destroyed)return Ym(this,new Error("the worker has exited")),!1;if(this[ue].ending)return Ym(this,new Error("the worker is ending")),!1;if(this[ue].flushing&&this[ue].buf.length+t.length>=aW)try{zm(this),this[ue].flushing=!0;}catch(r){return si(this,r),!1}if(this[ue].buf+=t,this[ue].sync)try{return zm(this),!0}catch(r){return si(this,r),!1}return this[ue].flushing||(this[ue].flushing=!0,setImmediate(af,this)),this[ue].needDrain=this[ue].data.length-this[ue].buf.length-Atomics.load(this[ue].state,Yr)<=0,!this[ue].needDrain}end(){this[ue].destroyed||(this[ue].ending=!0,Zm(this));}flush(t){if(this[ue].destroyed){typeof t=="function"&&process.nextTick(t,new Error("the worker has exited"));return}let r=Atomics.load(this[ue].state,Yr);nW(this[ue].state,ii,r,1/0,(n,i)=>{if(n){si(this,n),process.nextTick(t,n);return}if(i==="not-equal"){this.flush(t);return}process.nextTick(t);});}flushSync(){this[ue].destroyed||(zm(this),Qm(this));}unref(){this.worker.unref();}ref(){this.worker.ref();}get ready(){return this[ue].ready}get destroyed(){return this[ue].destroyed}get closed(){return this[ue].closed}get writable(){return !this[ue].destroyed&&!this[ue].ending}get writableEnded(){return this[ue].ending}get writableFinished(){return this[ue].finished}get writableNeedDrain(){return this[ue].needDrain}get writableObjectMode(){return !1}get writableErrored(){return this[ue].errored}};function Ym(e,t){setImmediate(()=>{e.emit("error",t);});}function si(e,t){e[ue].destroyed||(e[ue].destroyed=!0,t&&(e[ue].errored=t,Ym(e,t)),e.worker.exited?setImmediate(()=>{e[ue].closed=!0,e.emit("close");}):e.worker.terminate().catch(()=>{}).then(()=>{e[ue].closed=!0,e.emit("close");}));}function uf(e,t,r){let n=Atomics.load(e[ue].state,Yr),i=Buffer.byteLength(t);return e[ue].data.write(t,n),Atomics.store(e[ue].state,Yr,n+i),Atomics.notify(e[ue].state,Yr),r(),!0}function Zm(e){if(!(e[ue].ended||!e[ue].ending||e[ue].flushing)){e[ue].ended=!0;try{e.flushSync();let t=Atomics.load(e[ue].state,ii);Atomics.store(e[ue].state,Yr,-1),Atomics.notify(e[ue].state,Yr);let r=0;for(;t!==-1;){if(Atomics.wait(e[ue].state,ii,t,1e3),t=Atomics.load(e[ue].state,ii),t===-2){si(e,new Error("end() failed"));return}if(++r===10){si(e,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{e[ue].finished=!0,e.emit("finish");});}catch(t){si(e,t);}}}function zm(e){let t=()=>{e[ue].ending?Zm(e):e[ue].needDrain&&process.nextTick(EI,e);};for(e[ue].flushing=!1;e[ue].buf.length!==0;){let r=Atomics.load(e[ue].state,Yr),n=e[ue].data.length-r;if(n===0){Qm(e),Atomics.store(e[ue].state,ii,0),Atomics.store(e[ue].state,Yr,0);continue}else if(n<0)throw new Error("overwritten");let i=e[ue].buf.slice(0,n),s=Buffer.byteLength(i);if(s<=n)e[ue].buf=e[ue].buf.slice(n),uf(e,i,t);else {for(Qm(e),Atomics.store(e[ue].state,ii,0),Atomics.store(e[ue].state,Yr,0);s>e[ue].buf.length;)n=n/2,i=e[ue].buf.slice(0,n),s=Buffer.byteLength(i);e[ue].buf=e[ue].buf.slice(n),uf(e,i,t);}}}function Qm(e){if(e[ue].flushing)throw new Error("unable to flush while flushing");let t=Atomics.load(e[ue].state,Yr),r=0;for(;;){let n=Atomics.load(e[ue].state,ii);if(n===-2)throw Error("_flushSync failed");if(n!==t)Atomics.wait(e[ue].state,ii,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}CI.exports=Gm;});var e0=P((cne,TI)=>{var{createRequire:fW}=he("module"),dW=Lm(),{join:Xm,isAbsolute:hW,sep:pW}=he("path"),gW=Hm(),Jm=Km(),mW=xI();function yW(e){Jm.register(e,_W),Jm.registerBeforeExit(e,bW),e.on("close",function(){Jm.unregister(e);});}function vW(e,t,r){let n=new mW({filename:e,workerData:t,workerOpts:r});n.on("ready",i),n.on("close",function(){process.removeListener("exit",s);}),process.on("exit",s);function i(){process.removeListener("exit",s),n.unref(),r.autoEnd!==!1&&yW(n);}function s(){n.closed||(n.flushSync(),gW(100),n.end());}return n}function _W(e){e.ref(),e.flushSync(),e.end(),e.once("close",function(){e.unref();});}function bW(e){e.flushSync();}function SW(e){let{pipeline:t,targets:r,levels:n,dedupe:i,options:s={},worker:a={},caller:o=dW()}=e,c=typeof o=="string"?[o]:o,l="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},u=e.target;if(u&&r)throw new Error("only one of target or targets can be specified");return r?(u=l["pino-worker"]||Xm(__dirname,"worker.js"),s.targets=r.map(h=>({...h,target:f(h.target)}))):t&&(u=l["pino-pipeline-worker"]||Xm(__dirname,"worker-pipeline.js"),s.targets=t.map(h=>({...h,target:f(h.target)}))),n&&(s.levels=n),i&&(s.dedupe=i),vW(f(u),s,a);function f(h){if(h=l[h]||h,hW(h)||h.indexOf("file://")===0)return h;if(h==="pino/file")return Xm(__dirname,"..","file.js");let p;for(let m of c)try{let _=m==="node:repl"?process.cwd()+pW:m;p=fW(_).resolve(h);break}catch{continue}if(!p)throw new Error(`unable to determine transport target for "${h}"`);return p}}TI.exports=SW;});var ff=P((lne,FI)=>{var AI=rI(),{mapHttpRequest:EW,mapHttpResponse:wW}=Om(),r0=lI(),RI=Km(),{lsCacheSym:CW,chindingsSym:NI,writeSym:II,serializersSym:DI,formatOptsSym:PI,endSym:xW,stringifiersSym:kI,stringifySym:OI,stringifySafeSym:n0,wildcardFirstSym:LI,nestedKeySym:TW,formattersSym:BI,messageKeySym:AW,errorKeySym:RW,nestedKeyStrSym:IW,msgPrefixSym:cf}=$a(),{isMainThread:PW}=he("worker_threads"),NW=e0();function Ha(){}function DW(e,t){if(!t)return r;return function(...i){t.call(this,i,r,e);};function r(n,...i){if(typeof n=="object"){let s=n;n!==null&&(n.method&&n.headers&&n.socket?n=EW(n):typeof n.setHeader=="function"&&(n=wW(n)));let a;s===null&&i.length===0?a=[null]:(s=i.shift(),a=i),typeof this[cf]=="string"&&s!==void 0&&s!==null&&(s=this[cf]+s),this[II](n,AI(s,a,this[PI]),e);}else {let s=n===void 0?i.shift():n;typeof this[cf]=="string"&&s!==void 0&&s!==null&&(s=this[cf]+s),this[II](null,AI(s,i,this[PI]),e);}}}function t0(e){let t="",r=0,n=!1,i=255,s=e.length;if(s>100)return JSON.stringify(e);for(var a=0;a<s&&i>=32;a++)i=e.charCodeAt(a),(i===34||i===92)&&(t+=e.slice(r,a)+"\\",r=a,n=!0);return n?t+=e.slice(r):t=e,i<32?JSON.stringify(e):'"'+t+'"'}function kW(e,t,r,n){let i=this[OI],s=this[n0],a=this[kI],o=this[xW],c=this[NI],l=this[DI],u=this[BI],f=this[AW],h=this[RW],p=this[CW][r]+n;p=p+c;let m;u.log&&(e=u.log(e));let _=a[LI],E="";for(let y in e)if(m=e[y],Object.prototype.hasOwnProperty.call(e,y)&&m!==void 0){l[y]?m=l[y](m):y===h&&l.err&&(m=l.err(m));let b=a[y]||_;switch(typeof m){case"undefined":case"function":continue;case"number":Number.isFinite(m)===!1&&(m=null);case"boolean":b&&(m=b(m));break;case"string":m=(b||t0)(m);break;default:m=(b||i)(m,s);}if(m===void 0)continue;let N=t0(y);E+=","+N+":"+m;}let w="";if(t!==void 0){m=l[f]?l[f](t):t;let y=a[f]||_;switch(typeof m){case"function":break;case"number":Number.isFinite(m)===!1&&(m=null);case"boolean":y&&(m=y(m)),w=',"'+f+'":'+m;break;case"string":m=(y||t0)(m),w=',"'+f+'":'+m;break;default:m=(y||i)(m,s),w=',"'+f+'":'+m;}}return this[TW]&&E?p+this[IW]+E.slice(1)+"}"+w+o:p+E+w+o}function OW(e,t){let r,n=e[NI],i=e[OI],s=e[n0],a=e[kI],o=a[LI],c=e[DI],l=e[BI].bindings;t=l(t);for(let u in t)if(r=t[u],(u!=="level"&&u!=="serializers"&&u!=="formatters"&&u!=="customLevels"&&t.hasOwnProperty(u)&&r!==void 0)===!0){if(r=c[u]?c[u](r):r,r=(a[u]||o||i)(r,s),r===void 0)continue;n+=',"'+u+'":'+r;}return n}function LW(e){return e.write!==e.constructor.prototype.write}var BW=process.env.NODE_V8_COVERAGE||process.env.V8_COVERAGE;function lf(e){let t=new r0(e);return t.on("error",r),!BW&&!e.sync&&PW&&(RI.register(t,FW),t.on("close",function(){RI.unregister(t);})),t;function r(n){if(n.code==="EPIPE"){t.write=Ha,t.end=Ha,t.flushSync=Ha,t.destroy=Ha;return}t.removeListener("error",r),t.emit("error",n);}}function FW(e,t){e.destroyed||(t==="beforeExit"?(e.flush(),e.on("drain",function(){e.end();})):e.flushSync());}function MW(e){return function(r,n,i={},s){if(typeof i=="string")s=lf({dest:i}),i={};else if(typeof s=="string"){if(i&&i.transport)throw Error("only one of option.transport or stream can be specified");s=lf({dest:s});}else if(i instanceof r0||i.writable||i._writableState)s=i,i={};else if(i.transport){if(i.transport instanceof r0||i.transport.writable||i.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(i.transport.targets&&i.transport.targets.length&&i.formatters&&typeof i.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let c;i.customLevels&&(c=i.useOnlyCustomLevels?i.customLevels:Object.assign({},i.levels,i.customLevels)),s=NW({caller:n,...i.transport,levels:c});}if(i=Object.assign({},e,i),i.serializers=Object.assign({},e.serializers,i.serializers),i.formatters=Object.assign({},e.formatters,i.formatters),i.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:a,onChild:o}=i;return a===!1&&(i.level="silent"),o||(i.onChild=Ha),s||(LW(process.stdout)?s=process.stdout:s=lf({fd:process.stdout.fd||1})),{opts:i,stream:s}}}function qW(e,t){try{return JSON.stringify(e)}catch{try{return (t||this[n0])(e)}catch{return '"[unable to serialize, circular reference is too complex to analyze]"'}}}function UW(e,t,r){return {level:e,bindings:t,log:r}}function jW(e){let t=Number(e);return typeof e=="string"&&Number.isFinite(t)?t:e===void 0?1:e}FI.exports={noop:Ha,buildSafeSonicBoom:lf,asChindings:OW,asJson:kW,genLog:DW,createArgsNormalizer:MW,stringify:qW,buildFormatters:UW,normalizeDestFileDescriptor:jW};});var df=P((fne,qI)=>{var{lsCacheSym:$W,levelValSym:i0,useOnlyCustomLevelsSym:VW,streamSym:HW,formattersSym:WW,hooksSym:KW}=$a(),{noop:zW,genLog:$s}=ff(),Wn={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},MI={fatal:e=>{let t=$s(Wn.fatal,e);return function(...r){let n=this[HW];if(t.call(this,...r),typeof n.flushSync=="function")try{n.flushSync();}catch{}}},error:e=>$s(Wn.error,e),warn:e=>$s(Wn.warn,e),info:e=>$s(Wn.info,e),debug:e=>$s(Wn.debug,e),trace:e=>$s(Wn.trace,e)},s0=Object.keys(Wn).reduce((e,t)=>(e[Wn[t]]=t,e),{}),GW=Object.keys(s0).reduce((e,t)=>(e[t]='{"level":'+Number(t),e),{});function YW(e){let t=e[WW].level,{labels:r}=e.levels,n={};for(let i in r){let s=t(r[i],Number(i));n[i]=JSON.stringify(s).slice(0,-1);}return e[$W]=n,e}function QW(e,t){if(t)return !1;switch(e){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return !0;default:return !1}}function ZW(e){let{labels:t,values:r}=this.levels;if(typeof e=="number"){if(t[e]===void 0)throw Error("unknown level value"+e);e=t[e];}if(r[e]===void 0)throw Error("unknown level "+e);let n=this[i0],i=this[i0]=r[e],s=this[VW],a=this[KW].logMethod;for(let o in r){if(i>r[o]){this[o]=zW;continue}this[o]=QW(o,s)?MI[o](a):$s(r[o],a);}this.emit("level-change",e,i,t[n],n,this);}function XW(e){let{levels:t,levelVal:r}=this;return t&&t.labels?t.labels[r]:""}function JW(e){let{values:t}=this.levels,r=t[e];return r!==void 0&&r>=this[i0]}function eK(e=null,t=!1){let r=e?Object.keys(e).reduce((s,a)=>(s[e[a]]=a,s),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),t?null:s0,r),i=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:Wn,e);return {labels:n,values:i}}function tK(e,t,r){if(typeof e=="number"){if(![].concat(Object.keys(t||{}).map(s=>t[s]),r?[]:Object.keys(s0).map(s=>+s),1/0).includes(e))throw Error(`default level:${e} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:Wn,t);if(!(e in n))throw Error(`default level:${e} must be included in custom levels`)}function rK(e,t){let{labels:r,values:n}=e;for(let i in t){if(i in n)throw Error("levels cannot be overridden");if(t[i]in r)throw Error("pre-existing level values cannot be used for new levels")}}qI.exports={initialLsCache:GW,genLsCache:YW,levelMethods:MI,getLevel:XW,setLevel:ZW,isLevelEnabled:JW,mappings:eK,levels:Wn,assertNoLevelCollisions:rK,assertDefaultLevelFound:tK};});var a0=P((dne,UI)=>{UI.exports={version:"8.17.1"};});var ZI=P((pne,QI)=>{var{EventEmitter:nK}=he("events"),{lsCacheSym:iK,levelValSym:sK,setLevelSym:u0,getLevelSym:jI,chindingsSym:c0,parsedChindingsSym:aK,mixinSym:oK,asJsonSym:KI,writeSym:uK,mixinMergeStrategySym:cK,timeSym:lK,timeSliceIndexSym:fK,streamSym:zI,serializersSym:Vs,formattersSym:o0,errorKeySym:dK,messageKeySym:hK,useOnlyCustomLevelsSym:pK,needsMetadataGsym:gK,redactFmtSym:mK,stringifySym:yK,formatOptsSym:vK,stringifiersSym:_K,msgPrefixSym:$I}=$a(),{getLevel:bK,setLevel:SK,isLevelEnabled:EK,mappings:wK,initialLsCache:CK,genLsCache:xK,assertNoLevelCollisions:TK}=df(),{asChindings:GI,asJson:AK,buildFormatters:VI,stringify:HI}=ff(),{version:RK}=a0(),IK=$m(),PK=class{},YI={constructor:PK,child:NK,bindings:DK,setBindings:kK,flush:FK,isLevelEnabled:EK,version:RK,get level(){return this[jI]()},set level(e){this[u0](e);},get levelVal(){return this[sK]},set levelVal(e){throw Error("levelVal is read-only")},[iK]:CK,[uK]:LK,[KI]:AK,[jI]:bK,[u0]:SK};Object.setPrototypeOf(YI,nK.prototype);QI.exports=function(){return Object.create(YI)};var WI=e=>e;function NK(e,t){if(!e)throw Error("missing bindings for child Pino");t=t||{};let r=this[Vs],n=this[o0],i=Object.create(this);if(t.hasOwnProperty("serializers")===!0){i[Vs]=Object.create(null);for(let u in r)i[Vs][u]=r[u];let c=Object.getOwnPropertySymbols(r);for(var s=0;s<c.length;s++){let u=c[s];i[Vs][u]=r[u];}for(let u in t.serializers)i[Vs][u]=t.serializers[u];let l=Object.getOwnPropertySymbols(t.serializers);for(var a=0;a<l.length;a++){let u=l[a];i[Vs][u]=t.serializers[u];}}else i[Vs]=r;if(t.hasOwnProperty("formatters")){let{level:c,bindings:l,log:u}=t.formatters;i[o0]=VI(c||n.level,l||WI,u||n.log);}else i[o0]=VI(n.level,WI,n.log);if(t.hasOwnProperty("customLevels")===!0&&(TK(this.levels,t.customLevels),i.levels=wK(t.customLevels,i[pK]),xK(i)),typeof t.redact=="object"&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let c=IK(i.redact,HI),l={stringify:c[mK]};i[yK]=HI,i[_K]=c,i[vK]=l;}typeof t.msgPrefix=="string"&&(i[$I]=(this[$I]||"")+t.msgPrefix),i[c0]=GI(i,e);let o=t.level||this.level;return i[u0](o),this.onChild(i),i}function DK(){let t=`{${this[c0].substr(1)}}`,r=JSON.parse(t);return delete r.pid,delete r.hostname,r}function kK(e){let t=GI(this,e);this[c0]=t,delete this[aK];}function OK(e,t){return Object.assign(t,e)}function LK(e,t,r){let n=this[lK](),i=this[oK],s=this[dK],a=this[hK],o=this[cK]||OK,c;e==null?c={}:e instanceof Error?(c={[s]:e},t===void 0&&(t=e.message)):(c=e,t===void 0&&e[a]===void 0&&e[s]&&(t=e[s].message)),i&&(c=o(c,i(c,r,this)));let l=this[KI](c,t,r,n),u=this[zI];u[gK]===!0&&(u.lastLevel=r,u.lastObj=c,u.lastMsg=t,u.lastTime=n.slice(this[fK]),u.lastLogger=this),u.write(l);}function BK(){}function FK(e){if(e!=null&&typeof e!="function")throw Error("callback must be a function");let t=this[zI];typeof t.flush=="function"?t.flush(e||BK):e&&e();}});var r2=P((h0,t2)=>{var{hasOwnProperty:hf}=Object.prototype,Ws=d0();Ws.configure=d0;Ws.stringify=Ws;Ws.default=Ws;h0.stringify=Ws;h0.configure=d0;t2.exports=Ws;var MK=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function Xi(e){return e.length<5e3&&!MK.test(e)?`"${e}"`:JSON.stringify(e)}function l0(e){if(e.length>200)return e.sort();for(let t=1;t<e.length;t++){let r=e[t],n=t;for(;n!==0&&e[n-1]>r;)e[n]=e[n-1],n--;e[n]=r;}return e}var qK=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function f0(e){return qK.call(e)!==void 0&&e.length!==0}function XI(e,t,r){e.length<r&&(r=e.length);let n=t===","?"":" ",i=`"0":${n}${e[0]}`;for(let s=1;s<r;s++)i+=`${t}"${s}":${n}${e[s]}`;return i}function UK(e){if(hf.call(e,"circularValue")){let t=e.circularValue;if(typeof t=="string")return `"${t}"`;if(t==null)return t;if(t===Error||t===TypeError)return {toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return '"[Circular]"'}function JI(e,t){let r;if(hf.call(e,t)&&(r=e[t],typeof r!="boolean"))throw new TypeError(`The "${t}" argument must be of type boolean`);return r===void 0?!0:r}function e2(e,t){let r;if(hf.call(e,t)){if(r=e[t],typeof r!="number")throw new TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${t}" argument must be an integer`);if(r<1)throw new RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function Hs(e){return e===1?"1 item":`${e} items`}function jK(e){let t=new Set;for(let r of e)(typeof r=="string"||typeof r=="number")&&t.add(String(r));return t}function $K(e){if(hf.call(e,"strict")){let t=e.strict;if(typeof t!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(t)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function d0(e){e={...e};let t=$K(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let r=UK(e),n=JI(e,"bigint"),i=JI(e,"deterministic"),s=e2(e,"maximumDepth"),a=e2(e,"maximumBreadth");function o(h,p,m,_,E,w){let y=p[h];switch(typeof y=="object"&&y!==null&&typeof y.toJSON=="function"&&(y=y.toJSON(h)),y=_.call(p,h,y),typeof y){case"string":return Xi(y);case"object":{if(y===null)return "null";if(m.indexOf(y)!==-1)return r;let b="",N=",",L=w;if(Array.isArray(y)){if(y.length===0)return "[]";if(s<m.length+1)return '"[Array]"';m.push(y),E!==""&&(w+=E,b+=`
${w}`,N=`,
${w}`);let U=Math.min(y.length,a),ie=0;for(;ie<U-1;ie++){let Pe=o(String(ie),y,m,_,E,w);b+=Pe!==void 0?Pe:"null",b+=N;}let me=o(String(ie),y,m,_,E,w);if(b+=me!==void 0?me:"null",y.length-1>a){let Pe=y.length-a-1;b+=`${N}"... ${Hs(Pe)} not stringified"`;}return E!==""&&(b+=`
${L}`),m.pop(),`[${b}]`}let V=Object.keys(y),X=V.length;if(X===0)return "{}";if(s<m.length+1)return '"[Object]"';let z="",G="";E!==""&&(w+=E,N=`,
${w}`,z=" ");let ee=Math.min(X,a);i&&!f0(y)&&(V=l0(V)),m.push(y);for(let U=0;U<ee;U++){let ie=V[U],me=o(ie,y,m,_,E,w);me!==void 0&&(b+=`${G}${Xi(ie)}:${z}${me}`,G=N);}if(X>a){let U=X-a;b+=`${G}"...":${z}"${Hs(U)} not stringified"`,G=N;}return E!==""&&G.length>1&&(b=`
${w}${b}
${L}`),m.pop(),`{${b}}`}case"number":return isFinite(y)?String(y):t?t(y):"null";case"boolean":return y===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(y);default:return t?t(y):void 0}}function c(h,p,m,_,E,w){switch(typeof p=="object"&&p!==null&&typeof p.toJSON=="function"&&(p=p.toJSON(h)),typeof p){case"string":return Xi(p);case"object":{if(p===null)return "null";if(m.indexOf(p)!==-1)return r;let y=w,b="",N=",";if(Array.isArray(p)){if(p.length===0)return "[]";if(s<m.length+1)return '"[Array]"';m.push(p),E!==""&&(w+=E,b+=`
${w}`,N=`,
${w}`);let X=Math.min(p.length,a),z=0;for(;z<X-1;z++){let ee=c(String(z),p[z],m,_,E,w);b+=ee!==void 0?ee:"null",b+=N;}let G=c(String(z),p[z],m,_,E,w);if(b+=G!==void 0?G:"null",p.length-1>a){let ee=p.length-a-1;b+=`${N}"... ${Hs(ee)} not stringified"`;}return E!==""&&(b+=`
${y}`),m.pop(),`[${b}]`}m.push(p);let L="";E!==""&&(w+=E,N=`,
${w}`,L=" ");let V="";for(let X of _){let z=c(X,p[X],m,_,E,w);z!==void 0&&(b+=`${V}${Xi(X)}:${L}${z}`,V=N);}return E!==""&&V.length>1&&(b=`
${w}${b}
${y}`),m.pop(),`{${b}}`}case"number":return isFinite(p)?String(p):t?t(p):"null";case"boolean":return p===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(p);default:return t?t(p):void 0}}function l(h,p,m,_,E){switch(typeof p){case"string":return Xi(p);case"object":{if(p===null)return "null";if(typeof p.toJSON=="function"){if(p=p.toJSON(h),typeof p!="object")return l(h,p,m,_,E);if(p===null)return "null"}if(m.indexOf(p)!==-1)return r;let w=E;if(Array.isArray(p)){if(p.length===0)return "[]";if(s<m.length+1)return '"[Array]"';m.push(p),E+=_;let z=`
${E}`,G=`,
${E}`,ee=Math.min(p.length,a),U=0;for(;U<ee-1;U++){let me=l(String(U),p[U],m,_,E);z+=me!==void 0?me:"null",z+=G;}let ie=l(String(U),p[U],m,_,E);if(z+=ie!==void 0?ie:"null",p.length-1>a){let me=p.length-a-1;z+=`${G}"... ${Hs(me)} not stringified"`;}return z+=`
${w}`,m.pop(),`[${z}]`}let y=Object.keys(p),b=y.length;if(b===0)return "{}";if(s<m.length+1)return '"[Object]"';E+=_;let N=`,
${E}`,L="",V="",X=Math.min(b,a);f0(p)&&(L+=XI(p,N,a),y=y.slice(p.length),X-=p.length,V=N),i&&(y=l0(y)),m.push(p);for(let z=0;z<X;z++){let G=y[z],ee=l(G,p[G],m,_,E);ee!==void 0&&(L+=`${V}${Xi(G)}: ${ee}`,V=N);}if(b>a){let z=b-a;L+=`${V}"...": "${Hs(z)} not stringified"`,V=N;}return V!==""&&(L=`
${E}${L}
${w}`),m.pop(),`{${L}}`}case"number":return isFinite(p)?String(p):t?t(p):"null";case"boolean":return p===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(p);default:return t?t(p):void 0}}function u(h,p,m){switch(typeof p){case"string":return Xi(p);case"object":{if(p===null)return "null";if(typeof p.toJSON=="function"){if(p=p.toJSON(h),typeof p!="object")return u(h,p,m);if(p===null)return "null"}if(m.indexOf(p)!==-1)return r;let _="";if(Array.isArray(p)){if(p.length===0)return "[]";if(s<m.length+1)return '"[Array]"';m.push(p);let N=Math.min(p.length,a),L=0;for(;L<N-1;L++){let X=u(String(L),p[L],m);_+=X!==void 0?X:"null",_+=",";}let V=u(String(L),p[L],m);if(_+=V!==void 0?V:"null",p.length-1>a){let X=p.length-a-1;_+=`,"... ${Hs(X)} not stringified"`;}return m.pop(),`[${_}]`}let E=Object.keys(p),w=E.length;if(w===0)return "{}";if(s<m.length+1)return '"[Object]"';let y="",b=Math.min(w,a);f0(p)&&(_+=XI(p,",",a),E=E.slice(p.length),b-=p.length,y=","),i&&(E=l0(E)),m.push(p);for(let N=0;N<b;N++){let L=E[N],V=u(L,p[L],m);V!==void 0&&(_+=`${y}${Xi(L)}:${V}`,y=",");}if(w>a){let N=w-a;_+=`${y}"...":"${Hs(N)} not stringified"`;}return m.pop(),`{${_}}`}case"number":return isFinite(p)?String(p):t?t(p):"null";case"boolean":return p===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(p);default:return t?t(p):void 0}}function f(h,p,m){if(arguments.length>1){let _="";if(typeof m=="number"?_=" ".repeat(Math.min(m,10)):typeof m=="string"&&(_=m.slice(0,10)),p!=null){if(typeof p=="function")return o("",{"":h},[],p,_,"");if(Array.isArray(p))return c("",h,[],jK(p),_,"")}if(_.length!==0)return l("",h,[],_,"")}return u("",h,[])}return f}});var s2=P((gne,i2)=>{var p0=Symbol.for("pino.metadata"),{levels:n2}=df(),VK=n2.info;function HK(e,t){let r=0;e=e||[],t=t||{dedupe:!1};let n=Object.create(n2);n.silent=1/0,t.levels&&typeof t.levels=="object"&&Object.keys(t.levels).forEach(u=>{n[u]=t.levels[u];});let i={write:s,add:o,flushSync:a,end:c,minLevel:0,streams:[],clone:l,[p0]:!0,streamLevels:n};return Array.isArray(e)?e.forEach(o,i):o.call(i,e),e=null,i;function s(u){let f,h=this.lastLevel,{streams:p}=this,m=0,_;for(let E=KK(p.length,t.dedupe);GK(E,p.length,t.dedupe);E=zK(E,t.dedupe))if(f=p[E],f.level<=h){if(m!==0&&m!==f.level)break;if(_=f.stream,_[p0]){let{lastTime:w,lastMsg:y,lastObj:b,lastLogger:N}=this;_.lastLevel=h,_.lastTime=w,_.lastMsg=y,_.lastObj=b,_.lastLogger=N;}_.write(u),t.dedupe&&(m=f.level);}else if(!t.dedupe)break}function a(){for(let{stream:u}of this.streams)typeof u.flushSync=="function"&&u.flushSync();}function o(u){if(!u)return i;let f=typeof u.write=="function"||u.stream,h=u.write?u:u.stream;if(!f)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:p,streamLevels:m}=this,_;typeof u.levelVal=="number"?_=u.levelVal:typeof u.level=="string"?_=m[u.level]:typeof u.level=="number"?_=u.level:_=VK;let E={stream:h,level:_,levelVal:void 0,id:r++};return p.unshift(E),p.sort(WK),this.minLevel=p[0].level,i}function c(){for(let{stream:u}of this.streams)typeof u.flushSync=="function"&&u.flushSync(),u.end();}function l(u){let f=new Array(this.streams.length);for(let h=0;h<f.length;h++)f[h]={level:u,stream:this.streams[h].stream};return {write:s,add:o,minLevel:u,streams:f,clone:l,flushSync:a,[p0]:!0}}}function WK(e,t){return e.level-t.level}function KK(e,t){return t?e-1:0}function zK(e,t){return t?e-1:e+1}function GK(e,t,r){return r?e>=0:e<t}i2.exports=HK;});var v2=P((mne,Cn)=>{var YK=he("os"),h2=Om(),QK=Lm(),ZK=$m(),p2=eI(),XK=ZI(),g2=$a(),{configure:JK}=r2(),{assertDefaultLevelFound:e7,mappings:m2,genLsCache:t7,levels:r7}=df(),{createArgsNormalizer:n7,asChindings:i7,buildSafeSonicBoom:a2,buildFormatters:s7,stringify:g0,normalizeDestFileDescriptor:o2,noop:a7}=ff(),{version:o7}=a0(),{chindingsSym:u2,redactFmtSym:u7,serializersSym:c2,timeSym:c7,timeSliceIndexSym:l7,streamSym:f7,stringifySym:l2,stringifySafeSym:m0,stringifiersSym:f2,setLevelSym:d7,endSym:h7,formatOptsSym:p7,messageKeySym:g7,errorKeySym:m7,nestedKeySym:y7,mixinSym:v7,useOnlyCustomLevelsSym:_7,formattersSym:d2,hooksSym:b7,nestedKeyStrSym:S7,mixinMergeStrategySym:E7,msgPrefixSym:w7}=g2,{epochTime:y2,nullTime:C7}=p2,{pid:x7}=process,T7=YK.hostname(),A7=h2.err,R7={level:"info",levels:r7,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:x7,hostname:T7},serializers:Object.assign(Object.create(null),{err:A7}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return {level:t}}}),hooks:{logMethod:void 0},timestamp:y2,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},I7=n7(R7),P7=Object.assign(Object.create(null),h2);function y0(...e){let t={},{opts:r,stream:n}=I7(t,QK(),...e),{redact:i,crlf:s,serializers:a,timestamp:o,messageKey:c,errorKey:l,nestedKey:u,base:f,name:h,level:p,customLevels:m,mixin:_,mixinMergeStrategy:E,useOnlyCustomLevels:w,formatters:y,hooks:b,depthLimit:N,edgeLimit:L,onChild:V,msgPrefix:X}=r,z=JK({maximumDepth:N,maximumBreadth:L}),G=s7(y.level,y.bindings,y.log),ee=g0.bind({[m0]:z}),U=i?ZK(i,ee):{},ie=i?{stringify:U[u7]}:{stringify:ee},me="}"+(s?`\r
`:`
`),Pe=i7.bind(null,{[u2]:"",[c2]:a,[f2]:U,[l2]:g0,[m0]:z,[d2]:G}),W="";f!==null&&(h===void 0?W=Pe(f):W=Pe(Object.assign({},f,{name:h})));let K=o instanceof Function?o:o?y2:C7,se=K().indexOf(":")+1;if(w&&!m)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(_&&typeof _!="function")throw Error(`Unknown mixin type "${typeof _}" - expected "function"`);if(X&&typeof X!="string")throw Error(`Unknown msgPrefix type "${typeof X}" - expected "string"`);e7(p,m,w);let Ae=m2(m,w);return Object.assign(t,{levels:Ae,[_7]:w,[f7]:n,[c7]:K,[l7]:se,[l2]:g0,[m0]:z,[f2]:U,[h7]:me,[p7]:ie,[g7]:c,[m7]:l,[y7]:u,[S7]:u?`,${JSON.stringify(u)}:{`:"",[c2]:a,[v7]:_,[E7]:E,[u2]:W,[d2]:G,[b7]:b,silent:a7,onChild:V,[w7]:X}),Object.setPrototypeOf(t,XK()),t7(t),t[d7](p),t}Cn.exports=y0;Cn.exports.destination=(e=process.stdout.fd)=>typeof e=="object"?(e.dest=o2(e.dest||process.stdout.fd),a2(e)):a2({dest:o2(e),minLength:0});Cn.exports.transport=e0();Cn.exports.multistream=s2();Cn.exports.levels=m2();Cn.exports.stdSerializers=P7;Cn.exports.stdTimeFunctions=Object.assign({},p2);Cn.exports.symbols=g2;Cn.exports.version=o7;Cn.exports.default=y0;Cn.exports.pino=y0;});var wu=P(Ji=>{Object.defineProperty(Ji,"__esModule",{value:!0});Ji.Frequency=Ji.KeepLogFiles=void 0;(function(e){e[e.days=1]="days",e[e.fileCount=2]="fileCount";})(Ji.KeepLogFiles||(Ji.KeepLogFiles={}));(function(e){e[e.daily=1]="daily",e[e.minutes=2]="minutes",e[e.hours=3]="hours",e[e.date=4]="date",e[e.none=5]="none";})(Ji.Frequency||(Ji.Frequency={}));});var b2=P(_0=>{Object.defineProperty(_0,"__esModule",{value:!0});var _2=wu(),v0=class{static fileStreamRotatorOptions(t){return Object.assign(Object.assign({},{filename:"",verbose:!1,end_stream:!1,utc:!1,create_symlink:!1,symlink_name:"current.log"}),t)}static fileOptions(t){return Object.assign(Object.assign({},{flags:"a"}),t)}static auditSettings(t){let r={keepSettings:{type:_2.KeepLogFiles.fileCount,amount:10},auditFilename:"audit.json",hashType:"md5",extension:"",files:[]};return Object.assign(Object.assign({},r),t)}static rotationSettings(t){let r={filename:"",frequency:_2.Frequency.none,utc:!1};return Object.assign(Object.assign({},r),t)}static extractParam(t,r=!0){let n=t.toString().match(/(\w)$/),i={number:0};n?.length==2&&(i.letter=n[1].toLowerCase());let s=t.toString().match(/^(\d+)/);return s?.length==2&&(i.number=Number(s[1])),i}};_0.default=v0;});var pf=P(Wa=>{Object.defineProperty(Wa,"__esModule",{value:!0});Wa.Logger=Wa.makeDirectory=void 0;var k7=he("fs"),O7=he("path");function L7(e){if(e.trim()!==""){var t=O7.dirname(e);try{k7.mkdirSync(t,{recursive:!0});}catch(r){if(r.code!=="EEXIST")throw r}}}Wa.makeDirectory=L7;var b0=class e{constructor(){this.isVerbose=!1,this.allowDebug=!1;}static getInstance(t,r){return e.instance||(e.instance=new e,e.instance.isVerbose=t??!1,e.instance.allowDebug=r??!1),e.instance}static verbose(...t){e.getInstance().isVerbose&&console.log.apply(null,[new Date,"[FileStreamRotator:VERBOSE]",...t]);}static log(...t){console.log.apply(null,[new Date,"[FileStreamRotator]",...t]);}static debug(...t){e.getInstance().allowDebug&&console.debug.apply(null,[new Date,"[FileStreamRotator:DEBUG]",...t]);}};Wa.Logger=b0;});var E2=P(E0=>{Object.defineProperty(E0,"__esModule",{value:!0});var S2=he("fs"),hn=wu(),Ks=pf(),S0=class e{constructor(t,r){var n;switch(this.currentSize=0,this.lastDate="",this.fileIndx=0,this.settings=t,this.settings.frequency){case hn.Frequency.hours:this.settings.amount&&this.settings.amount<13?this.settings.amount&&this.settings.amount>0||(this.settings.amount=1):this.settings.amount=12,this.isFormatValidForHour()||(Ks.Logger.log("Date format not suitable for X hours rotation. Changing date format to 'YMDHm'"),this.settings.format="YMDHm");break;case hn.Frequency.minutes:this.settings.amount&&this.settings.amount<31?this.settings.amount&&this.settings.amount>0||(this.settings.amount=1):this.settings.amount=30,this.isFormatValidForMinutes()||(this.settings.format="YMDHm",Ks.Logger.log("Date format not suitable for X minutes rotation. Changing date format to 'YMDHm'"));break;case hn.Frequency.daily:this.isFormatValidForDaily()||(this.settings.format="YMD",Ks.Logger.log("Date format not suitable for daily rotation. Changing date format to 'YMD'"));break}if(this.settings.frequency!==hn.Frequency.none&&!this.settings.filename.match("%DATE%")&&(this.settings.filename+=".%DATE%",Ks.Logger.log("Appending date to the end of the filename")),this.lastDate=this.getDateString(),this.settings.maxSize&&r){let s=new Date(r.date),a=(n=this.settings.extension)!==null&&n!==void 0?n:"";if(Ks.Logger.debug(this.getDateString(s)==this.getDateString(new Date),this.getDateString(s),this.getDateString(new Date)),this.getDateString(s)==this.getDateString(new Date)){let o=r.name.match(RegExp("(\\d+)"+a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")));o&&(this.fileIndx=Number(o[1]));var i=this.getSizeForFile(this.getNewFilename());i&&(this.currentSize=i),this.lastDate=this.getDateString(s),Ks.Logger.debug("LOADED LAST ENTRY",this.currentSize,this.lastDate,this.fileIndx);}else {var i=this.getSizeForFile(this.getNewFilename());i&&(this.currentSize=i),Ks.Logger.debug("CURRENT FILE:",this.getNewFilename(),this.currentSize);}}}getSizeForFile(t){try{if(S2.existsSync(t)){var r=S2.statSync(this.getNewFilename());if(r)return r.size}}catch{return}}hasMaxSizeReached(){return this.settings.maxSize?this.currentSize>this.settings.maxSize:!1}shouldRotate(){let t=this.hasMaxSizeReached();switch(this.settings.frequency){case hn.Frequency.none:return t;case hn.Frequency.hours:case hn.Frequency.minutes:case hn.Frequency.date:case hn.Frequency.daily:default:let r=this.getDateString();return this.lastDate!=r?!0:t}}isFormatValidForDaily(){let t=new Date(2022,2,20,1,2,3),r=new Date(2022,2,20,23,55,45),n=new Date(2022,2,21,2,55,45);return this.getDateString(t)===this.getDateString(r)&&this.getDateString(t)!==this.getDateString(n)}isFormatValidForHour(){if(!this.settings.amount||this.settings.frequency!=hn.Frequency.hours)return !1;let t=new Date(2022,2,20,1,2,3),r=new Date(2022,2,20,2+this.settings.amount,55,45);return this.getDateString(t)!==this.getDateString(r)}isFormatValidForMinutes(){if(!this.settings.amount||this.settings.frequency!=hn.Frequency.minutes)return !1;let t=new Date(2022,2,20,1,2,3),r=new Date(2022,2,20,1,2+this.settings.amount,45);return this.getDateString(t)!==this.getDateString(r)}getDateString(t){let r=t||new Date,n=e.getDateComponents(r,this.settings.utc),i=this.settings.format;if(i){switch(this.settings.frequency){case hn.Frequency.hours:if(this.settings.amount){var s=Math.floor(n.hour/this.settings.amount)*this.settings.amount;n.hour=s,n.minute=0,n.second=0;}case hn.Frequency.minutes:if(this.settings.amount){var a=Math.floor(n.minute/this.settings.amount)*this.settings.amount;n.minute=a,n.second=0;}}return i?.replace(/D+/,n.day.toString().padStart(2,"0")).replace(/M+/,n.month.toString().padStart(2,"0")).replace(/Y+/,n.year.toString()).replace(/H+/,n.hour.toString().padStart(2,"0")).replace(/m+/,n.minute.toString().padStart(2,"0")).replace(/s+/,n.second.toString().padStart(2,"0")).replace(/A+/,n.hour>11?"PM":"AM")}return ""}getFilename(t,r){return t.replace("%DATE%",this.lastDate)+(this.settings.maxSize||this.fileIndx>0?"."+this.fileIndx:"")+(r||"")}getNewFilename(){return this.getFilename(this.settings.filename,this.settings.extension)}addBytes(t){this.currentSize+=t;}rotate(t=!1){return t?(this.fileIndx+=1,this.currentSize=0,this.lastDate=this.getDateString()):this.shouldRotate()&&(this.hasMaxSizeReached()?this.fileIndx+=1:this.fileIndx=0,this.currentSize=0,this.lastDate=this.getDateString()),this.getNewFilename()}static getDateComponents(t,r){return r?{day:t.getUTCDate(),month:t.getUTCMonth()+1,year:t.getUTCFullYear(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),utc:r,source:t}:{day:t.getDate(),month:t.getMonth()+1,year:t.getFullYear(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),utc:r,source:t}}static createDate(t,r){return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second)}};E0.default=S0;});var w2=P(x0=>{Object.defineProperty(x0,"__esModule",{value:!0});var gf=he("fs"),B7=he("path"),F7=wu(),ai=pf(),w0=he("crypto"),C0=class{constructor(t,r){this.config=t,this.emitter=r,this.loadLog();}loadLog(){var t;if(!this.config.keepSettings||((t=this.config.keepSettings)===null||t===void 0?void 0:t.amount)==0||!this.config.auditFilename||this.config.auditFilename==""){ai.Logger.verbose("no existing audit settings found",this.config);return}try{let r=B7.resolve(this.config.auditFilename),n=JSON.parse(gf.readFileSync(r,{encoding:"utf-8"}));this.config.files=n.files;}catch(r){if(r.code!=="ENOENT"){ai.Logger.log("Failed to load config file",r);return}}}writeLog(){if(this.config.auditFilename)try{(0, ai.makeDirectory)(this.config.auditFilename),gf.writeFileSync(this.config.auditFilename,JSON.stringify(this.config,null,4));}catch(t){ai.Logger.verbose("ERROR: Failed to store log audit",t);}}addLog(t){var r;if(!this.config.keepSettings||((r=this.config.keepSettings)===null||r===void 0?void 0:r.amount)==0||!this.config.auditFilename||this.config.auditFilename==""){ai.Logger.verbose("audit log missing");return}if(this.config.files.findIndex(s=>s.name===t)!==-1){ai.Logger.debug("file already in the log",t);return}var n=Date.now();if(this.config.files.push({date:n,name:t,hash:w0.createHash(this.config.hashType).update(t+"LOG_FILE"+n).digest("hex")}),ai.Logger.debug(`added file ${t} to log`),this.config.keepSettings&&this.config.keepSettings.amount){if(this.config.keepSettings.type==F7.KeepLogFiles.days){let s=Date.now()-86400*this.config.keepSettings.amount*1e3,a=this.config.files.filter(o=>{if(o.date>=s)return !0;this.removeLog(o);});this.config.files=a;}else if(this.config.files.length>this.config.keepSettings.amount){var i=this.config.files.splice(-this.config.keepSettings.amount);this.config.files.length>0&&this.config.files.filter(s=>(this.removeLog(s),!1)),this.config.files=i;}}this.writeLog();}removeLog(t){if(t.hash===w0.createHash(this.config.hashType).update(t.name+"LOG_FILE"+t.date).digest("hex"))try{gf.existsSync(t.name)&&(ai.Logger.debug("removing log file",t.name),gf.unlinkSync(t.name),this.emitter.emit("logRemoved",t.name));}catch{ai.Logger.verbose("Could not remove old log file: ",t.name);}else ai.Logger.debug("incorrect hash",t.name,t.hash,w0.createHash(this.config.hashType).update(t.name+"LOG_FILE"+t.date).digest("hex"));}};x0.default=C0;});var x2=P(R0=>{Object.defineProperty(R0,"__esModule",{value:!0});var M7=he("stream"),Ka=he("fs"),T0=he("path"),Ii=wu(),Pi=b2(),C2=E2(),q7=w2(),Cu=pf(),A0=class e extends M7.EventEmitter{constructor(t,r=!1){var n,i;super(),this.config={},this.config=this.parseOptions(t),Cu.Logger.getInstance(t.verbose,r),this.auditManager=new q7.default((n=this.config.auditSettings)!==null&&n!==void 0?n:Pi.default.auditSettings({}),this);let s=this.auditManager.config.files.slice(-1).shift();this.rotator=new C2.default((i=this.config.rotationSettings)!==null&&i!==void 0?i:Pi.default.rotationSettings({}),s),this.rotate();}static getStream(t){return new e(t)}parseOptions(t){var r,n,i,s;let a={};a.options=Pi.default.fileStreamRotatorOptions(t),a.fileOptions=Pi.default.fileOptions((r=t.file_options)!==null&&r!==void 0?r:{});let o=Pi.default.auditSettings({});if(t.audit_file&&(o.auditFilename=t.audit_file),t.audit_hash_type&&(o.hashType=t.audit_hash_type),t.extension&&(o.extension=t.extension),t.max_logs){let l=Pi.default.extractParam(t.max_logs);o.keepSettings={type:((n=l.letter)===null||n===void 0?void 0:n.toLowerCase())=="d"?Ii.KeepLogFiles.days:Ii.KeepLogFiles.fileCount,amount:l.number};}switch(a.auditSettings=o,a.rotationSettings=Pi.default.rotationSettings({filename:t.filename,extension:t.extension}),t.date_format&&!t.frequency?a.rotationSettings.frequency=Ii.Frequency.date:a.rotationSettings.frequency=Ii.Frequency.none,t.date_format&&(a.rotationSettings.format=t.date_format),a.rotationSettings.utc=(i=t.utc)!==null&&i!==void 0?i:!1,t.frequency){case"daily":a.rotationSettings.frequency=Ii.Frequency.daily;break;case"custom":case"date":a.rotationSettings.frequency=Ii.Frequency.date;break;case"test":a.rotationSettings.frequency=Ii.Frequency.minutes,a.rotationSettings.amount=1;break;default:if(t.frequency){let l=Pi.default.extractParam(t.frequency);!((s=l.letter)===null||s===void 0)&&s.match(/^([mh])$/)&&(a.rotationSettings.frequency=l.letter=="h"?Ii.Frequency.hours:Ii.Frequency.minutes,a.rotationSettings.amount=l.number);}}if(t.size){let l=Pi.default.extractParam(t.size);switch(l.letter){case"k":a.rotationSettings.maxSize=l.number*1024;break;case"m":a.rotationSettings.maxSize=l.number*1024*1024;break;case"g":a.rotationSettings.maxSize=l.number*1024*1024*1024;break}}this.rotator=new C2.default(a.rotationSettings);this.rotator.getNewFilename();return a}rotate(t=!1){var r;let n=this.currentFile;this.rotator.rotate(t),this.currentFile=this.rotator.getNewFilename(),this.currentFile!=n&&(this.fs&&(((r=this.config.options)===null||r===void 0?void 0:r.end_stream)===!0?this.fs.end():this.fs.destroy()),n&&this.auditManager.addLog(n),this.createNewLog(this.currentFile),this.emit("new",this.currentFile),this.emit("rotate",n,this.currentFile,t));}createNewLog(t){var r;(0, Cu.makeDirectory)(t),this.auditManager.addLog(t);let n={};this.config.fileOptions&&(n=this.config.fileOptions),this.fs=Ka.createWriteStream(t,n),this.bubbleEvents(this.fs,t),!((r=this.config.options)===null||r===void 0)&&r.create_symlink&&this.createCurrentSymLink(t);}write(t,r){this.fs&&(this.rotator.shouldRotate()&&this.rotate(),this.fs.write(t,r??"utf8"),this.rotator.addBytes(Buffer.byteLength(t,r)),this.rotator.hasMaxSizeReached()&&this.rotate());}end(t){this.fs&&(this.fs.end(t),this.fs=void 0);}bubbleEvents(t,r){t.on("close",()=>{this.emit("close");}),t.on("finish",()=>{this.emit("finish");}),t.on("error",n=>{this.emit("error",n);}),t.on("open",n=>{this.emit("open",r);});}createCurrentSymLink(t){var r,n;if(!t)return;let i=(n=(r=this.config.options)===null||r===void 0?void 0:r.symlink_name)!==null&&n!==void 0?n:"current.log",s=T0.dirname(t),a=T0.basename(t),o=s+T0.sep+i;try{if(Ka.existsSync(o)){if(Ka.lstatSync(o).isSymbolicLink()){Ka.unlinkSync(o),Ka.symlinkSync(a,o);return}Cu.Logger.verbose("Could not create symlink file as file with the same name exists: ",o);}else Ka.symlinkSync(a,o);}catch(c){Cu.Logger.verbose("[Could not create symlink file: ",o," -> ",a),Cu.Logger.debug("error creating sym link",o,c);}}test(){return {config:this.config,rotator:this.rotator}}};R0.default=A0;});var T2=P(mf=>{Object.defineProperty(mf,"__esModule",{value:!0});mf.getStream=void 0;var U7=x2();function j7(e){return new U7.default(e)}mf.getStream=j7;});var k2=P((Lne,D2)=>{D2.exports=function(){function e(n,i){function s(){this.constructor=n;}s.prototype=i.prototype,n.prototype=new s;}function t(n,i,s,a,o,c){this.message=n,this.expected=i,this.found=s,this.offset=a,this.line=o,this.column=c,this.name="SyntaxError";}e(t,Error);function r(n){var i=arguments.length>1?arguments[1]:{},s={},a={start:Bb},o=Bb,l=function(){return tS},u=s,f="#",h={type:"literal",value:"#",description:'"#"'},p=void 0,m={type:"any",description:"any character"},_="[",E={type:"literal",value:"[",description:'"["'},w="]",y={type:"literal",value:"]",description:'"]"'},b=function(d){Gh(br("ObjectPath",d,vr,_r));},N=function(d){Gh(br("ArrayPath",d,vr,_r));},L=function(d,v){return d.concat(v)},V=function(d){return [d]},X=function(d){return d},z=".",G={type:"literal",value:".",description:'"."'},ee="=",U={type:"literal",value:"=",description:'"="'},ie=function(d,v){Gh(br("Assign",v,vr,_r,d));},me=function(d){return d.join("")},Pe=function(d){return d.value},W='"""',K={type:"literal",value:'"""',description:'"\\"\\"\\""'},se=null,Ae=function(d){return br("String",d.join(""),vr,_r)},Fe='"',Ke={type:"literal",value:'"',description:'"\\""'},Ve="'''",ot={type:"literal",value:"'''",description:`"'''"`},Dt="'",bt={type:"literal",value:"'",description:`"'"`},ft=function(d){return d},Oe=function(d){return d},Rt="\\",qt={type:"literal",value:"\\",description:'"\\\\"'},ye=function(){return ""},je="e",le={type:"literal",value:"e",description:'"e"'},Ie="E",He={type:"literal",value:"E",description:'"E"'},et=function(d,v){return br("Float",parseFloat(d+"e"+v),vr,_r)},ze=function(d){return br("Float",parseFloat(d),vr,_r)},vn="+",Or={type:"literal",value:"+",description:'"+"'},As=function(d){return d.join("")},Lr="-",Kr={type:"literal",value:"-",description:'"-"'},Rs=function(d){return "-"+d.join("")},ma=function(d){return br("Integer",parseInt(d,10),vr,_r)},an="true",Is={type:"literal",value:"true",description:'"true"'},Ps=function(){return br("Boolean",!0,vr,_r)},Si="false",Ns={type:"literal",value:"false",description:'"false"'},Fn=function(){return br("Boolean",!1,vr,_r)},M=function(){return br("Array",[],vr,_r)},ae=function(d){return br("Array",d?[d]:[],vr,_r)},Se=function(d){return br("Array",d,vr,_r)},Ne=function(d,v){return br("Array",d.concat(v),vr,_r)},St=function(d){return d},gt=",",It={type:"literal",value:",",description:'","'},Ot="{",tt={type:"literal",value:"{",description:'"{"'},xt="}",dt={type:"literal",value:"}",description:'"}"'},Vt=function(d){return br("InlineTable",d,vr,_r)},Xt=function(d,v){return br("InlineTableValue",v,vr,_r,d)},Br=function(d){return "."+d},ya=function(d){return d.join("")},Mi=":",qi={type:"literal",value:":",description:'":"'},Lo=function(d){return d.join("")},Bo="T",Ec={type:"literal",value:"T",description:'"T"'},Z="Z",A={type:"literal",value:"Z",description:'"Z"'},q=function(d,v){return br("Date",new Date(d+"T"+v+"Z"),vr,_r)},j=function(d,v){return br("Date",new Date(d+"T"+v),vr,_r)},D=/^[ \t]/,S={type:"class",value:"[ \\t]",description:"[ \\t]"},Y=`
`,oe={type:"literal",value:`
`,description:'"\\n"'},Ge="\r",Ht={type:"literal",value:"\r",description:'"\\r"'},Pt=/^[0-9a-f]/i,on={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},un=/^[0-9]/,Mn={type:"class",value:"[0-9]",description:"[0-9]"},nt="_",Ui={type:"literal",value:"_",description:'"_"'},va=function(){return ""},wc=/^[A-Za-z0-9_\-]/,UM={type:"class",value:"[A-Za-z0-9_\\-]",description:"[A-Za-z0-9_\\-]"},jM=function(d){return d.join("")},Tb='\\"',$M={type:"literal",value:'\\"',description:'"\\\\\\""'},VM=function(){return '"'},Ab="\\\\",HM={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},WM=function(){return "\\"},Rb="\\b",KM={type:"literal",value:"\\b",description:'"\\\\b"'},zM=function(){return "\b"},Ib="\\t",GM={type:"literal",value:"\\t",description:'"\\\\t"'},YM=function(){return "	"},Pb="\\n",QM={type:"literal",value:"\\n",description:'"\\\\n"'},ZM=function(){return `
`},Nb="\\f",XM={type:"literal",value:"\\f",description:'"\\\\f"'},JM=function(){return "\f"},Db="\\r",eq={type:"literal",value:"\\r",description:'"\\\\r"'},tq=function(){return "\r"},kb="\\U",rq={type:"literal",value:"\\U",description:'"\\\\U"'},Ob=function(d){return Eq(d.join(""))},Lb="\\u",nq={type:"literal",value:"\\u",description:'"\\\\u"'},g=0,De=0,Fo=0,$h={line:1,column:1,seenCR:!1},Cc=0,Vh=[],ce=0,pe={},xc;if("startRule"in i){if(!(i.startRule in a))throw new Error(`Can't start parsing from rule "`+i.startRule+'".');o=a[i.startRule];}function vr(){return Hh(De).line}function _r(){return Hh(De).column}function Hh(d){function v(x,k,B){var J,ne;for(J=k;J<B;J++)ne=n.charAt(J),ne===`
`?(x.seenCR||x.line++,x.column=1,x.seenCR=!1):ne==="\r"||ne==="\u2028"||ne==="\u2029"?(x.line++,x.column=1,x.seenCR=!0):(x.column++,x.seenCR=!1);}return Fo!==d&&(Fo>d&&(Fo=0,$h={line:1,column:1,seenCR:!1}),v($h,Fo,d),Fo=d),$h}function ve(d){g<Cc||(g>Cc&&(Cc=g,Vh=[]),Vh.push(d));}function Wh(d,v,x){function k(Te){var We=1;for(Te.sort(function(Tt,vt){return Tt.description<vt.description?-1:Tt.description>vt.description?1:0});We<Te.length;)Te[We-1]===Te[We]?Te.splice(We,1):We++;}function B(Te,We){function Tt(ba){function ji(ln){return ln.charCodeAt(0).toString(16).toUpperCase()}return ba.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(ln){return "\\x0"+ji(ln)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(ln){return "\\x"+ji(ln)}).replace(/[\u0180-\u0FFF]/g,function(ln){return "\\u0"+ji(ln)}).replace(/[\u1080-\uFFFF]/g,function(ln){return "\\u"+ji(ln)})}var vt=new Array(Te.length),zt,Jt,cn;for(cn=0;cn<Te.length;cn++)vt[cn]=Te[cn].description;return zt=Te.length>1?vt.slice(0,-1).join(", ")+" or "+vt[Te.length-1]:vt[0],Jt=We?'"'+Tt(We)+'"':"end of input","Expected "+zt+" but "+Jt+" found."}var J=Hh(x),ne=x<n.length?n.charAt(x):null;return v!==null&&k(v),new t(d!==null?d:B(v,ne),v,ne,x,J.line,J.column)}function Bb(){var d,v,x,k=g*49+0,B=pe[k];if(B)return g=B.nextPos,B.result;for(d=g,v=[],x=Fb();x!==s;)v.push(x),x=Fb();return v!==s&&(De=d,v=l()),d=v,pe[k]={nextPos:g,result:d},d}function Fb(){var d,v,x,k,B,J,ne,Te=g*49+1,We=pe[Te];if(We)return g=We.nextPos,We.result;for(d=g,v=[],x=ke();x!==s;)v.push(x),x=ke();if(v!==s)if(x=iq(),x!==s){for(k=[],B=ke();B!==s;)k.push(B),B=ke();if(k!==s){for(B=[],J=Tc();J!==s;)B.push(J),J=Tc();if(B!==s){if(J=[],ne=bn(),ne!==s)for(;ne!==s;)J.push(ne),ne=bn();else J=u;J===s&&(J=Rc()),J!==s?(v=[v,x,k,B,J],d=v):(g=d,d=u);}else g=d,d=u;}else g=d,d=u;}else g=d,d=u;else g=d,d=u;if(d===s){if(d=g,v=[],x=ke(),x!==s)for(;x!==s;)v.push(x),x=ke();else v=u;if(v!==s){if(x=[],k=bn(),k!==s)for(;k!==s;)x.push(k),k=bn();else x=u;x===s&&(x=Rc()),x!==s?(v=[v,x],d=v):(g=d,d=u);}else g=d,d=u;d===s&&(d=bn());}return pe[Te]={nextPos:g,result:d},d}function iq(){var d,v=g*49+2,x=pe[v];return x?(g=x.nextPos,x.result):(d=Tc(),d===s&&(d=sq(),d===s&&(d=aq(),d===s&&(d=oq()))),pe[v]={nextPos:g,result:d},d)}function Tc(){var d,v,x,k,B,J,ne=g*49+3,Te=pe[ne];if(Te)return g=Te.nextPos,Te.result;if(d=g,n.charCodeAt(g)===35?(v=f,g++):(v=s,ce===0&&ve(h)),v!==s){for(x=[],k=g,B=g,ce++,J=bn(),J===s&&(J=Rc()),ce--,J===s?B=p:(g=B,B=u),B!==s?(n.length>g?(J=n.charAt(g),g++):(J=s,ce===0&&ve(m)),J!==s?(B=[B,J],k=B):(g=k,k=u)):(g=k,k=u);k!==s;)x.push(k),k=g,B=g,ce++,J=bn(),J===s&&(J=Rc()),ce--,J===s?B=p:(g=B,B=u),B!==s?(n.length>g?(J=n.charAt(g),g++):(J=s,ce===0&&ve(m)),J!==s?(B=[B,J],k=B):(g=k,k=u)):(g=k,k=u);x!==s?(v=[v,x],d=v):(g=d,d=u);}else g=d,d=u;return pe[ne]={nextPos:g,result:d},d}function sq(){var d,v,x,k,B,J,ne=g*49+4,Te=pe[ne];if(Te)return g=Te.nextPos,Te.result;if(d=g,n.charCodeAt(g)===91?(v=_,g++):(v=s,ce===0&&ve(E)),v!==s){for(x=[],k=ke();k!==s;)x.push(k),k=ke();if(x!==s)if(k=Mb(),k!==s){for(B=[],J=ke();J!==s;)B.push(J),J=ke();B!==s?(n.charCodeAt(g)===93?(J=w,g++):(J=s,ce===0&&ve(y)),J!==s?(De=d,v=b(k),d=v):(g=d,d=u)):(g=d,d=u);}else g=d,d=u;else g=d,d=u;}else g=d,d=u;return pe[ne]={nextPos:g,result:d},d}function aq(){var d,v,x,k,B,J,ne,Te,We=g*49+5,Tt=pe[We];if(Tt)return g=Tt.nextPos,Tt.result;if(d=g,n.charCodeAt(g)===91?(v=_,g++):(v=s,ce===0&&ve(E)),v!==s)if(n.charCodeAt(g)===91?(x=_,g++):(x=s,ce===0&&ve(E)),x!==s){for(k=[],B=ke();B!==s;)k.push(B),B=ke();if(k!==s)if(B=Mb(),B!==s){for(J=[],ne=ke();ne!==s;)J.push(ne),ne=ke();J!==s?(n.charCodeAt(g)===93?(ne=w,g++):(ne=s,ce===0&&ve(y)),ne!==s?(n.charCodeAt(g)===93?(Te=w,g++):(Te=s,ce===0&&ve(y)),Te!==s?(De=d,v=N(B),d=v):(g=d,d=u)):(g=d,d=u)):(g=d,d=u);}else g=d,d=u;else g=d,d=u;}else g=d,d=u;else g=d,d=u;return pe[We]={nextPos:g,result:d},d}function Mb(){var d,v,x,k=g*49+6,B=pe[k];if(B)return g=B.nextPos,B.result;if(d=g,v=[],x=Ub(),x!==s)for(;x!==s;)v.push(x),x=Ub();else v=u;return v!==s?(x=qb(),x!==s?(De=d,v=L(v,x),d=v):(g=d,d=u)):(g=d,d=u),d===s&&(d=g,v=qb(),v!==s&&(De=d,v=V(v)),d=v),pe[k]={nextPos:g,result:d},d}function qb(){var d,v,x,k,B,J=g*49+7,ne=pe[J];if(ne)return g=ne.nextPos,ne.result;for(d=g,v=[],x=ke();x!==s;)v.push(x),x=ke();if(v!==s)if(x=Mo(),x!==s){for(k=[],B=ke();B!==s;)k.push(B),B=ke();k!==s?(De=d,v=X(x),d=v):(g=d,d=u);}else g=d,d=u;else g=d,d=u;if(d===s){for(d=g,v=[],x=ke();x!==s;)v.push(x),x=ke();if(v!==s)if(x=Kh(),x!==s){for(k=[],B=ke();B!==s;)k.push(B),B=ke();k!==s?(De=d,v=X(x),d=v):(g=d,d=u);}else g=d,d=u;else g=d,d=u;}return pe[J]={nextPos:g,result:d},d}function Ub(){var d,v,x,k,B,J,ne,Te=g*49+8,We=pe[Te];if(We)return g=We.nextPos,We.result;for(d=g,v=[],x=ke();x!==s;)v.push(x),x=ke();if(v!==s)if(x=Mo(),x!==s){for(k=[],B=ke();B!==s;)k.push(B),B=ke();if(k!==s)if(n.charCodeAt(g)===46?(B=z,g++):(B=s,ce===0&&ve(G)),B!==s){for(J=[],ne=ke();ne!==s;)J.push(ne),ne=ke();J!==s?(De=d,v=X(x),d=v):(g=d,d=u);}else g=d,d=u;else g=d,d=u;}else g=d,d=u;else g=d,d=u;if(d===s){for(d=g,v=[],x=ke();x!==s;)v.push(x),x=ke();if(v!==s)if(x=Kh(),x!==s){for(k=[],B=ke();B!==s;)k.push(B),B=ke();if(k!==s)if(n.charCodeAt(g)===46?(B=z,g++):(B=s,ce===0&&ve(G)),B!==s){for(J=[],ne=ke();ne!==s;)J.push(ne),ne=ke();J!==s?(De=d,v=X(x),d=v):(g=d,d=u);}else g=d,d=u;else g=d,d=u;}else g=d,d=u;else g=d,d=u;}return pe[Te]={nextPos:g,result:d},d}function oq(){var d,v,x,k,B,J,ne=g*49+9,Te=pe[ne];if(Te)return g=Te.nextPos,Te.result;if(d=g,v=Mo(),v!==s){for(x=[],k=ke();k!==s;)x.push(k),k=ke();if(x!==s)if(n.charCodeAt(g)===61?(k=ee,g++):(k=s,ce===0&&ve(U)),k!==s){for(B=[],J=ke();J!==s;)B.push(J),J=ke();B!==s?(J=_a(),J!==s?(De=d,v=ie(v,J),d=v):(g=d,d=u)):(g=d,d=u);}else g=d,d=u;else g=d,d=u;}else g=d,d=u;if(d===s)if(d=g,v=Kh(),v!==s){for(x=[],k=ke();k!==s;)x.push(k),k=ke();if(x!==s)if(n.charCodeAt(g)===61?(k=ee,g++):(k=s,ce===0&&ve(U)),k!==s){for(B=[],J=ke();J!==s;)B.push(J),J=ke();B!==s?(J=_a(),J!==s?(De=d,v=ie(v,J),d=v):(g=d,d=u)):(g=d,d=u);}else g=d,d=u;else g=d,d=u;}else g=d,d=u;return pe[ne]={nextPos:g,result:d},d}function Mo(){var d,v,x,k=g*49+10,B=pe[k];if(B)return g=B.nextPos,B.result;if(d=g,v=[],x=Jb(),x!==s)for(;x!==s;)v.push(x),x=Jb();else v=u;return v!==s&&(De=d,v=me(v)),d=v,pe[k]={nextPos:g,result:d},d}function Kh(){var d,v,x=g*49+11,k=pe[x];return k?(g=k.nextPos,k.result):(d=g,v=jb(),v!==s&&(De=d,v=Pe(v)),d=v,d===s&&(d=g,v=$b(),v!==s&&(De=d,v=Pe(v)),d=v),pe[x]={nextPos:g,result:d},d)}function _a(){var d,v=g*49+12,x=pe[v];return x?(g=x.nextPos,x.result):(d=uq(),d===s&&(d=_q(),d===s&&(d=dq(),d===s&&(d=hq(),d===s&&(d=pq(),d===s&&(d=gq(),d===s&&(d=mq())))))),pe[v]={nextPos:g,result:d},d)}function uq(){var d,v=g*49+13,x=pe[v];return x?(g=x.nextPos,x.result):(d=cq(),d===s&&(d=jb(),d===s&&(d=lq(),d===s&&(d=$b()))),pe[v]={nextPos:g,result:d},d)}function cq(){var d,v,x,k,B,J=g*49+14,ne=pe[J];if(ne)return g=ne.nextPos,ne.result;if(d=g,n.substr(g,3)===W?(v=W,g+=3):(v=s,ce===0&&ve(K)),v!==s)if(x=bn(),x===s&&(x=se),x!==s){for(k=[],B=Wb();B!==s;)k.push(B),B=Wb();k!==s?(n.substr(g,3)===W?(B=W,g+=3):(B=s,ce===0&&ve(K)),B!==s?(De=d,v=Ae(k),d=v):(g=d,d=u)):(g=d,d=u);}else g=d,d=u;else g=d,d=u;return pe[J]={nextPos:g,result:d},d}function jb(){var d,v,x,k,B=g*49+15,J=pe[B];if(J)return g=J.nextPos,J.result;if(d=g,n.charCodeAt(g)===34?(v=Fe,g++):(v=s,ce===0&&ve(Ke)),v!==s){for(x=[],k=Vb();k!==s;)x.push(k),k=Vb();x!==s?(n.charCodeAt(g)===34?(k=Fe,g++):(k=s,ce===0&&ve(Ke)),k!==s?(De=d,v=Ae(x),d=v):(g=d,d=u)):(g=d,d=u);}else g=d,d=u;return pe[B]={nextPos:g,result:d},d}function lq(){var d,v,x,k,B,J=g*49+16,ne=pe[J];if(ne)return g=ne.nextPos,ne.result;if(d=g,n.substr(g,3)===Ve?(v=Ve,g+=3):(v=s,ce===0&&ve(ot)),v!==s)if(x=bn(),x===s&&(x=se),x!==s){for(k=[],B=Kb();B!==s;)k.push(B),B=Kb();k!==s?(n.substr(g,3)===Ve?(B=Ve,g+=3):(B=s,ce===0&&ve(ot)),B!==s?(De=d,v=Ae(k),d=v):(g=d,d=u)):(g=d,d=u);}else g=d,d=u;else g=d,d=u;return pe[J]={nextPos:g,result:d},d}function $b(){var d,v,x,k,B=g*49+17,J=pe[B];if(J)return g=J.nextPos,J.result;if(d=g,n.charCodeAt(g)===39?(v=Dt,g++):(v=s,ce===0&&ve(bt)),v!==s){for(x=[],k=Hb();k!==s;)x.push(k),k=Hb();x!==s?(n.charCodeAt(g)===39?(k=Dt,g++):(k=s,ce===0&&ve(bt)),k!==s?(De=d,v=Ae(x),d=v):(g=d,d=u)):(g=d,d=u);}else g=d,d=u;return pe[B]={nextPos:g,result:d},d}function Vb(){var d,v,x,k=g*49+18,B=pe[k];return B?(g=B.nextPos,B.result):(d=eS(),d===s&&(d=g,v=g,ce++,n.charCodeAt(g)===34?(x=Fe,g++):(x=s,ce===0&&ve(Ke)),ce--,x===s?v=p:(g=v,v=u),v!==s?(n.length>g?(x=n.charAt(g),g++):(x=s,ce===0&&ve(m)),x!==s?(De=d,v=ft(x),d=v):(g=d,d=u)):(g=d,d=u)),pe[k]={nextPos:g,result:d},d)}function Hb(){var d,v,x,k=g*49+19,B=pe[k];return B?(g=B.nextPos,B.result):(d=g,v=g,ce++,n.charCodeAt(g)===39?(x=Dt,g++):(x=s,ce===0&&ve(bt)),ce--,x===s?v=p:(g=v,v=u),v!==s?(n.length>g?(x=n.charAt(g),g++):(x=s,ce===0&&ve(m)),x!==s?(De=d,v=ft(x),d=v):(g=d,d=u)):(g=d,d=u),pe[k]={nextPos:g,result:d},d)}function Wb(){var d,v,x,k=g*49+20,B=pe[k];return B?(g=B.nextPos,B.result):(d=eS(),d===s&&(d=fq(),d===s&&(d=g,v=g,ce++,n.substr(g,3)===W?(x=W,g+=3):(x=s,ce===0&&ve(K)),ce--,x===s?v=p:(g=v,v=u),v!==s?(n.length>g?(x=n.charAt(g),g++):(x=s,ce===0&&ve(m)),x!==s?(De=d,v=Oe(x),d=v):(g=d,d=u)):(g=d,d=u))),pe[k]={nextPos:g,result:d},d)}function fq(){var d,v,x,k,B,J=g*49+21,ne=pe[J];if(ne)return g=ne.nextPos,ne.result;if(d=g,n.charCodeAt(g)===92?(v=Rt,g++):(v=s,ce===0&&ve(qt)),v!==s)if(x=bn(),x!==s){for(k=[],B=Xb();B!==s;)k.push(B),B=Xb();k!==s?(De=d,v=ye(),d=v):(g=d,d=u);}else g=d,d=u;else g=d,d=u;return pe[J]={nextPos:g,result:d},d}function Kb(){var d,v,x,k=g*49+22,B=pe[k];return B?(g=B.nextPos,B.result):(d=g,v=g,ce++,n.substr(g,3)===Ve?(x=Ve,g+=3):(x=s,ce===0&&ve(ot)),ce--,x===s?v=p:(g=v,v=u),v!==s?(n.length>g?(x=n.charAt(g),g++):(x=s,ce===0&&ve(m)),x!==s?(De=d,v=ft(x),d=v):(g=d,d=u)):(g=d,d=u),pe[k]={nextPos:g,result:d},d)}function dq(){var d,v,x,k,B=g*49+23,J=pe[B];return J?(g=J.nextPos,J.result):(d=g,v=zb(),v===s&&(v=zh()),v!==s?(n.charCodeAt(g)===101?(x=je,g++):(x=s,ce===0&&ve(le)),x===s&&(n.charCodeAt(g)===69?(x=Ie,g++):(x=s,ce===0&&ve(He))),x!==s?(k=zh(),k!==s?(De=d,v=et(v,k),d=v):(g=d,d=u)):(g=d,d=u)):(g=d,d=u),d===s&&(d=g,v=zb(),v!==s&&(De=d,v=ze(v)),d=v),pe[B]={nextPos:g,result:d},d)}function zb(){var d,v,x,k,B,J,ne=g*49+24,Te=pe[ne];return Te?(g=Te.nextPos,Te.result):(d=g,n.charCodeAt(g)===43?(v=vn,g++):(v=s,ce===0&&ve(Or)),v===s&&(v=se),v!==s?(x=g,k=qo(),k!==s?(n.charCodeAt(g)===46?(B=z,g++):(B=s,ce===0&&ve(G)),B!==s?(J=qo(),J!==s?(k=[k,B,J],x=k):(g=x,x=u)):(g=x,x=u)):(g=x,x=u),x!==s?(De=d,v=As(x),d=v):(g=d,d=u)):(g=d,d=u),d===s&&(d=g,n.charCodeAt(g)===45?(v=Lr,g++):(v=s,ce===0&&ve(Kr)),v!==s?(x=g,k=qo(),k!==s?(n.charCodeAt(g)===46?(B=z,g++):(B=s,ce===0&&ve(G)),B!==s?(J=qo(),J!==s?(k=[k,B,J],x=k):(g=x,x=u)):(g=x,x=u)):(g=x,x=u),x!==s?(De=d,v=Rs(x),d=v):(g=d,d=u)):(g=d,d=u)),pe[ne]={nextPos:g,result:d},d)}function hq(){var d,v,x=g*49+25,k=pe[x];return k?(g=k.nextPos,k.result):(d=g,v=zh(),v!==s&&(De=d,v=ma(v)),d=v,pe[x]={nextPos:g,result:d},d)}function zh(){var d,v,x,k,B,J=g*49+26,ne=pe[J];if(ne)return g=ne.nextPos,ne.result;if(d=g,n.charCodeAt(g)===43?(v=vn,g++):(v=s,ce===0&&ve(Or)),v===s&&(v=se),v!==s){if(x=[],k=wt(),k!==s)for(;k!==s;)x.push(k),k=wt();else x=u;x!==s?(k=g,ce++,n.charCodeAt(g)===46?(B=z,g++):(B=s,ce===0&&ve(G)),ce--,B===s?k=p:(g=k,k=u),k!==s?(De=d,v=As(x),d=v):(g=d,d=u)):(g=d,d=u);}else g=d,d=u;if(d===s)if(d=g,n.charCodeAt(g)===45?(v=Lr,g++):(v=s,ce===0&&ve(Kr)),v!==s){if(x=[],k=wt(),k!==s)for(;k!==s;)x.push(k),k=wt();else x=u;x!==s?(k=g,ce++,n.charCodeAt(g)===46?(B=z,g++):(B=s,ce===0&&ve(G)),ce--,B===s?k=p:(g=k,k=u),k!==s?(De=d,v=Rs(x),d=v):(g=d,d=u)):(g=d,d=u);}else g=d,d=u;return pe[J]={nextPos:g,result:d},d}function pq(){var d,v,x=g*49+27,k=pe[x];return k?(g=k.nextPos,k.result):(d=g,n.substr(g,4)===an?(v=an,g+=4):(v=s,ce===0&&ve(Is)),v!==s&&(De=d,v=Ps()),d=v,d===s&&(d=g,n.substr(g,5)===Si?(v=Si,g+=5):(v=s,ce===0&&ve(Ns)),v!==s&&(De=d,v=Fn()),d=v),pe[x]={nextPos:g,result:d},d)}function gq(){var d,v,x,k,B,J=g*49+28,ne=pe[J];if(ne)return g=ne.nextPos,ne.result;if(d=g,n.charCodeAt(g)===91?(v=_,g++):(v=s,ce===0&&ve(E)),v!==s){for(x=[],k=_n();k!==s;)x.push(k),k=_n();x!==s?(n.charCodeAt(g)===93?(k=w,g++):(k=s,ce===0&&ve(y)),k!==s?(De=d,v=M(),d=v):(g=d,d=u)):(g=d,d=u);}else g=d,d=u;if(d===s&&(d=g,n.charCodeAt(g)===91?(v=_,g++):(v=s,ce===0&&ve(E)),v!==s?(x=Gb(),x===s&&(x=se),x!==s?(n.charCodeAt(g)===93?(k=w,g++):(k=s,ce===0&&ve(y)),k!==s?(De=d,v=ae(x),d=v):(g=d,d=u)):(g=d,d=u)):(g=d,d=u),d===s)){if(d=g,n.charCodeAt(g)===91?(v=_,g++):(v=s,ce===0&&ve(E)),v!==s){if(x=[],k=Ac(),k!==s)for(;k!==s;)x.push(k),k=Ac();else x=u;x!==s?(n.charCodeAt(g)===93?(k=w,g++):(k=s,ce===0&&ve(y)),k!==s?(De=d,v=Se(x),d=v):(g=d,d=u)):(g=d,d=u);}else g=d,d=u;if(d===s)if(d=g,n.charCodeAt(g)===91?(v=_,g++):(v=s,ce===0&&ve(E)),v!==s){if(x=[],k=Ac(),k!==s)for(;k!==s;)x.push(k),k=Ac();else x=u;x!==s?(k=Gb(),k!==s?(n.charCodeAt(g)===93?(B=w,g++):(B=s,ce===0&&ve(y)),B!==s?(De=d,v=Ne(x,k),d=v):(g=d,d=u)):(g=d,d=u)):(g=d,d=u);}else g=d,d=u;}return pe[J]={nextPos:g,result:d},d}function Gb(){var d,v,x,k,B,J=g*49+29,ne=pe[J];if(ne)return g=ne.nextPos,ne.result;for(d=g,v=[],x=_n();x!==s;)v.push(x),x=_n();if(v!==s)if(x=_a(),x!==s){for(k=[],B=_n();B!==s;)k.push(B),B=_n();k!==s?(De=d,v=St(x),d=v):(g=d,d=u);}else g=d,d=u;else g=d,d=u;return pe[J]={nextPos:g,result:d},d}function Ac(){var d,v,x,k,B,J,ne,Te=g*49+30,We=pe[Te];if(We)return g=We.nextPos,We.result;for(d=g,v=[],x=_n();x!==s;)v.push(x),x=_n();if(v!==s)if(x=_a(),x!==s){for(k=[],B=_n();B!==s;)k.push(B),B=_n();if(k!==s)if(n.charCodeAt(g)===44?(B=gt,g++):(B=s,ce===0&&ve(It)),B!==s){for(J=[],ne=_n();ne!==s;)J.push(ne),ne=_n();J!==s?(De=d,v=St(x),d=v):(g=d,d=u);}else g=d,d=u;else g=d,d=u;}else g=d,d=u;else g=d,d=u;return pe[Te]={nextPos:g,result:d},d}function _n(){var d,v=g*49+31,x=pe[v];return x?(g=x.nextPos,x.result):(d=ke(),d===s&&(d=bn(),d===s&&(d=Tc())),pe[v]={nextPos:g,result:d},d)}function mq(){var d,v,x,k,B,J,ne=g*49+32,Te=pe[ne];if(Te)return g=Te.nextPos,Te.result;if(d=g,n.charCodeAt(g)===123?(v=Ot,g++):(v=s,ce===0&&ve(tt)),v!==s){for(x=[],k=ke();k!==s;)x.push(k),k=ke();if(x!==s){for(k=[],B=Yb();B!==s;)k.push(B),B=Yb();if(k!==s){for(B=[],J=ke();J!==s;)B.push(J),J=ke();B!==s?(n.charCodeAt(g)===125?(J=xt,g++):(J=s,ce===0&&ve(dt)),J!==s?(De=d,v=Vt(k),d=v):(g=d,d=u)):(g=d,d=u);}else g=d,d=u;}else g=d,d=u;}else g=d,d=u;return pe[ne]={nextPos:g,result:d},d}function Yb(){var d,v,x,k,B,J,ne,Te,We,Tt,vt,zt=g*49+33,Jt=pe[zt];if(Jt)return g=Jt.nextPos,Jt.result;for(d=g,v=[],x=ke();x!==s;)v.push(x),x=ke();if(v!==s)if(x=Mo(),x!==s){for(k=[],B=ke();B!==s;)k.push(B),B=ke();if(k!==s)if(n.charCodeAt(g)===61?(B=ee,g++):(B=s,ce===0&&ve(U)),B!==s){for(J=[],ne=ke();ne!==s;)J.push(ne),ne=ke();if(J!==s)if(ne=_a(),ne!==s){for(Te=[],We=ke();We!==s;)Te.push(We),We=ke();if(Te!==s)if(n.charCodeAt(g)===44?(We=gt,g++):(We=s,ce===0&&ve(It)),We!==s){for(Tt=[],vt=ke();vt!==s;)Tt.push(vt),vt=ke();Tt!==s?(De=d,v=Xt(x,ne),d=v):(g=d,d=u);}else g=d,d=u;else g=d,d=u;}else g=d,d=u;else g=d,d=u;}else g=d,d=u;else g=d,d=u;}else g=d,d=u;else g=d,d=u;if(d===s){for(d=g,v=[],x=ke();x!==s;)v.push(x),x=ke();if(v!==s)if(x=Mo(),x!==s){for(k=[],B=ke();B!==s;)k.push(B),B=ke();if(k!==s)if(n.charCodeAt(g)===61?(B=ee,g++):(B=s,ce===0&&ve(U)),B!==s){for(J=[],ne=ke();ne!==s;)J.push(ne),ne=ke();J!==s?(ne=_a(),ne!==s?(De=d,v=Xt(x,ne),d=v):(g=d,d=u)):(g=d,d=u);}else g=d,d=u;else g=d,d=u;}else g=d,d=u;else g=d,d=u;}return pe[zt]={nextPos:g,result:d},d}function Qb(){var d,v,x,k=g*49+34,B=pe[k];return B?(g=B.nextPos,B.result):(d=g,n.charCodeAt(g)===46?(v=z,g++):(v=s,ce===0&&ve(G)),v!==s?(x=qo(),x!==s?(De=d,v=Br(x),d=v):(g=d,d=u)):(g=d,d=u),pe[k]={nextPos:g,result:d},d)}function Zb(){var d,v,x,k,B,J,ne,Te,We,Tt,vt,zt,Jt=g*49+35,cn=pe[Jt];return cn?(g=cn.nextPos,cn.result):(d=g,v=g,x=wt(),x!==s?(k=wt(),k!==s?(B=wt(),B!==s?(J=wt(),J!==s?(n.charCodeAt(g)===45?(ne=Lr,g++):(ne=s,ce===0&&ve(Kr)),ne!==s?(Te=wt(),Te!==s?(We=wt(),We!==s?(n.charCodeAt(g)===45?(Tt=Lr,g++):(Tt=s,ce===0&&ve(Kr)),Tt!==s?(vt=wt(),vt!==s?(zt=wt(),zt!==s?(x=[x,k,B,J,ne,Te,We,Tt,vt,zt],v=x):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u),v!==s&&(De=d,v=ya(v)),d=v,pe[Jt]={nextPos:g,result:d},d)}function yq(){var d,v,x,k,B,J,ne,Te,We,Tt,vt,zt=g*49+36,Jt=pe[zt];return Jt?(g=Jt.nextPos,Jt.result):(d=g,v=g,x=wt(),x!==s?(k=wt(),k!==s?(n.charCodeAt(g)===58?(B=Mi,g++):(B=s,ce===0&&ve(qi)),B!==s?(J=wt(),J!==s?(ne=wt(),ne!==s?(n.charCodeAt(g)===58?(Te=Mi,g++):(Te=s,ce===0&&ve(qi)),Te!==s?(We=wt(),We!==s?(Tt=wt(),Tt!==s?(vt=Qb(),vt===s&&(vt=se),vt!==s?(x=[x,k,B,J,ne,Te,We,Tt,vt],v=x):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u),v!==s&&(De=d,v=Lo(v)),d=v,pe[zt]={nextPos:g,result:d},d)}function vq(){var d,v,x,k,B,J,ne,Te,We,Tt,vt,zt,Jt,cn,ba,ji,ln,rS=g*49+37,Yh=pe[rS];return Yh?(g=Yh.nextPos,Yh.result):(d=g,v=g,x=wt(),x!==s?(k=wt(),k!==s?(n.charCodeAt(g)===58?(B=Mi,g++):(B=s,ce===0&&ve(qi)),B!==s?(J=wt(),J!==s?(ne=wt(),ne!==s?(n.charCodeAt(g)===58?(Te=Mi,g++):(Te=s,ce===0&&ve(qi)),Te!==s?(We=wt(),We!==s?(Tt=wt(),Tt!==s?(vt=Qb(),vt===s&&(vt=se),vt!==s?(n.charCodeAt(g)===45?(zt=Lr,g++):(zt=s,ce===0&&ve(Kr)),zt===s&&(n.charCodeAt(g)===43?(zt=vn,g++):(zt=s,ce===0&&ve(Or))),zt!==s?(Jt=wt(),Jt!==s?(cn=wt(),cn!==s?(n.charCodeAt(g)===58?(ba=Mi,g++):(ba=s,ce===0&&ve(qi)),ba!==s?(ji=wt(),ji!==s?(ln=wt(),ln!==s?(x=[x,k,B,J,ne,Te,We,Tt,vt,zt,Jt,cn,ba,ji,ln],v=x):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u)):(g=v,v=u),v!==s&&(De=d,v=Lo(v)),d=v,pe[rS]={nextPos:g,result:d},d)}function _q(){var d,v,x,k,B,J=g*49+38,ne=pe[J];return ne?(g=ne.nextPos,ne.result):(d=g,v=Zb(),v!==s?(n.charCodeAt(g)===84?(x=Bo,g++):(x=s,ce===0&&ve(Ec)),x!==s?(k=yq(),k!==s?(n.charCodeAt(g)===90?(B=Z,g++):(B=s,ce===0&&ve(A)),B!==s?(De=d,v=q(v,k),d=v):(g=d,d=u)):(g=d,d=u)):(g=d,d=u)):(g=d,d=u),d===s&&(d=g,v=Zb(),v!==s?(n.charCodeAt(g)===84?(x=Bo,g++):(x=s,ce===0&&ve(Ec)),x!==s?(k=vq(),k!==s?(De=d,v=j(v,k),d=v):(g=d,d=u)):(g=d,d=u)):(g=d,d=u)),pe[J]={nextPos:g,result:d},d)}function ke(){var d,v=g*49+39,x=pe[v];return x?(g=x.nextPos,x.result):(D.test(n.charAt(g))?(d=n.charAt(g),g++):(d=s,ce===0&&ve(S)),pe[v]={nextPos:g,result:d},d)}function bn(){var d,v,x,k=g*49+40,B=pe[k];return B?(g=B.nextPos,B.result):(n.charCodeAt(g)===10?(d=Y,g++):(d=s,ce===0&&ve(oe)),d===s&&(d=g,n.charCodeAt(g)===13?(v=Ge,g++):(v=s,ce===0&&ve(Ht)),v!==s?(n.charCodeAt(g)===10?(x=Y,g++):(x=s,ce===0&&ve(oe)),x!==s?(v=[v,x],d=v):(g=d,d=u)):(g=d,d=u)),pe[k]={nextPos:g,result:d},d)}function Xb(){var d,v=g*49+41,x=pe[v];return x?(g=x.nextPos,x.result):(d=bn(),d===s&&(d=ke()),pe[v]={nextPos:g,result:d},d)}function Rc(){var d,v,x=g*49+42,k=pe[x];return k?(g=k.nextPos,k.result):(d=g,ce++,n.length>g?(v=n.charAt(g),g++):(v=s,ce===0&&ve(m)),ce--,v===s?d=p:(g=d,d=u),pe[x]={nextPos:g,result:d},d)}function Sn(){var d,v=g*49+43,x=pe[v];return x?(g=x.nextPos,x.result):(Pt.test(n.charAt(g))?(d=n.charAt(g),g++):(d=s,ce===0&&ve(on)),pe[v]={nextPos:g,result:d},d)}function wt(){var d,v,x=g*49+44,k=pe[x];return k?(g=k.nextPos,k.result):(un.test(n.charAt(g))?(d=n.charAt(g),g++):(d=s,ce===0&&ve(Mn)),d===s&&(d=g,n.charCodeAt(g)===95?(v=nt,g++):(v=s,ce===0&&ve(Ui)),v!==s&&(De=d,v=va()),d=v),pe[x]={nextPos:g,result:d},d)}function Jb(){var d,v=g*49+45,x=pe[v];return x?(g=x.nextPos,x.result):(wc.test(n.charAt(g))?(d=n.charAt(g),g++):(d=s,ce===0&&ve(UM)),pe[v]={nextPos:g,result:d},d)}function qo(){var d,v,x,k=g*49+46,B=pe[k];if(B)return g=B.nextPos,B.result;if(d=g,v=[],x=wt(),x!==s)for(;x!==s;)v.push(x),x=wt();else v=u;return v!==s&&(De=d,v=jM(v)),d=v,pe[k]={nextPos:g,result:d},d}function eS(){var d,v,x=g*49+47,k=pe[x];return k?(g=k.nextPos,k.result):(d=g,n.substr(g,2)===Tb?(v=Tb,g+=2):(v=s,ce===0&&ve($M)),v!==s&&(De=d,v=VM()),d=v,d===s&&(d=g,n.substr(g,2)===Ab?(v=Ab,g+=2):(v=s,ce===0&&ve(HM)),v!==s&&(De=d,v=WM()),d=v,d===s&&(d=g,n.substr(g,2)===Rb?(v=Rb,g+=2):(v=s,ce===0&&ve(KM)),v!==s&&(De=d,v=zM()),d=v,d===s&&(d=g,n.substr(g,2)===Ib?(v=Ib,g+=2):(v=s,ce===0&&ve(GM)),v!==s&&(De=d,v=YM()),d=v,d===s&&(d=g,n.substr(g,2)===Pb?(v=Pb,g+=2):(v=s,ce===0&&ve(QM)),v!==s&&(De=d,v=ZM()),d=v,d===s&&(d=g,n.substr(g,2)===Nb?(v=Nb,g+=2):(v=s,ce===0&&ve(XM)),v!==s&&(De=d,v=JM()),d=v,d===s&&(d=g,n.substr(g,2)===Db?(v=Db,g+=2):(v=s,ce===0&&ve(eq)),v!==s&&(De=d,v=tq()),d=v,d===s&&(d=bq()))))))),pe[x]={nextPos:g,result:d},d)}function bq(){var d,v,x,k,B,J,ne,Te,We,Tt,vt,zt=g*49+48,Jt=pe[zt];return Jt?(g=Jt.nextPos,Jt.result):(d=g,n.substr(g,2)===kb?(v=kb,g+=2):(v=s,ce===0&&ve(rq)),v!==s?(x=g,k=Sn(),k!==s?(B=Sn(),B!==s?(J=Sn(),J!==s?(ne=Sn(),ne!==s?(Te=Sn(),Te!==s?(We=Sn(),We!==s?(Tt=Sn(),Tt!==s?(vt=Sn(),vt!==s?(k=[k,B,J,ne,Te,We,Tt,vt],x=k):(g=x,x=u)):(g=x,x=u)):(g=x,x=u)):(g=x,x=u)):(g=x,x=u)):(g=x,x=u)):(g=x,x=u)):(g=x,x=u),x!==s?(De=d,v=Ob(x),d=v):(g=d,d=u)):(g=d,d=u),d===s&&(d=g,n.substr(g,2)===Lb?(v=Lb,g+=2):(v=s,ce===0&&ve(nq)),v!==s?(x=g,k=Sn(),k!==s?(B=Sn(),B!==s?(J=Sn(),J!==s?(ne=Sn(),ne!==s?(k=[k,B,J,ne],x=k):(g=x,x=u)):(g=x,x=u)):(g=x,x=u)):(g=x,x=u),x!==s?(De=d,v=Ob(x),d=v):(g=d,d=u)):(g=d,d=u)),pe[zt]={nextPos:g,result:d},d)}var tS=[];function Sq(d,v,x){var k=new Error(d);throw k.line=v,k.column=x,k}function Gh(d){tS.push(d);}function br(d,v,x,k,B){var J={type:d,value:v,line:x(),column:k()};return B&&(J.key=B),J}function Eq(d,v,x){var k=parseInt("0x"+d);if(!isFinite(k)||Math.floor(k)!=k||k<0||k>1114111||k>55295&&k<57344)Sq("Invalid Unicode escape code: "+d,v,x);else return wq(k)}function wq(){var d=16384,v=[],x,k,B=-1,J=arguments.length;if(!J)return "";for(var ne="";++B<J;){var Te=Number(arguments[B]);Te<=65535?v.push(Te):(Te-=65536,x=(Te>>10)+55296,k=Te%1024+56320,v.push(x,k)),(B+1==J||v.length>d)&&(ne+=String.fromCharCode.apply(null,v),v.length=0);}return ne}if(xc=o(),xc!==s&&g===n.length)return xc;throw xc!==s&&g<n.length&&ve({type:"end",description:"end of input"}),Wh(null,Vh,Cc)}return {SyntaxError:t,parse:r}}();});var L2=P((Bne,O2)=>{function K7(e){var t=[],r=[],n="",i=Object.create(null),s=i;return o(e);function o(y){for(var b,N=0;N<y.length;N++)switch(b=y[N],b.type){case"Assign":l(b);break;case"ObjectPath":p(b);break;case"ArrayPath":m(b);break}return i}function c(y,b,N){var L=new Error(y);throw L.line=b,L.column=N,L}function l(y){var b=y.key,N=y.value,L=y.line,V=y.column,X;n?X=n+"."+b:X=b,typeof s[b]<"u"&&c("Cannot redefine existing key '"+X+"'.",L,V),s[b]=f(N),u(X)||(t.push(X),r.push(X));}function u(y){return t.indexOf(y)!==-1}function f(y){return y.type==="Array"?E(y.value):y.type==="InlineTable"?h(y.value):y.value}function h(y){for(var b=Object.create(null),N=0;N<y.length;N++){var L=y[N];L.value.type==="InlineTable"?b[L.key]=h(L.value.value):L.type==="InlineTableValue"&&(b[L.key]=f(L.value));}return b}function p(y){var b=y.value,N=b.map(w).join("."),L=y.line,V=y.column;u(N)&&c("Cannot redefine existing key '"+b+"'.",L,V),t.push(N),s=_(i,b,Object.create(null),L,V),n=b;}function m(y){var b=y.value,N=b.map(w).join("."),L=y.line,V=y.column;if(u(N)||t.push(N),t=t.filter(function(z){return z.indexOf(N)!==0}),t.push(N),s=_(i,b,[],L,V),n=N,s instanceof Array){var X=Object.create(null);s.push(X),s=X;}else c("Cannot redefine existing key '"+b+"'.",L,V);}function _(y,b,N,L,V){for(var X=[],z="",G=b.join("."),ee=y,U=0;U<b.length;U++){var ie=b[U];X.push(ie),z=X.join("."),typeof ee[ie]>"u"?U===b.length-1?ee[ie]=N:ee[ie]=Object.create(null):U!==b.length-1&&r.indexOf(z)>-1&&c("Cannot redefine existing key '"+z+"'.",L,V),ee=ee[ie],ee instanceof Array&&ee.length&&U<b.length-1&&(ee=ee[ee.length-1]);}return ee}function E(y){for(var b=null,N=0;N<y.length;N++){var L=y[N];b===null?b=L.type:L.type!==b&&c("Cannot add value of type "+L.type+" to array of type "+b+".",L.line,L.column);}return y.map(f)}function w(y){return y.indexOf(".")>-1?'"'+y+'"':y}}O2.exports={compile:K7};});var F2=P((Fne,B2)=>{var z7=k2(),G7=L2();B2.exports={parse:function(e){var t=z7.parse(e.toString());return G7.compile(t)}};});var Z2=P((zs,Q2)=>{var B0=he("crypto");zs=Q2.exports=Pu;function Pu(e,t){return t=G2(e,t),rz(e,t)}zs.sha1=function(e){return Pu(e)};zs.keys=function(e){return Pu(e,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})};zs.MD5=function(e){return Pu(e,{algorithm:"md5",encoding:"hex"})};zs.keysMD5=function(e){return Pu(e,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var Ya=B0.getHashes?B0.getHashes().slice():["sha1","md5"];Ya.push("passthrough");var K2=["buffer","hex","binary","base64"];function G2(e,t){t=t||{};var r={};if(r.algorithm=t.algorithm||"sha1",r.encoding=t.encoding||"hex",r.excludeValues=!!t.excludeValues,r.algorithm=r.algorithm.toLowerCase(),r.encoding=r.encoding.toLowerCase(),r.ignoreUnknown=t.ignoreUnknown===!0,r.respectType=t.respectType!==!1,r.respectFunctionNames=t.respectFunctionNames!==!1,r.respectFunctionProperties=t.respectFunctionProperties!==!1,r.unorderedArrays=t.unorderedArrays===!0,r.unorderedSets=t.unorderedSets!==!1,r.unorderedObjects=t.unorderedObjects!==!1,r.replacer=t.replacer||void 0,r.excludeKeys=t.excludeKeys||void 0,typeof e>"u")throw new Error("Object argument required.");for(var n=0;n<Ya.length;++n)Ya[n].toLowerCase()===r.algorithm.toLowerCase()&&(r.algorithm=Ya[n]);if(Ya.indexOf(r.algorithm)===-1)throw new Error('Algorithm "'+r.algorithm+'"  not supported. supported values: '+Ya.join(", "));if(K2.indexOf(r.encoding)===-1&&r.algorithm!=="passthrough")throw new Error('Encoding "'+r.encoding+'"  not supported. supported values: '+K2.join(", "));return r}function z2(e){if(typeof e!="function")return !1;var t=/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i;return t.exec(Function.prototype.toString.call(e))!=null}function rz(e,t){var r;t.algorithm!=="passthrough"?r=B0.createHash(t.algorithm):r=new Y2,typeof r.write>"u"&&(r.write=r.update,r.end=r.update);var n=F0(t,r);if(n.dispatch(e),r.update||r.end(""),r.digest)return r.digest(t.encoding==="buffer"?void 0:t.encoding);var i=r.read();return t.encoding==="buffer"?i:i.toString(t.encoding)}zs.writeToStream=function(e,t,r){return typeof r>"u"&&(r=t,t={}),t=G2(e,t),F0(t,r).dispatch(e)};function F0(e,t,r){r=r||[];var n=function(i){return t.update?t.update(i,"utf8"):t.write(i,"utf8")};return {dispatch:function(i){e.replacer&&(i=e.replacer(i));var s=typeof i;return i===null&&(s="null"),this["_"+s](i)},_object:function(i){var s=/\[object (.*)\]/i,a=Object.prototype.toString.call(i),o=s.exec(a);o?o=o[1]:o="unknown:["+a+"]",o=o.toLowerCase();var c=null;if((c=r.indexOf(i))>=0)return this.dispatch("[CIRCULAR:"+c+"]");if(r.push(i),typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(i))return n("buffer:"),n(i);if(o!=="object"&&o!=="function"&&o!=="asyncfunction")if(this["_"+o])this["_"+o](i);else {if(e.ignoreUnknown)return n("["+o+"]");throw new Error('Unknown object type "'+o+'"')}else {var l=Object.keys(i);e.unorderedObjects&&(l=l.sort()),e.respectType!==!1&&!z2(i)&&l.splice(0,0,"prototype","__proto__","constructor"),e.excludeKeys&&(l=l.filter(function(f){return !e.excludeKeys(f)})),n("object:"+l.length+":");var u=this;return l.forEach(function(f){u.dispatch(f),n(":"),e.excludeValues||u.dispatch(i[f]),n(",");})}},_array:function(i,s){s=typeof s<"u"?s:e.unorderedArrays!==!1;var a=this;if(n("array:"+i.length+":"),!s||i.length<=1)return i.forEach(function(l){return a.dispatch(l)});var o=[],c=i.map(function(l){var u=new Y2,f=r.slice(),h=F0(e,u,f);return h.dispatch(l),o=o.concat(f.slice(r.length)),u.read().toString()});return r=r.concat(o),c.sort(),this._array(c,!1)},_date:function(i){return n("date:"+i.toJSON())},_symbol:function(i){return n("symbol:"+i.toString())},_error:function(i){return n("error:"+i.toString())},_boolean:function(i){return n("bool:"+i.toString())},_string:function(i){n("string:"+i.length+":"),n(i.toString());},_function:function(i){n("fn:"),z2(i)?this.dispatch("[native]"):this.dispatch(i.toString()),e.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(i.name)),e.respectFunctionProperties&&this._object(i);},_number:function(i){return n("number:"+i.toString())},_xml:function(i){return n("xml:"+i.toString())},_null:function(){return n("Null")},_undefined:function(){return n("Undefined")},_regexp:function(i){return n("regex:"+i.toString())},_uint8array:function(i){return n("uint8array:"),this.dispatch(Array.prototype.slice.call(i))},_uint8clampedarray:function(i){return n("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(i))},_int8array:function(i){return n("int8array:"),this.dispatch(Array.prototype.slice.call(i))},_uint16array:function(i){return n("uint16array:"),this.dispatch(Array.prototype.slice.call(i))},_int16array:function(i){return n("int16array:"),this.dispatch(Array.prototype.slice.call(i))},_uint32array:function(i){return n("uint32array:"),this.dispatch(Array.prototype.slice.call(i))},_int32array:function(i){return n("int32array:"),this.dispatch(Array.prototype.slice.call(i))},_float32array:function(i){return n("float32array:"),this.dispatch(Array.prototype.slice.call(i))},_float64array:function(i){return n("float64array:"),this.dispatch(Array.prototype.slice.call(i))},_arraybuffer:function(i){return n("arraybuffer:"),this.dispatch(new Uint8Array(i))},_url:function(i){return n("url:"+i.toString())},_map:function(i){n("map:");var s=Array.from(i);return this._array(s,e.unorderedSets!==!1)},_set:function(i){n("set:");var s=Array.from(i);return this._array(s,e.unorderedSets!==!1)},_file:function(i){return n("file:"),this.dispatch([i.name,i.size,i.type,i.lastModfied])},_blob:function(){if(e.ignoreUnknown)return n("[blob]");throw Error(`Hashing Blob objects is currently not supported
(see https://github.com/puleos/object-hash/issues/26)
Use "options.replacer" or "options.ignoreUnknown"
`)},_domwindow:function(){return n("domwindow")},_bigint:function(i){return n("bigint:"+i.toString())},_process:function(){return n("process")},_timer:function(){return n("timer")},_pipe:function(){return n("pipe")},_tcp:function(){return n("tcp")},_udp:function(){return n("udp")},_tty:function(){return n("tty")},_statwatcher:function(){return n("statwatcher")},_securecontext:function(){return n("securecontext")},_connection:function(){return n("connection")},_zlib:function(){return n("zlib")},_context:function(){return n("context")},_nodescript:function(){return n("nodescript")},_httpparser:function(){return n("httpparser")},_dataview:function(){return n("dataview")},_signal:function(){return n("signal")},_fsevent:function(){return n("fsevent")},_tlswrap:function(){return n("tlswrap")}}}function Y2(){return {buf:"",write:function(e){this.buf+=e;},end:function(e){this.buf+=e;},read:function(){return this.buf}}}});var iP=P((exports,module)=>{var Module=Module!==void 0?Module:{},TreeSitter=function(){var initPromise,document=typeof window=="object"?{currentScript:window.document.currentScript}:null;class 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_=(e,t)=>{throw t},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",scriptDirectory="",read_,readAsync,readBinary;function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}function logExceptionOnExit(e){e instanceof ExitStatus||err("exiting due to exception: "+e);}if(ENVIRONMENT_IS_NODE){var fs=he("fs"),nodePath=he("path");scriptDirectory=ENVIRONMENT_IS_WORKER?nodePath.dirname(scriptDirectory)+"/":__dirname+"/",read_=(e,t)=>(e=isFileURI(e)?new URL(e):nodePath.normalize(e),fs.readFileSync(e,t?void 0:"utf8")),readBinary=e=>{var t=read_(e,!0);return t.buffer||(t=new Uint8Array(t)),t},readAsync=(e,t,r)=>{e=isFileURI(e)?new URL(e):nodePath.normalize(e),fs.readFile(e,function(n,i){n?r(n):t(i.buffer);});},process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),typeof module<"u"&&(module.exports=Module),quit_=(e,t)=>{if(keepRuntimeAlive())throw process.exitCode=e,t;logExceptionOnExit(t),process.exit(e);},Module.inspect=function(){return "[Emscripten Module object]"};}else (ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:document!==void 0&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory=scriptDirectory.indexOf("blob:")!==0?scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1):"",read_=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},ENVIRONMENT_IS_WORKER&&(readBinary=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),readAsync=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{n.status==200||n.status==0&&n.response?t(n.response):r();},n.onerror=r,n.send(null);},e=>document.title=e);Module.print||console.log.bind(console);var err=Module.printErr||console.warn.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.quit&&(quit_=Module.quit);var STACK_ALIGN=16,dynamicLibraries=Module.dynamicLibraries||[],wasmBinary;Module.wasmBinary&&(wasmBinary=Module.wasmBinary);var noExitRuntime=Module.noExitRuntime||!0,wasmMemory;typeof WebAssembly!="object"&&abort("no native wasm support detected");var ABORT=!1,EXITSTATUS,UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,buffer,HEAP8,HEAPU8,HEAP16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function UTF8ArrayToString(e,t,r){for(var n=t+r,i=t;e[i]&&!(i>=n);)++i;if(i-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,i));for(var s="";t<i;){var a=e[t++];if(128&a){var o=63&e[t++];if((224&a)!=192){var c=63&e[t++];if((a=(240&a)==224?(15&a)<<12|o<<6|c:(7&a)<<18|o<<12|c<<6|63&e[t++])<65536)s+=String.fromCharCode(a);else {var l=a-65536;s+=String.fromCharCode(55296|l>>10,56320|1023&l);}}else s+=String.fromCharCode((31&a)<<6|o);}else s+=String.fromCharCode(a);}return s}function UTF8ToString(e,t){return e?UTF8ArrayToString(HEAPU8,e,t):""}function stringToUTF8Array(e,t,r,n){if(!(n>0))return 0;for(var i=r,s=r+n-1,a=0;a<e.length;++a){var o=e.charCodeAt(a);if(o>=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++a)),o<=127){if(r>=s)break;t[r++]=o;}else if(o<=2047){if(r+1>=s)break;t[r++]=192|o>>6,t[r++]=128|63&o;}else if(o<=65535){if(r+2>=s)break;t[r++]=224|o>>12,t[r++]=128|o>>6&63,t[r++]=128|63&o;}else {if(r+3>=s)break;t[r++]=240|o>>18,t[r++]=128|o>>12&63,t[r++]=128|o>>6&63,t[r++]=128|63&o;}}return t[r]=0,r-i}function stringToUTF8(e,t,r){return stringToUTF8Array(e,HEAPU8,t,r)}function lengthBytesUTF8(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3;}return t}function updateGlobalBufferAndViews(e){buffer=e,Module.HEAP8=HEAP8=new Int8Array(e),Module.HEAP16=HEAP16=new Int16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=new Uint16Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),Module.HEAPF32=HEAPF32=new Float32Array(e),Module.HEAPF64=HEAPF64=new Float64Array(e);}var INITIAL_MEMORY=Module.INITIAL_MEMORY||33554432;wasmMemory=Module.wasmMemory?Module.wasmMemory:new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:32768}),wasmMemory&&(buffer=wasmMemory.buffer),INITIAL_MEMORY=buffer.byteLength,updateGlobalBufferAndViews(buffer);var wasmTable=new WebAssembly.Table({initial:20,element:"anyfunc"}),__ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function keepRuntimeAlive(){return noExitRuntime}function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__);}function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),callRuntimeCallbacks(__ATINIT__);}function preMain(){callRuntimeCallbacks(__ATMAIN__);}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__);}function addOnPreRun(e){__ATPRERUN__.unshift(e);}function addOnInit(e){__ATINIT__.unshift(e);}function addOnPostRun(e){__ATPOSTRUN__.unshift(e);}var runDependencies=0,dependenciesFulfilled=null;function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies);}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),runDependencies==0&&(dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t();}}function abort(e){throw Module.onAbort&&Module.onAbort(e),err(e="Aborted("+e+")"),ABORT=!0,EXITSTATUS=1,e+=". Build with -sASSERTIONS for more info.",new WebAssembly.RuntimeError(e)}var dataURIPrefix="data:application/octet-stream;base64,",wasmBinaryFile,tempDouble,tempI64;function isDataURI(e){return e.startsWith(dataURIPrefix)}function isFileURI(e){return e.startsWith("file://")}function getBinary(e){try{if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw "both async and sync fetching of the wasm failed"}catch(t){abort(t);}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(wasmBinaryFile))return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw "failed to load wasm binary file at '"+wasmBinaryFile+"'";return e.arrayBuffer()}).catch(function(){return getBinary(wasmBinaryFile)});if(readAsync)return new Promise(function(e,t){readAsync(wasmBinaryFile,function(r){e(new Uint8Array(r));},t);})}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var e={env:asmLibraryArg,wasi_snapshot_preview1:asmLibraryArg,"GOT.mem":new Proxy(asmLibraryArg,GOTHandler),"GOT.func":new Proxy(asmLibraryArg,GOTHandler)};function t(i,s){var a=i.exports;a=relocateExports(a,1024);var o=getDylinkMetadata(s);o.neededDynlibs&&(dynamicLibraries=o.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(a),Module.asm=a,addOnInit(Module.asm.__wasm_call_ctors),__RELOC_FUNCS__.push(Module.asm.__wasm_apply_data_relocs),removeRunDependency();}function r(i){t(i.instance,i.module);}function n(i){return getBinaryPromise().then(function(s){return WebAssembly.instantiate(s,e)}).then(function(s){return s}).then(i,function(s){err("failed to asynchronously prepare wasm: "+s),abort(s);})}if(addRunDependency(),Module.instantiateWasm)try{return Module.instantiateWasm(e,t)}catch(i){return err("Module.instantiateWasm callback failed with error: "+i),!1}return wasmBinary||typeof WebAssembly.instantiateStreaming!="function"||isDataURI(wasmBinaryFile)||isFileURI(wasmBinaryFile)||ENVIRONMENT_IS_NODE||typeof fetch!="function"?n(r):fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(i){return WebAssembly.instantiateStreaming(i,e).then(r,function(s){return err("wasm streaming compile failed: "+s),err("falling back to ArrayBuffer instantiation"),n(r)})}),{}}wasmBinaryFile="tree-sitter.wasm",isDataURI(wasmBinaryFile)||(wasmBinaryFile=locateFile(wasmBinaryFile));function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e;}var GOT={},CurrentModuleWeakSymbols=new Set([]),GOTHandler={get:function(e,t){var r=GOT[t];return r||(r=GOT[t]=new WebAssembly.Global({value:"i32",mutable:!0})),CurrentModuleWeakSymbols.has(t)||(r.required=!0),r}};function callRuntimeCallbacks(e){for(;e.length>0;)e.shift()(Module);}function getDylinkMetadata(e){var t=0,r=0;function n(){for(var w=0,y=1;;){var b=e[t++];if(w+=(127&b)*y,y*=128,!(128&b))break}return w}function i(){var w=n();return UTF8ArrayToString(e,(t+=w)-w,w)}function s(w,y){if(w)throw new Error(y)}var a="dylink.0";if(e instanceof WebAssembly.Module){var o=WebAssembly.Module.customSections(e,a);o.length===0&&(a="dylink",o=WebAssembly.Module.customSections(e,a)),s(o.length===0,"need dylink section"),r=(e=new Uint8Array(o[0])).length;}else {s(new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer)[0]!=1836278016,"need to see wasm magic number"),s(e[8]!==0,"need the dylink section to be first"),t=9;var c=n();r=t+c,a=i();}var l={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(a=="dylink"){l.memorySize=n(),l.memoryAlign=n(),l.tableSize=n(),l.tableAlign=n();for(var u=n(),f=0;f<u;++f){var h=i();l.neededDynlibs.push(h);}}else for(s(a!=="dylink.0");t<r;){var p=e[t++],m=n();if(p===1)l.memorySize=n(),l.memoryAlign=n(),l.tableSize=n(),l.tableAlign=n();else if(p===2)for(u=n(),f=0;f<u;++f)h=i(),l.neededDynlibs.push(h);else if(p===3)for(var _=n();_--;){var E=i();256&n()&&l.tlsExports.add(E);}else if(p===4)for(_=n();_--;)i(),E=i(),(3&n())==1&&l.weakImports.add(E);else t+=m;}return l}function getValue(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":case"i8":return HEAP8[e>>0];case"i16":return HEAP16[e>>1];case"i32":case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];case"*":return HEAPU32[e>>2];default:abort("invalid type for getValue: "+t);}return null}function asmjsMangle(e){return e.indexOf("dynCall_")==0||["stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0"].includes(e)?e:"_"+e}function mergeLibSymbols(e,t){for(var r in e)if(e.hasOwnProperty(r)){asmLibraryArg.hasOwnProperty(r)||(asmLibraryArg[r]=e[r]);var n=asmjsMangle(r);Module.hasOwnProperty(n)||(Module[n]=e[r]),r=="__main_argc_argv"&&(Module._main=e[r]);}}var LDSO={loadedLibsByName:{},loadedLibsByHandle:{}};function dynCallLegacy(e,t,r){var n=Module["dynCall_"+e];return r&&r.length?n.apply(null,[t].concat(r)):n.call(null,t)}var wasmTableMirror=[];function getWasmTableEntry(e){var t=wasmTableMirror[e];return t||(e>=wasmTableMirror.length&&(wasmTableMirror.length=e+1),wasmTableMirror[e]=t=wasmTable.get(e)),t}function dynCall(e,t,r){return e.includes("j")?dynCallLegacy(e,t,r):getWasmTableEntry(t).apply(null,r)}function createInvokeFunction(e){return function(){var t=stackSave();try{return dynCall(e,arguments[0],Array.prototype.slice.call(arguments,1))}catch(r){if(stackRestore(t),r!==r+0)throw r;_setThrew(1,0);}}}var ___heap_base=78144;function zeroMemory(e,t){return HEAPU8.fill(0,e,e+t),e}function getMemory(e){if(runtimeInitialized)return zeroMemory(_malloc(e),e);var t=___heap_base,r=t+e+15&-16;return ___heap_base=r,GOT.__heap_base.value=r,t}function isInternalSym(e){return ["__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"].includes(e)}function uleb128Encode(e,t){e<128?t.push(e):t.push(e%128|128,e>>7);}function sigToWasmTypes(e){for(var t={i:"i32",j:"i32",f:"f32",d:"f64",p:"i32"},r={parameters:[],results:e[0]=="v"?[]:[t[e[0]]]},n=1;n<e.length;++n)r.parameters.push(t[e[n]]),e[n]==="j"&&r.parameters.push("i32");return r}function generateFuncType(e,t){var r=e.slice(0,1),n=e.slice(1),i={i:127,p:127,j:126,f:125,d:124};t.push(96),uleb128Encode(n.length,t);for(var s=0;s<n.length;++s)t.push(i[n[s]]);r=="v"?t.push(0):t.push(1,i[r]);}function convertJsFunctionToWasm(e,t){if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes(t),e);var r=[1];generateFuncType(t,r);var n=[0,97,115,109,1,0,0,0,1];uleb128Encode(r.length,n),n.push.apply(n,r),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var i=new WebAssembly.Module(new Uint8Array(n));return new WebAssembly.Instance(i,{e:{f:e}}).exports.f}function updateTableMap(e,t){if(functionsInTableMap)for(var r=e;r<e+t;r++){var n=getWasmTableEntry(r);n&&functionsInTableMap.set(n,r);}}var functionsInTableMap=void 0,freeTableIndexes=[];function getEmptyTableSlot(){if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1);}catch(e){throw e instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":e}return wasmTable.length-1}function setWasmTableEntry(e,t){wasmTable.set(e,t),wasmTableMirror[e]=wasmTable.get(e);}function addFunction(e,t){if(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.has(e))return functionsInTableMap.get(e);var r=getEmptyTableSlot();try{setWasmTableEntry(r,e);}catch(n){if(!(n instanceof TypeError))throw n;setWasmTableEntry(r,convertJsFunctionToWasm(e,t));}return functionsInTableMap.set(e,r),r}function updateGOT(e,t){for(var r in e)if(!isInternalSym(r)){var n=e[r];r.startsWith("orig$")&&(r=r.split("$")[1],t=!0),GOT[r]||(GOT[r]=new WebAssembly.Global({value:"i32",mutable:!0})),(t||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));}}function relocateExports(e,t,r){var n={};for(var i in e){var s=e[i];typeof s=="object"&&(s=s.value),typeof s=="number"&&(s+=t),n[i]=s;}return updateGOT(n,r),n}function resolveGlobalSymbol(e,t){var r;return t&&(r=asmLibraryArg["orig$"+e]),r||(r=asmLibraryArg[e])&&r.stub&&(r=void 0),r||(r=Module[asmjsMangle(e)]),!r&&e.startsWith("invoke_")&&(r=createInvokeFunction(e.split("_")[1])),r}function alignMemory(e,t){return Math.ceil(e/t)*t}function loadWebAssemblyModule(binary,flags,handle){var metadata=getDylinkMetadata(binary);function loadModule(){var firstLoad=!handle||!HEAP8[handle+12>>0];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign);memAlign=Math.max(memAlign,STACK_ALIGN);var memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+12>>0]=1,HEAPU32[handle+16>>2]=memoryBase,HEAP32[handle+20>>2]=metadata.memorySize,HEAPU32[handle+24>>2]=tableBase,HEAP32[handle+28>>2]=metadata.tableSize);}else memoryBase=HEAPU32[handle+16>>2],tableBase=HEAPU32[handle+24>>2];var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length,moduleExports;function resolveSymbol(e){var t=resolveGlobalSymbol(e,!1);return t||(t=moduleExports[e]),t}tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var proxyHandler={get:function(e,t){switch(t){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(t in asmLibraryArg)return asmLibraryArg[t];var r;return t in e||(e[t]=function(){return r||(r=resolveSymbol(t)),r.apply(null,arguments)}),e[t]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(instance){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+"};";eval(func);}if(updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols(),"__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start<stop;){var jsString=UTF8ToString(start);addEmAsm(start,jsString),start=HEAPU8.indexOf(0,start)+1;}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(flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(instance))}return WebAssembly.instantiate(binary,info).then(function(e){return postInstantiation(e.instance)})}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(instance)}return CurrentModuleWeakSymbols=metadata.weakImports,flags.loadAsync?metadata.neededDynlibs.reduce(function(e,t){return e.then(function(){return loadDynamicLibrary(t,flags)})},Promise.resolve()).then(function(){return loadModule()}):(metadata.neededDynlibs.forEach(function(e){loadDynamicLibrary(e,flags);}),loadModule())}function loadDynamicLibrary(e,t,r){t=t||{global:!0,nodelete:!0};var n=LDSO.loadedLibsByName[e];if(n)return t.global&&!n.global&&(n.global=!0,n.module!=="loading"&&mergeLibSymbols(n.module)),t.nodelete&&n.refcount!==1/0&&(n.refcount=1/0),n.refcount++,r&&(LDSO.loadedLibsByHandle[r]=n),!t.loadAsync||Promise.resolve(!0);function i(o){if(t.fs&&t.fs.findObject(o)){var c=t.fs.readFile(o,{encoding:"binary"});return c instanceof Uint8Array||(c=new Uint8Array(c)),t.loadAsync?Promise.resolve(c):c}if(o=locateFile(o),t.loadAsync)return new Promise(function(l,u){readAsync(o,f=>l(new Uint8Array(f)),u);});if(!readBinary)throw new Error(o+": file not found, and synchronous loading of external files is not available");return readBinary(o)}function s(){if(typeof preloadedWasm<"u"&&preloadedWasm[e]){var o=preloadedWasm[e];return t.loadAsync?Promise.resolve(o):o}return t.loadAsync?i(e).then(function(c){return loadWebAssemblyModule(c,t,r)}):loadWebAssemblyModule(i(e),t,r)}function a(o){n.global&&mergeLibSymbols(o),n.module=o;}return n={refcount:t.nodelete?1/0:1,name:e,module:"loading",global:t.global},LDSO.loadedLibsByName[e]=n,r&&(LDSO.loadedLibsByHandle[r]=n),t.loadAsync?s().then(function(o){return a(o),!0}):(a(s()),!0)}function reportUndefinedSymbols(){for(var e in GOT)if(GOT[e].value==0){var t=resolveGlobalSymbol(e,!0);if(!t&&!GOT[e].required)continue;if(typeof t=="function")GOT[e].value=addFunction(t,t.sig);else {if(typeof t!="number")throw new Error("bad export type for `"+e+"`: "+typeof t);GOT[e].value=t;}}}function preloadDylibs(){dynamicLibraries.length?(addRunDependency(),dynamicLibraries.reduce(function(e,t){return e.then(function(){return loadDynamicLibrary(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})})},Promise.resolve()).then(function(){reportUndefinedSymbols(),removeRunDependency();})):reportUndefinedSymbols();}function setValue(e,t,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":case"i8":HEAP8[e>>0]=t;break;case"i16":HEAP16[e>>1]=t;break;case"i32":HEAP32[e>>2]=t;break;case"i64":tempI64=[t>>>0,(tempDouble=t,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64[0],HEAP32[e+4>>2]=tempI64[1];break;case"float":HEAPF32[e>>2]=t;break;case"double":HEAPF64[e>>3]=t;break;case"*":HEAPU32[e>>2]=t;break;default:abort("invalid type for setValue: "+r);}}var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},78144),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),nowIsMonotonic=!0,_emscripten_get_now;function __emscripten_get_now_is_monotonic(){return nowIsMonotonic}function _abort(){abort("");}function _emscripten_memcpy_big(e,t,r){HEAPU8.copyWithin(e,t,t+r);}function getHeapMax(){return 2147483648}function emscripten_realloc_buffer(e){try{return wasmMemory.grow(e-buffer.byteLength+65535>>>16),updateGlobalBufferAndViews(wasmMemory.buffer),1}catch{}}function _emscripten_resize_heap(e){var t=HEAPU8.length;e>>>=0;var r=getHeapMax();if(e>r)return !1;for(var n=1;n<=4;n*=2){var i=t*(1+.2/n);if(i=Math.min(i,e+100663296),emscripten_realloc_buffer(Math.min(r,(s=Math.max(e,i))+((a=65536)-s%a)%a)))return !0}var s,a;return !1}__emscripten_get_now_is_monotonic.sig="i",Module._abort=_abort,_abort.sig="v",_emscripten_get_now=ENVIRONMENT_IS_NODE?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:()=>performance.now(),_emscripten_get_now.sig="d",_emscripten_memcpy_big.sig="vppp",_emscripten_resize_heap.sig="ip";var SYSCALLS={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(PATH.isAbs(t))return t;var n;if(e===-100?n=FS.cwd():n=SYSCALLS.getStreamFromFD(e).path,t.length==0){if(!r)throw new FS.ErrnoError(44);return n}return PATH.join2(n,t)},doStat:function(e,t,r){try{var n=e(t);}catch(o){if(o&&o.node&&PATH.normalize(t)!==PATH.normalize(FS.getPath(o.node)))return -54;throw o}HEAP32[r>>2]=n.dev,HEAP32[r+8>>2]=n.ino,HEAP32[r+12>>2]=n.mode,HEAPU32[r+16>>2]=n.nlink,HEAP32[r+20>>2]=n.uid,HEAP32[r+24>>2]=n.gid,HEAP32[r+28>>2]=n.rdev,tempI64=[n.size>>>0,(tempDouble=n.size,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+40>>2]=tempI64[0],HEAP32[r+44>>2]=tempI64[1],HEAP32[r+48>>2]=4096,HEAP32[r+52>>2]=n.blocks;var i=n.atime.getTime(),s=n.mtime.getTime(),a=n.ctime.getTime();return tempI64=[Math.floor(i/1e3)>>>0,(tempDouble=Math.floor(i/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+56>>2]=tempI64[0],HEAP32[r+60>>2]=tempI64[1],HEAPU32[r+64>>2]=i%1e3*1e3,tempI64=[Math.floor(s/1e3)>>>0,(tempDouble=Math.floor(s/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+72>>2]=tempI64[0],HEAP32[r+76>>2]=tempI64[1],HEAPU32[r+80>>2]=s%1e3*1e3,tempI64=[Math.floor(a/1e3)>>>0,(tempDouble=Math.floor(a/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+88>>2]=tempI64[0],HEAP32[r+92>>2]=tempI64[1],HEAPU32[r+96>>2]=a%1e3*1e3,tempI64=[n.ino>>>0,(tempDouble=n.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+104>>2]=tempI64[0],HEAP32[r+108>>2]=tempI64[1],0},doMsync:function(e,t,r,n,i){if(!FS.isFile(t.node.mode))throw new FS.ErrnoError(43);if(2&n)return 0;var s=HEAPU8.slice(e,e+r);FS.msync(t,s,i,r,n);},varargs:void 0,get:function(){return SYSCALLS.varargs+=4,HEAP32[SYSCALLS.varargs-4>>2]},getStr:function(e){return UTF8ToString(e)},getStreamFromFD:function(e){var t=FS.getStream(e);if(!t)throw new FS.ErrnoError(8);return t}};function _proc_exit(e){EXITSTATUS=e,keepRuntimeAlive()||(Module.onExit&&Module.onExit(e),ABORT=!0),quit_(e,new ExitStatus(e));}function exitJS(e,t){EXITSTATUS=e,_proc_exit(e);}_proc_exit.sig="vi";var _exit=exitJS;function _fd_close(e){try{var t=SYSCALLS.getStreamFromFD(e);return FS.close(t),0}catch(r){if(typeof FS>"u"||!(r instanceof FS.ErrnoError))throw r;return r.errno}}function convertI32PairToI53Checked(e,t){return t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN}function _fd_seek(e,t,r,n,i){try{var s=convertI32PairToI53Checked(t,r);if(isNaN(s))return 61;var a=SYSCALLS.getStreamFromFD(e);return FS.llseek(a,s,n),tempI64=[a.position>>>0,(tempDouble=a.position,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[i>>2]=tempI64[0],HEAP32[i+4>>2]=tempI64[1],a.getdents&&s===0&&n===0&&(a.getdents=null),0}catch(o){if(typeof FS>"u"||!(o instanceof FS.ErrnoError))throw o;return o.errno}}function doWritev(e,t,r,n){for(var i=0,s=0;s<r;s++){var a=HEAPU32[t>>2],o=HEAPU32[t+4>>2];t+=8;var c=FS.write(e,HEAP8,a,o,n);if(c<0)return -1;i+=c,n!==void 0&&(n+=c);}return i}function _fd_write(e,t,r,n){try{var i=doWritev(SYSCALLS.getStreamFromFD(e),t,r);return HEAPU32[n>>2]=i,0}catch(s){if(typeof FS>"u"||!(s instanceof FS.ErrnoError))throw s;return s.errno}}function _tree_sitter_log_callback(e,t){if(currentLogCallback){let r=UTF8ToString(t);currentLogCallback(r,e!==0);}}function _tree_sitter_parse_callback(e,t,r,n,i){var s=currentParseCallback(t,{row:r,column:n});typeof s=="string"?(setValue(i,s.length,"i32"),stringToUTF16(s,e,10240)):setValue(i,0,"i32");}function handleException(e){if(e instanceof ExitStatus||e=="unwind")return EXITSTATUS;quit_(1,e);}function allocateUTF8OnStack(e){var t=lengthBytesUTF8(e)+1,r=stackAlloc(t);return stringToUTF8Array(e,HEAP8,r,t),r}function stringToUTF16(e,t,r){if(r===void 0&&(r=2147483647),r<2)return 0;for(var n=t,i=(r-=2)<2*e.length?r/2:e.length,s=0;s<i;++s){var a=e.charCodeAt(s);HEAP16[t>>1]=a,t+=2;}return HEAP16[t>>1]=0,t-n}function AsciiToString(e){for(var t="";;){var r=HEAPU8[e++>>0];if(!r)return t;t+=String.fromCharCode(r);}}_exit.sig="vi",_fd_close.sig="ii",_fd_seek.sig="iijip",_fd_write.sig="iippp";var asmLibraryArg={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_pointer:___stack_pointer,__table_base:___table_base,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,abort:_abort,emscripten_get_now:_emscripten_get_now,emscripten_memcpy_big:_emscripten_memcpy_big,emscripten_resize_heap:_emscripten_resize_heap,exit:_exit,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};createWasm();Module.___wasm_call_ctors=function(){return (Module.___wasm_call_ctors=Module.asm.__wasm_call_ctors).apply(null,arguments)};Module.___wasm_apply_data_relocs=function(){return (Module.___wasm_apply_data_relocs=Module.asm.__wasm_apply_data_relocs).apply(null,arguments)};var _malloc=Module._malloc=function(){return (_malloc=Module._malloc=Module.asm.malloc).apply(null,arguments)};Module._calloc=function(){return (Module._calloc=Module.asm.calloc).apply(null,arguments)};Module._realloc=function(){return (Module._realloc=Module.asm.realloc).apply(null,arguments)};Module._free=function(){return (Module._free=Module.asm.free).apply(null,arguments)};Module._ts_language_symbol_count=function(){return (Module._ts_language_symbol_count=Module.asm.ts_language_symbol_count).apply(null,arguments)};Module._ts_language_version=function(){return (Module._ts_language_version=Module.asm.ts_language_version).apply(null,arguments)};Module._ts_language_field_count=function(){return (Module._ts_language_field_count=Module.asm.ts_language_field_count).apply(null,arguments)};Module._ts_language_symbol_name=function(){return (Module._ts_language_symbol_name=Module.asm.ts_language_symbol_name).apply(null,arguments)};Module._ts_language_symbol_for_name=function(){return (Module._ts_language_symbol_for_name=Module.asm.ts_language_symbol_for_name).apply(null,arguments)};Module._ts_language_symbol_type=function(){return (Module._ts_language_symbol_type=Module.asm.ts_language_symbol_type).apply(null,arguments)};Module._ts_language_field_name_for_id=function(){return (Module._ts_language_field_name_for_id=Module.asm.ts_language_field_name_for_id).apply(null,arguments)};Module._memset=function(){return (Module._memset=Module.asm.memset).apply(null,arguments)};Module._memcpy=function(){return (Module._memcpy=Module.asm.memcpy).apply(null,arguments)};Module._ts_parser_delete=function(){return (Module._ts_parser_delete=Module.asm.ts_parser_delete).apply(null,arguments)};Module._ts_parser_reset=function(){return (Module._ts_parser_reset=Module.asm.ts_parser_reset).apply(null,arguments)};Module._ts_parser_set_language=function(){return (Module._ts_parser_set_language=Module.asm.ts_parser_set_language).apply(null,arguments)};Module._ts_parser_timeout_micros=function(){return (Module._ts_parser_timeout_micros=Module.asm.ts_parser_timeout_micros).apply(null,arguments)};Module._ts_parser_set_timeout_micros=function(){return (Module._ts_parser_set_timeout_micros=Module.asm.ts_parser_set_timeout_micros).apply(null,arguments)};Module._memmove=function(){return (Module._memmove=Module.asm.memmove).apply(null,arguments)};Module._memcmp=function(){return (Module._memcmp=Module.asm.memcmp).apply(null,arguments)};Module._ts_query_new=function(){return (Module._ts_query_new=Module.asm.ts_query_new).apply(null,arguments)};Module._ts_query_delete=function(){return (Module._ts_query_delete=Module.asm.ts_query_delete).apply(null,arguments)};Module._iswspace=function(){return (Module._iswspace=Module.asm.iswspace).apply(null,arguments)};Module._iswalnum=function(){return (Module._iswalnum=Module.asm.iswalnum).apply(null,arguments)};Module._ts_query_pattern_count=function(){return (Module._ts_query_pattern_count=Module.asm.ts_query_pattern_count).apply(null,arguments)};Module._ts_query_capture_count=function(){return (Module._ts_query_capture_count=Module.asm.ts_query_capture_count).apply(null,arguments)};Module._ts_query_string_count=function(){return (Module._ts_query_string_count=Module.asm.ts_query_string_count).apply(null,arguments)};Module._ts_query_capture_name_for_id=function(){return (Module._ts_query_capture_name_for_id=Module.asm.ts_query_capture_name_for_id).apply(null,arguments)};Module._ts_query_string_value_for_id=function(){return (Module._ts_query_string_value_for_id=Module.asm.ts_query_string_value_for_id).apply(null,arguments)};Module._ts_query_predicates_for_pattern=function(){return (Module._ts_query_predicates_for_pattern=Module.asm.ts_query_predicates_for_pattern).apply(null,arguments)};Module._ts_tree_copy=function(){return (Module._ts_tree_copy=Module.asm.ts_tree_copy).apply(null,arguments)};Module._ts_tree_delete=function(){return (Module._ts_tree_delete=Module.asm.ts_tree_delete).apply(null,arguments)};Module._ts_init=function(){return (Module._ts_init=Module.asm.ts_init).apply(null,arguments)};Module._ts_parser_new_wasm=function(){return (Module._ts_parser_new_wasm=Module.asm.ts_parser_new_wasm).apply(null,arguments)};Module._ts_parser_enable_logger_wasm=function(){return (Module._ts_parser_enable_logger_wasm=Module.asm.ts_parser_enable_logger_wasm).apply(null,arguments)};Module._ts_parser_parse_wasm=function(){return (Module._ts_parser_parse_wasm=Module.asm.ts_parser_parse_wasm).apply(null,arguments)};Module._ts_language_type_is_named_wasm=function(){return (Module._ts_language_type_is_named_wasm=Module.asm.ts_language_type_is_named_wasm).apply(null,arguments)};Module._ts_language_type_is_visible_wasm=function(){return (Module._ts_language_type_is_visible_wasm=Module.asm.ts_language_type_is_visible_wasm).apply(null,arguments)};Module._ts_tree_root_node_wasm=function(){return (Module._ts_tree_root_node_wasm=Module.asm.ts_tree_root_node_wasm).apply(null,arguments)};Module._ts_tree_edit_wasm=function(){return (Module._ts_tree_edit_wasm=Module.asm.ts_tree_edit_wasm).apply(null,arguments)};Module._ts_tree_get_changed_ranges_wasm=function(){return (Module._ts_tree_get_changed_ranges_wasm=Module.asm.ts_tree_get_changed_ranges_wasm).apply(null,arguments)};Module._ts_tree_cursor_new_wasm=function(){return (Module._ts_tree_cursor_new_wasm=Module.asm.ts_tree_cursor_new_wasm).apply(null,arguments)};Module._ts_tree_cursor_delete_wasm=function(){return (Module._ts_tree_cursor_delete_wasm=Module.asm.ts_tree_cursor_delete_wasm).apply(null,arguments)};Module._ts_tree_cursor_reset_wasm=function(){return (Module._ts_tree_cursor_reset_wasm=Module.asm.ts_tree_cursor_reset_wasm).apply(null,arguments)};Module._ts_tree_cursor_goto_first_child_wasm=function(){return (Module._ts_tree_cursor_goto_first_child_wasm=Module.asm.ts_tree_cursor_goto_first_child_wasm).apply(null,arguments)};Module._ts_tree_cursor_goto_next_sibling_wasm=function(){return (Module._ts_tree_cursor_goto_next_sibling_wasm=Module.asm.ts_tree_cursor_goto_next_sibling_wasm).apply(null,arguments)};Module._ts_tree_cursor_goto_parent_wasm=function(){return (Module._ts_tree_cursor_goto_parent_wasm=Module.asm.ts_tree_cursor_goto_parent_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_type_id_wasm=function(){return (Module._ts_tree_cursor_current_node_type_id_wasm=Module.asm.ts_tree_cursor_current_node_type_id_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_is_named_wasm=function(){return (Module._ts_tree_cursor_current_node_is_named_wasm=Module.asm.ts_tree_cursor_current_node_is_named_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_is_missing_wasm=function(){return (Module._ts_tree_cursor_current_node_is_missing_wasm=Module.asm.ts_tree_cursor_current_node_is_missing_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_id_wasm=function(){return (Module._ts_tree_cursor_current_node_id_wasm=Module.asm.ts_tree_cursor_current_node_id_wasm).apply(null,arguments)};Module._ts_tree_cursor_start_position_wasm=function(){return (Module._ts_tree_cursor_start_position_wasm=Module.asm.ts_tree_cursor_start_position_wasm).apply(null,arguments)};Module._ts_tree_cursor_end_position_wasm=function(){return (Module._ts_tree_cursor_end_position_wasm=Module.asm.ts_tree_cursor_end_position_wasm).apply(null,arguments)};Module._ts_tree_cursor_start_index_wasm=function(){return (Module._ts_tree_cursor_start_index_wasm=Module.asm.ts_tree_cursor_start_index_wasm).apply(null,arguments)};Module._ts_tree_cursor_end_index_wasm=function(){return (Module._ts_tree_cursor_end_index_wasm=Module.asm.ts_tree_cursor_end_index_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_field_id_wasm=function(){return (Module._ts_tree_cursor_current_field_id_wasm=Module.asm.ts_tree_cursor_current_field_id_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_wasm=function(){return (Module._ts_tree_cursor_current_node_wasm=Module.asm.ts_tree_cursor_current_node_wasm).apply(null,arguments)};Module._ts_node_symbol_wasm=function(){return (Module._ts_node_symbol_wasm=Module.asm.ts_node_symbol_wasm).apply(null,arguments)};Module._ts_node_child_count_wasm=function(){return (Module._ts_node_child_count_wasm=Module.asm.ts_node_child_count_wasm).apply(null,arguments)};Module._ts_node_named_child_count_wasm=function(){return (Module._ts_node_named_child_count_wasm=Module.asm.ts_node_named_child_count_wasm).apply(null,arguments)};Module._ts_node_child_wasm=function(){return (Module._ts_node_child_wasm=Module.asm.ts_node_child_wasm).apply(null,arguments)};Module._ts_node_named_child_wasm=function(){return (Module._ts_node_named_child_wasm=Module.asm.ts_node_named_child_wasm).apply(null,arguments)};Module._ts_node_child_by_field_id_wasm=function(){return (Module._ts_node_child_by_field_id_wasm=Module.asm.ts_node_child_by_field_id_wasm).apply(null,arguments)};Module._ts_node_next_sibling_wasm=function(){return (Module._ts_node_next_sibling_wasm=Module.asm.ts_node_next_sibling_wasm).apply(null,arguments)};Module._ts_node_prev_sibling_wasm=function(){return (Module._ts_node_prev_sibling_wasm=Module.asm.ts_node_prev_sibling_wasm).apply(null,arguments)};Module._ts_node_next_named_sibling_wasm=function(){return (Module._ts_node_next_named_sibling_wasm=Module.asm.ts_node_next_named_sibling_wasm).apply(null,arguments)};Module._ts_node_prev_named_sibling_wasm=function(){return (Module._ts_node_prev_named_sibling_wasm=Module.asm.ts_node_prev_named_sibling_wasm).apply(null,arguments)};Module._ts_node_parent_wasm=function(){return (Module._ts_node_parent_wasm=Module.asm.ts_node_parent_wasm).apply(null,arguments)};Module._ts_node_descendant_for_index_wasm=function(){return (Module._ts_node_descendant_for_index_wasm=Module.asm.ts_node_descendant_for_index_wasm).apply(null,arguments)};Module._ts_node_named_descendant_for_index_wasm=function(){return (Module._ts_node_named_descendant_for_index_wasm=Module.asm.ts_node_named_descendant_for_index_wasm).apply(null,arguments)};Module._ts_node_descendant_for_position_wasm=function(){return (Module._ts_node_descendant_for_position_wasm=Module.asm.ts_node_descendant_for_position_wasm).apply(null,arguments)};Module._ts_node_named_descendant_for_position_wasm=function(){return (Module._ts_node_named_descendant_for_position_wasm=Module.asm.ts_node_named_descendant_for_position_wasm).apply(null,arguments)};Module._ts_node_start_point_wasm=function(){return (Module._ts_node_start_point_wasm=Module.asm.ts_node_start_point_wasm).apply(null,arguments)};Module._ts_node_end_point_wasm=function(){return (Module._ts_node_end_point_wasm=Module.asm.ts_node_end_point_wasm).apply(null,arguments)};Module._ts_node_start_index_wasm=function(){return (Module._ts_node_start_index_wasm=Module.asm.ts_node_start_index_wasm).apply(null,arguments)};Module._ts_node_end_index_wasm=function(){return (Module._ts_node_end_index_wasm=Module.asm.ts_node_end_index_wasm).apply(null,arguments)};Module._ts_node_to_string_wasm=function(){return (Module._ts_node_to_string_wasm=Module.asm.ts_node_to_string_wasm).apply(null,arguments)};Module._ts_node_children_wasm=function(){return (Module._ts_node_children_wasm=Module.asm.ts_node_children_wasm).apply(null,arguments)};Module._ts_node_named_children_wasm=function(){return (Module._ts_node_named_children_wasm=Module.asm.ts_node_named_children_wasm).apply(null,arguments)};Module._ts_node_descendants_of_type_wasm=function(){return (Module._ts_node_descendants_of_type_wasm=Module.asm.ts_node_descendants_of_type_wasm).apply(null,arguments)};Module._ts_node_is_named_wasm=function(){return (Module._ts_node_is_named_wasm=Module.asm.ts_node_is_named_wasm).apply(null,arguments)};Module._ts_node_has_changes_wasm=function(){return (Module._ts_node_has_changes_wasm=Module.asm.ts_node_has_changes_wasm).apply(null,arguments)};Module._ts_node_has_error_wasm=function(){return (Module._ts_node_has_error_wasm=Module.asm.ts_node_has_error_wasm).apply(null,arguments)};Module._ts_node_is_missing_wasm=function(){return (Module._ts_node_is_missing_wasm=Module.asm.ts_node_is_missing_wasm).apply(null,arguments)};Module._ts_query_matches_wasm=function(){return (Module._ts_query_matches_wasm=Module.asm.ts_query_matches_wasm).apply(null,arguments)};Module._ts_query_captures_wasm=function(){return (Module._ts_query_captures_wasm=Module.asm.ts_query_captures_wasm).apply(null,arguments)};Module.___cxa_atexit=function(){return (Module.___cxa_atexit=Module.asm.__cxa_atexit).apply(null,arguments)};Module._iswdigit=function(){return (Module._iswdigit=Module.asm.iswdigit).apply(null,arguments)};Module._iswalpha=function(){return (Module._iswalpha=Module.asm.iswalpha).apply(null,arguments)};Module._iswlower=function(){return (Module._iswlower=Module.asm.iswlower).apply(null,arguments)};Module._memchr=function(){return (Module._memchr=Module.asm.memchr).apply(null,arguments)};Module._strlen=function(){return (Module._strlen=Module.asm.strlen).apply(null,arguments)};Module._towupper=function(){return (Module._towupper=Module.asm.towupper).apply(null,arguments)};var _setThrew=Module._setThrew=function(){return (_setThrew=Module._setThrew=Module.asm.setThrew).apply(null,arguments)},stackSave=Module.stackSave=function(){return (stackSave=Module.stackSave=Module.asm.stackSave).apply(null,arguments)},stackRestore=Module.stackRestore=function(){return (stackRestore=Module.stackRestore=Module.asm.stackRestore).apply(null,arguments)},stackAlloc=Module.stackAlloc=function(){return (stackAlloc=Module.stackAlloc=Module.asm.stackAlloc).apply(null,arguments)};Module.__Znwm=function(){return (Module.__Znwm=Module.asm._Znwm).apply(null,arguments)};Module.__ZdlPv=function(){return (Module.__ZdlPv=Module.asm._ZdlPv).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm).apply(null,arguments)};Module.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=function(){return (Module.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=Module.asm._ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc).apply(null,arguments)};Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=function(){return (Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev).apply(null,arguments)};Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=function(){return (Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw).apply(null,arguments)};Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw=function(){return (Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw=Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw).apply(null,arguments)};Module.dynCall_jiji=function(){return (Module.dynCall_jiji=Module.asm.dynCall_jiji).apply(null,arguments)};Module._orig$ts_parser_timeout_micros=function(){return (Module._orig$ts_parser_timeout_micros=Module.asm.orig$ts_parser_timeout_micros).apply(null,arguments)};Module._orig$ts_parser_set_timeout_micros=function(){return (Module._orig$ts_parser_set_timeout_micros=Module.asm.orig$ts_parser_set_timeout_micros).apply(null,arguments)};var calledRun;function callMain(e){var t=Module._main;if(t){(e=e||[]).unshift(thisProgram);var r=e.length,n=stackAlloc(4*(r+1)),i=n>>2;e.forEach(a=>{HEAP32[i++]=allocateUTF8OnStack(a);}),HEAP32[i]=0;try{var s=t(r,n);return exitJS(s),s}catch(a){return handleException(a)}}}Module.AsciiToString=AsciiToString,Module.stringToUTF16=stringToUTF16,dependenciesFulfilled=function e(){calledRun||run(),calledRun||(dependenciesFulfilled=e);};var dylibsLoaded=!1;function run(e){function t(){calledRun||(calledRun=!0,Module.calledRun=!0,ABORT||(initRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),shouldRunNow&&callMain(e),postRun()));}e=e||arguments_,runDependencies>0||!dylibsLoaded&&(preloadDylibs(),dylibsLoaded=!0,runDependencies>0)||(preRun(),runDependencies>0||(Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("");},1),t();},1)):t()));}if(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_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+/;var VERSION,MIN_COMPATIBLE_VERSION,TRANSFER_BUFFER,currentParseCallback,currentLogCallback;class 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(t){let r;if(t){if(t.constructor!==Language)throw new Error("Argument must be a Language");{r=t[0];let n=C._ts_language_version(r);if(n<MIN_COMPATIBLE_VERSION||VERSION<n)throw new Error(`Incompatible language version ${n}. Compatibility range ${MIN_COMPATIBLE_VERSION} through ${VERSION}.`)}}else r=0,t=null;return this.language=t,C._ts_parser_set_language(this[0],r),this}getLanguage(){return this.language}parse(t,r,n){if(typeof t=="string")currentParseCallback=(c,l,u)=>t.slice(c,u);else {if(typeof t!="function")throw new Error("Argument must be a string or a function");currentParseCallback=t;}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 i=0,s=0;if(n&&n.includedRanges){i=n.includedRanges.length,s=C._calloc(i,SIZE_OF_RANGE);let c=s;for(let l=0;l<i;l++)marshalRange(c,n.includedRanges[l]),c+=SIZE_OF_RANGE;}let a=C._ts_parser_parse_wasm(this[0],this[1],r?r[0]:0,s,i);if(!a)throw currentParseCallback=null,currentLogCallback=null,new Error("Parsing failed");let o=new Tree(INTERNAL,a,this.language,currentParseCallback);return currentParseCallback=null,currentLogCallback=null,o}reset(){C._ts_parser_reset(this[0]);}setTimeoutMicros(t){C._ts_parser_set_timeout_micros(this[0],t);}getTimeoutMicros(){return C._ts_parser_timeout_micros(this[0])}setLogger(t){if(t){if(typeof t!="function")throw new Error("Logger callback must be a function")}else t=null;return this.logCallback=t,this}getLogger(){return this.logCallback}}class Tree{constructor(t,r,n,i){assertInternal(t),this[0]=r,this.language=n,this.textCallback=i;}copy(){let t=C._ts_tree_copy(this[0]);return new Tree(INTERNAL,t,this.language,this.textCallback)}delete(){C._ts_tree_delete(this[0]),this[0]=0;}edit(t){marshalEdit(t),C._ts_tree_edit_wasm(this[0]);}get rootNode(){return C._ts_tree_root_node_wasm(this[0]),unmarshalNode(this)}getLanguage(){return this.language}walk(){return this.rootNode.walk()}getChangedRanges(t){if(t.constructor!==Tree)throw new TypeError("Argument must be a Tree");C._ts_tree_get_changed_ranges_wasm(this[0],t[0]);let r=getValue(TRANSFER_BUFFER,"i32"),n=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),i=new Array(r);if(r>0){let s=n;for(let a=0;a<r;a++)i[a]=unmarshalRange(s),s+=SIZE_OF_RANGE;C._free(n);}return i}}class Node{constructor(t,r){assertInternal(t),this.tree=r;}get typeId(){return marshalNode(this),C._ts_node_symbol_wasm(this.tree[0])}get type(){return this.tree.language.types[this.typeId]||"ERROR"}get endPosition(){return marshalNode(this),C._ts_node_end_point_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get endIndex(){return marshalNode(this),C._ts_node_end_index_wasm(this.tree[0])}get text(){return getText(this.tree,this.startIndex,this.endIndex)}isNamed(){return marshalNode(this),C._ts_node_is_named_wasm(this.tree[0])===1}hasError(){return marshalNode(this),C._ts_node_has_error_wasm(this.tree[0])===1}hasChanges(){return marshalNode(this),C._ts_node_has_changes_wasm(this.tree[0])===1}isMissing(){return marshalNode(this),C._ts_node_is_missing_wasm(this.tree[0])===1}equals(t){return this.id===t.id}child(t){return marshalNode(this),C._ts_node_child_wasm(this.tree[0],t),unmarshalNode(this.tree)}namedChild(t){return marshalNode(this),C._ts_node_named_child_wasm(this.tree[0],t),unmarshalNode(this.tree)}childForFieldId(t){return marshalNode(this),C._ts_node_child_by_field_id_wasm(this.tree[0],t),unmarshalNode(this.tree)}childForFieldName(t){let r=this.tree.language.fields.indexOf(t);if(r!==-1)return this.childForFieldId(r)}get childCount(){return marshalNode(this),C._ts_node_child_count_wasm(this.tree[0])}get namedChildCount(){return marshalNode(this),C._ts_node_named_child_count_wasm(this.tree[0])}get firstChild(){return this.child(0)}get firstNamedChild(){return this.namedChild(0)}get lastChild(){return this.child(this.childCount-1)}get lastNamedChild(){return this.namedChild(this.namedChildCount-1)}get children(){if(!this._children){marshalNode(this),C._ts_node_children_wasm(this.tree[0]);let t=getValue(TRANSFER_BUFFER,"i32"),r=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");if(this._children=new Array(t),t>0){let n=r;for(let i=0;i<t;i++)this._children[i]=unmarshalNode(this.tree,n),n+=SIZE_OF_NODE;C._free(r);}}return this._children}get namedChildren(){if(!this._namedChildren){marshalNode(this),C._ts_node_named_children_wasm(this.tree[0]);let t=getValue(TRANSFER_BUFFER,"i32"),r=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");if(this._namedChildren=new Array(t),t>0){let n=r;for(let i=0;i<t;i++)this._namedChildren[i]=unmarshalNode(this.tree,n),n+=SIZE_OF_NODE;C._free(r);}}return this._namedChildren}descendantsOfType(t,r,n){Array.isArray(t)||(t=[t]),r||(r=ZERO_POINT),n||(n=ZERO_POINT);let i=[],s=this.tree.language.types;for(let u=0,f=s.length;u<f;u++)t.includes(s[u])&&i.push(u);let a=C._malloc(SIZE_OF_INT*i.length);for(let u=0,f=i.length;u<f;u++)setValue(a+u*SIZE_OF_INT,i[u],"i32");marshalNode(this),C._ts_node_descendants_of_type_wasm(this.tree[0],a,i.length,r.row,r.column,n.row,n.column);let o=getValue(TRANSFER_BUFFER,"i32"),c=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),l=new Array(o);if(o>0){let u=c;for(let f=0;f<o;f++)l[f]=unmarshalNode(this.tree,u),u+=SIZE_OF_NODE;}return C._free(c),C._free(a),l}get nextSibling(){return marshalNode(this),C._ts_node_next_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get previousSibling(){return marshalNode(this),C._ts_node_prev_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get nextNamedSibling(){return marshalNode(this),C._ts_node_next_named_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get previousNamedSibling(){return marshalNode(this),C._ts_node_prev_named_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get parent(){return marshalNode(this),C._ts_node_parent_wasm(this.tree[0]),unmarshalNode(this.tree)}descendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");marshalNode(this);let n=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue(n,t,"i32"),setValue(n+SIZE_OF_INT,r,"i32"),C._ts_node_descendant_for_index_wasm(this.tree[0]),unmarshalNode(this.tree)}namedDescendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");marshalNode(this);let n=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue(n,t,"i32"),setValue(n+SIZE_OF_INT,r,"i32"),C._ts_node_named_descendant_for_index_wasm(this.tree[0]),unmarshalNode(this.tree)}descendantForPosition(t,r=t){if(!isPoint(t)||!isPoint(r))throw new Error("Arguments must be {row, column} objects");marshalNode(this);let n=TRANSFER_BUFFER+SIZE_OF_NODE;return marshalPoint(n,t),marshalPoint(n+SIZE_OF_POINT,r),C._ts_node_descendant_for_position_wasm(this.tree[0]),unmarshalNode(this.tree)}namedDescendantForPosition(t,r=t){if(!isPoint(t)||!isPoint(r))throw new Error("Arguments must be {row, column} objects");marshalNode(this);let n=TRANSFER_BUFFER+SIZE_OF_NODE;return marshalPoint(n,t),marshalPoint(n+SIZE_OF_POINT,r),C._ts_node_named_descendant_for_position_wasm(this.tree[0]),unmarshalNode(this.tree)}walk(){return marshalNode(this),C._ts_tree_cursor_new_wasm(this.tree[0]),new TreeCursor(INTERNAL,this.tree)}toString(){marshalNode(this);let t=C._ts_node_to_string_wasm(this.tree[0]),r=AsciiToString(t);return C._free(t),r}}class TreeCursor{constructor(t,r){assertInternal(t),this.tree=r,unmarshalTreeCursor(this);}delete(){marshalTreeCursor(this),C._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0;}reset(t){marshalNode(t),marshalTreeCursor(this,TRANSFER_BUFFER+SIZE_OF_NODE),C._ts_tree_cursor_reset_wasm(this.tree[0]),unmarshalTreeCursor(this);}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])===1}get nodeIsMissing(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])===1}get nodeText(){marshalTreeCursor(this);let t=C._ts_tree_cursor_start_index_wasm(this.tree[0]),r=C._ts_tree_cursor_end_index_wasm(this.tree[0]);return getText(this.tree,t,r)}get startPosition(){return marshalTreeCursor(this),C._ts_tree_cursor_start_position_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get endPosition(){return marshalTreeCursor(this),C._ts_tree_cursor_end_position_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get startIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_end_index_wasm(this.tree[0])}currentNode(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_wasm(this.tree[0]),unmarshalNode(this.tree)}currentFieldId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_field_id_wasm(this.tree[0])}currentFieldName(){return this.tree.language.fields[this.currentFieldId()]}gotoFirstChild(){marshalTreeCursor(this);let t=C._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return unmarshalTreeCursor(this),t===1}gotoNextSibling(){marshalTreeCursor(this);let t=C._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return unmarshalTreeCursor(this),t===1}gotoParent(){marshalTreeCursor(this);let t=C._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return unmarshalTreeCursor(this),t===1}}class Language{constructor(t,r){assertInternal(t),this[0]=r,this.types=new Array(C._ts_language_symbol_count(this[0]));for(let n=0,i=this.types.length;n<i;n++)C._ts_language_symbol_type(this[0],n)<2&&(this.types[n]=UTF8ToString(C._ts_language_symbol_name(this[0],n)));this.fields=new Array(C._ts_language_field_count(this[0])+1);for(let n=0,i=this.fields.length;n<i;n++){let s=C._ts_language_field_name_for_id(this[0],n);this.fields[n]=s!==0?UTF8ToString(s):null;}}get version(){return C._ts_language_version(this[0])}get fieldCount(){return this.fields.length-1}fieldIdForName(t){let r=this.fields.indexOf(t);return r!==-1?r:null}fieldNameForId(t){return this.fields[t]||null}idForNodeType(t,r){let n=lengthBytesUTF8(t),i=C._malloc(n+1);stringToUTF8(t,i,n+1);let s=C._ts_language_symbol_for_name(this[0],i,n,r);return C._free(i),s||null}get nodeTypeCount(){return C._ts_language_symbol_count(this[0])}nodeTypeForId(t){let r=C._ts_language_symbol_name(this[0],t);return r?UTF8ToString(r):null}nodeTypeIsNamed(t){return !!C._ts_language_type_is_named_wasm(this[0],t)}nodeTypeIsVisible(t){return !!C._ts_language_type_is_visible_wasm(this[0],t)}query(t){let r=lengthBytesUTF8(t),n=C._malloc(r+1);stringToUTF8(t,n,r+1);let i=C._ts_query_new(this[0],n,r,TRANSFER_BUFFER,TRANSFER_BUFFER+SIZE_OF_INT);if(!i){let _=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),E=UTF8ToString(n,getValue(TRANSFER_BUFFER,"i32")).length,w=t.substr(E,100).split(`
`)[0],y,b=w.match(QUERY_WORD_REGEX)[0];switch(_){case 2:y=new RangeError(`Bad node name '${b}'`);break;case 3:y=new RangeError(`Bad field name '${b}'`);break;case 4:y=new RangeError(`Bad capture name @${b}`);break;case 5:y=new TypeError(`Bad pattern structure at offset ${E}: '${w}'...`),b="";break;default:y=new SyntaxError(`Bad syntax at offset ${E}: '${w}'...`),b="";}throw y.index=E,y.length=b.length,C._free(n),y}let s=C._ts_query_string_count(i),a=C._ts_query_capture_count(i),o=C._ts_query_pattern_count(i),c=new Array(a),l=new Array(s);for(let _=0;_<a;_++){let E=C._ts_query_capture_name_for_id(i,_,TRANSFER_BUFFER),w=getValue(TRANSFER_BUFFER,"i32");c[_]=UTF8ToString(E,w);}for(let _=0;_<s;_++){let E=C._ts_query_string_value_for_id(i,_,TRANSFER_BUFFER),w=getValue(TRANSFER_BUFFER,"i32");l[_]=UTF8ToString(E,w);}let u=new Array(o),f=new Array(o),h=new Array(o),p=new Array(o),m=new Array(o);for(let _=0;_<o;_++){let E=C._ts_query_predicates_for_pattern(i,_,TRANSFER_BUFFER),w=getValue(TRANSFER_BUFFER,"i32");p[_]=[],m[_]=[];let y=[],b=E;for(let N=0;N<w;N++){let L=getValue(b,"i32");b+=SIZE_OF_INT;let V=getValue(b,"i32");if(b+=SIZE_OF_INT,L===PREDICATE_STEP_TYPE_CAPTURE)y.push({type:"capture",name:c[V]});else if(L===PREDICATE_STEP_TYPE_STRING)y.push({type:"string",value:l[V]});else if(y.length>0){if(y[0].type!=="string")throw new Error("Predicates must begin with a literal value");let X=y[0].value,z=!0;switch(X){case"not-eq?":z=!1;case"eq?":if(y.length!==3)throw new Error("Wrong number of arguments to `#eq?` predicate. Expected 2, got "+(y.length-1));if(y[1].type!=="capture")throw new Error(`First argument of \`#eq?\` predicate must be a capture. Got "${y[1].value}"`);if(y[2].type==="capture"){let ie=y[1].name,me=y[2].name;m[_].push(function(Pe){let W,K;for(let se of Pe)se.name===ie&&(W=se.node),se.name===me&&(K=se.node);return W===void 0||K===void 0||W.text===K.text===z});}else {let ie=y[1].name,me=y[2].value;m[_].push(function(Pe){for(let W of Pe)if(W.name===ie)return W.node.text===me===z;return !0});}break;case"not-match?":z=!1;case"match?":if(y.length!==3)throw new Error(`Wrong number of arguments to \`#match?\` predicate. Expected 2, got ${y.length-1}.`);if(y[1].type!=="capture")throw new Error(`First argument of \`#match?\` predicate must be a capture. Got "${y[1].value}".`);if(y[2].type!=="string")throw new Error(`Second argument of \`#match?\` predicate must be a string. Got @${y[2].value}.`);let G=y[1].name,ee=new RegExp(y[2].value);m[_].push(function(ie){for(let me of ie)if(me.name===G)return ee.test(me.node.text)===z;return !0});break;case"set!":if(y.length<2||y.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${y.length-1}.`);if(y.some(ie=>ie.type!=="string"))throw new Error('Arguments to `#set!` predicate must be a strings.".');u[_]||(u[_]={}),u[_][y[1].value]=y[2]?y[2].value:null;break;case"is?":case"is-not?":if(y.length<2||y.length>3)throw new Error(`Wrong number of arguments to \`#${X}\` predicate. Expected 1 or 2. Got ${y.length-1}.`);if(y.some(ie=>ie.type!=="string"))throw new Error(`Arguments to \`#${X}\` predicate must be a strings.".`);let U=X==="is?"?f:h;U[_]||(U[_]={}),U[_][y[1].value]=y[2]?y[2].value:null;break;default:p[_].push({operator:X,operands:y.slice(1)});}y.length=0;}}Object.freeze(u[_]),Object.freeze(f[_]),Object.freeze(h[_]);}return C._free(n),new Query(INTERNAL,i,c,m,p,Object.freeze(u),Object.freeze(f),Object.freeze(h))}static load(t){let r;if(t instanceof Uint8Array)r=Promise.resolve(t);else {let i=t;if(typeof process<"u"&&process.versions&&process.versions.node){let s=he("fs");r=Promise.resolve(s.readFileSync(i));}else r=fetch(i).then(s=>s.arrayBuffer().then(a=>{if(s.ok)return new Uint8Array(a);{let o=new TextDecoder("utf-8").decode(a);throw new Error(`Language.load failed with status ${s.status}.

${o}`)}}));}let n=typeof loadSideModule=="function"?loadSideModule:loadWebAssemblyModule;return r.then(i=>n(i,{loadAsync:!0})).then(i=>{let s=Object.keys(i),a=s.find(c=>LANGUAGE_FUNCTION_REGEX.test(c)&&!c.includes("external_scanner_"));a||console.log(`Couldn't find language function in WASM file. Symbols:
${JSON.stringify(s,null,2)}`);let o=i[a]();return new Language(INTERNAL,o)})}}class Query{constructor(t,r,n,i,s,a,o,c){assertInternal(t),this[0]=r,this.captureNames=n,this.textPredicates=i,this.predicates=s,this.setProperties=a,this.assertedProperties=o,this.refutedProperties=c,this.exceededMatchLimit=!1;}delete(){C._ts_query_delete(this[0]),this[0]=0;}matches(t,r,n,i){r||(r=ZERO_POINT),n||(n=ZERO_POINT),i||(i={});let s=i.matchLimit;if(s===void 0)s=0;else if(typeof s!="number")throw new Error("Arguments must be numbers");marshalNode(t),C._ts_query_matches_wasm(this[0],t.tree[0],r.row,r.column,n.row,n.column,s);let a=getValue(TRANSFER_BUFFER,"i32"),o=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),c=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),l=new Array(a);this.exceededMatchLimit=!!c;let u=0,f=o;for(let h=0;h<a;h++){let p=getValue(f,"i32");f+=SIZE_OF_INT;let m=getValue(f,"i32");f+=SIZE_OF_INT;let _=new Array(m);if(f=unmarshalCaptures(this,t.tree,f,_),this.textPredicates[p].every(E=>E(_))){l[u++]={pattern:p,captures:_};let E=this.setProperties[p];E&&(l[h].setProperties=E);let w=this.assertedProperties[p];w&&(l[h].assertedProperties=w);let y=this.refutedProperties[p];y&&(l[h].refutedProperties=y);}}return l.length=u,C._free(o),l}captures(t,r,n,i){r||(r=ZERO_POINT),n||(n=ZERO_POINT),i||(i={});let s=i.matchLimit;if(s===void 0)s=0;else if(typeof s!="number")throw new Error("Arguments must be numbers");marshalNode(t),C._ts_query_captures_wasm(this[0],t.tree[0],r.row,r.column,n.row,n.column,s);let a=getValue(TRANSFER_BUFFER,"i32"),o=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),c=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),l=[];this.exceededMatchLimit=!!c;let u=[],f=o;for(let h=0;h<a;h++){let p=getValue(f,"i32");f+=SIZE_OF_INT;let m=getValue(f,"i32");f+=SIZE_OF_INT;let _=getValue(f,"i32");if(f+=SIZE_OF_INT,u.length=m,f=unmarshalCaptures(this,t.tree,f,u),this.textPredicates[p].every(E=>E(u))){let E=u[_],w=this.setProperties[p];w&&(E.setProperties=w);let y=this.assertedProperties[p];y&&(E.assertedProperties=y);let b=this.refutedProperties[p];b&&(E.refutedProperties=b),l.push(E);}}return C._free(o),l}predicatesForPattern(t){return this.predicates[t]}didExceedMatchLimit(){return this.exceededMatchLimit}}function getText(e,t,r){let n=r-t,i=e.textCallback(t,null,r);for(t+=i.length;t<r;){let s=e.textCallback(t,null,r);if(!(s&&s.length>0))break;t+=s.length,i+=s;}return t>r&&(i=i.slice(0,n)),i}function unmarshalCaptures(e,t,r,n){for(let i=0,s=n.length;i<s;i++){let a=getValue(r,"i32"),o=unmarshalNode(t,r+=SIZE_OF_INT);r+=SIZE_OF_NODE,n[i]={name:e.captureNames[a],node:o};}return r}function assertInternal(e){if(e!==INTERNAL)throw new Error("Illegal constructor")}function isPoint(e){return e&&typeof e.row=="number"&&typeof e.column=="number"}function marshalNode(e){let t=TRANSFER_BUFFER;setValue(t,e.id,"i32"),t+=SIZE_OF_INT,setValue(t,e.startIndex,"i32"),t+=SIZE_OF_INT,setValue(t,e.startPosition.row,"i32"),t+=SIZE_OF_INT,setValue(t,e.startPosition.column,"i32"),t+=SIZE_OF_INT,setValue(t,e[0],"i32");}function unmarshalNode(e,t=TRANSFER_BUFFER){let r=getValue(t,"i32");if(r===0)return null;let n=getValue(t+=SIZE_OF_INT,"i32"),i=getValue(t+=SIZE_OF_INT,"i32"),s=getValue(t+=SIZE_OF_INT,"i32"),a=getValue(t+=SIZE_OF_INT,"i32"),o=new Node(INTERNAL,e);return o.id=r,o.startIndex=n,o.startPosition={row:i,column:s},o[0]=a,o}function marshalTreeCursor(e,t=TRANSFER_BUFFER){setValue(t+0*SIZE_OF_INT,e[0],"i32"),setValue(t+1*SIZE_OF_INT,e[1],"i32"),setValue(t+2*SIZE_OF_INT,e[2],"i32");}function unmarshalTreeCursor(e){e[0]=getValue(TRANSFER_BUFFER+0*SIZE_OF_INT,"i32"),e[1]=getValue(TRANSFER_BUFFER+1*SIZE_OF_INT,"i32"),e[2]=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32");}function marshalPoint(e,t){setValue(e,t.row,"i32"),setValue(e+SIZE_OF_INT,t.column,"i32");}function unmarshalPoint(e){return {row:getValue(e,"i32"),column:getValue(e+SIZE_OF_INT,"i32")}}function marshalRange(e,t){marshalPoint(e,t.startPosition),marshalPoint(e+=SIZE_OF_POINT,t.endPosition),setValue(e+=SIZE_OF_POINT,t.startIndex,"i32"),setValue(e+=SIZE_OF_INT,t.endIndex,"i32"),e+=SIZE_OF_INT;}function unmarshalRange(e){let t={};return t.startPosition=unmarshalPoint(e),e+=SIZE_OF_POINT,t.endPosition=unmarshalPoint(e),e+=SIZE_OF_POINT,t.startIndex=getValue(e,"i32"),e+=SIZE_OF_INT,t.endIndex=getValue(e,"i32"),t}function marshalEdit(e){let t=TRANSFER_BUFFER;marshalPoint(t,e.startPosition),t+=SIZE_OF_POINT,marshalPoint(t,e.oldEndPosition),t+=SIZE_OF_POINT,marshalPoint(t,e.newEndPosition),t+=SIZE_OF_POINT,setValue(t,e.startIndex,"i32"),t+=SIZE_OF_INT,setValue(t,e.oldEndIndex,"i32"),t+=SIZE_OF_INT,setValue(t,e.newEndIndex,"i32"),t+=SIZE_OF_INT;}for(let e of Object.getOwnPropertyNames(ParserImpl.prototype))Object.defineProperty(Parser.prototype,e,{value:ParserImpl.prototype[e],enumerable:!1,writable:!1});Parser.Language=Language,Module.onRuntimeInitialized=()=>{ParserImpl.init(),resolveInitPromise();};}))}}return Parser}();typeof exports=="object"&&(module.exports=TreeSitter);});var W0=P((jse,bP)=>{var H0=class{constructor(t={}){let r=t.base||1.001,n=t.precision||1e-9;if(!(r>1)||!(r<1.5))throw new Error("base must be a number between 1 and 1.5");if(r+=1e-9,r=2**(1/Math.ceil(Math.log(2)/Math.log(r))),r===1)throw new Error("base too close to 1");n=Number.parseFloat(""+n);let i=Math.ceil(1/(r-1)),s=n*i;this._thresh=s,this._precision=n,this._base=r;}getBase(){return this._base}getPrecision(){return this._precision}round(t){if(typeof t!="number"&&(t=Number.parseFloat(t)),Number.isNaN(t))throw new Error("Attempt to round a non-numeric value: "+t);return t<0?-this.round(-t):t<this._thresh?Math.round(t/this._precision)*this._precision:this._thresh*this._base**Math.round(Math.log(t/this._thresh)/Math.log(this._base))}upper(t){return t<0?-this.lower(-t):(t=this.round(t),t<this._thresh?t+this._precision/2:t*Math.sqrt(this._base))}lower(t){return t<0?-this.upper(-t):(t=this.round(t),t<=this._thresh?t-this._precision/2:t/Math.sqrt(this._base))}shorten(t,r){return t===void 0?t:r===void 0?ku(this.lower(t),this.upper(t)):ku(t,r)}};function ku(e,t,r=10){if(e===t)return e;if(e*t<=0)return 0;if(t<0)return -ku(-t,-e,r);if(e>t)return ku(t,e,r);let n=-Math.floor(Math.log(t-e)/Math.log(r));for(;Math.ceil(e*r**n)<=Math.floor(t*r**n);)n--;return n++,n>=0?Math.ceil(e*r**n)/r**n:Math.ceil(e/r**-n)*r**-n}bP.exports={Binning:H0,shorten:ku};});var EP=P(($se,SP)=>{var{Binning:pz}=W0(),gz="stats-logscale/univariate@1.0",Ou=class e extends pz{constructor(t={}){super(t),this.storage=new Map,this._count=0,this._cache={},this.neat=new Lu(this),t.bins&&this.addWeighted(t.bins);}add(...t){return this._cache={},t.forEach(r=>{let n=this.round(r),i=this.storage.get(n)??0;this.storage.set(n,i+1),this._count++;}),this}addWeighted(t){return this._cache={},t.forEach(r=>{let n=r[0],i=Number.parseFloat(r[1]);if(Number.isNaN(i))throw new Error("Attempt to provide a non-numeric weight");let s=this.round(n),a=(this.storage.get(s)??0)+i;a<=0?(this.storage.delete(s),this._count+=i-a):(this.storage.set(s,a),this._count+=i);}),this}toJSON(){return {version:gz,precision:this.getPrecision(),base:this.getBase(),bins:this.getBins()}}clone(t={}){let r=this.getBins(t);return t.transform&&(r=r.map(n=>[t.transform(n[0]),n[1]])),new e({precision:t.precision??this.getPrecision(),base:t.base??this.getBase(),bins:r})}getBins(t){if(this._cache.data||(this._cache.data=[...this.storage].sort((o,c)=>o[0]-c[0])),!t)return this._cache.data;let r=Math.max(t.min??-1/0,this.percentile(t.ltrim??0)),n=Math.min(t.max??1/0,this.percentile(100-(t.rtrim??0)));if(!t.winsorize)return this._cache.data.filter(o=>o[0]>=r&&o[0]<=n);let i=[this.round(r),0],s=[this.round(n),0],a=[i];for(let[o,c]of this._cache.data)o<=i[0]?i[1]+=c:o>=s[0]?s[1]+=c:a.push([o,c]);return s[1]>0&&a.push(s),a}count(){return this._count}min(){let t=this.getBins();return this.lower(t[0][0])}max(){let t=this.getBins();return this.upper(t[t.length-1][0])}sumOf(t){let r=0;return [...this.storage].forEach(n=>{r+=n[1]*t(n[0]);}),r}E(t){return this._count?this.sumOf(t)/this._count:void 0}mean(){return this._count?this.sumOf(t=>t)/this._count:void 0}stdev(){if(this._count<2)return;let t=this.mean();return Math.sqrt(this.sumOf(r=>(r-t)*(r-t))/(this._count-1))}skewness(){let t=this.count();return t<3?void 0:t*t/((t-1)*(t-2))*this.momentStd(3)}kurtosis(){let t=this.count();if(t<4)return;let r=t*t*(t+1)/((t-1)*(t-2)*(t-3)),n=(t-1)*(t-1)/((t-2)*(t-3));return this.momentStd(4)*r-3*n}moment(t,r){if(!Number.isInteger(t))throw new Error("Cannot calculate non-integer moment (did you mean momentAbs?)");return r===void 0&&(r=this.mean()),this.E(n=>(n-r)**t)}momentAbs(t=1,r){return r===void 0&&(r=this.mean()),this.E(n=>Math.abs(n-r)**t)}momentStd(t){return this.moment(t)/this.stdev()**t}quantile(t){let r=t*this._count,n=this._cumulative(),i=0,s=n.length;for(;i+1<s;){let c=Math.floor((s+i)/2);n[c][1]>=r?s=c:i=c;}let a=this.lower(n[i][0]),o=this.upper(n[i][0])-a;return a+o*(r-n[i][1])/(n[i][2]-n[i][1])}percentile(t){return this.quantile(t/100)}median(){return this.quantile(.5)}cdf(t){return this._rawCdf(t)/this._count}_rawCdf(t){let r=this._cumulative(),n=this.round(t),i=0,s=r.length;for(;i<s;){let c=Math.floor((s+i)/2);r[c][0]<n?i=c+1:s=c;}if(i>=r.length)return this._count;let a=i>0?r[i-1][2]:0,o=n!==r[i][0]?0:(r[i][2]-r[i][1])*(t-this.lower(t))/(this.upper(t)-this.lower(t));return a+o}histogram(t={}){if(!this._count)return [];let r=this.min(),n=this.max(),i=t.count||10,s=[],a=r,o=(n-r)/i;for(let c=0;c<i;c++)s.push([this._rawCdf(a+o),a,a+=o]);for(let c=s.length;c-- >1;)s[c][0]-=s[c-1][0];if(s[0][0]-=this._rawCdf(r),t.scale){let c=0;for(let l=0;l<s.length;l++)c<s[l][0]&&(c=s[l][0]);for(let l=0;l<s.length;l++)s[l][0]=s[l][0]*t.scale/c;}return s}_cumulative(){if(!this._cache.cumulative){let t=this.getBins(),r=[],n=0;for(let i=0;i<t.length;i++)r.push([t[i][0],n,n+=t[i][1]]);this._cache.cumulative=r;}return this._cache.cumulative}};["cdf+","kurtosis","max","mean","min","moment+","momentAbs+","momentStd+","quantile+","skewness","stdev"].forEach(e=>{let t=!!e.match(/\+/);t&&(e=e.replace("+",""));let r=Ou.prototype[e];if(typeof r!="function")throw new Error('method "'+e+'" is cached but never defined');Ou.prototype[e]=t?function(...n){if(this._count===0)return;this._cache[e]===void 0&&(this._cache[e]={});let i=n.join(":");return this._cache[e][i]===void 0&&(this._cache[e][i]=r.apply(this,n)),this._cache[e][i]}:function(){if(this._count!==0)return this._cache[e]===void 0&&(this._cache[e]=r.apply(this)),this._cache[e]};});var Lu=class{constructor(t){this._main=t;}min(){if(!this._main._count)return;let t=this._main.getBins();return this._main.shorten(t[0][0])}max(){if(!this._main._count)return;let t=this._main.getBins();return this._main.shorten(t[t.length-1][0])}};["E","kurtosis","mean","median","moment","momentAbs","momentStd","percentile","quantile","skewness","stdev","sumOf"].forEach(e=>{Lu.prototype[e]=function(t){return this._main.shorten(this._main[e](t))};});["cdf","count"].forEach(e=>{Lu.prototype[e]=function(t){return this._main[e](t)};});SP.exports={Univariate:Ou};});var wP=P((Vse,K0)=>{(()=>{let{Binning:e}=W0(),{Univariate:t}=EP(),r={Binning:e,Univariate:t};typeof window<"u"&&(window.logstat=r),typeof K0=="object"&&(K0.exports=r);})();});var xP=P((Wse,CP)=>{CP.exports=Bu();});var AP=P((Kse,TP)=>{function mz(){return !!(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&process.versions.electron||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Electron")>=0)}TP.exports=mz;});var Je=P((zse,RP)=>{RP.exports={options:{usePureJavaScript:!1}};});var NP=P((Gse,PP)=>{var G0={};PP.exports=G0;var IP={};G0.encode=function(e,t,r){if(typeof t!="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(!(e instanceof Uint8Array))n=yz(e,t);else {var i=0,s=t.length,a=t.charAt(0),o=[0];for(i=0;i<e.length;++i){for(var c=0,l=e[i];c<o.length;++c)l+=o[c]<<8,o[c]=l%s,l=l/s|0;for(;l>0;)o.push(l%s),l=l/s|0;}for(i=0;e[i]===0&&i<e.length-1;++i)n+=a;for(i=o.length-1;i>=0;--i)n+=t[o[i]];}if(r){var u=new RegExp(".{1,"+r+"}","g");n=n.match(u).join(`\r
`);}return n};G0.decode=function(e,t){if(typeof e!="string")throw new TypeError('"input" must be a string.');if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');var r=IP[t];if(!r){r=IP[t]=[];for(var n=0;n<t.length;++n)r[t.charCodeAt(n)]=n;}e=e.replace(/\s/g,"");for(var i=t.length,s=t.charAt(0),a=[0],n=0;n<e.length;n++){var o=r[e.charCodeAt(n)];if(o===void 0)return;for(var c=0,l=o;c<a.length;++c)l+=a[c]*i,a[c]=l&255,l>>=8;for(;l>0;)a.push(l&255),l>>=8;}for(var u=0;e[u]===s&&u<e.length-1;++u)a.push(0);return typeof Buffer<"u"?Buffer.from(a.reverse()):new Uint8Array(a.reverse())};function yz(e,t){var r=0,n=t.length,i=t.charAt(0),s=[0];for(r=0;r<e.length();++r){for(var a=0,o=e.at(r);a<s.length;++a)o+=s[a]<<8,s[a]=o%n,o=o/n|0;for(;o>0;)s.push(o%n),o=o/n|0;}var c="";for(r=0;e.at(r)===0&&r<e.length()-1;++r)c+=i;for(r=s.length-1;r>=0;--r)c+=t[s[r]];return c}});var mt=P((Yse,LP)=>{var DP=Je(),kP=NP(),H=LP.exports=DP.util=DP.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){H.nextTick=process.nextTick,typeof setImmediate=="function"?H.setImmediate=setImmediate:H.setImmediate=H.nextTick;return}if(typeof setImmediate=="function"){H.setImmediate=function(){return setImmediate.apply(void 0,arguments)},H.nextTick=function(o){return setImmediate(o)};return}if(H.setImmediate=function(o){setTimeout(o,0);},typeof window<"u"&&typeof window.postMessage=="function"){let o=function(c){if(c.source===window&&c.data===e){c.stopPropagation();var l=t.slice();t.length=0,l.forEach(function(u){u();});}};var e="forge.setImmediate",t=[];H.setImmediate=function(c){t.push(c),t.length===1&&window.postMessage(e,"*");},window.addEventListener("message",o,!0);}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,i=document.createElement("div"),t=[];new MutationObserver(function(){var c=t.slice();t.length=0,c.forEach(function(l){l();});}).observe(i,{attributes:!0});var s=H.setImmediate;H.setImmediate=function(c){Date.now()-r>15?(r=Date.now(),s(c)):(t.push(c),t.length===1&&i.setAttribute("a",n=!n));};}H.nextTick=H.setImmediate;})();H.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;H.globalScope=function(){return H.isNodejs?global:typeof self>"u"?window:self}();H.isArray=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};H.isArrayBuffer=function(e){return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer};H.isArrayBufferView=function(e){return e&&H.isArrayBuffer(e.buffer)&&e.byteLength!==void 0};function Fu(e){if(!(e===8||e===16||e===24||e===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}H.ByteBuffer=Y0;function Y0(e){if(this.data="",this.read=0,typeof e=="string")this.data=e;else if(H.isArrayBuffer(e)||H.isArrayBufferView(e))if(typeof Buffer<"u"&&e instanceof Buffer)this.data=e.toString("binary");else {var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t);}catch{for(var r=0;r<t.length;++r)this.putByte(t[r]);}}else (e instanceof Y0||typeof e=="object"&&typeof e.data=="string"&&typeof e.read=="number")&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0;}H.ByteStringBuffer=Y0;var vz=4096;H.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>vz&&(this.data.substr(0,1),this._constructedStringLength=0);};H.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};H.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};H.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))};H.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)t&1&&(r+=e),t>>>=1,t>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this};H.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this};H.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(H.encodeUtf8(e))};H.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};H.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};H.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};H.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255))};H.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))};H.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))};H.ByteStringBuffer.prototype.putInt=function(e,t){Fu(t);var r="";do t-=8,r+=String.fromCharCode(e>>t&255);while(t>0);return this.putBytes(r)};H.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)};H.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())};H.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};H.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e};H.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e};H.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e};H.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e};H.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e};H.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e};H.ByteStringBuffer.prototype.getInt=function(e){Fu(e);var t=0;do t=(t<<8)+this.data.charCodeAt(this.read++),e-=8;while(e>0);return t};H.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t};H.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t};H.ByteStringBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)};H.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)};H.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this};H.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};H.ByteStringBuffer.prototype.copy=function(){var e=H.createBuffer(this.data);return e.read=this.read,e};H.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};H.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};H.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this};H.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16);}return e};H.ByteStringBuffer.prototype.toString=function(){return H.decodeUtf8(this.bytes())};function _z(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=H.isArrayBuffer(e),n=H.isArrayBufferView(e);if(r||n){r?this.data=new DataView(e):this.data=new DataView(e.buffer,e.byteOffset,e.byteLength),this.write="writeOffset"in t?t.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,e!=null&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset);}H.DataBuffer=_z;H.DataBuffer.prototype.length=function(){return this.write-this.read};H.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};H.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this};H.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this};H.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this};H.DataBuffer.prototype.putBytes=function(e,t){if(H.isArrayBufferView(e)){var r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),n=r.byteLength-r.byteOffset;this.accommodate(n);var i=new Uint8Array(this.data.buffer,this.write);return i.set(r),this.write+=n,this}if(H.isArrayBuffer(e)){var r=new Uint8Array(e);this.accommodate(r.byteLength);var i=new Uint8Array(this.data.buffer);return i.set(r,this.write),this.write+=r.byteLength,this}if(e instanceof H.DataBuffer||typeof e=="object"&&typeof e.read=="number"&&typeof e.write=="number"&&H.isArrayBufferView(e.data)){var r=new Uint8Array(e.data.byteLength,e.read,e.length());this.accommodate(r.byteLength);var i=new Uint8Array(e.data.byteLength,this.write);return i.set(r),this.write+=r.byteLength,this}if(e instanceof H.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary",typeof e=="string"){var s;if(t==="hex")return this.accommodate(Math.ceil(e.length/2)),s=new Uint8Array(this.data.buffer,this.write),this.write+=H.binary.hex.decode(e,s,this.write),this;if(t==="base64")return this.accommodate(Math.ceil(e.length/4)*3),s=new Uint8Array(this.data.buffer,this.write),this.write+=H.binary.base64.decode(e,s,this.write),this;if(t==="utf8"&&(e=H.encodeUtf8(e),t="binary"),t==="binary"||t==="raw")return this.accommodate(e.length),s=new Uint8Array(this.data.buffer,this.write),this.write+=H.binary.raw.decode(s),this;if(t==="utf16")return this.accommodate(e.length*2),s=new Uint16Array(this.data.buffer,this.write),this.write+=H.text.utf16.encode(s),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)};H.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this};H.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")};H.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this};H.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this};H.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this};H.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this};H.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this};H.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this};H.DataBuffer.prototype.putInt=function(e,t){Fu(t),this.accommodate(t/8);do t-=8,this.data.setInt8(this.write++,e>>t&255);while(t>0);return this};H.DataBuffer.prototype.putSignedInt=function(e,t){return Fu(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)};H.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};H.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e};H.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e};H.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e};H.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e};H.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e};H.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e};H.DataBuffer.prototype.getInt=function(e){Fu(e);var t=0;do t=(t<<8)+this.data.getInt8(this.read++),e-=8;while(e>0);return t};H.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t};H.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t};H.DataBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)};H.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)};H.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this};H.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};H.DataBuffer.prototype.copy=function(){return new H.DataBuffer(this)};H.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0;}return this};H.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};H.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this};H.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+="0"),e+=r.toString(16);}return e};H.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if(e=e||"utf8",e==="binary"||e==="raw")return H.binary.raw.encode(t);if(e==="hex")return H.binary.hex.encode(t);if(e==="base64")return H.binary.base64.encode(t);if(e==="utf8")return H.text.utf8.decode(t);if(e==="utf16")return H.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)};H.createBuffer=function(e,t){return t=t||"raw",e!==void 0&&t==="utf8"&&(e=H.encodeUtf8(e)),new H.ByteBuffer(e)};H.fillString=function(e,t){for(var r="";t>0;)t&1&&(r+=e),t>>>=1,t>0&&(e+=e);return r};H.xorBytes=function(e,t,r){for(var n="",i="",s="",a=0,o=0;r>0;--r,++a)i=e.charCodeAt(a)^t.charCodeAt(a),o>=10&&(n+=s,s="",o=0),s+=String.fromCharCode(i),++o;return n+=s,n};H.hexToBytes=function(e){var t="",r=0;for(e.length&!0&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t};H.bytesToHex=function(e){return H.createBuffer(e).toHex()};H.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255)};var ts="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",rs=[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],OP="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";H.encode64=function(e,t){for(var r="",n="",i,s,a,o=0;o<e.length;)i=e.charCodeAt(o++),s=e.charCodeAt(o++),a=e.charCodeAt(o++),r+=ts.charAt(i>>2),r+=ts.charAt((i&3)<<4|s>>4),isNaN(s)?r+="==":(r+=ts.charAt((s&15)<<2|a>>6),r+=isNaN(a)?"=":ts.charAt(a&63)),t&&r.length>t&&(n+=r.substr(0,t)+`\r
`,r=r.substr(t));return n+=r,n};H.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t="",r,n,i,s,a=0;a<e.length;)r=rs[e.charCodeAt(a++)-43],n=rs[e.charCodeAt(a++)-43],i=rs[e.charCodeAt(a++)-43],s=rs[e.charCodeAt(a++)-43],t+=String.fromCharCode(r<<2|n>>4),i!==64&&(t+=String.fromCharCode((n&15)<<4|i>>2),s!==64&&(t+=String.fromCharCode((i&3)<<6|s)));return t};H.encodeUtf8=function(e){return unescape(encodeURIComponent(e))};H.decodeUtf8=function(e){return decodeURIComponent(escape(e))};H.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:kP.encode,decode:kP.decode}};H.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)};H.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length)),r=r||0;for(var i=r,s=0;s<e.length;++s)n[i++]=e.charCodeAt(s);return t?i-r:n};H.binary.hex.encode=H.bytesToHex;H.binary.hex.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/2))),r=r||0;var i=0,s=r;for(e.length&1&&(i=1,n[s++]=parseInt(e[0],16));i<e.length;i+=2)n[s++]=parseInt(e.substr(i,2),16);return t?s-r:n};H.binary.base64.encode=function(e,t){for(var r="",n="",i,s,a,o=0;o<e.byteLength;)i=e[o++],s=e[o++],a=e[o++],r+=ts.charAt(i>>2),r+=ts.charAt((i&3)<<4|s>>4),isNaN(s)?r+="==":(r+=ts.charAt((s&15)<<2|a>>6),r+=isNaN(a)?"=":ts.charAt(a&63)),t&&r.length>t&&(n+=r.substr(0,t)+`\r
`,r=r.substr(t));return n+=r,n};H.binary.base64.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/4)*3)),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var i,s,a,o,c=0,l=r;c<e.length;)i=rs[e.charCodeAt(c++)-43],s=rs[e.charCodeAt(c++)-43],a=rs[e.charCodeAt(c++)-43],o=rs[e.charCodeAt(c++)-43],n[l++]=i<<2|s>>4,a!==64&&(n[l++]=(s&15)<<4|a>>2,o!==64&&(n[l++]=(a&3)<<6|o));return t?l-r:n.subarray(0,l)};H.binary.base58.encode=function(e,t){return H.binary.baseN.encode(e,OP,t)};H.binary.base58.decode=function(e,t){return H.binary.baseN.decode(e,OP,t)};H.text={utf8:{},utf16:{}};H.text.utf8.encode=function(e,t,r){e=H.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length)),r=r||0;for(var i=r,s=0;s<e.length;++s)n[i++]=e.charCodeAt(s);return t?i-r:n};H.text.utf8.decode=function(e){return H.decodeUtf8(String.fromCharCode.apply(null,e))};H.text.utf16.encode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length*2));var i=new Uint16Array(n.buffer);r=r||0;for(var s=r,a=r,o=0;o<e.length;++o)i[a++]=e.charCodeAt(o),s+=2;return t?s-r:n};H.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))};H.deflate=function(e,t,r){if(t=H.decode64(e.deflate(H.encode64(t)).rval),r){var n=2,i=t.charCodeAt(1);i&32&&(n=6),t=t.substring(n,t.length-4);}return t};H.inflate=function(e,t,r){var n=e.inflate(H.encode64(t)).rval;return n===null?null:H.decode64(n)};var Q0=function(e,t,r){if(!e)throw new Error("WebStorage not available.");var n;if(r===null?n=e.removeItem(t):(r=H.encode64(JSON.stringify(r)),n=e.setItem(t,r)),typeof n<"u"&&n.rval!==!0){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}},Z0=function(e,t){if(!e)throw new Error("WebStorage not available.");var r=e.getItem(t);if(e.init)if(r.rval===null){if(r.error){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}r=null;}else r=r.rval;return r!==null&&(r=JSON.parse(H.decode64(r))),r},bz=function(e,t,r,n){var i=Z0(e,t);i===null&&(i={}),i[r]=n,Q0(e,t,i);},Sz=function(e,t,r){var n=Z0(e,t);return n!==null&&(n=r in n?n[r]:null),n},Ez=function(e,t,r){var n=Z0(e,t);if(n!==null&&r in n){delete n[r];var i=!0;for(var s in n){i=!1;break}i&&(n=null),Q0(e,t,n);}},wz=function(e,t){Q0(e,t,null);},If=function(e,t,r){var n=null;typeof r>"u"&&(r=["web","flash"]);var i,s=!1,a=null;for(var o in r){i=r[o];try{if(i==="flash"||i==="both"){if(t[0]===null)throw new Error("Flash local storage not available.");n=e.apply(this,t),s=i==="flash";}(i==="web"||i==="both")&&(t[0]=localStorage,n=e.apply(this,t),s=!0);}catch(c){a=c;}if(s)break}if(!s)throw a;return n};H.setItem=function(e,t,r,n,i){If(bz,arguments,i);};H.getItem=function(e,t,r,n){return If(Sz,arguments,n)};H.removeItem=function(e,t,r,n){If(Ez,arguments,n);};H.clearItems=function(e,t,r){If(wz,arguments,r);};H.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return !1;return !0};H.format=function(e){for(var t=/%./g,r,n,i=0,s=[],a=0;r=t.exec(e);){n=e.substring(a,t.lastIndex-2),n.length>0&&s.push(n),a=t.lastIndex;var o=r[0][1];switch(o){case"s":case"o":i<arguments.length?s.push(arguments[i+++1]):s.push("<?>");break;case"%":s.push("%");break;default:s.push("<%"+o+"?>");}}return s.push(e.substring(a)),s.join("")};H.formatNumber=function(e,t,r,n){var i=e,s=isNaN(t=Math.abs(t))?2:t,a=r===void 0?",":r,o=n===void 0?".":n,c=i<0?"-":"",l=parseInt(i=Math.abs(+i||0).toFixed(s),10)+"",u=l.length>3?l.length%3:0;return c+(u?l.substr(0,u)+o:"")+l.substr(u).replace(/(\d{3})(?=\d)/g,"$1"+o)+(s?a+Math.abs(i-l).toFixed(s).slice(2):"")};H.formatSize=function(e){return e>=1073741824?e=H.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?e=H.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?e=H.formatNumber(e/1024,0)+" KiB":e=H.formatNumber(e,0)+" bytes",e};H.bytesFromIP=function(e){return e.indexOf(".")!==-1?H.bytesFromIPv4(e):e.indexOf(":")!==-1?H.bytesFromIPv6(e):null};H.bytesFromIPv4=function(e){if(e=e.split("."),e.length!==4)return null;for(var t=H.createBuffer(),r=0;r<e.length;++r){var n=parseInt(e[r],10);if(isNaN(n))return null;t.putByte(n);}return t.getBytes()};H.bytesFromIPv6=function(e){var t=0;e=e.split(":").filter(function(a){return a.length===0&&++t,!0});for(var r=(8-e.length+t)*2,n=H.createBuffer(),i=0;i<8;++i){if(!e[i]||e[i].length===0){n.fillWithByte(0,r),r=0;continue}var s=H.hexToBytes(e[i]);s.length<2&&n.putByte(0),n.putBytes(s);}return n.getBytes()};H.bytesToIP=function(e){return e.length===4?H.bytesToIPv4(e):e.length===16?H.bytesToIPv6(e):null};H.bytesToIPv4=function(e){if(e.length!==4)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(".")};H.bytesToIPv6=function(e){if(e.length!==16)return null;for(var t=[],r=[],n=0,i=0;i<e.length;i+=2){for(var s=H.bytesToHex(e[i]+e[i+1]);s[0]==="0"&&s!=="0";)s=s.substr(1);if(s==="0"){var a=r[r.length-1],o=t.length;!a||o!==a.end+1?r.push({start:o,end:o}):(a.end=o,a.end-a.start>r[n].end-r[n].start&&(n=r.length-1));}t.push(s);}if(r.length>0){var c=r[n];c.end-c.start>0&&(t.splice(c.start,c.end-c.start+1,""),c.start===0&&t.unshift(""),c.end===7&&t.push(""));}return t.join(":")};H.estimateCores=function(e,t){if(typeof e=="function"&&(t=e,e={}),e=e||{},"cores"in H&&!e.update)return t(null,H.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return H.cores=navigator.hardwareConcurrency,t(null,H.cores);if(typeof Worker>"u")return H.cores=1,t(null,H.cores);if(typeof Blob>"u")return H.cores=2,t(null,H.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(a){for(var o=Date.now(),c=o+4;Date.now()<c;);self.postMessage({st:o,et:c});});}.toString(),")()"],{type:"application/javascript"}));n([],5,16);function n(a,o,c){if(o===0){var l=Math.floor(a.reduce(function(u,f){return u+f},0)/a.length);return H.cores=Math.max(1,l),URL.revokeObjectURL(r),t(null,H.cores)}i(c,function(u,f){a.push(s(c,f)),n(a,o-1,c);});}function i(a,o){for(var c=[],l=[],u=0;u<a;++u){var f=new Worker(r);f.addEventListener("message",function(h){if(l.push(h.data),l.length===a){for(var p=0;p<a;++p)c[p].terminate();o(null,l);}}),c.push(f);}for(var u=0;u<a;++u)c[u].postMessage(u);}function s(a,o){for(var c=[],l=0;l<a;++l)for(var u=o[l],f=c[l]=[],h=0;h<a;++h)if(l!==h){var p=o[h];(u.st>p.st&&u.st<p.et||p.st>u.st&&p.st<u.et)&&f.push(h);}return c.reduce(function(m,_){return Math.max(m,_.length)},0)}};});var Pf=P((Qse,BP)=>{var hr=Je();mt();BP.exports=hr.cipher=hr.cipher||{};hr.cipher.algorithms=hr.cipher.algorithms||{};hr.cipher.createCipher=function(e,t){var r=e;if(typeof r=="string"&&(r=hr.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+e);return new hr.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})};hr.cipher.createDecipher=function(e,t){var r=e;if(typeof r=="string"&&(r=hr.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+e);return new hr.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})};hr.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),hr.cipher.algorithms[e]=t;};hr.cipher.getAlgorithm=function(e){return e=e.toUpperCase(),e in hr.cipher.algorithms?hr.cipher.algorithms[e]:null};var X0=hr.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e);};X0.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=hr.util.createBuffer(),this.output=e.output||hr.util.createBuffer(),this.mode.start(t);};X0.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact();};X0.prototype.finish=function(e){e&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return e(this.blockSize,r,!1)},this.mode.unpad=function(r){return e(this.blockSize,r,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,t))};});var ey=P((Zse,FP)=>{var pr=Je();mt();pr.cipher=pr.cipher||{};var it=FP.exports=pr.cipher.modes=pr.cipher.modes||{};it.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints);};it.ecb.prototype.start=function(e){};it.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return !0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);};it.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return !0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);};it.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0};it.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return !1;var r=e.length(),n=e.at(r-1);return n>this.blockSize<<2?!1:(e.truncate(n),!0)};it.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints);};it.cbc.prototype.start=function(e){if(e.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0);}else if("iv"in e)this._iv=Nf(e.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};it.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return !0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);this._prev=this._outBlock;};it.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return !0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0);};it.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0};it.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return !1;var r=e.length(),n=e.at(r-1);return n>this.blockSize<<2?!1:(e.truncate(n),!0)};it.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=pr.util.createBuffer(),this._partialBytes=0;};it.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Nf(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0;};it.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(n===0)return !0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);return}var s=(this.blockSize-n)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(s>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0;};it.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(n===0)return !0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);return}var s=(this.blockSize-n)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(s>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0;};it.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=pr.util.createBuffer(),this._partialBytes=0;};it.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Nf(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0;};it.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(e.length()===0)return !0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];return}var s=(this.blockSize-n)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(s>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0;};it.ofb.prototype.decrypt=it.ofb.prototype.encrypt;it.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=pr.util.createBuffer(),this._partialBytes=0;};it.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Nf(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0;};it.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(n===0)return !0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]);else {var s=(this.blockSize-n)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(s>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0;}Df(this._inBlock);};it.ctr.prototype.decrypt=it.ctr.prototype.encrypt;it.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=pr.util.createBuffer(),this._partialBytes=0,this._R=3774873600;};it.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t=pr.util.createBuffer(e.iv);this._cipherLength=0;var r;if("additionalData"in e?r=pr.util.createBuffer(e.additionalData):r=pr.util.createBuffer(),"tagLength"in e?this._tagLength=e.tagLength:this._tagLength=128,this._tag=null,e.decrypt&&(this._tag=pr.util.createBuffer(e.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=t.length();if(n===12)this._j0=[t.getInt32(),t.getInt32(),t.getInt32(),1];else {for(this._j0=[0,0,0,0];t.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(J0(n*8)));}this._inBlock=this._j0.slice(0),Df(this._inBlock),this._partialBytes=0,r=pr.util.createBuffer(r),this._aDataLength=J0(r.length()*8);var i=r.length()%this.blockSize;for(i&&r.fillWithByte(0,this.blockSize-i),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()]);};it.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(n===0)return !0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^=e.getInt32());this._cipherLength+=this.blockSize;}else {var s=(this.blockSize-n)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(s<=0||r){if(r){var a=n%this.blockSize;this._cipherLength+=a,this._partialOutput.truncate(this.blockSize-a);}else this._cipherLength+=this.blockSize;for(var i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize;}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0;}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),Df(this._inBlock);};it.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n<this.blockSize&&!(r&&n>0))return !0;this.cipher.encrypt(this._inBlock,this._outBlock),Df(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^this._hashBlock[i]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize;};it.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=pr.util.createBuffer();var n=this._aDataLength.concat(J0(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,n);var i=[];this.cipher.encrypt(this._j0,i);for(var s=0;s<this._ints;++s)this.tag.putInt32(this._s[s]^i[s]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r};it.gcm.prototype.multiply=function(e,t){for(var r=[0,0,0,0],n=t.slice(0),i=0;i<128;++i){var s=e[i/32|0]&1<<31-i%32;s&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n);}return r};it.gcm.prototype.pow=function(e,t){for(var r=e[3]&1,n=3;n>0;--n)t[n]=e[n]>>>1|(e[n-1]&1)<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R);};it.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,i=e[n]>>>(7-r%8)*4&15,s=this._m[r][i];t[0]^=s[0],t[1]^=s[1],t[2]^=s[2],t[3]^=s[3];}return t};it.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)};it.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,s=new Array(i),a=0;a<i;++a){var o=[0,0,0,0],c=a/n|0,l=(n-1-a%n)*t;o[c]=1<<t-1<<l,s[a]=this.generateSubHashTable(this.multiply(o,e),t);}return s};it.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,n=r>>>1,i=new Array(r);i[n]=e.slice(0);for(var s=n>>>1;s>0;)this.pow(i[2*s],i[s]=[]),s>>=1;for(s=2;s<n;){for(var a=1;a<s;++a){var o=i[s],c=i[a];i[s+a]=[o[0]^c[0],o[1]^c[1],o[2]^c[2],o[3]^c[3]];}s*=2;}for(i[0]=[0,0,0,0],s=n+1;s<r;++s){var l=i[s^n];i[s]=[e[0]^l[0],e[1]^l[1],e[2]^l[2],e[3]^l[3]];}return i};function Nf(e,t){if(typeof e=="string"&&(e=pr.util.createBuffer(e)),pr.util.isArray(e)&&e.length>4){var r=e;e=pr.util.createBuffer();for(var n=0;n<r.length;++n)e.putByte(r[n]);}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!pr.util.isArray(e)){for(var i=[],s=t/4,n=0;n<s;++n)i.push(e.getInt32());e=i;}return e}function Df(e){e[e.length-1]=e[e.length-1]+1&4294967295;}function J0(e){return [e/4294967296|0,e&4294967295]}});var ns=P((Xse,jP)=>{var Bt=Je();Pf();ey();mt();jP.exports=Bt.aes=Bt.aes||{};Bt.aes.startEncrypting=function(e,t,r,n){var i=kf({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i};Bt.aes.createEncryptionCipher=function(e,t){return kf({key:e,output:null,decrypt:!1,mode:t})};Bt.aes.startDecrypting=function(e,t,r,n){var i=kf({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i};Bt.aes.createDecryptionCipher=function(e,t){return kf({key:e,output:null,decrypt:!0,mode:t})};Bt.aes.Algorithm=function(e,t){ny||qP();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(n,i){return ry(r._w,n,i,!1)},decrypt:function(n,i){return ry(r._w,n,i,!0)}}}),r._init=!1;};Bt.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t=e.key,r;if(typeof t=="string"&&(t.length===16||t.length===24||t.length===32))t=Bt.util.createBuffer(t);else if(Bt.util.isArray(t)&&(t.length===16||t.length===24||t.length===32)){r=t,t=Bt.util.createBuffer();for(var n=0;n<r.length;++n)t.putByte(r[n]);}if(!Bt.util.isArray(t)){r=t,t=[];var i=r.length();if(i===16||i===24||i===32){i=i>>>2;for(var n=0;n<i;++n)t.push(r.getInt32());}}if(!Bt.util.isArray(t)||!(t.length===4||t.length===6||t.length===8))throw new Error("Invalid key parameter.");var s=this.mode.name,a=["CFB","OFB","CTR","GCM"].indexOf(s)!==-1;this._w=UP(t,e.decrypt&&!a),this._init=!0;}};Bt.aes._expandKey=function(e,t){return ny||qP(),UP(e,t)};Bt.aes._updateBlock=ry;Xa("AES-ECB",Bt.cipher.modes.ecb);Xa("AES-CBC",Bt.cipher.modes.cbc);Xa("AES-CFB",Bt.cipher.modes.cfb);Xa("AES-OFB",Bt.cipher.modes.ofb);Xa("AES-CTR",Bt.cipher.modes.ctr);Xa("AES-GCM",Bt.cipher.modes.gcm);function Xa(e,t){var r=function(){return new Bt.aes.Algorithm(e,t)};Bt.cipher.registerAlgorithm(e,r);}var ny=!1,Za=4,jr,ty,MP,Ys,Kn;function qP(){ny=!0,MP=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;jr=new Array(256),ty=new Array(256),Ys=new Array(4),Kn=new Array(4);for(var t=0;t<4;++t)Ys[t]=new Array(256),Kn[t]=new Array(256);for(var r=0,n=0,i,s,a,o,c,l,u,t=0;t<256;++t){o=n^n<<1^n<<2^n<<3^n<<4,o=o>>8^o&255^99,jr[r]=o,ty[o]=r,c=e[o],i=e[r],s=e[i],a=e[s],l=c<<24^o<<16^o<<8^(o^c),u=(i^s^a)<<24^(r^a)<<16^(r^s^a)<<8^(r^i^a);for(var f=0;f<4;++f)Ys[f][r]=l,Kn[f][o]=u,l=l<<24|l>>>8,u=u<<24|u>>>8;r===0?r=n=1:(r=i^e[e[e[i^a]]],n^=e[e[n]]);}}function UP(e,t){for(var r=e.slice(0),n,i=1,s=r.length,a=s+6+1,o=Za*a,c=s;c<o;++c)n=r[c-1],c%s===0?(n=jr[n>>>16&255]<<24^jr[n>>>8&255]<<16^jr[n&255]<<8^jr[n>>>24]^MP[i]<<24,i++):s>6&&c%s===4&&(n=jr[n>>>24]<<24^jr[n>>>16&255]<<16^jr[n>>>8&255]<<8^jr[n&255]),r[c]=r[c-s]^n;if(t){var l,u=Kn[0],f=Kn[1],h=Kn[2],p=Kn[3],m=r.slice(0);o=r.length;for(var c=0,_=o-Za;c<o;c+=Za,_-=Za)if(c===0||c===o-Za)m[c]=r[_],m[c+1]=r[_+3],m[c+2]=r[_+2],m[c+3]=r[_+1];else for(var E=0;E<Za;++E)l=r[_+E],m[c+(3&-E)]=u[jr[l>>>24]]^f[jr[l>>>16&255]]^h[jr[l>>>8&255]]^p[jr[l&255]];r=m;}return r}function ry(e,t,r,n){var i=e.length/4-1,s,a,o,c,l;n?(s=Kn[0],a=Kn[1],o=Kn[2],c=Kn[3],l=ty):(s=Ys[0],a=Ys[1],o=Ys[2],c=Ys[3],l=jr);var u,f,h,p,m,_,E;u=t[0]^e[0],f=t[n?3:1]^e[1],h=t[2]^e[2],p=t[n?1:3]^e[3];for(var w=3,y=1;y<i;++y)m=s[u>>>24]^a[f>>>16&255]^o[h>>>8&255]^c[p&255]^e[++w],_=s[f>>>24]^a[h>>>16&255]^o[p>>>8&255]^c[u&255]^e[++w],E=s[h>>>24]^a[p>>>16&255]^o[u>>>8&255]^c[f&255]^e[++w],p=s[p>>>24]^a[u>>>16&255]^o[f>>>8&255]^c[h&255]^e[++w],u=m,f=_,h=E;r[0]=l[u>>>24]<<24^l[f>>>16&255]<<16^l[h>>>8&255]<<8^l[p&255]^e[++w],r[n?3:1]=l[f>>>24]<<24^l[h>>>16&255]<<16^l[p>>>8&255]<<8^l[u&255]^e[++w],r[2]=l[h>>>24]<<24^l[p>>>16&255]<<16^l[u>>>8&255]<<8^l[f&255]^e[++w],r[n?1:3]=l[p>>>24]<<24^l[u>>>16&255]<<16^l[f>>>8&255]<<8^l[h&255]^e[++w];}function kf(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),r="AES-"+t,n;e.decrypt?n=Bt.cipher.createDecipher(r,e.key):n=Bt.cipher.createCipher(r,e.key);var i=n.start;return n.start=function(s,a){var o=null;a instanceof Bt.util.ByteBuffer&&(o=a,a={}),a=a||{},a.output=o,a.iv=s,i.call(n,a);},n}});var is=P((Jse,$P)=>{var Mu=Je();Mu.pki=Mu.pki||{};var iy=$P.exports=Mu.pki.oids=Mu.oids=Mu.oids||{};function ge(e,t){iy[e]=t,iy[t]=e;}function Ct(e,t){iy[e]=t;}ge("1.2.840.113549.1.1.1","rsaEncryption");ge("1.2.840.113549.1.1.4","md5WithRSAEncryption");ge("1.2.840.113549.1.1.5","sha1WithRSAEncryption");ge("1.2.840.113549.1.1.7","RSAES-OAEP");ge("1.2.840.113549.1.1.8","mgf1");ge("1.2.840.113549.1.1.9","pSpecified");ge("1.2.840.113549.1.1.10","RSASSA-PSS");ge("1.2.840.113549.1.1.11","sha256WithRSAEncryption");ge("1.2.840.113549.1.1.12","sha384WithRSAEncryption");ge("1.2.840.113549.1.1.13","sha512WithRSAEncryption");ge("1.3.101.112","EdDSA25519");ge("1.2.840.10040.4.3","dsa-with-sha1");ge("1.3.14.3.2.7","desCBC");ge("1.3.14.3.2.26","sha1");ge("1.3.14.3.2.29","sha1WithRSASignature");ge("2.16.840.1.101.3.4.2.1","sha256");ge("2.16.840.1.101.3.4.2.2","sha384");ge("2.16.840.1.101.3.4.2.3","sha512");ge("2.16.840.1.101.3.4.2.4","sha224");ge("2.16.840.1.101.3.4.2.5","sha512-224");ge("2.16.840.1.101.3.4.2.6","sha512-256");ge("1.2.840.113549.2.2","md2");ge("1.2.840.113549.2.5","md5");ge("1.2.840.113549.1.7.1","data");ge("1.2.840.113549.1.7.2","signedData");ge("1.2.840.113549.1.7.3","envelopedData");ge("1.2.840.113549.1.7.4","signedAndEnvelopedData");ge("1.2.840.113549.1.7.5","digestedData");ge("1.2.840.113549.1.7.6","encryptedData");ge("1.2.840.113549.1.9.1","emailAddress");ge("1.2.840.113549.1.9.2","unstructuredName");ge("1.2.840.113549.1.9.3","contentType");ge("1.2.840.113549.1.9.4","messageDigest");ge("1.2.840.113549.1.9.5","signingTime");ge("1.2.840.113549.1.9.6","counterSignature");ge("1.2.840.113549.1.9.7","challengePassword");ge("1.2.840.113549.1.9.8","unstructuredAddress");ge("1.2.840.113549.1.9.14","extensionRequest");ge("1.2.840.113549.1.9.20","friendlyName");ge("1.2.840.113549.1.9.21","localKeyId");ge("1.2.840.113549.1.9.22.1","x509Certificate");ge("1.2.840.113549.1.12.10.1.1","keyBag");ge("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");ge("1.2.840.113549.1.12.10.1.3","certBag");ge("1.2.840.113549.1.12.10.1.4","crlBag");ge("1.2.840.113549.1.12.10.1.5","secretBag");ge("1.2.840.113549.1.12.10.1.6","safeContentsBag");ge("1.2.840.113549.1.5.13","pkcs5PBES2");ge("1.2.840.113549.1.5.12","pkcs5PBKDF2");ge("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");ge("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");ge("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");ge("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");ge("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");ge("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");ge("1.2.840.113549.2.7","hmacWithSHA1");ge("1.2.840.113549.2.8","hmacWithSHA224");ge("1.2.840.113549.2.9","hmacWithSHA256");ge("1.2.840.113549.2.10","hmacWithSHA384");ge("1.2.840.113549.2.11","hmacWithSHA512");ge("1.2.840.113549.3.7","des-EDE3-CBC");ge("2.16.840.1.101.3.4.1.2","aes128-CBC");ge("2.16.840.1.101.3.4.1.22","aes192-CBC");ge("2.16.840.1.101.3.4.1.42","aes256-CBC");ge("2.5.4.3","commonName");ge("2.5.4.4","surname");ge("2.5.4.5","serialNumber");ge("2.5.4.6","countryName");ge("2.5.4.7","localityName");ge("2.5.4.8","stateOrProvinceName");ge("2.5.4.9","streetAddress");ge("2.5.4.10","organizationName");ge("2.5.4.11","organizationalUnitName");ge("2.5.4.12","title");ge("2.5.4.13","description");ge("2.5.4.15","businessCategory");ge("2.5.4.17","postalCode");ge("2.5.4.42","givenName");ge("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");ge("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");ge("2.16.840.1.113730.1.1","nsCertType");ge("2.16.840.1.113730.1.13","nsComment");Ct("2.5.29.1","authorityKeyIdentifier");Ct("2.5.29.2","keyAttributes");Ct("2.5.29.3","certificatePolicies");Ct("2.5.29.4","keyUsageRestriction");Ct("2.5.29.5","policyMapping");Ct("2.5.29.6","subtreesConstraint");Ct("2.5.29.7","subjectAltName");Ct("2.5.29.8","issuerAltName");Ct("2.5.29.9","subjectDirectoryAttributes");Ct("2.5.29.10","basicConstraints");Ct("2.5.29.11","nameConstraints");Ct("2.5.29.12","policyConstraints");Ct("2.5.29.13","basicConstraints");ge("2.5.29.14","subjectKeyIdentifier");ge("2.5.29.15","keyUsage");Ct("2.5.29.16","privateKeyUsagePeriod");ge("2.5.29.17","subjectAltName");ge("2.5.29.18","issuerAltName");ge("2.5.29.19","basicConstraints");Ct("2.5.29.20","cRLNumber");Ct("2.5.29.21","cRLReason");Ct("2.5.29.22","expirationDate");Ct("2.5.29.23","instructionCode");Ct("2.5.29.24","invalidityDate");Ct("2.5.29.25","cRLDistributionPoints");Ct("2.5.29.26","issuingDistributionPoint");Ct("2.5.29.27","deltaCRLIndicator");Ct("2.5.29.28","issuingDistributionPoint");Ct("2.5.29.29","certificateIssuer");Ct("2.5.29.30","nameConstraints");ge("2.5.29.31","cRLDistributionPoints");ge("2.5.29.32","certificatePolicies");Ct("2.5.29.33","policyMappings");Ct("2.5.29.34","policyConstraints");ge("2.5.29.35","authorityKeyIdentifier");Ct("2.5.29.36","policyConstraints");ge("2.5.29.37","extKeyUsage");Ct("2.5.29.46","freshestCRL");Ct("2.5.29.54","inhibitAnyPolicy");ge("1.3.6.1.4.1.11129.2.4.2","timestampList");ge("1.3.6.1.5.5.7.1.1","authorityInfoAccess");ge("1.3.6.1.5.5.7.3.1","serverAuth");ge("1.3.6.1.5.5.7.3.2","clientAuth");ge("1.3.6.1.5.5.7.3.3","codeSigning");ge("1.3.6.1.5.5.7.3.4","emailProtection");ge("1.3.6.1.5.5.7.3.8","timeStamping");});var zn=P((eae,HP)=>{var Ut=Je();mt();is();var Ce=HP.exports=Ut.asn1=Ut.asn1||{};Ce.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};Ce.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};Ce.create=function(e,t,r,n,i){if(Ut.util.isArray(n)){for(var s=[],a=0;a<n.length;++a)n[a]!==void 0&&s.push(n[a]);n=s;}var o={tagClass:e,type:t,constructed:r,composed:r||Ut.util.isArray(n),value:n};return i&&"bitStringContents"in i&&(o.bitStringContents=i.bitStringContents,o.original=Ce.copy(o)),o};Ce.copy=function(e,t){var r;if(Ut.util.isArray(e)){r=[];for(var n=0;n<e.length;++n)r.push(Ce.copy(e[n],t));return r}return typeof e=="string"?e:(r={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:Ce.copy(e.value,t)},t&&!t.excludeBitStringContents&&(r.bitStringContents=e.bitStringContents),r)};Ce.equals=function(e,t,r){if(Ut.util.isArray(e)){if(!Ut.util.isArray(t)||e.length!==t.length)return !1;for(var n=0;n<e.length;++n)if(!Ce.equals(e[n],t[n]))return !1;return !0}if(typeof e!=typeof t)return !1;if(typeof e=="string")return e===t;var i=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&Ce.equals(e.value,t.value);return r&&r.includeBitStringContents&&(i=i&&e.bitStringContents===t.bitStringContents),i};Ce.getBerValueLength=function(e){var t=e.getByte();if(t!==128){var r,n=t&128;return n?r=e.getInt((t&127)<<3):r=t,r}};function qu(e,t,r){if(r>t){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}var Cz=function(e,t){var r=e.getByte();if(t--,r!==128){var n,i=r&128;if(!i)n=r;else {var s=r&127;qu(e,t,s),n=e.getInt(s<<3);}if(n<0)throw new Error("Negative length: "+n);return n}};Ce.fromDer=function(e,t){t===void 0&&(t={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof t=="boolean"&&(t={strict:t,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"parseAllBytes"in t||(t.parseAllBytes=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),typeof e=="string"&&(e=Ut.util.createBuffer(e));var r=e.length(),n=Of(e,e.length(),0,t);if(t.parseAllBytes&&e.length()!==0){var i=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw i.byteCount=r,i.remaining=e.length(),i}return n};function Of(e,t,r,n){var i;qu(e,t,2);var s=e.getByte();t--;var a=s&192,o=s&31;i=e.length();var c=Cz(e,t);if(t-=i-e.length(),c!==void 0&&c>t){if(n.strict){var l=new Error("Too few bytes to read ASN.1 value.");throw l.available=e.length(),l.remaining=t,l.requested=c,l}c=t;}var u,f,h=(s&32)===32;if(h)if(u=[],c===void 0)for(;;){if(qu(e,t,2),e.bytes(2)==="\0\0"){e.getBytes(2),t-=2;break}i=e.length(),u.push(Of(e,t,r+1,n)),t-=i-e.length();}else for(;c>0;)i=e.length(),u.push(Of(e,c,r+1,n)),t-=i-e.length(),c-=i-e.length();if(u===void 0&&a===Ce.Class.UNIVERSAL&&o===Ce.Type.BITSTRING&&(f=e.bytes(c)),u===void 0&&n.decodeBitStrings&&a===Ce.Class.UNIVERSAL&&o===Ce.Type.BITSTRING&&c>1){var p=e.read,m=t,_=0;if(o===Ce.Type.BITSTRING&&(qu(e,t,1),_=e.getByte(),t--),_===0)try{i=e.length();var E={strict:!0,decodeBitStrings:!0},w=Of(e,t,r+1,E),y=i-e.length();t-=y,o==Ce.Type.BITSTRING&&y++;var b=w.tagClass;y===c&&(b===Ce.Class.UNIVERSAL||b===Ce.Class.CONTEXT_SPECIFIC)&&(u=[w]);}catch{}u===void 0&&(e.read=p,t=m);}if(u===void 0){if(c===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");c=t;}if(o===Ce.Type.BMPSTRING)for(u="";c>0;c-=2)qu(e,t,2),u+=String.fromCharCode(e.getInt16()),t-=2;else u=e.getBytes(c),t-=c;}var N=f===void 0?null:{bitStringContents:f};return Ce.create(a,o,h,u,N)}Ce.toDer=function(e){var t=Ut.util.createBuffer(),r=e.tagClass|e.type,n=Ut.util.createBuffer(),i=!1;if("bitStringContents"in e&&(i=!0,e.original&&(i=Ce.equals(e,e.original))),i)n.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:n.putByte(0);for(var s=0;s<e.value.length;++s)e.value[s]!==void 0&&n.putBuffer(Ce.toDer(e.value[s]));}else if(e.type===Ce.Type.BMPSTRING)for(var s=0;s<e.value.length;++s)n.putInt16(e.value.charCodeAt(s));else e.type===Ce.Type.INTEGER&&e.value.length>1&&(e.value.charCodeAt(0)===0&&!(e.value.charCodeAt(1)&128)||e.value.charCodeAt(0)===255&&(e.value.charCodeAt(1)&128)===128)?n.putBytes(e.value.substr(1)):n.putBytes(e.value);if(t.putByte(r),n.length()<=127)t.putByte(n.length()&127);else {var a=n.length(),o="";do o+=String.fromCharCode(a&255),a=a>>>8;while(a>0);t.putByte(o.length|128);for(var s=o.length-1;s>=0;--s)t.putByte(o.charCodeAt(s));}return t.putBuffer(n),t};Ce.oidToDer=function(e){var t=e.split("."),r=Ut.util.createBuffer();r.putByte(40*parseInt(t[0],10)+parseInt(t[1],10));for(var n,i,s,a,o=2;o<t.length;++o){n=!0,i=[],s=parseInt(t[o],10);do a=s&127,s=s>>>7,n||(a|=128),i.push(a),n=!1;while(s>0);for(var c=i.length-1;c>=0;--c)r.putByte(i[c]);}return r};Ce.derToOid=function(e){var t;typeof e=="string"&&(e=Ut.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var n=0;e.length()>0;)r=e.getByte(),n=n<<7,r&128?n+=r&127:(t+="."+(n+r),n=0);return t};Ce.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),s=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),o=0;if(e.length>11){var c=e.charAt(10),l=10;c!=="+"&&c!=="-"&&(o=parseInt(e.substr(10,2),10),l+=2);}if(t.setUTCFullYear(r,n,i),t.setUTCHours(s,a,o,0),l&&(c=e.charAt(l),c==="+"||c==="-")){var u=parseInt(e.substr(l+1,2),10),f=parseInt(e.substr(l+4,2),10),h=u*60+f;h*=6e4,c==="+"?t.setTime(+t-h):t.setTime(+t+h);}return t};Ce.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),a=parseInt(e.substr(10,2),10),o=parseInt(e.substr(12,2),10),c=0,l=0,u=!1;e.charAt(e.length-1)==="Z"&&(u=!0);var f=e.length-5,h=e.charAt(f);if(h==="+"||h==="-"){var p=parseInt(e.substr(f+1,2),10),m=parseInt(e.substr(f+4,2),10);l=p*60+m,l*=6e4,h==="+"&&(l*=-1),u=!0;}return e.charAt(14)==="."&&(c=parseFloat(e.substr(14),10)*1e3),u?(t.setUTCFullYear(r,n,i),t.setUTCHours(s,a,o,c),t.setTime(+t+l)):(t.setFullYear(r,n,i),t.setHours(s,a,o,c)),t};Ce.dateToUtcTime=function(e){if(typeof e=="string")return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z",t};Ce.dateToGeneralizedTime=function(e){if(typeof e=="string")return e;var t="",r=[];r.push(""+e.getUTCFullYear()),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z",t};Ce.integerToDer=function(e){var t=Ut.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r};Ce.derToInteger=function(e){typeof e=="string"&&(e=Ut.util.createBuffer(e));var t=e.length()*8;if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)};Ce.validate=function(e,t,r,n){var i=!1;if((e.tagClass===t.tagClass||typeof t.tagClass>"u")&&(e.type===t.type||typeof t.type>"u"))if(e.constructed===t.constructed||typeof t.constructed>"u"){if(i=!0,t.value&&Ut.util.isArray(t.value))for(var s=0,a=0;i&&a<t.value.length;++a)i=t.value[a].optional||!1,e.value[s]&&(i=Ce.validate(e.value[s],t.value[a],r,n),i?++s:t.value[a].optional&&(i=!0)),!i&&n&&n.push("["+t.name+'] Tag class "'+t.tagClass+'", type "'+t.type+'" expected value length "'+t.value.length+'", got "'+e.value.length+'"');if(i&&r&&(t.capture&&(r[t.capture]=e.value),t.captureAsn1&&(r[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(r[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e)){if(e.bitStringContents.length<2)r[t.captureBitStringValue]="";else {var c=e.bitStringContents.charCodeAt(0);if(c!==0)throw new Error("captureBitStringValue only supported for zero unused bits");r[t.captureBitStringValue]=e.bitStringContents.slice(1);}}}else n&&n.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');else n&&(e.tagClass!==t.tagClass&&n.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&n.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));return i};var VP=/[^\\u0000-\\u00ff]/;Ce.prettyPrint=function(e,t,r){var n="";t=t||0,r=r||2,t>0&&(n+=`
`);for(var i="",s=0;s<t*r;++s)i+=" ";switch(n+=i+"Tag: ",e.tagClass){case Ce.Class.UNIVERSAL:n+="Universal:";break;case Ce.Class.APPLICATION:n+="Application:";break;case Ce.Class.CONTEXT_SPECIFIC:n+="Context-Specific:";break;case Ce.Class.PRIVATE:n+="Private:";break}if(e.tagClass===Ce.Class.UNIVERSAL)switch(n+=e.type,e.type){case Ce.Type.NONE:n+=" (None)";break;case Ce.Type.BOOLEAN:n+=" (Boolean)";break;case Ce.Type.INTEGER:n+=" (Integer)";break;case Ce.Type.BITSTRING:n+=" (Bit string)";break;case Ce.Type.OCTETSTRING:n+=" (Octet string)";break;case Ce.Type.NULL:n+=" (Null)";break;case Ce.Type.OID:n+=" (Object Identifier)";break;case Ce.Type.ODESC:n+=" (Object Descriptor)";break;case Ce.Type.EXTERNAL:n+=" (External or Instance of)";break;case Ce.Type.REAL:n+=" (Real)";break;case Ce.Type.ENUMERATED:n+=" (Enumerated)";break;case Ce.Type.EMBEDDED:n+=" (Embedded PDV)";break;case Ce.Type.UTF8:n+=" (UTF8)";break;case Ce.Type.ROID:n+=" (Relative Object Identifier)";break;case Ce.Type.SEQUENCE:n+=" (Sequence)";break;case Ce.Type.SET:n+=" (Set)";break;case Ce.Type.PRINTABLESTRING:n+=" (Printable String)";break;case Ce.Type.IA5String:n+=" (IA5String (ASCII))";break;case Ce.Type.UTCTIME:n+=" (UTC time)";break;case Ce.Type.GENERALIZEDTIME:n+=" (Generalized time)";break;case Ce.Type.BMPSTRING:n+=" (BMP String)";break}else n+=e.type;if(n+=`
`,n+=i+"Constructed: "+e.constructed+`
`,e.composed){for(var a=0,o="",s=0;s<e.value.length;++s)e.value[s]!==void 0&&(a+=1,o+=Ce.prettyPrint(e.value[s],t+1,r),s+1<e.value.length&&(o+=","));n+=i+"Sub values: "+a+o;}else {if(n+=i+"Value: ",e.type===Ce.Type.OID){var c=Ce.derToOid(e.value);n+=c,Ut.pki&&Ut.pki.oids&&c in Ut.pki.oids&&(n+=" ("+Ut.pki.oids[c]+") ");}if(e.type===Ce.Type.INTEGER)try{n+=Ce.derToInteger(e.value);}catch{n+="0x"+Ut.util.bytesToHex(e.value);}else if(e.type===Ce.Type.BITSTRING){if(e.value.length>1?n+="0x"+Ut.util.bytesToHex(e.value.slice(1)):n+="(none)",e.value.length>0){var l=e.value.charCodeAt(0);l==1?n+=" (1 unused bit shown)":l>1&&(n+=" ("+l+" unused bits shown)");}}else if(e.type===Ce.Type.OCTETSTRING)VP.test(e.value)||(n+="("+e.value+") "),n+="0x"+Ut.util.bytesToHex(e.value);else if(e.type===Ce.Type.UTF8)try{n+=Ut.util.decodeUtf8(e.value);}catch(u){if(u.message==="URI malformed")n+="0x"+Ut.util.bytesToHex(e.value)+" (malformed UTF8)";else throw u}else e.type===Ce.Type.PRINTABLESTRING||e.type===Ce.Type.IA5String?n+=e.value:VP.test(e.value)?n+="0x"+Ut.util.bytesToHex(e.value):e.value.length===0?n+="[null]":n+=e.value;}return n};});var oi=P((tae,WP)=>{var Lf=Je();WP.exports=Lf.md=Lf.md||{};Lf.md.algorithms=Lf.md.algorithms||{};});var Ja=P((rae,KP)=>{var Ni=Je();oi();mt();var xz=KP.exports=Ni.hmac=Ni.hmac||{};xz.create=function(){var e=null,t=null,r=null,n=null,i={};return i.start=function(s,a){if(s!==null)if(typeof s=="string")if(s=s.toLowerCase(),s in Ni.md.algorithms)t=Ni.md.algorithms[s].create();else throw new Error('Unknown hash algorithm "'+s+'"');else t=s;if(a===null)a=e;else {if(typeof a=="string")a=Ni.util.createBuffer(a);else if(Ni.util.isArray(a)){var o=a;a=Ni.util.createBuffer();for(var c=0;c<o.length;++c)a.putByte(o[c]);}var l=a.length();l>t.blockLength&&(t.start(),t.update(a.bytes()),a=t.digest()),r=Ni.util.createBuffer(),n=Ni.util.createBuffer(),l=a.length();for(var c=0;c<l;++c){var o=a.at(c);r.putByte(54^o),n.putByte(92^o);}if(l<t.blockLength)for(var o=t.blockLength-l,c=0;c<o;++c)r.putByte(54),n.putByte(92);e=a,r=r.bytes(),n=n.bytes();}t.start(),t.update(r);},i.update=function(s){t.update(s);},i.getMac=function(){var s=t.digest().bytes();return t.start(),t.update(n),t.update(s),t.digest()},i.digest=i.getMac,i};});var Ff=P((nae,QP)=>{var ui=Je();oi();mt();var GP=QP.exports=ui.md5=ui.md5||{};ui.md.md5=ui.md.algorithms.md5=GP;GP.create=function(){YP||Tz();var e=null,t=ui.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 i=n.messageLengthSize/4,s=0;s<i;++s)n.fullMessageLength.push(0);return t=ui.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},n},n.start(),n.update=function(i,s){s==="utf8"&&(i=ui.util.encodeUtf8(i));var a=i.length;n.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var o=n.fullMessageLength.length-1;o>=0;--o)n.fullMessageLength[o]+=a[1],a[1]=a[0]+(n.fullMessageLength[o]/4294967296>>>0),n.fullMessageLength[o]=n.fullMessageLength[o]>>>0,a[0]=a[1]/4294967296>>>0;return t.putBytes(i),zP(e,r,t),(t.read>2048||t.length()===0)&&t.compact(),n},n.digest=function(){var i=ui.util.createBuffer();i.putBytes(t.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,a=s&n.blockLength-1;i.putBytes(sy.substr(0,n.blockLength-a));for(var o,c=0,l=n.fullMessageLength.length-1;l>=0;--l)o=n.fullMessageLength[l]*8+c,c=o/4294967296>>>0,i.putInt32Le(o>>>0);var u={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};zP(u,r,i);var f=ui.util.createBuffer();return f.putInt32Le(u.h0),f.putInt32Le(u.h1),f.putInt32Le(u.h2),f.putInt32Le(u.h3),f},n};var sy=null,Bf=null,Uu=null,eo=null,YP=!1;function Tz(){sy="\x80",sy+=ui.util.fillString("\0",64),Bf=[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],Uu=[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],eo=new Array(64);for(var e=0;e<64;++e)eo[e]=Math.floor(Math.abs(Math.sin(e+1))*4294967296);YP=!0;}function zP(e,t,r){for(var n,i,s,a,o,c,l,u,f=r.length();f>=64;){for(i=e.h0,s=e.h1,a=e.h2,o=e.h3,u=0;u<16;++u)t[u]=r.getInt32Le(),c=o^s&(a^o),n=i+c+eo[u]+t[u],l=Uu[u],i=o,o=a,a=s,s+=n<<l|n>>>32-l;for(;u<32;++u)c=a^o&(s^a),n=i+c+eo[u]+t[Bf[u]],l=Uu[u],i=o,o=a,a=s,s+=n<<l|n>>>32-l;for(;u<48;++u)c=s^a^o,n=i+c+eo[u]+t[Bf[u]],l=Uu[u],i=o,o=a,a=s,s+=n<<l|n>>>32-l;for(;u<64;++u)c=a^(s|~o),n=i+c+eo[u]+t[Bf[u]],l=Uu[u],i=o,o=a,a=s,s+=n<<l|n>>>32-l;e.h0=e.h0+i|0,e.h1=e.h1+s|0,e.h2=e.h2+a|0,e.h3=e.h3+o|0,f-=64;}}});var Qs=P((iae,XP)=>{var qf=Je();mt();var ZP=XP.exports=qf.pem=qf.pem||{};ZP.encode=function(e,t){t=t||{};var r="-----BEGIN "+e.type+`-----\r
`,n;if(e.procType&&(n={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]},r+=Mf(n)),e.contentDomain&&(n={name:"Content-Domain",values:[e.contentDomain]},r+=Mf(n)),e.dekInfo&&(n={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&n.values.push(e.dekInfo.parameters),r+=Mf(n)),e.headers)for(var i=0;i<e.headers.length;++i)r+=Mf(e.headers[i]);return e.procType&&(r+=`\r
`),r+=qf.util.encode64(e.body,t.maxline||64)+`\r
`,r+="-----END "+e.type+`-----\r
`,r};ZP.decode=function(e){for(var t=[],r=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,n=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,i=/\r?\n/,s;s=r.exec(e),!!s;){var a=s[1];a==="NEW CERTIFICATE REQUEST"&&(a="CERTIFICATE REQUEST");var o={type:a,procType:null,contentDomain:null,dekInfo:null,headers:[],body:qf.util.decode64(s[3])};if(t.push(o),!!s[2]){for(var c=s[2].split(i),l=0;s&&l<c.length;){for(var u=c[l].replace(/\s+$/,""),f=l+1;f<c.length;++f){var h=c[f];if(!/\s/.test(h[0]))break;u+=h,l=f;}if(s=u.match(n),s){for(var p={name:s[1],values:[]},m=s[2].split(","),_=0;_<m.length;++_)p.values.push(Az(m[_]));if(o.procType)if(!o.contentDomain&&p.name==="Content-Domain")o.contentDomain=m[0]||"";else if(!o.dekInfo&&p.name==="DEK-Info"){if(p.values.length===0)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');o.dekInfo={algorithm:m[0],parameters:m[1]||null};}else o.headers.push(p);else {if(p.name!=="Proc-Type")throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(p.values.length!==2)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');o.procType={version:m[0],type:m[1]};}}++l;}if(o.procType==="ENCRYPTED"&&!o.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(t.length===0)throw new Error("Invalid PEM formatted message.");return t};function Mf(e){for(var t=e.name+": ",r=[],n=function(c,l){return " "+l},i=0;i<e.values.length;++i)r.push(e.values[i].replace(/^(\S+\r\n)/,n));t+=r.join(",")+`\r
`;for(var s=0,a=-1,i=0;i<t.length;++i,++s)if(s>65&&a!==-1){var o=t[a];o===","?(++a,t=t.substr(0,a)+`\r
 `+t.substr(a)):t=t.substr(0,a)+`\r
`+o+t.substr(a+1),s=i-a-1,a=-1,++i;}else (t[i]===" "||t[i]==="	"||t[i]===",")&&(a=i);return t}function Az(e){return e.replace(/^\s+/,"")}});var ju=P((sae,eN)=>{var Wt=Je();Pf();ey();mt();eN.exports=Wt.des=Wt.des||{};Wt.des.startEncrypting=function(e,t,r,n){var i=Uf({key:e,output:r,decrypt:!1,mode:n||(t===null?"ECB":"CBC")});return i.start(t),i};Wt.des.createEncryptionCipher=function(e,t){return Uf({key:e,output:null,decrypt:!1,mode:t})};Wt.des.startDecrypting=function(e,t,r,n){var i=Uf({key:e,output:r,decrypt:!0,mode:n||(t===null?"ECB":"CBC")});return i.start(t),i};Wt.des.createDecryptionCipher=function(e,t){return Uf({key:e,output:null,decrypt:!0,mode:t})};Wt.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(n,i){return JP(r._keys,n,i,!1)},decrypt:function(n,i){return JP(r._keys,n,i,!0)}}}),r._init=!1;};Wt.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=Wt.util.createBuffer(e.key);if(this.name.indexOf("3DES")===0&&t.length()!==24)throw new Error("Invalid Triple-DES key size: "+t.length()*8);this._keys=Bz(t),this._init=!0;}};ci("DES-ECB",Wt.cipher.modes.ecb);ci("DES-CBC",Wt.cipher.modes.cbc);ci("DES-CFB",Wt.cipher.modes.cfb);ci("DES-OFB",Wt.cipher.modes.ofb);ci("DES-CTR",Wt.cipher.modes.ctr);ci("3DES-ECB",Wt.cipher.modes.ecb);ci("3DES-CBC",Wt.cipher.modes.cbc);ci("3DES-CFB",Wt.cipher.modes.cfb);ci("3DES-OFB",Wt.cipher.modes.ofb);ci("3DES-CTR",Wt.cipher.modes.ctr);function ci(e,t){var r=function(){return new Wt.des.Algorithm(e,t)};Wt.cipher.registerAlgorithm(e,r);}var Rz=[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],Iz=[-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],Pz=[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],Nz=[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],Dz=[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],kz=[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],Oz=[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],Lz=[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 Bz(e){for(var t=[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],i=[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],a=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],o=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],u=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],f=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],h=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],p=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],m=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],_=e.length()>8?3:1,E=[],w=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],y=0,b,N=0;N<_;N++){var L=e.getInt32(),V=e.getInt32();b=(L>>>4^V)&252645135,V^=b,L^=b<<4,b=(V>>>-16^L)&65535,L^=b,V^=b<<-16,b=(L>>>2^V)&858993459,V^=b,L^=b<<2,b=(V>>>-16^L)&65535,L^=b,V^=b<<-16,b=(L>>>1^V)&1431655765,V^=b,L^=b<<1,b=(V>>>8^L)&16711935,L^=b,V^=b<<8,b=(L>>>1^V)&1431655765,V^=b,L^=b<<1,b=L<<8|V>>>20&240,L=V<<24|V<<8&16711680|V>>>8&65280|V>>>24&240,V=b;for(var X=0;X<w.length;++X){w[X]?(L=L<<2|L>>>26,V=V<<2|V>>>26):(L=L<<1|L>>>27,V=V<<1|V>>>27),L&=-15,V&=-15;var z=t[L>>>28]|r[L>>>24&15]|n[L>>>20&15]|i[L>>>16&15]|s[L>>>12&15]|a[L>>>8&15]|o[L>>>4&15],G=c[V>>>28]|l[V>>>24&15]|u[V>>>20&15]|f[V>>>16&15]|h[V>>>12&15]|p[V>>>8&15]|m[V>>>4&15];b=(G>>>16^z)&65535,E[y++]=z^b,E[y++]=G^b<<16;}}return E}function JP(e,t,r,n){var i=e.length===32?3:9,s;i===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 a,o=t[0],c=t[1];a=(o>>>4^c)&252645135,c^=a,o^=a<<4,a=(o>>>16^c)&65535,c^=a,o^=a<<16,a=(c>>>2^o)&858993459,o^=a,c^=a<<2,a=(c>>>8^o)&16711935,o^=a,c^=a<<8,a=(o>>>1^c)&1431655765,c^=a,o^=a<<1,o=o<<1|o>>>31,c=c<<1|c>>>31;for(var l=0;l<i;l+=3){for(var u=s[l+1],f=s[l+2],h=s[l];h!=u;h+=f){var p=c^e[h],m=(c>>>4|c<<28)^e[h+1];a=o,o=c,c=a^(Iz[p>>>24&63]|Nz[p>>>16&63]|kz[p>>>8&63]|Lz[p&63]|Rz[m>>>24&63]|Pz[m>>>16&63]|Dz[m>>>8&63]|Oz[m&63]);}a=o,o=c,c=a;}o=o>>>1|o<<31,c=c>>>1|c<<31,a=(o>>>1^c)&1431655765,c^=a,o^=a<<1,a=(c>>>8^o)&16711935,o^=a,c^=a<<8,a=(c>>>2^o)&858993459,o^=a,c^=a<<2,a=(o>>>16^c)&65535,c^=a,o^=a<<16,a=(o>>>4^c)&252645135,c^=a,o^=a<<4,r[0]=o,r[1]=c;}function Uf(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),r="DES-"+t,n;e.decrypt?n=Wt.cipher.createDecipher(r,e.key):n=Wt.cipher.createCipher(r,e.key);var i=n.start;return n.start=function(s,a){var o=null;a instanceof Wt.util.ByteBuffer&&(o=a,a={}),a=a||{},a.output=o,a.iv=s,i.call(n,a);},n}});var jf=P((aae,tN)=>{var $r=Je();Ja();oi();mt();var Fz=$r.pkcs5=$r.pkcs5||{},Di;$r.util.isNodejs&&!$r.options.usePureJavaScript&&(Di=he("crypto"));tN.exports=$r.pbkdf2=Fz.pbkdf2=function(e,t,r,n,i,s){if(typeof i=="function"&&(s=i,i=null),$r.util.isNodejs&&!$r.options.usePureJavaScript&&Di.pbkdf2&&(i===null||typeof i!="object")&&(Di.pbkdf2Sync.length>4||!i||i==="sha1"))return typeof i!="string"&&(i="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),s?Di.pbkdf2Sync.length===4?Di.pbkdf2(e,t,r,n,function(b,N){if(b)return s(b);s(null,N.toString("binary"));}):Di.pbkdf2(e,t,r,n,i,function(b,N){if(b)return s(b);s(null,N.toString("binary"));}):Di.pbkdf2Sync.length===4?Di.pbkdf2Sync(e,t,r,n).toString("binary"):Di.pbkdf2Sync(e,t,r,n,i).toString("binary");if((typeof i>"u"||i===null)&&(i="sha1"),typeof i=="string"){if(!(i in $r.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=$r.md[i].create();}var a=i.digestLength;if(n>4294967295*a){var o=new Error("Derived key is too long.");if(s)return s(o);throw o}var c=Math.ceil(n/a),l=n-(c-1)*a,u=$r.hmac.create();u.start(i,e);var f="",h,p,m;if(!s){for(var _=1;_<=c;++_){u.start(null,null),u.update(t),u.update($r.util.int32ToBytes(_)),h=m=u.digest().getBytes();for(var E=2;E<=r;++E)u.start(null,null),u.update(m),p=u.digest().getBytes(),h=$r.util.xorBytes(h,p,a),m=p;f+=_<c?h:h.substr(0,l);}return f}var _=1,E;function w(){if(_>c)return s(null,f);u.start(null,null),u.update(t),u.update($r.util.int32ToBytes(_)),h=m=u.digest().getBytes(),E=2,y();}function y(){if(E<=r)return u.start(null,null),u.update(m),p=u.digest().getBytes(),h=$r.util.xorBytes(h,p,a),m=p,++E,$r.util.setImmediate(y);f+=_<c?h:h.substr(0,l),++_,w();}w();};});var oy=P((oae,aN)=>{var li=Je();oi();mt();var nN=aN.exports=li.sha256=li.sha256||{};li.md.sha256=li.md.algorithms.sha256=nN;nN.create=function(){iN||Mz();var e=null,t=li.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 i=n.messageLengthSize/4,s=0;s<i;++s)n.fullMessageLength.push(0);return t=li.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},n},n.start(),n.update=function(i,s){s==="utf8"&&(i=li.util.encodeUtf8(i));var a=i.length;n.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var o=n.fullMessageLength.length-1;o>=0;--o)n.fullMessageLength[o]+=a[1],a[1]=a[0]+(n.fullMessageLength[o]/4294967296>>>0),n.fullMessageLength[o]=n.fullMessageLength[o]>>>0,a[0]=a[1]/4294967296>>>0;return t.putBytes(i),rN(e,r,t),(t.read>2048||t.length()===0)&&t.compact(),n},n.digest=function(){var i=li.util.createBuffer();i.putBytes(t.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,a=s&n.blockLength-1;i.putBytes(ay.substr(0,n.blockLength-a));for(var o,c,l=n.fullMessageLength[0]*8,u=0;u<n.fullMessageLength.length-1;++u)o=n.fullMessageLength[u+1]*8,c=o/4294967296>>>0,l+=c,i.putInt32(l>>>0),l=o>>>0;i.putInt32(l);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};rN(f,r,i);var h=li.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h.putInt32(f.h5),h.putInt32(f.h6),h.putInt32(f.h7),h},n};var ay=null,iN=!1,sN=null;function Mz(){ay="\x80",ay+=li.util.fillString("\0",64),sN=[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],iN=!0;}function rN(e,t,r){for(var n,i,s,a,o,c,l,u,f,h,p,m,_,E,w,y=r.length();y>=64;){for(l=0;l<16;++l)t[l]=r.getInt32();for(;l<64;++l)n=t[l-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=t[l-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[l]=n+t[l-7]+i+t[l-16]|0;for(u=e.h0,f=e.h1,h=e.h2,p=e.h3,m=e.h4,_=e.h5,E=e.h6,w=e.h7,l=0;l<64;++l)a=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7),o=E^m&(_^E),s=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),c=u&f|h&(u^f),n=w+a+o+sN[l]+t[l],i=s+c,w=E,E=_,_=m,m=p+n>>>0,p=h,h=f,f=u,u=n+i>>>0;e.h0=e.h0+u|0,e.h1=e.h1+f|0,e.h2=e.h2+h|0,e.h3=e.h3+p|0,e.h4=e.h4+m|0,e.h5=e.h5+_|0,e.h6=e.h6+E|0,e.h7=e.h7+w|0,y-=64;}}});var uy=P((uae,oN)=>{var fi=Je();mt();var $f=null;fi.util.isNodejs&&!fi.options.usePureJavaScript&&!process.versions["node-webkit"]&&($f=he("crypto"));var qz=oN.exports=fi.prng=fi.prng||{};qz.create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,n=new Array(32),i=0;i<32;++i)n[i]=r.create();t.pools=n,t.pool=0,t.generate=function(l,u){if(!u)return t.generateSync(l);var f=t.plugin.cipher,h=t.plugin.increment,p=t.plugin.formatKey,m=t.plugin.formatSeed,_=fi.util.createBuffer();t.key=null,E();function E(w){if(w)return u(w);if(_.length()>=l)return u(null,_.getBytes(l));if(t.generated>1048575&&(t.key=null),t.key===null)return fi.util.nextTick(function(){s(E);});var y=f(t.key,t.seed);t.generated+=y.length,_.putBytes(y),t.key=p(f(t.key,h(t.seed))),t.seed=m(f(t.key,t.seed)),fi.util.setImmediate(E);}},t.generateSync=function(l){var u=t.plugin.cipher,f=t.plugin.increment,h=t.plugin.formatKey,p=t.plugin.formatSeed;t.key=null;for(var m=fi.util.createBuffer();m.length()<l;){t.generated>1048575&&(t.key=null),t.key===null&&a();var _=u(t.key,t.seed);t.generated+=_.length,m.putBytes(_),t.key=h(u(t.key,f(t.seed))),t.seed=p(u(t.key,t.seed));}return m.getBytes(l)};function s(l){if(t.pools[0].messageLength>=32)return o(),l();var u=32-t.pools[0].messageLength<<5;t.seedFile(u,function(f,h){if(f)return l(f);t.collect(h),o(),l();});}function a(){if(t.pools[0].messageLength>=32)return o();var l=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(l)),o();}function o(){t.reseeds=t.reseeds===4294967295?0:t.reseeds+1;var l=t.plugin.md.create();l.update(t.keyBytes);for(var u=1,f=0;f<32;++f)t.reseeds%u===0&&(l.update(t.pools[f].digest().getBytes()),t.pools[f].start()),u=u<<1;t.keyBytes=l.digest().getBytes(),l.start(),l.update(t.keyBytes);var h=l.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(h),t.generated=0;}function c(l){var u=null,f=fi.util.globalScope,h=f.crypto||f.msCrypto;h&&h.getRandomValues&&(u=function(L){return h.getRandomValues(L)});var p=fi.util.createBuffer();if(u)for(;p.length()<l;){var m=Math.max(1,Math.min(l-p.length(),65536)/4),_=new Uint32Array(Math.floor(m));try{u(_);for(var E=0;E<_.length;++E)p.putInt32(_[E]);}catch(L){if(!(typeof QuotaExceededError<"u"&&L instanceof QuotaExceededError))throw L}}if(p.length()<l)for(var w,y,b,N=Math.floor(Math.random()*65536);p.length()<l;){y=16807*(N&65535),w=16807*(N>>16),y+=(w&32767)<<16,y+=w>>15,y=(y&2147483647)+(y>>31),N=y&4294967295;for(var E=0;E<3;++E)b=N>>>(E<<3),b^=Math.floor(Math.random()*256),p.putByte(b&255);}return p.getBytes(l)}return $f?(t.seedFile=function(l,u){$f.randomBytes(l,function(f,h){if(f)return u(f);u(null,h.toString());});},t.seedFileSync=function(l){return $f.randomBytes(l).toString()}):(t.seedFile=function(l,u){try{u(null,c(l));}catch(f){u(f);}},t.seedFileSync=c),t.collect=function(l){for(var u=l.length,f=0;f<u;++f)t.pools[t.pool].update(l.substr(f,1)),t.pool=t.pool===31?0:t.pool+1;},t.collectInt=function(l,u){for(var f="",h=0;h<u;h+=8)f+=String.fromCharCode(l>>h&255);t.collect(f);},t.registerWorker=function(l){if(l===self)t.seedFile=function(f,h){function p(m){var _=m.data;_.forge&&_.forge.prng&&(self.removeEventListener("message",p),h(_.forge.prng.err,_.forge.prng.bytes));}self.addEventListener("message",p),self.postMessage({forge:{prng:{needed:f}}});};else {var u=function(f){var h=f.data;h.forge&&h.forge.prng&&t.seedFile(h.forge.prng.needed,function(p,m){l.postMessage({forge:{prng:{err:p,bytes:m}}});});};l.addEventListener("message",u);}},t};});var xn=P((cae,cy)=>{var gr=Je();ns();oy();uy();mt();(function(){if(gr.random&&gr.random.getBytes){cy.exports=gr.random;return}(function(e){var t={},r=new Array(4),n=gr.util.createBuffer();t.formatKey=function(f){var h=gr.util.createBuffer(f);return f=new Array(4),f[0]=h.getInt32(),f[1]=h.getInt32(),f[2]=h.getInt32(),f[3]=h.getInt32(),gr.aes._expandKey(f,!1)},t.formatSeed=function(f){var h=gr.util.createBuffer(f);return f=new Array(4),f[0]=h.getInt32(),f[1]=h.getInt32(),f[2]=h.getInt32(),f[3]=h.getInt32(),f},t.cipher=function(f,h){return gr.aes._updateBlock(f,h,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},t.increment=function(f){return ++f[3],f},t.md=gr.md.sha256;function i(){var f=gr.prng.create(t);return f.getBytes=function(h,p){return f.generate(h,p)},f.getBytesSync=function(h){return f.generate(h)},f}var s=i(),a=null,o=gr.util.globalScope,c=o.crypto||o.msCrypto;if(c&&c.getRandomValues&&(a=function(f){return c.getRandomValues(f)}),gr.options.usePureJavaScript||!gr.util.isNodejs&&!a){if(s.collectInt(+new Date,32),typeof navigator<"u"){var l="";for(var u in navigator)try{typeof navigator[u]=="string"&&(l+=navigator[u]);}catch{}s.collect(l),l=null;}e&&(e().mousemove(function(f){s.collectInt(f.clientX,16),s.collectInt(f.clientY,16);}),e().keypress(function(f){s.collectInt(f.charCode,8);}));}if(!gr.random)gr.random=s;else for(var u in s)gr.random[u]=s[u];gr.random.createInstance=i,cy.exports=gr.random;})(typeof jQuery<"u"?jQuery:null);})();});var fy=P((lae,lN)=>{var Zr=Je();mt();var ly=[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],uN=[1,2,3,5],Uz=function(e,t){return e<<t&65535|(e&65535)>>16-t},jz=function(e,t){return (e&65535)>>t|e<<16-t&65535};lN.exports=Zr.rc2=Zr.rc2||{};Zr.rc2.expandKey=function(e,t){typeof e=="string"&&(e=Zr.util.createBuffer(e)),t=t||128;var r=e,n=e.length(),i=t,s=Math.ceil(i/8),a=255>>(i&7),o;for(o=n;o<128;o++)r.putByte(ly[r.at(o-1)+r.at(o-n)&255]);for(r.setAt(128-s,ly[r.at(128-s)&a]),o=127-s;o>=0;o--)r.setAt(o,ly[r.at(o+1)^r.at(o+s)]);return r};var cN=function(e,t,r){var n=!1,i=null,s=null,a=null,o,c,l,u,f=[];for(e=Zr.rc2.expandKey(e,t),l=0;l<64;l++)f.push(e.getInt16Le());r?(o=function(m){for(l=0;l<4;l++)m[l]+=f[u]+(m[(l+3)%4]&m[(l+2)%4])+(~m[(l+3)%4]&m[(l+1)%4]),m[l]=Uz(m[l],uN[l]),u++;},c=function(m){for(l=0;l<4;l++)m[l]+=f[m[(l+3)%4]&63];}):(o=function(m){for(l=3;l>=0;l--)m[l]=jz(m[l],uN[l]),m[l]-=f[u]+(m[(l+3)%4]&m[(l+2)%4])+(~m[(l+3)%4]&m[(l+1)%4]),u--;},c=function(m){for(l=3;l>=0;l--)m[l]-=f[m[(l+3)%4]&63];});var h=function(m){var _=[];for(l=0;l<4;l++){var E=i.getInt16Le();a!==null&&(r?E^=a.getInt16Le():a.putInt16Le(E)),_.push(E&65535);}u=r?0:63;for(var w=0;w<m.length;w++)for(var y=0;y<m[w][0];y++)m[w][1](_);for(l=0;l<4;l++)a!==null&&(r?a.putInt16Le(_[l]):_[l]^=a.getInt16Le()),s.putInt16Le(_[l]);},p=null;return p={start:function(m,_){m&&typeof m=="string"&&(m=Zr.util.createBuffer(m)),n=!1,i=Zr.util.createBuffer(),s=_||new Zr.util.createBuffer,a=m,p.output=s;},update:function(m){for(n||i.putBuffer(m);i.length()>=8;)h([[5,o],[1,c],[6,o],[1,c],[5,o]]);},finish:function(m){var _=!0;if(r)if(m)_=m(8,i,!r);else {var E=i.length()===8?8:8-i.length();i.fillWithByte(E,E);}if(_&&(n=!0,p.update()),!r&&(_=i.length()===0,_))if(m)_=m(8,s,!r);else {var w=s.length(),y=s.at(w-1);y>w?_=!1:s.truncate(y);}return _}},p};Zr.rc2.startEncrypting=function(e,t,r){var n=Zr.rc2.createEncryptionCipher(e,128);return n.start(t,r),n};Zr.rc2.createEncryptionCipher=function(e,t){return cN(e,t,!0)};Zr.rc2.startDecrypting=function(e,t,r){var n=Zr.rc2.createDecryptionCipher(e,128);return n.start(t,r),n};Zr.rc2.createDecryptionCipher=function(e,t){return cN(e,t,!1)};});var Vu=P((fae,vN)=>{var dy=Je();vN.exports=dy.jsbn=dy.jsbn||{};var ki;function fe(e,t,r){this.data=[],e!=null&&(typeof e=="number"?this.fromNumber(e,t,r):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t));}dy.jsbn.BigInteger=fe;function yt(){return new fe(null)}function Vz(e,t,r,n,i,s){for(;--s>=0;){var a=t*this.data[e++]+r.data[n]+i;i=Math.floor(a/67108864),r.data[n++]=a&67108863;}return i}function Hz(e,t,r,n,i,s){for(var a=t&32767,o=t>>15;--s>=0;){var c=this.data[e]&32767,l=this.data[e++]>>15,u=o*c+l*a;c=a*c+((u&32767)<<15)+r.data[n]+(i&1073741823),i=(c>>>30)+(u>>>15)+o*l+(i>>>30),r.data[n++]=c&1073741823;}return i}function dN(e,t,r,n,i,s){for(var a=t&16383,o=t>>14;--s>=0;){var c=this.data[e]&16383,l=this.data[e++]>>14,u=o*c+l*a;c=a*c+((u&16383)<<14)+r.data[n]+i,i=(c>>28)+(u>>14)+o*l,r.data[n++]=c&268435455;}return i}typeof navigator>"u"?(fe.prototype.am=dN,ki=28):navigator.appName=="Microsoft Internet Explorer"?(fe.prototype.am=Hz,ki=30):navigator.appName!="Netscape"?(fe.prototype.am=Vz,ki=26):(fe.prototype.am=dN,ki=28);fe.prototype.DB=ki;fe.prototype.DM=(1<<ki)-1;fe.prototype.DV=1<<ki;var hy=52;fe.prototype.FV=Math.pow(2,hy);fe.prototype.F1=hy-ki;fe.prototype.F2=2*ki-hy;var Wz="0123456789abcdefghijklmnopqrstuvwxyz",Vf=new Array,to,Tn;to=48;for(Tn=0;Tn<=9;++Tn)Vf[to++]=Tn;to=97;for(Tn=10;Tn<36;++Tn)Vf[to++]=Tn;to=65;for(Tn=10;Tn<36;++Tn)Vf[to++]=Tn;function hN(e){return Wz.charAt(e)}function pN(e,t){var r=Vf[e.charCodeAt(t)];return r??-1}function Kz(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s;}function zz(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0;}function ss(e){var t=yt();return t.fromInt(e),t}function Gz(e,t){var r;if(t==16)r=4;else if(t==8)r=3;else if(t==256)r=8;else if(t==2)r=1;else if(t==32)r=5;else if(t==4)r=2;else {this.fromRadix(e,t);return}this.t=0,this.s=0;for(var n=e.length,i=!1,s=0;--n>=0;){var a=r==8?e[n]&255:pN(e,n);if(a<0){e.charAt(n)=="-"&&(i=!0);continue}i=!1,s==0?this.data[this.t++]=a:s+r>this.DB?(this.data[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this.data[this.t++]=a>>this.DB-s):this.data[this.t-1]|=a<<s,s+=r,s>=this.DB&&(s-=this.DB);}r==8&&e[0]&128&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&fe.ZERO.subTo(this,this);}function Yz(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t;}function Qz(e){if(this.s<0)return "-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var r=(1<<t)-1,n,i=!1,s="",a=this.t,o=this.DB-a*this.DB%t;if(a-- >0)for(o<this.DB&&(n=this.data[a]>>o)>0&&(i=!0,s=hN(n));a>=0;)o<t?(n=(this.data[a]&(1<<o)-1)<<t-o,n|=this.data[--a]>>(o+=this.DB-t)):(n=this.data[a]>>(o-=t)&r,o<=0&&(o+=this.DB,--a)),n>0&&(i=!0),i&&(s+=hN(n));return i?s:"0"}function Zz(){var e=yt();return fe.ZERO.subTo(this,e),e}function Xz(){return this.s<0?this.negate():this}function Jz(e){var t=this.s-e.s;if(t!=0)return t;var r=this.t;if(t=r-e.t,t!=0)return this.s<0?-t:t;for(;--r>=0;)if((t=this.data[r]-e.data[r])!=0)return t;return 0}function Hf(e){var t=1,r;return (r=e>>>16)!=0&&(e=r,t+=16),(r=e>>8)!=0&&(e=r,t+=8),(r=e>>4)!=0&&(e=r,t+=4),(r=e>>2)!=0&&(e=r,t+=2),(r=e>>1)!=0&&(e=r,t+=1),t}function eG(){return this.t<=0?0:this.DB*(this.t-1)+Hf(this.data[this.t-1]^this.s&this.DM)}function tG(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s;}function rG(e,t){for(var r=e;r<this.t;++r)t.data[r-e]=this.data[r];t.t=Math.max(this.t-e,0),t.s=this.s;}function nG(e,t){var r=e%this.DB,n=this.DB-r,i=(1<<n)-1,s=Math.floor(e/this.DB),a=this.s<<r&this.DM,o;for(o=this.t-1;o>=0;--o)t.data[o+s+1]=this.data[o]>>n|a,a=(this.data[o]&i)<<r;for(o=s-1;o>=0;--o)t.data[o]=0;t.data[s]=a,t.t=this.t+s+1,t.s=this.s,t.clamp();}function iG(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t){t.t=0;return}var n=e%this.DB,i=this.DB-n,s=(1<<n)-1;t.data[0]=this.data[r]>>n;for(var a=r+1;a<this.t;++a)t.data[a-r-1]|=(this.data[a]&s)<<i,t.data[a-r]=this.data[a]>>n;n>0&&(t.data[this.t-r-1]|=(this.s&s)<<i),t.t=this.t-r,t.clamp();}function sG(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]-e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s;}else {for(n+=this.s;r<e.t;)n-=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n-=e.s;}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp();}function aG(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t.data[i]=0;for(i=0;i<n.t;++i)t.data[i+r.t]=r.am(0,n.data[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&fe.ZERO.subTo(t,t);}function oG(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e.data[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t.data[r],e,2*r,0,1);(e.data[r+t.t]+=t.am(r+1,2*t.data[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1);}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp();}function uG(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t){t?.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=yt());var s=yt(),a=this.s,o=e.s,c=this.DB-Hf(n.data[n.t-1]);c>0?(n.lShiftTo(c,s),i.lShiftTo(c,r)):(n.copyTo(s),i.copyTo(r));var l=s.t,u=s.data[l-1];if(u!=0){var f=u*(1<<this.F1)+(l>1?s.data[l-2]>>this.F2:0),h=this.FV/f,p=(1<<this.F1)/f,m=1<<this.F2,_=r.t,E=_-l,w=t??yt();for(s.dlShiftTo(E,w),r.compareTo(w)>=0&&(r.data[r.t++]=1,r.subTo(w,r)),fe.ONE.dlShiftTo(l,w),w.subTo(s,s);s.t<l;)s.data[s.t++]=0;for(;--E>=0;){var y=r.data[--_]==u?this.DM:Math.floor(r.data[_]*h+(r.data[_-1]+m)*p);if((r.data[_]+=s.am(0,y,r,E,0,l))<y)for(s.dlShiftTo(E,w),r.subTo(w,r);r.data[_]<--y;)r.subTo(w,r);}t!=null&&(r.drShiftTo(l,t),a!=o&&fe.ZERO.subTo(t,t)),r.t=l,r.clamp(),c>0&&r.rShiftTo(c,r),a<0&&fe.ZERO.subTo(r,r);}}}function cG(e){var t=yt();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(fe.ZERO)>0&&e.subTo(t,t),t}function Zs(e){this.m=e;}function lG(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function fG(e){return e}function dG(e){e.divRemTo(this.m,null,e);}function hG(e,t,r){e.multiplyTo(t,r),this.reduce(r);}function pG(e,t){e.squareTo(t),this.reduce(t);}Zs.prototype.convert=lG;Zs.prototype.revert=fG;Zs.prototype.reduce=dG;Zs.prototype.mulTo=hG;Zs.prototype.sqrTo=pG;function gG(){if(this.t<1)return 0;var e=this.data[0];if(!(e&1))return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function Xs(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t;}function mG(e){var t=yt();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(fe.ZERO)>0&&this.m.subTo(t,t),t}function yG(e){var t=yt();return e.copyTo(t),this.reduce(t),t}function vG(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=e.data[t]&32767,n=r*this.mpl+((r*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++;}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e);}function _G(e,t){e.squareTo(t),this.reduce(t);}function bG(e,t,r){e.multiplyTo(t,r),this.reduce(r);}Xs.prototype.convert=mG;Xs.prototype.revert=yG;Xs.prototype.reduce=vG;Xs.prototype.mulTo=bG;Xs.prototype.sqrTo=_G;function SG(){return (this.t>0?this.data[0]&1:this.s)==0}function EG(e,t){if(e>4294967295||e<1)return fe.ONE;var r=yt(),n=yt(),i=t.convert(this),s=Hf(e)-1;for(i.copyTo(r);--s>=0;)if(t.sqrTo(r,n),(e&1<<s)>0)t.mulTo(n,i,r);else {var a=r;r=n,n=a;}return t.revert(r)}function wG(e,t){var r;return e<256||t.isEven()?r=new Zs(t):r=new Xs(t),this.exp(e,r)}fe.prototype.copyTo=Kz;fe.prototype.fromInt=zz;fe.prototype.fromString=Gz;fe.prototype.clamp=Yz;fe.prototype.dlShiftTo=tG;fe.prototype.drShiftTo=rG;fe.prototype.lShiftTo=nG;fe.prototype.rShiftTo=iG;fe.prototype.subTo=sG;fe.prototype.multiplyTo=aG;fe.prototype.squareTo=oG;fe.prototype.divRemTo=uG;fe.prototype.invDigit=gG;fe.prototype.isEven=SG;fe.prototype.exp=EG;fe.prototype.toString=Qz;fe.prototype.negate=Zz;fe.prototype.abs=Xz;fe.prototype.compareTo=Jz;fe.prototype.bitLength=eG;fe.prototype.mod=cG;fe.prototype.modPowInt=wG;fe.ZERO=ss(0);fe.ONE=ss(1);function CG(){var e=yt();return this.copyTo(e),e}function xG(){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)<<this.DB|this.data[0]}function TG(){return this.t==0?this.s:this.data[0]<<24>>24}function AG(){return this.t==0?this.s:this.data[0]<<16>>16}function RG(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function IG(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function PG(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return "0";var t=this.chunkSize(e),r=Math.pow(e,t),n=ss(r),i=yt(),s=yt(),a="";for(this.divRemTo(n,i,s);i.signum()>0;)a=(r+s.intValue()).toString(e).substr(1)+a,i.divRemTo(n,i,s);return s.intValue().toString(e)+a}function NG(e,t){this.fromInt(0),t==null&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,s=0,a=0,o=0;o<e.length;++o){var c=pN(e,o);if(c<0){e.charAt(o)=="-"&&this.signum()==0&&(i=!0);continue}a=t*a+c,++s>=r&&(this.dMultiply(n),this.dAddOffset(a,0),s=0,a=0);}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(a,0)),i&&fe.ZERO.subTo(this,this);}function DG(e,t,r){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(fe.ONE.shiftLeft(e-1),py,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(fe.ONE.shiftLeft(e-1),this);else {var n=new Array,i=e&7;n.length=(e>>3)+1,t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256);}}function kG(){var e=this.t,t=new Array;t[0]=this.s;var r=this.DB-e*this.DB%8,n,i=0;if(e-- >0)for(r<this.DB&&(n=this.data[e]>>r)!=(this.s&this.DM)>>r&&(t[i++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this.data[e]&(1<<r)-1)<<8-r,n|=this.data[--e]>>(r+=this.DB-8)):(n=this.data[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),n&128&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(t[i++]=n);return t}function OG(e){return this.compareTo(e)==0}function LG(e){return this.compareTo(e)<0?this:e}function BG(e){return this.compareTo(e)>0?this:e}function FG(e,t,r){var n,i,s=Math.min(e.t,this.t);for(n=0;n<s;++n)r.data[n]=t(this.data[n],e.data[n]);if(e.t<this.t){for(i=e.s&this.DM,n=s;n<this.t;++n)r.data[n]=t(this.data[n],i);r.t=this.t;}else {for(i=this.s&this.DM,n=s;n<e.t;++n)r.data[n]=t(i,e.data[n]);r.t=e.t;}r.s=t(this.s,e.s),r.clamp();}function MG(e,t){return e&t}function qG(e){var t=yt();return this.bitwiseTo(e,MG,t),t}function py(e,t){return e|t}function UG(e){var t=yt();return this.bitwiseTo(e,py,t),t}function gN(e,t){return e^t}function jG(e){var t=yt();return this.bitwiseTo(e,gN,t),t}function mN(e,t){return e&~t}function $G(e){var t=yt();return this.bitwiseTo(e,mN,t),t}function VG(){for(var e=yt(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e}function HG(e){var t=yt();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function WG(e){var t=yt();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function KG(e){if(e==0)return -1;var t=0;return e&65535||(e>>=16,t+=16),e&255||(e>>=8,t+=8),e&15||(e>>=4,t+=4),e&3||(e>>=2,t+=2),e&1||++t,t}function zG(){for(var e=0;e<this.t;++e)if(this.data[e]!=0)return e*this.DB+KG(this.data[e]);return this.s<0?this.t*this.DB:-1}function GG(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function YG(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=GG(this.data[r]^t);return e}function QG(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this.data[t]&1<<e%this.DB)!=0}function ZG(e,t){var r=fe.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}function XG(e){return this.changeBit(e,py)}function JG(e){return this.changeBit(e,mN)}function eY(e){return this.changeBit(e,gN)}function tY(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]+e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s;}else {for(n+=this.s;r<e.t;)n+=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=e.s;}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp();}function rY(e){var t=yt();return this.addTo(e,t),t}function nY(e){var t=yt();return this.subTo(e,t),t}function iY(e){var t=yt();return this.multiplyTo(e,t),t}function sY(e){var t=yt();return this.divRemTo(e,t,null),t}function aY(e){var t=yt();return this.divRemTo(e,null,t),t}function oY(e){var t=yt(),r=yt();return this.divRemTo(e,t,r),new Array(t,r)}function uY(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp();}function cY(e,t){if(e!=0){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t];}}function $u(){}function yN(e){return e}function lY(e,t,r){e.multiplyTo(t,r);}function fY(e,t){e.squareTo(t);}$u.prototype.convert=yN;$u.prototype.revert=yN;$u.prototype.mulTo=lY;$u.prototype.sqrTo=fY;function dY(e){return this.exp(e,new $u)}function hY(e,t,r){var n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var i;for(i=r.t-this.t;n<i;++n)r.data[n+this.t]=this.am(0,e.data[n],r,n,0,this.t);for(i=Math.min(e.t,t);n<i;++n)this.am(0,e.data[n],r,n,0,t-n);r.clamp();}function pY(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r.data[this.t+n-t]=this.am(t-n,e.data[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r);}function ro(e){this.r2=yt(),this.q3=yt(),fe.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e;}function gY(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=yt();return e.copyTo(t),this.reduce(t),t}function mY(e){return e}function yY(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e);}function vY(e,t){e.squareTo(t),this.reduce(t);}function _Y(e,t,r){e.multiplyTo(t,r),this.reduce(r);}ro.prototype.convert=gY;ro.prototype.revert=mY;ro.prototype.reduce=yY;ro.prototype.mulTo=_Y;ro.prototype.sqrTo=vY;function bY(e,t){var r=e.bitLength(),n,i=ss(1),s;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?s=new Zs(t):t.isEven()?s=new ro(t):s=new Xs(t);var a=new Array,o=3,c=n-1,l=(1<<n)-1;if(a[1]=s.convert(this),n>1){var u=yt();for(s.sqrTo(a[1],u);o<=l;)a[o]=yt(),s.mulTo(u,a[o-2],a[o]),o+=2;}var f=e.t-1,h,p=!0,m=yt(),_;for(r=Hf(e.data[f])-1;f>=0;){for(r>=c?h=e.data[f]>>r-c&l:(h=(e.data[f]&(1<<r+1)-1)<<c-r,f>0&&(h|=e.data[f-1]>>this.DB+r-c)),o=n;!(h&1);)h>>=1,--o;if((r-=o)<0&&(r+=this.DB,--f),p)a[h].copyTo(i),p=!1;else {for(;o>1;)s.sqrTo(i,m),s.sqrTo(m,i),o-=2;o>0?s.sqrTo(i,m):(_=i,i=m,m=_),s.mulTo(m,a[h],i);}for(;f>=0&&!(e.data[f]&1<<r);)s.sqrTo(i,m),_=i,i=m,m=_,--r<0&&(r=this.DB-1,--f);}return s.revert(i)}function SY(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n;}var i=t.getLowestSetBit(),s=r.getLowestSetBit();if(s<0)return t;for(i<s&&(s=i),s>0&&(t.rShiftTo(s,t),r.rShiftTo(s,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}function EY(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(t==0)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r}function wY(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return fe.ZERO;for(var r=e.clone(),n=this.clone(),i=ss(1),s=ss(0),a=ss(0),o=ss(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),t?((!i.isEven()||!s.isEven())&&(i.addTo(this,i),s.subTo(e,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),t?((!a.isEven()||!o.isEven())&&(a.addTo(this,a),o.subTo(e,o)),a.rShiftTo(1,a)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(a,i),s.subTo(o,s)):(n.subTo(r,n),t&&a.subTo(i,a),o.subTo(s,o));}if(n.compareTo(fe.ONE)!=0)return fe.ZERO;if(o.compareTo(e)>=0)return o.subtract(e);if(o.signum()<0)o.addTo(e,o);else return o;return o.signum()<0?o.add(e):o}var Gn=[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],CY=(1<<26)/Gn[Gn.length-1];function xY(e){var t,r=this.abs();if(r.t==1&&r.data[0]<=Gn[Gn.length-1]){for(t=0;t<Gn.length;++t)if(r.data[0]==Gn[t])return !0;return !1}if(r.isEven())return !1;for(t=1;t<Gn.length;){for(var n=Gn[t],i=t+1;i<Gn.length&&n<CY;)n*=Gn[i++];for(n=r.modInt(n);t<i;)if(n%Gn[t++]==0)return !1}return r.millerRabin(e)}function TY(e){var t=this.subtract(fe.ONE),r=t.getLowestSetBit();if(r<=0)return !1;for(var n=t.shiftRight(r),i=AY(),s,a=0;a<e;++a){do s=new fe(this.bitLength(),i);while(s.compareTo(fe.ONE)<=0||s.compareTo(t)>=0);var o=s.modPow(n,this);if(o.compareTo(fe.ONE)!=0&&o.compareTo(t)!=0){for(var c=1;c++<r&&o.compareTo(t)!=0;)if(o=o.modPowInt(2,this),o.compareTo(fe.ONE)==0)return !1;if(o.compareTo(t)!=0)return !1}}return !0}function AY(){return {nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(Math.random()*256);}}}fe.prototype.chunkSize=RG;fe.prototype.toRadix=PG;fe.prototype.fromRadix=NG;fe.prototype.fromNumber=DG;fe.prototype.bitwiseTo=FG;fe.prototype.changeBit=ZG;fe.prototype.addTo=tY;fe.prototype.dMultiply=uY;fe.prototype.dAddOffset=cY;fe.prototype.multiplyLowerTo=hY;fe.prototype.multiplyUpperTo=pY;fe.prototype.modInt=EY;fe.prototype.millerRabin=TY;fe.prototype.clone=CG;fe.prototype.intValue=xG;fe.prototype.byteValue=TG;fe.prototype.shortValue=AG;fe.prototype.signum=IG;fe.prototype.toByteArray=kG;fe.prototype.equals=OG;fe.prototype.min=LG;fe.prototype.max=BG;fe.prototype.and=qG;fe.prototype.or=UG;fe.prototype.xor=jG;fe.prototype.andNot=$G;fe.prototype.not=VG;fe.prototype.shiftLeft=HG;fe.prototype.shiftRight=WG;fe.prototype.getLowestSetBit=zG;fe.prototype.bitCount=YG;fe.prototype.testBit=QG;fe.prototype.setBit=XG;fe.prototype.clearBit=JG;fe.prototype.flipBit=eY;fe.prototype.add=rY;fe.prototype.subtract=nY;fe.prototype.multiply=iY;fe.prototype.divide=sY;fe.prototype.remainder=aY;fe.prototype.divideAndRemainder=oY;fe.prototype.modPow=bY;fe.prototype.modInverse=wY;fe.prototype.pow=dY;fe.prototype.gcd=SY;fe.prototype.isProbablePrime=xY;});var no=P((dae,EN)=>{var di=Je();oi();mt();var bN=EN.exports=di.sha1=di.sha1||{};di.md.sha1=di.md.algorithms.sha1=bN;bN.create=function(){SN||RY();var e=null,t=di.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 i=n.messageLengthSize/4,s=0;s<i;++s)n.fullMessageLength.push(0);return t=di.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},n},n.start(),n.update=function(i,s){s==="utf8"&&(i=di.util.encodeUtf8(i));var a=i.length;n.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var o=n.fullMessageLength.length-1;o>=0;--o)n.fullMessageLength[o]+=a[1],a[1]=a[0]+(n.fullMessageLength[o]/4294967296>>>0),n.fullMessageLength[o]=n.fullMessageLength[o]>>>0,a[0]=a[1]/4294967296>>>0;return t.putBytes(i),_N(e,r,t),(t.read>2048||t.length()===0)&&t.compact(),n},n.digest=function(){var i=di.util.createBuffer();i.putBytes(t.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,a=s&n.blockLength-1;i.putBytes(gy.substr(0,n.blockLength-a));for(var o,c,l=n.fullMessageLength[0]*8,u=0;u<n.fullMessageLength.length-1;++u)o=n.fullMessageLength[u+1]*8,c=o/4294967296>>>0,l+=c,i.putInt32(l>>>0),l=o>>>0;i.putInt32(l);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};_N(f,r,i);var h=di.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h},n};var gy=null,SN=!1;function RY(){gy="\x80",gy+=di.util.fillString("\0",64),SN=!0;}function _N(e,t,r){for(var n,i,s,a,o,c,l,u,f=r.length();f>=64;){for(i=e.h0,s=e.h1,a=e.h2,o=e.h3,c=e.h4,u=0;u<16;++u)n=r.getInt32(),t[u]=n,l=o^s&(a^o),n=(i<<5|i>>>27)+l+c+1518500249+n,c=o,o=a,a=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<20;++u)n=t[u-3]^t[u-8]^t[u-14]^t[u-16],n=n<<1|n>>>31,t[u]=n,l=o^s&(a^o),n=(i<<5|i>>>27)+l+c+1518500249+n,c=o,o=a,a=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<32;++u)n=t[u-3]^t[u-8]^t[u-14]^t[u-16],n=n<<1|n>>>31,t[u]=n,l=s^a^o,n=(i<<5|i>>>27)+l+c+1859775393+n,c=o,o=a,a=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<40;++u)n=t[u-6]^t[u-16]^t[u-28]^t[u-32],n=n<<2|n>>>30,t[u]=n,l=s^a^o,n=(i<<5|i>>>27)+l+c+1859775393+n,c=o,o=a,a=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<60;++u)n=t[u-6]^t[u-16]^t[u-28]^t[u-32],n=n<<2|n>>>30,t[u]=n,l=s&a|o&(s^a),n=(i<<5|i>>>27)+l+c+2400959708+n,c=o,o=a,a=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<80;++u)n=t[u-6]^t[u-16]^t[u-28]^t[u-32],n=n<<2|n>>>30,t[u]=n,l=s^a^o,n=(i<<5|i>>>27)+l+c+3395469782+n,c=o,o=a,a=(s<<30|s>>>2)>>>0,s=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+s|0,e.h2=e.h2+a|0,e.h3=e.h3+o|0,e.h4=e.h4+c|0,f-=64;}}});var my=P((hae,CN)=>{var hi=Je();mt();xn();no();var wN=CN.exports=hi.pkcs1=hi.pkcs1||{};wN.encode_rsa_oaep=function(e,t,r){var n,i,s,a;typeof r=="string"?(n=r,i=arguments[3]||void 0,s=arguments[4]||void 0):r&&(n=r.label||void 0,i=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(a=r.mgf1.md)),s?s.start():s=hi.md.sha1.create(),a||(a=s);var o=Math.ceil(e.n.bitLength()/8),c=o-2*s.digestLength-2;if(t.length>c){var l=new Error("RSAES-OAEP input message length is too long.");throw l.length=t.length,l.maxLength=c,l}n||(n=""),s.update(n,"raw");for(var u=s.digest(),f="",h=c-t.length,p=0;p<h;p++)f+="\0";var m=u.getBytes()+f+""+t;if(!i)i=hi.random.getBytes(s.digestLength);else if(i.length!==s.digestLength){var l=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw l.seedLength=i.length,l.digestLength=s.digestLength,l}var _=Wf(i,o-s.digestLength-1,a),E=hi.util.xorBytes(m,_,m.length),w=Wf(E,s.digestLength,a),y=hi.util.xorBytes(i,w,i.length);return "\0"+y+E};wN.decode_rsa_oaep=function(e,t,r){var n,i,s;typeof r=="string"?(n=r,i=arguments[3]||void 0):r&&(n=r.label||void 0,i=r.md||void 0,r.mgf1&&r.mgf1.md&&(s=r.mgf1.md));var a=Math.ceil(e.n.bitLength()/8);if(t.length!==a){var E=new Error("RSAES-OAEP encoded message length is invalid.");throw E.length=t.length,E.expectedLength=a,E}if(i===void 0?i=hi.md.sha1.create():i.start(),s||(s=i),a<2*i.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");n||(n=""),i.update(n,"raw");for(var o=i.digest().getBytes(),c=t.charAt(0),l=t.substring(1,i.digestLength+1),u=t.substring(1+i.digestLength),f=Wf(u,i.digestLength,s),h=hi.util.xorBytes(l,f,l.length),p=Wf(h,a-i.digestLength-1,s),m=hi.util.xorBytes(u,p,u.length),_=m.substring(0,i.digestLength),E=c!=="\0",w=0;w<i.digestLength;++w)E|=o.charAt(w)!==_.charAt(w);for(var y=1,b=i.digestLength,N=i.digestLength;N<m.length;N++){var L=m.charCodeAt(N),V=L&1^1,X=y?65534:0;E|=L&X,y=y&V,b+=y;}if(E||m.charCodeAt(b)!==1)throw new Error("Invalid RSAES-OAEP padding.");return m.substring(b+1)};function Wf(e,t,r){r||(r=hi.md.sha1.create());for(var n="",i=Math.ceil(t/r.digestLength),s=0;s<i;++s){var a=String.fromCharCode(s>>24&255,s>>16&255,s>>8&255,s&255);r.start(),r.update(e+a),n+=r.digest().getBytes();}return n.substring(0,t)}});var vy=P((pae,yy)=>{var as=Je();mt();Vu();xn();(function(){if(as.prime){yy.exports=as.prime;return}var e=yy.exports=as.prime=as.prime||{},t=as.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new t(null);n.fromInt(30);var i=function(f,h){return f|h};e.generateProbablePrime=function(f,h,p){typeof h=="function"&&(p=h,h={}),h=h||{};var m=h.algorithm||"PRIMEINC";typeof m=="string"&&(m={name:m}),m.options=m.options||{};var _=h.prng||as.random,E={nextBytes:function(w){for(var y=_.getBytesSync(w.length),b=0;b<w.length;++b)w[b]=y.charCodeAt(b);}};if(m.name==="PRIMEINC")return s(f,E,m.options,p);throw new Error("Invalid prime generation algorithm: "+m.name)};function s(f,h,p,m){return "workers"in p?c(f,h,p,m):a(f,h,p,m)}function a(f,h,p,m){var _=l(f,h),E=0,w=u(_.bitLength());"millerRabinTests"in p&&(w=p.millerRabinTests);var y=10;"maxBlockTime"in p&&(y=p.maxBlockTime),o(_,f,h,E,w,y,m);}function o(f,h,p,m,_,E,w){var y=+new Date;do{if(f.bitLength()>h&&(f=l(h,p)),f.isProbablePrime(_))return w(null,f);f.dAddOffset(r[m++%8],0);}while(E<0||+new Date-y<E);as.util.setImmediate(function(){o(f,h,p,m,_,E,w);});}function c(f,h,p,m){if(typeof Worker>"u")return a(f,h,p,m);var _=l(f,h),E=p.workers,w=p.workLoad||100,y=w*30/8,b=p.workerScript||"forge/prime.worker.js";if(E===-1)return as.util.estimateCores(function(L,V){L&&(V=2),E=V-1,N();});N();function N(){E=Math.max(1,E);for(var L=[],V=0;V<E;++V)L[V]=new Worker(b);for(var X=E,V=0;V<E;++V)L[V].addEventListener("message",G);var z=!1;function G(ee){if(!z){--X;var U=ee.data;if(U.found){for(var ie=0;ie<L.length;++ie)L[ie].terminate();return z=!0,m(null,new t(U.prime,16))}_.bitLength()>f&&(_=l(f,h));var me=_.toString(16);ee.target.postMessage({hex:me,workLoad:w}),_.dAddOffset(y,0);}}}}function l(f,h){var p=new t(f,h),m=f-1;return p.testBit(m)||p.bitwiseTo(t.ONE.shiftLeft(m),i,p),p.dAddOffset(31-p.mod(n).byteValue(),0),p}function u(f){return f<=100?27:f<=150?18:f<=200?15:f<=250?12:f<=300?9:f<=350?8:f<=400?7:f<=500?6:f<=600?5:f<=800?4:f<=1250?3:2}})();});var Hu=P((gae,NN)=>{var Me=Je();zn();Vu();is();my();vy();xn();mt();typeof ht>"u"&&(ht=Me.jsbn.BigInteger);var ht,_y=Me.util.isNodejs?he("crypto"):null,Q=Me.asn1,An=Me.util;Me.pki=Me.pki||{};NN.exports=Me.pki.rsa=Me.rsa=Me.rsa||{};var Qe=Me.pki,IY=[6,4,2,4,2,4,6,2],PY={name:"PrivateKeyInfo",tagClass:Q.Class.UNIVERSAL,type:Q.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Q.Class.UNIVERSAL,type:Q.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Q.Class.UNIVERSAL,type:Q.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Q.Class.UNIVERSAL,type:Q.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Q.Class.UNIVERSAL,type:Q.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},NY={name:"RSAPrivateKey",tagClass:Q.Class.UNIVERSAL,type:Q.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:Q.Class.UNIVERSAL,type:Q.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:Q.Class.UNIVERSAL,type:Q.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:Q.Class.UNIVERSAL,type:Q.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:Q.Class.UNIVERSAL,type:Q.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:Q.Class.UNIVERSAL,type:Q.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:Q.Class.UNIVERSAL,type:Q.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:Q.Class.UNIVERSAL,type:Q.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:Q.Class.UNIVERSAL,type:Q.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:Q.Class.UNIVERSAL,type:Q.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},DY={name:"RSAPublicKey",tagClass:Q.Class.UNIVERSAL,type:Q.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:Q.Class.UNIVERSAL,type:Q.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:Q.Class.UNIVERSAL,type:Q.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},kY=Me.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Q.Class.UNIVERSAL,type:Q.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Q.Class.UNIVERSAL,type:Q.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Q.Class.UNIVERSAL,type:Q.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:Q.Class.UNIVERSAL,type:Q.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:Q.Class.UNIVERSAL,type:Q.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},OY={name:"DigestInfo",tagClass:Q.Class.UNIVERSAL,type:Q.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:Q.Class.UNIVERSAL,type:Q.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:Q.Class.UNIVERSAL,type:Q.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:Q.Class.UNIVERSAL,type:Q.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:Q.Class.UNIVERSAL,type:Q.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},LY=function(e){var t;if(e.algorithm in Qe.oids)t=Qe.oids[e.algorithm];else {var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}var n=Q.oidToDer(t).getBytes(),i=Q.create(Q.Class.UNIVERSAL,Q.Type.SEQUENCE,!0,[]),s=Q.create(Q.Class.UNIVERSAL,Q.Type.SEQUENCE,!0,[]);s.value.push(Q.create(Q.Class.UNIVERSAL,Q.Type.OID,!1,n)),s.value.push(Q.create(Q.Class.UNIVERSAL,Q.Type.NULL,!1,""));var a=Q.create(Q.Class.UNIVERSAL,Q.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(s),i.value.push(a),Q.toDer(i).getBytes()},IN=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);t.dP||(t.dP=t.d.mod(t.p.subtract(ht.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(ht.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));var n;do n=new ht(Me.util.bytesToHex(Me.random.getBytes(t.n.bitLength()/8)),16);while(n.compareTo(t.n)>=0||!n.gcd(t.n).equals(ht.ONE));e=e.multiply(n.modPow(t.e,t.n)).mod(t.n);for(var i=e.mod(t.p).modPow(t.dP,t.p),s=e.mod(t.q).modPow(t.dQ,t.q);i.compareTo(s)<0;)i=i.add(t.p);var a=i.subtract(s).multiply(t.qInv).mod(t.p).multiply(t.q).add(s);return a=a.multiply(n.modInverse(t.n)).mod(t.n),a};Qe.rsa.encrypt=function(e,t,r){var n=r,i,s=Math.ceil(t.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,i=PN(e,t,r)):(i=Me.util.createBuffer(),i.putBytes(e));for(var a=new ht(i.toHex(),16),o=IN(a,t,n),c=o.toString(16),l=Me.util.createBuffer(),u=s-Math.ceil(c.length/2);u>0;)l.putByte(0),--u;return l.putBytes(Me.util.hexToBytes(c)),l.getBytes()};Qe.rsa.decrypt=function(e,t,r,n){var i=Math.ceil(t.n.bitLength()/8);if(e.length!==i){var s=new Error("Encrypted message length is invalid.");throw s.length=e.length,s.expected=i,s}var a=new ht(Me.util.createBuffer(e).toHex(),16);if(a.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var o=IN(a,t,r),c=o.toString(16),l=Me.util.createBuffer(),u=i-Math.ceil(c.length/2);u>0;)l.putByte(0),--u;return l.putBytes(Me.util.hexToBytes(c)),n!==!1?Kf(l.getBytes(),t,r):l.getBytes()};Qe.rsa.createKeyPairGenerationState=function(e,t,r){typeof e=="string"&&(e=parseInt(e,10)),e=e||2048,r=r||{};var n=r.prng||Me.random,i={nextBytes:function(o){for(var c=n.getBytesSync(o.length),l=0;l<o.length;++l)o[l]=c.charCodeAt(l);}},s=r.algorithm||"PRIMEINC",a;if(s==="PRIMEINC")a={algorithm:s,state:0,bits:e,rng:i,eInt:t||65537,e:new ht(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null},a.e.fromInt(a.eInt);else throw new Error("Invalid key generation algorithm: "+s);return a};Qe.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new ht(null);r.fromInt(30);for(var n=0,i=function(f,h){return f|h},s=+new Date,a,o=0;e.keys===null&&(t<=0||o<t);){if(e.state===0){var c=e.p===null?e.pBits:e.qBits,l=c-1;e.pqState===0?(e.num=new ht(c,e.rng),e.num.testBit(l)||e.num.bitwiseTo(ht.ONE.shiftLeft(l),i,e.num),e.num.dAddOffset(31-e.num.mod(r).byteValue(),0),n=0,++e.pqState):e.pqState===1?e.num.bitLength()>c?e.pqState=0:e.num.isProbablePrime(FY(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(IY[n++%8],0):e.pqState===2?e.pqState=e.num.subtract(ht.ONE).gcd(e.e).compareTo(ht.ONE)===0?3:0:e.pqState===3&&(e.pqState=0,e.p===null?e.p=e.num:e.q=e.num,e.p!==null&&e.q!==null&&++e.state,e.num=null);}else if(e.state===1)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(e.state===2)e.p1=e.p.subtract(ht.ONE),e.q1=e.q.subtract(ht.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(e.state===3)e.phi.gcd(e.e).compareTo(ht.ONE)===0?++e.state:(e.p=null,e.q=null,e.state=0);else if(e.state===4)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(e.state===5){var u=e.e.modInverse(e.phi);e.keys={privateKey:Qe.rsa.setPrivateKey(e.n,e.e,u,e.p,e.q,u.mod(e.p1),u.mod(e.q1),e.q.modInverse(e.p)),publicKey:Qe.rsa.setPublicKey(e.n,e.e)};}a=+new Date,o+=a-s,s=a;}return e.keys!==null};Qe.rsa.generateKeyPair=function(e,t,r,n){if(arguments.length===1?typeof e=="object"?(r=e,e=void 0):typeof e=="function"&&(n=e,e=void 0):arguments.length===2?typeof e=="number"?typeof t=="function"?(n=t,t=void 0):typeof t!="number"&&(r=t,t=void 0):(r=e,n=t,e=void 0,t=void 0):arguments.length===3&&(typeof t=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=t,t=void 0)),r=r||{},e===void 0&&(e=r.bits||2048),t===void 0&&(t=r.e||65537),!Me.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(t===65537||t===3)){if(n){if(xN("generateKeyPair"))return _y.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(o,c,l){if(o)return n(o);n(null,{privateKey:Qe.privateKeyFromPem(l),publicKey:Qe.publicKeyFromPem(c)});});if(TN("generateKey")&&TN("exportKey"))return An.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:RN(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(o){return An.globalScope.crypto.subtle.exportKey("pkcs8",o.privateKey)}).then(void 0,function(o){n(o);}).then(function(o){if(o){var c=Qe.privateKeyFromAsn1(Q.fromDer(Me.util.createBuffer(o)));n(null,{privateKey:c,publicKey:Qe.setRsaPublicKey(c.n,c.e)});}});if(AN("generateKey")&&AN("exportKey")){var i=An.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:RN(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(o){var c=o.target.result,l=An.globalScope.msCrypto.subtle.exportKey("pkcs8",c.privateKey);l.oncomplete=function(u){var f=u.target.result,h=Qe.privateKeyFromAsn1(Q.fromDer(Me.util.createBuffer(f)));n(null,{privateKey:h,publicKey:Qe.setRsaPublicKey(h.n,h.e)});},l.onerror=function(u){n(u);};},i.onerror=function(o){n(o);};return}}else if(xN("generateKeyPairSync")){var s=_y.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return {privateKey:Qe.privateKeyFromPem(s.privateKey),publicKey:Qe.publicKeyFromPem(s.publicKey)}}}var a=Qe.rsa.createKeyPairGenerationState(e,t,r);if(!n)return Qe.rsa.stepKeyPairGenerationState(a,0),a.keys;BY(a,r,n);};Qe.setRsaPublicKey=Qe.rsa.setPublicKey=function(e,t){var r={n:e,e:t};return r.encrypt=function(n,i,s){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(o,c,l){return PN(o,c,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(o,c){return Me.pkcs1.encode_rsa_oaep(c,o,s)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(o){return o}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var a=i.encode(n,r,!0);return Qe.rsa.encrypt(a,r,!0)},r.verify=function(n,i,s,a){typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSASSA-PKCS1-V1_5"),a===void 0&&(a={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in a||(a._parseAllDigestBytes=!0),s==="RSASSA-PKCS1-V1_5"?s={verify:function(c,l){l=Kf(l,r,!0);var u=Q.fromDer(l,{parseAllBytes:a._parseAllDigestBytes}),f={},h=[];if(!Q.validate(u,OY,f,h)){var p=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw p.errors=h,p}var m=Q.derToOid(f.algorithmIdentifier);if(!(m===Me.oids.md2||m===Me.oids.md5||m===Me.oids.sha1||m===Me.oids.sha224||m===Me.oids.sha256||m===Me.oids.sha384||m===Me.oids.sha512||m===Me.oids["sha512-224"]||m===Me.oids["sha512-256"])){var p=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw p.oid=m,p}if((m===Me.oids.md2||m===Me.oids.md5)&&!("parameters"in f))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return c===f.digest}}:(s==="NONE"||s==="NULL"||s===null)&&(s={verify:function(c,l){return l=Kf(l,r,!0),c===l}});var o=Qe.rsa.decrypt(i,r,!0,!1);return s.verify(n,o,r.n.bitLength())},r};Qe.setRsaPrivateKey=Qe.rsa.setPrivateKey=function(e,t,r,n,i,s,a,o){var c={n:e,e:t,d:r,p:n,q:i,dP:s,dQ:a,qInv:o};return c.decrypt=function(l,u,f){typeof u=="string"?u=u.toUpperCase():u===void 0&&(u="RSAES-PKCS1-V1_5");var h=Qe.rsa.decrypt(l,c,!1,!1);if(u==="RSAES-PKCS1-V1_5")u={decode:Kf};else if(u==="RSA-OAEP"||u==="RSAES-OAEP")u={decode:function(p,m){return Me.pkcs1.decode_rsa_oaep(m,p,f)}};else if(["RAW","NONE","NULL",null].indexOf(u)!==-1)u={decode:function(p){return p}};else throw new Error('Unsupported encryption scheme: "'+u+'".');return u.decode(h,c,!1)},c.sign=function(l,u){var f=!1;typeof u=="string"&&(u=u.toUpperCase()),u===void 0||u==="RSASSA-PKCS1-V1_5"?(u={encode:LY},f=1):(u==="NONE"||u==="NULL"||u===null)&&(u={encode:function(){return l}},f=1);var h=u.encode(l,c.n.bitLength());return Qe.rsa.encrypt(h,c,f)},c};Qe.wrapRsaPrivateKey=function(e){return Q.create(Q.Class.UNIVERSAL,Q.Type.SEQUENCE,!0,[Q.create(Q.Class.UNIVERSAL,Q.Type.INTEGER,!1,Q.integerToDer(0).getBytes()),Q.create(Q.Class.UNIVERSAL,Q.Type.SEQUENCE,!0,[Q.create(Q.Class.UNIVERSAL,Q.Type.OID,!1,Q.oidToDer(Qe.oids.rsaEncryption).getBytes()),Q.create(Q.Class.UNIVERSAL,Q.Type.NULL,!1,"")]),Q.create(Q.Class.UNIVERSAL,Q.Type.OCTETSTRING,!1,Q.toDer(e).getBytes())])};Qe.privateKeyFromAsn1=function(e){var t={},r=[];if(Q.validate(e,PY,t,r)&&(e=Q.fromDer(Me.util.createBuffer(t.privateKey))),t={},r=[],!Q.validate(e,NY,t,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var i,s,a,o,c,l,u,f;return i=Me.util.createBuffer(t.privateKeyModulus).toHex(),s=Me.util.createBuffer(t.privateKeyPublicExponent).toHex(),a=Me.util.createBuffer(t.privateKeyPrivateExponent).toHex(),o=Me.util.createBuffer(t.privateKeyPrime1).toHex(),c=Me.util.createBuffer(t.privateKeyPrime2).toHex(),l=Me.util.createBuffer(t.privateKeyExponent1).toHex(),u=Me.util.createBuffer(t.privateKeyExponent2).toHex(),f=Me.util.createBuffer(t.privateKeyCoefficient).toHex(),Qe.setRsaPrivateKey(new ht(i,16),new ht(s,16),new ht(a,16),new ht(o,16),new ht(c,16),new ht(l,16),new ht(u,16),new ht(f,16))};Qe.privateKeyToAsn1=Qe.privateKeyToRSAPrivateKey=function(e){return Q.create(Q.Class.UNIVERSAL,Q.Type.SEQUENCE,!0,[Q.create(Q.Class.UNIVERSAL,Q.Type.INTEGER,!1,Q.integerToDer(0).getBytes()),Q.create(Q.Class.UNIVERSAL,Q.Type.INTEGER,!1,pi(e.n)),Q.create(Q.Class.UNIVERSAL,Q.Type.INTEGER,!1,pi(e.e)),Q.create(Q.Class.UNIVERSAL,Q.Type.INTEGER,!1,pi(e.d)),Q.create(Q.Class.UNIVERSAL,Q.Type.INTEGER,!1,pi(e.p)),Q.create(Q.Class.UNIVERSAL,Q.Type.INTEGER,!1,pi(e.q)),Q.create(Q.Class.UNIVERSAL,Q.Type.INTEGER,!1,pi(e.dP)),Q.create(Q.Class.UNIVERSAL,Q.Type.INTEGER,!1,pi(e.dQ)),Q.create(Q.Class.UNIVERSAL,Q.Type.INTEGER,!1,pi(e.qInv))])};Qe.publicKeyFromAsn1=function(e){var t={},r=[];if(Q.validate(e,kY,t,r)){var n=Q.derToOid(t.publicKeyOid);if(n!==Qe.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=n,i}e=t.rsaPublicKey;}if(r=[],!Q.validate(e,DY,t,r)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=r,i}var s=Me.util.createBuffer(t.publicKeyModulus).toHex(),a=Me.util.createBuffer(t.publicKeyExponent).toHex();return Qe.setRsaPublicKey(new ht(s,16),new ht(a,16))};Qe.publicKeyToAsn1=Qe.publicKeyToSubjectPublicKeyInfo=function(e){return Q.create(Q.Class.UNIVERSAL,Q.Type.SEQUENCE,!0,[Q.create(Q.Class.UNIVERSAL,Q.Type.SEQUENCE,!0,[Q.create(Q.Class.UNIVERSAL,Q.Type.OID,!1,Q.oidToDer(Qe.oids.rsaEncryption).getBytes()),Q.create(Q.Class.UNIVERSAL,Q.Type.NULL,!1,"")]),Q.create(Q.Class.UNIVERSAL,Q.Type.BITSTRING,!1,[Qe.publicKeyToRSAPublicKey(e)])])};Qe.publicKeyToRSAPublicKey=function(e){return Q.create(Q.Class.UNIVERSAL,Q.Type.SEQUENCE,!0,[Q.create(Q.Class.UNIVERSAL,Q.Type.INTEGER,!1,pi(e.n)),Q.create(Q.Class.UNIVERSAL,Q.Type.INTEGER,!1,pi(e.e))])};function PN(e,t,r){var n=Me.util.createBuffer(),i=Math.ceil(t.n.bitLength()/8);if(e.length>i-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=e.length,s.max=i-11,s}n.putByte(0),n.putByte(r);var a=i-3-e.length,o;if(r===0||r===1){o=r===0?0:255;for(var c=0;c<a;++c)n.putByte(o);}else for(;a>0;){for(var l=0,u=Me.random.getBytes(a),c=0;c<a;++c)o=u.charCodeAt(c),o===0?++l:n.putByte(o);a=l;}return n.putByte(0),n.putBytes(e),n}function Kf(e,t,r,n){var i=Math.ceil(t.n.bitLength()/8),s=Me.util.createBuffer(e),a=s.getByte(),o=s.getByte();if(a!==0||r&&o!==0&&o!==1||!r&&o!=2||r&&o===0&&typeof n>"u")throw new Error("Encryption block is invalid.");var c=0;if(o===0){c=i-3-n;for(var l=0;l<c;++l)if(s.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(o===1)for(c=0;s.length()>1;){if(s.getByte()!==255){--s.read;break}++c;}else if(o===2)for(c=0;s.length()>1;){if(s.getByte()===0){--s.read;break}++c;}var u=s.getByte();if(u!==0||c!==i-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function BY(e,t,r){typeof t=="function"&&(r=t,t={}),t=t||{};var n={algorithm:{name:t.algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};"prng"in t&&(n.prng=t.prng),i();function i(){s(e.pBits,function(o,c){if(o)return r(o);if(e.p=c,e.q!==null)return a(o,e.q);s(e.qBits,a);});}function s(o,c){Me.prime.generateProbablePrime(o,n,c);}function a(o,c){if(o)return r(o);if(e.q=c,e.p.compareTo(e.q)<0){var l=e.p;e.p=e.q,e.q=l;}if(e.p.subtract(ht.ONE).gcd(e.e).compareTo(ht.ONE)!==0){e.p=null,i();return}if(e.q.subtract(ht.ONE).gcd(e.e).compareTo(ht.ONE)!==0){e.q=null,s(e.qBits,a);return}if(e.p1=e.p.subtract(ht.ONE),e.q1=e.q.subtract(ht.ONE),e.phi=e.p1.multiply(e.q1),e.phi.gcd(e.e).compareTo(ht.ONE)!==0){e.p=e.q=null,i();return}if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits){e.q=null,s(e.qBits,a);return}var u=e.e.modInverse(e.phi);e.keys={privateKey:Qe.rsa.setPrivateKey(e.n,e.e,u,e.p,e.q,u.mod(e.p1),u.mod(e.q1),e.q.modInverse(e.p)),publicKey:Qe.rsa.setPublicKey(e.n,e.e)},r(null,e.keys);}}function pi(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=Me.util.hexToBytes(t);return r.length>1&&(r.charCodeAt(0)===0&&!(r.charCodeAt(1)&128)||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}function FY(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function xN(e){return Me.util.isNodejs&&typeof _y[e]=="function"}function TN(e){return typeof An.globalScope<"u"&&typeof An.globalScope.crypto=="object"&&typeof An.globalScope.crypto.subtle=="object"&&typeof An.globalScope.crypto.subtle[e]=="function"}function AN(e){return typeof An.globalScope<"u"&&typeof An.globalScope.msCrypto=="object"&&typeof An.globalScope.msCrypto.subtle=="object"&&typeof An.globalScope.msCrypto.subtle[e]=="function"}function RN(e){for(var t=Me.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r}});var by=P((mae,BN)=>{var Re=Je();ns();zn();ju();oi();is();jf();Qs();xn();fy();Hu();mt();var te=Re.asn1,Xe=Re.pki=Re.pki||{};BN.exports=Xe.pbe=Re.pbe=Re.pbe||{};var Js=Xe.oids,MY={name:"EncryptedPrivateKeyInfo",tagClass:te.Class.UNIVERSAL,type:te.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:te.Class.UNIVERSAL,type:te.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:te.Class.UNIVERSAL,type:te.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:te.Class.UNIVERSAL,type:te.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:te.Class.UNIVERSAL,type:te.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},qY={name:"PBES2Algorithms",tagClass:te.Class.UNIVERSAL,type:te.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:te.Class.UNIVERSAL,type:te.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:te.Class.UNIVERSAL,type:te.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:te.Class.UNIVERSAL,type:te.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:te.Class.UNIVERSAL,type:te.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:te.Class.UNIVERSAL,type:te.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:te.Class.UNIVERSAL,type:te.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:te.Class.UNIVERSAL,type:te.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:te.Class.UNIVERSAL,type:te.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:te.Class.UNIVERSAL,type:te.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:te.Class.UNIVERSAL,type:te.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:te.Class.UNIVERSAL,type:te.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},UY={name:"pkcs-12PbeParams",tagClass:te.Class.UNIVERSAL,type:te.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:te.Class.UNIVERSAL,type:te.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:te.Class.UNIVERSAL,type:te.Type.INTEGER,constructed:!1,capture:"iterations"}]};Xe.encryptPrivateKeyInfo=function(e,t,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=Re.random.getBytesSync(r.saltSize),i=r.count,s=te.integerToDer(i),a,o,c;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var l,u,f;switch(r.algorithm){case"aes128":a=16,l=16,u=Js["aes128-CBC"],f=Re.aes.createEncryptionCipher;break;case"aes192":a=24,l=16,u=Js["aes192-CBC"],f=Re.aes.createEncryptionCipher;break;case"aes256":a=32,l=16,u=Js["aes256-CBC"],f=Re.aes.createEncryptionCipher;break;case"des":a=8,l=8,u=Js.desCBC,f=Re.des.createEncryptionCipher;break;default:var h=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw h.algorithm=r.algorithm,h}var p="hmacWith"+r.prfAlgorithm.toUpperCase(),m=LN(p),_=Re.pkcs5.pbkdf2(t,n,i,a,m),E=Re.random.getBytesSync(l),w=f(_);w.start(E),w.update(te.toDer(e)),w.finish(),c=w.output.getBytes();var y=jY(n,s,a,p);o=te.create(te.Class.UNIVERSAL,te.Type.SEQUENCE,!0,[te.create(te.Class.UNIVERSAL,te.Type.OID,!1,te.oidToDer(Js.pkcs5PBES2).getBytes()),te.create(te.Class.UNIVERSAL,te.Type.SEQUENCE,!0,[te.create(te.Class.UNIVERSAL,te.Type.SEQUENCE,!0,[te.create(te.Class.UNIVERSAL,te.Type.OID,!1,te.oidToDer(Js.pkcs5PBKDF2).getBytes()),y]),te.create(te.Class.UNIVERSAL,te.Type.SEQUENCE,!0,[te.create(te.Class.UNIVERSAL,te.Type.OID,!1,te.oidToDer(u).getBytes()),te.create(te.Class.UNIVERSAL,te.Type.OCTETSTRING,!1,E)])])]);}else if(r.algorithm==="3des"){a=24;var b=new Re.util.ByteBuffer(n),_=Xe.pbe.generatePkcs12Key(t,b,1,i,a),E=Xe.pbe.generatePkcs12Key(t,b,2,i,a),w=Re.des.createEncryptionCipher(_);w.start(E),w.update(te.toDer(e)),w.finish(),c=w.output.getBytes(),o=te.create(te.Class.UNIVERSAL,te.Type.SEQUENCE,!0,[te.create(te.Class.UNIVERSAL,te.Type.OID,!1,te.oidToDer(Js["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),te.create(te.Class.UNIVERSAL,te.Type.SEQUENCE,!0,[te.create(te.Class.UNIVERSAL,te.Type.OCTETSTRING,!1,n),te.create(te.Class.UNIVERSAL,te.Type.INTEGER,!1,s.getBytes())])]);}else {var h=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw h.algorithm=r.algorithm,h}var N=te.create(te.Class.UNIVERSAL,te.Type.SEQUENCE,!0,[o,te.create(te.Class.UNIVERSAL,te.Type.OCTETSTRING,!1,c)]);return N};Xe.decryptPrivateKeyInfo=function(e,t){var r=null,n={},i=[];if(!te.validate(e,MY,n,i)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var a=te.derToOid(n.encryptionOid),o=Xe.pbe.getCipher(a,n.encryptionParams,t),c=Re.util.createBuffer(n.encryptedData);return o.update(c),o.finish()&&(r=te.fromDer(o.output)),r};Xe.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:te.toDer(e).getBytes()};return Re.pem.encode(r,{maxline:t})};Xe.encryptedPrivateKeyFromPem=function(e){var t=Re.pem.decode(e)[0];if(t.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=t.type,r}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return te.fromDer(t.body)};Xe.encryptRsaPrivateKey=function(e,t,r){if(r=r||{},!r.legacy){var n=Xe.wrapRsaPrivateKey(Xe.privateKeyToAsn1(e));return n=Xe.encryptPrivateKeyInfo(n,t,r),Xe.encryptedPrivateKeyToPem(n)}var i,s,a,o;switch(r.algorithm){case"aes128":i="AES-128-CBC",a=16,s=Re.random.getBytesSync(16),o=Re.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",a=24,s=Re.random.getBytesSync(16),o=Re.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",a=32,s=Re.random.getBytesSync(16),o=Re.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",a=24,s=Re.random.getBytesSync(8),o=Re.des.createEncryptionCipher;break;case"des":i="DES-CBC",a=8,s=Re.random.getBytesSync(8),o=Re.des.createEncryptionCipher;break;default:var c=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw c.algorithm=r.algorithm,c}var l=Re.pbe.opensslDeriveBytes(t,s.substr(0,8),a),u=o(l);u.start(s),u.update(te.toDer(Xe.privateKeyToAsn1(e))),u.finish();var f={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:Re.util.bytesToHex(s).toUpperCase()},body:u.output.getBytes()};return Re.pem.encode(f)};Xe.decryptRsaPrivateKey=function(e,t){var r=null,n=Re.pem.decode(e)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(n.procType&&n.procType.type==="ENCRYPTED"){var s,a;switch(n.dekInfo.algorithm){case"DES-CBC":s=8,a=Re.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,a=Re.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,a=Re.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,a=Re.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,a=Re.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,a=function(f){return Re.rc2.createDecryptionCipher(f,40)};break;case"RC2-64-CBC":s=8,a=function(f){return Re.rc2.createDecryptionCipher(f,64)};break;case"RC2-128-CBC":s=16,a=function(f){return Re.rc2.createDecryptionCipher(f,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw i.algorithm=n.dekInfo.algorithm,i}var o=Re.util.hexToBytes(n.dekInfo.parameters),c=Re.pbe.opensslDeriveBytes(t,o.substr(0,8),s),l=a(c);if(l.start(o),l.update(Re.util.createBuffer(n.body)),l.finish())r=l.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=Xe.decryptPrivateKeyInfo(te.fromDer(r),t):r=te.fromDer(r),r!==null&&(r=Xe.privateKeyFromAsn1(r)),r};Xe.pbe.generatePkcs12Key=function(e,t,r,n,i,s){var a,o;if(typeof s>"u"||s===null){if(!("sha1"in Re.md))throw new Error('"sha1" hash algorithm unavailable.');s=Re.md.sha1.create();}var c=s.digestLength,l=s.blockLength,u=new Re.util.ByteBuffer,f=new Re.util.ByteBuffer;if(e!=null){for(o=0;o<e.length;o++)f.putInt16(e.charCodeAt(o));f.putInt16(0);}var h=f.length(),p=t.length(),m=new Re.util.ByteBuffer;m.fillWithByte(r,l);var _=l*Math.ceil(p/l),E=new Re.util.ByteBuffer;for(o=0;o<_;o++)E.putByte(t.at(o%p));var w=l*Math.ceil(h/l),y=new Re.util.ByteBuffer;for(o=0;o<w;o++)y.putByte(f.at(o%h));var b=E;b.putBuffer(y);for(var N=Math.ceil(i/c),L=1;L<=N;L++){var V=new Re.util.ByteBuffer;V.putBytes(m.bytes()),V.putBytes(b.bytes());for(var X=0;X<n;X++)s.start(),s.update(V.getBytes()),V=s.digest();var z=new Re.util.ByteBuffer;for(o=0;o<l;o++)z.putByte(V.at(o%c));var G=Math.ceil(p/l)+Math.ceil(h/l),ee=new Re.util.ByteBuffer;for(a=0;a<G;a++){var U=new Re.util.ByteBuffer(b.getBytes(l)),ie=511;for(o=z.length()-1;o>=0;o--)ie=ie>>8,ie+=z.at(o)+U.at(o),U.setAt(o,ie&255);ee.putBuffer(U);}b=ee,u.putBuffer(V);}return u.truncate(u.length()-i),u};Xe.pbe.getCipher=function(e,t,r){switch(e){case Xe.oids.pkcs5PBES2:return Xe.pbe.getCipherForPBES2(e,t,r);case Xe.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case Xe.oids["pbewithSHAAnd40BitRC2-CBC"]:return Xe.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};Xe.pbe.getCipherForPBES2=function(e,t,r){var n={},i=[];if(!te.validate(t,qY,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}if(e=te.derToOid(n.kdfOid),e!==Xe.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=e,s.supportedOids=["pkcs5PBKDF2"],s}if(e=te.derToOid(n.encOid),e!==Xe.oids["aes128-CBC"]&&e!==Xe.oids["aes192-CBC"]&&e!==Xe.oids["aes256-CBC"]&&e!==Xe.oids["des-EDE3-CBC"]&&e!==Xe.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=e,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var a=n.kdfSalt,o=Re.util.createBuffer(n.kdfIterationCount);o=o.getInt(o.length()<<3);var c,l;switch(Xe.oids[e]){case"aes128-CBC":c=16,l=Re.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,l=Re.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,l=Re.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,l=Re.des.createDecryptionCipher;break;case"desCBC":c=8,l=Re.des.createDecryptionCipher;break}var u=ON(n.prfOid),f=Re.pkcs5.pbkdf2(r,a,o,c,u),h=n.encIv,p=l(f);return p.start(h),p};Xe.pbe.getCipherForPKCS12PBE=function(e,t,r){var n={},i=[];if(!te.validate(t,UY,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var a=Re.util.createBuffer(n.salt),o=Re.util.createBuffer(n.iterations);o=o.getInt(o.length()<<3);var c,l,u;switch(e){case Xe.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,l=8,u=Re.des.startDecrypting;break;case Xe.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,l=8,u=function(_,E){var w=Re.rc2.createDecryptionCipher(_,40);return w.start(E,null),w};break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=e,s}var f=ON(n.prfOid),h=Xe.pbe.generatePkcs12Key(r,a,1,o,c,f);f.start();var p=Xe.pbe.generatePkcs12Key(r,a,2,o,l,f);return u(h,p)};Xe.pbe.opensslDeriveBytes=function(e,t,r,n){if(typeof n>"u"||n===null){if(!("md5"in Re.md))throw new Error('"md5" hash algorithm unavailable.');n=Re.md.md5.create();}t===null&&(t="");for(var i=[kN(n,e+t)],s=16,a=1;s<r;++a,s+=16)i.push(kN(n,i[a-1]+e+t));return i.join("").substr(0,r)};function kN(e,t){return e.start().update(t).digest().getBytes()}function ON(e){var t;if(!e)t="hmacWithSHA1";else if(t=Xe.oids[te.derToOid(e)],!t){var r=new Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}return LN(t)}function LN(e){var t=Re.md;switch(e){case"hmacWithSHA224":t=Re.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}function jY(e,t,r,n){var i=te.create(te.Class.UNIVERSAL,te.Type.SEQUENCE,!0,[te.create(te.Class.UNIVERSAL,te.Type.OCTETSTRING,!1,e),te.create(te.Class.UNIVERSAL,te.Type.INTEGER,!1,t.getBytes())]);return n!=="hmacWithSHA1"&&i.value.push(te.create(te.Class.UNIVERSAL,te.Type.INTEGER,!1,Re.util.hexToBytes(r.toString(16))),te.create(te.Class.UNIVERSAL,te.Type.SEQUENCE,!0,[te.create(te.Class.UNIVERSAL,te.Type.OID,!1,te.oidToDer(Xe.oids[n]).getBytes()),te.create(te.Class.UNIVERSAL,te.Type.NULL,!1,"")])),i}});var Sy=P((yae,qN)=>{var io=Je();zn();mt();var xe=io.asn1,so=qN.exports=io.pkcs7asn1=io.pkcs7asn1||{};io.pkcs7=io.pkcs7||{};io.pkcs7.asn1=so;var FN={name:"ContentInfo",tagClass:xe.Class.UNIVERSAL,type:xe.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:xe.Class.UNIVERSAL,type:xe.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:xe.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};so.contentInfoValidator=FN;var MN={name:"EncryptedContentInfo",tagClass:xe.Class.UNIVERSAL,type:xe.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:xe.Class.UNIVERSAL,type:xe.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:xe.Class.UNIVERSAL,type:xe.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:xe.Class.UNIVERSAL,type:xe.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:xe.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:xe.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};so.envelopedDataValidator={name:"EnvelopedData",tagClass:xe.Class.UNIVERSAL,type:xe.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:xe.Class.UNIVERSAL,type:xe.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:xe.Class.UNIVERSAL,type:xe.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(MN)};so.encryptedDataValidator={name:"EncryptedData",tagClass:xe.Class.UNIVERSAL,type:xe.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:xe.Class.UNIVERSAL,type:xe.Type.INTEGER,constructed:!1,capture:"version"}].concat(MN)};var $Y={name:"SignerInfo",tagClass:xe.Class.UNIVERSAL,type:xe.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:xe.Class.UNIVERSAL,type:xe.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:xe.Class.UNIVERSAL,type:xe.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:xe.Class.UNIVERSAL,type:xe.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:xe.Class.UNIVERSAL,type:xe.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:xe.Class.UNIVERSAL,type:xe.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:xe.Class.UNIVERSAL,type:xe.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:xe.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:xe.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:xe.Class.UNIVERSAL,type:xe.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:xe.Class.UNIVERSAL,type:xe.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:xe.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};so.signedDataValidator={name:"SignedData",tagClass:xe.Class.UNIVERSAL,type:xe.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:xe.Class.UNIVERSAL,type:xe.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:xe.Class.UNIVERSAL,type:xe.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},FN,{name:"SignedData.Certificates",tagClass:xe.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:xe.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:xe.Class.UNIVERSAL,type:xe.Type.SET,capture:"signerInfos",optional:!0,value:[$Y]}]};so.recipientInfoValidator={name:"RecipientInfo",tagClass:xe.Class.UNIVERSAL,type:xe.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:xe.Class.UNIVERSAL,type:xe.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:xe.Class.UNIVERSAL,type:xe.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:xe.Class.UNIVERSAL,type:xe.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:xe.Class.UNIVERSAL,type:xe.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:xe.Class.UNIVERSAL,type:xe.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:xe.Class.UNIVERSAL,type:xe.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:xe.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:xe.Class.UNIVERSAL,type:xe.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]};});var Ey=P((vae,UN)=>{var ea=Je();mt();ea.mgf=ea.mgf||{};var VY=UN.exports=ea.mgf.mgf1=ea.mgf1=ea.mgf1||{};VY.create=function(e){var t={generate:function(r,n){for(var i=new ea.util.ByteBuffer,s=Math.ceil(n/e.digestLength),a=0;a<s;a++){var o=new ea.util.ByteBuffer;o.putInt32(a),e.start(),e.update(r+o.getBytes()),i.putBuffer(e.digest());}return i.truncate(i.length()-n),i.getBytes()}};return t};});var $N=P((_ae,jN)=>{var zf=Je();Ey();jN.exports=zf.mgf=zf.mgf||{};zf.mgf.mgf1=zf.mgf1;});var Gf=P((bae,VN)=>{var ta=Je();xn();mt();var HY=VN.exports=ta.pss=ta.pss||{};HY.create=function(e){arguments.length===3&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t=e.md,r=e.mgf,n=t.digestLength,i=e.salt||null;typeof i=="string"&&(i=ta.util.createBuffer(i));var s;if("saltLength"in e)s=e.saltLength;else if(i!==null)s=i.length();else throw new Error("Salt length not specified or specific salt not given.");if(i!==null&&i.length()!==s)throw new Error("Given salt length does not match length of given salt.");var a=e.prng||ta.random,o={};return o.encode=function(c,l){var u,f=l-1,h=Math.ceil(f/8),p=c.digest().getBytes();if(h<n+s+2)throw new Error("Message is too long to encrypt.");var m;i===null?m=a.getBytesSync(s):m=i.bytes();var _=new ta.util.ByteBuffer;_.fillWithByte(0,8),_.putBytes(p),_.putBytes(m),t.start(),t.update(_.getBytes());var E=t.digest().getBytes(),w=new ta.util.ByteBuffer;w.fillWithByte(0,h-s-n-2),w.putByte(1),w.putBytes(m);var y=w.getBytes(),b=h-n-1,N=r.generate(E,b),L="";for(u=0;u<b;u++)L+=String.fromCharCode(y.charCodeAt(u)^N.charCodeAt(u));var V=65280>>8*h-f&255;return L=String.fromCharCode(L.charCodeAt(0)&~V)+L.substr(1),L+E+"\xBC"},o.verify=function(c,l,u){var f,h=u-1,p=Math.ceil(h/8);if(l=l.substr(-p),p<n+s+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(l.charCodeAt(p-1)!==188)throw new Error("Encoded message does not end in 0xBC.");var m=p-n-1,_=l.substr(0,m),E=l.substr(m,n),w=65280>>8*p-h&255;if(_.charCodeAt(0)&w)throw new Error("Bits beyond keysize not zero as expected.");var y=r.generate(E,m),b="";for(f=0;f<m;f++)b+=String.fromCharCode(_.charCodeAt(f)^y.charCodeAt(f));b=String.fromCharCode(b.charCodeAt(0)&~w)+b.substr(1);var N=p-n-s-2;for(f=0;f<N;f++)if(b.charCodeAt(f)!==0)throw new Error("Leftmost octets not zero as expected");if(b.charCodeAt(N)!==1)throw new Error("Inconsistent PSS signature, 0x01 marker not found");var L=b.substr(-s),V=new ta.util.ByteBuffer;V.fillWithByte(0,8),V.putBytes(c),V.putBytes(L),t.start(),t.update(V.getBytes());var X=t.digest().getBytes();return E===X},o};});var Zf=P((Sae,GN)=>{var qe=Je();ns();zn();ju();oi();$N();is();Qs();Gf();Hu();mt();var T=qe.asn1,be=GN.exports=qe.pki=qe.pki||{},pt=be.oids,Qt={};Qt.CN=pt.commonName;Qt.commonName="CN";Qt.C=pt.countryName;Qt.countryName="C";Qt.L=pt.localityName;Qt.localityName="L";Qt.ST=pt.stateOrProvinceName;Qt.stateOrProvinceName="ST";Qt.O=pt.organizationName;Qt.organizationName="O";Qt.OU=pt.organizationalUnitName;Qt.organizationalUnitName="OU";Qt.E=pt.emailAddress;Qt.emailAddress="E";var WN=qe.pki.rsa.publicKeyValidator,WY={name:"Certificate",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:T.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:T.Class.UNIVERSAL,type:T.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:T.Class.UNIVERSAL,type:T.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:T.Class.UNIVERSAL,type:T.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:T.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:T.Class.UNIVERSAL,type:T.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:T.Class.UNIVERSAL,type:T.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:T.Class.UNIVERSAL,type:T.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:T.Class.UNIVERSAL,type:T.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},WN,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:T.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:T.Class.UNIVERSAL,type:T.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:T.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:T.Class.UNIVERSAL,type:T.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:T.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:T.Class.UNIVERSAL,type:T.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:T.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:T.Class.UNIVERSAL,type:T.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},KY={name:"rsapss",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:T.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:T.Class.UNIVERSAL,type:T.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:T.Class.UNIVERSAL,type:T.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:T.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:T.Class.UNIVERSAL,type:T.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:T.Class.UNIVERSAL,type:T.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:T.Class.UNIVERSAL,type:T.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:T.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:T.Class.UNIVERSAL,type:T.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:T.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:T.Class.UNIVERSAL,type:T.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},zY={name:"CertificationRequestInfo",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:T.Class.UNIVERSAL,type:T.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},WN,{name:"CertificationRequestInfo.attributes",tagClass:T.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:T.Class.UNIVERSAL,type:T.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:T.Class.UNIVERSAL,type:T.Type.SET,constructed:!0}]}]}]},GY={name:"CertificationRequest",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[zY,{name:"CertificationRequest.signatureAlgorithm",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:T.Class.UNIVERSAL,type:T.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:T.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:T.Class.UNIVERSAL,type:T.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};be.RDNAttributesAsArray=function(e,t){for(var r=[],n,i,s,a=0;a<e.value.length;++a){n=e.value[a];for(var o=0;o<n.value.length;++o)s={},i=n.value[o],s.type=T.derToOid(i.value[0].value),s.value=i.value[1].value,s.valueTagClass=i.value[1].type,s.type in pt&&(s.name=pt[s.type],s.name in Qt&&(s.shortName=Qt[s.name])),t&&(t.update(s.type),t.update(s.value)),r.push(s);}return r};be.CRIAttributesAsArray=function(e){for(var t=[],r=0;r<e.length;++r)for(var n=e[r],i=T.derToOid(n.value[0].value),s=n.value[1].value,a=0;a<s.length;++a){var o={};if(o.type=i,o.value=s[a].value,o.valueTagClass=s[a].type,o.type in pt&&(o.name=pt[o.type],o.name in Qt&&(o.shortName=Qt[o.name])),o.type===pt.extensionRequest){o.extensions=[];for(var c=0;c<o.value.length;++c)o.extensions.push(be.certificateExtensionFromAsn1(o.value[c]));}t.push(o);}return t};function os(e,t){typeof t=="string"&&(t={shortName:t});for(var r=null,n,i=0;r===null&&i<e.attributes.length;++i)n=e.attributes[i],(t.type&&t.type===n.type||t.name&&t.name===n.name||t.shortName&&t.shortName===n.shortName)&&(r=n);return r}var Yf=function(e,t,r){var n={};if(e!==pt["RSASSA-PSS"])return n;r&&(n={hash:{algorithmOid:pt.sha1},mgf:{algorithmOid:pt.mgf1,hash:{algorithmOid:pt.sha1}},saltLength:20});var i={},s=[];if(!T.validate(t,KY,i,s)){var a=new Error("Cannot read RSASSA-PSS parameter block.");throw a.errors=s,a}return i.hashOid!==void 0&&(n.hash=n.hash||{},n.hash.algorithmOid=T.derToOid(i.hashOid)),i.maskGenOid!==void 0&&(n.mgf=n.mgf||{},n.mgf.algorithmOid=T.derToOid(i.maskGenOid),n.mgf.hash=n.mgf.hash||{},n.mgf.hash.algorithmOid=T.derToOid(i.maskGenHashOid)),i.saltLength!==void 0&&(n.saltLength=i.saltLength.charCodeAt(0)),n},Qf=function(e){switch(pt[e.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return qe.md.sha1.create();case"md5WithRSAEncryption":return qe.md.md5.create();case"sha256WithRSAEncryption":return qe.md.sha256.create();case"sha384WithRSAEncryption":return qe.md.sha384.create();case"sha512WithRSAEncryption":return qe.md.sha512.create();case"RSASSA-PSS":return qe.md.sha256.create();default:var t=new Error("Could not compute "+e.type+" digest. Unknown signature OID.");throw t.signatureOid=e.signatureOid,t}},KN=function(e){var t=e.certificate,r;switch(t.signatureOid){case pt.sha1WithRSAEncryption:case pt.sha1WithRSASignature:break;case pt["RSASSA-PSS"]:var n,i;if(n=pt[t.signatureParameters.mgf.hash.algorithmOid],n===void 0||qe.md[n]===void 0){var s=new Error("Unsupported MGF hash function.");throw s.oid=t.signatureParameters.mgf.hash.algorithmOid,s.name=n,s}if(i=pt[t.signatureParameters.mgf.algorithmOid],i===void 0||qe.mgf[i]===void 0){var s=new Error("Unsupported MGF function.");throw s.oid=t.signatureParameters.mgf.algorithmOid,s.name=i,s}if(i=qe.mgf[i].create(qe.md[n].create()),n=pt[t.signatureParameters.hash.algorithmOid],n===void 0||qe.md[n]===void 0){var s=new Error("Unsupported RSASSA-PSS hash function.");throw s.oid=t.signatureParameters.hash.algorithmOid,s.name=n,s}r=qe.pss.create(qe.md[n].create(),i,t.signatureParameters.saltLength);break}return t.publicKey.verify(e.md.digest().getBytes(),e.signature,r)};be.certificateFromPem=function(e,t,r){var n=qe.pem.decode(e)[0];if(n.type!=="CERTIFICATE"&&n.type!=="X509 CERTIFICATE"&&n.type!=="TRUSTED CERTIFICATE"){var i=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw i.headerType=n.type,i}if(n.procType&&n.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var s=T.fromDer(n.body,r);return be.certificateFromAsn1(s,t)};be.certificateToPem=function(e,t){var r={type:"CERTIFICATE",body:T.toDer(be.certificateToAsn1(e)).getBytes()};return qe.pem.encode(r,{maxline:t})};be.publicKeyFromPem=function(e){var t=qe.pem.decode(e)[0];if(t.type!=="PUBLIC KEY"&&t.type!=="RSA PUBLIC KEY"){var r=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw r.headerType=t.type,r}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert public key from PEM; PEM is encrypted.");var n=T.fromDer(t.body);return be.publicKeyFromAsn1(n)};be.publicKeyToPem=function(e,t){var r={type:"PUBLIC KEY",body:T.toDer(be.publicKeyToAsn1(e)).getBytes()};return qe.pem.encode(r,{maxline:t})};be.publicKeyToRSAPublicKeyPem=function(e,t){var r={type:"RSA PUBLIC KEY",body:T.toDer(be.publicKeyToRSAPublicKey(e)).getBytes()};return qe.pem.encode(r,{maxline:t})};be.getPublicKeyFingerprint=function(e,t){t=t||{};var r=t.md||qe.md.sha1.create(),n=t.type||"RSAPublicKey",i;switch(n){case"RSAPublicKey":i=T.toDer(be.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":i=T.toDer(be.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}r.start(),r.update(i);var s=r.digest();if(t.encoding==="hex"){var a=s.toHex();return t.delimiter?a.match(/.{2}/g).join(t.delimiter):a}else {if(t.encoding==="binary")return s.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return s};be.certificationRequestFromPem=function(e,t,r){var n=qe.pem.decode(e)[0];if(n.type!=="CERTIFICATE REQUEST"){var i=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw i.headerType=n.type,i}if(n.procType&&n.procType.type==="ENCRYPTED")throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var s=T.fromDer(n.body,r);return be.certificationRequestFromAsn1(s,t)};be.certificationRequestToPem=function(e,t){var r={type:"CERTIFICATE REQUEST",body:T.toDer(be.certificationRequestToAsn1(e)).getBytes()};return qe.pem.encode(r,{maxline:t})};be.createCertificate=function(){var e={};return e.version=2,e.serialNumber="00",e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return os(e.issuer,t)},e.issuer.addField=function(t){Rn([t]),e.issuer.attributes.push(t);},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return os(e.subject,t)},e.subject.addField=function(t){Rn([t]),e.subject.attributes.push(t);},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,r){Rn(t),e.subject.attributes=t,delete e.subject.uniqueId,r&&(e.subject.uniqueId=r),e.subject.hash=null;},e.setIssuer=function(t,r){Rn(t),e.issuer.attributes=t,delete e.issuer.uniqueId,r&&(e.issuer.uniqueId=r),e.issuer.hash=null;},e.setExtensions=function(t){for(var r=0;r<t.length;++r)zN(t[r],{cert:e});e.extensions=t;},e.getExtension=function(t){typeof t=="string"&&(t={name:t});for(var r=null,n,i=0;r===null&&i<e.extensions.length;++i)n=e.extensions[i],(t.id&&n.id===t.id||t.name&&n.name===t.name)&&(r=n);return r},e.sign=function(t,r){e.md=r||qe.md.sha1.create();var n=pt[e.md.algorithm+"WithRSAEncryption"];if(!n){var i=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw i.algorithm=e.md.algorithm,i}e.signatureOid=e.siginfo.algorithmOid=n,e.tbsCertificate=be.getTBSCertificate(e);var s=T.toDer(e.tbsCertificate);e.md.update(s.getBytes()),e.signature=t.sign(e.md);},e.verify=function(t){var r=!1;if(!e.issued(t)){var n=t.issuer,i=e.subject,s=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw s.expectedIssuer=i.attributes,s.actualIssuer=n.attributes,s}var a=t.md;if(a===null){a=Qf({signatureOid:t.signatureOid,type:"certificate"});var o=t.tbsCertificate||be.getTBSCertificate(t),c=T.toDer(o);a.update(c.getBytes());}return a!==null&&(r=KN({certificate:e,md:a,signature:t.signature})),r},e.isIssuer=function(t){var r=!1,n=e.issuer,i=t.subject;if(n.hash&&i.hash)r=n.hash===i.hash;else if(n.attributes.length===i.attributes.length){r=!0;for(var s,a,o=0;r&&o<n.attributes.length;++o)s=n.attributes[o],a=i.attributes[o],(s.type!==a.type||s.value!==a.value)&&(r=!1);}return r},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return be.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=pt.subjectKeyIdentifier,r=0;r<e.extensions.length;++r){var n=e.extensions[r];if(n.id===t){var i=e.generateSubjectKeyIdentifier().getBytes();return qe.util.hexToBytes(n.subjectKeyIdentifier)===i}}return !1},e};be.certificateFromAsn1=function(e,t){var r={},n=[];if(!T.validate(e,WY,r,n)){var i=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw i.errors=n,i}var s=T.derToOid(r.publicKeyOid);if(s!==be.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var a=be.createCertificate();a.version=r.certVersion?r.certVersion.charCodeAt(0):0;var o=qe.util.createBuffer(r.certSerialNumber);a.serialNumber=o.toHex(),a.signatureOid=qe.asn1.derToOid(r.certSignatureOid),a.signatureParameters=Yf(a.signatureOid,r.certSignatureParams,!0),a.siginfo.algorithmOid=qe.asn1.derToOid(r.certinfoSignatureOid),a.siginfo.parameters=Yf(a.siginfo.algorithmOid,r.certinfoSignatureParams,!1),a.signature=r.certSignature;var c=[];if(r.certValidity1UTCTime!==void 0&&c.push(T.utcTimeToDate(r.certValidity1UTCTime)),r.certValidity2GeneralizedTime!==void 0&&c.push(T.generalizedTimeToDate(r.certValidity2GeneralizedTime)),r.certValidity3UTCTime!==void 0&&c.push(T.utcTimeToDate(r.certValidity3UTCTime)),r.certValidity4GeneralizedTime!==void 0&&c.push(T.generalizedTimeToDate(r.certValidity4GeneralizedTime)),c.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(c.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(a.validity.notBefore=c[0],a.validity.notAfter=c[1],a.tbsCertificate=r.tbsCertificate,t){a.md=Qf({signatureOid:a.signatureOid,type:"certificate"});var l=T.toDer(a.tbsCertificate);a.md.update(l.getBytes());}var u=qe.md.sha1.create(),f=T.toDer(r.certIssuer);u.update(f.getBytes()),a.issuer.getField=function(m){return os(a.issuer,m)},a.issuer.addField=function(m){Rn([m]),a.issuer.attributes.push(m);},a.issuer.attributes=be.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(a.issuer.uniqueId=r.certIssuerUniqueId),a.issuer.hash=u.digest().toHex();var h=qe.md.sha1.create(),p=T.toDer(r.certSubject);return h.update(p.getBytes()),a.subject.getField=function(m){return os(a.subject,m)},a.subject.addField=function(m){Rn([m]),a.subject.attributes.push(m);},a.subject.attributes=be.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(a.subject.uniqueId=r.certSubjectUniqueId),a.subject.hash=h.digest().toHex(),r.certExtensions?a.extensions=be.certificateExtensionsFromAsn1(r.certExtensions):a.extensions=[],a.publicKey=be.publicKeyFromAsn1(r.subjectPublicKeyInfo),a};be.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r<e.value.length;++r)for(var n=e.value[r],i=0;i<n.value.length;++i)t.push(be.certificateExtensionFromAsn1(n.value[i]));return t};be.certificateExtensionFromAsn1=function(e){var t={};if(t.id=T.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===T.Type.BOOLEAN?(t.critical=e.value[1].value.charCodeAt(0)!==0,t.value=e.value[2].value):t.value=e.value[1].value,t.id in pt){if(t.name=pt[t.id],t.name==="keyUsage"){var r=T.fromDer(t.value),n=0,i=0;r.value.length>1&&(n=r.value.charCodeAt(1),i=r.value.length>2?r.value.charCodeAt(2):0),t.digitalSignature=(n&128)===128,t.nonRepudiation=(n&64)===64,t.keyEncipherment=(n&32)===32,t.dataEncipherment=(n&16)===16,t.keyAgreement=(n&8)===8,t.keyCertSign=(n&4)===4,t.cRLSign=(n&2)===2,t.encipherOnly=(n&1)===1,t.decipherOnly=(i&128)===128;}else if(t.name==="basicConstraints"){var r=T.fromDer(t.value);r.value.length>0&&r.value[0].type===T.Type.BOOLEAN?t.cA=r.value[0].value.charCodeAt(0)!==0:t.cA=!1;var s=null;r.value.length>0&&r.value[0].type===T.Type.INTEGER?s=r.value[0].value:r.value.length>1&&(s=r.value[1].value),s!==null&&(t.pathLenConstraint=T.derToInteger(s));}else if(t.name==="extKeyUsage")for(var r=T.fromDer(t.value),a=0;a<r.value.length;++a){var o=T.derToOid(r.value[a].value);o in pt?t[pt[o]]=!0:t[o]=!0;}else if(t.name==="nsCertType"){var r=T.fromDer(t.value),n=0;r.value.length>1&&(n=r.value.charCodeAt(1)),t.client=(n&128)===128,t.server=(n&64)===64,t.email=(n&32)===32,t.objsign=(n&16)===16,t.reserved=(n&8)===8,t.sslCA=(n&4)===4,t.emailCA=(n&2)===2,t.objCA=(n&1)===1;}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.altNames=[];for(var c,r=T.fromDer(t.value),l=0;l<r.value.length;++l){c=r.value[l];var u={type:c.type,value:c.value};switch(t.altNames.push(u),c.type){case 1:case 2:case 6:break;case 7:u.ip=qe.util.bytesToIP(c.value);break;case 8:u.oid=T.derToOid(c.value);break;}}}else if(t.name==="subjectKeyIdentifier"){var r=T.fromDer(t.value);t.subjectKeyIdentifier=qe.util.bytesToHex(r.value);}}return t};be.certificationRequestFromAsn1=function(e,t){var r={},n=[];if(!T.validate(e,GY,r,n)){var i=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw i.errors=n,i}var s=T.derToOid(r.publicKeyOid);if(s!==be.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var a=be.createCertificationRequest();if(a.version=r.csrVersion?r.csrVersion.charCodeAt(0):0,a.signatureOid=qe.asn1.derToOid(r.csrSignatureOid),a.signatureParameters=Yf(a.signatureOid,r.csrSignatureParams,!0),a.siginfo.algorithmOid=qe.asn1.derToOid(r.csrSignatureOid),a.siginfo.parameters=Yf(a.siginfo.algorithmOid,r.csrSignatureParams,!1),a.signature=r.csrSignature,a.certificationRequestInfo=r.certificationRequestInfo,t){a.md=Qf({signatureOid:a.signatureOid,type:"certification request"});var o=T.toDer(a.certificationRequestInfo);a.md.update(o.getBytes());}var c=qe.md.sha1.create();return a.subject.getField=function(l){return os(a.subject,l)},a.subject.addField=function(l){Rn([l]),a.subject.attributes.push(l);},a.subject.attributes=be.RDNAttributesAsArray(r.certificationRequestInfoSubject,c),a.subject.hash=c.digest().toHex(),a.publicKey=be.publicKeyFromAsn1(r.subjectPublicKeyInfo),a.getAttribute=function(l){return os(a,l)},a.addAttribute=function(l){Rn([l]),a.attributes.push(l);},a.attributes=be.CRIAttributesAsArray(r.certificationRequestInfoAttributes||[]),a};be.createCertificationRequest=function(){var e={};return e.version=0,e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return os(e.subject,t)},e.subject.addField=function(t){Rn([t]),e.subject.attributes.push(t);},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return os(e,t)},e.addAttribute=function(t){Rn([t]),e.attributes.push(t);},e.md=null,e.setSubject=function(t){Rn(t),e.subject.attributes=t,e.subject.hash=null;},e.setAttributes=function(t){Rn(t),e.attributes=t;},e.sign=function(t,r){e.md=r||qe.md.sha1.create();var n=pt[e.md.algorithm+"WithRSAEncryption"];if(!n){var i=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw i.algorithm=e.md.algorithm,i}e.signatureOid=e.siginfo.algorithmOid=n,e.certificationRequestInfo=be.getCertificationRequestInfo(e);var s=T.toDer(e.certificationRequestInfo);e.md.update(s.getBytes()),e.signature=t.sign(e.md);},e.verify=function(){var t=!1,r=e.md;if(r===null){r=Qf({signatureOid:e.signatureOid,type:"certification request"});var n=e.certificationRequestInfo||be.getCertificationRequestInfo(e),i=T.toDer(n);r.update(i.getBytes());}return r!==null&&(t=KN({certificate:e,md:r,signature:e.signature})),t},e};function ao(e){for(var t=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[]),r,n,i=e.attributes,s=0;s<i.length;++s){r=i[s];var a=r.value,o=T.Type.PRINTABLESTRING;"valueTagClass"in r&&(o=r.valueTagClass,o===T.Type.UTF8&&(a=qe.util.encodeUtf8(a))),n=T.create(T.Class.UNIVERSAL,T.Type.SET,!0,[T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(r.type).getBytes()),T.create(T.Class.UNIVERSAL,o,!1,a)])]),t.value.push(n);}return t}function Rn(e){for(var t,r=0;r<e.length;++r){if(t=e[r],typeof t.name>"u"&&(t.type&&t.type in be.oids?t.name=be.oids[t.type]:t.shortName&&t.shortName in Qt&&(t.name=be.oids[Qt[t.shortName]])),typeof t.type>"u")if(t.name&&t.name in be.oids)t.type=be.oids[t.name];else {var n=new Error("Attribute type not specified.");throw n.attribute=t,n}if(typeof t.shortName>"u"&&t.name&&t.name in Qt&&(t.shortName=Qt[t.name]),t.type===pt.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=T.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var i=0;i<t.extensions.length;++i)t.value.push(be.certificateExtensionToAsn1(zN(t.extensions[i])));}if(typeof t.value>"u"){var n=new Error("Attribute value not specified.");throw n.attribute=t,n}}}function zN(e,t){if(t=t||{},typeof e.name>"u"&&e.id&&e.id in be.oids&&(e.name=be.oids[e.id]),typeof e.id>"u")if(e.name&&e.name in be.oids)e.id=be.oids[e.name];else {var r=new Error("Extension ID not specified.");throw r.extension=e,r}if(typeof e.value<"u")return e;if(e.name==="keyUsage"){var n=0,i=0,s=0;e.digitalSignature&&(i|=128,n=7),e.nonRepudiation&&(i|=64,n=6),e.keyEncipherment&&(i|=32,n=5),e.dataEncipherment&&(i|=16,n=4),e.keyAgreement&&(i|=8,n=3),e.keyCertSign&&(i|=4,n=2),e.cRLSign&&(i|=2,n=1),e.encipherOnly&&(i|=1,n=0),e.decipherOnly&&(s|=128,n=7);var a=String.fromCharCode(n);s!==0?a+=String.fromCharCode(i)+String.fromCharCode(s):i!==0&&(a+=String.fromCharCode(i)),e.value=T.create(T.Class.UNIVERSAL,T.Type.BITSTRING,!1,a);}else if(e.name==="basicConstraints")e.value=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(T.create(T.Class.UNIVERSAL,T.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in e&&e.value.value.push(T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,T.integerToDer(e.pathLenConstraint).getBytes()));else if(e.name==="extKeyUsage"){e.value=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[]);var o=e.value.value;for(var c in e)e[c]===!0&&(c in pt?o.push(T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(pt[c]).getBytes())):c.indexOf(".")!==-1&&o.push(T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(c).getBytes())));}else if(e.name==="nsCertType"){var n=0,i=0;e.client&&(i|=128,n=7),e.server&&(i|=64,n=6),e.email&&(i|=32,n=5),e.objsign&&(i|=16,n=4),e.reserved&&(i|=8,n=3),e.sslCA&&(i|=4,n=2),e.emailCA&&(i|=2,n=1),e.objCA&&(i|=1,n=0);var a=String.fromCharCode(n);i!==0&&(a+=String.fromCharCode(i)),e.value=T.create(T.Class.UNIVERSAL,T.Type.BITSTRING,!1,a);}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.value=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[]);for(var l,u=0;u<e.altNames.length;++u){l=e.altNames[u];var a=l.value;if(l.type===7&&l.ip){if(a=qe.util.bytesFromIP(l.ip),a===null){var r=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw r.extension=e,r}}else l.type===8&&(l.oid?a=T.oidToDer(T.oidToDer(l.oid)):a=T.oidToDer(a));e.value.value.push(T.create(T.Class.CONTEXT_SPECIFIC,l.type,!1,a));}}else if(e.name==="nsComment"&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=T.create(T.Class.UNIVERSAL,T.Type.IA5STRING,!1,e.comment);}else if(e.name==="subjectKeyIdentifier"&&t.cert){var f=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=f.toHex(),e.value=T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,f.getBytes());}else if(e.name==="authorityKeyIdentifier"&&t.cert){e.value=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[]);var o=e.value.value;if(e.keyIdentifier){var h=e.keyIdentifier===!0?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;o.push(T.create(T.Class.CONTEXT_SPECIFIC,0,!1,h));}if(e.authorityCertIssuer){var p=[T.create(T.Class.CONTEXT_SPECIFIC,4,!0,[ao(e.authorityCertIssuer===!0?t.cert.issuer:e.authorityCertIssuer)])];o.push(T.create(T.Class.CONTEXT_SPECIFIC,1,!0,p));}if(e.serialNumber){var m=qe.util.hexToBytes(e.serialNumber===!0?t.cert.serialNumber:e.serialNumber);o.push(T.create(T.Class.CONTEXT_SPECIFIC,2,!1,m));}}else if(e.name==="cRLDistributionPoints"){e.value=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[]);for(var o=e.value.value,_=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[]),E=T.create(T.Class.CONTEXT_SPECIFIC,0,!0,[]),l,u=0;u<e.altNames.length;++u){l=e.altNames[u];var a=l.value;if(l.type===7&&l.ip){if(a=qe.util.bytesFromIP(l.ip),a===null){var r=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw r.extension=e,r}}else l.type===8&&(l.oid?a=T.oidToDer(T.oidToDer(l.oid)):a=T.oidToDer(a));E.value.push(T.create(T.Class.CONTEXT_SPECIFIC,l.type,!1,a));}_.value.push(T.create(T.Class.CONTEXT_SPECIFIC,0,!0,[E])),o.push(_);}if(typeof e.value>"u"){var r=new Error("Extension value not specified.");throw r.extension=e,r}return e}function wy(e,t){switch(e){case pt["RSASSA-PSS"]:var r=[];return t.hash.algorithmOid!==void 0&&r.push(T.create(T.Class.CONTEXT_SPECIFIC,0,!0,[T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(t.hash.algorithmOid).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.NULL,!1,"")])])),t.mgf.algorithmOid!==void 0&&r.push(T.create(T.Class.CONTEXT_SPECIFIC,1,!0,[T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(t.mgf.algorithmOid).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(t.mgf.hash.algorithmOid).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.NULL,!1,"")])])])),t.saltLength!==void 0&&r.push(T.create(T.Class.CONTEXT_SPECIFIC,2,!0,[T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,T.integerToDer(t.saltLength).getBytes())])),T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,r);default:return T.create(T.Class.UNIVERSAL,T.Type.NULL,!1,"")}}function YY(e){var t=T.create(T.Class.CONTEXT_SPECIFIC,0,!0,[]);if(e.attributes.length===0)return t;for(var r=e.attributes,n=0;n<r.length;++n){var i=r[n],s=i.value,a=T.Type.UTF8;"valueTagClass"in i&&(a=i.valueTagClass),a===T.Type.UTF8&&(s=qe.util.encodeUtf8(s));var o=!1;"valueConstructed"in i&&(o=i.valueConstructed);var c=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(i.type).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.SET,!0,[T.create(T.Class.UNIVERSAL,a,o,s)])]);t.value.push(c);}return t}var QY=new Date("1950-01-01T00:00:00Z"),ZY=new Date("2050-01-01T00:00:00Z");function HN(e){return e>=QY&&e<ZY?T.create(T.Class.UNIVERSAL,T.Type.UTCTIME,!1,T.dateToUtcTime(e)):T.create(T.Class.UNIVERSAL,T.Type.GENERALIZEDTIME,!1,T.dateToGeneralizedTime(e))}be.getTBSCertificate=function(e){var t=HN(e.validity.notBefore),r=HN(e.validity.notAfter),n=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.CONTEXT_SPECIFIC,0,!0,[T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,T.integerToDer(e.version).getBytes())]),T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,qe.util.hexToBytes(e.serialNumber)),T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(e.siginfo.algorithmOid).getBytes()),wy(e.siginfo.algorithmOid,e.siginfo.parameters)]),ao(e.issuer),T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[t,r]),ao(e.subject),be.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&n.value.push(T.create(T.Class.CONTEXT_SPECIFIC,1,!0,[T.create(T.Class.UNIVERSAL,T.Type.BITSTRING,!1,"\0"+e.issuer.uniqueId)])),e.subject.uniqueId&&n.value.push(T.create(T.Class.CONTEXT_SPECIFIC,2,!0,[T.create(T.Class.UNIVERSAL,T.Type.BITSTRING,!1,"\0"+e.subject.uniqueId)])),e.extensions.length>0&&n.value.push(be.certificateExtensionsToAsn1(e.extensions)),n};be.getCertificationRequestInfo=function(e){var t=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,T.integerToDer(e.version).getBytes()),ao(e.subject),be.publicKeyToAsn1(e.publicKey),YY(e)]);return t};be.distinguishedNameToAsn1=function(e){return ao(e)};be.certificateToAsn1=function(e){var t=e.tbsCertificate||be.getTBSCertificate(e);return T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[t,T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(e.signatureOid).getBytes()),wy(e.signatureOid,e.signatureParameters)]),T.create(T.Class.UNIVERSAL,T.Type.BITSTRING,!1,"\0"+e.signature)])};be.certificateExtensionsToAsn1=function(e){var t=T.create(T.Class.CONTEXT_SPECIFIC,3,!0,[]),r=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;n<e.length;++n)r.value.push(be.certificateExtensionToAsn1(e[n]));return t};be.certificateExtensionToAsn1=function(e){var t=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[]);t.value.push(T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(e.id).getBytes())),e.critical&&t.value.push(T.create(T.Class.UNIVERSAL,T.Type.BOOLEAN,!1,"\xFF"));var r=e.value;return typeof e.value!="string"&&(r=T.toDer(r).getBytes()),t.value.push(T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,r)),t};be.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||be.getCertificationRequestInfo(e);return T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[t,T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(e.signatureOid).getBytes()),wy(e.signatureOid,e.signatureParameters)]),T.create(T.Class.UNIVERSAL,T.Type.BITSTRING,!1,"\0"+e.signature)])};be.createCaStore=function(e){var t={certs:{}};t.getIssuer=function(a){var o=r(a.issuer);return o},t.addCertificate=function(a){if(typeof a=="string"&&(a=qe.pki.certificateFromPem(a)),n(a.subject),!t.hasCertificate(a))if(a.subject.hash in t.certs){var o=t.certs[a.subject.hash];qe.util.isArray(o)||(o=[o]),o.push(a),t.certs[a.subject.hash]=o;}else t.certs[a.subject.hash]=a;},t.hasCertificate=function(a){typeof a=="string"&&(a=qe.pki.certificateFromPem(a));var o=r(a.subject);if(!o)return !1;qe.util.isArray(o)||(o=[o]);for(var c=T.toDer(be.certificateToAsn1(a)).getBytes(),l=0;l<o.length;++l){var u=T.toDer(be.certificateToAsn1(o[l])).getBytes();if(c===u)return !0}return !1},t.listAllCertificates=function(){var a=[];for(var o in t.certs)if(t.certs.hasOwnProperty(o)){var c=t.certs[o];if(!qe.util.isArray(c))a.push(c);else for(var l=0;l<c.length;++l)a.push(c[l]);}return a},t.removeCertificate=function(a){var o;if(typeof a=="string"&&(a=qe.pki.certificateFromPem(a)),n(a.subject),!t.hasCertificate(a))return null;var c=r(a.subject);if(!qe.util.isArray(c))return o=t.certs[a.subject.hash],delete t.certs[a.subject.hash],o;for(var l=T.toDer(be.certificateToAsn1(a)).getBytes(),u=0;u<c.length;++u){var f=T.toDer(be.certificateToAsn1(c[u])).getBytes();l===f&&(o=c[u],c.splice(u,1));}return c.length===0&&delete t.certs[a.subject.hash],o};function r(a){return n(a),t.certs[a.hash]||null}function n(a){if(!a.hash){var o=qe.md.sha1.create();a.attributes=be.RDNAttributesAsArray(ao(a),o),a.hash=o.digest().toHex();}}if(e)for(var i=0;i<e.length;++i){var s=e[i];t.addCertificate(s);}return t};be.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"};be.verifyCertificateChain=function(e,t,r){typeof r=="function"&&(r={verify:r}),r=r||{},t=t.slice(0);var n=t.slice(0),i=r.validityCheckDate;typeof i>"u"&&(i=new Date);var s=!0,a=null,o=0;do{var c=t.shift(),l=null,u=!1;if(i&&(i<c.validity.notBefore||i>c.validity.notAfter)&&(a={message:"Certificate is not valid yet or has expired.",error:be.certificateError.certificate_expired,notBefore:c.validity.notBefore,notAfter:c.validity.notAfter,now:i}),a===null){if(l=t[0]||e.getIssuer(c),l===null&&c.isIssuer(c)&&(u=!0,l=c),l){var f=l;qe.util.isArray(f)||(f=[f]);for(var h=!1;!h&&f.length>0;){l=f.shift();try{h=l.verify(c);}catch{}}h||(a={message:"Certificate signature is invalid.",error:be.certificateError.bad_certificate});}a===null&&(!l||u)&&!e.hasCertificate(c)&&(a={message:"Certificate is not trusted.",error:be.certificateError.unknown_ca});}if(a===null&&l&&!c.isIssuer(l)&&(a={message:"Certificate issuer is invalid.",error:be.certificateError.bad_certificate}),a===null)for(var p={keyUsage:!0,basicConstraints:!0},m=0;a===null&&m<c.extensions.length;++m){var _=c.extensions[m];_.critical&&!(_.name in p)&&(a={message:"Certificate has an unsupported critical extension.",error:be.certificateError.unsupported_certificate});}if(a===null&&(!s||t.length===0&&(!l||u))){var E=c.getExtension("basicConstraints"),w=c.getExtension("keyUsage");if(w!==null&&(!w.keyCertSign||E===null)&&(a={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:be.certificateError.bad_certificate}),a===null&&E!==null&&!E.cA&&(a={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:be.certificateError.bad_certificate}),a===null&&w!==null&&"pathLenConstraint"in E){var y=o-1;y>E.pathLenConstraint&&(a={message:"Certificate basicConstraints pathLenConstraint violated.",error:be.certificateError.bad_certificate});}}var b=a===null?!0:a.error,N=r.verify?r.verify(b,o,n):b;if(N===!0)a=null;else throw b===!0&&(a={message:"The application rejected the certificate.",error:be.certificateError.bad_certificate}),(N||N===0)&&(typeof N=="object"&&!qe.util.isArray(N)?(N.message&&(a.message=N.message),N.error&&(a.error=N.error)):typeof N=="string"&&(a.error=N)),a;s=!1,++o;}while(t.length>0);return !0};});var xy=P((Eae,QN)=>{var Ft=Je();zn();Ja();is();Sy();by();xn();Hu();no();mt();Zf();var F=Ft.asn1,st=Ft.pki,Ku=QN.exports=Ft.pkcs12=Ft.pkcs12||{},YN={name:"ContentInfo",tagClass:F.Class.UNIVERSAL,type:F.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:F.Class.UNIVERSAL,type:F.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:F.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},XY={name:"PFX",tagClass:F.Class.UNIVERSAL,type:F.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:F.Class.UNIVERSAL,type:F.Type.INTEGER,constructed:!1,capture:"version"},YN,{name:"PFX.macData",tagClass:F.Class.UNIVERSAL,type:F.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:F.Class.UNIVERSAL,type:F.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:F.Class.UNIVERSAL,type:F.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:F.Class.UNIVERSAL,type:F.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:F.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:F.Class.UNIVERSAL,type:F.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:F.Class.UNIVERSAL,type:F.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:F.Class.UNIVERSAL,type:F.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},JY={name:"SafeBag",tagClass:F.Class.UNIVERSAL,type:F.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:F.Class.UNIVERSAL,type:F.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:F.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:F.Class.UNIVERSAL,type:F.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},eQ={name:"Attribute",tagClass:F.Class.UNIVERSAL,type:F.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:F.Class.UNIVERSAL,type:F.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:F.Class.UNIVERSAL,type:F.Type.SET,constructed:!0,capture:"values"}]},tQ={name:"CertBag",tagClass:F.Class.UNIVERSAL,type:F.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:F.Class.UNIVERSAL,type:F.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:F.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:F.Class.UNIVERSAL,type:F.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function Wu(e,t,r,n){for(var i=[],s=0;s<e.length;s++)for(var a=0;a<e[s].safeBags.length;a++){var o=e[s].safeBags[a];if(!(n!==void 0&&o.type!==n)){if(t===null){i.push(o);continue}o.attributes[t]!==void 0&&o.attributes[t].indexOf(r)>=0&&i.push(o);}}return i}Ku.pkcs12FromAsn1=function(e,t,r){typeof t=="string"?(r=t,t=!0):t===void 0&&(t=!0);var n={},i=[];if(!F.validate(e,XY,n,i)){var s=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw s.errors=s,s}var a={version:n.version.charCodeAt(0),safeContents:[],getBags:function(E){var w={},y;return "localKeyId"in E?y=E.localKeyId:"localKeyIdHex"in E&&(y=Ft.util.hexToBytes(E.localKeyIdHex)),y===void 0&&!("friendlyName"in E)&&"bagType"in E&&(w[E.bagType]=Wu(a.safeContents,null,null,E.bagType)),y!==void 0&&(w.localKeyId=Wu(a.safeContents,"localKeyId",y,E.bagType)),"friendlyName"in E&&(w.friendlyName=Wu(a.safeContents,"friendlyName",E.friendlyName,E.bagType)),w},getBagsByFriendlyName:function(E,w){return Wu(a.safeContents,"friendlyName",E,w)},getBagsByLocalKeyId:function(E,w){return Wu(a.safeContents,"localKeyId",E,w)}};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(F.derToOid(n.contentType)!==st.oids.data){var s=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw s.oid=F.derToOid(n.contentType),s}var o=n.content.value[0];if(o.tagClass!==F.Class.UNIVERSAL||o.type!==F.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(o=Cy(o),n.mac){var c=null,l=0,u=F.derToOid(n.macAlgorithm);switch(u){case st.oids.sha1:c=Ft.md.sha1.create(),l=20;break;case st.oids.sha256:c=Ft.md.sha256.create(),l=32;break;case st.oids.sha384:c=Ft.md.sha384.create(),l=48;break;case st.oids.sha512:c=Ft.md.sha512.create(),l=64;break;case st.oids.md5:c=Ft.md.md5.create(),l=16;break}if(c===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+u);var f=new Ft.util.ByteBuffer(n.macSalt),h="macIterations"in n?parseInt(Ft.util.bytesToHex(n.macIterations),16):1,p=Ku.generateKey(r,f,3,h,l,c),m=Ft.hmac.create();m.start(c,p),m.update(o.value);var _=m.getMac();if(_.getBytes()!==n.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return rQ(a,o.value,t,r),a};function Cy(e){if(e.composed||e.constructed){for(var t=Ft.util.createBuffer(),r=0;r<e.value.length;++r)t.putBytes(e.value[r].value);e.composed=e.constructed=!1,e.value=t.getBytes();}return e}function rQ(e,t,r,n){if(t=F.fromDer(t,r),t.tagClass!==F.Class.UNIVERSAL||t.type!==F.Type.SEQUENCE||t.constructed!==!0)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var i=0;i<t.value.length;i++){var s=t.value[i],a={},o=[];if(!F.validate(s,YN,a,o)){var c=new Error("Cannot read ContentInfo.");throw c.errors=o,c}var l={encrypted:!1},u=null,f=a.content.value[0];switch(F.derToOid(a.contentType)){case st.oids.data:if(f.tagClass!==F.Class.UNIVERSAL||f.type!==F.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");u=Cy(f).value;break;case st.oids.encryptedData:u=nQ(f,n),l.encrypted=!0;break;default:var c=new Error("Unsupported PKCS#12 contentType.");throw c.contentType=F.derToOid(a.contentType),c}l.safeBags=iQ(u,r,n),e.safeContents.push(l);}}function nQ(e,t){var r={},n=[];if(!F.validate(e,Ft.pkcs7.asn1.encryptedDataValidator,r,n)){var i=new Error("Cannot read EncryptedContentInfo.");throw i.errors=n,i}var s=F.derToOid(r.contentType);if(s!==st.oids.data){var i=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw i.oid=s,i}s=F.derToOid(r.encAlgorithm);var a=st.pbe.getCipher(s,r.encParameter,t),o=Cy(r.encryptedContentAsn1),c=Ft.util.createBuffer(o.value);if(a.update(c),!a.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return a.output.getBytes()}function iQ(e,t,r){if(!t&&e.length===0)return [];if(e=F.fromDer(e,t),e.tagClass!==F.Class.UNIVERSAL||e.type!==F.Type.SEQUENCE||e.constructed!==!0)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var n=[],i=0;i<e.value.length;i++){var s=e.value[i],a={},o=[];if(!F.validate(s,JY,a,o)){var c=new Error("Cannot read SafeBag.");throw c.errors=o,c}var l={type:F.derToOid(a.bagId),attributes:sQ(a.bagAttributes)};n.push(l);var u,f,h=a.bagValue.value[0];switch(l.type){case st.oids.pkcs8ShroudedKeyBag:if(h=st.decryptPrivateKeyInfo(h,r),h===null)throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case st.oids.keyBag:try{l.key=st.privateKeyFromAsn1(h);}catch{l.key=null,l.asn1=h;}continue;case st.oids.certBag:u=tQ,f=function(){if(F.derToOid(a.certId)!==st.oids.x509Certificate){var m=new Error("Unsupported certificate type, only X.509 supported.");throw m.oid=F.derToOid(a.certId),m}var _=F.fromDer(a.cert,t);try{l.cert=st.certificateFromAsn1(_,!0);}catch{l.cert=null,l.asn1=_;}};break;default:var c=new Error("Unsupported PKCS#12 SafeBag type.");throw c.oid=l.type,c}if(u!==void 0&&!F.validate(h,u,a,o)){var c=new Error("Cannot read PKCS#12 "+u.name);throw c.errors=o,c}f();}return n}function sQ(e){var t={};if(e!==void 0)for(var r=0;r<e.length;++r){var n={},i=[];if(!F.validate(e[r],eQ,n,i)){var s=new Error("Cannot read PKCS#12 BagAttribute.");throw s.errors=i,s}var a=F.derToOid(n.oid);if(st.oids[a]!==void 0){t[st.oids[a]]=[];for(var o=0;o<n.values.length;++o)t[st.oids[a]].push(n.values[o].value);}}return t}Ku.toPkcs12Asn1=function(e,t,r,n){n=n||{},n.saltSize=n.saltSize||8,n.count=n.count||2048,n.algorithm=n.algorithm||n.encAlgorithm||"aes128","useMac"in n||(n.useMac=!0),"localKeyId"in n||(n.localKeyId=null),"generateLocalKeyId"in n||(n.generateLocalKeyId=!0);var i=n.localKeyId,s;if(i!==null)i=Ft.util.hexToBytes(i);else if(n.generateLocalKeyId)if(t){var a=Ft.util.isArray(t)?t[0]:t;typeof a=="string"&&(a=st.certificateFromPem(a));var o=Ft.md.sha1.create();o.update(F.toDer(st.certificateToAsn1(a)).getBytes()),i=o.digest().getBytes();}else i=Ft.random.getBytes(20);var c=[];i!==null&&c.push(F.create(F.Class.UNIVERSAL,F.Type.SEQUENCE,!0,[F.create(F.Class.UNIVERSAL,F.Type.OID,!1,F.oidToDer(st.oids.localKeyId).getBytes()),F.create(F.Class.UNIVERSAL,F.Type.SET,!0,[F.create(F.Class.UNIVERSAL,F.Type.OCTETSTRING,!1,i)])])),"friendlyName"in n&&c.push(F.create(F.Class.UNIVERSAL,F.Type.SEQUENCE,!0,[F.create(F.Class.UNIVERSAL,F.Type.OID,!1,F.oidToDer(st.oids.friendlyName).getBytes()),F.create(F.Class.UNIVERSAL,F.Type.SET,!0,[F.create(F.Class.UNIVERSAL,F.Type.BMPSTRING,!1,n.friendlyName)])])),c.length>0&&(s=F.create(F.Class.UNIVERSAL,F.Type.SET,!0,c));var l=[],u=[];t!==null&&(Ft.util.isArray(t)?u=t:u=[t]);for(var f=[],h=0;h<u.length;++h){t=u[h],typeof t=="string"&&(t=st.certificateFromPem(t));var p=h===0?s:void 0,m=st.certificateToAsn1(t),_=F.create(F.Class.UNIVERSAL,F.Type.SEQUENCE,!0,[F.create(F.Class.UNIVERSAL,F.Type.OID,!1,F.oidToDer(st.oids.certBag).getBytes()),F.create(F.Class.CONTEXT_SPECIFIC,0,!0,[F.create(F.Class.UNIVERSAL,F.Type.SEQUENCE,!0,[F.create(F.Class.UNIVERSAL,F.Type.OID,!1,F.oidToDer(st.oids.x509Certificate).getBytes()),F.create(F.Class.CONTEXT_SPECIFIC,0,!0,[F.create(F.Class.UNIVERSAL,F.Type.OCTETSTRING,!1,F.toDer(m).getBytes())])])]),p]);f.push(_);}if(f.length>0){var E=F.create(F.Class.UNIVERSAL,F.Type.SEQUENCE,!0,f),w=F.create(F.Class.UNIVERSAL,F.Type.SEQUENCE,!0,[F.create(F.Class.UNIVERSAL,F.Type.OID,!1,F.oidToDer(st.oids.data).getBytes()),F.create(F.Class.CONTEXT_SPECIFIC,0,!0,[F.create(F.Class.UNIVERSAL,F.Type.OCTETSTRING,!1,F.toDer(E).getBytes())])]);l.push(w);}var y=null;if(e!==null){var b=st.wrapRsaPrivateKey(st.privateKeyToAsn1(e));r===null?y=F.create(F.Class.UNIVERSAL,F.Type.SEQUENCE,!0,[F.create(F.Class.UNIVERSAL,F.Type.OID,!1,F.oidToDer(st.oids.keyBag).getBytes()),F.create(F.Class.CONTEXT_SPECIFIC,0,!0,[b]),s]):y=F.create(F.Class.UNIVERSAL,F.Type.SEQUENCE,!0,[F.create(F.Class.UNIVERSAL,F.Type.OID,!1,F.oidToDer(st.oids.pkcs8ShroudedKeyBag).getBytes()),F.create(F.Class.CONTEXT_SPECIFIC,0,!0,[st.encryptPrivateKeyInfo(b,r,n)]),s]);var N=F.create(F.Class.UNIVERSAL,F.Type.SEQUENCE,!0,[y]),L=F.create(F.Class.UNIVERSAL,F.Type.SEQUENCE,!0,[F.create(F.Class.UNIVERSAL,F.Type.OID,!1,F.oidToDer(st.oids.data).getBytes()),F.create(F.Class.CONTEXT_SPECIFIC,0,!0,[F.create(F.Class.UNIVERSAL,F.Type.OCTETSTRING,!1,F.toDer(N).getBytes())])]);l.push(L);}var V=F.create(F.Class.UNIVERSAL,F.Type.SEQUENCE,!0,l),X;if(n.useMac){var o=Ft.md.sha1.create(),z=new Ft.util.ByteBuffer(Ft.random.getBytes(n.saltSize)),G=n.count,e=Ku.generateKey(r,z,3,G,20),ee=Ft.hmac.create();ee.start(o,e),ee.update(F.toDer(V).getBytes());var U=ee.getMac();X=F.create(F.Class.UNIVERSAL,F.Type.SEQUENCE,!0,[F.create(F.Class.UNIVERSAL,F.Type.SEQUENCE,!0,[F.create(F.Class.UNIVERSAL,F.Type.SEQUENCE,!0,[F.create(F.Class.UNIVERSAL,F.Type.OID,!1,F.oidToDer(st.oids.sha1).getBytes()),F.create(F.Class.UNIVERSAL,F.Type.NULL,!1,"")]),F.create(F.Class.UNIVERSAL,F.Type.OCTETSTRING,!1,U.getBytes())]),F.create(F.Class.UNIVERSAL,F.Type.OCTETSTRING,!1,z.getBytes()),F.create(F.Class.UNIVERSAL,F.Type.INTEGER,!1,F.integerToDer(G).getBytes())]);}return F.create(F.Class.UNIVERSAL,F.Type.SEQUENCE,!0,[F.create(F.Class.UNIVERSAL,F.Type.INTEGER,!1,F.integerToDer(3).getBytes()),F.create(F.Class.UNIVERSAL,F.Type.SEQUENCE,!0,[F.create(F.Class.UNIVERSAL,F.Type.OID,!1,F.oidToDer(st.oids.data).getBytes()),F.create(F.Class.CONTEXT_SPECIFIC,0,!0,[F.create(F.Class.UNIVERSAL,F.Type.OCTETSTRING,!1,F.toDer(V).getBytes())])]),X])};Ku.generateKey=Ft.pbe.generatePkcs12Key;});var Ay=P((wae,ZN)=>{var us=Je();zn();is();by();Qs();jf();xy();Gf();Hu();mt();Zf();var Ty=us.asn1,oo=ZN.exports=us.pki=us.pki||{};oo.pemToDer=function(e){var t=us.pem.decode(e)[0];if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return us.util.createBuffer(t.body)};oo.privateKeyFromPem=function(e){var t=us.pem.decode(e)[0];if(t.type!=="PRIVATE KEY"&&t.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=t.type,r}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var n=Ty.fromDer(t.body);return oo.privateKeyFromAsn1(n)};oo.privateKeyToPem=function(e,t){var r={type:"RSA PRIVATE KEY",body:Ty.toDer(oo.privateKeyToAsn1(e)).getBytes()};return us.pem.encode(r,{maxline:t})};oo.privateKeyInfoToPem=function(e,t){var r={type:"PRIVATE KEY",body:Ty.toDer(e).getBytes()};return us.pem.encode(r,{maxline:t})};});var ky=P((Cae,sD)=>{var de=Je();zn();Ja();Ff();Qs();Ay();xn();no();mt();var td=function(e,t,r,n){var i=de.util.createBuffer(),s=e.length>>1,a=s+(e.length&1),o=e.substr(0,a),c=e.substr(s,a),l=de.util.createBuffer(),u=de.hmac.create();r=t+r;var f=Math.ceil(n/16),h=Math.ceil(n/20);u.start("MD5",o);var p=de.util.createBuffer();l.putBytes(r);for(var m=0;m<f;++m)u.start(null,null),u.update(l.getBytes()),l.putBuffer(u.digest()),u.start(null,null),u.update(l.bytes()+r),p.putBuffer(u.digest());u.start("SHA1",c);var _=de.util.createBuffer();l.clear(),l.putBytes(r);for(var m=0;m<h;++m)u.start(null,null),u.update(l.getBytes()),l.putBuffer(u.digest()),u.start(null,null),u.update(l.bytes()+r),_.putBuffer(u.digest());return i.putBytes(de.util.xorBytes(p.getBytes(),_.getBytes(),n)),i},aQ=function(e,t,r){var n=de.hmac.create();n.start("SHA1",e);var i=de.util.createBuffer();return i.putInt32(t[0]),i.putInt32(t[1]),i.putByte(r.type),i.putByte(r.version.major),i.putByte(r.version.minor),i.putInt16(r.length),i.putBytes(r.fragment.bytes()),n.update(i.getBytes()),n.digest().getBytes()},oQ=function(e,t,r){var n=!1;try{var i=e.deflate(t.fragment.getBytes());t.fragment=de.util.createBuffer(i),t.length=i.length,n=!0;}catch{}return n},uQ=function(e,t,r){var n=!1;try{var i=e.inflate(t.fragment.getBytes());t.fragment=de.util.createBuffer(i),t.length=i.length,n=!0;}catch{}return n},pn=function(e,t){var r=0;switch(t){case 1:r=e.getByte();break;case 2:r=e.getInt16();break;case 3:r=e.getInt24();break;case 4:r=e.getInt32();break}return de.util.createBuffer(e.getBytes(r))},In=function(e,t,r){e.putInt(r.length(),t<<3),e.putBuffer(r);},I={};I.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}};I.SupportedVersions=[I.Versions.TLS_1_1,I.Versions.TLS_1_0];I.Version=I.SupportedVersions[0];I.MaxFragment=15360;I.ConnectionEnd={server:0,client:1};I.PRFAlgorithm={tls_prf_sha256:0};I.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2};I.CipherType={stream:0,block:1,aead:2};I.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4};I.CompressionMethod={none:0,deflate:1};I.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24};I.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20};I.Alert={};I.Alert.Level={warning:1,fatal:2};I.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100};I.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2};I.CipherSuites={};I.getCipherSuite=function(e){var t=null;for(var r in I.CipherSuites){var n=I.CipherSuites[r];if(n.id[0]===e.charCodeAt(0)&&n.id[1]===e.charCodeAt(1)){t=n;break}}return t};I.handleUnexpected=function(e,t){var r=!e.open&&e.entity===I.ConnectionEnd.client;r||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.unexpected_message}});};I.handleHelloRequest=function(e,t,r){!e.handshaking&&e.handshakes>0&&(I.queue(e,I.createAlert(e,{level:I.Alert.Level.warning,description:I.Alert.Description.no_renegotiation})),I.flush(e)),e.process();};I.parseHelloMessage=function(e,t,r){var n=null,i=e.entity===I.ConnectionEnd.client;if(r<38)e.error(e,{message:i?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.illegal_parameter}});else {var s=t.fragment,a=s.length();if(n={version:{major:s.getByte(),minor:s.getByte()},random:de.util.createBuffer(s.getBytes(32)),session_id:pn(s,1),extensions:[]},i?(n.cipher_suite=s.getBytes(2),n.compression_method=s.getByte()):(n.cipher_suites=pn(s,2),n.compression_methods=pn(s,1)),a=r-(a-s.length()),a>0){for(var o=pn(s,2);o.length()>0;)n.extensions.push({type:[o.getByte(),o.getByte()],data:pn(o,2)});if(!i)for(var c=0;c<n.extensions.length;++c){var l=n.extensions[c];if(l.type[0]===0&&l.type[1]===0)for(var u=pn(l.data,2);u.length()>0;){var f=u.getByte();if(f!==0)break;e.session.extensions.server_name.serverNameList.push(pn(u,2).getBytes());}}}if(e.session.version&&(n.version.major!==e.session.version.major||n.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.protocol_version}});if(i)e.session.cipherSuite=I.getCipherSuite(n.cipher_suite);else for(var h=de.util.createBuffer(n.cipher_suites.bytes());h.length()>0&&(e.session.cipherSuite=I.getCipherSuite(h.getBytes(2)),e.session.cipherSuite===null););if(e.session.cipherSuite===null)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.handshake_failure},cipherSuite:de.util.bytesToHex(n.cipher_suite)});i?e.session.compressionMethod=n.compression_method:e.session.compressionMethod=I.CompressionMethod.none;}return n};I.createSecurityParameters=function(e,t){var r=e.entity===I.ConnectionEnd.client,n=t.random.bytes(),i=r?e.session.sp.client_random:n,s=r?n:I.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:I.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:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:i,server_random:s};};I.handleServerHello=function(e,t,r){var n=I.parseHelloMessage(e,t,r);if(!e.fail){if(n.version.minor<=e.version.minor)e.version.minor=n.version.minor;else return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.protocol_version}});e.session.version=e.version;var i=n.session_id.bytes();i.length>0&&i===e.session.id?(e.expect=eD,e.session.resuming=!0,e.session.sp.server_random=n.random.bytes()):(e.expect=lQ,e.session.resuming=!1,I.createSecurityParameters(e,n)),e.session.id=i,e.process();}};I.handleClientHello=function(e,t,r){var n=I.parseHelloMessage(e,t,r);if(!e.fail){var i=n.session_id.bytes(),s=null;if(e.sessionCache&&(s=e.sessionCache.getSession(i),s===null?i="":(s.version.major!==n.version.major||s.version.minor>n.version.minor)&&(s=null,i="")),i.length===0&&(i=de.random.getBytes(32)),e.session.id=i,e.session.clientHelloVersion=n.version,e.session.sp={},s)e.version=e.session.version=s.version,e.session.sp=s.sp;else {for(var a,o=1;o<I.SupportedVersions.length&&(a=I.SupportedVersions[o],!(a.minor<=n.version.minor));++o);e.version={major:a.major,minor:a.minor},e.session.version=e.version;}s!==null?(e.expect=Ny,e.session.resuming=!0,e.session.sp.client_random=n.random.bytes()):(e.expect=e.verifyClient!==!1?yQ:Py,e.session.resuming=!1,I.createSecurityParameters(e,n)),e.open=!0,I.queue(e,I.createRecord(e,{type:I.ContentType.handshake,data:I.createServerHello(e)})),e.session.resuming?(I.queue(e,I.createRecord(e,{type:I.ContentType.change_cipher_spec,data:I.createChangeCipherSpec()})),e.state.pending=I.createConnectionState(e),e.state.current.write=e.state.pending.write,I.queue(e,I.createRecord(e,{type:I.ContentType.handshake,data:I.createFinished(e)}))):(I.queue(e,I.createRecord(e,{type:I.ContentType.handshake,data:I.createCertificate(e)})),e.fail||(I.queue(e,I.createRecord(e,{type:I.ContentType.handshake,data:I.createServerKeyExchange(e)})),e.verifyClient!==!1&&I.queue(e,I.createRecord(e,{type:I.ContentType.handshake,data:I.createCertificateRequest(e)})),I.queue(e,I.createRecord(e,{type:I.ContentType.handshake,data:I.createServerHelloDone(e)})))),I.flush(e),e.process();}};I.handleCertificate=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.illegal_parameter}});var n=t.fragment,i={certificate_list:pn(n,3)},s,a,o=[];try{for(;i.certificate_list.length()>0;)s=pn(i.certificate_list,3),a=de.asn1.fromDer(s),s=de.pki.certificateFromAsn1(a,!0),o.push(s);}catch(l){return e.error(e,{message:"Could not parse certificate list.",cause:l,send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.bad_certificate}})}var c=e.entity===I.ConnectionEnd.client;(c||e.verifyClient===!0)&&o.length===0?e.error(e,{message:c?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.illegal_parameter}}):o.length===0?e.expect=c?XN:Py:(c?e.session.serverCertificate=o[0]:e.session.clientCertificate=o[0],I.verifyCertificateChain(e,o)&&(e.expect=c?XN:Py)),e.process();};I.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.unsupported_certificate}});e.expect=fQ,e.process();};I.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.unsupported_certificate}});var n=t.fragment,i={enc_pre_master_secret:pn(n,2).getBytes()},s=null;if(e.getPrivateKey)try{s=e.getPrivateKey(e,e.session.serverCertificate),s=de.pki.privateKeyFromPem(s);}catch(c){e.error(e,{message:"Could not get private key.",cause:c,send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.internal_error}});}if(s===null)return e.error(e,{message:"No private key set.",send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.internal_error}});try{var a=e.session.sp;a.pre_master_secret=s.decrypt(i.enc_pre_master_secret);var o=e.session.clientHelloVersion;if(o.major!==a.pre_master_secret.charCodeAt(0)||o.minor!==a.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{a.pre_master_secret=de.random.getBytes(48);}e.expect=Ny,e.session.clientCertificate!==null&&(e.expect=vQ),e.process();};I.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.illegal_parameter}});var n=t.fragment,i={certificate_types:pn(n,1),certificate_authorities:pn(n,2)};e.session.certificateRequest=i,e.expect=dQ,e.process();};I.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.illegal_parameter}});var n=t.fragment;n.read-=4;var i=n.bytes();n.read+=4;var s={signature:pn(n,2).getBytes()},a=de.util.createBuffer();a.putBuffer(e.session.md5.digest()),a.putBuffer(e.session.sha1.digest()),a=a.getBytes();try{var o=e.session.clientCertificate;if(!o.publicKey.verify(a,s.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(i),e.session.sha1.update(i);}catch{return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.handshake_failure}})}e.expect=Ny,e.process();};I.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.record_overflow}});if(e.serverCertificate===null){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.insufficient_security}},i=0,s=e.verify(e,n.alert.description,i,[]);if(s!==!0)return (s||s===0)&&(typeof s=="object"&&!de.util.isArray(s)?(s.message&&(n.message=s.message),s.alert&&(n.alert.description=s.alert)):typeof s=="number"&&(n.alert.description=s)),e.error(e,n)}e.session.certificateRequest!==null&&(t=I.createRecord(e,{type:I.ContentType.handshake,data:I.createCertificate(e)}),I.queue(e,t)),t=I.createRecord(e,{type:I.ContentType.handshake,data:I.createClientKeyExchange(e)}),I.queue(e,t),e.expect=gQ;var a=function(o,c){o.session.certificateRequest!==null&&o.session.clientCertificate!==null&&I.queue(o,I.createRecord(o,{type:I.ContentType.handshake,data:I.createCertificateVerify(o,c)})),I.queue(o,I.createRecord(o,{type:I.ContentType.change_cipher_spec,data:I.createChangeCipherSpec()})),o.state.pending=I.createConnectionState(o),o.state.current.write=o.state.pending.write,I.queue(o,I.createRecord(o,{type:I.ContentType.handshake,data:I.createFinished(o)})),o.expect=eD,I.flush(o),o.process();};if(e.session.certificateRequest===null||e.session.clientCertificate===null)return a(e,null);I.getClientSignature(e,a);};I.handleChangeCipherSpec=function(e,t){if(t.fragment.getByte()!==1)return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.illegal_parameter}});var r=e.entity===I.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=I.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&r||e.session.resuming&&!r)&&(e.state.pending=null),e.expect=r?hQ:_Q,e.process();};I.handleFinished=function(e,t,r){var n=t.fragment;n.read-=4;var i=n.bytes();n.read+=4;var s=t.fragment.getBytes();n=de.util.createBuffer(),n.putBuffer(e.session.md5.digest()),n.putBuffer(e.session.sha1.digest());var a=e.entity===I.ConnectionEnd.client,o=a?"server finished":"client finished",c=e.session.sp,l=12,u=td;if(n=u(c.master_secret,o,n.getBytes(),l),n.getBytes()!==s)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.decrypt_error}});e.session.md5.update(i),e.session.sha1.update(i),(e.session.resuming&&a||!e.session.resuming&&!a)&&(I.queue(e,I.createRecord(e,{type:I.ContentType.change_cipher_spec,data:I.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,I.queue(e,I.createRecord(e,{type:I.ContentType.handshake,data:I.createFinished(e)}))),e.expect=a?pQ:bQ,e.handshaking=!1,++e.handshakes,e.peerCertificate=a?e.session.serverCertificate:e.session.clientCertificate,I.flush(e),e.isConnected=!0,e.connected(e),e.process();};I.handleAlert=function(e,t){var r=t.fragment,n={level:r.getByte(),description:r.getByte()},i;switch(n.description){case I.Alert.Description.close_notify:i="Connection closed.";break;case I.Alert.Description.unexpected_message:i="Unexpected message.";break;case I.Alert.Description.bad_record_mac:i="Bad record MAC.";break;case I.Alert.Description.decryption_failed:i="Decryption failed.";break;case I.Alert.Description.record_overflow:i="Record overflow.";break;case I.Alert.Description.decompression_failure:i="Decompression failed.";break;case I.Alert.Description.handshake_failure:i="Handshake failure.";break;case I.Alert.Description.bad_certificate:i="Bad certificate.";break;case I.Alert.Description.unsupported_certificate:i="Unsupported certificate.";break;case I.Alert.Description.certificate_revoked:i="Certificate revoked.";break;case I.Alert.Description.certificate_expired:i="Certificate expired.";break;case I.Alert.Description.certificate_unknown:i="Certificate unknown.";break;case I.Alert.Description.illegal_parameter:i="Illegal parameter.";break;case I.Alert.Description.unknown_ca:i="Unknown certificate authority.";break;case I.Alert.Description.access_denied:i="Access denied.";break;case I.Alert.Description.decode_error:i="Decode error.";break;case I.Alert.Description.decrypt_error:i="Decrypt error.";break;case I.Alert.Description.export_restriction:i="Export restriction.";break;case I.Alert.Description.protocol_version:i="Unsupported protocol version.";break;case I.Alert.Description.insufficient_security:i="Insufficient security.";break;case I.Alert.Description.internal_error:i="Internal error.";break;case I.Alert.Description.user_canceled:i="User canceled.";break;case I.Alert.Description.no_renegotiation:i="Renegotiation not supported.";break;default:i="Unknown error.";break}if(n.description===I.Alert.Description.close_notify)return e.close();e.error(e,{message:i,send:!1,origin:e.entity===I.ConnectionEnd.client?"server":"client",alert:n}),e.process();};I.handleHandshake=function(e,t){var r=t.fragment,n=r.getByte(),i=r.getInt24();if(i>r.length())return e.fragmented=t,t.fragment=de.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var s=r.bytes(i+4);r.read+=4,n in ed[e.entity][e.expect]?(e.entity===I.ConnectionEnd.server&&!e.open&&!e.fail&&(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:de.md.md5.create(),sha1:de.md.sha1.create()}),n!==I.HandshakeType.hello_request&&n!==I.HandshakeType.certificate_verify&&n!==I.HandshakeType.finished&&(e.session.md5.update(s),e.session.sha1.update(s)),ed[e.entity][e.expect][n](e,t,i)):I.handleUnexpected(e,t);};I.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process();};I.handleHeartbeat=function(e,t){var r=t.fragment,n=r.getByte(),i=r.getInt16(),s=r.getBytes(i);if(n===I.HeartbeatMessageType.heartbeat_request){if(e.handshaking||i>s.length)return e.process();I.queue(e,I.createRecord(e,{type:I.ContentType.heartbeat,data:I.createHeartbeat(I.HeartbeatMessageType.heartbeat_response,s)})),I.flush(e);}else if(n===I.HeartbeatMessageType.heartbeat_response){if(s!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,de.util.createBuffer(s));}e.process();};var cQ=0,lQ=1,XN=2,fQ=3,dQ=4,eD=5,hQ=6,pQ=7,gQ=8,mQ=0,yQ=1,Py=2,vQ=3,Ny=4,_Q=5,bQ=6,R=I.handleUnexpected,tD=I.handleChangeCipherSpec,wr=I.handleAlert,Vr=I.handleHandshake,rD=I.handleApplicationData,Cr=I.handleHeartbeat,Dy=[];Dy[I.ConnectionEnd.client]=[[R,wr,Vr,R,Cr],[R,wr,Vr,R,Cr],[R,wr,Vr,R,Cr],[R,wr,Vr,R,Cr],[R,wr,Vr,R,Cr],[tD,wr,R,R,Cr],[R,wr,Vr,R,Cr],[R,wr,Vr,rD,Cr],[R,wr,Vr,R,Cr]];Dy[I.ConnectionEnd.server]=[[R,wr,Vr,R,Cr],[R,wr,Vr,R,Cr],[R,wr,Vr,R,Cr],[R,wr,Vr,R,Cr],[tD,wr,R,R,Cr],[R,wr,Vr,R,Cr],[R,wr,Vr,rD,Cr],[R,wr,Vr,R,Cr]];var cs=I.handleHelloRequest,SQ=I.handleServerHello,nD=I.handleCertificate,JN=I.handleServerKeyExchange,Ry=I.handleCertificateRequest,Xf=I.handleServerHelloDone,iD=I.handleFinished,ed=[];ed[I.ConnectionEnd.client]=[[R,R,SQ,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R],[cs,R,R,R,R,R,R,R,R,R,R,nD,JN,Ry,Xf,R,R,R,R,R,R],[cs,R,R,R,R,R,R,R,R,R,R,R,JN,Ry,Xf,R,R,R,R,R,R],[cs,R,R,R,R,R,R,R,R,R,R,R,R,Ry,Xf,R,R,R,R,R,R],[cs,R,R,R,R,R,R,R,R,R,R,R,R,R,Xf,R,R,R,R,R,R],[cs,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R],[cs,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,iD],[cs,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R],[cs,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R]];var EQ=I.handleClientHello,wQ=I.handleClientKeyExchange,CQ=I.handleCertificateVerify;ed[I.ConnectionEnd.server]=[[R,EQ,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R],[R,R,R,R,R,R,R,R,R,R,R,nD,R,R,R,R,R,R,R,R,R],[R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,wQ,R,R,R,R],[R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,CQ,R,R,R,R,R],[R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R],[R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,iD],[R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R],[R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R]];I.generateKeys=function(e,t){var r=td,n=t.client_random+t.server_random;e.session.resuming||(t.master_secret=r(t.pre_master_secret,"master secret",n,48).bytes(),t.pre_master_secret=null),n=t.server_random+t.client_random;var i=2*t.mac_key_length+2*t.enc_key_length,s=e.version.major===I.Versions.TLS_1_0.major&&e.version.minor===I.Versions.TLS_1_0.minor;s&&(i+=2*t.fixed_iv_length);var a=r(t.master_secret,"key expansion",n,i),o={client_write_MAC_key:a.getBytes(t.mac_key_length),server_write_MAC_key:a.getBytes(t.mac_key_length),client_write_key:a.getBytes(t.enc_key_length),server_write_key:a.getBytes(t.enc_key_length)};return s&&(o.client_write_IV=a.getBytes(t.fixed_iv_length),o.server_write_IV=a.getBytes(t.fixed_iv_length)),o};I.createConnectionState=function(e){var t=e.entity===I.ConnectionEnd.client,r=function(){var s={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(a){return !0},compressionState:null,compressFunction:function(a){return !0},updateSequenceNumber:function(){s.sequenceNumber[1]===4294967295?(s.sequenceNumber[1]=0,++s.sequenceNumber[0]):++s.sequenceNumber[1];}};return s},n={read:r(),write:r()};if(n.read.update=function(s,a){return n.read.cipherFunction(a,n.read)?n.read.compressFunction(s,a,n.read)||s.error(s,{message:"Could not decompress record.",send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.decompression_failure}}):s.error(s,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.bad_record_mac}}),!s.fail},n.write.update=function(s,a){return n.write.compressFunction(s,a,n.write)?n.write.cipherFunction(a,n.write)||s.error(s,{message:"Could not encrypt record.",send:!1,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.internal_error}}):s.error(s,{message:"Could not compress record.",send:!1,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.internal_error}}),!s.fail},e.session){var i=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(i),i.keys=I.generateKeys(e,i),n.read.macKey=t?i.keys.server_write_MAC_key:i.keys.client_write_MAC_key,n.write.macKey=t?i.keys.client_write_MAC_key:i.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(n,e,i),i.compression_algorithm){case I.CompressionMethod.none:break;case I.CompressionMethod.deflate:n.read.compressFunction=uQ,n.write.compressFunction=oQ;break;default:throw new Error("Unsupported compression algorithm.")}}return n};I.createRandom=function(){var e=new Date,t=+e+e.getTimezoneOffset()*6e4,r=de.util.createBuffer();return r.putInt32(t),r.putBytes(de.random.getBytes(28)),r};I.createRecord=function(e,t){if(!t.data)return null;var r={type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data};return r};I.createAlert=function(e,t){var r=de.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),I.createRecord(e,{type:I.ContentType.alert,data:r})};I.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=de.util.createBuffer(),r=0;r<e.cipherSuites.length;++r){var n=e.cipherSuites[r];t.putByte(n.id[0]),t.putByte(n.id[1]);}var i=t.length(),s=de.util.createBuffer();s.putByte(I.CompressionMethod.none);var a=s.length(),o=de.util.createBuffer();if(e.virtualHost){var c=de.util.createBuffer();c.putByte(0),c.putByte(0);var l=de.util.createBuffer();l.putByte(0),In(l,2,de.util.createBuffer(e.virtualHost));var u=de.util.createBuffer();In(u,2,l),In(c,2,u),o.putBuffer(c);}var f=o.length();f>0&&(f+=2);var h=e.session.id,p=h.length+1+2+4+28+2+i+1+a+f,m=de.util.createBuffer();return m.putByte(I.HandshakeType.client_hello),m.putInt24(p),m.putByte(e.version.major),m.putByte(e.version.minor),m.putBytes(e.session.sp.client_random),In(m,1,de.util.createBuffer(h)),In(m,2,t),In(m,1,s),f>0&&In(m,2,o),m};I.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,n=de.util.createBuffer();return n.putByte(I.HandshakeType.server_hello),n.putInt24(r),n.putByte(e.version.major),n.putByte(e.version.minor),n.putBytes(e.session.sp.server_random),In(n,1,de.util.createBuffer(t)),n.putByte(e.session.cipherSuite.id[0]),n.putByte(e.session.cipherSuite.id[1]),n.putByte(e.session.compressionMethod),n};I.createCertificate=function(e){var t=e.entity===I.ConnectionEnd.client,r=null;if(e.getCertificate){var n;t?n=e.session.certificateRequest:n=e.session.extensions.server_name.serverNameList,r=e.getCertificate(e,n);}var i=de.util.createBuffer();if(r!==null)try{de.util.isArray(r)||(r=[r]);for(var s=null,a=0;a<r.length;++a){var o=de.pem.decode(r[a])[0];if(o.type!=="CERTIFICATE"&&o.type!=="X509 CERTIFICATE"&&o.type!=="TRUSTED CERTIFICATE"){var c=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw c.headerType=o.type,c}if(o.procType&&o.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var l=de.util.createBuffer(o.body);s===null&&(s=de.asn1.fromDer(l.bytes(),!1));var u=de.util.createBuffer();In(u,3,l),i.putBuffer(u);}r=de.pki.certificateFromAsn1(s),t?e.session.clientCertificate=r:e.session.serverCertificate=r;}catch(p){return e.error(e,{message:"Could not send certificate list.",cause:p,send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.bad_certificate}})}var f=3+i.length(),h=de.util.createBuffer();return h.putByte(I.HandshakeType.certificate),h.putInt24(f),In(h,3,i),h};I.createClientKeyExchange=function(e){var t=de.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(de.random.getBytes(46));var r=e.session.sp;r.pre_master_secret=t.getBytes();var n=e.session.serverCertificate.publicKey;t=n.encrypt(r.pre_master_secret);var i=t.length+2,s=de.util.createBuffer();return s.putByte(I.HandshakeType.client_key_exchange),s.putInt24(i),s.putInt16(t.length),s.putBytes(t),s};I.createServerKeyExchange=function(e){var r=de.util.createBuffer();return r};I.getClientSignature=function(e,t){var r=de.util.createBuffer();r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest()),r=r.getBytes(),e.getSignature=e.getSignature||function(n,i,s){var a=null;if(n.getPrivateKey)try{a=n.getPrivateKey(n,n.session.clientCertificate),a=de.pki.privateKeyFromPem(a);}catch(o){n.error(n,{message:"Could not get private key.",cause:o,send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.internal_error}});}a===null?n.error(n,{message:"No private key set.",send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.internal_error}}):i=a.sign(i,null),s(n,i);},e.getSignature(e,r,t);};I.createCertificateVerify=function(e,t){var r=t.length+2,n=de.util.createBuffer();return n.putByte(I.HandshakeType.certificate_verify),n.putInt24(r),n.putInt16(t.length),n.putBytes(t),n};I.createCertificateRequest=function(e){var t=de.util.createBuffer();t.putByte(1);var r=de.util.createBuffer();for(var n in e.caStore.certs){var i=e.caStore.certs[n],s=de.pki.distinguishedNameToAsn1(i.subject),a=de.asn1.toDer(s);r.putInt16(a.length()),r.putBuffer(a);}var o=1+t.length()+2+r.length(),c=de.util.createBuffer();return c.putByte(I.HandshakeType.certificate_request),c.putInt24(o),In(c,1,t),In(c,2,r),c};I.createServerHelloDone=function(e){var t=de.util.createBuffer();return t.putByte(I.HandshakeType.server_hello_done),t.putInt24(0),t};I.createChangeCipherSpec=function(){var e=de.util.createBuffer();return e.putByte(1),e};I.createFinished=function(e){var t=de.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var r=e.entity===I.ConnectionEnd.client,n=e.session.sp,i=12,s=td,a=r?"client finished":"server finished";t=s(n.master_secret,a,t.getBytes(),i);var o=de.util.createBuffer();return o.putByte(I.HandshakeType.finished),o.putInt24(t.length()),o.putBuffer(t),o};I.createHeartbeat=function(e,t,r){typeof r>"u"&&(r=t.length);var n=de.util.createBuffer();n.putByte(e),n.putInt16(r),n.putBytes(t);var i=n.length(),s=Math.max(16,i-r-3);return n.putBytes(de.random.getBytes(s)),n};I.queue=function(e,t){if(t&&!(t.fragment.length()===0&&(t.type===I.ContentType.handshake||t.type===I.ContentType.alert||t.type===I.ContentType.change_cipher_spec))){if(t.type===I.ContentType.handshake){var r=t.fragment.bytes();e.session.md5.update(r),e.session.sha1.update(r),r=null;}var n;if(t.fragment.length()<=I.MaxFragment)n=[t];else {n=[];for(var i=t.fragment.bytes();i.length>I.MaxFragment;)n.push(I.createRecord(e,{type:t.type,data:de.util.createBuffer(i.slice(0,I.MaxFragment))})),i=i.slice(I.MaxFragment);i.length>0&&n.push(I.createRecord(e,{type:t.type,data:de.util.createBuffer(i)}));}for(var s=0;s<n.length&&!e.fail;++s){var a=n[s],o=e.state.current.write;o.update(e,a)&&e.records.push(a);}}};I.flush=function(e){for(var t=0;t<e.records.length;++t){var r=e.records[t];e.tlsData.putByte(r.type),e.tlsData.putByte(r.version.major),e.tlsData.putByte(r.version.minor),e.tlsData.putInt16(r.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment);}return e.records=[],e.tlsDataReady(e)};var Iy=function(e){switch(e){case!0:return !0;case de.pki.certificateError.bad_certificate:return I.Alert.Description.bad_certificate;case de.pki.certificateError.unsupported_certificate:return I.Alert.Description.unsupported_certificate;case de.pki.certificateError.certificate_revoked:return I.Alert.Description.certificate_revoked;case de.pki.certificateError.certificate_expired:return I.Alert.Description.certificate_expired;case de.pki.certificateError.certificate_unknown:return I.Alert.Description.certificate_unknown;case de.pki.certificateError.unknown_ca:return I.Alert.Description.unknown_ca;default:return I.Alert.Description.bad_certificate}},xQ=function(e){switch(e){case!0:return !0;case I.Alert.Description.bad_certificate:return de.pki.certificateError.bad_certificate;case I.Alert.Description.unsupported_certificate:return de.pki.certificateError.unsupported_certificate;case I.Alert.Description.certificate_revoked:return de.pki.certificateError.certificate_revoked;case I.Alert.Description.certificate_expired:return de.pki.certificateError.certificate_expired;case I.Alert.Description.certificate_unknown:return de.pki.certificateError.certificate_unknown;case I.Alert.Description.unknown_ca:return de.pki.certificateError.unknown_ca;default:return de.pki.certificateError.bad_certificate}};I.verifyCertificateChain=function(e,t){try{var r={};for(var n in e.verifyOptions)r[n]=e.verifyOptions[n];r.verify=function(s,a,o){var l=e.verify(e,s,a,o);if(l!==!0){if(typeof l=="object"&&!de.util.isArray(l)){var u=new Error("The application rejected the certificate.");throw u.send=!0,u.alert={level:I.Alert.Level.fatal,description:I.Alert.Description.bad_certificate},l.message&&(u.message=l.message),l.alert&&(u.alert.description=l.alert),u}l!==s&&(l=xQ(l));}return l},de.pki.verifyCertificateChain(e.caStore,t,r);}catch(s){var i=s;(typeof i!="object"||de.util.isArray(i))&&(i={send:!0,alert:{level:I.Alert.Level.fatal,description:Iy(s)}}),"send"in i||(i.send=!0),"alert"in i||(i.alert={level:I.Alert.Level.fatal,description:Iy(i.error)}),e.error(e,i);}return !e.fail};I.createSessionCache=function(e,t){var r=null;if(e&&e.getSession&&e.setSession&&e.order)r=e;else {r={},r.cache=e||{},r.capacity=Math.max(t||100,1),r.order=[];for(var n in e)r.order.length<=t?r.order.push(n):delete e[n];r.getSession=function(i){var s=null,a=null;if(i?a=de.util.bytesToHex(i):r.order.length>0&&(a=r.order[0]),a!==null&&a in r.cache){s=r.cache[a],delete r.cache[a];for(var o in r.order)if(r.order[o]===a){r.order.splice(o,1);break}}return s},r.setSession=function(i,s){if(r.order.length===r.capacity){var a=r.order.shift();delete r.cache[a];}var a=de.util.bytesToHex(i);r.order.push(a),r.cache[a]=s;};}return r};I.createConnection=function(e){var t=null;e.caStore?de.util.isArray(e.caStore)?t=de.pki.createCaStore(e.caStore):t=e.caStore:t=de.pki.createCaStore();var r=e.cipherSuites||null;if(r===null){r=[];for(var n in I.CipherSuites)r.push(I.CipherSuites[n]);}var i=e.server?I.ConnectionEnd.server:I.ConnectionEnd.client,s=e.sessionCache?I.createSessionCache(e.sessionCache):null,a={version:{major:I.Version.major,minor:I.Version.minor},entity:i,sessionId:e.sessionId,caStore:t,sessionCache:s,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(u,f,h,p){return f},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:de.util.createBuffer(),tlsData:de.util.createBuffer(),data:de.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(u,f){f.origin=f.origin||(u.entity===I.ConnectionEnd.client?"client":"server"),f.send&&(I.queue(u,I.createAlert(u,f.alert)),I.flush(u));var h=f.fatal!==!1;h&&(u.fail=!0),e.error(u,f),h&&u.close(!1);},deflate:e.deflate||null,inflate:e.inflate||null};a.reset=function(u){a.version={major:I.Version.major,minor:I.Version.minor},a.record=null,a.session=null,a.peerCertificate=null,a.state={pending:null,current:null},a.expect=a.entity===I.ConnectionEnd.client?cQ:mQ,a.fragmented=null,a.records=[],a.open=!1,a.handshakes=0,a.handshaking=!1,a.isConnected=!1,a.fail=!(u||typeof u>"u"),a.input.clear(),a.tlsData.clear(),a.data.clear(),a.state.current=I.createConnectionState(a);},a.reset();var o=function(u,f){var h=f.type-I.ContentType.change_cipher_spec,p=Dy[u.entity][u.expect];h in p?p[h](u,f):I.handleUnexpected(u,f);},c=function(u){var f=0,h=u.input,p=h.length();if(p<5)f=5-p;else {u.record={type:h.getByte(),version:{major:h.getByte(),minor:h.getByte()},length:h.getInt16(),fragment:de.util.createBuffer(),ready:!1};var m=u.record.version.major===u.version.major;m&&u.session&&u.session.version&&(m=u.record.version.minor===u.version.minor),m||u.error(u,{message:"Incompatible TLS version.",send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.protocol_version}});}return f},l=function(u){var f=0,h=u.input,p=h.length();if(p<u.record.length)f=u.record.length-p;else {u.record.fragment.putBytes(h.getBytes(u.record.length)),h.compact();var m=u.state.current.read;m.update(u,u.record)&&(u.fragmented!==null&&(u.fragmented.type===u.record.type?(u.fragmented.fragment.putBuffer(u.record.fragment),u.record=u.fragmented):u.error(u,{message:"Invalid fragmented record.",send:!0,alert:{level:I.Alert.Level.fatal,description:I.Alert.Description.unexpected_message}})),u.record.ready=!0);}return f};return a.handshake=function(u){if(a.entity!==I.ConnectionEnd.client)a.error(a,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(a.handshaking)a.error(a,{message:"Handshake already in progress.",fatal:!1});else {a.fail&&!a.open&&a.handshakes===0&&(a.fail=!1),a.handshaking=!0,u=u||"";var f=null;u.length>0&&(a.sessionCache&&(f=a.sessionCache.getSession(u)),f===null&&(u="")),u.length===0&&a.sessionCache&&(f=a.sessionCache.getSession(),f!==null&&(u=f.id)),a.session={id:u,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:de.md.md5.create(),sha1:de.md.sha1.create()},f&&(a.version=f.version,a.session.sp=f.sp),a.session.sp.client_random=I.createRandom().getBytes(),a.open=!0,I.queue(a,I.createRecord(a,{type:I.ContentType.handshake,data:I.createClientHello(a)})),I.flush(a);}},a.process=function(u){var f=0;return u&&a.input.putBytes(u),a.fail||(a.record!==null&&a.record.ready&&a.record.fragment.isEmpty()&&(a.record=null),a.record===null&&(f=c(a)),!a.fail&&a.record!==null&&!a.record.ready&&(f=l(a)),!a.fail&&a.record!==null&&a.record.ready&&o(a,a.record)),f},a.prepare=function(u){return I.queue(a,I.createRecord(a,{type:I.ContentType.application_data,data:de.util.createBuffer(u)})),I.flush(a)},a.prepareHeartbeatRequest=function(u,f){return u instanceof de.util.ByteBuffer&&(u=u.bytes()),typeof f>"u"&&(f=u.length),a.expectedHeartbeatPayload=u,I.queue(a,I.createRecord(a,{type:I.ContentType.heartbeat,data:I.createHeartbeat(I.HeartbeatMessageType.heartbeat_request,u,f)})),I.flush(a)},a.close=function(u){if(!a.fail&&a.sessionCache&&a.session){var f={id:a.session.id,version:a.session.version,sp:a.session.sp};f.sp.keys=null,a.sessionCache.setSession(f.id,f);}a.open&&(a.open=!1,a.input.clear(),(a.isConnected||a.handshaking)&&(a.isConnected=a.handshaking=!1,I.queue(a,I.createAlert(a,{level:I.Alert.Level.warning,description:I.Alert.Description.close_notify})),I.flush(a)),a.closed(a)),a.reset(u);},a};sD.exports=de.tls=de.tls||{};for(Jf in I)typeof I[Jf]!="function"&&(de.tls[Jf]=I[Jf]);var Jf;de.tls.prf_tls1=td;de.tls.hmac_sha1=aQ;de.tls.createSessionCache=I.createSessionCache;de.tls.createConnection=I.createConnection;});var uD=P((xae,oD)=>{var ls=Je();ns();ky();var Pn=oD.exports=ls.tls;Pn.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=Pn.BulkCipherAlgorithm.aes,e.cipher_type=Pn.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=Pn.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20;},initConnectionState:aD};Pn.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=Pn.BulkCipherAlgorithm.aes,e.cipher_type=Pn.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=Pn.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20;},initConnectionState:aD};function aD(e,t,r){var n=t.entity===ls.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:ls.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},e.write.cipherState={init:!1,cipher:ls.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},e.read.cipherFunction=IQ,e.write.cipherFunction=TQ,e.read.macLength=e.write.macLength=r.mac_length,e.read.macFunction=e.write.macFunction=Pn.hmac_sha1;}function TQ(e,t){var r=!1,n=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(n),t.updateSequenceNumber();var i;e.version.minor===Pn.Versions.TLS_1_0.minor?i=t.cipherState.init?null:t.cipherState.iv:i=ls.random.getBytesSync(16),t.cipherState.init=!0;var s=t.cipherState.cipher;return s.start({iv:i}),e.version.minor>=Pn.Versions.TLS_1_1.minor&&s.output.putBytes(i),s.update(e.fragment),s.finish(AQ)&&(e.fragment=s.output,e.length=e.fragment.length(),r=!0),r}function AQ(e,t,r){if(!r){var n=e-t.length()%e;t.fillWithByte(n-1,n);}return !0}function RQ(e,t,r){var n=!0;if(r){for(var i=t.length(),s=t.last(),a=i-1-s;a<i-1;++a)n=n&&t.at(a)==s;n&&t.truncate(s+1);}return n}function IQ(e,t){var r=!1,n;e.version.minor===Pn.Versions.TLS_1_0.minor?n=t.cipherState.init?null:t.cipherState.iv:n=e.fragment.getBytes(16),t.cipherState.init=!0;var i=t.cipherState.cipher;i.start({iv:n}),i.update(e.fragment),r=i.finish(RQ);var s=t.macLength,a=ls.random.getBytesSync(s),o=i.output.length();o>=s?(e.fragment=i.output.getBytes(o-s),a=i.output.getBytes(s)):e.fragment=i.output.getBytes(),e.fragment=ls.util.createBuffer(e.fragment),e.length=e.fragment.length();var c=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),r=PQ(t.macKey,a,c)&&r,r}function PQ(e,t,r){var n=ls.hmac.create();return n.start("SHA1",e),n.update(t),t=n.digest().getBytes(),n.start(null,null),n.update(r),r=n.digest().getBytes(),t===r}});var By=P((Tae,dD)=>{var jt=Je();oi();mt();var zu=dD.exports=jt.sha512=jt.sha512||{};jt.md.sha512=jt.md.algorithms.sha512=zu;var lD=jt.sha384=jt.sha512.sha384=jt.sha512.sha384||{};lD.create=function(){return zu.create("SHA-384")};jt.md.sha384=jt.md.algorithms.sha384=lD;jt.sha512.sha256=jt.sha512.sha256||{create:function(){return zu.create("SHA-512/256")}};jt.md["sha512/256"]=jt.md.algorithms["sha512/256"]=jt.sha512.sha256;jt.sha512.sha224=jt.sha512.sha224||{create:function(){return zu.create("SHA-512/224")}};jt.md["sha512/224"]=jt.md.algorithms["sha512/224"]=jt.sha512.sha224;zu.create=function(e){if(fD||NQ(),typeof e>"u"&&(e="SHA-512"),!(e in ra))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=ra[e],r=null,n=jt.util.createBuffer(),i=new Array(80),s=0;s<80;++s)i[s]=new Array(2);var a=64;switch(e){case"SHA-384":a=48;break;case"SHA-512/256":a=32;break;case"SHA-512/224":a=28;break}var o={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:a,messageLength:0,fullMessageLength:null,messageLengthSize:16};return o.start=function(){o.messageLength=0,o.fullMessageLength=o.messageLength128=[];for(var c=o.messageLengthSize/4,l=0;l<c;++l)o.fullMessageLength.push(0);n=jt.util.createBuffer(),r=new Array(t.length);for(var l=0;l<t.length;++l)r[l]=t[l].slice(0);return o},o.start(),o.update=function(c,l){l==="utf8"&&(c=jt.util.encodeUtf8(c));var u=c.length;o.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var f=o.fullMessageLength.length-1;f>=0;--f)o.fullMessageLength[f]+=u[1],u[1]=u[0]+(o.fullMessageLength[f]/4294967296>>>0),o.fullMessageLength[f]=o.fullMessageLength[f]>>>0,u[0]=u[1]/4294967296>>>0;return n.putBytes(c),cD(r,i,n),(n.read>2048||n.length()===0)&&n.compact(),o},o.digest=function(){var c=jt.util.createBuffer();c.putBytes(n.bytes());var l=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize,u=l&o.blockLength-1;c.putBytes(Oy.substr(0,o.blockLength-u));for(var f,h,p=o.fullMessageLength[0]*8,m=0;m<o.fullMessageLength.length-1;++m)f=o.fullMessageLength[m+1]*8,h=f/4294967296>>>0,p+=h,c.putInt32(p>>>0),p=f>>>0;c.putInt32(p);for(var _=new Array(r.length),m=0;m<r.length;++m)_[m]=r[m].slice(0);cD(_,i,c);var E=jt.util.createBuffer(),w;e==="SHA-512"?w=_.length:e==="SHA-384"?w=_.length-2:w=_.length-4;for(var m=0;m<w;++m)E.putInt32(_[m][0]),(m!==w-1||e!=="SHA-512/224")&&E.putInt32(_[m][1]);return E},o};var Oy=null,fD=!1,Ly=null,ra=null;function NQ(){Oy="\x80",Oy+=jt.util.fillString("\0",128),Ly=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],ra={},ra["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],ra["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],ra["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],ra["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],fD=!0;}function cD(e,t,r){for(var n,i,s,a,o,c,l,u,f,h,p,m,_,E,w,y,b,N,L,V,X,z,G,ee,U,ie,me,Pe,W,K,se,Ae,Fe,Ke,Ve,ot=r.length();ot>=128;){for(W=0;W<16;++W)t[W][0]=r.getInt32()>>>0,t[W][1]=r.getInt32()>>>0;for(;W<80;++W)Ae=t[W-2],K=Ae[0],se=Ae[1],n=((K>>>19|se<<13)^(se>>>29|K<<3)^K>>>6)>>>0,i=((K<<13|se>>>19)^(se<<3|K>>>29)^(K<<26|se>>>6))>>>0,Ke=t[W-15],K=Ke[0],se=Ke[1],s=((K>>>1|se<<31)^(K>>>8|se<<24)^K>>>7)>>>0,a=((K<<31|se>>>1)^(K<<24|se>>>8)^(K<<25|se>>>7))>>>0,Fe=t[W-7],Ve=t[W-16],se=i+Fe[1]+a+Ve[1],t[W][0]=n+Fe[0]+s+Ve[0]+(se/4294967296>>>0)>>>0,t[W][1]=se>>>0;for(_=e[0][0],E=e[0][1],w=e[1][0],y=e[1][1],b=e[2][0],N=e[2][1],L=e[3][0],V=e[3][1],X=e[4][0],z=e[4][1],G=e[5][0],ee=e[5][1],U=e[6][0],ie=e[6][1],me=e[7][0],Pe=e[7][1],W=0;W<80;++W)l=((X>>>14|z<<18)^(X>>>18|z<<14)^(z>>>9|X<<23))>>>0,u=((X<<18|z>>>14)^(X<<14|z>>>18)^(z<<23|X>>>9))>>>0,f=(U^X&(G^U))>>>0,h=(ie^z&(ee^ie))>>>0,o=((_>>>28|E<<4)^(E>>>2|_<<30)^(E>>>7|_<<25))>>>0,c=((_<<4|E>>>28)^(E<<30|_>>>2)^(E<<25|_>>>7))>>>0,p=(_&w|b&(_^w))>>>0,m=(E&y|N&(E^y))>>>0,se=Pe+u+h+Ly[W][1]+t[W][1],n=me+l+f+Ly[W][0]+t[W][0]+(se/4294967296>>>0)>>>0,i=se>>>0,se=c+m,s=o+p+(se/4294967296>>>0)>>>0,a=se>>>0,me=U,Pe=ie,U=G,ie=ee,G=X,ee=z,se=V+i,X=L+n+(se/4294967296>>>0)>>>0,z=se>>>0,L=b,V=N,b=w,N=y,w=_,y=E,se=i+a,_=n+s+(se/4294967296>>>0)>>>0,E=se>>>0;se=e[0][1]+E,e[0][0]=e[0][0]+_+(se/4294967296>>>0)>>>0,e[0][1]=se>>>0,se=e[1][1]+y,e[1][0]=e[1][0]+w+(se/4294967296>>>0)>>>0,e[1][1]=se>>>0,se=e[2][1]+N,e[2][0]=e[2][0]+b+(se/4294967296>>>0)>>>0,e[2][1]=se>>>0,se=e[3][1]+V,e[3][0]=e[3][0]+L+(se/4294967296>>>0)>>>0,e[3][1]=se>>>0,se=e[4][1]+z,e[4][0]=e[4][0]+X+(se/4294967296>>>0)>>>0,e[4][1]=se>>>0,se=e[5][1]+ee,e[5][0]=e[5][0]+G+(se/4294967296>>>0)>>>0,e[5][1]=se>>>0,se=e[6][1]+ie,e[6][0]=e[6][0]+U+(se/4294967296>>>0)>>>0,e[6][1]=se>>>0,se=e[7][1]+Pe,e[7][0]=e[7][0]+me+(se/4294967296>>>0)>>>0,e[7][1]=se>>>0,ot-=128;}}});var hD=P(Fy=>{var DQ=Je();zn();var mr=DQ.asn1;Fy.privateKeyValidator={name:"PrivateKeyInfo",tagClass:mr.Class.UNIVERSAL,type:mr.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:mr.Class.UNIVERSAL,type:mr.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:mr.Class.UNIVERSAL,type:mr.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:mr.Class.UNIVERSAL,type:mr.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:mr.Class.UNIVERSAL,type:mr.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};Fy.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:mr.Class.UNIVERSAL,type:mr.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:mr.Class.UNIVERSAL,type:mr.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:mr.Class.UNIVERSAL,type:mr.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:mr.Class.UNIVERSAL,type:mr.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]};});var TD=P((Rae,xD)=>{var xr=Je();Vu();xn();By();mt();var _D=hD(),kQ=_D.publicKeyValidator,OQ=_D.privateKeyValidator;var Uy=xr.util.ByteBuffer,Xr=typeof Buffer>"u"?Uint8Array:Buffer;xr.pki=xr.pki||{};xD.exports=xr.pki.ed25519=xr.ed25519=xr.ed25519||{};var at=xr.ed25519;at.constants={};at.constants.PUBLIC_KEY_BYTE_LENGTH=32;at.constants.PRIVATE_KEY_BYTE_LENGTH=64;at.constants.SEED_BYTE_LENGTH=32;at.constants.SIGN_BYTE_LENGTH=64;at.constants.HASH_BYTE_LENGTH=64;at.generateKeyPair=function(e){e=e||{};var t=e.seed;if(t===void 0)t=xr.random.getBytesSync(at.constants.SEED_BYTE_LENGTH);else if(typeof t=="string"){if(t.length!==at.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+at.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=Oi({message:t,encoding:"binary"});for(var r=new Xr(at.constants.PUBLIC_KEY_BYTE_LENGTH),n=new Xr(at.constants.PRIVATE_KEY_BYTE_LENGTH),i=0;i<32;++i)n[i]=t[i];return MQ(r,n),{publicKey:r,privateKey:n}};at.privateKeyFromAsn1=function(e){var t={},r=[],n=xr.asn1.validate(e,OQ,t,r);if(!n){var i=new Error("Invalid Key.");throw i.errors=r,i}var s=xr.asn1.derToOid(t.privateKeyOid),a=xr.oids.EdDSA25519;if(s!==a)throw new Error('Invalid OID "'+s+'"; OID must be "'+a+'".');var o=t.privateKey,c=Oi({message:xr.asn1.fromDer(o).value,encoding:"binary"});return {privateKeyBytes:c}};at.publicKeyFromAsn1=function(e){var t={},r=[],n=xr.asn1.validate(e,kQ,t,r);if(!n){var i=new Error("Invalid Key.");throw i.errors=r,i}var s=xr.asn1.derToOid(t.publicKeyOid),a=xr.oids.EdDSA25519;if(s!==a)throw new Error('Invalid OID "'+s+'"; OID must be "'+a+'".');var o=t.ed25519PublicKey;if(o.length!==at.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return Oi({message:o,encoding:"binary"})};at.publicKeyFromPrivateKey=function(e){e=e||{};var t=Oi({message:e.privateKey,encoding:"binary"});if(t.length!==at.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+at.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new Xr(at.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n<r.length;++n)r[n]=t[32+n];return r};at.sign=function(e){e=e||{};var t=Oi(e),r=Oi({message:e.privateKey,encoding:"binary"});if(r.length===at.constants.SEED_BYTE_LENGTH){var n=at.generateKeyPair({seed:r});r=n.privateKey;}else if(r.length!==at.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+at.constants.SEED_BYTE_LENGTH+" or "+at.constants.PRIVATE_KEY_BYTE_LENGTH);var i=new Xr(at.constants.SIGN_BYTE_LENGTH+t.length);qQ(i,t,t.length,r);for(var s=new Xr(at.constants.SIGN_BYTE_LENGTH),a=0;a<s.length;++a)s[a]=i[a];return s};at.verify=function(e){e=e||{};var t=Oi(e);if(e.signature===void 0)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var r=Oi({message:e.signature,encoding:"binary"});if(r.length!==at.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+at.constants.SIGN_BYTE_LENGTH);var n=Oi({message:e.publicKey,encoding:"binary"});if(n.length!==at.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+at.constants.PUBLIC_KEY_BYTE_LENGTH);var i=new Xr(at.constants.SIGN_BYTE_LENGTH+t.length),s=new Xr(at.constants.SIGN_BYTE_LENGTH+t.length),a;for(a=0;a<at.constants.SIGN_BYTE_LENGTH;++a)i[a]=r[a];for(a=0;a<t.length;++a)i[a+at.constants.SIGN_BYTE_LENGTH]=t[a];return UQ(s,i,i.length,n)>=0};function Oi(e){var t=e.message;if(t instanceof Uint8Array||t instanceof Xr)return t;var r=e.encoding;if(t===void 0)if(e.md)t=e.md.digest().getBytes(),r="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof t=="string"&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof t=="string"){if(typeof Buffer<"u")return Buffer.from(t,r);t=new Uy(t,r);}else if(!(t instanceof Uy))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 Xr(t.length()),i=0;i<n.length;++i)n[i]=t.at(i);return n}var jy=Ue(),rd=Ue([1]),LQ=Ue([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),BQ=Ue([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),gD=Ue([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),mD=Ue([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),My=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),FQ=Ue([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Gu(e,t){var r=xr.md.sha512.create(),n=new Uy(e);r.update(n.getBytes(t),"binary");var i=r.digest().getBytes();if(typeof Buffer<"u")return Buffer.from(i,"binary");for(var s=new Xr(at.constants.HASH_BYTE_LENGTH),a=0;a<64;++a)s[a]=i.charCodeAt(a);return s}function MQ(e,t){var r=[Ue(),Ue(),Ue(),Ue()],n,i=Gu(t,32);for(i[0]&=248,i[31]&=127,i[31]|=64,Wy(r,i),Hy(e,r),n=0;n<32;++n)t[n+32]=e[n];return 0}function qQ(e,t,r,n){var i,s,a=new Float64Array(64),o=[Ue(),Ue(),Ue(),Ue()],c=Gu(n,32);c[0]&=248,c[31]&=127,c[31]|=64;var l=r+64;for(i=0;i<r;++i)e[64+i]=t[i];for(i=0;i<32;++i)e[32+i]=c[32+i];var u=Gu(e.subarray(32),r+32);for($y(u),Wy(o,u),Hy(e,o),i=32;i<64;++i)e[i]=n[i];var f=Gu(e,r+64);for($y(f),i=32;i<64;++i)a[i]=0;for(i=0;i<32;++i)a[i]=u[i];for(i=0;i<32;++i)for(s=0;s<32;s++)a[i+s]+=f[i]*c[s];return bD(e.subarray(32),a),l}function UQ(e,t,r,n){var i,s,a=new Xr(32),o=[Ue(),Ue(),Ue(),Ue()],c=[Ue(),Ue(),Ue(),Ue()];if(s=-1,r<64||jQ(c,n))return -1;for(i=0;i<r;++i)e[i]=t[i];for(i=0;i<32;++i)e[i+32]=n[i];var l=Gu(e,r);if($y(l),wD(o,c,l),Wy(c,t.subarray(32)),Vy(o,c),Hy(a,o),r-=64,SD(t,0,a,0)){for(i=0;i<r;++i)e[i]=0;return -1}for(i=0;i<r;++i)e[i]=t[i+64];return s=r,s}function bD(e,t){var r,n,i,s;for(n=63;n>=32;--n){for(r=0,i=n-32,s=n-12;i<s;++i)t[i]+=r-16*t[n]*My[i-(n-32)],r=t[i]+128>>8,t[i]-=r*256;t[i]+=r,t[n]=0;}for(r=0,i=0;i<32;++i)t[i]+=r-(t[31]>>4)*My[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=r*My[i];for(n=0;n<32;++n)t[n+1]+=t[n]>>8,e[n]=t[n]&255;}function $y(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;bD(e,t);}function Vy(e,t){var r=Ue(),n=Ue(),i=Ue(),s=Ue(),a=Ue(),o=Ue(),c=Ue(),l=Ue(),u=Ue();co(r,e[1],e[0]),co(u,t[1],t[0]),kt(r,r,u),uo(n,e[0],e[1]),uo(u,t[0],t[1]),kt(n,n,u),kt(i,e[3],t[3]),kt(i,i,BQ),kt(s,e[2],t[2]),uo(s,s,s),co(a,n,r),co(o,s,i),uo(c,s,i),uo(l,n,r),kt(e[0],a,o),kt(e[1],l,c),kt(e[2],c,o),kt(e[3],a,l);}function yD(e,t,r){for(var n=0;n<4;++n)CD(e[n],t[n],r);}function Hy(e,t){var r=Ue(),n=Ue(),i=Ue();WQ(i,t[2]),kt(r,t[0],i),kt(n,t[1],i),nd(e,n),e[31]^=ED(r)<<7;}function nd(e,t){var r,n,i,s=Ue(),a=Ue();for(r=0;r<16;++r)a[r]=t[r];for(qy(a),qy(a),qy(a),n=0;n<2;++n){for(s[0]=a[0]-65517,r=1;r<15;++r)s[r]=a[r]-65535-(s[r-1]>>16&1),s[r-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),i=s[15]>>16&1,s[14]&=65535,CD(a,s,1-i);}for(r=0;r<16;r++)e[2*r]=a[r]&255,e[2*r+1]=a[r]>>8;}function jQ(e,t){var r=Ue(),n=Ue(),i=Ue(),s=Ue(),a=Ue(),o=Ue(),c=Ue();return ds(e[2],rd),$Q(e[1],t),na(i,e[1]),kt(s,i,LQ),co(i,i,e[2]),uo(s,e[2],s),na(a,s),na(o,a),kt(c,o,a),kt(r,c,i),kt(r,r,s),VQ(r,r),kt(r,r,i),kt(r,r,s),kt(r,r,s),kt(e[0],r,s),na(n,e[0]),kt(n,n,s),vD(n,i)&&kt(e[0],e[0],FQ),na(n,e[0]),kt(n,n,s),vD(n,i)?-1:(ED(e[0])===t[31]>>7&&co(e[0],jy,e[0]),kt(e[3],e[0],e[1]),0)}function $Q(e,t){var r;for(r=0;r<16;++r)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767;}function VQ(e,t){var r=Ue(),n;for(n=0;n<16;++n)r[n]=t[n];for(n=250;n>=0;--n)na(r,r),n!==1&&kt(r,r,t);for(n=0;n<16;++n)e[n]=r[n];}function vD(e,t){var r=new Xr(32),n=new Xr(32);return nd(r,e),nd(n,t),SD(r,0,n,0)}function SD(e,t,r,n){return HQ(e,t,r,n,32)}function HQ(e,t,r,n,i){var s,a=0;for(s=0;s<i;++s)a|=e[t+s]^r[n+s];return (1&a-1>>>8)-1}function ED(e){var t=new Xr(32);return nd(t,e),t[0]&1}function wD(e,t,r){var n,i;for(ds(e[0],jy),ds(e[1],rd),ds(e[2],rd),ds(e[3],jy),i=255;i>=0;--i)n=r[i/8|0]>>(i&7)&1,yD(e,t,n),Vy(t,e),Vy(e,e),yD(e,t,n);}function Wy(e,t){var r=[Ue(),Ue(),Ue(),Ue()];ds(r[0],gD),ds(r[1],mD),ds(r[2],rd),kt(r[3],gD,mD),wD(e,r,t);}function ds(e,t){var r;for(r=0;r<16;r++)e[r]=t[r]|0;}function WQ(e,t){var r=Ue(),n;for(n=0;n<16;++n)r[n]=t[n];for(n=253;n>=0;--n)na(r,r),n!==2&&n!==4&&kt(r,r,t);for(n=0;n<16;++n)e[n]=r[n];}function qy(e){var t,r,n=1;for(t=0;t<16;++t)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-n*65536;e[0]+=n-1+37*(n-1);}function CD(e,t,r){for(var n,i=~(r-1),s=0;s<16;++s)n=i&(e[s]^t[s]),e[s]^=n,t[s]^=n;}function Ue(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;++t)r[t]=e[t];return r}function uo(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]+r[n];}function co(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]-r[n];}function na(e,t){kt(e,t,t);}function kt(e,t,r){var n,i,s=0,a=0,o=0,c=0,l=0,u=0,f=0,h=0,p=0,m=0,_=0,E=0,w=0,y=0,b=0,N=0,L=0,V=0,X=0,z=0,G=0,ee=0,U=0,ie=0,me=0,Pe=0,W=0,K=0,se=0,Ae=0,Fe=0,Ke=r[0],Ve=r[1],ot=r[2],Dt=r[3],bt=r[4],ft=r[5],Oe=r[6],Rt=r[7],qt=r[8],ye=r[9],je=r[10],le=r[11],Ie=r[12],He=r[13],et=r[14],ze=r[15];n=t[0],s+=n*Ke,a+=n*Ve,o+=n*ot,c+=n*Dt,l+=n*bt,u+=n*ft,f+=n*Oe,h+=n*Rt,p+=n*qt,m+=n*ye,_+=n*je,E+=n*le,w+=n*Ie,y+=n*He,b+=n*et,N+=n*ze,n=t[1],a+=n*Ke,o+=n*Ve,c+=n*ot,l+=n*Dt,u+=n*bt,f+=n*ft,h+=n*Oe,p+=n*Rt,m+=n*qt,_+=n*ye,E+=n*je,w+=n*le,y+=n*Ie,b+=n*He,N+=n*et,L+=n*ze,n=t[2],o+=n*Ke,c+=n*Ve,l+=n*ot,u+=n*Dt,f+=n*bt,h+=n*ft,p+=n*Oe,m+=n*Rt,_+=n*qt,E+=n*ye,w+=n*je,y+=n*le,b+=n*Ie,N+=n*He,L+=n*et,V+=n*ze,n=t[3],c+=n*Ke,l+=n*Ve,u+=n*ot,f+=n*Dt,h+=n*bt,p+=n*ft,m+=n*Oe,_+=n*Rt,E+=n*qt,w+=n*ye,y+=n*je,b+=n*le,N+=n*Ie,L+=n*He,V+=n*et,X+=n*ze,n=t[4],l+=n*Ke,u+=n*Ve,f+=n*ot,h+=n*Dt,p+=n*bt,m+=n*ft,_+=n*Oe,E+=n*Rt,w+=n*qt,y+=n*ye,b+=n*je,N+=n*le,L+=n*Ie,V+=n*He,X+=n*et,z+=n*ze,n=t[5],u+=n*Ke,f+=n*Ve,h+=n*ot,p+=n*Dt,m+=n*bt,_+=n*ft,E+=n*Oe,w+=n*Rt,y+=n*qt,b+=n*ye,N+=n*je,L+=n*le,V+=n*Ie,X+=n*He,z+=n*et,G+=n*ze,n=t[6],f+=n*Ke,h+=n*Ve,p+=n*ot,m+=n*Dt,_+=n*bt,E+=n*ft,w+=n*Oe,y+=n*Rt,b+=n*qt,N+=n*ye,L+=n*je,V+=n*le,X+=n*Ie,z+=n*He,G+=n*et,ee+=n*ze,n=t[7],h+=n*Ke,p+=n*Ve,m+=n*ot,_+=n*Dt,E+=n*bt,w+=n*ft,y+=n*Oe,b+=n*Rt,N+=n*qt,L+=n*ye,V+=n*je,X+=n*le,z+=n*Ie,G+=n*He,ee+=n*et,U+=n*ze,n=t[8],p+=n*Ke,m+=n*Ve,_+=n*ot,E+=n*Dt,w+=n*bt,y+=n*ft,b+=n*Oe,N+=n*Rt,L+=n*qt,V+=n*ye,X+=n*je,z+=n*le,G+=n*Ie,ee+=n*He,U+=n*et,ie+=n*ze,n=t[9],m+=n*Ke,_+=n*Ve,E+=n*ot,w+=n*Dt,y+=n*bt,b+=n*ft,N+=n*Oe,L+=n*Rt,V+=n*qt,X+=n*ye,z+=n*je,G+=n*le,ee+=n*Ie,U+=n*He,ie+=n*et,me+=n*ze,n=t[10],_+=n*Ke,E+=n*Ve,w+=n*ot,y+=n*Dt,b+=n*bt,N+=n*ft,L+=n*Oe,V+=n*Rt,X+=n*qt,z+=n*ye,G+=n*je,ee+=n*le,U+=n*Ie,ie+=n*He,me+=n*et,Pe+=n*ze,n=t[11],E+=n*Ke,w+=n*Ve,y+=n*ot,b+=n*Dt,N+=n*bt,L+=n*ft,V+=n*Oe,X+=n*Rt,z+=n*qt,G+=n*ye,ee+=n*je,U+=n*le,ie+=n*Ie,me+=n*He,Pe+=n*et,W+=n*ze,n=t[12],w+=n*Ke,y+=n*Ve,b+=n*ot,N+=n*Dt,L+=n*bt,V+=n*ft,X+=n*Oe,z+=n*Rt,G+=n*qt,ee+=n*ye,U+=n*je,ie+=n*le,me+=n*Ie,Pe+=n*He,W+=n*et,K+=n*ze,n=t[13],y+=n*Ke,b+=n*Ve,N+=n*ot,L+=n*Dt,V+=n*bt,X+=n*ft,z+=n*Oe,G+=n*Rt,ee+=n*qt,U+=n*ye,ie+=n*je,me+=n*le,Pe+=n*Ie,W+=n*He,K+=n*et,se+=n*ze,n=t[14],b+=n*Ke,N+=n*Ve,L+=n*ot,V+=n*Dt,X+=n*bt,z+=n*ft,G+=n*Oe,ee+=n*Rt,U+=n*qt,ie+=n*ye,me+=n*je,Pe+=n*le,W+=n*Ie,K+=n*He,se+=n*et,Ae+=n*ze,n=t[15],N+=n*Ke,L+=n*Ve,V+=n*ot,X+=n*Dt,z+=n*bt,G+=n*ft,ee+=n*Oe,U+=n*Rt,ie+=n*qt,me+=n*ye,Pe+=n*je,W+=n*le,K+=n*Ie,se+=n*He,Ae+=n*et,Fe+=n*ze,s+=38*L,a+=38*V,o+=38*X,c+=38*z,l+=38*G,u+=38*ee,f+=38*U,h+=38*ie,p+=38*me,m+=38*Pe,_+=38*W,E+=38*K,w+=38*se,y+=38*Ae,b+=38*Fe,i=1,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=o+i+65535,i=Math.floor(n/65536),o=n-i*65536,n=c+i+65535,i=Math.floor(n/65536),c=n-i*65536,n=l+i+65535,i=Math.floor(n/65536),l=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=f+i+65535,i=Math.floor(n/65536),f=n-i*65536,n=h+i+65535,i=Math.floor(n/65536),h=n-i*65536,n=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=n-i*65536,n=_+i+65535,i=Math.floor(n/65536),_=n-i*65536,n=E+i+65535,i=Math.floor(n/65536),E=n-i*65536,n=w+i+65535,i=Math.floor(n/65536),w=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=b+i+65535,i=Math.floor(n/65536),b=n-i*65536,n=N+i+65535,i=Math.floor(n/65536),N=n-i*65536,s+=i-1+37*(i-1),i=1,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=o+i+65535,i=Math.floor(n/65536),o=n-i*65536,n=c+i+65535,i=Math.floor(n/65536),c=n-i*65536,n=l+i+65535,i=Math.floor(n/65536),l=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=f+i+65535,i=Math.floor(n/65536),f=n-i*65536,n=h+i+65535,i=Math.floor(n/65536),h=n-i*65536,n=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=n-i*65536,n=_+i+65535,i=Math.floor(n/65536),_=n-i*65536,n=E+i+65535,i=Math.floor(n/65536),E=n-i*65536,n=w+i+65535,i=Math.floor(n/65536),w=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=b+i+65535,i=Math.floor(n/65536),b=n-i*65536,n=N+i+65535,i=Math.floor(n/65536),N=n-i*65536,s+=i-1+37*(i-1),e[0]=s,e[1]=a,e[2]=o,e[3]=c,e[4]=l,e[5]=u,e[6]=f,e[7]=h,e[8]=p,e[9]=m,e[10]=_,e[11]=E,e[12]=w,e[13]=y,e[14]=b,e[15]=N;}});var PD=P((Iae,ID)=>{var gn=Je();mt();xn();Vu();ID.exports=gn.kem=gn.kem||{};var AD=gn.jsbn.BigInteger;gn.kem.rsa={};gn.kem.rsa.create=function(e,t){t=t||{};var r=t.prng||gn.random,n={};return n.encrypt=function(i,s){var a=Math.ceil(i.n.bitLength()/8),o;do o=new AD(gn.util.bytesToHex(r.getBytesSync(a)),16).mod(i.n);while(o.compareTo(AD.ONE)<=0);o=gn.util.hexToBytes(o.toString(16));var c=a-o.length;c>0&&(o=gn.util.fillString("\0",c)+o);var l=i.encrypt(o,"NONE"),u=e.generate(o,s);return {encapsulation:l,key:u}},n.decrypt=function(i,s,a){var o=i.decrypt(s,"NONE");return e.generate(o,a)},n};gn.kem.kdf1=function(e,t){RD(this,e,0,t||e.digestLength);};gn.kem.kdf2=function(e,t){RD(this,e,1,t||e.digestLength);};function RD(e,t,r,n){e.generate=function(i,s){for(var a=new gn.util.ByteBuffer,o=Math.ceil(s/n)+r,c=new gn.util.ByteBuffer,l=r;l<o;++l){c.putInt32(l),t.start(),t.update(i+c.getBytes());var u=t.digest();a.putBytes(u.getBytes(n));}return a.truncate(a.length()-s),a.getBytes()};}});var OD=P((Pae,kD)=>{var ct=Je();mt();kD.exports=ct.log=ct.log||{};ct.log.levels=["none","error","warning","info","debug","verbose","max"];var id={},Gy=[],Qu=null;ct.log.LEVEL_LOCKED=2;ct.log.NO_LEVEL_CHECK=4;ct.log.INTERPOLATE=8;for(gi=0;gi<ct.log.levels.length;++gi)Ky=ct.log.levels[gi],id[Ky]={index:gi,name:Ky.toUpperCase()};var Ky,gi;ct.log.logMessage=function(e){for(var t=id[e.level].index,r=0;r<Gy.length;++r){var n=Gy[r];if(n.flags&ct.log.NO_LEVEL_CHECK)n.f(e);else {var i=id[n.level].index;t<=i&&n.f(n,e);}}};ct.log.prepareStandard=function(e){"standard"in e||(e.standard=id[e.level].name+" ["+e.category+"] "+e.message);};ct.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]),e.full=ct.util.format.apply(this,t);}};ct.log.prepareStandardFull=function(e){"standardFull"in e||(ct.log.prepareStandard(e),e.standardFull=e.standard);};for(zy=["error","warning","info","debug","verbose"],gi=0;gi<zy.length;++gi)(function(t){ct.log[t]=function(r,n){var i=Array.prototype.slice.call(arguments).slice(2),s={timestamp:new Date,level:t,category:r,message:n,arguments:i};ct.log.logMessage(s);};})(zy[gi]);var zy,gi;ct.log.makeLogger=function(e){var t={flags:0,f:e};return ct.log.setLevel(t,"none"),t};ct.log.setLevel=function(e,t){var r=!1;if(e&&!(e.flags&ct.log.LEVEL_LOCKED))for(var n=0;n<ct.log.levels.length;++n){var i=ct.log.levels[n];if(t==i){e.level=t,r=!0;break}}return r};ct.log.lock=function(e,t){typeof t>"u"||t?e.flags|=ct.log.LEVEL_LOCKED:e.flags&=~ct.log.LEVEL_LOCKED;};ct.log.addLogger=function(e){Gy.push(e);};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(ND={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},Zu=function(e,t){ct.log.prepareStandard(t);var r=ND[t.level],n=[t.standard];n=n.concat(t.arguments.slice()),r.apply(console,n);},lo=ct.log.makeLogger(Zu)):(Zu=function(t,r){ct.log.prepareStandardFull(r),console.log(r.standardFull);},lo=ct.log.makeLogger(Zu)),ct.log.setLevel(lo,"debug"),ct.log.addLogger(lo),Qu=lo):console={log:function(){}};var lo,ND,Zu;Qu!==null&&typeof window<"u"&&window.location&&(Yu=new URL(window.location.href).searchParams,Yu.has("console.level")&&ct.log.setLevel(Qu,Yu.get("console.level").slice(-1)[0]),Yu.has("console.lock")&&(DD=Yu.get("console.lock").slice(-1)[0],DD=="true"&&ct.log.lock(Qu)));var Yu,DD;ct.log.consoleLogger=Qu;});var BD=P((Nae,LD)=>{LD.exports=oi();Ff();no();oy();By();});var qD=P((Dae,MD)=>{var Ee=Je();ns();zn();ju();is();Qs();Sy();xn();mt();Zf();var $=Ee.asn1,Hr=MD.exports=Ee.pkcs7=Ee.pkcs7||{};Hr.messageFromPem=function(e){var t=Ee.pem.decode(e)[0];if(t.type!=="PKCS7"){var r=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw r.headerType=t.type,r}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var n=$.fromDer(t.body);return Hr.messageFromAsn1(n)};Hr.messageToPem=function(e,t){var r={type:"PKCS7",body:$.toDer(e.toAsn1()).getBytes()};return Ee.pem.encode(r,{maxline:t})};Hr.messageFromAsn1=function(e){var t={},r=[];if(!$.validate(e,Hr.asn1.contentInfoValidator,t,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 i=$.derToOid(t.contentType),s;switch(i){case Ee.pki.oids.envelopedData:s=Hr.createEnvelopedData();break;case Ee.pki.oids.encryptedData:s=Hr.createEncryptedData();break;case Ee.pki.oids.signedData:s=Hr.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+i+" is not (yet) supported.")}return s.fromAsn1(t.content.value[0]),s};Hr.createSignedData=function(){var e=null;return e={type:Ee.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(n){if(Qy(e,n,Hr.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var i=e.rawCapture.certificates.value,s=0;s<i.length;++s)e.certificates.push(Ee.pki.certificateFromAsn1(i[s]));},toAsn1:function(){e.contentInfo||e.sign();for(var n=[],i=0;i<e.certificates.length;++i)n.push(Ee.pki.certificateToAsn1(e.certificates[i]));var s=[],a=$.create($.Class.CONTEXT_SPECIFIC,0,!0,[$.create($.Class.UNIVERSAL,$.Type.SEQUENCE,!0,[$.create($.Class.UNIVERSAL,$.Type.INTEGER,!1,$.integerToDer(e.version).getBytes()),$.create($.Class.UNIVERSAL,$.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return n.length>0&&a.value[0].value.push($.create($.Class.CONTEXT_SPECIFIC,0,!0,n)),s.length>0&&a.value[0].value.push($.create($.Class.CONTEXT_SPECIFIC,1,!0,s)),a.value[0].value.push($.create($.Class.UNIVERSAL,$.Type.SET,!0,e.signerInfos)),$.create($.Class.UNIVERSAL,$.Type.SEQUENCE,!0,[$.create($.Class.UNIVERSAL,$.Type.OID,!1,$.oidToDer(e.type).getBytes()),a])},addSigner:function(n){var i=n.issuer,s=n.serialNumber;if(n.certificate){var a=n.certificate;typeof a=="string"&&(a=Ee.pki.certificateFromPem(a)),i=a.issuer.attributes,s=a.serialNumber;}var o=n.key;if(!o)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof o=="string"&&(o=Ee.pki.privateKeyFromPem(o));var c=n.digestAlgorithm||Ee.pki.oids.sha1;switch(c){case Ee.pki.oids.sha1:case Ee.pki.oids.sha256:case Ee.pki.oids.sha384:case Ee.pki.oids.sha512:case Ee.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+c)}var l=n.authenticatedAttributes||[];if(l.length>0){for(var u=!1,f=!1,h=0;h<l.length;++h){var p=l[h];if(!u&&p.type===Ee.pki.oids.contentType){if(u=!0,f)break;continue}if(!f&&p.type===Ee.pki.oids.messageDigest){if(f=!0,u)break;continue}}if(!u||!f)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:o,version:1,issuer:i,serialNumber:s,digestAlgorithm:c,signatureAlgorithm:Ee.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:l,unauthenticatedAttributes:[]});},sign:function(n){if(n=n||{},(typeof e.content!="object"||e.contentInfo===null)&&(e.contentInfo=$.create($.Class.UNIVERSAL,$.Type.SEQUENCE,!0,[$.create($.Class.UNIVERSAL,$.Type.OID,!1,$.oidToDer(Ee.pki.oids.data).getBytes())]),"content"in e)){var i;e.content instanceof Ee.util.ByteBuffer?i=e.content.bytes():typeof e.content=="string"&&(i=Ee.util.encodeUtf8(e.content)),n.detached?e.detachedContent=$.create($.Class.UNIVERSAL,$.Type.OCTETSTRING,!1,i):e.contentInfo.value.push($.create($.Class.CONTEXT_SPECIFIC,0,!0,[$.create($.Class.UNIVERSAL,$.Type.OCTETSTRING,!1,i)]));}if(e.signers.length!==0){var s=t();r(s);}},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(n){typeof n=="string"&&(n=Ee.pki.certificateFromPem(n)),e.certificates.push(n);},addCertificateRevokationList:function(n){throw new Error("PKCS#7 CRL support not yet implemented.")}},e;function t(){for(var n={},i=0;i<e.signers.length;++i){var s=e.signers[i],a=s.digestAlgorithm;a in n||(n[a]=Ee.md[Ee.pki.oids[a]].create()),s.authenticatedAttributes.length===0?s.md=n[a]:s.md=Ee.md[Ee.pki.oids[a]].create();}e.digestAlgorithmIdentifiers=[];for(var a in n)e.digestAlgorithmIdentifiers.push($.create($.Class.UNIVERSAL,$.Type.SEQUENCE,!0,[$.create($.Class.UNIVERSAL,$.Type.OID,!1,$.oidToDer(a).getBytes()),$.create($.Class.UNIVERSAL,$.Type.NULL,!1,"")]));return n}function r(n){var i;if(e.detachedContent?i=e.detachedContent:(i=e.contentInfo.value[1],i=i.value[0]),!i)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var s=$.derToOid(e.contentInfo.value[0].value),a=$.toDer(i);a.getByte(),$.getBerValueLength(a),a=a.getBytes();for(var o in n)n[o].start().update(a);for(var c=new Date,l=0;l<e.signers.length;++l){var u=e.signers[l];if(u.authenticatedAttributes.length===0){if(s!==Ee.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else {u.authenticatedAttributesAsn1=$.create($.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var f=$.create($.Class.UNIVERSAL,$.Type.SET,!0,[]),h=0;h<u.authenticatedAttributes.length;++h){var p=u.authenticatedAttributes[h];p.type===Ee.pki.oids.messageDigest?p.value=n[u.digestAlgorithm].digest():p.type===Ee.pki.oids.signingTime&&(p.value||(p.value=c)),f.value.push(Yy(p)),u.authenticatedAttributesAsn1.value.push(Yy(p));}a=$.toDer(f).getBytes(),u.md.start().update(a);}u.signature=u.key.sign(u.md,"RSASSA-PKCS1-V1_5");}e.signerInfos=ZQ(e.signers);}};Hr.createEncryptedData=function(){var e=null;return e={type:Ee.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:Ee.pki.oids["aes256-CBC"]},fromAsn1:function(t){Qy(e,t,Hr.asn1.encryptedDataValidator);},decrypt:function(t){t!==void 0&&(e.encryptedContent.key=t),FD(e);}},e};Hr.createEnvelopedData=function(){var e=null;return e={type:Ee.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:Ee.pki.oids["aes256-CBC"]},fromAsn1:function(t){var r=Qy(e,t,Hr.asn1.envelopedDataValidator);e.recipients=GQ(r.recipientInfos.value);},toAsn1:function(){return $.create($.Class.UNIVERSAL,$.Type.SEQUENCE,!0,[$.create($.Class.UNIVERSAL,$.Type.OID,!1,$.oidToDer(e.type).getBytes()),$.create($.Class.CONTEXT_SPECIFIC,0,!0,[$.create($.Class.UNIVERSAL,$.Type.SEQUENCE,!0,[$.create($.Class.UNIVERSAL,$.Type.INTEGER,!1,$.integerToDer(e.version).getBytes()),$.create($.Class.UNIVERSAL,$.Type.SET,!0,YQ(e.recipients)),$.create($.Class.UNIVERSAL,$.Type.SEQUENCE,!0,XQ(e.encryptedContent))])])])},findRecipient:function(t){for(var r=t.issuer.attributes,n=0;n<e.recipients.length;++n){var i=e.recipients[n],s=i.issuer;if(i.serialNumber===t.serialNumber&&s.length===r.length){for(var a=!0,o=0;o<r.length;++o)if(s[o].type!==r[o].type||s[o].value!==r[o].value){a=!1;break}if(a)return i}}return null},decrypt:function(t,r){if(e.encryptedContent.key===void 0&&t!==void 0&&r!==void 0)switch(t.encryptedContent.algorithm){case Ee.pki.oids.rsaEncryption:case Ee.pki.oids.desCBC:var n=r.decrypt(t.encryptedContent.content);e.encryptedContent.key=Ee.util.createBuffer(n);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}FD(e);},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:Ee.pki.oids.rsaEncryption,key:t.publicKey}});},encrypt:function(t,r){if(e.encryptedContent.content===void 0){r=r||e.encryptedContent.algorithm,t=t||e.encryptedContent.key;var n,i,s;switch(r){case Ee.pki.oids["aes128-CBC"]:n=16,i=16,s=Ee.aes.createEncryptionCipher;break;case Ee.pki.oids["aes192-CBC"]:n=24,i=16,s=Ee.aes.createEncryptionCipher;break;case Ee.pki.oids["aes256-CBC"]:n=32,i=16,s=Ee.aes.createEncryptionCipher;break;case Ee.pki.oids["des-EDE3-CBC"]:n=24,i=8,s=Ee.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+r)}if(t===void 0)t=Ee.util.createBuffer(Ee.random.getBytes(n));else if(t.length()!=n)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+n+".");e.encryptedContent.algorithm=r,e.encryptedContent.key=t,e.encryptedContent.parameter=Ee.util.createBuffer(Ee.random.getBytes(i));var a=s(t);if(a.start(e.encryptedContent.parameter.copy()),a.update(e.content),!a.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=a.output;}for(var o=0;o<e.recipients.length;++o){var c=e.recipients[o];if(c.encryptedContent.content===void 0)switch(c.encryptedContent.algorithm){case Ee.pki.oids.rsaEncryption:c.encryptedContent.content=c.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+c.encryptedContent.algorithm)}}}},e};function KQ(e){var t={},r=[];if(!$.validate(e,Hr.asn1.recipientInfoValidator,t,r)){var n=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw n.errors=r,n}return {version:t.version.charCodeAt(0),issuer:Ee.pki.RDNAttributesAsArray(t.issuer),serialNumber:Ee.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:$.derToOid(t.encAlgorithm),parameter:t.encParameter?t.encParameter.value:void 0,content:t.encKey}}}function zQ(e){return $.create($.Class.UNIVERSAL,$.Type.SEQUENCE,!0,[$.create($.Class.UNIVERSAL,$.Type.INTEGER,!1,$.integerToDer(e.version).getBytes()),$.create($.Class.UNIVERSAL,$.Type.SEQUENCE,!0,[Ee.pki.distinguishedNameToAsn1({attributes:e.issuer}),$.create($.Class.UNIVERSAL,$.Type.INTEGER,!1,Ee.util.hexToBytes(e.serialNumber))]),$.create($.Class.UNIVERSAL,$.Type.SEQUENCE,!0,[$.create($.Class.UNIVERSAL,$.Type.OID,!1,$.oidToDer(e.encryptedContent.algorithm).getBytes()),$.create($.Class.UNIVERSAL,$.Type.NULL,!1,"")]),$.create($.Class.UNIVERSAL,$.Type.OCTETSTRING,!1,e.encryptedContent.content)])}function GQ(e){for(var t=[],r=0;r<e.length;++r)t.push(KQ(e[r]));return t}function YQ(e){for(var t=[],r=0;r<e.length;++r)t.push(zQ(e[r]));return t}function QQ(e){var t=$.create($.Class.UNIVERSAL,$.Type.SEQUENCE,!0,[$.create($.Class.UNIVERSAL,$.Type.INTEGER,!1,$.integerToDer(e.version).getBytes()),$.create($.Class.UNIVERSAL,$.Type.SEQUENCE,!0,[Ee.pki.distinguishedNameToAsn1({attributes:e.issuer}),$.create($.Class.UNIVERSAL,$.Type.INTEGER,!1,Ee.util.hexToBytes(e.serialNumber))]),$.create($.Class.UNIVERSAL,$.Type.SEQUENCE,!0,[$.create($.Class.UNIVERSAL,$.Type.OID,!1,$.oidToDer(e.digestAlgorithm).getBytes()),$.create($.Class.UNIVERSAL,$.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push($.create($.Class.UNIVERSAL,$.Type.SEQUENCE,!0,[$.create($.Class.UNIVERSAL,$.Type.OID,!1,$.oidToDer(e.signatureAlgorithm).getBytes()),$.create($.Class.UNIVERSAL,$.Type.NULL,!1,"")])),t.value.push($.create($.Class.UNIVERSAL,$.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var r=$.create($.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n<e.unauthenticatedAttributes.length;++n){var i=e.unauthenticatedAttributes[n];r.values.push(Yy(i));}t.value.push(r);}return t}function ZQ(e){for(var t=[],r=0;r<e.length;++r)t.push(QQ(e[r]));return t}function Yy(e){var t;if(e.type===Ee.pki.oids.contentType)t=$.create($.Class.UNIVERSAL,$.Type.OID,!1,$.oidToDer(e.value).getBytes());else if(e.type===Ee.pki.oids.messageDigest)t=$.create($.Class.UNIVERSAL,$.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===Ee.pki.oids.signingTime){var r=new Date("1950-01-01T00:00:00Z"),n=new Date("2050-01-01T00:00:00Z"),i=e.value;if(typeof i=="string"){var s=Date.parse(i);isNaN(s)?i.length===13?i=$.utcTimeToDate(i):i=$.generalizedTimeToDate(i):i=new Date(s);}i>=r&&i<n?t=$.create($.Class.UNIVERSAL,$.Type.UTCTIME,!1,$.dateToUtcTime(i)):t=$.create($.Class.UNIVERSAL,$.Type.GENERALIZEDTIME,!1,$.dateToGeneralizedTime(i));}return $.create($.Class.UNIVERSAL,$.Type.SEQUENCE,!0,[$.create($.Class.UNIVERSAL,$.Type.OID,!1,$.oidToDer(e.type).getBytes()),$.create($.Class.UNIVERSAL,$.Type.SET,!0,[t])])}function XQ(e){return [$.create($.Class.UNIVERSAL,$.Type.OID,!1,$.oidToDer(Ee.pki.oids.data).getBytes()),$.create($.Class.UNIVERSAL,$.Type.SEQUENCE,!0,[$.create($.Class.UNIVERSAL,$.Type.OID,!1,$.oidToDer(e.algorithm).getBytes()),e.parameter?$.create($.Class.UNIVERSAL,$.Type.OCTETSTRING,!1,e.parameter.getBytes()):void 0]),$.create($.Class.CONTEXT_SPECIFIC,0,!0,[$.create($.Class.UNIVERSAL,$.Type.OCTETSTRING,!1,e.content.getBytes())])]}function Qy(e,t,r){var n={},i=[];if(!$.validate(t,r,n,i)){var s=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw s.errors=s,s}var a=$.derToOid(n.contentType);if(a!==Ee.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(n.encryptedContent){var o="";if(Ee.util.isArray(n.encryptedContent))for(var c=0;c<n.encryptedContent.length;++c){if(n.encryptedContent[c].type!==$.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");o+=n.encryptedContent[c].value;}else o=n.encryptedContent;e.encryptedContent={algorithm:$.derToOid(n.encAlgorithm),parameter:Ee.util.createBuffer(n.encParameter.value),content:Ee.util.createBuffer(o)};}if(n.content){var o="";if(Ee.util.isArray(n.content))for(var c=0;c<n.content.length;++c){if(n.content[c].type!==$.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");o+=n.content[c].value;}else o=n.content;e.content=Ee.util.createBuffer(o);}return e.version=n.version.charCodeAt(0),e.rawCapture=n,n}function FD(e){if(e.encryptedContent.key===void 0)throw new Error("Symmetric key not available.");if(e.content===void 0){var t;switch(e.encryptedContent.algorithm){case Ee.pki.oids["aes128-CBC"]:case Ee.pki.oids["aes192-CBC"]:case Ee.pki.oids["aes256-CBC"]:t=Ee.aes.createDecryptionCipher(e.encryptedContent.key);break;case Ee.pki.oids.desCBC:case Ee.pki.oids["des-EDE3-CBC"]:t=Ee.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output;}}});var jD=P((kae,UD)=>{var nr=Je();ns();Ja();Ff();no();mt();var ad=UD.exports=nr.ssh=nr.ssh||{};ad.privateKeyToPutty=function(e,t,r){r=r||"",t=t||"";var n="ssh-rsa",i=t===""?"none":"aes256-cbc",s="PuTTY-User-Key-File-2: "+n+`\r
`;s+="Encryption: "+i+`\r
`,s+="Comment: "+r+`\r
`;var a=nr.util.createBuffer();fo(a,n),mi(a,e.e),mi(a,e.n);var o=nr.util.encode64(a.bytes(),64),c=Math.floor(o.length/66)+1;s+="Public-Lines: "+c+`\r
`,s+=o;var l=nr.util.createBuffer();mi(l,e.d),mi(l,e.p),mi(l,e.q),mi(l,e.qInv);var u;if(!t)u=nr.util.encode64(l.bytes(),64);else {var f=l.length()+16-1;f-=f%16;var h=sd(l.bytes());h.truncate(h.length()-f+l.length()),l.putBuffer(h);var p=nr.util.createBuffer();p.putBuffer(sd("\0\0\0\0",t)),p.putBuffer(sd("\0\0\0",t));var m=nr.aes.createEncryptionCipher(p.truncate(8),"CBC");m.start(nr.util.createBuffer().fillWithByte(0,16)),m.update(l.copy()),m.finish();var _=m.output;_.truncate(16),u=nr.util.encode64(_.bytes(),64);}c=Math.floor(u.length/66)+1,s+=`\r
Private-Lines: `+c+`\r
`,s+=u;var E=sd("putty-private-key-file-mac-key",t),w=nr.util.createBuffer();fo(w,n),fo(w,i),fo(w,r),w.putInt32(a.length()),w.putBuffer(a),w.putInt32(l.length()),w.putBuffer(l);var y=nr.hmac.create();return y.start("sha1",E),y.update(w.bytes()),s+=`\r
Private-MAC: `+y.digest().toHex()+`\r
`,s};ad.publicKeyToOpenSSH=function(e,t){var r="ssh-rsa";t=t||"";var n=nr.util.createBuffer();return fo(n,r),mi(n,e.e),mi(n,e.n),r+" "+nr.util.encode64(n.bytes())+" "+t};ad.privateKeyToOpenSSH=function(e,t){return t?nr.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):nr.pki.privateKeyToPem(e)};ad.getPublicKeyFingerprint=function(e,t){t=t||{};var r=t.md||nr.md.md5.create(),n="ssh-rsa",i=nr.util.createBuffer();fo(i,n),mi(i,e.e),mi(i,e.n),r.start(),r.update(i.getBytes());var s=r.digest();if(t.encoding==="hex"){var a=s.toHex();return t.delimiter?a.match(/.{2}/g).join(t.delimiter):a}else {if(t.encoding==="binary")return s.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return s};function mi(e,t){var r=t.toString(16);r[0]>="8"&&(r="00"+r);var n=nr.util.hexToBytes(r);e.putInt32(n.length),e.putBytes(n);}function fo(e,t){e.putInt32(t.length),e.putString(t);}function sd(){for(var e=nr.md.sha1.create(),t=arguments.length,r=0;r<t;++r)e.update(arguments[r]);return e.digest()}});var Zy=P((Oae,$D)=>{$D.exports=Je();ns();uD();zn();Pf();ju();TD();Ja();PD();OD();BD();Ey();jf();Qs();my();xy();qD();Ay();vy();uy();Gf();xn();fy();jD();ky();mt();});var HD=P((Lae,VD)=>{VD.exports={dc:"0.9.2342.19200300.100.1.25"};});var Xy=P((Bae,WD)=>{var od;WD.exports=JQ;function JQ(){var e,t,r,n;if(!od){od=Zy(),e=od.oids;for(t in r=HD())n=r[t],e[t]==null&&(e[t]=n),e[n]==null&&(e[n]=t);}return od}});var Ju=P((Fae,ZD)=>{var ud,ev,Xu,Jy,KD,zD,tv;ZD.exports=cd;ud=Xy();ev={der:GD,pem:YD,txt:eZ,asn1:QD,x509:tZ};Xu=[];for(Jy in ev)KD=ev[Jy],cd[Jy]=Xu.length,Xu.push(KD);cd.forge=cd.x509;zD=Buffer.isBuffer;tv=Buffer.from||function(e,t){return new Buffer(e,t)};function cd(e,t){var r;return r=Xu[e]||Xu[0],t!=null?r(t):r}function GD(e){return zD(e)?e:tv(e,"binary")}function YD(e){var t,r,n,i;for(e=GD(e).toString("base64"),t=["-----BEGIN CERTIFICATE-----"],r=0,n=e.length;r<n;r+=64)i=r,t.push(e.substr(i,64));return t.push("-----END CERTIFICATE-----",""),t.join(`\r
`)}function eZ(e){var t;return t=QD(e),"Subject	"+t.subject.value.map(function(r){return tv(r.value[0].value[1].value,"binary").toString("utf8")}).join("/")+`
Valid	`+t.valid.value.map(function(r){return r.value}).join(" - ")+`
`+YD(e)}function QD(e){var t,r,n,i;return t=ud().asn1,e=e.toString("binary"),r=t.fromDer(e).value[0].value,n=r[0],i=n.tagClass===t.Class.CONTEXT_SPECIFIC&&n.type===0&&n.constructed,r=r.slice(i),{serial:r[0],valid:r[3],issuer:r[2],subject:r[4]}}function tZ(e){return ud().pki.certificateFromAsn1(ud().asn1.fromDer(e.toString("binary")))}});var JD=P(nv=>{nv.all=nZ;nv.each=XD;XD.async=rZ;function XD(){var e;rv(arguments,e={unique:!0,ondata:function(t){typeof e.$cb=="function"&&e.$cb(t);}});}function rZ(){var e;rv(arguments,e={async:!0,ondata:function(t){typeof e.$cb=="function"&&e.$cb(void 0,t);},onend:function(){typeof e.$cb=="function"&&e.$cb();}});}function nZ(){var e;return rv(arguments,{ondata:e=[]}),e}function rv(e,t){var r,n;r=Bu(),n=e[0],t.unique==null&&(t.unique=!1),t.format=n??r.der2.x509,t.$cb=e[1]||n,r(t);}});var uv=P((qae,rk)=>{var av,ek,iv,ec,ov,sv;av=he("crypto");ek=Xy();iv=Ju();ec=ek().asn1;ov=iv(iv.asn1);rk.exports=aZ;sv=Buffer.from||function(e,t){return new Buffer(e,t)};function iZ(e){var t;return t=av.createHash("sha1"),ov(e).subject.value.forEach(function(r){var n,i;r=ec.copy(r),n=r.value[0].value[1],n.value&&(n.type=ec.Type.UTF8,i=sv(n.value,"binary").toString("utf8"),i=i.trim().replace(/[A-Z]+/g,function(s){return s.toLowerCase()}).replace(/\s+/g," "),n.value=sv(i,"utf8").toString("binary"),t.update(ec.toDer(r).getBytes(),"binary"));}),tk(t)}function sZ(e){var t,r;return t=av.createHash("md5"),r=ov(e).subject,t.update(ec.toDer(r).getBytes(),"binary"),tk(t)}function tk(e){return e=e.digest().slice(0,4),e.writeUInt32LE(e.readUInt32BE(0),0),e.toString("hex")}function aZ(e,t){var r;return r=e===0?sZ:iZ,t!=null?r(t):r}});var lv=P((Uae,uk)=>{var ik,tc,cv,sk,ld,hs,nc,rc;ik=he("https");tc=he("tls");cv=Ju();uk.exports=ak;ak.inject=ok;sk=cv(cv.pem);ld=ik.globalAgent.options;hs=[];function ak(e){return ok(e,[]),oZ}function oZ(e){hs.push(sk(e));}nc=0;function ok(e,t){if(t&&(hs.length=0,hs.push.apply(hs,t)),e=e==="+"?2:e?1:0,e!==nc){switch(nc){case 1:ld.ca===hs&&delete ld.ca;break;case 2:tc.createSecureContext===nk&&(tc.createSecureContext=rc,rc=void 0);}switch(nc=e){case 1:ld.ca=hs;break;case 2:rc||(rc=tc.createSecureContext,tc.createSecureContext=nk);}}}function nk(e){var t,r,n,i,s;if(t=rc.apply(this,arguments),nc===2&&!(e!=null&&e.ca))for(r=0,i=(n=hs).length;r<i;++r)s=n[r],t.context.addCACert(s);return t}});var fk=P((ck,lk)=>{var uZ=he("stream");lk.exports=fv;fv.through=fv;function fv(e,t,r){e=e||function(u){this.queue(u);},t=t||function(){this.queue(null);};var n=!1,i=!1,s=[],a=!1,o=new uZ;o.readable=o.writable=!0,o.paused=!1,o.autoDestroy=!(r&&r.autoDestroy===!1),o.write=function(u){return e.call(this,u),!o.paused};function c(){for(;s.length&&!o.paused;){var u=s.shift();if(u===null)return o.emit("end");o.emit("data",u);}}o.queue=o.push=function(u){return a||(u===null&&(a=!0),s.push(u),c()),o},o.on("end",function(){o.readable=!1,!o.writable&&o.autoDestroy&&process.nextTick(function(){o.destroy();});});function l(){o.writable=!1,t.call(o),!o.readable&&o.autoDestroy&&o.destroy();}return o.end=function(u){if(!n)return n=!0,arguments.length&&o.write(u),l(),o},o.destroy=function(){if(!i)return i=!0,n=!0,s.length=0,o.writable=o.readable=!1,o.emit("close"),o},o.pause=function(){if(!o.paused)return o.paused=!0,o},o.resume=function(){return o.paused&&(o.paused=!1,o.emit("resume")),c(),o.paused||o.emit("drain"),o},o}});var hk=P((jae,dk)=>{var cZ=fk(),lZ=he("string_decoder").StringDecoder;dk.exports=fZ;function fZ(e,t,r){var n=new lZ,i="",s=r&&r.maxLength,a=!(r&&r.trailing===!1);typeof e=="function"&&(t=e,e=null),e||(e=/\r?\n/);function o(l,u){if(t){try{u=t(u);}catch(f){return l.emit("error",f)}typeof u<"u"&&l.queue(u);}else l.queue(u);}function c(l,u){var f=((i??"")+u).split(e);if(i=f.pop(),s&&i.length>s)return l.emit("error",new Error("maximum buffer reached"));for(var h=0;h<f.length;h++){var p=f[h];o(l,p);}}return cZ(function(l){c(this,n.write(l));},function(){n.end&&c(this,n.end()),a&&i!=null&&o(this,i),this.queue(null);})}});var gv=P(fd=>{var pk,dv,gk,dd,hv,mk,pv=typeof fd<"u"&&fd||fd;pk=he("path");dv=he("child_process");gk=hk();hv={maxBuffer:1024*1024*1024};function yk(e){var t;return e==null&&(e="roots.exe"),t=dd,dd=pk.resolve(__dirname,e),t}yk();pv.exe=yk;pv.sync=dZ;function dZ(e){var t,r;return {run:s,next:n,done:i};function n(){if(t||(t=[],r=0,s(function(a){a&&t.push(a);})),r<t.length)return t[r++];t=[];}function i(){t=[];}function s(a){vk(a).on("end",function(){a();}).end(dv.execFileSync(dd,e,hv));}}pv.async=hZ;function hZ(e){var t,r,n;return {run:c,next:i,done:a};function i(){return t||(t=[],r=[],c(s)),t.length?Promise.resolve(t.shift()):n?Promise.resolve():new Promise(function(l){r.push(l);})}function s(l){n||(l?r.length?r.shift()(l):t.push(l):o());}function a(){t=[],o();}function o(){var l,u,f,h;for(n=!0,l=0,f=(u=r).length;l<f;++l)h=u[l],h();}function c(l){dv.execFile(dd,e,hv,function(){}).stdout.pipe(vk(l)).on("end",function(){l();});}}function vk(e){return gk(function(t){t.length&&e(mk(t,"hex"));})}mk=Buffer.from||function(e,t){return new Buffer(e,t)};});var Sk=P(hd=>{var _k=typeof hd<"u"&&hd||hd;_k.sync=bk;function bk(){return {next:function(){},done:function(){},run:function(e){return e()}}}_k.async=bk;});var Ek=P(()=>{});var wk=P(()=>{});var Qae,mv=iS(()=>{Qae=nS({"./crypt32-ia32.node":()=>Ek(),"./crypt32-x64.node":()=>wk()});});var Tk=P(pd=>{mv();var yv,Ck=typeof pd<"u"&&pd||pd;yv=Qae("./crypt32-"+process.arch);Ck.sync=xk;function xk(e){var t,r;return r=e.length?0:-1,{next:n,done:i,run:s};function n(){for(var a;r<e.length;){if(t==null&&(t=r<0?yv():yv(e[r])),a=t.next())return a;t.done(),t=void 0,r++;}}function i(){t?.done(),t=void 0,r=e.length;}function s(a){for(var o;o=n();)a(o);a();}}Ck.async=gZ;function gZ(e){var t,r;return t=xk(e),r=t.next,t.run=n,t;function n(i){function s(){return Promise.resolve().then(r).then(function(a){if(a)return i(a),s();i();})}s();}}});var Ik=P((Jae,Rk)=>{var Ak;Ak=he("crypto");Rk.exports=mZ;function mZ(){var e;e=new Set;function t(r){var n;if(n=Ak.createHash("sha256").update(r).digest("base64"),!e.has(n))return e.add(n),!0}return t}});var Dk=P((eoe,Nk)=>{var Pk=(e,t)=>function(){let r=t.promiseModule,n=new Array(arguments.length);for(let i=0;i<arguments.length;i++)n[i]=arguments[i];return new r((i,s)=>{t.errorFirst?n.push(function(a,o){if(t.multiArgs){let c=new Array(arguments.length-1);for(let l=1;l<arguments.length;l++)c[l-1]=arguments[l];a?(c.unshift(a),s(c)):i(c);}else a?s(a):i(o);}):n.push(function(a){if(t.multiArgs){let o=new Array(arguments.length-1);for(let c=0;c<arguments.length;c++)o[c]=arguments[c];i(o);}else i(a);}),e.apply(this,n);})};Nk.exports=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);let r=i=>{let s=a=>typeof a=="string"?i===a:a.test(i);return t.include?t.include.some(s):!t.exclude.some(s)},n;typeof e=="function"?n=function(){return t.excludeMain?e.apply(this,arguments):Pk(e,t).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(e));for(let i in e){let s=e[i];n[i]=typeof s=="function"&&r(i)?Pk(s,t):s;}return n};});var Bk=P((toe,vv)=>{var yZ=he("fs"),ia=he("path"),kk=Dk(),Ok={mode:511&~process.umask(),fs:yZ},Lk=e=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(ia.parse(e).root,""))){let r=new Error(`Path contains invalid characters: ${e}`);throw r.code="EINVAL",r}};vv.exports=(e,t)=>Promise.resolve().then(()=>{Lk(e),t=Object.assign({},Ok,t);let r=kk(t.fs.mkdir),n=kk(t.fs.stat),i=s=>r(s,t.mode).then(()=>s).catch(a=>{if(a.code==="ENOENT"){if(a.message.includes("null bytes")||ia.dirname(s)===s)throw a;return i(ia.dirname(s)).then(()=>i(s))}return n(s).then(o=>o.isDirectory()?s:Promise.reject()).catch(()=>{throw a})});return i(ia.resolve(e))});vv.exports.sync=(e,t)=>{Lk(e),t=Object.assign({},Ok,t);let r=n=>{try{t.fs.mkdirSync(n,t.mode);}catch(i){if(i.code==="ENOENT"){if(i.message.includes("null bytes")||ia.dirname(n)===n)throw i;return r(ia.dirname(n)),r(n)}try{if(!t.fs.statSync(n).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}return n};return r(ia.resolve(e))};});var Kk=P((roe,Wk)=>{var sc,Fk,ic,Mk,bv,qk,Uk,jk,$k,Vk,Hk;sc=he("fs");Fk=he("os");ic=he("path");Mk=Bk();bv=Ju();qk=uv();Wk.exports=vZ;Uk=bv(bv.txt);jk=qk();$k=Sv(sc.writeFile);Vk=Sv(sc.readdir);Hk=Sv(sc.unlink);function vZ(e){var t,r,n,i,s;return i={},s=new Set,a;function a(f){return Promise.resolve(f).then(o)}function o(f){f?(r||(r=bZ(e.save||e.$ave).then(function(h){return t=h})),r=r.then(function(){if(t)return c(f)})):r?r.then(u).then(function(){n?.end(),t&&e.$ave&&(process.env.SSL_CERT_DIR=Bu().path=t),typeof e.onsave=="function"&&e.onsave(t);}):typeof e.onsave=="function"&&e.onsave();}function c(f){var h,p;return (n||(n=sc.createWriteStream(l("roots.pem")))).write(h=Uk(f)),i[p=jk(f)]||(i[p]=0),$k(l(p+"."+i[p]++),h).catch(_v)}function l(f){return s.add(f),ic.join(t,f)}function u(){t&&Vk(t).then(function(f){return Promise.all(f.filter(function(h){return !s.has(h)}).map(function(h){return ic.join(t,h)}).map(function(h){return Hk(h).catch(_v)}))}).catch(_v);}}function _Z(){return [ic.join(__dirname,"../pem"),ic.join(Fk.homedir(),".local/win-ca/pem")]}function bZ(e){var t;return typeof e=="string"?e=[e]:Array.isArray(e)||(e=_Z()),t=0,r();function r(){return t<e.length?Mk(e[t++]).catch(r):Promise.resolve()}}function Sv(e){return function(){var t,r=this;return t=[].slice.call(arguments),new Promise(function(n,i){t.push(s),e.apply(r,t);function s(a,o){a?i(a):n(o);}})}}function _v(){}});var Bu=P((noe,Qk)=>{var Ev,Gk,Yk;Qk.exports=Wr;Wr.disabled=Ev=process.platform!=="win32";Wr.nApi=Gk=!!process.versions.napi&&Wr===xP()&&!(Wr.electron=AP()());Wr.der2=Yk=Ju();Wr.hash=SZ;Wr.inject=EZ;Wr.exe=wZ;CZ(Wr,JD());!Ev&&Wr===wv()&&Wr({inject:!0,$ave:!0,async:!0});function SZ(){return (Wr.hash=uv()).apply(this,arguments)}function EZ(){return (Wr.inject=lv().inject).apply(this,arguments)}function wZ(){return (Wr.exe=gv().exe).apply(this,arguments)}function Wr(e){var t,r,n,i,s,a,o,c,l;if(e==null&&(e={}),t=Ev||e.disabled?Sk():((r=e.fallback)!=null?r:!Gk)?gv():Tk(),(n=e.store)?Array.isArray(n)||(n=[n]):n=[],t=t[(i=e.async)?"async":"sync"](n),s=i?f:u,e.unique!==!1&&(a=Ik()()),o=Yk(e.format),Array.isArray(e.ondata)&&(e.ondata=e.ondata.push.bind(e.ondata)),(e.save||e.$ave)&&(c=Kk()(e)),e.inject&&(l=lv()(e.inject)),e.generator)return (i?p:h)();t.run(function(y){(!y||!a||a(y))&&s(y);});function u(y){c&&c(y),y?(l&&l(y),typeof e.ondata=="function"&&e.ondata(o(y))):typeof e.onend=="function"&&e.onend();}function f(y){Promise.resolve(y).then(u);}function h(){var y;return y={},y[Symbol.iterator]=zk,y.return=_,y.next=E,y}function p(){var y,b;return y={},y[(b=Symbol.asyncIterator)!=null?b:"@"]=zk,y.return=_,y.next=w,y}function m(y){return s(y),{done:!y,value:y!=null?o(y):y}}function _(y){return t.done(),{done:!0,value:y}}function E(){for(var y;(y=t.next())&&a&&!a(y););return m(y)}function w(){function y(){return Promise.resolve().then(t.next).then(function(b){return b&&a&&!a(b)?y():m(b)})}return y()}}function zk(){return this}function CZ(e,t){for(var r in t)e[r]=t[r];return e}});var wv=P((ioe,Zk)=>{Zk.exports=Bu();});var eO=P(sa=>{Object.defineProperty(sa,"__esModule",{value:!0});sa.convert=sa.Format=void 0;var ac=Zy(),ps;(function(e){e.der="der",e.pem="pem",e.txt="txt",e.asn1="asn1",e.x509="x509",e.fingerprint="fingerprint";})(ps=sa.Format||(sa.Format={}));function Xk(e){var t=ac.pki.pemToDer(e),r=ac.asn1,n=r.fromDer(t.data.toString("binary")).value[0].value,i=n[0],s=i.tagClass===r.Class.CONTEXT_SPECIFIC&&i.type===0&&i.constructed,a=n.slice(s);return {serial:a[0],issuer:a[2],valid:a[3],subject:a[4]}}function xZ(e){var t=Xk(e),r=t.subject.value.map(function(i){return i.value[0].value[1].value}).join("/"),n=t.valid.value.map(function(i){return i.value}).join(" - ");return ["Subject	".concat(r),"Valid	".concat(n),String(e)].join(`
`)}function Jk(e,t){switch(t){case ps.der:return ac.pki.pemToDer(e);case ps.pem:return e;case ps.txt:return xZ(e);case ps.asn1:return Xk(e);case ps.fingerprint:var r=ac.md.sha1.create(),n=Jk(e,ps.der);return r.update(n.getBytes()),r.digest().toHex();case ps.x509:return ac.pki.certificateFromPem(e);default:throw new Error("unknown format ".concat(t))}}sa.convert=Jk;});var sO=P(Jr=>{var aa=Jr&&Jr.__assign||function(){return aa=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);}return e},aa.apply(this,arguments)},gd=Jr&&Jr.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.convert=Jr.Format=Jr.addToGlobalAgent=Jr.get=void 0;var rO=he("https"),TZ=he("tls"),tO=he("child_process"),Li=eO();Object.defineProperty(Jr,"Format",{enumerable:!0,get:function(){return Li.Format}});Object.defineProperty(Jr,"convert",{enumerable:!0,get:function(){return Li.convert}});var nO=process.platform==="darwin",yd={keychain:"all",unique:!0,excludeBundled:!0,format:Li.Format.pem};function iO(e){if(e===void 0&&(e=yd),!nO)return [];e=aa(aa({},yd),e);var t=/(?=-----BEGIN\sCERTIFICATE-----)/g,r=["find-certificate","-a","-p"],n=[];if(e.keychain==="all"||e.keychain==="SystemRootCertificates"){var i="/System/Library/Keychains/SystemRootCertificates.keychain",s=(0, tO.spawnSync)("/usr/bin/security",r.concat(i)).stdout.toString().split(t).map(function(l){return l.trim()});n=gd(gd([],n,!0),s,!0);}if(e.keychain==="all"||e.keychain==="SystemRootCertificates"){var a=(0, tO.spawnSync)("/usr/bin/security",r).stdout.toString().split(t).map(function(l){return l.trim()});n=gd(gd([],n,!0),a,!0);}if(e.unique||e.excludeBundled){var o=n.map(function(l){return (0, Li.convert)(l,Li.Format.fingerprint)}),c=e.excludeBundled?TZ.rootCertificates.map(function(l){return (0, Li.convert)(l,Li.Format.fingerprint)}):[];n=n.filter(function(l,u){var f=o[u];return !(e.unique&&u!==o.indexOf(f)||e.excludeBundled&&c.includes(f))});}return n.map(function(l){return (0, Li.convert)(l,e.format)})}Jr.get=iO;var md=rO.globalAgent.options.ca,AZ=function(e){if(e===void 0&&(e=yd),!!nO){var t;Array.isArray(md)?t=Array.from(md):t=typeof md<"u"?[md]:[],iO(aa(aa(aa({},yd),e),{format:Li.Format.pem})).forEach(function(r){return t.push(r)}),rO.globalAgent.options.ca=t;}};Jr.addToGlobalAgent=AZ;});var Ed=P(ir=>{Object.defineProperty(ir,"__esModule",{value:!0});ir.thenable=ir.typedArray=ir.stringArray=ir.array=ir.func=ir.error=ir.number=ir.string=ir.boolean=void 0;function IZ(e){return e===!0||e===!1}ir.boolean=IZ;function pO(e){return typeof e=="string"||e instanceof String}ir.string=pO;function PZ(e){return typeof e=="number"||e instanceof Number}ir.number=PZ;function NZ(e){return e instanceof Error}ir.error=NZ;function gO(e){return typeof e=="function"}ir.func=gO;function mO(e){return Array.isArray(e)}ir.array=mO;function DZ(e){return mO(e)&&e.every(t=>pO(t))}ir.stringArray=DZ;function kZ(e,t){return Array.isArray(e)&&e.every(t)}ir.typedArray=kZ;function OZ(e){return e&&gO(e.then)}ir.thenable=OZ;});var ho=P(Pr=>{Object.defineProperty(Pr,"__esModule",{value:!0});Pr.stringArray=Pr.array=Pr.func=Pr.error=Pr.number=Pr.string=Pr.boolean=void 0;function LZ(e){return e===!0||e===!1}Pr.boolean=LZ;function yO(e){return typeof e=="string"||e instanceof String}Pr.string=yO;function BZ(e){return typeof e=="number"||e instanceof Number}Pr.number=BZ;function FZ(e){return e instanceof Error}Pr.error=FZ;function MZ(e){return typeof e=="function"}Pr.func=MZ;function vO(e){return Array.isArray(e)}Pr.array=vO;function qZ(e){return vO(e)&&e.every(t=>yO(t))}Pr.stringArray=qZ;});var Zv=P(Be=>{Object.defineProperty(Be,"__esModule",{value:!0});Be.Message=Be.NotificationType9=Be.NotificationType8=Be.NotificationType7=Be.NotificationType6=Be.NotificationType5=Be.NotificationType4=Be.NotificationType3=Be.NotificationType2=Be.NotificationType1=Be.NotificationType0=Be.NotificationType=Be.RequestType9=Be.RequestType8=Be.RequestType7=Be.RequestType6=Be.RequestType5=Be.RequestType4=Be.RequestType3=Be.RequestType2=Be.RequestType1=Be.RequestType=Be.RequestType0=Be.AbstractMessageSignature=Be.ParameterStructures=Be.ResponseError=Be.ErrorCodes=void 0;var ua=ho(),Av;(function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3;})(Av||(Be.ErrorCodes=Av={}));var Rv=class e extends Error{constructor(t,r,n){super(r),this.code=ua.number(t)?t:Av.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,e.prototype);}toJson(){let t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),t}};Be.ResponseError=Rv;var en=class e{constructor(t){this.kind=t;}static is(t){return t===e.auto||t===e.byName||t===e.byPosition}toString(){return this.kind}};Be.ParameterStructures=en;en.auto=new en("auto");en.byPosition=new en("byPosition");en.byName=new en("byName");var $t=class{constructor(t,r){this.method=t,this.numberOfParams=r;}get parameterStructures(){return en.auto}};Be.AbstractMessageSignature=$t;var Iv=class extends $t{constructor(t){super(t,0);}};Be.RequestType0=Iv;var Pv=class extends $t{constructor(t,r=en.auto){super(t,1),this._parameterStructures=r;}get parameterStructures(){return this._parameterStructures}};Be.RequestType=Pv;var Nv=class extends $t{constructor(t,r=en.auto){super(t,1),this._parameterStructures=r;}get parameterStructures(){return this._parameterStructures}};Be.RequestType1=Nv;var Dv=class extends $t{constructor(t){super(t,2);}};Be.RequestType2=Dv;var kv=class extends $t{constructor(t){super(t,3);}};Be.RequestType3=kv;var Ov=class extends $t{constructor(t){super(t,4);}};Be.RequestType4=Ov;var Lv=class extends $t{constructor(t){super(t,5);}};Be.RequestType5=Lv;var Bv=class extends $t{constructor(t){super(t,6);}};Be.RequestType6=Bv;var Fv=class extends $t{constructor(t){super(t,7);}};Be.RequestType7=Fv;var Mv=class extends $t{constructor(t){super(t,8);}};Be.RequestType8=Mv;var qv=class extends $t{constructor(t){super(t,9);}};Be.RequestType9=qv;var Uv=class extends $t{constructor(t,r=en.auto){super(t,1),this._parameterStructures=r;}get parameterStructures(){return this._parameterStructures}};Be.NotificationType=Uv;var jv=class extends $t{constructor(t){super(t,0);}};Be.NotificationType0=jv;var $v=class extends $t{constructor(t,r=en.auto){super(t,1),this._parameterStructures=r;}get parameterStructures(){return this._parameterStructures}};Be.NotificationType1=$v;var Vv=class extends $t{constructor(t){super(t,2);}};Be.NotificationType2=Vv;var Hv=class extends $t{constructor(t){super(t,3);}};Be.NotificationType3=Hv;var Wv=class extends $t{constructor(t){super(t,4);}};Be.NotificationType4=Wv;var Kv=class extends $t{constructor(t){super(t,5);}};Be.NotificationType5=Kv;var zv=class extends $t{constructor(t){super(t,6);}};Be.NotificationType6=zv;var Gv=class extends $t{constructor(t){super(t,7);}};Be.NotificationType7=Gv;var Yv=class extends $t{constructor(t){super(t,8);}};Be.NotificationType8=Yv;var Qv=class extends $t{constructor(t){super(t,9);}};Be.NotificationType9=Qv;var _O;(function(e){function t(i){let s=i;return s&&ua.string(s.method)&&(ua.string(s.id)||ua.number(s.id))}e.isRequest=t;function r(i){let s=i;return s&&ua.string(s.method)&&i.id===void 0}e.isNotification=r;function n(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(ua.string(s.id)||ua.number(s.id)||s.id===null)}e.isResponse=n;})(_O||(Be.Message=_O={}));});var Jv=P(gs=>{var bO;Object.defineProperty(gs,"__esModule",{value:!0});gs.LRUCache=gs.LinkedMap=gs.Touch=void 0;var Nr;(function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last;})(Nr||(gs.Touch=Nr={}));var wd=class{constructor(){this[bO]="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(t){return this._map.has(t)}get(t,r=Nr.None){let n=this._map.get(t);if(n)return r!==Nr.None&&this.touch(n,r),n.value}set(t,r,n=Nr.None){let i=this._map.get(t);if(i)i.value=r,n!==Nr.None&&this.touch(i,n);else {switch(i={key:t,value:r,next:void 0,previous:void 0},n){case Nr.None:this.addItemLast(i);break;case Nr.First:this.addItemFirst(i);break;case Nr.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(t,i),this._size++;}return this}delete(t){return !!this.remove(t)}remove(t){let r=this._map.get(t);if(r)return this._map.delete(t),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 t=this._head;return this._map.delete(t.key),this.removeItem(t),this._size--,t.value}forEach(t,r){let n=this._state,i=this._head;for(;i;){if(r?t.bind(r)(i.value,i.key,this):t(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next;}}keys(){let t=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return {value:void 0,done:!0}}};return n}values(){let t=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return {value:void 0,done:!0}}};return n}entries(){let t=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return {value:void 0,done:!0}}};return n}[(bO=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(t){if(t>=this.size)return;if(t===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>t;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++;}addItemFirst(t){if(!this._head&&!this._tail)this._tail=t;else if(this._head)t.next=this._head,this._head.previous=t;else throw new Error("Invalid list");this._head=t,this._state++;}addItemLast(t){if(!this._head&&!this._tail)this._head=t;else if(this._tail)t.previous=this._tail,this._tail.next=t;else throw new Error("Invalid list");this._tail=t,this._state++;}removeItem(t){if(t===this._head&&t===this._tail)this._head=void 0,this._tail=void 0;else if(t===this._head){if(!t.next)throw new Error("Invalid list");t.next.previous=void 0,this._head=t.next;}else if(t===this._tail){if(!t.previous)throw new Error("Invalid list");t.previous.next=void 0,this._tail=t.previous;}else {let r=t.next,n=t.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r;}t.next=void 0,t.previous=void 0,this._state++;}touch(t,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==Nr.First&&r!==Nr.Last)){if(r===Nr.First){if(t===this._head)return;let n=t.next,i=t.previous;t===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),t.previous=void 0,t.next=this._head,this._head.previous=t,this._head=t,this._state++;}else if(r===Nr.Last){if(t===this._tail)return;let n=t.next,i=t.previous;t===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),t.next=void 0,t.previous=this._tail,this._tail.next=t,this._tail=t,this._state++;}}}toJSON(){let t=[];return this.forEach((r,n)=>{t.push([n,r]);}),t}fromJSON(t){this.clear();for(let[r,n]of t)this.set(r,n);}};gs.LinkedMap=wd;var Xv=class extends wd{constructor(t,r=1){super(),this._limit=t,this._ratio=Math.min(Math.max(0,r),1);}get limit(){return this._limit}set limit(t){this._limit=t,this.checkTrim();}get ratio(){return this._ratio}set ratio(t){this._ratio=Math.min(Math.max(0,t),1),this.checkTrim();}get(t,r=Nr.AsNew){return super.get(t,r)}peek(t){return super.get(t,Nr.None)}set(t,r){return super.set(t,r,Nr.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio));}};gs.LRUCache=Xv;});var EO=P(Cd=>{Object.defineProperty(Cd,"__esModule",{value:!0});Cd.Disposable=void 0;var SO;(function(e){function t(r){return {dispose:r}}e.create=t;})(SO||(Cd.Disposable=SO={}));});var ms=P(r_=>{Object.defineProperty(r_,"__esModule",{value:!0});var e_;function t_(){if(e_===void 0)throw new Error("No runtime abstraction layer installed");return e_}(function(e){function t(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");e_=r;}e.install=t;})(t_||(t_={}));r_.default=t_;});var go=P(po=>{Object.defineProperty(po,"__esModule",{value:!0});po.Emitter=po.Event=void 0;var UZ=ms(),wO;(function(e){let t={dispose(){}};e.None=function(){return t};})(wO||(po.Event=wO={}));var n_=class{add(t,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(t),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(t,r)});}remove(t,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===t)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...t){if(!this._callbacks)return [];let r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,a=n.length;s<a;s++)try{r.push(n[s].apply(i[s],t));}catch(o){(0, UZ.default)().console.error(o);}return r}isEmpty(){return !this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0;}},xd=class e{constructor(t){this._options=t;}get event(){return this._event||(this._event=(t,r,n)=>{this._callbacks||(this._callbacks=new n_),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(t,r),i.dispose=e._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this));}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(t){this._callbacks&&this._callbacks.invoke.call(this._callbacks,t);}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0);}};po.Emitter=xd;xd._noop=function(){};});var Rd=P(mo=>{Object.defineProperty(mo,"__esModule",{value:!0});mo.CancellationTokenSource=mo.CancellationToken=void 0;var jZ=ms(),$Z=ho(),i_=go(),Td;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:i_.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:i_.Event.None});function t(r){let n=r;return n&&(n===e.None||n===e.Cancelled||$Z.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}e.is=t;})(Td||(mo.CancellationToken=Td={}));var VZ=Object.freeze(function(e,t){let r=(0, jZ.default)().timer.setTimeout(e.bind(t),0);return {dispose(){r.dispose();}}}),Ad=class{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?VZ:(this._emitter||(this._emitter=new i_.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0);}},s_=class{get token(){return this._token||(this._token=new Ad),this._token}cancel(){this._token?this._token.cancel():this._token=Td.Cancelled;}dispose(){this._token?this._token instanceof Ad&&this._token.dispose():this._token=Td.None;}};mo.CancellationTokenSource=s_;});var CO=P(yo=>{Object.defineProperty(yo,"__esModule",{value:!0});yo.SharedArrayReceiverStrategy=yo.SharedArraySenderStrategy=void 0;var HZ=Rd(),oc;(function(e){e.Continue=0,e.Cancelled=1;})(oc||(oc={}));var a_=class{constructor(){this.buffers=new Map;}enableCancellation(t){if(t.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=oc.Continue,this.buffers.set(t.id,r),t.$cancellationData=r;}async sendCancellation(t,r){let n=this.buffers.get(r);if(n===void 0)return;let i=new Int32Array(n,0,1);Atomics.store(i,0,oc.Cancelled);}cleanup(t){this.buffers.delete(t);}dispose(){this.buffers.clear();}};yo.SharedArraySenderStrategy=a_;var o_=class{constructor(t){this.data=new Int32Array(t,0,1);}get isCancellationRequested(){return Atomics.load(this.data,0)===oc.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},u_=class{constructor(t){this.token=new o_(t);}cancel(){}dispose(){}},c_=class{constructor(){this.kind="request";}createCancellationTokenSource(t){let r=t.$cancellationData;return r===void 0?new HZ.CancellationTokenSource:new u_(r)}};yo.SharedArrayReceiverStrategy=c_;});var f_=P(Id=>{Object.defineProperty(Id,"__esModule",{value:!0});Id.Semaphore=void 0;var WZ=ms(),l_=class{constructor(t=1){if(t<=0)throw new Error("Capacity must be greater than 0");this._capacity=t,this._active=0,this._waiting=[];}lock(t){return new Promise((r,n)=>{this._waiting.push({thunk:t,resolve:r,reject:n}),this.runNext();})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0, WZ.default)().timer.setImmediate(()=>this.doRunNext());}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let t=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let r=t.thunk();r instanceof Promise?r.then(n=>{this._active--,t.resolve(n),this.runNext();},n=>{this._active--,t.reject(n),this.runNext();}):(this._active--,t.resolve(r),this.runNext());}catch(r){this._active--,t.reject(r),this.runNext();}}};Id.Semaphore=l_;});var TO=P(ys=>{Object.defineProperty(ys,"__esModule",{value:!0});ys.ReadableStreamMessageReader=ys.AbstractMessageReader=ys.MessageReader=void 0;var h_=ms(),vo=ho(),d_=go(),KZ=f_(),xO;(function(e){function t(r){let n=r;return n&&vo.func(n.listen)&&vo.func(n.dispose)&&vo.func(n.onError)&&vo.func(n.onClose)&&vo.func(n.onPartialMessage)}e.is=t;})(xO||(ys.MessageReader=xO={}));var Pd=class{constructor(){this.errorEmitter=new d_.Emitter,this.closeEmitter=new d_.Emitter,this.partialMessageEmitter=new d_.Emitter;}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose();}get onError(){return this.errorEmitter.event}fireError(t){this.errorEmitter.fire(this.asError(t));}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0);}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(t){this.partialMessageEmitter.fire(t);}asError(t){return t instanceof Error?t:new Error(`Reader received error. Reason: ${vo.string(t.message)?t.message:"unknown"}`)}};ys.AbstractMessageReader=Pd;var p_;(function(e){function t(r){let n,s,a=new Map,o,c=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,a.set(s.name,s)),r.contentDecoders!==void 0)for(let l of r.contentDecoders)a.set(l.name,l);if(r.contentTypeDecoder!==void 0&&(o=r.contentTypeDecoder,c.set(o.name,o)),r.contentTypeDecoders!==void 0)for(let l of r.contentTypeDecoders)c.set(l.name,l);}return o===void 0&&(o=(0, h_.default)().applicationJson.decoder,c.set(o.name,o)),{charset:n,contentDecoder:s,contentDecoders:a,contentTypeDecoder:o,contentTypeDecoders:c}}e.fromOptions=t;})(p_||(p_={}));var g_=class extends Pd{constructor(t,r){super(),this.readable=t,this.options=p_.fromOptions(r),this.buffer=(0, h_.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new KZ.Semaphore(1);}set partialMessageTimeout(t){this._partialMessageTimeout=t;}get partialMessageTimeout(){return this._partialMessageTimeout}listen(t){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=t;let r=this.readable.onData(n=>{this.onData(n);});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(t){try{for(this.buffer.append(t);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let i=n.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
${JSON.stringify(Object.fromEntries(n))}`));return}let s=parseInt(i);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));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,i=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(i);}).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, h_.default)().timer.setTimeout((t,r)=>{this.partialMessageTimer=void 0,t===this.messageToken&&(this.firePartialMessage({messageToken:t,waitingTime:r}),this.setPartialMessageTimer());},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout));}};ys.ReadableStreamMessageReader=g_;});var NO=P(vs=>{Object.defineProperty(vs,"__esModule",{value:!0});vs.WriteableStreamMessageWriter=vs.AbstractMessageWriter=vs.MessageWriter=void 0;var AO=ms(),uc=ho(),zZ=f_(),RO=go(),GZ="Content-Length: ",IO=`\r
`,PO;(function(e){function t(r){let n=r;return n&&uc.func(n.dispose)&&uc.func(n.onClose)&&uc.func(n.onError)&&uc.func(n.write)}e.is=t;})(PO||(vs.MessageWriter=PO={}));var Nd=class{constructor(){this.errorEmitter=new RO.Emitter,this.closeEmitter=new RO.Emitter;}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose();}get onError(){return this.errorEmitter.event}fireError(t,r,n){this.errorEmitter.fire([this.asError(t),r,n]);}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0);}asError(t){return t instanceof Error?t:new Error(`Writer received error. Reason: ${uc.string(t.message)?t.message:"unknown"}`)}};vs.AbstractMessageWriter=Nd;var m_;(function(e){function t(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0, AO.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0, AO.default)().applicationJson.encoder}}e.fromOptions=t;})(m_||(m_={}));var y_=class extends Nd{constructor(t,r){super(),this.writable=t,this.options=m_.fromOptions(r),this.errorCount=0,this.writeSemaphore=new zZ.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose());}async write(t){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(t,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(GZ,n.byteLength.toString(),IO),i.push(IO),this.doWrite(t,i,n)},n=>{throw this.fireError(n),n}))}async doWrite(t,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){return this.handleError(i,t),Promise.reject(i)}}handleError(t,r){this.errorCount++,this.fireError(t,r,this.errorCount);}end(){this.writable.end();}};vs.WriteableStreamMessageWriter=y_;});var DO=P(Dd=>{Object.defineProperty(Dd,"__esModule",{value:!0});Dd.AbstractMessageBuffer=void 0;var YZ=13,QZ=10,ZZ=`\r
`,v_=class{constructor(t="utf-8"){this._encoding=t,this._chunks=[],this._totalLength=0;}get encoding(){return this._encoding}append(t){let r=typeof t=="string"?this.fromString(t,this._encoding):t;this._chunks.push(r),this._totalLength+=r.byteLength;}tryReadHeaders(t=!1){if(this._chunks.length===0)return;let r=0,n=0,i=0,s=0;e:for(;n<this._chunks.length;){let l=this._chunks[n];for(i=0;i<l.length;){switch(l[i]){case YZ:switch(r){case 0:r=1;break;case 2:r=3;break;default:r=0;}break;case QZ:switch(r){case 1:r=2;break;case 3:r=4,i++;break e;default:r=0;}break;default:r=0;}i++;}s+=l.byteLength,n++;}if(r!==4)return;let a=this._read(s+i),o=new Map,c=this.toString(a,"ascii").split(ZZ);if(c.length<2)return o;for(let l=0;l<c.length-2;l++){let u=c[l],f=u.indexOf(":");if(f===-1)throw new Error(`Message header must separate key and value using ':'
${u}`);let h=u.substr(0,f),p=u.substr(f+1).trim();o.set(t?h.toLowerCase():h,p);}return o}tryReadBody(t){if(!(this._totalLength<t))return this._read(t)}get numberOfBytes(){return this._totalLength}_read(t){if(t===0)return this.emptyBuffer();if(t>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===t){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=t,this.asNative(s)}if(this._chunks[0].byteLength>t){let s=this._chunks[0],a=this.asNative(s,t);return this._chunks[0]=s.slice(t),this._totalLength-=t,a}let r=this.allocNative(t),n=0,i=0;for(;t>0;){let s=this._chunks[i];if(s.byteLength>t){let a=s.slice(0,t);r.set(a,n),n+=t,this._chunks[i]=s.slice(t),this._totalLength-=t,t-=t;}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,t-=s.byteLength;}return r}};Dd.AbstractMessageBuffer=v_;});var FO=P(Ze=>{Object.defineProperty(Ze,"__esModule",{value:!0});Ze.createMessageConnection=Ze.ConnectionOptions=Ze.MessageStrategy=Ze.CancellationStrategy=Ze.CancellationSenderStrategy=Ze.CancellationReceiverStrategy=Ze.RequestCancellationReceiverStrategy=Ze.IdCancellationReceiverStrategy=Ze.ConnectionStrategy=Ze.ConnectionError=Ze.ConnectionErrors=Ze.LogTraceNotification=Ze.SetTraceNotification=Ze.TraceFormat=Ze.TraceValues=Ze.Trace=Ze.NullLogger=Ze.ProgressType=Ze.ProgressToken=void 0;var kO=ms(),Yt=ho(),$e=Zv(),OO=Jv(),cc=go(),__=Rd(),dc;(function(e){e.type=new $e.NotificationType("$/cancelRequest");})(dc||(dc={}));var b_;(function(e){function t(r){return typeof r=="string"||typeof r=="number"}e.is=t;})(b_||(Ze.ProgressToken=b_={}));var lc;(function(e){e.type=new $e.NotificationType("$/progress");})(lc||(lc={}));var S_=class{constructor(){}};Ze.ProgressType=S_;var E_;(function(e){function t(r){return Yt.func(r)}e.is=t;})(E_||(E_={}));Ze.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Et;(function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Compact=2]="Compact",e[e.Verbose=3]="Verbose";})(Et||(Ze.Trace=Et={}));var LO;(function(e){e.Off="off",e.Messages="messages",e.Compact="compact",e.Verbose="verbose";})(LO||(Ze.TraceValues=LO={}));(function(e){function t(n){if(!Yt.string(n))return e.Off;switch(n=n.toLowerCase(),n){case"off":return e.Off;case"messages":return e.Messages;case"compact":return e.Compact;case"verbose":return e.Verbose;default:return e.Off}}e.fromString=t;function r(n){switch(n){case e.Off:return "off";case e.Messages:return "messages";case e.Compact:return "compact";case e.Verbose:return "verbose";default:return "off"}}e.toString=r;})(Et||(Ze.Trace=Et={}));var mn;(function(e){e.Text="text",e.JSON="json";})(mn||(Ze.TraceFormat=mn={}));(function(e){function t(r){return Yt.string(r)?(r=r.toLowerCase(),r==="json"?e.JSON:e.Text):e.Text}e.fromString=t;})(mn||(Ze.TraceFormat=mn={}));var w_;(function(e){e.type=new $e.NotificationType("$/setTrace");})(w_||(Ze.SetTraceNotification=w_={}));var kd;(function(e){e.type=new $e.NotificationType("$/logTrace");})(kd||(Ze.LogTraceNotification=kd={}));var fc;(function(e){e[e.Closed=1]="Closed",e[e.Disposed=2]="Disposed",e[e.AlreadyListening=3]="AlreadyListening";})(fc||(Ze.ConnectionErrors=fc={}));var _o=class e extends Error{constructor(t,r){super(r),this.code=t,Object.setPrototypeOf(this,e.prototype);}};Ze.ConnectionError=_o;var C_;(function(e){function t(r){let n=r;return n&&Yt.func(n.cancelUndispatched)}e.is=t;})(C_||(Ze.ConnectionStrategy=C_={}));var Od;(function(e){function t(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&Yt.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Yt.func(n.dispose))}e.is=t;})(Od||(Ze.IdCancellationReceiverStrategy=Od={}));var x_;(function(e){function t(r){let n=r;return n&&n.kind==="request"&&Yt.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Yt.func(n.dispose))}e.is=t;})(x_||(Ze.RequestCancellationReceiverStrategy=x_={}));var Ld;(function(e){e.Message=Object.freeze({createCancellationTokenSource(r){return new __.CancellationTokenSource}});function t(r){return Od.is(r)||x_.is(r)}e.is=t;})(Ld||(Ze.CancellationReceiverStrategy=Ld={}));var Bd;(function(e){e.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(dc.type,{id:n})},cleanup(r){}});function t(r){let n=r;return n&&Yt.func(n.sendCancellation)&&Yt.func(n.cleanup)}e.is=t;})(Bd||(Ze.CancellationSenderStrategy=Bd={}));var Fd;(function(e){e.Message=Object.freeze({receiver:Ld.Message,sender:Bd.Message});function t(r){let n=r;return n&&Ld.is(n.receiver)&&Bd.is(n.sender)}e.is=t;})(Fd||(Ze.CancellationStrategy=Fd={}));var Md;(function(e){function t(r){let n=r;return n&&Yt.func(n.handleMessage)}e.is=t;})(Md||(Ze.MessageStrategy=Md={}));var BO;(function(e){function t(r){let n=r;return n&&(Fd.is(n.cancellationStrategy)||C_.is(n.connectionStrategy)||Md.is(n.messageStrategy))}e.is=t;})(BO||(Ze.ConnectionOptions=BO={}));var Yn;(function(e){e[e.New=1]="New",e[e.Listening=2]="Listening",e[e.Closed=3]="Closed",e[e.Disposed=4]="Disposed";})(Yn||(Yn={}));function XZ(e,t,r,n){let i=r!==void 0?r:Ze.NullLogger,s=0,a=0,o=0,c="2.0",l,u=new Map,f,h=new Map,p=new Map,m,_=new OO.LinkedMap,E=new Map,w=new Set,y=new Map,b=Et.Off,N=mn.Text,L,V=Yn.New,X=new cc.Emitter,z=new cc.Emitter,G=new cc.Emitter,ee=new cc.Emitter,U=new cc.Emitter,ie=n&&n.cancellationStrategy?n.cancellationStrategy:Fd.Message;function me(M){if(M===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return "req-"+M.toString()}function Pe(M){return M===null?"res-unknown-"+(++o).toString():"res-"+M.toString()}function W(){return "not-"+(++a).toString()}function K(M,ae){$e.Message.isRequest(ae)?M.set(me(ae.id),ae):$e.Message.isResponse(ae)?M.set(Pe(ae.id),ae):M.set(W(),ae);}function se(M){}function Ae(){return V===Yn.Listening}function Fe(){return V===Yn.Closed}function Ke(){return V===Yn.Disposed}function Ve(){(V===Yn.New||V===Yn.Listening)&&(V=Yn.Closed,z.fire(void 0));}function ot(M){X.fire([M,void 0,void 0]);}function Dt(M){X.fire(M);}e.onClose(Ve),e.onError(ot),t.onClose(Ve),t.onError(Dt);function bt(){m||_.size===0||(m=(0, kO.default)().timer.setImmediate(()=>{m=void 0,Oe();}));}function ft(M){$e.Message.isRequest(M)?qt(M):$e.Message.isNotification(M)?je(M):$e.Message.isResponse(M)?ye(M):le(M);}function Oe(){if(_.size===0)return;let M=_.shift();try{let ae=n?.messageStrategy;Md.is(ae)?ae.handleMessage(M,ft):ft(M);}finally{bt();}}let Rt=M=>{try{if($e.Message.isNotification(M)&&M.method===dc.type.method){let ae=M.params.id,Se=me(ae),Ne=_.get(Se);if($e.Message.isRequest(Ne)){let gt=n?.connectionStrategy,It=gt&&gt.cancelUndispatched?gt.cancelUndispatched(Ne,se):void 0;if(It&&(It.error!==void 0||It.result!==void 0)){_.delete(Se),y.delete(ae),It.id=Ne.id,ze(It,M.method,Date.now()),t.write(It).catch(()=>i.error("Sending response for canceled message failed."));return}}let St=y.get(ae);if(St!==void 0){St.cancel(),Or(M);return}else w.add(ae);}K(_,M);}finally{bt();}};function qt(M){if(Ke())return;function ae(tt,xt,dt){let Vt={jsonrpc:c,id:M.id};tt instanceof $e.ResponseError?Vt.error=tt.toJson():Vt.result=tt===void 0?null:tt,ze(Vt,xt,dt),t.write(Vt).catch(()=>i.error("Sending response failed."));}function Se(tt,xt,dt){let Vt={jsonrpc:c,id:M.id,error:tt.toJson()};ze(Vt,xt,dt),t.write(Vt).catch(()=>i.error("Sending response failed."));}function Ne(tt,xt,dt){tt===void 0&&(tt=null);let Vt={jsonrpc:c,id:M.id,result:tt};ze(Vt,xt,dt),t.write(Vt).catch(()=>i.error("Sending response failed."));}vn(M);let St=u.get(M.method),gt,It;St&&(gt=St.type,It=St.handler);let Ot=Date.now();if(It||l){let tt=M.id??String(Date.now()),xt=Od.is(ie.receiver)?ie.receiver.createCancellationTokenSource(tt):ie.receiver.createCancellationTokenSource(M);M.id!==null&&w.has(M.id)&&xt.cancel(),M.id!==null&&y.set(tt,xt);try{let dt;if(It)if(M.params===void 0){if(gt!==void 0&&gt.numberOfParams!==0){Se(new $e.ResponseError($e.ErrorCodes.InvalidParams,`Request ${M.method} defines ${gt.numberOfParams} params but received none.`),M.method,Ot);return}dt=It(xt.token);}else if(Array.isArray(M.params)){if(gt!==void 0&&gt.parameterStructures===$e.ParameterStructures.byName){Se(new $e.ResponseError($e.ErrorCodes.InvalidParams,`Request ${M.method} defines parameters by name but received parameters by position`),M.method,Ot);return}dt=It(...M.params,xt.token);}else {if(gt!==void 0&&gt.parameterStructures===$e.ParameterStructures.byPosition){Se(new $e.ResponseError($e.ErrorCodes.InvalidParams,`Request ${M.method} defines parameters by position but received parameters by name`),M.method,Ot);return}dt=It(M.params,xt.token);}else l&&(dt=l(M.method,M.params,xt.token));let Vt=dt;dt?Vt.then?Vt.then(Xt=>{y.delete(tt),ae(Xt,M.method,Ot);},Xt=>{y.delete(tt),Xt instanceof $e.ResponseError?Se(Xt,M.method,Ot):Xt&&Yt.string(Xt.message)?Se(new $e.ResponseError($e.ErrorCodes.InternalError,`Request ${M.method} failed with message: ${Xt.message}`),M.method,Ot):Se(new $e.ResponseError($e.ErrorCodes.InternalError,`Request ${M.method} failed unexpectedly without providing any details.`),M.method,Ot);}):(y.delete(tt),ae(dt,M.method,Ot)):(y.delete(tt),Ne(dt,M.method,Ot));}catch(dt){y.delete(tt),dt instanceof $e.ResponseError?ae(dt,M.method,Ot):dt&&Yt.string(dt.message)?Se(new $e.ResponseError($e.ErrorCodes.InternalError,`Request ${M.method} failed with message: ${dt.message}`),M.method,Ot):Se(new $e.ResponseError($e.ErrorCodes.InternalError,`Request ${M.method} failed unexpectedly without providing any details.`),M.method,Ot);}}else Se(new $e.ResponseError($e.ErrorCodes.MethodNotFound,`Unhandled method ${M.method}`),M.method,Ot);}function ye(M){if(!Ke())if(M.id===null)M.error?i.error(`Received response message without id: Error is: 
${JSON.stringify(M.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else {let ae=M.id,Se=E.get(ae);if(As(M,Se),Se!==void 0){E.delete(ae);try{if(M.error){let Ne=M.error;Se.reject(new $e.ResponseError(Ne.code,Ne.message,Ne.data));}else if(M.result!==void 0)Se.resolve(M.result);else throw new Error("Should never happen.")}catch(Ne){Ne.message?i.error(`Response handler '${Se.method}' failed with message: ${Ne.message}`):i.error(`Response handler '${Se.method}' failed unexpectedly.`);}}}}function je(M){if(Ke())return;let ae,Se;if(M.method===dc.type.method){let Ne=M.params.id;w.delete(Ne),Or(M);return}else {let Ne=h.get(M.method);Ne&&(Se=Ne.handler,ae=Ne.type);}if(Se||f)try{if(Or(M),Se)if(M.params===void 0)ae!==void 0&&ae.numberOfParams!==0&&ae.parameterStructures!==$e.ParameterStructures.byName&&i.error(`Notification ${M.method} defines ${ae.numberOfParams} params but received none.`),Se();else if(Array.isArray(M.params)){let Ne=M.params;M.method===lc.type.method&&Ne.length===2&&b_.is(Ne[0])?Se({token:Ne[0],value:Ne[1]}):(ae!==void 0&&(ae.parameterStructures===$e.ParameterStructures.byName&&i.error(`Notification ${M.method} defines parameters by name but received parameters by position`),ae.numberOfParams!==M.params.length&&i.error(`Notification ${M.method} defines ${ae.numberOfParams} params but received ${Ne.length} arguments`)),Se(...Ne));}else ae!==void 0&&ae.parameterStructures===$e.ParameterStructures.byPosition&&i.error(`Notification ${M.method} defines parameters by position but received parameters by name`),Se(M.params);else f&&f(M.method,M.params);}catch(Ne){Ne.message?i.error(`Notification handler '${M.method}' failed with message: ${Ne.message}`):i.error(`Notification handler '${M.method}' failed unexpectedly.`);}else G.fire(M);}function le(M){if(!M){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
${JSON.stringify(M,null,4)}`);let ae=M;if(Yt.string(ae.id)||Yt.number(ae.id)){let Se=ae.id,Ne=E.get(Se);Ne&&Ne.reject(new Error("The received response has neither a result nor an error property."));}}function Ie(M){if(M!=null)switch(b){case Et.Verbose:return JSON.stringify(M,null,4);case Et.Compact:return JSON.stringify(M);default:return}}function He(M){if(!(b===Et.Off||!L))if(N===mn.Text){let ae;(b===Et.Verbose||b===Et.Compact)&&M.params&&(ae=`Params: ${Ie(M.params)}

`),L.log(`Sending request '${M.method} - (${M.id})'.`,ae);}else Lr("send-request",M);}function et(M){if(!(b===Et.Off||!L))if(N===mn.Text){let ae;(b===Et.Verbose||b===Et.Compact)&&(M.params?ae=`Params: ${Ie(M.params)}

`:ae=`No parameters provided.

`),L.log(`Sending notification '${M.method}'.`,ae);}else Lr("send-notification",M);}function ze(M,ae,Se){if(!(b===Et.Off||!L))if(N===mn.Text){let Ne;(b===Et.Verbose||b===Et.Compact)&&(M.error&&M.error.data?Ne=`Error data: ${Ie(M.error.data)}

`:M.result?Ne=`Result: ${Ie(M.result)}

`:M.error===void 0&&(Ne=`No result returned.

`)),L.log(`Sending response '${ae} - (${M.id})'. Processing request took ${Date.now()-Se}ms`,Ne);}else Lr("send-response",M);}function vn(M){if(!(b===Et.Off||!L))if(N===mn.Text){let ae;(b===Et.Verbose||b===Et.Compact)&&M.params&&(ae=`Params: ${Ie(M.params)}

`),L.log(`Received request '${M.method} - (${M.id})'.`,ae);}else Lr("receive-request",M);}function Or(M){if(!(b===Et.Off||!L||M.method===kd.type.method))if(N===mn.Text){let ae;(b===Et.Verbose||b===Et.Compact)&&(M.params?ae=`Params: ${Ie(M.params)}

`:ae=`No parameters provided.

`),L.log(`Received notification '${M.method}'.`,ae);}else Lr("receive-notification",M);}function As(M,ae){if(!(b===Et.Off||!L))if(N===mn.Text){let Se;if((b===Et.Verbose||b===Et.Compact)&&(M.error&&M.error.data?Se=`Error data: ${Ie(M.error.data)}

`:M.result?Se=`Result: ${Ie(M.result)}

`:M.error===void 0&&(Se=`No result returned.

`)),ae){let Ne=M.error?` Request failed: ${M.error.message} (${M.error.code}).`:"";L.log(`Received response '${ae.method} - (${M.id})' in ${Date.now()-ae.timerStart}ms.${Ne}`,Se);}else L.log(`Received response ${M.id} without active response promise.`,Se);}else Lr("receive-response",M);}function Lr(M,ae){if(!L||b===Et.Off)return;let Se={isLSPMessage:!0,type:M,message:ae,timestamp:Date.now()};L.log(Se);}function Kr(){if(Fe())throw new _o(fc.Closed,"Connection is closed.");if(Ke())throw new _o(fc.Disposed,"Connection is disposed.")}function Rs(){if(Ae())throw new _o(fc.AlreadyListening,"Connection is already listening")}function ma(){if(!Ae())throw new Error("Call listen() first.")}function an(M){return M===void 0?null:M}function Is(M){if(M!==null)return M}function Ps(M){return M!=null&&!Array.isArray(M)&&typeof M=="object"}function Si(M,ae){switch(M){case $e.ParameterStructures.auto:return Ps(ae)?Is(ae):[an(ae)];case $e.ParameterStructures.byName:if(!Ps(ae))throw new Error("Received parameters by name but param is not an object literal.");return Is(ae);case $e.ParameterStructures.byPosition:return [an(ae)];default:throw new Error(`Unknown parameter structure ${M.toString()}`)}}function Ns(M,ae){let Se,Ne=M.numberOfParams;switch(Ne){case 0:Se=void 0;break;case 1:Se=Si(M.parameterStructures,ae[0]);break;default:Se=[];for(let St=0;St<ae.length&&St<Ne;St++)Se.push(an(ae[St]));if(ae.length<Ne)for(let St=ae.length;St<Ne;St++)Se.push(null);break}return Se}let Fn={sendNotification:(M,...ae)=>{Kr();let Se,Ne;if(Yt.string(M)){Se=M;let gt=ae[0],It=0,Ot=$e.ParameterStructures.auto;$e.ParameterStructures.is(gt)&&(It=1,Ot=gt);let tt=ae.length,xt=tt-It;switch(xt){case 0:Ne=void 0;break;case 1:Ne=Si(Ot,ae[It]);break;default:if(Ot===$e.ParameterStructures.byName)throw new Error(`Received ${xt} parameters for 'by Name' notification parameter structure.`);Ne=ae.slice(It,tt).map(dt=>an(dt));break}}else {let gt=ae;Se=M.method,Ne=Ns(M,gt);}let St={jsonrpc:c,method:Se,params:Ne};return et(St),t.write(St).catch(gt=>{throw i.error("Sending notification failed."),gt})},onNotification:(M,ae)=>{Kr();let Se;return Yt.func(M)?f=M:ae&&(Yt.string(M)?(Se=M,h.set(M,{type:void 0,handler:ae})):(Se=M.method,h.set(M.method,{type:M,handler:ae}))),{dispose:()=>{Se!==void 0?h.delete(Se):f=void 0;}}},onProgress:(M,ae,Se)=>{if(p.has(ae))throw new Error(`Progress handler for token ${ae} already registered`);return p.set(ae,Se),{dispose:()=>{p.delete(ae);}}},sendProgress:(M,ae,Se)=>Fn.sendNotification(lc.type,{token:ae,value:Se}),onUnhandledProgress:ee.event,sendRequest:(M,...ae)=>{Kr(),ma();let Se,Ne,St;if(Yt.string(M)){Se=M;let tt=ae[0],xt=ae[ae.length-1],dt=0,Vt=$e.ParameterStructures.auto;$e.ParameterStructures.is(tt)&&(dt=1,Vt=tt);let Xt=ae.length;__.CancellationToken.is(xt)&&(Xt=Xt-1,St=xt);let Br=Xt-dt;switch(Br){case 0:Ne=void 0;break;case 1:Ne=Si(Vt,ae[dt]);break;default:if(Vt===$e.ParameterStructures.byName)throw new Error(`Received ${Br} parameters for 'by Name' request parameter structure.`);Ne=ae.slice(dt,Xt).map(ya=>an(ya));break}}else {let tt=ae;Se=M.method,Ne=Ns(M,tt);let xt=M.numberOfParams;St=__.CancellationToken.is(tt[xt])?tt[xt]:void 0;}let gt=s++,It;St&&(It=St.onCancellationRequested(()=>{let tt=ie.sender.sendCancellation(Fn,gt);return tt===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${gt}`),Promise.resolve()):tt.catch(()=>{i.log(`Sending cancellation messages for id ${gt} failed`);})}));let Ot={jsonrpc:c,id:gt,method:Se,params:Ne};return He(Ot),typeof ie.sender.enableCancellation=="function"&&ie.sender.enableCancellation(Ot),new Promise(async(tt,xt)=>{let dt=Br=>{tt(Br),ie.sender.cleanup(gt),It?.dispose();},Vt=Br=>{xt(Br),ie.sender.cleanup(gt),It?.dispose();},Xt={method:Se,timerStart:Date.now(),resolve:dt,reject:Vt};try{await t.write(Ot),E.set(gt,Xt);}catch(Br){throw i.error("Sending request failed."),Xt.reject(new $e.ResponseError($e.ErrorCodes.MessageWriteError,Br.message?Br.message:"Unknown reason")),Br}})},onRequest:(M,ae)=>{Kr();let Se=null;return E_.is(M)?(Se=void 0,l=M):Yt.string(M)?(Se=null,ae!==void 0&&(Se=M,u.set(M,{handler:ae,type:void 0}))):ae!==void 0&&(Se=M.method,u.set(M.method,{type:M,handler:ae})),{dispose:()=>{Se!==null&&(Se!==void 0?u.delete(Se):l=void 0);}}},hasPendingResponse:()=>E.size>0,trace:async(M,ae,Se)=>{let Ne=!1,St=mn.Text;Se!==void 0&&(Yt.boolean(Se)?Ne=Se:(Ne=Se.sendNotification||!1,St=Se.traceFormat||mn.Text)),b=M,N=St,b===Et.Off?L=void 0:L=ae,Ne&&!Fe()&&!Ke()&&await Fn.sendNotification(w_.type,{value:Et.toString(M)});},onError:X.event,onClose:z.event,onUnhandledNotification:G.event,onDispose:U.event,end:()=>{t.end();},dispose:()=>{if(Ke())return;V=Yn.Disposed,U.fire(void 0);let M=new $e.ResponseError($e.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let ae of E.values())ae.reject(M);E=new Map,y=new Map,w=new Set,_=new OO.LinkedMap,Yt.func(t.dispose)&&t.dispose(),Yt.func(e.dispose)&&e.dispose();},listen:()=>{Kr(),Rs(),V=Yn.Listening,e.listen(Rt);},inspect:()=>{(0, kO.default)().console.log("inspect");}};return Fn.onNotification(kd.type,M=>{if(b===Et.Off||!L)return;let ae=b===Et.Verbose||b===Et.Compact;L.log(M.message,ae?M.verbose:void 0);}),Fn.onNotification(lc.type,M=>{let ae=p.get(M.token);ae?ae(M.value):ee.fire(M);}),Fn}Ze.createMessageConnection=XZ;});var qd=P(re=>{Object.defineProperty(re,"__esModule",{value:!0});re.ProgressType=re.ProgressToken=re.createMessageConnection=re.NullLogger=re.ConnectionOptions=re.ConnectionStrategy=re.AbstractMessageBuffer=re.WriteableStreamMessageWriter=re.AbstractMessageWriter=re.MessageWriter=re.ReadableStreamMessageReader=re.AbstractMessageReader=re.MessageReader=re.SharedArrayReceiverStrategy=re.SharedArraySenderStrategy=re.CancellationToken=re.CancellationTokenSource=re.Emitter=re.Event=re.Disposable=re.LRUCache=re.Touch=re.LinkedMap=re.ParameterStructures=re.NotificationType9=re.NotificationType8=re.NotificationType7=re.NotificationType6=re.NotificationType5=re.NotificationType4=re.NotificationType3=re.NotificationType2=re.NotificationType1=re.NotificationType0=re.NotificationType=re.ErrorCodes=re.ResponseError=re.RequestType9=re.RequestType8=re.RequestType7=re.RequestType6=re.RequestType5=re.RequestType4=re.RequestType3=re.RequestType2=re.RequestType1=re.RequestType0=re.RequestType=re.Message=re.RAL=void 0;re.MessageStrategy=re.CancellationStrategy=re.CancellationSenderStrategy=re.CancellationReceiverStrategy=re.ConnectionError=re.ConnectionErrors=re.LogTraceNotification=re.SetTraceNotification=re.TraceFormat=re.TraceValues=re.Trace=void 0;var Mt=Zv();Object.defineProperty(re,"Message",{enumerable:!0,get:function(){return Mt.Message}});Object.defineProperty(re,"RequestType",{enumerable:!0,get:function(){return Mt.RequestType}});Object.defineProperty(re,"RequestType0",{enumerable:!0,get:function(){return Mt.RequestType0}});Object.defineProperty(re,"RequestType1",{enumerable:!0,get:function(){return Mt.RequestType1}});Object.defineProperty(re,"RequestType2",{enumerable:!0,get:function(){return Mt.RequestType2}});Object.defineProperty(re,"RequestType3",{enumerable:!0,get:function(){return Mt.RequestType3}});Object.defineProperty(re,"RequestType4",{enumerable:!0,get:function(){return Mt.RequestType4}});Object.defineProperty(re,"RequestType5",{enumerable:!0,get:function(){return Mt.RequestType5}});Object.defineProperty(re,"RequestType6",{enumerable:!0,get:function(){return Mt.RequestType6}});Object.defineProperty(re,"RequestType7",{enumerable:!0,get:function(){return Mt.RequestType7}});Object.defineProperty(re,"RequestType8",{enumerable:!0,get:function(){return Mt.RequestType8}});Object.defineProperty(re,"RequestType9",{enumerable:!0,get:function(){return Mt.RequestType9}});Object.defineProperty(re,"ResponseError",{enumerable:!0,get:function(){return Mt.ResponseError}});Object.defineProperty(re,"ErrorCodes",{enumerable:!0,get:function(){return Mt.ErrorCodes}});Object.defineProperty(re,"NotificationType",{enumerable:!0,get:function(){return Mt.NotificationType}});Object.defineProperty(re,"NotificationType0",{enumerable:!0,get:function(){return Mt.NotificationType0}});Object.defineProperty(re,"NotificationType1",{enumerable:!0,get:function(){return Mt.NotificationType1}});Object.defineProperty(re,"NotificationType2",{enumerable:!0,get:function(){return Mt.NotificationType2}});Object.defineProperty(re,"NotificationType3",{enumerable:!0,get:function(){return Mt.NotificationType3}});Object.defineProperty(re,"NotificationType4",{enumerable:!0,get:function(){return Mt.NotificationType4}});Object.defineProperty(re,"NotificationType5",{enumerable:!0,get:function(){return Mt.NotificationType5}});Object.defineProperty(re,"NotificationType6",{enumerable:!0,get:function(){return Mt.NotificationType6}});Object.defineProperty(re,"NotificationType7",{enumerable:!0,get:function(){return Mt.NotificationType7}});Object.defineProperty(re,"NotificationType8",{enumerable:!0,get:function(){return Mt.NotificationType8}});Object.defineProperty(re,"NotificationType9",{enumerable:!0,get:function(){return Mt.NotificationType9}});Object.defineProperty(re,"ParameterStructures",{enumerable:!0,get:function(){return Mt.ParameterStructures}});var T_=Jv();Object.defineProperty(re,"LinkedMap",{enumerable:!0,get:function(){return T_.LinkedMap}});Object.defineProperty(re,"LRUCache",{enumerable:!0,get:function(){return T_.LRUCache}});Object.defineProperty(re,"Touch",{enumerable:!0,get:function(){return T_.Touch}});var JZ=EO();Object.defineProperty(re,"Disposable",{enumerable:!0,get:function(){return JZ.Disposable}});var MO=go();Object.defineProperty(re,"Event",{enumerable:!0,get:function(){return MO.Event}});Object.defineProperty(re,"Emitter",{enumerable:!0,get:function(){return MO.Emitter}});var qO=Rd();Object.defineProperty(re,"CancellationTokenSource",{enumerable:!0,get:function(){return qO.CancellationTokenSource}});Object.defineProperty(re,"CancellationToken",{enumerable:!0,get:function(){return qO.CancellationToken}});var UO=CO();Object.defineProperty(re,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return UO.SharedArraySenderStrategy}});Object.defineProperty(re,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return UO.SharedArrayReceiverStrategy}});var A_=TO();Object.defineProperty(re,"MessageReader",{enumerable:!0,get:function(){return A_.MessageReader}});Object.defineProperty(re,"AbstractMessageReader",{enumerable:!0,get:function(){return A_.AbstractMessageReader}});Object.defineProperty(re,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return A_.ReadableStreamMessageReader}});var R_=NO();Object.defineProperty(re,"MessageWriter",{enumerable:!0,get:function(){return R_.MessageWriter}});Object.defineProperty(re,"AbstractMessageWriter",{enumerable:!0,get:function(){return R_.AbstractMessageWriter}});Object.defineProperty(re,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return R_.WriteableStreamMessageWriter}});var eX=DO();Object.defineProperty(re,"AbstractMessageBuffer",{enumerable:!0,get:function(){return eX.AbstractMessageBuffer}});var Tr=FO();Object.defineProperty(re,"ConnectionStrategy",{enumerable:!0,get:function(){return Tr.ConnectionStrategy}});Object.defineProperty(re,"ConnectionOptions",{enumerable:!0,get:function(){return Tr.ConnectionOptions}});Object.defineProperty(re,"NullLogger",{enumerable:!0,get:function(){return Tr.NullLogger}});Object.defineProperty(re,"createMessageConnection",{enumerable:!0,get:function(){return Tr.createMessageConnection}});Object.defineProperty(re,"ProgressToken",{enumerable:!0,get:function(){return Tr.ProgressToken}});Object.defineProperty(re,"ProgressType",{enumerable:!0,get:function(){return Tr.ProgressType}});Object.defineProperty(re,"Trace",{enumerable:!0,get:function(){return Tr.Trace}});Object.defineProperty(re,"TraceValues",{enumerable:!0,get:function(){return Tr.TraceValues}});Object.defineProperty(re,"TraceFormat",{enumerable:!0,get:function(){return Tr.TraceFormat}});Object.defineProperty(re,"SetTraceNotification",{enumerable:!0,get:function(){return Tr.SetTraceNotification}});Object.defineProperty(re,"LogTraceNotification",{enumerable:!0,get:function(){return Tr.LogTraceNotification}});Object.defineProperty(re,"ConnectionErrors",{enumerable:!0,get:function(){return Tr.ConnectionErrors}});Object.defineProperty(re,"ConnectionError",{enumerable:!0,get:function(){return Tr.ConnectionError}});Object.defineProperty(re,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Tr.CancellationReceiverStrategy}});Object.defineProperty(re,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Tr.CancellationSenderStrategy}});Object.defineProperty(re,"CancellationStrategy",{enumerable:!0,get:function(){return Tr.CancellationStrategy}});Object.defineProperty(re,"MessageStrategy",{enumerable:!0,get:function(){return Tr.MessageStrategy}});var tX=ms();re.RAL=tX.default;});var VO=P(D_=>{Object.defineProperty(D_,"__esModule",{value:!0});var jO=he("util"),Bi=qd(),Ud=class e extends Bi.AbstractMessageBuffer{constructor(t="utf-8"){super(t);}emptyBuffer(){return e.emptyBuffer}fromString(t,r){return Buffer.from(t,r)}toString(t,r){return t instanceof Buffer?t.toString(r):new jO.TextDecoder(r).decode(t)}asNative(t,r){return r===void 0?t instanceof Buffer?t:Buffer.from(t):t instanceof Buffer?t.slice(0,r):Buffer.from(t,0,r)}allocNative(t){return Buffer.allocUnsafe(t)}};Ud.emptyBuffer=Buffer.allocUnsafe(0);var I_=class{constructor(t){this.stream=t;}onClose(t){return this.stream.on("close",t),Bi.Disposable.create(()=>this.stream.off("close",t))}onError(t){return this.stream.on("error",t),Bi.Disposable.create(()=>this.stream.off("error",t))}onEnd(t){return this.stream.on("end",t),Bi.Disposable.create(()=>this.stream.off("end",t))}onData(t){return this.stream.on("data",t),Bi.Disposable.create(()=>this.stream.off("data",t))}},P_=class{constructor(t){this.stream=t;}onClose(t){return this.stream.on("close",t),Bi.Disposable.create(()=>this.stream.off("close",t))}onError(t){return this.stream.on("error",t),Bi.Disposable.create(()=>this.stream.off("error",t))}onEnd(t){return this.stream.on("end",t),Bi.Disposable.create(()=>this.stream.off("end",t))}write(t,r){return new Promise((n,i)=>{let s=a=>{a==null?n():i(a);};typeof t=="string"?this.stream.write(t,r,s):this.stream.write(t,s);})}end(){this.stream.end();}},$O=Object.freeze({messageBuffer:Object.freeze({create:e=>new Ud(e)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(e,t)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(e,void 0,0),t.charset))}catch(r){return Promise.reject(r)}}}),decoder:Object.freeze({name:"application/json",decode:(e,t)=>{try{return e instanceof Buffer?Promise.resolve(JSON.parse(e.toString(t.charset))):Promise.resolve(JSON.parse(new jO.TextDecoder(t.charset).decode(e)))}catch(r){return Promise.reject(r)}}})}),stream:Object.freeze({asReadableStream:e=>new I_(e),asWritableStream:e=>new P_(e)}),console,timer:Object.freeze({setTimeout(e,t,...r){let n=setTimeout(e,t,...r);return {dispose:()=>clearTimeout(n)}},setImmediate(e,...t){let r=setImmediate(e,...t);return {dispose:()=>clearImmediate(r)}},setInterval(e,t,...r){let n=setInterval(e,t,...r);return {dispose:()=>clearInterval(n)}}})});function N_(){return $O}(function(e){function t(){Bi.RAL.install($O);}e.install=t;})(N_||(N_={}));D_.default=N_;});var fa=P(lt=>{var rX=lt&&lt.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i);}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r];}),nX=lt&&lt.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&rX(t,e,r);};Object.defineProperty(lt,"__esModule",{value:!0});lt.createMessageConnection=lt.createServerSocketTransport=lt.createClientSocketTransport=lt.createServerPipeTransport=lt.createClientPipeTransport=lt.generateRandomPipeName=lt.StreamMessageWriter=lt.StreamMessageReader=lt.SocketMessageWriter=lt.SocketMessageReader=lt.PortMessageWriter=lt.PortMessageReader=lt.IPCMessageWriter=lt.IPCMessageReader=void 0;var bo=VO();bo.default.install();var HO=he("path"),iX=he("os"),sX=he("crypto"),Vd=he("net"),yn=qd();nX(qd(),lt);var k_=class extends yn.AbstractMessageReader{constructor(t){super(),this.process=t;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose());}listen(t){return this.process.on("message",t),yn.Disposable.create(()=>this.process.off("message",t))}};lt.IPCMessageReader=k_;var O_=class extends yn.AbstractMessageWriter{constructor(t){super(),this.process=t,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose);}write(t){try{return typeof this.process.send=="function"&&this.process.send(t,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,t)):this.errorCount=0;}),Promise.resolve()}catch(r){return this.handleError(r,t),Promise.reject(r)}}handleError(t,r){this.errorCount++,this.fireError(t,r,this.errorCount);}end(){}};lt.IPCMessageWriter=O_;var L_=class extends yn.AbstractMessageReader{constructor(t){super(),this.onData=new yn.Emitter,t.on("close",()=>this.fireClose),t.on("error",r=>this.fireError(r)),t.on("message",r=>{this.onData.fire(r);});}listen(t){return this.onData.event(t)}};lt.PortMessageReader=L_;var B_=class extends yn.AbstractMessageWriter{constructor(t){super(),this.port=t,this.errorCount=0,t.on("close",()=>this.fireClose()),t.on("error",r=>this.fireError(r));}write(t){try{return this.port.postMessage(t),Promise.resolve()}catch(r){return this.handleError(r,t),Promise.reject(r)}}handleError(t,r){this.errorCount++,this.fireError(t,r,this.errorCount);}end(){}};lt.PortMessageWriter=B_;var ca=class extends yn.ReadableStreamMessageReader{constructor(t,r="utf-8"){super((0, bo.default)().stream.asReadableStream(t),r);}};lt.SocketMessageReader=ca;var la=class extends yn.WriteableStreamMessageWriter{constructor(t,r){super((0, bo.default)().stream.asWritableStream(t),r),this.socket=t;}dispose(){super.dispose(),this.socket.destroy();}};lt.SocketMessageWriter=la;var jd=class extends yn.ReadableStreamMessageReader{constructor(t,r){super((0, bo.default)().stream.asReadableStream(t),r);}};lt.StreamMessageReader=jd;var $d=class extends yn.WriteableStreamMessageWriter{constructor(t,r){super((0, bo.default)().stream.asWritableStream(t),r);}};lt.StreamMessageWriter=$d;var WO=process.env.XDG_RUNTIME_DIR,aX=new Map([["linux",107],["darwin",103]]);function oX(){let e=(0, sX.randomBytes)(21).toString("hex");if(process.platform==="win32")return `\\\\.\\pipe\\vscode-jsonrpc-${e}-sock`;let t;WO?t=HO.join(WO,`vscode-ipc-${e}.sock`):t=HO.join(iX.tmpdir(),`vscode-${e}.sock`);let r=aX.get(process.platform);return r!==void 0&&t.length>r&&(0, bo.default)().console.warn(`WARNING: IPC handle "${t}" is longer than ${r} characters.`),t}lt.generateRandomPipeName=oX;function uX(e,t="utf-8"){let r,n=new Promise((i,s)=>{r=i;});return new Promise((i,s)=>{let a=(0, Vd.createServer)(o=>{a.close(),r([new ca(o,t),new la(o,t)]);});a.on("error",s),a.listen(e,()=>{a.removeListener("error",s),i({onConnected:()=>n});});})}lt.createClientPipeTransport=uX;function cX(e,t="utf-8"){let r=(0, Vd.createConnection)(e);return [new ca(r,t),new la(r,t)]}lt.createServerPipeTransport=cX;function lX(e,t="utf-8"){let r,n=new Promise((i,s)=>{r=i;});return new Promise((i,s)=>{let a=(0, Vd.createServer)(o=>{a.close(),r([new ca(o,t),new la(o,t)]);});a.on("error",s),a.listen(e,"127.0.0.1",()=>{a.removeListener("error",s),i({onConnected:()=>n});});})}lt.createClientSocketTransport=lX;function fX(e,t="utf-8"){let r=(0, Vd.createConnection)(e,"127.0.0.1");return [new ca(r,t),new la(r,t)]}lt.createServerSocketTransport=fX;function dX(e){let t=e;return t.read!==void 0&&t.addListener!==void 0}function hX(e){let t=e;return t.write!==void 0&&t.addListener!==void 0}function pX(e,t,r,n){r||(r=yn.NullLogger);let i=dX(e)?new jd(e):e,s=hX(t)?new $d(t):t;return yn.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0, yn.createMessageConnection)(i,s,r,n)}lt.createMessageConnection=pX;});var F_=P((uue,KO)=>{KO.exports=fa();});var Wd=P((zO,Hd)=>{(function(e){if(typeof Hd=="object"&&typeof Hd.exports=="object"){var t=e(he,zO);t!==void 0&&(Hd.exports=t);}else typeof define=="function"&&define.amd&&define(["require","exports"],e);})(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.TextDocument=t.EOL=t.WorkspaceFolder=t.InlineCompletionContext=t.SelectedCompletionInfo=t.InlineCompletionTriggerKind=t.InlineCompletionList=t.InlineCompletionItem=t.StringValue=t.InlayHint=t.InlayHintLabelPart=t.InlayHintKind=t.InlineValueContext=t.InlineValueEvaluatableExpression=t.InlineValueVariableLookup=t.InlineValueText=t.SemanticTokens=t.SemanticTokenModifiers=t.SemanticTokenTypes=t.SelectionRange=t.DocumentLink=t.FormattingOptions=t.CodeLens=t.CodeAction=t.CodeActionContext=t.CodeActionTriggerKind=t.CodeActionKind=t.DocumentSymbol=t.WorkspaceSymbol=t.SymbolInformation=t.SymbolTag=t.SymbolKind=t.DocumentHighlight=t.DocumentHighlightKind=t.SignatureInformation=t.ParameterInformation=t.Hover=t.MarkedString=t.CompletionList=t.CompletionItem=t.CompletionItemLabelDetails=t.InsertTextMode=t.InsertReplaceEdit=t.CompletionItemTag=t.InsertTextFormat=t.CompletionItemKind=t.MarkupContent=t.MarkupKind=t.TextDocumentItem=t.OptionalVersionedTextDocumentIdentifier=t.VersionedTextDocumentIdentifier=t.TextDocumentIdentifier=t.WorkspaceChange=t.WorkspaceEdit=t.DeleteFile=t.RenameFile=t.CreateFile=t.TextDocumentEdit=t.AnnotatedTextEdit=t.ChangeAnnotationIdentifier=t.ChangeAnnotation=t.TextEdit=t.Command=t.Diagnostic=t.CodeDescription=t.DiagnosticTag=t.DiagnosticSeverity=t.DiagnosticRelatedInformation=t.FoldingRange=t.FoldingRangeKind=t.ColorPresentation=t.ColorInformation=t.Color=t.LocationLink=t.Location=t.Range=t.Position=t.uinteger=t.integer=t.URI=t.DocumentUri=void 0;var r;(function(A){function q(j){return typeof j=="string"}A.is=q;})(r||(t.DocumentUri=r={}));var n;(function(A){function q(j){return typeof j=="string"}A.is=q;})(n||(t.URI=n={}));var i;(function(A){A.MIN_VALUE=-2147483648,A.MAX_VALUE=2147483647;function q(j){return typeof j=="number"&&A.MIN_VALUE<=j&&j<=A.MAX_VALUE}A.is=q;})(i||(t.integer=i={}));var s;(function(A){A.MIN_VALUE=0,A.MAX_VALUE=2147483647;function q(j){return typeof j=="number"&&A.MIN_VALUE<=j&&j<=A.MAX_VALUE}A.is=q;})(s||(t.uinteger=s={}));var a;(function(A){function q(D,S){return D===Number.MAX_VALUE&&(D=s.MAX_VALUE),S===Number.MAX_VALUE&&(S=s.MAX_VALUE),{line:D,character:S}}A.create=q;function j(D){var S=D;return Z.objectLiteral(S)&&Z.uinteger(S.line)&&Z.uinteger(S.character)}A.is=j;})(a||(t.Position=a={}));var o;(function(A){function q(D,S,Y,oe){if(Z.uinteger(D)&&Z.uinteger(S)&&Z.uinteger(Y)&&Z.uinteger(oe))return {start:a.create(D,S),end:a.create(Y,oe)};if(a.is(D)&&a.is(S))return {start:D,end:S};throw new Error("Range#create called with invalid arguments[".concat(D,", ").concat(S,", ").concat(Y,", ").concat(oe,"]"))}A.create=q;function j(D){var S=D;return Z.objectLiteral(S)&&a.is(S.start)&&a.is(S.end)}A.is=j;})(o||(t.Range=o={}));var c;(function(A){function q(D,S){return {uri:D,range:S}}A.create=q;function j(D){var S=D;return Z.objectLiteral(S)&&o.is(S.range)&&(Z.string(S.uri)||Z.undefined(S.uri))}A.is=j;})(c||(t.Location=c={}));var l;(function(A){function q(D,S,Y,oe){return {targetUri:D,targetRange:S,targetSelectionRange:Y,originSelectionRange:oe}}A.create=q;function j(D){var S=D;return Z.objectLiteral(S)&&o.is(S.targetRange)&&Z.string(S.targetUri)&&o.is(S.targetSelectionRange)&&(o.is(S.originSelectionRange)||Z.undefined(S.originSelectionRange))}A.is=j;})(l||(t.LocationLink=l={}));var u;(function(A){function q(D,S,Y,oe){return {red:D,green:S,blue:Y,alpha:oe}}A.create=q;function j(D){var S=D;return Z.objectLiteral(S)&&Z.numberRange(S.red,0,1)&&Z.numberRange(S.green,0,1)&&Z.numberRange(S.blue,0,1)&&Z.numberRange(S.alpha,0,1)}A.is=j;})(u||(t.Color=u={}));var f;(function(A){function q(D,S){return {range:D,color:S}}A.create=q;function j(D){var S=D;return Z.objectLiteral(S)&&o.is(S.range)&&u.is(S.color)}A.is=j;})(f||(t.ColorInformation=f={}));var h;(function(A){function q(D,S,Y){return {label:D,textEdit:S,additionalTextEdits:Y}}A.create=q;function j(D){var S=D;return Z.objectLiteral(S)&&Z.string(S.label)&&(Z.undefined(S.textEdit)||L.is(S))&&(Z.undefined(S.additionalTextEdits)||Z.typedArray(S.additionalTextEdits,L.is))}A.is=j;})(h||(t.ColorPresentation=h={}));var p;(function(A){A.Comment="comment",A.Imports="imports",A.Region="region";})(p||(t.FoldingRangeKind=p={}));var m;(function(A){function q(D,S,Y,oe,Ge,Ht){var Pt={startLine:D,endLine:S};return Z.defined(Y)&&(Pt.startCharacter=Y),Z.defined(oe)&&(Pt.endCharacter=oe),Z.defined(Ge)&&(Pt.kind=Ge),Z.defined(Ht)&&(Pt.collapsedText=Ht),Pt}A.create=q;function j(D){var S=D;return Z.objectLiteral(S)&&Z.uinteger(S.startLine)&&Z.uinteger(S.startLine)&&(Z.undefined(S.startCharacter)||Z.uinteger(S.startCharacter))&&(Z.undefined(S.endCharacter)||Z.uinteger(S.endCharacter))&&(Z.undefined(S.kind)||Z.string(S.kind))}A.is=j;})(m||(t.FoldingRange=m={}));var _;(function(A){function q(D,S){return {location:D,message:S}}A.create=q;function j(D){var S=D;return Z.defined(S)&&c.is(S.location)&&Z.string(S.message)}A.is=j;})(_||(t.DiagnosticRelatedInformation=_={}));var E;(function(A){A.Error=1,A.Warning=2,A.Information=3,A.Hint=4;})(E||(t.DiagnosticSeverity=E={}));var w;(function(A){A.Unnecessary=1,A.Deprecated=2;})(w||(t.DiagnosticTag=w={}));var y;(function(A){function q(j){var D=j;return Z.objectLiteral(D)&&Z.string(D.href)}A.is=q;})(y||(t.CodeDescription=y={}));var b;(function(A){function q(D,S,Y,oe,Ge,Ht){var Pt={range:D,message:S};return Z.defined(Y)&&(Pt.severity=Y),Z.defined(oe)&&(Pt.code=oe),Z.defined(Ge)&&(Pt.source=Ge),Z.defined(Ht)&&(Pt.relatedInformation=Ht),Pt}A.create=q;function j(D){var S,Y=D;return Z.defined(Y)&&o.is(Y.range)&&Z.string(Y.message)&&(Z.number(Y.severity)||Z.undefined(Y.severity))&&(Z.integer(Y.code)||Z.string(Y.code)||Z.undefined(Y.code))&&(Z.undefined(Y.codeDescription)||Z.string((S=Y.codeDescription)===null||S===void 0?void 0:S.href))&&(Z.string(Y.source)||Z.undefined(Y.source))&&(Z.undefined(Y.relatedInformation)||Z.typedArray(Y.relatedInformation,_.is))}A.is=j;})(b||(t.Diagnostic=b={}));var N;(function(A){function q(D,S){for(var Y=[],oe=2;oe<arguments.length;oe++)Y[oe-2]=arguments[oe];var Ge={title:D,command:S};return Z.defined(Y)&&Y.length>0&&(Ge.arguments=Y),Ge}A.create=q;function j(D){var S=D;return Z.defined(S)&&Z.string(S.title)&&Z.string(S.command)}A.is=j;})(N||(t.Command=N={}));var L;(function(A){function q(Y,oe){return {range:Y,newText:oe}}A.replace=q;function j(Y,oe){return {range:{start:Y,end:Y},newText:oe}}A.insert=j;function D(Y){return {range:Y,newText:""}}A.del=D;function S(Y){var oe=Y;return Z.objectLiteral(oe)&&Z.string(oe.newText)&&o.is(oe.range)}A.is=S;})(L||(t.TextEdit=L={}));var V;(function(A){function q(D,S,Y){var oe={label:D};return S!==void 0&&(oe.needsConfirmation=S),Y!==void 0&&(oe.description=Y),oe}A.create=q;function j(D){var S=D;return Z.objectLiteral(S)&&Z.string(S.label)&&(Z.boolean(S.needsConfirmation)||S.needsConfirmation===void 0)&&(Z.string(S.description)||S.description===void 0)}A.is=j;})(V||(t.ChangeAnnotation=V={}));var X;(function(A){function q(j){var D=j;return Z.string(D)}A.is=q;})(X||(t.ChangeAnnotationIdentifier=X={}));var z;(function(A){function q(Y,oe,Ge){return {range:Y,newText:oe,annotationId:Ge}}A.replace=q;function j(Y,oe,Ge){return {range:{start:Y,end:Y},newText:oe,annotationId:Ge}}A.insert=j;function D(Y,oe){return {range:Y,newText:"",annotationId:oe}}A.del=D;function S(Y){var oe=Y;return L.is(oe)&&(V.is(oe.annotationId)||X.is(oe.annotationId))}A.is=S;})(z||(t.AnnotatedTextEdit=z={}));var G;(function(A){function q(D,S){return {textDocument:D,edits:S}}A.create=q;function j(D){var S=D;return Z.defined(S)&&Fe.is(S.textDocument)&&Array.isArray(S.edits)}A.is=j;})(G||(t.TextDocumentEdit=G={}));var ee;(function(A){function q(D,S,Y){var oe={kind:"create",uri:D};return S!==void 0&&(S.overwrite!==void 0||S.ignoreIfExists!==void 0)&&(oe.options=S),Y!==void 0&&(oe.annotationId=Y),oe}A.create=q;function j(D){var S=D;return S&&S.kind==="create"&&Z.string(S.uri)&&(S.options===void 0||(S.options.overwrite===void 0||Z.boolean(S.options.overwrite))&&(S.options.ignoreIfExists===void 0||Z.boolean(S.options.ignoreIfExists)))&&(S.annotationId===void 0||X.is(S.annotationId))}A.is=j;})(ee||(t.CreateFile=ee={}));var U;(function(A){function q(D,S,Y,oe){var Ge={kind:"rename",oldUri:D,newUri:S};return Y!==void 0&&(Y.overwrite!==void 0||Y.ignoreIfExists!==void 0)&&(Ge.options=Y),oe!==void 0&&(Ge.annotationId=oe),Ge}A.create=q;function j(D){var S=D;return S&&S.kind==="rename"&&Z.string(S.oldUri)&&Z.string(S.newUri)&&(S.options===void 0||(S.options.overwrite===void 0||Z.boolean(S.options.overwrite))&&(S.options.ignoreIfExists===void 0||Z.boolean(S.options.ignoreIfExists)))&&(S.annotationId===void 0||X.is(S.annotationId))}A.is=j;})(U||(t.RenameFile=U={}));var ie;(function(A){function q(D,S,Y){var oe={kind:"delete",uri:D};return S!==void 0&&(S.recursive!==void 0||S.ignoreIfNotExists!==void 0)&&(oe.options=S),Y!==void 0&&(oe.annotationId=Y),oe}A.create=q;function j(D){var S=D;return S&&S.kind==="delete"&&Z.string(S.uri)&&(S.options===void 0||(S.options.recursive===void 0||Z.boolean(S.options.recursive))&&(S.options.ignoreIfNotExists===void 0||Z.boolean(S.options.ignoreIfNotExists)))&&(S.annotationId===void 0||X.is(S.annotationId))}A.is=j;})(ie||(t.DeleteFile=ie={}));var me;(function(A){function q(j){var D=j;return D&&(D.changes!==void 0||D.documentChanges!==void 0)&&(D.documentChanges===void 0||D.documentChanges.every(function(S){return Z.string(S.kind)?ee.is(S)||U.is(S)||ie.is(S):G.is(S)}))}A.is=q;})(me||(t.WorkspaceEdit=me={}));var Pe=function(){function A(q,j){this.edits=q,this.changeAnnotations=j;}return A.prototype.insert=function(q,j,D){var S,Y;if(D===void 0?S=L.insert(q,j):X.is(D)?(Y=D,S=z.insert(q,j,D)):(this.assertChangeAnnotations(this.changeAnnotations),Y=this.changeAnnotations.manage(D),S=z.insert(q,j,Y)),this.edits.push(S),Y!==void 0)return Y},A.prototype.replace=function(q,j,D){var S,Y;if(D===void 0?S=L.replace(q,j):X.is(D)?(Y=D,S=z.replace(q,j,D)):(this.assertChangeAnnotations(this.changeAnnotations),Y=this.changeAnnotations.manage(D),S=z.replace(q,j,Y)),this.edits.push(S),Y!==void 0)return Y},A.prototype.delete=function(q,j){var D,S;if(j===void 0?D=L.del(q):X.is(j)?(S=j,D=z.del(q,j)):(this.assertChangeAnnotations(this.changeAnnotations),S=this.changeAnnotations.manage(j),D=z.del(q,S)),this.edits.push(D),S!==void 0)return S},A.prototype.add=function(q){this.edits.push(q);},A.prototype.all=function(){return this.edits},A.prototype.clear=function(){this.edits.splice(0,this.edits.length);},A.prototype.assertChangeAnnotations=function(q){if(q===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},A}(),W=function(){function A(q){this._annotations=q===void 0?Object.create(null):q,this._counter=0,this._size=0;}return A.prototype.all=function(){return this._annotations},Object.defineProperty(A.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),A.prototype.manage=function(q,j){var D;if(X.is(q)?D=q:(D=this.nextId(),j=q),this._annotations[D]!==void 0)throw new Error("Id ".concat(D," is already in use."));if(j===void 0)throw new Error("No annotation provided for id ".concat(D));return this._annotations[D]=j,this._size++,D},A.prototype.nextId=function(){return this._counter++,this._counter.toString()},A}(),K=function(){function A(q){var j=this;this._textEditChanges=Object.create(null),q!==void 0?(this._workspaceEdit=q,q.documentChanges?(this._changeAnnotations=new W(q.changeAnnotations),q.changeAnnotations=this._changeAnnotations.all(),q.documentChanges.forEach(function(D){if(G.is(D)){var S=new Pe(D.edits,j._changeAnnotations);j._textEditChanges[D.textDocument.uri]=S;}})):q.changes&&Object.keys(q.changes).forEach(function(D){var S=new Pe(q.changes[D]);j._textEditChanges[D]=S;})):this._workspaceEdit={};}return Object.defineProperty(A.prototype,"edit",{get: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},enumerable:!1,configurable:!0}),A.prototype.getTextEditChange=function(q){if(Fe.is(q)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var j={uri:q.uri,version:q.version},D=this._textEditChanges[j.uri];if(!D){var S=[],Y={textDocument:j,edits:S};this._workspaceEdit.documentChanges.push(Y),D=new Pe(S,this._changeAnnotations),this._textEditChanges[j.uri]=D;}return D}else {if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var D=this._textEditChanges[q];if(!D){var S=[];this._workspaceEdit.changes[q]=S,D=new Pe(S),this._textEditChanges[q]=D;}return D}},A.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new W,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all());},A.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null));},A.prototype.createFile=function(q,j,D){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var S;V.is(j)||X.is(j)?S=j:D=j;var Y,oe;if(S===void 0?Y=ee.create(q,D):(oe=X.is(S)?S:this._changeAnnotations.manage(S),Y=ee.create(q,D,oe)),this._workspaceEdit.documentChanges.push(Y),oe!==void 0)return oe},A.prototype.renameFile=function(q,j,D,S){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var Y;V.is(D)||X.is(D)?Y=D:S=D;var oe,Ge;if(Y===void 0?oe=U.create(q,j,S):(Ge=X.is(Y)?Y:this._changeAnnotations.manage(Y),oe=U.create(q,j,S,Ge)),this._workspaceEdit.documentChanges.push(oe),Ge!==void 0)return Ge},A.prototype.deleteFile=function(q,j,D){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var S;V.is(j)||X.is(j)?S=j:D=j;var Y,oe;if(S===void 0?Y=ie.create(q,D):(oe=X.is(S)?S:this._changeAnnotations.manage(S),Y=ie.create(q,D,oe)),this._workspaceEdit.documentChanges.push(Y),oe!==void 0)return oe},A}();t.WorkspaceChange=K;var se;(function(A){function q(D){return {uri:D}}A.create=q;function j(D){var S=D;return Z.defined(S)&&Z.string(S.uri)}A.is=j;})(se||(t.TextDocumentIdentifier=se={}));var Ae;(function(A){function q(D,S){return {uri:D,version:S}}A.create=q;function j(D){var S=D;return Z.defined(S)&&Z.string(S.uri)&&Z.integer(S.version)}A.is=j;})(Ae||(t.VersionedTextDocumentIdentifier=Ae={}));var Fe;(function(A){function q(D,S){return {uri:D,version:S}}A.create=q;function j(D){var S=D;return Z.defined(S)&&Z.string(S.uri)&&(S.version===null||Z.integer(S.version))}A.is=j;})(Fe||(t.OptionalVersionedTextDocumentIdentifier=Fe={}));var Ke;(function(A){function q(D,S,Y,oe){return {uri:D,languageId:S,version:Y,text:oe}}A.create=q;function j(D){var S=D;return Z.defined(S)&&Z.string(S.uri)&&Z.string(S.languageId)&&Z.integer(S.version)&&Z.string(S.text)}A.is=j;})(Ke||(t.TextDocumentItem=Ke={}));var Ve;(function(A){A.PlainText="plaintext",A.Markdown="markdown";function q(j){var D=j;return D===A.PlainText||D===A.Markdown}A.is=q;})(Ve||(t.MarkupKind=Ve={}));var ot;(function(A){function q(j){var D=j;return Z.objectLiteral(j)&&Ve.is(D.kind)&&Z.string(D.value)}A.is=q;})(ot||(t.MarkupContent=ot={}));var Dt;(function(A){A.Text=1,A.Method=2,A.Function=3,A.Constructor=4,A.Field=5,A.Variable=6,A.Class=7,A.Interface=8,A.Module=9,A.Property=10,A.Unit=11,A.Value=12,A.Enum=13,A.Keyword=14,A.Snippet=15,A.Color=16,A.File=17,A.Reference=18,A.Folder=19,A.EnumMember=20,A.Constant=21,A.Struct=22,A.Event=23,A.Operator=24,A.TypeParameter=25;})(Dt||(t.CompletionItemKind=Dt={}));var bt;(function(A){A.PlainText=1,A.Snippet=2;})(bt||(t.InsertTextFormat=bt={}));var ft;(function(A){A.Deprecated=1;})(ft||(t.CompletionItemTag=ft={}));var Oe;(function(A){function q(D,S,Y){return {newText:D,insert:S,replace:Y}}A.create=q;function j(D){var S=D;return S&&Z.string(S.newText)&&o.is(S.insert)&&o.is(S.replace)}A.is=j;})(Oe||(t.InsertReplaceEdit=Oe={}));var Rt;(function(A){A.asIs=1,A.adjustIndentation=2;})(Rt||(t.InsertTextMode=Rt={}));var qt;(function(A){function q(j){var D=j;return D&&(Z.string(D.detail)||D.detail===void 0)&&(Z.string(D.description)||D.description===void 0)}A.is=q;})(qt||(t.CompletionItemLabelDetails=qt={}));var ye;(function(A){function q(j){return {label:j}}A.create=q;})(ye||(t.CompletionItem=ye={}));var je;(function(A){function q(j,D){return {items:j||[],isIncomplete:!!D}}A.create=q;})(je||(t.CompletionList=je={}));var le;(function(A){function q(D){return D.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}A.fromPlainText=q;function j(D){var S=D;return Z.string(S)||Z.objectLiteral(S)&&Z.string(S.language)&&Z.string(S.value)}A.is=j;})(le||(t.MarkedString=le={}));var Ie;(function(A){function q(j){var D=j;return !!D&&Z.objectLiteral(D)&&(ot.is(D.contents)||le.is(D.contents)||Z.typedArray(D.contents,le.is))&&(j.range===void 0||o.is(j.range))}A.is=q;})(Ie||(t.Hover=Ie={}));var He;(function(A){function q(j,D){return D?{label:j,documentation:D}:{label:j}}A.create=q;})(He||(t.ParameterInformation=He={}));var et;(function(A){function q(j,D){for(var S=[],Y=2;Y<arguments.length;Y++)S[Y-2]=arguments[Y];var oe={label:j};return Z.defined(D)&&(oe.documentation=D),Z.defined(S)?oe.parameters=S:oe.parameters=[],oe}A.create=q;})(et||(t.SignatureInformation=et={}));var ze;(function(A){A.Text=1,A.Read=2,A.Write=3;})(ze||(t.DocumentHighlightKind=ze={}));var vn;(function(A){function q(j,D){var S={range:j};return Z.number(D)&&(S.kind=D),S}A.create=q;})(vn||(t.DocumentHighlight=vn={}));var Or;(function(A){A.File=1,A.Module=2,A.Namespace=3,A.Package=4,A.Class=5,A.Method=6,A.Property=7,A.Field=8,A.Constructor=9,A.Enum=10,A.Interface=11,A.Function=12,A.Variable=13,A.Constant=14,A.String=15,A.Number=16,A.Boolean=17,A.Array=18,A.Object=19,A.Key=20,A.Null=21,A.EnumMember=22,A.Struct=23,A.Event=24,A.Operator=25,A.TypeParameter=26;})(Or||(t.SymbolKind=Or={}));var As;(function(A){A.Deprecated=1;})(As||(t.SymbolTag=As={}));var Lr;(function(A){function q(j,D,S,Y,oe){var Ge={name:j,kind:D,location:{uri:Y,range:S}};return oe&&(Ge.containerName=oe),Ge}A.create=q;})(Lr||(t.SymbolInformation=Lr={}));var Kr;(function(A){function q(j,D,S,Y){return Y!==void 0?{name:j,kind:D,location:{uri:S,range:Y}}:{name:j,kind:D,location:{uri:S}}}A.create=q;})(Kr||(t.WorkspaceSymbol=Kr={}));var Rs;(function(A){function q(D,S,Y,oe,Ge,Ht){var Pt={name:D,detail:S,kind:Y,range:oe,selectionRange:Ge};return Ht!==void 0&&(Pt.children=Ht),Pt}A.create=q;function j(D){var S=D;return S&&Z.string(S.name)&&Z.number(S.kind)&&o.is(S.range)&&o.is(S.selectionRange)&&(S.detail===void 0||Z.string(S.detail))&&(S.deprecated===void 0||Z.boolean(S.deprecated))&&(S.children===void 0||Array.isArray(S.children))&&(S.tags===void 0||Array.isArray(S.tags))}A.is=j;})(Rs||(t.DocumentSymbol=Rs={}));var ma;(function(A){A.Empty="",A.QuickFix="quickfix",A.Refactor="refactor",A.RefactorExtract="refactor.extract",A.RefactorInline="refactor.inline",A.RefactorRewrite="refactor.rewrite",A.Source="source",A.SourceOrganizeImports="source.organizeImports",A.SourceFixAll="source.fixAll";})(ma||(t.CodeActionKind=ma={}));var an;(function(A){A.Invoked=1,A.Automatic=2;})(an||(t.CodeActionTriggerKind=an={}));var Is;(function(A){function q(D,S,Y){var oe={diagnostics:D};return S!=null&&(oe.only=S),Y!=null&&(oe.triggerKind=Y),oe}A.create=q;function j(D){var S=D;return Z.defined(S)&&Z.typedArray(S.diagnostics,b.is)&&(S.only===void 0||Z.typedArray(S.only,Z.string))&&(S.triggerKind===void 0||S.triggerKind===an.Invoked||S.triggerKind===an.Automatic)}A.is=j;})(Is||(t.CodeActionContext=Is={}));var Ps;(function(A){function q(D,S,Y){var oe={title:D},Ge=!0;return typeof S=="string"?(Ge=!1,oe.kind=S):N.is(S)?oe.command=S:oe.edit=S,Ge&&Y!==void 0&&(oe.kind=Y),oe}A.create=q;function j(D){var S=D;return S&&Z.string(S.title)&&(S.diagnostics===void 0||Z.typedArray(S.diagnostics,b.is))&&(S.kind===void 0||Z.string(S.kind))&&(S.edit!==void 0||S.command!==void 0)&&(S.command===void 0||N.is(S.command))&&(S.isPreferred===void 0||Z.boolean(S.isPreferred))&&(S.edit===void 0||me.is(S.edit))}A.is=j;})(Ps||(t.CodeAction=Ps={}));var Si;(function(A){function q(D,S){var Y={range:D};return Z.defined(S)&&(Y.data=S),Y}A.create=q;function j(D){var S=D;return Z.defined(S)&&o.is(S.range)&&(Z.undefined(S.command)||N.is(S.command))}A.is=j;})(Si||(t.CodeLens=Si={}));var Ns;(function(A){function q(D,S){return {tabSize:D,insertSpaces:S}}A.create=q;function j(D){var S=D;return Z.defined(S)&&Z.uinteger(S.tabSize)&&Z.boolean(S.insertSpaces)}A.is=j;})(Ns||(t.FormattingOptions=Ns={}));var Fn;(function(A){function q(D,S,Y){return {range:D,target:S,data:Y}}A.create=q;function j(D){var S=D;return Z.defined(S)&&o.is(S.range)&&(Z.undefined(S.target)||Z.string(S.target))}A.is=j;})(Fn||(t.DocumentLink=Fn={}));var M;(function(A){function q(D,S){return {range:D,parent:S}}A.create=q;function j(D){var S=D;return Z.objectLiteral(S)&&o.is(S.range)&&(S.parent===void 0||A.is(S.parent))}A.is=j;})(M||(t.SelectionRange=M={}));var ae;(function(A){A.namespace="namespace",A.type="type",A.class="class",A.enum="enum",A.interface="interface",A.struct="struct",A.typeParameter="typeParameter",A.parameter="parameter",A.variable="variable",A.property="property",A.enumMember="enumMember",A.event="event",A.function="function",A.method="method",A.macro="macro",A.keyword="keyword",A.modifier="modifier",A.comment="comment",A.string="string",A.number="number",A.regexp="regexp",A.operator="operator",A.decorator="decorator";})(ae||(t.SemanticTokenTypes=ae={}));var Se;(function(A){A.declaration="declaration",A.definition="definition",A.readonly="readonly",A.static="static",A.deprecated="deprecated",A.abstract="abstract",A.async="async",A.modification="modification",A.documentation="documentation",A.defaultLibrary="defaultLibrary";})(Se||(t.SemanticTokenModifiers=Se={}));var Ne;(function(A){function q(j){var D=j;return Z.objectLiteral(D)&&(D.resultId===void 0||typeof D.resultId=="string")&&Array.isArray(D.data)&&(D.data.length===0||typeof D.data[0]=="number")}A.is=q;})(Ne||(t.SemanticTokens=Ne={}));var St;(function(A){function q(D,S){return {range:D,text:S}}A.create=q;function j(D){var S=D;return S!=null&&o.is(S.range)&&Z.string(S.text)}A.is=j;})(St||(t.InlineValueText=St={}));var gt;(function(A){function q(D,S,Y){return {range:D,variableName:S,caseSensitiveLookup:Y}}A.create=q;function j(D){var S=D;return S!=null&&o.is(S.range)&&Z.boolean(S.caseSensitiveLookup)&&(Z.string(S.variableName)||S.variableName===void 0)}A.is=j;})(gt||(t.InlineValueVariableLookup=gt={}));var It;(function(A){function q(D,S){return {range:D,expression:S}}A.create=q;function j(D){var S=D;return S!=null&&o.is(S.range)&&(Z.string(S.expression)||S.expression===void 0)}A.is=j;})(It||(t.InlineValueEvaluatableExpression=It={}));var Ot;(function(A){function q(D,S){return {frameId:D,stoppedLocation:S}}A.create=q;function j(D){var S=D;return Z.defined(S)&&o.is(D.stoppedLocation)}A.is=j;})(Ot||(t.InlineValueContext=Ot={}));var tt;(function(A){A.Type=1,A.Parameter=2;function q(j){return j===1||j===2}A.is=q;})(tt||(t.InlayHintKind=tt={}));var xt;(function(A){function q(D){return {value:D}}A.create=q;function j(D){var S=D;return Z.objectLiteral(S)&&(S.tooltip===void 0||Z.string(S.tooltip)||ot.is(S.tooltip))&&(S.location===void 0||c.is(S.location))&&(S.command===void 0||N.is(S.command))}A.is=j;})(xt||(t.InlayHintLabelPart=xt={}));var dt;(function(A){function q(D,S,Y){var oe={position:D,label:S};return Y!==void 0&&(oe.kind=Y),oe}A.create=q;function j(D){var S=D;return Z.objectLiteral(S)&&a.is(S.position)&&(Z.string(S.label)||Z.typedArray(S.label,xt.is))&&(S.kind===void 0||tt.is(S.kind))&&S.textEdits===void 0||Z.typedArray(S.textEdits,L.is)&&(S.tooltip===void 0||Z.string(S.tooltip)||ot.is(S.tooltip))&&(S.paddingLeft===void 0||Z.boolean(S.paddingLeft))&&(S.paddingRight===void 0||Z.boolean(S.paddingRight))}A.is=j;})(dt||(t.InlayHint=dt={}));var Vt;(function(A){function q(j){return {kind:"snippet",value:j}}A.createSnippet=q;})(Vt||(t.StringValue=Vt={}));var Xt;(function(A){function q(j,D,S,Y){return {insertText:j,filterText:D,range:S,command:Y}}A.create=q;})(Xt||(t.InlineCompletionItem=Xt={}));var Br;(function(A){function q(j){return {items:j}}A.create=q;})(Br||(t.InlineCompletionList=Br={}));var ya;(function(A){A.Invoked=0,A.Automatic=1;})(ya||(t.InlineCompletionTriggerKind=ya={}));var Mi;(function(A){function q(j,D){return {range:j,text:D}}A.create=q;})(Mi||(t.SelectedCompletionInfo=Mi={}));var qi;(function(A){function q(j,D){return {triggerKind:j,selectedCompletionInfo:D}}A.create=q;})(qi||(t.InlineCompletionContext=qi={}));var Lo;((function(A){function q(j){var D=j;return Z.objectLiteral(D)&&n.is(D.uri)&&Z.string(D.name)}A.is=q;}))(Lo||(t.WorkspaceFolder=Lo={})),t.EOL=[`
`,`\r
`,"\r"];var Bo;(function(A){function q(Y,oe,Ge,Ht){return new Ec(Y,oe,Ge,Ht)}A.create=q;function j(Y){var oe=Y;return !!(Z.defined(oe)&&Z.string(oe.uri)&&(Z.undefined(oe.languageId)||Z.string(oe.languageId))&&Z.uinteger(oe.lineCount)&&Z.func(oe.getText)&&Z.func(oe.positionAt)&&Z.func(oe.offsetAt))}A.is=j;function D(Y,oe){for(var Ge=Y.getText(),Ht=S(oe,function(Ui,va){var wc=Ui.range.start.line-va.range.start.line;return wc===0?Ui.range.start.character-va.range.start.character:wc}),Pt=Ge.length,on=Ht.length-1;on>=0;on--){var un=Ht[on],Mn=Y.offsetAt(un.range.start),nt=Y.offsetAt(un.range.end);if(nt<=Pt)Ge=Ge.substring(0,Mn)+un.newText+Ge.substring(nt,Ge.length);else throw new Error("Overlapping edit");Pt=Mn;}return Ge}A.applyEdits=D;function S(Y,oe){if(Y.length<=1)return Y;var Ge=Y.length/2|0,Ht=Y.slice(0,Ge),Pt=Y.slice(Ge);S(Ht,oe),S(Pt,oe);for(var on=0,un=0,Mn=0;on<Ht.length&&un<Pt.length;){var nt=oe(Ht[on],Pt[un]);nt<=0?Y[Mn++]=Ht[on++]:Y[Mn++]=Pt[un++];}for(;on<Ht.length;)Y[Mn++]=Ht[on++];for(;un<Pt.length;)Y[Mn++]=Pt[un++];return Y}})(Bo||(t.TextDocument=Bo={}));var Ec=function(){function A(q,j,D,S){this._uri=q,this._languageId=j,this._version=D,this._content=S,this._lineOffsets=void 0;}return Object.defineProperty(A.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),A.prototype.getText=function(q){if(q){var j=this.offsetAt(q.start),D=this.offsetAt(q.end);return this._content.substring(j,D)}return this._content},A.prototype.update=function(q,j){this._content=q.text,this._version=j,this._lineOffsets=void 0;},A.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var q=[],j=this._content,D=!0,S=0;S<j.length;S++){D&&(q.push(S),D=!1);var Y=j.charAt(S);D=Y==="\r"||Y===`
`,Y==="\r"&&S+1<j.length&&j.charAt(S+1)===`
`&&S++;}D&&j.length>0&&q.push(j.length),this._lineOffsets=q;}return this._lineOffsets},A.prototype.positionAt=function(q){q=Math.max(Math.min(q,this._content.length),0);var j=this.getLineOffsets(),D=0,S=j.length;if(S===0)return a.create(0,q);for(;D<S;){var Y=Math.floor((D+S)/2);j[Y]>q?S=Y:D=Y+1;}var oe=D-1;return a.create(oe,q-j[oe])},A.prototype.offsetAt=function(q){var j=this.getLineOffsets();if(q.line>=j.length)return this._content.length;if(q.line<0)return 0;var D=j[q.line],S=q.line+1<j.length?j[q.line+1]:this._content.length;return Math.max(Math.min(D+q.character,S),D)},Object.defineProperty(A.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),A}(),Z;(function(A){var q=Object.prototype.toString;function j(nt){return typeof nt<"u"}A.defined=j;function D(nt){return typeof nt>"u"}A.undefined=D;function S(nt){return nt===!0||nt===!1}A.boolean=S;function Y(nt){return q.call(nt)==="[object String]"}A.string=Y;function oe(nt){return q.call(nt)==="[object Number]"}A.number=oe;function Ge(nt,Ui,va){return q.call(nt)==="[object Number]"&&Ui<=nt&&nt<=va}A.numberRange=Ge;function Ht(nt){return q.call(nt)==="[object Number]"&&-2147483648<=nt&&nt<=2147483647}A.integer=Ht;function Pt(nt){return q.call(nt)==="[object Number]"&&0<=nt&&nt<=2147483647}A.uinteger=Pt;function on(nt){return q.call(nt)==="[object Function]"}A.func=on;function un(nt){return nt!==null&&typeof nt=="object"}A.objectLiteral=un;function Mn(nt,Ui){return Array.isArray(nt)&&nt.every(Ui)}A.typedArray=Mn;})(Z||(Z={}));});});var Kt=P(tn=>{Object.defineProperty(tn,"__esModule",{value:!0});tn.ProtocolNotificationType=tn.ProtocolNotificationType0=tn.ProtocolRequestType=tn.ProtocolRequestType0=tn.RegistrationType=tn.MessageDirection=void 0;var So=fa(),GO;(function(e){e.clientToServer="clientToServer",e.serverToClient="serverToClient",e.both="both";})(GO||(tn.MessageDirection=GO={}));var M_=class{constructor(t){this.method=t;}};tn.RegistrationType=M_;var q_=class extends So.RequestType0{constructor(t){super(t);}};tn.ProtocolRequestType0=q_;var U_=class extends So.RequestType{constructor(t){super(t,So.ParameterStructures.byName);}};tn.ProtocolRequestType=U_;var j_=class extends So.NotificationType0{constructor(t){super(t);}};tn.ProtocolNotificationType0=j_;var $_=class extends So.NotificationType{constructor(t){super(t,So.ParameterStructures.byName);}};tn.ProtocolNotificationType=$_;});var Kd=P(sr=>{Object.defineProperty(sr,"__esModule",{value:!0});sr.objectLiteral=sr.typedArray=sr.stringArray=sr.array=sr.func=sr.error=sr.number=sr.string=sr.boolean=void 0;function gX(e){return e===!0||e===!1}sr.boolean=gX;function YO(e){return typeof e=="string"||e instanceof String}sr.string=YO;function mX(e){return typeof e=="number"||e instanceof Number}sr.number=mX;function yX(e){return e instanceof Error}sr.error=yX;function vX(e){return typeof e=="function"}sr.func=vX;function QO(e){return Array.isArray(e)}sr.array=QO;function _X(e){return QO(e)&&e.every(t=>YO(t))}sr.stringArray=_X;function bX(e,t){return Array.isArray(e)&&e.every(t)}sr.typedArray=bX;function SX(e){return e!==null&&typeof e=="object"}sr.objectLiteral=SX;});var JO=P(zd=>{Object.defineProperty(zd,"__esModule",{value:!0});zd.ImplementationRequest=void 0;var ZO=Kt(),XO;(function(e){e.method="textDocument/implementation",e.messageDirection=ZO.MessageDirection.clientToServer,e.type=new ZO.ProtocolRequestType(e.method);})(XO||(zd.ImplementationRequest=XO={}));});var rL=P(Gd=>{Object.defineProperty(Gd,"__esModule",{value:!0});Gd.TypeDefinitionRequest=void 0;var eL=Kt(),tL;(function(e){e.method="textDocument/typeDefinition",e.messageDirection=eL.MessageDirection.clientToServer,e.type=new eL.ProtocolRequestType(e.method);})(tL||(Gd.TypeDefinitionRequest=tL={}));});var sL=P(Eo=>{Object.defineProperty(Eo,"__esModule",{value:!0});Eo.DidChangeWorkspaceFoldersNotification=Eo.WorkspaceFoldersRequest=void 0;var Yd=Kt(),nL;(function(e){e.method="workspace/workspaceFolders",e.messageDirection=Yd.MessageDirection.serverToClient,e.type=new Yd.ProtocolRequestType0(e.method);})(nL||(Eo.WorkspaceFoldersRequest=nL={}));var iL;(function(e){e.method="workspace/didChangeWorkspaceFolders",e.messageDirection=Yd.MessageDirection.clientToServer,e.type=new Yd.ProtocolNotificationType(e.method);})(iL||(Eo.DidChangeWorkspaceFoldersNotification=iL={}));});var uL=P(Qd=>{Object.defineProperty(Qd,"__esModule",{value:!0});Qd.ConfigurationRequest=void 0;var aL=Kt(),oL;(function(e){e.method="workspace/configuration",e.messageDirection=aL.MessageDirection.serverToClient,e.type=new aL.ProtocolRequestType(e.method);})(oL||(Qd.ConfigurationRequest=oL={}));});var fL=P(wo=>{Object.defineProperty(wo,"__esModule",{value:!0});wo.ColorPresentationRequest=wo.DocumentColorRequest=void 0;var Zd=Kt(),cL;(function(e){e.method="textDocument/documentColor",e.messageDirection=Zd.MessageDirection.clientToServer,e.type=new Zd.ProtocolRequestType(e.method);})(cL||(wo.DocumentColorRequest=cL={}));var lL;(function(e){e.method="textDocument/colorPresentation",e.messageDirection=Zd.MessageDirection.clientToServer,e.type=new Zd.ProtocolRequestType(e.method);})(lL||(wo.ColorPresentationRequest=lL={}));});var pL=P(Co=>{Object.defineProperty(Co,"__esModule",{value:!0});Co.FoldingRangeRefreshRequest=Co.FoldingRangeRequest=void 0;var Xd=Kt(),dL;(function(e){e.method="textDocument/foldingRange",e.messageDirection=Xd.MessageDirection.clientToServer,e.type=new Xd.ProtocolRequestType(e.method);})(dL||(Co.FoldingRangeRequest=dL={}));var hL;(function(e){e.method="workspace/foldingRange/refresh",e.messageDirection=Xd.MessageDirection.serverToClient,e.type=new Xd.ProtocolRequestType0(e.method);})(hL||(Co.FoldingRangeRefreshRequest=hL={}));});var yL=P(Jd=>{Object.defineProperty(Jd,"__esModule",{value:!0});Jd.DeclarationRequest=void 0;var gL=Kt(),mL;(function(e){e.method="textDocument/declaration",e.messageDirection=gL.MessageDirection.clientToServer,e.type=new gL.ProtocolRequestType(e.method);})(mL||(Jd.DeclarationRequest=mL={}));});var bL=P(eh=>{Object.defineProperty(eh,"__esModule",{value:!0});eh.SelectionRangeRequest=void 0;var vL=Kt(),_L;(function(e){e.method="textDocument/selectionRange",e.messageDirection=vL.MessageDirection.clientToServer,e.type=new vL.ProtocolRequestType(e.method);})(_L||(eh.SelectionRangeRequest=_L={}));});var CL=P(_s=>{Object.defineProperty(_s,"__esModule",{value:!0});_s.WorkDoneProgressCancelNotification=_s.WorkDoneProgressCreateRequest=_s.WorkDoneProgress=void 0;var EX=fa(),th=Kt(),SL;(function(e){e.type=new EX.ProgressType;function t(r){return r===e.type}e.is=t;})(SL||(_s.WorkDoneProgress=SL={}));var EL;(function(e){e.method="window/workDoneProgress/create",e.messageDirection=th.MessageDirection.serverToClient,e.type=new th.ProtocolRequestType(e.method);})(EL||(_s.WorkDoneProgressCreateRequest=EL={}));var wL;(function(e){e.method="window/workDoneProgress/cancel",e.messageDirection=th.MessageDirection.clientToServer,e.type=new th.ProtocolNotificationType(e.method);})(wL||(_s.WorkDoneProgressCancelNotification=wL={}));});var RL=P(bs=>{Object.defineProperty(bs,"__esModule",{value:!0});bs.CallHierarchyOutgoingCallsRequest=bs.CallHierarchyIncomingCallsRequest=bs.CallHierarchyPrepareRequest=void 0;var xo=Kt(),xL;(function(e){e.method="textDocument/prepareCallHierarchy",e.messageDirection=xo.MessageDirection.clientToServer,e.type=new xo.ProtocolRequestType(e.method);})(xL||(bs.CallHierarchyPrepareRequest=xL={}));var TL;(function(e){e.method="callHierarchy/incomingCalls",e.messageDirection=xo.MessageDirection.clientToServer,e.type=new xo.ProtocolRequestType(e.method);})(TL||(bs.CallHierarchyIncomingCallsRequest=TL={}));var AL;(function(e){e.method="callHierarchy/outgoingCalls",e.messageDirection=xo.MessageDirection.clientToServer,e.type=new xo.ProtocolRequestType(e.method);})(AL||(bs.CallHierarchyOutgoingCallsRequest=AL={}));});var OL=P(rn=>{Object.defineProperty(rn,"__esModule",{value:!0});rn.SemanticTokensRefreshRequest=rn.SemanticTokensRangeRequest=rn.SemanticTokensDeltaRequest=rn.SemanticTokensRequest=rn.SemanticTokensRegistrationType=rn.TokenFormat=void 0;var Fi=Kt(),IL;(function(e){e.Relative="relative";})(IL||(rn.TokenFormat=IL={}));var hc;(function(e){e.method="textDocument/semanticTokens",e.type=new Fi.RegistrationType(e.method);})(hc||(rn.SemanticTokensRegistrationType=hc={}));var PL;(function(e){e.method="textDocument/semanticTokens/full",e.messageDirection=Fi.MessageDirection.clientToServer,e.type=new Fi.ProtocolRequestType(e.method),e.registrationMethod=hc.method;})(PL||(rn.SemanticTokensRequest=PL={}));var NL;(function(e){e.method="textDocument/semanticTokens/full/delta",e.messageDirection=Fi.MessageDirection.clientToServer,e.type=new Fi.ProtocolRequestType(e.method),e.registrationMethod=hc.method;})(NL||(rn.SemanticTokensDeltaRequest=NL={}));var DL;(function(e){e.method="textDocument/semanticTokens/range",e.messageDirection=Fi.MessageDirection.clientToServer,e.type=new Fi.ProtocolRequestType(e.method),e.registrationMethod=hc.method;})(DL||(rn.SemanticTokensRangeRequest=DL={}));var kL;(function(e){e.method="workspace/semanticTokens/refresh",e.messageDirection=Fi.MessageDirection.serverToClient,e.type=new Fi.ProtocolRequestType0(e.method);})(kL||(rn.SemanticTokensRefreshRequest=kL={}));});var FL=P(rh=>{Object.defineProperty(rh,"__esModule",{value:!0});rh.ShowDocumentRequest=void 0;var LL=Kt(),BL;(function(e){e.method="window/showDocument",e.messageDirection=LL.MessageDirection.serverToClient,e.type=new LL.ProtocolRequestType(e.method);})(BL||(rh.ShowDocumentRequest=BL={}));});var UL=P(nh=>{Object.defineProperty(nh,"__esModule",{value:!0});nh.LinkedEditingRangeRequest=void 0;var ML=Kt(),qL;(function(e){e.method="textDocument/linkedEditingRange",e.messageDirection=ML.MessageDirection.clientToServer,e.type=new ML.ProtocolRequestType(e.method);})(qL||(nh.LinkedEditingRangeRequest=qL={}));});var GL=P(Dr=>{Object.defineProperty(Dr,"__esModule",{value:!0});Dr.WillDeleteFilesRequest=Dr.DidDeleteFilesNotification=Dr.DidRenameFilesNotification=Dr.WillRenameFilesRequest=Dr.DidCreateFilesNotification=Dr.WillCreateFilesRequest=Dr.FileOperationPatternKind=void 0;var Nn=Kt(),jL;(function(e){e.file="file",e.folder="folder";})(jL||(Dr.FileOperationPatternKind=jL={}));var $L;(function(e){e.method="workspace/willCreateFiles",e.messageDirection=Nn.MessageDirection.clientToServer,e.type=new Nn.ProtocolRequestType(e.method);})($L||(Dr.WillCreateFilesRequest=$L={}));var VL;(function(e){e.method="workspace/didCreateFiles",e.messageDirection=Nn.MessageDirection.clientToServer,e.type=new Nn.ProtocolNotificationType(e.method);})(VL||(Dr.DidCreateFilesNotification=VL={}));var HL;(function(e){e.method="workspace/willRenameFiles",e.messageDirection=Nn.MessageDirection.clientToServer,e.type=new Nn.ProtocolRequestType(e.method);})(HL||(Dr.WillRenameFilesRequest=HL={}));var WL;(function(e){e.method="workspace/didRenameFiles",e.messageDirection=Nn.MessageDirection.clientToServer,e.type=new Nn.ProtocolNotificationType(e.method);})(WL||(Dr.DidRenameFilesNotification=WL={}));var KL;(function(e){e.method="workspace/didDeleteFiles",e.messageDirection=Nn.MessageDirection.clientToServer,e.type=new Nn.ProtocolNotificationType(e.method);})(KL||(Dr.DidDeleteFilesNotification=KL={}));var zL;(function(e){e.method="workspace/willDeleteFiles",e.messageDirection=Nn.MessageDirection.clientToServer,e.type=new Nn.ProtocolRequestType(e.method);})(zL||(Dr.WillDeleteFilesRequest=zL={}));});var JL=P(Ss=>{Object.defineProperty(Ss,"__esModule",{value:!0});Ss.MonikerRequest=Ss.MonikerKind=Ss.UniquenessLevel=void 0;var YL=Kt(),QL;(function(e){e.document="document",e.project="project",e.group="group",e.scheme="scheme",e.global="global";})(QL||(Ss.UniquenessLevel=QL={}));var ZL;(function(e){e.$import="import",e.$export="export",e.local="local";})(ZL||(Ss.MonikerKind=ZL={}));var XL;(function(e){e.method="textDocument/moniker",e.messageDirection=YL.MessageDirection.clientToServer,e.type=new YL.ProtocolRequestType(e.method);})(XL||(Ss.MonikerRequest=XL={}));});var nB=P(Es=>{Object.defineProperty(Es,"__esModule",{value:!0});Es.TypeHierarchySubtypesRequest=Es.TypeHierarchySupertypesRequest=Es.TypeHierarchyPrepareRequest=void 0;var To=Kt(),eB;(function(e){e.method="textDocument/prepareTypeHierarchy",e.messageDirection=To.MessageDirection.clientToServer,e.type=new To.ProtocolRequestType(e.method);})(eB||(Es.TypeHierarchyPrepareRequest=eB={}));var tB;(function(e){e.method="typeHierarchy/supertypes",e.messageDirection=To.MessageDirection.clientToServer,e.type=new To.ProtocolRequestType(e.method);})(tB||(Es.TypeHierarchySupertypesRequest=tB={}));var rB;(function(e){e.method="typeHierarchy/subtypes",e.messageDirection=To.MessageDirection.clientToServer,e.type=new To.ProtocolRequestType(e.method);})(rB||(Es.TypeHierarchySubtypesRequest=rB={}));});var aB=P(Ao=>{Object.defineProperty(Ao,"__esModule",{value:!0});Ao.InlineValueRefreshRequest=Ao.InlineValueRequest=void 0;var ih=Kt(),iB;(function(e){e.method="textDocument/inlineValue",e.messageDirection=ih.MessageDirection.clientToServer,e.type=new ih.ProtocolRequestType(e.method);})(iB||(Ao.InlineValueRequest=iB={}));var sB;(function(e){e.method="workspace/inlineValue/refresh",e.messageDirection=ih.MessageDirection.serverToClient,e.type=new ih.ProtocolRequestType0(e.method);})(sB||(Ao.InlineValueRefreshRequest=sB={}));});var lB=P(ws=>{Object.defineProperty(ws,"__esModule",{value:!0});ws.InlayHintRefreshRequest=ws.InlayHintResolveRequest=ws.InlayHintRequest=void 0;var Ro=Kt(),oB;(function(e){e.method="textDocument/inlayHint",e.messageDirection=Ro.MessageDirection.clientToServer,e.type=new Ro.ProtocolRequestType(e.method);})(oB||(ws.InlayHintRequest=oB={}));var uB;(function(e){e.method="inlayHint/resolve",e.messageDirection=Ro.MessageDirection.clientToServer,e.type=new Ro.ProtocolRequestType(e.method);})(uB||(ws.InlayHintResolveRequest=uB={}));var cB;(function(e){e.method="workspace/inlayHint/refresh",e.messageDirection=Ro.MessageDirection.serverToClient,e.type=new Ro.ProtocolRequestType0(e.method);})(cB||(ws.InlayHintRefreshRequest=cB={}));});var yB=P(Dn=>{Object.defineProperty(Dn,"__esModule",{value:!0});Dn.DiagnosticRefreshRequest=Dn.WorkspaceDiagnosticRequest=Dn.DocumentDiagnosticRequest=Dn.DocumentDiagnosticReportKind=Dn.DiagnosticServerCancellationData=void 0;var mB=fa(),wX=Kd(),Io=Kt(),fB;(function(e){function t(r){let n=r;return n&&wX.boolean(n.retriggerRequest)}e.is=t;})(fB||(Dn.DiagnosticServerCancellationData=fB={}));var dB;(function(e){e.Full="full",e.Unchanged="unchanged";})(dB||(Dn.DocumentDiagnosticReportKind=dB={}));var hB;(function(e){e.method="textDocument/diagnostic",e.messageDirection=Io.MessageDirection.clientToServer,e.type=new Io.ProtocolRequestType(e.method),e.partialResult=new mB.ProgressType;})(hB||(Dn.DocumentDiagnosticRequest=hB={}));var pB;(function(e){e.method="workspace/diagnostic",e.messageDirection=Io.MessageDirection.clientToServer,e.type=new Io.ProtocolRequestType(e.method),e.partialResult=new mB.ProgressType;})(pB||(Dn.WorkspaceDiagnosticRequest=pB={}));var gB;(function(e){e.method="workspace/diagnostic/refresh",e.messageDirection=Io.MessageDirection.serverToClient,e.type=new Io.ProtocolRequestType0(e.method);})(gB||(Dn.DiagnosticRefreshRequest=gB={}));});var CB=P(Zt=>{Object.defineProperty(Zt,"__esModule",{value:!0});Zt.DidCloseNotebookDocumentNotification=Zt.DidSaveNotebookDocumentNotification=Zt.DidChangeNotebookDocumentNotification=Zt.NotebookCellArrayChange=Zt.DidOpenNotebookDocumentNotification=Zt.NotebookDocumentSyncRegistrationType=Zt.NotebookDocument=Zt.NotebookCell=Zt.ExecutionSummary=Zt.NotebookCellKind=void 0;var pc=Wd(),Qn=Kd(),yi=Kt(),V_;(function(e){e.Markup=1,e.Code=2;function t(r){return r===1||r===2}e.is=t;})(V_||(Zt.NotebookCellKind=V_={}));var H_;(function(e){function t(i,s){let a={executionOrder:i};return (s===!0||s===!1)&&(a.success=s),a}e.create=t;function r(i){let s=i;return Qn.objectLiteral(s)&&pc.uinteger.is(s.executionOrder)&&(s.success===void 0||Qn.boolean(s.success))}e.is=r;function n(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}e.equals=n;})(H_||(Zt.ExecutionSummary=H_={}));var sh;(function(e){function t(s,a){return {kind:s,document:a}}e.create=t;function r(s){let a=s;return Qn.objectLiteral(a)&&V_.is(a.kind)&&pc.DocumentUri.is(a.document)&&(a.metadata===void 0||Qn.objectLiteral(a.metadata))}e.is=r;function n(s,a){let o=new Set;return s.document!==a.document&&o.add("document"),s.kind!==a.kind&&o.add("kind"),s.executionSummary!==a.executionSummary&&o.add("executionSummary"),(s.metadata!==void 0||a.metadata!==void 0)&&!i(s.metadata,a.metadata)&&o.add("metadata"),(s.executionSummary!==void 0||a.executionSummary!==void 0)&&!H_.equals(s.executionSummary,a.executionSummary)&&o.add("executionSummary"),o}e.diff=n;function i(s,a){if(s===a)return !0;if(s==null||a===null||a===void 0||typeof s!=typeof a||typeof s!="object")return !1;let o=Array.isArray(s),c=Array.isArray(a);if(o!==c)return !1;if(o&&c){if(s.length!==a.length)return !1;for(let l=0;l<s.length;l++)if(!i(s[l],a[l]))return !1}if(Qn.objectLiteral(s)&&Qn.objectLiteral(a)){let l=Object.keys(s),u=Object.keys(a);if(l.length!==u.length||(l.sort(),u.sort(),!i(l,u)))return !1;for(let f=0;f<l.length;f++){let h=l[f];if(!i(s[h],a[h]))return !1}}return !0}})(sh||(Zt.NotebookCell=sh={}));var vB;(function(e){function t(n,i,s,a){return {uri:n,notebookType:i,version:s,cells:a}}e.create=t;function r(n){let i=n;return Qn.objectLiteral(i)&&Qn.string(i.uri)&&pc.integer.is(i.version)&&Qn.typedArray(i.cells,sh.is)}e.is=r;})(vB||(Zt.NotebookDocument=vB={}));var Po;(function(e){e.method="notebookDocument/sync",e.messageDirection=yi.MessageDirection.clientToServer,e.type=new yi.RegistrationType(e.method);})(Po||(Zt.NotebookDocumentSyncRegistrationType=Po={}));var _B;(function(e){e.method="notebookDocument/didOpen",e.messageDirection=yi.MessageDirection.clientToServer,e.type=new yi.ProtocolNotificationType(e.method),e.registrationMethod=Po.method;})(_B||(Zt.DidOpenNotebookDocumentNotification=_B={}));var bB;(function(e){function t(n){let i=n;return Qn.objectLiteral(i)&&pc.uinteger.is(i.start)&&pc.uinteger.is(i.deleteCount)&&(i.cells===void 0||Qn.typedArray(i.cells,sh.is))}e.is=t;function r(n,i,s){let a={start:n,deleteCount:i};return s!==void 0&&(a.cells=s),a}e.create=r;})(bB||(Zt.NotebookCellArrayChange=bB={}));var SB;(function(e){e.method="notebookDocument/didChange",e.messageDirection=yi.MessageDirection.clientToServer,e.type=new yi.ProtocolNotificationType(e.method),e.registrationMethod=Po.method;})(SB||(Zt.DidChangeNotebookDocumentNotification=SB={}));var EB;(function(e){e.method="notebookDocument/didSave",e.messageDirection=yi.MessageDirection.clientToServer,e.type=new yi.ProtocolNotificationType(e.method),e.registrationMethod=Po.method;})(EB||(Zt.DidSaveNotebookDocumentNotification=EB={}));var wB;(function(e){e.method="notebookDocument/didClose",e.messageDirection=yi.MessageDirection.clientToServer,e.type=new yi.ProtocolNotificationType(e.method),e.registrationMethod=Po.method;})(wB||(Zt.DidCloseNotebookDocumentNotification=wB={}));});var AB=P(ah=>{Object.defineProperty(ah,"__esModule",{value:!0});ah.InlineCompletionRequest=void 0;var xB=Kt(),TB;(function(e){e.method="textDocument/inlineCompletion",e.messageDirection=xB.MessageDirection.clientToServer,e.type=new xB.ProtocolRequestType(e.method);})(TB||(ah.InlineCompletionRequest=TB={}));});var UF=P(O=>{Object.defineProperty(O,"__esModule",{value:!0});O.WorkspaceSymbolRequest=O.CodeActionResolveRequest=O.CodeActionRequest=O.DocumentSymbolRequest=O.DocumentHighlightRequest=O.ReferencesRequest=O.DefinitionRequest=O.SignatureHelpRequest=O.SignatureHelpTriggerKind=O.HoverRequest=O.CompletionResolveRequest=O.CompletionRequest=O.CompletionTriggerKind=O.PublishDiagnosticsNotification=O.WatchKind=O.RelativePattern=O.FileChangeType=O.DidChangeWatchedFilesNotification=O.WillSaveTextDocumentWaitUntilRequest=O.WillSaveTextDocumentNotification=O.TextDocumentSaveReason=O.DidSaveTextDocumentNotification=O.DidCloseTextDocumentNotification=O.DidChangeTextDocumentNotification=O.TextDocumentContentChangeEvent=O.DidOpenTextDocumentNotification=O.TextDocumentSyncKind=O.TelemetryEventNotification=O.LogMessageNotification=O.ShowMessageRequest=O.ShowMessageNotification=O.MessageType=O.DidChangeConfigurationNotification=O.ExitNotification=O.ShutdownRequest=O.InitializedNotification=O.InitializeErrorCodes=O.InitializeRequest=O.WorkDoneProgressOptions=O.TextDocumentRegistrationOptions=O.StaticRegistrationOptions=O.PositionEncodingKind=O.FailureHandlingKind=O.ResourceOperationKind=O.UnregistrationRequest=O.RegistrationRequest=O.DocumentSelector=O.NotebookCellTextDocumentFilter=O.NotebookDocumentFilter=O.TextDocumentFilter=void 0;O.MonikerRequest=O.MonikerKind=O.UniquenessLevel=O.WillDeleteFilesRequest=O.DidDeleteFilesNotification=O.WillRenameFilesRequest=O.DidRenameFilesNotification=O.WillCreateFilesRequest=O.DidCreateFilesNotification=O.FileOperationPatternKind=O.LinkedEditingRangeRequest=O.ShowDocumentRequest=O.SemanticTokensRegistrationType=O.SemanticTokensRefreshRequest=O.SemanticTokensRangeRequest=O.SemanticTokensDeltaRequest=O.SemanticTokensRequest=O.TokenFormat=O.CallHierarchyPrepareRequest=O.CallHierarchyOutgoingCallsRequest=O.CallHierarchyIncomingCallsRequest=O.WorkDoneProgressCancelNotification=O.WorkDoneProgressCreateRequest=O.WorkDoneProgress=O.SelectionRangeRequest=O.DeclarationRequest=O.FoldingRangeRefreshRequest=O.FoldingRangeRequest=O.ColorPresentationRequest=O.DocumentColorRequest=O.ConfigurationRequest=O.DidChangeWorkspaceFoldersNotification=O.WorkspaceFoldersRequest=O.TypeDefinitionRequest=O.ImplementationRequest=O.ApplyWorkspaceEditRequest=O.ExecuteCommandRequest=O.PrepareRenameRequest=O.RenameRequest=O.PrepareSupportDefaultBehavior=O.DocumentOnTypeFormattingRequest=O.DocumentRangesFormattingRequest=O.DocumentRangeFormattingRequest=O.DocumentFormattingRequest=O.DocumentLinkResolveRequest=O.DocumentLinkRequest=O.CodeLensRefreshRequest=O.CodeLensResolveRequest=O.CodeLensRequest=O.WorkspaceSymbolResolveRequest=void 0;O.InlineCompletionRequest=O.DidCloseNotebookDocumentNotification=O.DidSaveNotebookDocumentNotification=O.DidChangeNotebookDocumentNotification=O.NotebookCellArrayChange=O.DidOpenNotebookDocumentNotification=O.NotebookDocumentSyncRegistrationType=O.NotebookDocument=O.NotebookCell=O.ExecutionSummary=O.NotebookCellKind=O.DiagnosticRefreshRequest=O.WorkspaceDiagnosticRequest=O.DocumentDiagnosticRequest=O.DocumentDiagnosticReportKind=O.DiagnosticServerCancellationData=O.InlayHintRefreshRequest=O.InlayHintResolveRequest=O.InlayHintRequest=O.InlineValueRefreshRequest=O.InlineValueRequest=O.TypeHierarchySupertypesRequest=O.TypeHierarchySubtypesRequest=O.TypeHierarchyPrepareRequest=void 0;var _e=Kt(),RB=Wd(),yr=Kd(),CX=JO();Object.defineProperty(O,"ImplementationRequest",{enumerable:!0,get:function(){return CX.ImplementationRequest}});var xX=rL();Object.defineProperty(O,"TypeDefinitionRequest",{enumerable:!0,get:function(){return xX.TypeDefinitionRequest}});var BF=sL();Object.defineProperty(O,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return BF.WorkspaceFoldersRequest}});Object.defineProperty(O,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return BF.DidChangeWorkspaceFoldersNotification}});var TX=uL();Object.defineProperty(O,"ConfigurationRequest",{enumerable:!0,get:function(){return TX.ConfigurationRequest}});var FF=fL();Object.defineProperty(O,"DocumentColorRequest",{enumerable:!0,get:function(){return FF.DocumentColorRequest}});Object.defineProperty(O,"ColorPresentationRequest",{enumerable:!0,get:function(){return FF.ColorPresentationRequest}});var MF=pL();Object.defineProperty(O,"FoldingRangeRequest",{enumerable:!0,get:function(){return MF.FoldingRangeRequest}});Object.defineProperty(O,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return MF.FoldingRangeRefreshRequest}});var AX=yL();Object.defineProperty(O,"DeclarationRequest",{enumerable:!0,get:function(){return AX.DeclarationRequest}});var RX=bL();Object.defineProperty(O,"SelectionRangeRequest",{enumerable:!0,get:function(){return RX.SelectionRangeRequest}});var Y_=CL();Object.defineProperty(O,"WorkDoneProgress",{enumerable:!0,get:function(){return Y_.WorkDoneProgress}});Object.defineProperty(O,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Y_.WorkDoneProgressCreateRequest}});Object.defineProperty(O,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Y_.WorkDoneProgressCancelNotification}});var Q_=RL();Object.defineProperty(O,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Q_.CallHierarchyIncomingCallsRequest}});Object.defineProperty(O,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Q_.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(O,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Q_.CallHierarchyPrepareRequest}});var No=OL();Object.defineProperty(O,"TokenFormat",{enumerable:!0,get:function(){return No.TokenFormat}});Object.defineProperty(O,"SemanticTokensRequest",{enumerable:!0,get:function(){return No.SemanticTokensRequest}});Object.defineProperty(O,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return No.SemanticTokensDeltaRequest}});Object.defineProperty(O,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return No.SemanticTokensRangeRequest}});Object.defineProperty(O,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return No.SemanticTokensRefreshRequest}});Object.defineProperty(O,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return No.SemanticTokensRegistrationType}});var IX=FL();Object.defineProperty(O,"ShowDocumentRequest",{enumerable:!0,get:function(){return IX.ShowDocumentRequest}});var PX=UL();Object.defineProperty(O,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return PX.LinkedEditingRangeRequest}});var da=GL();Object.defineProperty(O,"FileOperationPatternKind",{enumerable:!0,get:function(){return da.FileOperationPatternKind}});Object.defineProperty(O,"DidCreateFilesNotification",{enumerable:!0,get:function(){return da.DidCreateFilesNotification}});Object.defineProperty(O,"WillCreateFilesRequest",{enumerable:!0,get:function(){return da.WillCreateFilesRequest}});Object.defineProperty(O,"DidRenameFilesNotification",{enumerable:!0,get:function(){return da.DidRenameFilesNotification}});Object.defineProperty(O,"WillRenameFilesRequest",{enumerable:!0,get:function(){return da.WillRenameFilesRequest}});Object.defineProperty(O,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return da.DidDeleteFilesNotification}});Object.defineProperty(O,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return da.WillDeleteFilesRequest}});var Z_=JL();Object.defineProperty(O,"UniquenessLevel",{enumerable:!0,get:function(){return Z_.UniquenessLevel}});Object.defineProperty(O,"MonikerKind",{enumerable:!0,get:function(){return Z_.MonikerKind}});Object.defineProperty(O,"MonikerRequest",{enumerable:!0,get:function(){return Z_.MonikerRequest}});var X_=nB();Object.defineProperty(O,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return X_.TypeHierarchyPrepareRequest}});Object.defineProperty(O,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return X_.TypeHierarchySubtypesRequest}});Object.defineProperty(O,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return X_.TypeHierarchySupertypesRequest}});var qF=aB();Object.defineProperty(O,"InlineValueRequest",{enumerable:!0,get:function(){return qF.InlineValueRequest}});Object.defineProperty(O,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return qF.InlineValueRefreshRequest}});var J_=lB();Object.defineProperty(O,"InlayHintRequest",{enumerable:!0,get:function(){return J_.InlayHintRequest}});Object.defineProperty(O,"InlayHintResolveRequest",{enumerable:!0,get:function(){return J_.InlayHintResolveRequest}});Object.defineProperty(O,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return J_.InlayHintRefreshRequest}});var gc=yB();Object.defineProperty(O,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return gc.DiagnosticServerCancellationData}});Object.defineProperty(O,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return gc.DocumentDiagnosticReportKind}});Object.defineProperty(O,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return gc.DocumentDiagnosticRequest}});Object.defineProperty(O,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return gc.WorkspaceDiagnosticRequest}});Object.defineProperty(O,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return gc.DiagnosticRefreshRequest}});var vi=CB();Object.defineProperty(O,"NotebookCellKind",{enumerable:!0,get:function(){return vi.NotebookCellKind}});Object.defineProperty(O,"ExecutionSummary",{enumerable:!0,get:function(){return vi.ExecutionSummary}});Object.defineProperty(O,"NotebookCell",{enumerable:!0,get:function(){return vi.NotebookCell}});Object.defineProperty(O,"NotebookDocument",{enumerable:!0,get:function(){return vi.NotebookDocument}});Object.defineProperty(O,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return vi.NotebookDocumentSyncRegistrationType}});Object.defineProperty(O,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return vi.DidOpenNotebookDocumentNotification}});Object.defineProperty(O,"NotebookCellArrayChange",{enumerable:!0,get:function(){return vi.NotebookCellArrayChange}});Object.defineProperty(O,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return vi.DidChangeNotebookDocumentNotification}});Object.defineProperty(O,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return vi.DidSaveNotebookDocumentNotification}});Object.defineProperty(O,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return vi.DidCloseNotebookDocumentNotification}});var NX=AB();Object.defineProperty(O,"InlineCompletionRequest",{enumerable:!0,get:function(){return NX.InlineCompletionRequest}});var W_;(function(e){function t(r){let n=r;return yr.string(n)||yr.string(n.language)||yr.string(n.scheme)||yr.string(n.pattern)}e.is=t;})(W_||(O.TextDocumentFilter=W_={}));var K_;(function(e){function t(r){let n=r;return yr.objectLiteral(n)&&(yr.string(n.notebookType)||yr.string(n.scheme)||yr.string(n.pattern))}e.is=t;})(K_||(O.NotebookDocumentFilter=K_={}));var z_;(function(e){function t(r){let n=r;return yr.objectLiteral(n)&&(yr.string(n.notebook)||K_.is(n.notebook))&&(n.language===void 0||yr.string(n.language))}e.is=t;})(z_||(O.NotebookCellTextDocumentFilter=z_={}));var G_;(function(e){function t(r){if(!Array.isArray(r))return !1;for(let n of r)if(!yr.string(n)&&!W_.is(n)&&!z_.is(n))return !1;return !0}e.is=t;})(G_||(O.DocumentSelector=G_={}));var IB;(function(e){e.method="client/registerCapability",e.messageDirection=_e.MessageDirection.serverToClient,e.type=new _e.ProtocolRequestType(e.method);})(IB||(O.RegistrationRequest=IB={}));var PB;(function(e){e.method="client/unregisterCapability",e.messageDirection=_e.MessageDirection.serverToClient,e.type=new _e.ProtocolRequestType(e.method);})(PB||(O.UnregistrationRequest=PB={}));var NB;(function(e){e.Create="create",e.Rename="rename",e.Delete="delete";})(NB||(O.ResourceOperationKind=NB={}));var DB;(function(e){e.Abort="abort",e.Transactional="transactional",e.TextOnlyTransactional="textOnlyTransactional",e.Undo="undo";})(DB||(O.FailureHandlingKind=DB={}));var kB;(function(e){e.UTF8="utf-8",e.UTF16="utf-16",e.UTF32="utf-32";})(kB||(O.PositionEncodingKind=kB={}));var OB;(function(e){function t(r){let n=r;return n&&yr.string(n.id)&&n.id.length>0}e.hasId=t;})(OB||(O.StaticRegistrationOptions=OB={}));var LB;(function(e){function t(r){let n=r;return n&&(n.documentSelector===null||G_.is(n.documentSelector))}e.is=t;})(LB||(O.TextDocumentRegistrationOptions=LB={}));var BB;(function(e){function t(n){let i=n;return yr.objectLiteral(i)&&(i.workDoneProgress===void 0||yr.boolean(i.workDoneProgress))}e.is=t;function r(n){let i=n;return i&&yr.boolean(i.workDoneProgress)}e.hasWorkDoneProgress=r;})(BB||(O.WorkDoneProgressOptions=BB={}));var FB;(function(e){e.method="initialize",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(FB||(O.InitializeRequest=FB={}));var MB;(function(e){e.unknownProtocolVersion=1;})(MB||(O.InitializeErrorCodes=MB={}));var qB;(function(e){e.method="initialized",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolNotificationType(e.method);})(qB||(O.InitializedNotification=qB={}));var UB;(function(e){e.method="shutdown",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType0(e.method);})(UB||(O.ShutdownRequest=UB={}));var jB;(function(e){e.method="exit",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolNotificationType0(e.method);})(jB||(O.ExitNotification=jB={}));var $B;(function(e){e.method="workspace/didChangeConfiguration",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolNotificationType(e.method);})($B||(O.DidChangeConfigurationNotification=$B={}));var VB;(function(e){e.Error=1,e.Warning=2,e.Info=3,e.Log=4,e.Debug=5;})(VB||(O.MessageType=VB={}));var HB;(function(e){e.method="window/showMessage",e.messageDirection=_e.MessageDirection.serverToClient,e.type=new _e.ProtocolNotificationType(e.method);})(HB||(O.ShowMessageNotification=HB={}));var WB;(function(e){e.method="window/showMessageRequest",e.messageDirection=_e.MessageDirection.serverToClient,e.type=new _e.ProtocolRequestType(e.method);})(WB||(O.ShowMessageRequest=WB={}));var KB;(function(e){e.method="window/logMessage",e.messageDirection=_e.MessageDirection.serverToClient,e.type=new _e.ProtocolNotificationType(e.method);})(KB||(O.LogMessageNotification=KB={}));var zB;(function(e){e.method="telemetry/event",e.messageDirection=_e.MessageDirection.serverToClient,e.type=new _e.ProtocolNotificationType(e.method);})(zB||(O.TelemetryEventNotification=zB={}));var GB;(function(e){e.None=0,e.Full=1,e.Incremental=2;})(GB||(O.TextDocumentSyncKind=GB={}));var YB;(function(e){e.method="textDocument/didOpen",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolNotificationType(e.method);})(YB||(O.DidOpenTextDocumentNotification=YB={}));var QB;(function(e){function t(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}e.isIncremental=t;function r(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}e.isFull=r;})(QB||(O.TextDocumentContentChangeEvent=QB={}));var ZB;(function(e){e.method="textDocument/didChange",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolNotificationType(e.method);})(ZB||(O.DidChangeTextDocumentNotification=ZB={}));var XB;(function(e){e.method="textDocument/didClose",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolNotificationType(e.method);})(XB||(O.DidCloseTextDocumentNotification=XB={}));var JB;(function(e){e.method="textDocument/didSave",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolNotificationType(e.method);})(JB||(O.DidSaveTextDocumentNotification=JB={}));var eF;(function(e){e.Manual=1,e.AfterDelay=2,e.FocusOut=3;})(eF||(O.TextDocumentSaveReason=eF={}));var tF;(function(e){e.method="textDocument/willSave",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolNotificationType(e.method);})(tF||(O.WillSaveTextDocumentNotification=tF={}));var rF;(function(e){e.method="textDocument/willSaveWaitUntil",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(rF||(O.WillSaveTextDocumentWaitUntilRequest=rF={}));var nF;(function(e){e.method="workspace/didChangeWatchedFiles",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolNotificationType(e.method);})(nF||(O.DidChangeWatchedFilesNotification=nF={}));var iF;(function(e){e.Created=1,e.Changed=2,e.Deleted=3;})(iF||(O.FileChangeType=iF={}));var sF;(function(e){function t(r){let n=r;return yr.objectLiteral(n)&&(RB.URI.is(n.baseUri)||RB.WorkspaceFolder.is(n.baseUri))&&yr.string(n.pattern)}e.is=t;})(sF||(O.RelativePattern=sF={}));var aF;(function(e){e.Create=1,e.Change=2,e.Delete=4;})(aF||(O.WatchKind=aF={}));var oF;(function(e){e.method="textDocument/publishDiagnostics",e.messageDirection=_e.MessageDirection.serverToClient,e.type=new _e.ProtocolNotificationType(e.method);})(oF||(O.PublishDiagnosticsNotification=oF={}));var uF;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.TriggerForIncompleteCompletions=3;})(uF||(O.CompletionTriggerKind=uF={}));var cF;(function(e){e.method="textDocument/completion",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(cF||(O.CompletionRequest=cF={}));var lF;(function(e){e.method="completionItem/resolve",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(lF||(O.CompletionResolveRequest=lF={}));var fF;(function(e){e.method="textDocument/hover",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(fF||(O.HoverRequest=fF={}));var dF;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.ContentChange=3;})(dF||(O.SignatureHelpTriggerKind=dF={}));var hF;(function(e){e.method="textDocument/signatureHelp",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(hF||(O.SignatureHelpRequest=hF={}));var pF;(function(e){e.method="textDocument/definition",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(pF||(O.DefinitionRequest=pF={}));var gF;(function(e){e.method="textDocument/references",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(gF||(O.ReferencesRequest=gF={}));var mF;(function(e){e.method="textDocument/documentHighlight",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(mF||(O.DocumentHighlightRequest=mF={}));var yF;(function(e){e.method="textDocument/documentSymbol",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(yF||(O.DocumentSymbolRequest=yF={}));var vF;(function(e){e.method="textDocument/codeAction",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(vF||(O.CodeActionRequest=vF={}));var _F;(function(e){e.method="codeAction/resolve",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(_F||(O.CodeActionResolveRequest=_F={}));var bF;(function(e){e.method="workspace/symbol",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(bF||(O.WorkspaceSymbolRequest=bF={}));var SF;(function(e){e.method="workspaceSymbol/resolve",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(SF||(O.WorkspaceSymbolResolveRequest=SF={}));var EF;(function(e){e.method="textDocument/codeLens",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(EF||(O.CodeLensRequest=EF={}));var wF;(function(e){e.method="codeLens/resolve",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(wF||(O.CodeLensResolveRequest=wF={}));var CF;(function(e){e.method="workspace/codeLens/refresh",e.messageDirection=_e.MessageDirection.serverToClient,e.type=new _e.ProtocolRequestType0(e.method);})(CF||(O.CodeLensRefreshRequest=CF={}));var xF;(function(e){e.method="textDocument/documentLink",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(xF||(O.DocumentLinkRequest=xF={}));var TF;(function(e){e.method="documentLink/resolve",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(TF||(O.DocumentLinkResolveRequest=TF={}));var AF;(function(e){e.method="textDocument/formatting",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(AF||(O.DocumentFormattingRequest=AF={}));var RF;(function(e){e.method="textDocument/rangeFormatting",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(RF||(O.DocumentRangeFormattingRequest=RF={}));var IF;(function(e){e.method="textDocument/rangesFormatting",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(IF||(O.DocumentRangesFormattingRequest=IF={}));var PF;(function(e){e.method="textDocument/onTypeFormatting",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(PF||(O.DocumentOnTypeFormattingRequest=PF={}));var NF;(function(e){e.Identifier=1;})(NF||(O.PrepareSupportDefaultBehavior=NF={}));var DF;(function(e){e.method="textDocument/rename",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(DF||(O.RenameRequest=DF={}));var kF;(function(e){e.method="textDocument/prepareRename",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(kF||(O.PrepareRenameRequest=kF={}));var OF;(function(e){e.method="workspace/executeCommand",e.messageDirection=_e.MessageDirection.clientToServer,e.type=new _e.ProtocolRequestType(e.method);})(OF||(O.ExecuteCommandRequest=OF={}));var LF;(function(e){e.method="workspace/applyEdit",e.messageDirection=_e.MessageDirection.serverToClient,e.type=new _e.ProtocolRequestType("workspace/applyEdit");})(LF||(O.ApplyWorkspaceEditRequest=LF={}));});var $F=P(oh=>{Object.defineProperty(oh,"__esModule",{value:!0});oh.createProtocolConnection=void 0;var jF=fa();function DX(e,t,r,n){return jF.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0, jF.createMessageConnection)(e,t,r,n)}oh.createProtocolConnection=DX;});var HF=P(nn=>{var kX=nn&&nn.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i);}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r];}),uh=nn&&nn.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&kX(t,e,r);};Object.defineProperty(nn,"__esModule",{value:!0});nn.LSPErrorCodes=nn.createProtocolConnection=void 0;uh(fa(),nn);uh(Wd(),nn);uh(Kt(),nn);uh(UF(),nn);var OX=$F();Object.defineProperty(nn,"createProtocolConnection",{enumerable:!0,get:function(){return OX.createProtocolConnection}});var VF;(function(e){e.lspReservedErrorRangeStart=-32899,e.RequestFailed=-32803,e.ServerCancelled=-32802,e.ContentModified=-32801,e.RequestCancelled=-32800,e.lspReservedErrorRangeEnd=-32800;})(VF||(nn.LSPErrorCodes=VF={}));});var rr=P(_i=>{var LX=_i&&_i.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i);}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r];}),WF=_i&&_i.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&LX(t,e,r);};Object.defineProperty(_i,"__esModule",{value:!0});_i.createProtocolConnection=void 0;var BX=F_();WF(F_(),_i);WF(HF(),_i);function FX(e,t,r,n){return (0, BX.createMessageConnection)(e,t,r,n)}_i.createProtocolConnection=FX;});var eb=P(kn=>{Object.defineProperty(kn,"__esModule",{value:!0});kn.generateUuid=kn.parse=kn.isUUID=kn.v4=kn.empty=void 0;var mc=class{constructor(t){this._value=t;}asHex(){return this._value}equals(t){return this.asHex()===t.asHex()}},yc=class e extends mc{static _oneOf(t){return t[Math.floor(t.length*Math.random())]}static _randomHex(){return e._oneOf(e._chars)}constructor(){super([e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),"-",e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),"-","4",e._randomHex(),e._randomHex(),e._randomHex(),"-",e._oneOf(e._timeHighBits),e._randomHex(),e._randomHex(),e._randomHex(),"-",e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex()].join(""));}};yc._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];yc._timeHighBits=["8","9","a","b"];kn.empty=new mc("00000000-0000-0000-0000-000000000000");function KF(){return new yc}kn.v4=KF;var MX=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function zF(e){return MX.test(e)}kn.isUUID=zF;function qX(e){if(!zF(e))throw new Error("invalid uuid");return new mc(e)}kn.parse=qX;function UX(){return KF().asHex()}kn.generateUuid=UX;});var GF=P(xs=>{Object.defineProperty(xs,"__esModule",{value:!0});xs.attachPartialResult=xs.ProgressFeature=xs.attachWorkDone=void 0;var Cs=rr(),jX=eb(),ha=class e{constructor(t,r){this._connection=t,this._token=r,e.Instances.set(this._token,this);}begin(t,r,n,i){let s={kind:"begin",title:t,percentage:r,message:n,cancellable:i};this._connection.sendProgress(Cs.WorkDoneProgress.type,this._token,s);}report(t,r){let n={kind:"report"};typeof t=="number"?(n.percentage=t,r!==void 0&&(n.message=r)):n.message=t,this._connection.sendProgress(Cs.WorkDoneProgress.type,this._token,n);}done(){e.Instances.delete(this._token),this._connection.sendProgress(Cs.WorkDoneProgress.type,this._token,{kind:"end"});}};ha.Instances=new Map;var ch=class extends ha{constructor(t,r){super(t,r),this._source=new Cs.CancellationTokenSource;}get token(){return this._source.token}done(){this._source.dispose(),super.done();}cancel(){this._source.cancel();}},vc=class{constructor(){}begin(){}report(){}done(){}},lh=class extends vc{constructor(){super(),this._source=new Cs.CancellationTokenSource;}get token(){return this._source.token}done(){this._source.dispose();}cancel(){this._source.cancel();}};function $X(e,t){if(t===void 0||t.workDoneToken===void 0)return new vc;let r=t.workDoneToken;return delete t.workDoneToken,new ha(e,r)}xs.attachWorkDone=$X;var VX=e=>class extends e{constructor(){super(),this._progressSupported=!1;}initialize(t){super.initialize(t),t?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Cs.WorkDoneProgressCancelNotification.type,r=>{let n=ha.Instances.get(r.token);(n instanceof ch||n instanceof lh)&&n.cancel();}));}attachWorkDoneProgress(t){return t===void 0?new vc:new ha(this.connection,t)}createWorkDoneProgress(){if(this._progressSupported){let t=(0, jX.generateUuid)();return this.connection.sendRequest(Cs.WorkDoneProgressCreateRequest.type,{token:t}).then(()=>new ch(this.connection,t))}else return Promise.resolve(new lh)}};xs.ProgressFeature=VX;var tb;(function(e){e.type=new Cs.ProgressType;})(tb||(tb={}));var rb=class{constructor(t,r){this._connection=t,this._token=r;}report(t){this._connection.sendProgress(tb.type,this._token,t);}};function HX(e,t){if(t===void 0||t.partialResultToken===void 0)return;let r=t.partialResultToken;return delete t.partialResultToken,new rb(e,r)}xs.attachPartialResult=HX;});var YF=P(fh=>{Object.defineProperty(fh,"__esModule",{value:!0});fh.ConfigurationFeature=void 0;var WX=rr(),KX=Ed(),zX=e=>class extends e{getConfiguration(t){return t?KX.string(t)?this._getConfiguration({section:t}):this._getConfiguration(t):this._getConfiguration({})}_getConfiguration(t){let r={items:Array.isArray(t)?t:[t]};return this.connection.sendRequest(WX.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(t)?n:n[0]:Array.isArray(t)?[]:null)}};fh.ConfigurationFeature=zX;});var QF=P(hh=>{Object.defineProperty(hh,"__esModule",{value:!0});hh.WorkspaceFoldersFeature=void 0;var dh=rr(),GX=e=>class extends e{constructor(){super(),this._notificationIsAutoRegistered=!1;}initialize(t){super.initialize(t);let r=t.workspace;r&&r.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new dh.Emitter,this.connection.onNotification(dh.DidChangeWorkspaceFoldersNotification.type,n=>{this._onDidChangeWorkspaceFolders.fire(n.event);}));}fillServerCapabilities(t){super.fillServerCapabilities(t);let r=t.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=r===!0||typeof r=="string";}getWorkspaceFolders(){return this.connection.sendRequest(dh.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(dh.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};hh.WorkspaceFoldersFeature=GX;});var ZF=P(ph=>{Object.defineProperty(ph,"__esModule",{value:!0});ph.CallHierarchyFeature=void 0;var nb=rr(),YX=e=>class extends e{get callHierarchy(){return {onPrepare:t=>this.connection.onRequest(nb.CallHierarchyPrepareRequest.type,(r,n)=>t(r,n,this.attachWorkDoneProgress(r),void 0)),onIncomingCalls:t=>{let r=nb.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>t(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onOutgoingCalls:t=>{let r=nb.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>t(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};ph.CallHierarchyFeature=YX;});var sb=P(Ts=>{Object.defineProperty(Ts,"__esModule",{value:!0});Ts.SemanticTokensBuilder=Ts.SemanticTokensDiff=Ts.SemanticTokensFeature=void 0;var gh=rr(),QX=e=>class extends e{get semanticTokens(){return {refresh:()=>this.connection.sendRequest(gh.SemanticTokensRefreshRequest.type),on:t=>{let r=gh.SemanticTokensRequest.type;return this.connection.onRequest(r,(n,i)=>t(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onDelta:t=>{let r=gh.SemanticTokensDeltaRequest.type;return this.connection.onRequest(r,(n,i)=>t(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onRange:t=>{let r=gh.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,i)=>t(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Ts.SemanticTokensFeature=QX;var mh=class{constructor(t,r){this.originalSequence=t,this.modifiedSequence=r;}computeDiff(){let t=this.originalSequence.length,r=this.modifiedSequence.length,n=0;for(;n<r&&n<t&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<r&&n<t){let i=t-1,s=r-1;for(;i>=n&&s>=n&&this.originalSequence[i]===this.modifiedSequence[s];)i--,s--;(i<n||s<n)&&(i++,s++);let a=i-n+1,o=this.modifiedSequence.slice(n,s+1);return o.length===1&&o[0]===this.originalSequence[i]?[{start:n,deleteCount:a-1}]:[{start:n,deleteCount:a,data:o}]}else return n<r?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<t?[{start:n,deleteCount:t-n}]:[]}};Ts.SemanticTokensDiff=mh;var ib=class{constructor(){this._prevData=void 0,this.initialize();}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0;}push(t,r,n,i,s){let a=t,o=r;this._dataLen>0&&(a-=this._prevLine,a===0&&(o-=this._prevChar)),this._data[this._dataLen++]=a,this._data[this._dataLen++]=o,this._data[this._dataLen++]=n,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._prevLine=t,this._prevChar=r;}get id(){return this._id.toString()}previousResult(t){this.id===t&&(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 mh(this._prevData,this._data).computeDiff()}:this.build()}};Ts.SemanticTokensBuilder=ib;});var XF=P(yh=>{Object.defineProperty(yh,"__esModule",{value:!0});yh.ShowDocumentFeature=void 0;var ZX=rr(),XX=e=>class extends e{showDocument(t){return this.connection.sendRequest(ZX.ShowDocumentRequest.type,t)}};yh.ShowDocumentFeature=XX;});var JF=P(vh=>{Object.defineProperty(vh,"__esModule",{value:!0});vh.FileOperationsFeature=void 0;var Do=rr(),JX=e=>class extends e{onDidCreateFiles(t){return this.connection.onNotification(Do.DidCreateFilesNotification.type,r=>{t(r);})}onDidRenameFiles(t){return this.connection.onNotification(Do.DidRenameFilesNotification.type,r=>{t(r);})}onDidDeleteFiles(t){return this.connection.onNotification(Do.DidDeleteFilesNotification.type,r=>{t(r);})}onWillCreateFiles(t){return this.connection.onRequest(Do.WillCreateFilesRequest.type,(r,n)=>t(r,n))}onWillRenameFiles(t){return this.connection.onRequest(Do.WillRenameFilesRequest.type,(r,n)=>t(r,n))}onWillDeleteFiles(t){return this.connection.onRequest(Do.WillDeleteFilesRequest.type,(r,n)=>t(r,n))}};vh.FileOperationsFeature=JX;});var eM=P(_h=>{Object.defineProperty(_h,"__esModule",{value:!0});_h.LinkedEditingRangeFeature=void 0;var eJ=rr(),tJ=e=>class extends e{onLinkedEditingRange(t){return this.connection.onRequest(eJ.LinkedEditingRangeRequest.type,(r,n)=>t(r,n,this.attachWorkDoneProgress(r),void 0))}};_h.LinkedEditingRangeFeature=tJ;});var tM=P(bh=>{Object.defineProperty(bh,"__esModule",{value:!0});bh.TypeHierarchyFeature=void 0;var ab=rr(),rJ=e=>class extends e{get typeHierarchy(){return {onPrepare:t=>this.connection.onRequest(ab.TypeHierarchyPrepareRequest.type,(r,n)=>t(r,n,this.attachWorkDoneProgress(r),void 0)),onSupertypes:t=>{let r=ab.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(r,(n,i)=>t(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onSubtypes:t=>{let r=ab.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,i)=>t(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};bh.TypeHierarchyFeature=rJ;});var nM=P(Sh=>{Object.defineProperty(Sh,"__esModule",{value:!0});Sh.InlineValueFeature=void 0;var rM=rr(),nJ=e=>class extends e{get inlineValue(){return {refresh:()=>this.connection.sendRequest(rM.InlineValueRefreshRequest.type),on:t=>this.connection.onRequest(rM.InlineValueRequest.type,(r,n)=>t(r,n,this.attachWorkDoneProgress(r)))}}};Sh.InlineValueFeature=nJ;});var sM=P(Eh=>{Object.defineProperty(Eh,"__esModule",{value:!0});Eh.FoldingRangeFeature=void 0;var iM=rr(),iJ=e=>class extends e{get foldingRange(){return {refresh:()=>this.connection.sendRequest(iM.FoldingRangeRefreshRequest.type),on:t=>{let r=iM.FoldingRangeRequest.type;return this.connection.onRequest(r,(n,i)=>t(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Eh.FoldingRangeFeature=iJ;});var aM=P(wh=>{Object.defineProperty(wh,"__esModule",{value:!0});wh.InlayHintFeature=void 0;var ob=rr(),sJ=e=>class extends e{get inlayHint(){return {refresh:()=>this.connection.sendRequest(ob.InlayHintRefreshRequest.type),on:t=>this.connection.onRequest(ob.InlayHintRequest.type,(r,n)=>t(r,n,this.attachWorkDoneProgress(r))),resolve:t=>this.connection.onRequest(ob.InlayHintResolveRequest.type,(r,n)=>t(r,n))}}};wh.InlayHintFeature=sJ;});var oM=P(Ch=>{Object.defineProperty(Ch,"__esModule",{value:!0});Ch.DiagnosticFeature=void 0;var _c=rr(),aJ=e=>class extends e{get diagnostics(){return {refresh:()=>this.connection.sendRequest(_c.DiagnosticRefreshRequest.type),on:t=>this.connection.onRequest(_c.DocumentDiagnosticRequest.type,(r,n)=>t(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(_c.DocumentDiagnosticRequest.partialResult,r))),onWorkspace:t=>this.connection.onRequest(_c.WorkspaceDiagnosticRequest.type,(r,n)=>t(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(_c.WorkspaceDiagnosticRequest.partialResult,r)))}}};Ch.DiagnosticFeature=aJ;});var cb=P(xh=>{Object.defineProperty(xh,"__esModule",{value:!0});xh.TextDocuments=void 0;var pa=rr(),ub=class{constructor(t){this._configuration=t,this._syncedDocuments=new Map,this._onDidChangeContent=new pa.Emitter,this._onDidOpen=new pa.Emitter,this._onDidClose=new pa.Emitter,this._onDidSave=new pa.Emitter,this._onWillSave=new pa.Emitter;}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(t){this._willSaveWaitUntil=t;}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(t){return this._syncedDocuments.get(t)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(t){t.__textDocumentSync=pa.TextDocumentSyncKind.Incremental;let r=[];return r.push(t.onDidOpenTextDocument(n=>{let i=n.textDocument,s=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,s);let a=Object.freeze({document:s});this._onDidOpen.fire(a),this._onDidChangeContent.fire(a);})),r.push(t.onDidChangeTextDocument(n=>{let i=n.textDocument,s=n.contentChanges;if(s.length===0)return;let{version:a}=i;if(a==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let o=this._syncedDocuments.get(i.uri);o!==void 0&&(o=this._configuration.update(o,s,a),this._syncedDocuments.set(i.uri,o),this._onDidChangeContent.fire(Object.freeze({document:o})));})),r.push(t.onDidCloseTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(n.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})));})),r.push(t.onWillSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:n.reason}));})),r.push(t.onWillSaveTextDocumentWaitUntil((n,i)=>{let s=this._syncedDocuments.get(n.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:n.reason}),i):[]})),r.push(t.onDidSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}));})),pa.Disposable.create(()=>{r.forEach(n=>n.dispose());})}};xh.TextDocuments=ub;});var fb=P(ko=>{Object.defineProperty(ko,"__esModule",{value:!0});ko.NotebookDocuments=ko.NotebookSyncFeature=void 0;var On=rr(),uM=cb(),oJ=e=>class extends e{get synchronization(){return {onDidOpenNotebookDocument:t=>this.connection.onNotification(On.DidOpenNotebookDocumentNotification.type,r=>{t(r);}),onDidChangeNotebookDocument:t=>this.connection.onNotification(On.DidChangeNotebookDocumentNotification.type,r=>{t(r);}),onDidSaveNotebookDocument:t=>this.connection.onNotification(On.DidSaveNotebookDocumentNotification.type,r=>{t(r);}),onDidCloseNotebookDocument:t=>this.connection.onNotification(On.DidCloseNotebookDocumentNotification.type,r=>{t(r);})}}};ko.NotebookSyncFeature=oJ;var Th=class e{onDidOpenTextDocument(t){return this.openHandler=t,On.Disposable.create(()=>{this.openHandler=void 0;})}openTextDocument(t){this.openHandler&&this.openHandler(t);}onDidChangeTextDocument(t){return this.changeHandler=t,On.Disposable.create(()=>{this.changeHandler=t;})}changeTextDocument(t){this.changeHandler&&this.changeHandler(t);}onDidCloseTextDocument(t){return this.closeHandler=t,On.Disposable.create(()=>{this.closeHandler=void 0;})}closeTextDocument(t){this.closeHandler&&this.closeHandler(t);}onWillSaveTextDocument(){return e.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return e.NULL_DISPOSE}onDidSaveTextDocument(){return e.NULL_DISPOSE}};Th.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var lb=class{constructor(t){t instanceof uM.TextDocuments?this._cellTextDocuments=t:this._cellTextDocuments=new uM.TextDocuments(t),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new On.Emitter,this._onDidChange=new On.Emitter,this._onDidSave=new On.Emitter,this._onDidClose=new On.Emitter;}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(t){return this._cellTextDocuments.get(t.document)}getNotebookDocument(t){return this.notebookDocuments.get(t)}getNotebookCell(t){let r=this.notebookCellMap.get(t);return r&&r[0]}findNotebookDocumentForCell(t){let r=typeof t=="string"?t:t.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(t){let r=new Th,n=[];return n.push(this.cellTextDocuments.listen(r)),n.push(t.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let s of i.cellTextDocuments)r.openTextDocument({textDocument:s});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument);})),n.push(t.notebooks.synchronization.onDidChangeNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s===void 0)return;s.version=i.notebookDocument.version;let a=s.metadata,o=!1,c=i.change;c.metadata!==void 0&&(o=!0,s.metadata=c.metadata);let l=[],u=[],f=[],h=[];if(c.cells!==void 0){let w=c.cells;if(w.structure!==void 0){let y=w.structure.array;if(s.cells.splice(y.start,y.deleteCount,...y.cells!==void 0?y.cells:[]),w.structure.didOpen!==void 0)for(let b of w.structure.didOpen)r.openTextDocument({textDocument:b}),l.push(b.uri);if(w.structure.didClose)for(let b of w.structure.didClose)r.closeTextDocument({textDocument:b}),u.push(b.uri);}if(w.data!==void 0){let y=new Map(w.data.map(b=>[b.document,b]));for(let b=0;b<=s.cells.length;b++){let N=y.get(s.cells[b].document);if(N!==void 0){let L=s.cells.splice(b,1,N);if(f.push({old:L[0],new:N}),y.delete(N.document),y.size===0)break}}}if(w.textContent!==void 0)for(let y of w.textContent)r.changeTextDocument({textDocument:y.document,contentChanges:y.changes}),h.push(y.document.uri);}this.updateCellMap(s);let p={notebookDocument:s};o&&(p.metadata={old:a,new:s.metadata});let m=[];for(let w of l)m.push(this.getNotebookCell(w));let _=[];for(let w of u)_.push(this.getNotebookCell(w));let E=[];for(let w of h)E.push(this.getNotebookCell(w));(m.length>0||_.length>0||f.length>0||E.length>0)&&(p.cells={added:m,removed:_,changed:{data:f,textContent:E}}),(p.metadata!==void 0||p.cells!==void 0)&&this._onDidChange.fire(p);})),n.push(t.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s);})),n.push(t.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let a of i.cellTextDocuments)r.closeTextDocument({textDocument:a});this.notebookDocuments.delete(i.notebookDocument.uri);for(let a of s.cells)this.notebookCellMap.delete(a.document);}})),On.Disposable.create(()=>{n.forEach(i=>i.dispose());})}updateCellMap(t){for(let r of t.cells)this.notebookCellMap.set(r.document,[r,t]);}};ko.NotebookDocuments=lb;});var cM=P(Ah=>{Object.defineProperty(Ah,"__esModule",{value:!0});Ah.MonikerFeature=void 0;var uJ=rr(),cJ=e=>class extends e{get moniker(){return {on:t=>{let r=uJ.MonikerRequest.type;return this.connection.onRequest(r,(n,i)=>t(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Ah.MonikerFeature=cJ;});var yb=P(_t=>{Object.defineProperty(_t,"__esModule",{value:!0});_t.createConnection=_t.combineFeatures=_t.combineNotebooksFeatures=_t.combineLanguagesFeatures=_t.combineWorkspaceFeatures=_t.combineWindowFeatures=_t.combineClientFeatures=_t.combineTracerFeatures=_t.combineTelemetryFeatures=_t.combineConsoleFeatures=_t._NotebooksImpl=_t._LanguagesImpl=_t.BulkUnregistration=_t.BulkRegistration=_t.ErrorMessageTracker=void 0;var we=rr(),Ln=Ed(),hb=eb(),Ye=GF(),lJ=YF(),fJ=QF(),dJ=ZF(),hJ=sb(),pJ=XF(),gJ=JF(),mJ=eM(),yJ=tM(),vJ=nM(),_J=sM(),bJ=aM(),SJ=oM(),EJ=fb(),wJ=cM();function db(e){if(e!==null)return e}var pb=class{constructor(){this._messages=Object.create(null);}add(t){let r=this._messages[t];r||(r=0),r++,this._messages[t]=r;}sendErrors(t){Object.keys(this._messages).forEach(r=>{t.window.showErrorMessage(r);});}};_t.ErrorMessageTracker=pb;var Rh=class{constructor(){}rawAttach(t){this._rawConnection=t;}attach(t){this._connection=t;}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(t){}initialize(t){}error(t){this.send(we.MessageType.Error,t);}warn(t){this.send(we.MessageType.Warning,t);}info(t){this.send(we.MessageType.Info,t);}log(t){this.send(we.MessageType.Log,t);}debug(t){this.send(we.MessageType.Debug,t);}send(t,r){this._rawConnection&&this._rawConnection.sendNotification(we.LogMessageNotification.type,{type:t,message:r}).catch(()=>{(0, we.RAL)().console.error("Sending log message failed");});}},gb=class{constructor(){}attach(t){this._connection=t;}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}showErrorMessage(t,...r){let n={type:we.MessageType.Error,message:t,actions:r};return this.connection.sendRequest(we.ShowMessageRequest.type,n).then(db)}showWarningMessage(t,...r){let n={type:we.MessageType.Warning,message:t,actions:r};return this.connection.sendRequest(we.ShowMessageRequest.type,n).then(db)}showInformationMessage(t,...r){let n={type:we.MessageType.Info,message:t,actions:r};return this.connection.sendRequest(we.ShowMessageRequest.type,n).then(db)}},lM=(0, pJ.ShowDocumentFeature)((0, Ye.ProgressFeature)(gb)),fM;(function(e){function t(){return new Ih}e.create=t;})(fM||(_t.BulkRegistration=fM={}));var Ih=class{constructor(){this._registrations=[],this._registered=new Set;}add(t,r){let n=Ln.string(t)?t:t.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let i=hb.generateUuid();this._registrations.push({id:i,method:n,registerOptions:r||{}}),this._registered.add(n);}asRegistrationParams(){return {registrations:this._registrations}}},dM;(function(e){function t(){return new bc(void 0,[])}e.create=t;})(dM||(_t.BulkUnregistration=dM={}));var bc=class{constructor(t,r){this._connection=t,this._unregistrations=new Map,r.forEach(n=>{this._unregistrations.set(n.method,n);});}get isAttached(){return !!this._connection}attach(t){this._connection=t;}add(t){this._unregistrations.set(t.method,t);}dispose(){let t=[];for(let n of this._unregistrations.values())t.push(n);let r={unregisterations:t};this._connection.sendRequest(we.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.");});}disposeSingle(t){let r=Ln.string(t)?t:t.method,n=this._unregistrations.get(r);if(!n)return !1;let i={unregisterations:[n]};return this._connection.sendRequest(we.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(r);},s=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`);}),!0}},Ph=class{attach(t){this._connection=t;}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}register(t,r,n){return t instanceof Ih?this.registerMany(t):t instanceof bc?this.registerSingle1(t,r,n):this.registerSingle2(t,r)}registerSingle1(t,r,n){let i=Ln.string(r)?r:r.method,s=hb.generateUuid(),a={registrations:[{id:s,method:i,registerOptions:n||{}}]};return t.isAttached||t.attach(this.connection),this.connection.sendRequest(we.RegistrationRequest.type,a).then(o=>(t.add({id:s,method:i}),t),o=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(o)))}registerSingle2(t,r){let n=Ln.string(t)?t:t.method,i=hb.generateUuid(),s={registrations:[{id:i,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(we.RegistrationRequest.type,s).then(a=>we.Disposable.create(()=>{this.unregisterSingle(i,n).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`);});}),a=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(a)))}unregisterSingle(t,r){let n={unregisterations:[{id:t,method:r}]};return this.connection.sendRequest(we.UnregistrationRequest.type,n).catch(()=>{this.connection.console.info(`Un-registering request handler for ${t} failed.`);})}registerMany(t){let r=t.asRegistrationParams();return this.connection.sendRequest(we.RegistrationRequest.type,r).then(()=>new bc(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},mb=class{constructor(){}attach(t){this._connection=t;}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}applyEdit(t){function r(i){return i&&!!i.edit}let n=r(t)?t:{edit:t};return this.connection.sendRequest(we.ApplyWorkspaceEditRequest.type,n)}},hM=(0, gJ.FileOperationsFeature)((0, fJ.WorkspaceFoldersFeature)((0, lJ.ConfigurationFeature)(mb))),Nh=class{constructor(){this._trace=we.Trace.Off;}attach(t){this._connection=t;}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}set trace(t){this._trace=t;}log(t,r){this._trace!==we.Trace.Off&&this.connection.sendNotification(we.LogTraceNotification.type,{message:t,verbose:this._trace===we.Trace.Verbose?r:void 0}).catch(()=>{});}},Dh=class{constructor(){}attach(t){this._connection=t;}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}logEvent(t){this.connection.sendNotification(we.TelemetryEventNotification.type,t).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed");});}},kh=class{constructor(){}attach(t){this._connection=t;}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}attachWorkDoneProgress(t){return (0, Ye.attachWorkDone)(this.connection,t)}attachPartialResultProgress(t,r){return (0, Ye.attachPartialResult)(this.connection,r)}};_t._LanguagesImpl=kh;var pM=(0, _J.FoldingRangeFeature)((0, wJ.MonikerFeature)((0, SJ.DiagnosticFeature)((0, bJ.InlayHintFeature)((0, vJ.InlineValueFeature)((0, yJ.TypeHierarchyFeature)((0, mJ.LinkedEditingRangeFeature)((0, hJ.SemanticTokensFeature)((0, dJ.CallHierarchyFeature)(kh))))))))),Oh=class{constructor(){}attach(t){this._connection=t;}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}attachWorkDoneProgress(t){return (0, Ye.attachWorkDone)(this.connection,t)}attachPartialResultProgress(t,r){return (0, Ye.attachPartialResult)(this.connection,r)}};_t._NotebooksImpl=Oh;var gM=(0, EJ.NotebookSyncFeature)(Oh);function mM(e,t){return function(r){return t(e(r))}}_t.combineConsoleFeatures=mM;function yM(e,t){return function(r){return t(e(r))}}_t.combineTelemetryFeatures=yM;function vM(e,t){return function(r){return t(e(r))}}_t.combineTracerFeatures=vM;function _M(e,t){return function(r){return t(e(r))}}_t.combineClientFeatures=_M;function bM(e,t){return function(r){return t(e(r))}}_t.combineWindowFeatures=bM;function SM(e,t){return function(r){return t(e(r))}}_t.combineWorkspaceFeatures=SM;function EM(e,t){return function(r){return t(e(r))}}_t.combineLanguagesFeatures=EM;function wM(e,t){return function(r){return t(e(r))}}_t.combineNotebooksFeatures=wM;function CJ(e,t){function r(i,s,a){return i&&s?a(i,s):i||s}return {__brand:"features",console:r(e.console,t.console,mM),tracer:r(e.tracer,t.tracer,vM),telemetry:r(e.telemetry,t.telemetry,yM),client:r(e.client,t.client,_M),window:r(e.window,t.window,bM),workspace:r(e.workspace,t.workspace,SM),languages:r(e.languages,t.languages,EM),notebooks:r(e.notebooks,t.notebooks,wM)}}_t.combineFeatures=CJ;function xJ(e,t,r){let n=r&&r.console?new(r.console(Rh)):new Rh,i=e(n);n.rawAttach(i);let s=r&&r.tracer?new(r.tracer(Nh)):new Nh,a=r&&r.telemetry?new(r.telemetry(Dh)):new Dh,o=r&&r.client?new(r.client(Ph)):new Ph,c=r&&r.window?new(r.window(lM)):new lM,l=r&&r.workspace?new(r.workspace(hM)):new hM,u=r&&r.languages?new(r.languages(pM)):new pM,f=r&&r.notebooks?new(r.notebooks(gM)):new gM,h=[n,s,a,o,c,l,u,f];function p(y){return y instanceof Promise?y:Ln.thenable(y)?new Promise((b,N)=>{y.then(L=>b(L),L=>N(L));}):Promise.resolve(y)}let m,_,E,w={listen:()=>i.listen(),sendRequest:(y,...b)=>i.sendRequest(Ln.string(y)?y:y.method,...b),onRequest:(y,b)=>i.onRequest(y,b),sendNotification:(y,b)=>{let N=Ln.string(y)?y:y.method;return i.sendNotification(N,b)},onNotification:(y,b)=>i.onNotification(y,b),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:y=>(_=y,{dispose:()=>{_=void 0;}}),onInitialized:y=>i.onNotification(we.InitializedNotification.type,y),onShutdown:y=>(m=y,{dispose:()=>{m=void 0;}}),onExit:y=>(E=y,{dispose:()=>{E=void 0;}}),get console(){return n},get telemetry(){return a},get tracer(){return s},get client(){return o},get window(){return c},get workspace(){return l},get languages(){return u},get notebooks(){return f},onDidChangeConfiguration:y=>i.onNotification(we.DidChangeConfigurationNotification.type,y),onDidChangeWatchedFiles:y=>i.onNotification(we.DidChangeWatchedFilesNotification.type,y),__textDocumentSync:void 0,onDidOpenTextDocument:y=>i.onNotification(we.DidOpenTextDocumentNotification.type,y),onDidChangeTextDocument:y=>i.onNotification(we.DidChangeTextDocumentNotification.type,y),onDidCloseTextDocument:y=>i.onNotification(we.DidCloseTextDocumentNotification.type,y),onWillSaveTextDocument:y=>i.onNotification(we.WillSaveTextDocumentNotification.type,y),onWillSaveTextDocumentWaitUntil:y=>i.onRequest(we.WillSaveTextDocumentWaitUntilRequest.type,y),onDidSaveTextDocument:y=>i.onNotification(we.DidSaveTextDocumentNotification.type,y),sendDiagnostics:y=>i.sendNotification(we.PublishDiagnosticsNotification.type,y),onHover:y=>i.onRequest(we.HoverRequest.type,(b,N)=>y(b,N,(0, Ye.attachWorkDone)(i,b),void 0)),onCompletion:y=>i.onRequest(we.CompletionRequest.type,(b,N)=>y(b,N,(0, Ye.attachWorkDone)(i,b),(0, Ye.attachPartialResult)(i,b))),onCompletionResolve:y=>i.onRequest(we.CompletionResolveRequest.type,y),onSignatureHelp:y=>i.onRequest(we.SignatureHelpRequest.type,(b,N)=>y(b,N,(0, Ye.attachWorkDone)(i,b),void 0)),onDeclaration:y=>i.onRequest(we.DeclarationRequest.type,(b,N)=>y(b,N,(0, Ye.attachWorkDone)(i,b),(0, Ye.attachPartialResult)(i,b))),onDefinition:y=>i.onRequest(we.DefinitionRequest.type,(b,N)=>y(b,N,(0, Ye.attachWorkDone)(i,b),(0, Ye.attachPartialResult)(i,b))),onTypeDefinition:y=>i.onRequest(we.TypeDefinitionRequest.type,(b,N)=>y(b,N,(0, Ye.attachWorkDone)(i,b),(0, Ye.attachPartialResult)(i,b))),onImplementation:y=>i.onRequest(we.ImplementationRequest.type,(b,N)=>y(b,N,(0, Ye.attachWorkDone)(i,b),(0, Ye.attachPartialResult)(i,b))),onReferences:y=>i.onRequest(we.ReferencesRequest.type,(b,N)=>y(b,N,(0, Ye.attachWorkDone)(i,b),(0, Ye.attachPartialResult)(i,b))),onDocumentHighlight:y=>i.onRequest(we.DocumentHighlightRequest.type,(b,N)=>y(b,N,(0, Ye.attachWorkDone)(i,b),(0, Ye.attachPartialResult)(i,b))),onDocumentSymbol:y=>i.onRequest(we.DocumentSymbolRequest.type,(b,N)=>y(b,N,(0, Ye.attachWorkDone)(i,b),(0, Ye.attachPartialResult)(i,b))),onWorkspaceSymbol:y=>i.onRequest(we.WorkspaceSymbolRequest.type,(b,N)=>y(b,N,(0, Ye.attachWorkDone)(i,b),(0, Ye.attachPartialResult)(i,b))),onWorkspaceSymbolResolve:y=>i.onRequest(we.WorkspaceSymbolResolveRequest.type,y),onCodeAction:y=>i.onRequest(we.CodeActionRequest.type,(b,N)=>y(b,N,(0, Ye.attachWorkDone)(i,b),(0, Ye.attachPartialResult)(i,b))),onCodeActionResolve:y=>i.onRequest(we.CodeActionResolveRequest.type,(b,N)=>y(b,N)),onCodeLens:y=>i.onRequest(we.CodeLensRequest.type,(b,N)=>y(b,N,(0, Ye.attachWorkDone)(i,b),(0, Ye.attachPartialResult)(i,b))),onCodeLensResolve:y=>i.onRequest(we.CodeLensResolveRequest.type,(b,N)=>y(b,N)),onDocumentFormatting:y=>i.onRequest(we.DocumentFormattingRequest.type,(b,N)=>y(b,N,(0, Ye.attachWorkDone)(i,b),void 0)),onDocumentRangeFormatting:y=>i.onRequest(we.DocumentRangeFormattingRequest.type,(b,N)=>y(b,N,(0, Ye.attachWorkDone)(i,b),void 0)),onDocumentOnTypeFormatting:y=>i.onRequest(we.DocumentOnTypeFormattingRequest.type,(b,N)=>y(b,N)),onRenameRequest:y=>i.onRequest(we.RenameRequest.type,(b,N)=>y(b,N,(0, Ye.attachWorkDone)(i,b),void 0)),onPrepareRename:y=>i.onRequest(we.PrepareRenameRequest.type,(b,N)=>y(b,N)),onDocumentLinks:y=>i.onRequest(we.DocumentLinkRequest.type,(b,N)=>y(b,N,(0, Ye.attachWorkDone)(i,b),(0, Ye.attachPartialResult)(i,b))),onDocumentLinkResolve:y=>i.onRequest(we.DocumentLinkResolveRequest.type,(b,N)=>y(b,N)),onDocumentColor:y=>i.onRequest(we.DocumentColorRequest.type,(b,N)=>y(b,N,(0, Ye.attachWorkDone)(i,b),(0, Ye.attachPartialResult)(i,b))),onColorPresentation:y=>i.onRequest(we.ColorPresentationRequest.type,(b,N)=>y(b,N,(0, Ye.attachWorkDone)(i,b),(0, Ye.attachPartialResult)(i,b))),onFoldingRanges:y=>i.onRequest(we.FoldingRangeRequest.type,(b,N)=>y(b,N,(0, Ye.attachWorkDone)(i,b),(0, Ye.attachPartialResult)(i,b))),onSelectionRanges:y=>i.onRequest(we.SelectionRangeRequest.type,(b,N)=>y(b,N,(0, Ye.attachWorkDone)(i,b),(0, Ye.attachPartialResult)(i,b))),onExecuteCommand:y=>i.onRequest(we.ExecuteCommandRequest.type,(b,N)=>y(b,N,(0, Ye.attachWorkDone)(i,b),void 0)),dispose:()=>i.dispose()};for(let y of h)y.attach(w);return i.onRequest(we.InitializeRequest.type,y=>{t.initialize(y),Ln.string(y.trace)&&(s.trace=we.Trace.fromString(y.trace));for(let b of h)b.initialize(y.capabilities);if(_){let b=_(y,new we.CancellationTokenSource().token,(0, Ye.attachWorkDone)(i,y),void 0);return p(b).then(N=>{if(N instanceof we.ResponseError)return N;let L=N;L||(L={capabilities:{}});let V=L.capabilities;V||(V={},L.capabilities=V),V.textDocumentSync===void 0||V.textDocumentSync===null?V.textDocumentSync=Ln.number(w.__textDocumentSync)?w.__textDocumentSync:we.TextDocumentSyncKind.None:!Ln.number(V.textDocumentSync)&&!Ln.number(V.textDocumentSync.change)&&(V.textDocumentSync.change=Ln.number(w.__textDocumentSync)?w.__textDocumentSync:we.TextDocumentSyncKind.None);for(let X of h)X.fillServerCapabilities(V);return L})}else {let b={capabilities:{textDocumentSync:we.TextDocumentSyncKind.None}};for(let N of h)N.fillServerCapabilities(b.capabilities);return b}}),i.onRequest(we.ShutdownRequest.type,()=>{if(t.shutdownReceived=!0,m)return m(new we.CancellationTokenSource().token)}),i.onNotification(we.ExitNotification.type,()=>{try{E&&E();}finally{t.shutdownReceived?t.exit(0):t.exit(1);}}),i.onNotification(we.SetTraceNotification.type,y=>{s.trace=we.Trace.fromString(y.value);}),w}_t.createConnection=xJ;});var CM=P(sn=>{Object.defineProperty(sn,"__esModule",{value:!0});sn.resolveModulePath=sn.FileSystem=sn.resolveGlobalYarnPath=sn.resolveGlobalNodePath=sn.resolve=sn.uriToFilePath=void 0;var TJ=he("url"),Zn=he("path"),vb=he("fs"),Eb=he("child_process");function AJ(e){let t=TJ.parse(e);if(t.protocol!=="file:"||!t.path)return;let r=t.path.split("/");for(var n=0,i=r.length;n<i;n++)r[n]=decodeURIComponent(r[n]);if(process.platform==="win32"&&r.length>1){let s=r[0],a=r[1];s.length===0&&a.length>1&&a[1]===":"&&r.shift();}return Zn.normalize(r.join("/"))}sn.uriToFilePath=AJ;function _b(){return process.platform==="win32"}function Lh(e,t,r,n){let i="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((a,o)=>{let c=process.env,l=Object.create(null);Object.keys(c).forEach(u=>l[u]=c[u]),t&&vb.existsSync(t)&&(l[i]?l[i]=t+Zn.delimiter+l[i]:l[i]=t,n&&n(`NODE_PATH value is: ${l[i]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let u=(0, Eb.fork)("",[],{cwd:r,env:l,execArgv:["-e",s]});if(u.pid===void 0){o(new Error(`Starting process to resolve node module  ${e} failed`));return}u.on("error",h=>{o(h);}),u.on("message",h=>{h.c==="r"&&(u.send({c:"e"}),h.s?a(h.r):o(new Error(`Failed to resolve module: ${e}`)));});let f={c:"rs",a:e};u.send(f);}catch(u){o(u);}})}sn.resolve=Lh;function bb(e){let t="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};_b()&&(t="npm.cmd",n.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0, Eb.spawnSync)(t,["config","get","prefix"],n).stdout;if(!s){e&&e("'npm config get prefix' didn't return a value.");return}let a=s.trim();return e&&e(`'npm config get prefix' value is: ${a}`),a.length>0?_b()?Zn.join(a,"node_modules"):Zn.join(a,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i);}}sn.resolveGlobalNodePath=bb;function RJ(e){let t="yarn",r={encoding:"utf8"};_b()&&(t="yarn.cmd",r.shell=!0);let n=()=>{};try{process.on("SIGPIPE",n);let i=(0, Eb.spawnSync)(t,["global","dir","--json"],r),s=i.stdout;if(!s){e&&(e("'yarn global dir' didn't return a value."),i.stderr&&e(i.stderr));return}let a=s.trim().split(/\r?\n/);for(let o of a)try{let c=JSON.parse(o);if(c.type==="log")return Zn.join(c.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n);}}sn.resolveGlobalYarnPath=RJ;var Sb;(function(e){let t;function r(){return t!==void 0||(process.platform==="win32"?t=!1:t=!vb.existsSync(__filename.toUpperCase())||!vb.existsSync(__filename.toLowerCase())),t}e.isCaseSensitive=r;function n(i,s){return r()?Zn.normalize(s).indexOf(Zn.normalize(i))===0:Zn.normalize(s).toLowerCase().indexOf(Zn.normalize(i).toLowerCase())===0}e.isParent=n;})(Sb||(sn.FileSystem=Sb={}));function IJ(e,t,r,n){return r?(Zn.isAbsolute(r)||(r=Zn.join(e,r)),Lh(t,r,r,n).then(i=>Sb.isParent(r,i)?i:Promise.reject(new Error(`Failed to load ${t} from node path location.`))).then(void 0,i=>Lh(t,bb(n),e,n))):Lh(t,bb(n),e,n)}sn.resolveModulePath=IJ;});var wb=P((yce,xM)=>{xM.exports=rr();});var TM=P(Bh=>{Object.defineProperty(Bh,"__esModule",{value:!0});Bh.InlineCompletionFeature=void 0;var PJ=rr(),NJ=e=>class extends e{get inlineCompletion(){return {on:t=>this.connection.onRequest(PJ.InlineCompletionRequest.type,(r,n)=>t(r,n,this.attachWorkDoneProgress(r)))}}};Bh.InlineCompletionFeature=NJ;});var IM=P(kr=>{var DJ=kr&&kr.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i);}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r];}),RM=kr&&kr.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&DJ(t,e,r);};Object.defineProperty(kr,"__esModule",{value:!0});kr.ProposedFeatures=kr.NotebookDocuments=kr.TextDocuments=kr.SemanticTokensBuilder=void 0;var kJ=sb();Object.defineProperty(kr,"SemanticTokensBuilder",{enumerable:!0,get:function(){return kJ.SemanticTokensBuilder}});var OJ=TM();RM(rr(),kr);var LJ=cb();Object.defineProperty(kr,"TextDocuments",{enumerable:!0,get:function(){return LJ.TextDocuments}});var BJ=fb();Object.defineProperty(kr,"NotebookDocuments",{enumerable:!0,get:function(){return BJ.NotebookDocuments}});RM(yb(),kr);var AM;(function(e){e.all={__brand:"features",languages:OJ.InlineCompletionFeature};})(AM||(kr.ProposedFeatures=AM={}));});var LM=P(Bn=>{var FJ=Bn&&Bn.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i);}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r];}),kM=Bn&&Bn.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&FJ(t,e,r);};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.createConnection=Bn.Files=void 0;var PM=he("util"),Cb=Ed(),MJ=yb(),Sc=CM(),ga=wb();kM(wb(),Bn);kM(IM(),Bn);var NM;(function(e){e.uriToFilePath=Sc.uriToFilePath,e.resolveGlobalNodePath=Sc.resolveGlobalNodePath,e.resolveGlobalYarnPath=Sc.resolveGlobalYarnPath,e.resolve=Sc.resolve,e.resolveModulePath=Sc.resolveModulePath;})(NM||(Bn.Files=NM={}));var Oo=!1,OM;function qJ(){let e="--clientProcessId";function t(r){try{let n=parseInt(r);isNaN(n)||(OM=setInterval(()=>{try{process.kill(n,0);}catch{process.exit(Oo?0:1);}},3e3));}catch{}}for(let r=2;r<process.argv.length;r++){let n=process.argv[r];if(n===e&&r+1<process.argv.length){t(process.argv[r+1]);return}else {let i=n.split("=");i[0]===e&&t(i[1]);}}}qJ();var UJ={initialize:e=>{let t=e.processId;Cb.number(t)&&OM===void 0&&setInterval(()=>{try{process.kill(t,0);}catch{process.exit(Oo?0:1);}},3e3);},get shutdownReceived(){return Oo},set shutdownReceived(e){Oo=e;},exit:e=>{process.exit(e);}};function jJ(e,t,r,n){let i,s,a,o;return e!==void 0&&e.__brand==="features"&&(i=e,e=t,t=r,r=n),ga.ConnectionStrategy.is(e)||ga.ConnectionOptions.is(e)?o=e:(s=e,a=t,o=r),$J(s,a,o,i)}Bn.createConnection=jJ;function $J(e,t,r,n){let i=!1;if(!e&&!t&&process.argv.length>2){let c,l,u=process.argv.slice(2);for(let f=0;f<u.length;f++){let h=u[f];if(h==="--node-ipc"){e=new ga.IPCMessageReader(process),t=new ga.IPCMessageWriter(process);break}else if(h==="--stdio"){i=!0,e=process.stdin,t=process.stdout;break}else if(h==="--socket"){c=parseInt(u[f+1]);break}else if(h==="--pipe"){l=u[f+1];break}else {var s=h.split("=");if(s[0]==="--socket"){c=parseInt(s[1]);break}else if(s[0]==="--pipe"){l=s[1];break}}}if(c){let f=(0, ga.createServerSocketTransport)(c);e=f[0],t=f[1];}else if(l){let f=(0, ga.createServerPipeTransport)(l);e=f[0],t=f[1];}}var a="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!e)throw new Error("Connection input stream is not set. "+a);if(!t)throw new Error("Connection output stream is not set. "+a);if(Cb.func(e.read)&&Cb.func(e.on)){let c=e;c.on("end",()=>{process.exit(Oo?0:1);}),c.on("close",()=>{process.exit(Oo?0:1);});}let o=c=>{let l=(0, ga.createProtocolConnection)(e,t,c,r);return i&&VJ(c),l};return (0, MJ.createConnection)(o,UJ,n)}function VJ(e){function t(n){return n.map(i=>typeof i=="string"?i:(0, PM.inspect)(i)).join(" ")}let r=new Map;console.assert=function(i,...s){if(!i)if(s.length===0)e.error("Assertion failed");else {let[a,...o]=s;e.error(`Assertion failed: ${a} ${t(o)}`);}},console.count=function(i="default"){let s=String(i),a=r.get(s)??0;a+=1,r.set(s,a),e.log(`${s}: ${s}`);},console.countReset=function(i){i===void 0?r.clear():r.delete(String(i));},console.debug=function(...i){e.log(t(i));},console.dir=function(i,s){e.log((0, PM.inspect)(i,s));},console.log=function(...i){e.log(t(i));},console.error=function(...i){e.error(t(i));},console.trace=function(...i){let s=new Error().stack.replace(/(.+\n){2}/,""),a="Trace";i.length!==0&&(a+=`: ${t(i)}`),e.log(`${a}
${s}`);},console.warn=function(...i){e.warn(t(i));};}});var FM=P((Ece,BM)=>{BM.exports=LM();});var Nc=new Uint8Array(256),Pc=Nc.length;function Qh(){return Pc>Nc.length-16&&(Nq__default.default.randomFillSync(Nc),Pc=0),Nc.slice(Pc,Pc+=16)}var Sr=[];for(let e=0;e<256;++e)Sr.push((e+256).toString(16).slice(1));function aS(e,t=0){return Sr[e[t+0]]+Sr[e[t+1]]+Sr[e[t+2]]+Sr[e[t+3]]+"-"+Sr[e[t+4]]+Sr[e[t+5]]+"-"+Sr[e[t+6]]+Sr[e[t+7]]+"-"+Sr[e[t+8]]+Sr[e[t+9]]+"-"+Sr[e[t+10]]+Sr[e[t+11]]+Sr[e[t+12]]+Sr[e[t+13]]+Sr[e[t+14]]+Sr[e[t+15]]}var Zh={randomUUID:Nq__default.default.randomUUID};function kq(e,t,r){if(Zh.randomUUID&&!t&&!e)return Zh.randomUUID();e=e||{};let n=e.random||(e.rng||Qh)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let i=0;i<16;++i)t[r+i]=n[i];return t}return aS(n)}var Xn=kq;var oa=ar(Zo());var zi={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};function gU(e,t){return t}function i1(e){return typeof e!="object"||e===null?0:Array.isArray(e)?2:vU(e)?1:e instanceof Set?3:e instanceof Map?4:5}function mU(e){let t=new Set;for(let r of e)for(let n of [...Object.keys(r),...Object.getOwnPropertySymbols(r)])t.add(n);return t}function yU(e,t){return typeof e=="object"&&Object.prototype.propertyIsEnumerable.call(e,t)}function a1(e){return {*[Symbol.iterator](){for(let t of e)for(let r of t)yield r;}}}var s1=new Set(["[object Object]","[object Module]"]);function vU(e){if(!s1.has(Object.prototype.toString.call(e)))return !1;let{constructor:t}=e;if(t===void 0)return !0;let r=t.prototype;return !(r===null||typeof r!="object"||!s1.has(Object.prototype.toString.call(r))||!r.hasOwnProperty("isPrototypeOf"))}function _U(e,t,r){let n={};for(let i of mU(e)){let s=[];for(let c of e)yU(c,i)&&s.push(c[i]);if(s.length===0)continue;let a=t.metaDataUpdater(r,{key:i,parents:e}),o=u1(s,t,a);o!==zi.skip&&(i==="__proto__"?Object.defineProperty(n,i,{value:o,configurable:!0,enumerable:!0,writable:!0}):n[i]=o);}return n}function bU(e){return e.flat()}function SU(e){return new Set(a1(e))}function EU(e){return new Map(a1(e))}function o1(e){return e.at(-1)}var eg=Object.freeze({__proto__:null,mergeArrays:bU,mergeMaps:EU,mergeOthers:o1,mergeRecords:_U,mergeSets:SU});function dl(...e){return wU({})(...e)}function wU(e,t){let r=CU(e,n);function n(...i){return u1(i,r,t)}return n}function CU(e,t){return {defaultMergeFunctions:eg,mergeFunctions:{...eg,...Object.fromEntries(Object.entries(e).filter(([r,n])=>Object.hasOwn(eg,r)).map(([r,n])=>n===!1?[r,o1]:[r,n]))},metaDataUpdater:e.metaDataUpdater??gU,deepmerge:t,useImplicitDefaultMerging:e.enableImplicitDefaultMerging??!1,actions:zi}}function u1(e,t,r){if(e.length===0)return;if(e.length===1)return tg(e,t,r);let n=i1(e[0]);if(n!==0&&n!==5){for(let i=1;i<e.length;i++)if(i1(e[i])!==n)return tg(e,t,r)}switch(n){case 1:return xU(e,t,r);case 2:return TU(e,t,r);case 3:return AU(e,t,r);case 4:return RU(e,t,r);default:return tg(e,t,r)}}function xU(e,t,r){let n=t.mergeFunctions.mergeRecords(e,t,r);return n===zi.defaultMerge||t.useImplicitDefaultMerging&&n===void 0&&t.mergeFunctions.mergeRecords!==t.defaultMergeFunctions.mergeRecords?t.defaultMergeFunctions.mergeRecords(e,t,r):n}function TU(e,t,r){let n=t.mergeFunctions.mergeArrays(e,t,r);return n===zi.defaultMerge||t.useImplicitDefaultMerging&&n===void 0&&t.mergeFunctions.mergeArrays!==t.defaultMergeFunctions.mergeArrays?t.defaultMergeFunctions.mergeArrays(e):n}function AU(e,t,r){let n=t.mergeFunctions.mergeSets(e,t,r);return n===zi.defaultMerge||t.useImplicitDefaultMerging&&n===void 0&&t.mergeFunctions.mergeSets!==t.defaultMergeFunctions.mergeSets?t.defaultMergeFunctions.mergeSets(e):n}function RU(e,t,r){let n=t.mergeFunctions.mergeMaps(e,t,r);return n===zi.defaultMerge||t.useImplicitDefaultMerging&&n===void 0&&t.mergeFunctions.mergeMaps!==t.defaultMergeFunctions.mergeMaps?t.defaultMergeFunctions.mergeMaps(e):n}function tg(e,t,r){let n=t.mergeFunctions.mergeOthers(e,t,r);return n===zi.defaultMerge||t.useImplicitDefaultMerging&&n===void 0&&t.mergeFunctions.mergeOthers!==t.defaultMergeFunctions.mergeOthers?t.defaultMergeFunctions.mergeOthers(e):n}var Xo=e=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")};var rg=new Set(["__proto__","prototype","constructor"]),IU=new Set("0123456789");function ng(e){let t=[],r="",n="start",i=!1;for(let s of e)switch(s){case"\\":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");i&&(r+=s),n="property",i=!i;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(i){i=!1,r+=s;break}if(rg.has(r))return [];t.push(r),r="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(i){i=!1,r+=s;break}if(n==="property"){if(rg.has(r))return [];t.push(r),r="";}n="index";break}case"]":{if(n==="index"){t.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!IU.has(s))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),i&&(i=!1,r+="\\"),r+=s;}}switch(i&&(r+="\\"),n){case"property":{if(rg.has(r))return [];t.push(r);break}case"index":throw new Error("Index was not closed");case"start":{t.push("");break}}return t}function c1(e,t){if(typeof t!="number"&&Array.isArray(e)){let r=Number.parseInt(t,10);return Number.isInteger(r)&&e[r]===e[t]}return !1}function l1(e,t){if(c1(e,t))throw new Error("Cannot use string index")}function hl(e,t,r){if(!Xo(e)||typeof t!="string")return r===void 0?e:r;let n=ng(t);if(n.length===0)return r;for(let i=0;i<n.length;i++){let s=n[i];if(c1(e,s)?e=i===n.length-1?void 0:null:e=e[s],e==null){if(i!==n.length-1)return r;break}}return e===void 0?r:e}function Ls(e,t,r){if(!Xo(e)||typeof t!="string")return e;let n=e,i=ng(t);for(let s=0;s<i.length;s++){let a=i[s];l1(e,a),s===i.length-1?e[a]=r:Xo(e[a])||(e[a]=typeof i[s+1]=="number"?[]:{}),e=e[a];}return n}function pl(e,t){if(!Xo(e)||typeof t!="string")return !1;let r=ng(t);for(let n=0;n<r.length;n++){let i=r[n];if(l1(e,i),n===r.length-1)return delete e[i],!0;if(e=e[i],!Xo(e))return !1}}var PU={"Content-Type":"application/json"};function Bs(e={}){let{fetch:t=globalThis.fetch,querySerializer:r,bodySerializer:n,...i}=e,s=i.baseUrl??"";s.endsWith("/")&&(s=s.slice(0,-1));async function a(o,c){let{fetch:l=t,headers:u,body:f,params:h={},parseAs:p="json",querySerializer:m=r??NU,bodySerializer:_=n??DU,...E}=c||{},w=kU(o,{baseUrl:s,params:h,querySerializer:m}),y=OU(PU,e?.headers,u,h.header),b={redirect:"follow",...i,...E,headers:y};f&&(b.body=_(f)),b.body instanceof FormData&&y.delete("Content-Type");let N=await l(w,b);if(N.status===204||N.headers.get("Content-Length")==="0")return N.ok?{data:{},response:N}:{error:{},response:N};if(N.ok){let V;if(p!=="stream"){let X=N.clone();V=typeof X[p]=="function"?await X[p]():await X.text();}else V=N.clone().body;return {data:V,response:N}}let L={};try{L=await N.clone().json();}catch{L=await N.clone().text();}return {error:L,response:N}}return {async GET(o,...c){return a(o,{...c[0],method:"GET"})},async PUT(o,...c){return a(o,{...c[0],method:"PUT"})},async POST(o,...c){return a(o,{...c[0],method:"POST"})},async DELETE(o,...c){return a(o,{...c[0],method:"DELETE"})},async OPTIONS(o,...c){return a(o,{...c[0],method:"OPTIONS"})},async HEAD(o,...c){return a(o,{...c[0],method:"HEAD"})},async PATCH(o,...c){return a(o,{...c[0],method:"PATCH"})},async TRACE(o,...c){return a(o,{...c[0],method:"TRACE"})}}}function NU(e){let t=new URLSearchParams;if(e&&typeof e=="object")for(let[r,n]of Object.entries(e))n!=null&&t.set(r,n);return t.toString()}function DU(e){return JSON.stringify(e)}function kU(e,t){let r=`${t.baseUrl}${e}`;if(t.params.path)for(let[i,s]of Object.entries(t.params.path))r=r.replace(`{${i}}`,encodeURIComponent(String(s)));let n=t.querySerializer(t.params.query??{});return n&&(r+=`?${n}`),r}function OU(...e){let t=new Headers;for(let r of e){if(!r||typeof r!="object")continue;let n=r instanceof Headers?r.entries():Object.entries(r);for(let[i,s]of n)s===null?t.delete(i):s!==void 0&&t.set(i,s);}return t}var mm=ar(xl()),rR=ar(Zo()),nR=ar(gm());var ym=class extends events.EventEmitter{constructor(r){super();this.filepath=r;this.data={};}async load(){this.data=await mm.default.readJson(vm,{throws:!1})||{};}async save(){await mm.default.outputJson(vm,this.data);}watch(){this.watcher=nR.default.watch(this.filepath,{interval:1e3});let r=async()=>{let n=this.data;await this.load(),(0, rR.default)(n,this.data)||super.emit("updated",this.data);};this.watcher.on("add",r),this.watcher.on("change",r);}},vm=xv__default.default.join(_P__default.default.homedir(),".tabby-client","agent","data.json"),_m=new ym(vm);var cR=ar(oR());function Lt(e){let t=e.match(/.*(?:$|\r?\n)/g)?.filter(Boolean)??[];return t.length>0&&t[t.length-1]?.endsWith(`
`)&&t.push(""),t}function rt(e){return e.trim().length===0}function ni(e,t){if(t===void 0)return e.match(/^[ \t]*/)?.[0]?.length??0;if(t==="	")return e.match(/^\t*/)?.[0].length??0;if(t.match(/^ *$/))return (e.match(/^ */)?.[0].length??0)/t.length;throw new Error(`Invalid indentation: ${t}`)}function Sm(e,t){return t<0||t>=e.length-1?!1:ni(e[t])<ni(e[t+1])}function Wl(e,t){return t<=0||t>e.length-1?!1:ni(e[t-1])>ni(e[t])}var Em=[{open:{chars:"(",reg:/\(/},close:{chars:")",reg:/\)/}},{open:{chars:"[",reg:/\[/},close:{chars:"]",reg:/\]/}},{open:{chars:"{",reg:/\{/},close:{chars:"}",reg:/\}/}},{open:{chars:"<",reg:/<(?=\w)/},close:{chars:"/>",reg:/\/>/}},{open:{chars:"<",reg:/<(?=[/\w])/},close:{chars:">",reg:/>/}},{openOrClose:{chars:'"',reg:/"/}},{openOrClose:{chars:"'",reg:/'/}},{openOrClose:{chars:"`",reg:/`/}}],uR=/^([)\]}>"'`]|(\/>))*$/g;function Kl(e){let t=[],r=0;for(;r<e.length;){let n=e.slice(r),i={index:n.length,found:void 0};if(Em.forEach(s=>{Object.entries(s).forEach(([a,o])=>{let c=n.match(o.reg);c&&c.index!==void 0&&c.index<i.index&&(i={index:c.index,found:{pair:s,pos:a,pattern:o}});});}),!i.found)break;switch(i.found.pos){case"openOrClose":{let s=i.found.pattern.chars;t.length>0&&t.includes(s)?t.splice(t.lastIndexOf(s),t.length-t.lastIndexOf(s)):t.push(s);break}case"open":{t.push(i.found.pattern.chars);break}case"close":{let s=i.found.pair;t.length>0&&"open"in s&&t[t.length-1]===s.open.chars?t.pop():t.push(i.found.pattern.chars);break}}r+=i.index+i.found.pattern.chars.length;}return t}function ja(e,t){return cR.get(e,t)}function vu(e){let t=new AbortController;for(let r of e){if(r?.aborted)return t.abort(r.reason),r;r?.addEventListener("abort",()=>t.abort(r.reason),{signal:t.signal});}return t.signal}var Ir=class extends Error{constructor(r){super(`${r.status} ${r.statusText}`);this.name="HttpError",this.status=r.status,this.statusText=r.statusText,this.response=r;}};function _u(e){return e instanceof Error&&e.name==="TimeoutError"||e instanceof Ir&&[408,499].includes(e.status)}function Ai(e){return e instanceof Error&&e.name==="AbortError"}function wm(e){let t=e.message||e.toString();return e.cause&&(t+=`
Caused by: `+wm(e.cause)),t}function Cm(e){this.message=e;}Cm.prototype=new Error,Cm.prototype.name="InvalidCharacterError";var lR=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new Cm("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,i=0,s=0,a="";n=t.charAt(s++);~n&&(r=i%4?64*r+n:n,i++%4)?a+=String.fromCharCode(255&r>>(-2*i&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return a};function QV(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw "Illegal base64url string!"}try{return function(r){return decodeURIComponent(lR(r).replace(/(.)/g,function(n,i){var s=i.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}(t)}catch{return lR(t)}}function zl(e){this.message=e;}function ZV(e,t){if(typeof e!="string")throw new zl("Invalid token specified");var r=(t=t||{}).header===!0?0:1;try{return JSON.parse(QV(e.split(".")[r]))}catch(n){throw new zl("Invalid token specified: "+n.message)}}zl.prototype=new Error,zl.prototype.name="InvalidTokenError";var Gl=ZV;var N2=ar(Zo());var yf=ar(v2()),I2=ar(T2());var I0=class{constructor(){this.streamOptions={filename:xv__default.default.join(_P__default.default.homedir(),".tabby-client","agent","logs","%DATE%"),frequency:"daily",size:"10M",max_logs:"30d",extension:".log",create_symlink:!0};}write(t){this.stream||(this.stream=I2.getStream(this.streamOptions)),this.stream.write(t);}},A2=new I0,R2={serializers:{error:yf.default.stdSerializers.err}},xu=A2?(0, yf.default)(R2,A2):(0, yf.default)(R2);xu.level="silent";var Au=[xu];xu.onChild=e=>{Au.push(e);};function H7(e){return (...t)=>{let r=t.shift();if(typeof r=="string")e(r,...t);else {let n=t.shift();typeof n=="string"?e(n,...t,r):e(r,n,...t);}}}function W7(e,t){return (r,...n)=>{e(`[${t}] ${r??""}`,...n);}}var P0={loggers:[],child(e){let t=r=>H7(W7((...i)=>{let s=i.shift();this.loggers.forEach(a=>a[r](s,...i));},e));return {error:t("error"),warn:t("warn"),info:t("info"),debug:t("debug"),trace:t("trace")}}};function dr(e){let t=xu.child({component:e}),r=P0.child(e),n=[t,r],i=s=>(...a)=>{let o=a.shift();n.forEach(c=>c[s](o,...a));};return {error:i("error"),warn:i("warn"),info:i("info"),debug:i("debug"),trace:i("trace")}}var N0=class extends Error{constructor(r){super();this.cause=r;this.name="RetryLimitReachedError";}},vf=class e extends events.EventEmitter{constructor(r){super();this.endpoint=r;this.logger=dr("Auth");this.authApi=Bs({baseUrl:"https://app.tabbyml.com/api"});}static{this.authPageUrl="https://app.tabbyml.com/account/device-token";}static{this.tokenStrategy={polling:{interval:5e3,timeout:5*60*1e3},refresh:{interval:15*60*1e3,beforeExpire:30*60*1e3,whenLoaded:{maxTry:5,retryDelay:1e3},whenScheduled:{maxTry:60,retryDelay:30*1e3}}};}async init(r){this.dataStore=r?.dataStore,this.dataStore instanceof events.EventEmitter&&this.dataStore.on("updated",async()=>{let n=this.jwt;await this.load(),(0, N2.default)(n,this.jwt)||super.emit("updated",this.jwt);}),this.scheduleRefreshToken(),await this.load();}get token(){return this.jwt?.token}get user(){return this.jwt?.payload.email}async load(){if(this.dataStore)try{await this.dataStore.load();let r=this.dataStore.data.auth?.[this.endpoint]?.jwt;if(typeof r=="string"&&this.jwt?.token!==r){this.logger.debug({storedJwt:r},"Load jwt from data store.");let n={token:r,payload:Gl(r)};n.payload.exp*1e3-Date.now()<e.tokenStrategy.refresh.beforeExpire?(this.jwt=await this.refreshToken(n,e.tokenStrategy.refresh.whenLoaded),await this.save()):this.jwt=n;}}catch(r){this.logger.debug({error:r},"Error when loading auth");}}async save(){if(this.dataStore)try{if(this.jwt){if(this.dataStore.data.auth?.[this.endpoint]?.jwt===this.jwt.token)return;this.dataStore.data.auth={...this.dataStore.data.auth,[this.endpoint]:{jwt:this.jwt.token}};}else {if(typeof this.dataStore.data.auth?.[this.endpoint]>"u")return;delete this.dataStore.data.auth[this.endpoint];}await this.dataStore.save(),this.logger.debug("Save changes to data store.");}catch(r){this.logger.error({error:r},"Error when saving auth");}}async reset(){this.jwt&&(this.jwt=void 0,await this.save());}async requestAuthUrl(r){try{if(await this.reset(),r?.signal.aborted)throw r.signal.reason;this.logger.debug("Start to request device token");let n=await this.authApi.POST("/device-token",{body:{auth_url:this.endpoint},signal:r?.signal});if(n.error||!n.response.ok)throw new Ir(n.response);let i=n.data;this.logger.debug({deviceToken:i},"Request device token response");let s=new URL(e.authPageUrl);return s.searchParams.append("code",i.data.code),{authUrl:s.toString(),code:i.data.code}}catch(n){throw this.logger.error({error:n},"Error when requesting token"),n}}async pollingToken(r,n){return new Promise((i,s)=>{let a=vu([AbortSignal.timeout(e.tokenStrategy.polling.timeout),n?.signal]),o=setInterval(async()=>{try{let c=await this.authApi.POST("/device-token/accept",{params:{query:{code:r}},signal:a});if(c.error||!c.response.ok)throw new Ir(c.response);let l=c.data;this.logger.debug({result:l},"Poll jwt response"),this.jwt={token:l.data.jwt,payload:Gl(l.data.jwt)},super.emit("updated",this.jwt),await this.save(),clearInterval(o),i(!0);}catch(c){c instanceof Ir&&[400,401,403,405].includes(c.status)?this.logger.debug({error:c},"Expected error when polling jwt"):this.logger.error({error:c},"Error when polling jwt");}},e.tokenStrategy.polling.interval);a.aborted?(clearInterval(o),s(a.reason)):a.addEventListener("abort",()=>{clearInterval(o),s(a.reason);});})}async refreshToken(r,n={maxTry:1,retryDelay:1e3},i=0){try{this.logger.debug({retry:i},"Start to refresh token");let s=await this.authApi.POST("/device-token/refresh",{headers:{Authorization:`Bearer ${r.token}`}});if(s.error||!s.response.ok)throw new Ir(s.response);let a=s.data;return this.logger.debug({refreshedJwt:a},"Refresh token response"),{token:a.data.jwt,payload:Gl(a.data.jwt)}}catch(s){if(s instanceof Ir&&[400,401,403,405].includes(s.status))this.logger.debug({error:s},"Error when refreshing jwt");else if(this.logger.error({error:s},"Unknown error when refreshing jwt"),i<n.maxTry)return this.logger.debug(`Retry refreshing jwt after ${n.retryDelay}ms`),await new Promise(a=>setTimeout(a,n.retryDelay)),this.refreshToken(r,n,i+1);throw new N0(s)}}scheduleRefreshToken(){setInterval(async()=>{if(this.jwt)if(this.jwt.payload.exp*1e3-Date.now()<e.tokenStrategy.refresh.beforeExpire)try{this.jwt=await this.refreshToken(this.jwt,e.tokenStrategy.refresh.whenScheduled),super.emit("updated",this.jwt),await this.save();}catch(r){this.logger.error({error:r},"Error when refreshing jwt");}else this.logger.debug("Check token, still valid");},e.tokenStrategy.refresh.interval);}};var Ru={server:{endpoint:"http://localhost:8080",token:"",requestHeaders:{},requestTimeout:12e4},completion:{prompt:{experimentalStripAutoClosingCharacters:!1,maxPrefixLines:20,maxSuffixLines:20,clipboard:{minChars:3,maxChars:2e3}},debounce:{mode:"adaptive",interval:250}},postprocess:{limitScope:{experimentalSyntax:!1,indentation:{experimentalKeepBlockScopeWhenCompletingLine:!1}},calculateReplaceRange:{experimentalSyntax:!1}},logs:{level:"silent"},tls:{caCerts:"system"},anonymousUsageTracking:{disable:!1}};var D0=ar(xl()),q2=ar(F2()),U2=ar(gm()),j2=ar(Zo());var M2=`## Tabby agent configuration file

## Online documentation: https://tabby.tabbyml.com/docs/extensions/configurations
## You can uncomment and edit the values below to change the default settings.
## Configurations in this file have lower priority than the IDE settings.

## Server
## You can set the server endpoint here and an optional authentication token if required.
# [server]
# endpoint = "http://localhost:8080" # http or https URL
# token = "your-token-here" # if token is set, request header Authorization = "Bearer $token" will be added automatically

## You can add custom request headers.
# [server.requestHeaders]
# Header1 = "Value1" # list your custom headers here
# Header2 = "Value2" # values can be strings, numbers or booleans

## Logs
## You can set the log level here. The log file is located at ~/.tabby-client/agent/logs/.
# [logs]
# level = "silent" # "silent" or "error" or "debug"

## Anonymous usage tracking
## Tabby collects anonymous usage data and sends it to the Tabby team to help improve our products.
## Your code, generated completions, or any sensitive information is never tracked or sent.
## For more details on data collection, see https://tabby.tabbyml.com/docs/extensions/configurations#usage-collection
## Your contribution is greatly appreciated. However, if you prefer not to participate, you can disable anonymous usage tracking here.
# [anonymousUsageTracking]
# disable = false # set to true to disable

`,X7={server:"object","server.endpoint":"string","server.token":"string","server.requestHeaders":"object","server.requestTimeout":"number",completion:"object","completion.prompt":"object","completion.prompt.experimentalStripAutoClosingCharacters":"boolean","completion.prompt.maxPrefixLines":"number","completion.prompt.maxSuffixLines":"number","completion.prompt.clipboard":"object","completion.prompt.clipboard.minChars":"number","completion.prompt.clipboard.maxChars":"number","completion.debounce":"object","completion.debounce.mode":"string","completion.debounce.interval":"number",postprocess:"object","postprocess.limitScopeByIndentation":"object","postprocess.limitScopeByIndentation.experimentalKeepBlockScopeWhenCompletingLine":"boolean",logs:"object","logs.level":"string",tls:"object","tls.caCerts":"string",anonymousUsageTracking:"object","anonymousUsageTracking.disable":"boolean"};function J7(e){for(let[t,r]of Object.entries(X7))typeof hl(e,t)!==r&&pl(e,t);return e}var k0=class extends events.EventEmitter{constructor(r){super();this.filepath=r;this.data={};this.logger=dr("ConfigFile");}get config(){return this.data}async load(){try{let r=await D0.default.readFile(this.filepath,"utf8"),n=q2.default.parse(r);if(Object.keys(n).length===0&&r.trim()!==M2.trim()){await this.createTemplate();return}this.data=J7(n);}catch(r){r instanceof Error&&"code"in r&&r.code==="ENOENT"?await this.createTemplate():this.logger.error({error:r},"Failed to load config file");}}watch(){this.watcher=U2.default.watch(this.filepath,{interval:1e3});let r=async()=>{let n=this.data;await this.load(),(0, j2.default)(n,this.data)||super.emit("updated",this.data);};this.watcher.on("add",r),this.watcher.on("change",r);}async createTemplate(){try{await D0.default.outputFile(this.filepath,M2);}catch(r){this.logger.error({error:r},"Failed to create config template file");}}},ez=xv__default.default.join(_P__default.default.homedir(),".tabby-client","agent","config.toml"),za=new k0(ez);var Iu=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,V2=new Set,O0=typeof process=="object"&&process?process:{},H2=(e,t,r,n)=>{typeof O0.emitWarning=="function"?O0.emitWarning(e,t,r,n):console.error(`[${r}] ${t}: ${e}`);},_f=globalThis.AbortController,$2=globalThis.AbortSignal;if(typeof _f>"u"){$2=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,i){this._onabort.push(i);}},_f=class{constructor(){t();}signal=new $2;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let i of this.signal._onabort)i(n);this.signal.onabort?.(n);}}};let e=O0.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{e&&(e=!1,H2("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",t));};}var tz=e=>!V2.has(e),es=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),W2=e=>es(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?Ga:null:null,Ga=class extends Array{constructor(t){super(t),this.fill(0);}},L0=class e{heap;length;static#u=!1;static create(t){let r=W2(t);if(!r)return [];e.#u=!0;let n=new e(t,r);return e.#u=!1,n}constructor(t,r){if(!e.#u)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0;}push(t){this.heap[this.length++]=t;}pop(){return this.heap[--this.length]}},bf=class e{#u;#f;#v;#p;#I;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#g;#i;#r;#e;#c;#d;#o;#s;#m;#a;#E;#w;#y;#_;#x;#l;static unsafeExposeInternals(t){return {starts:t.#w,ttls:t.#y,sizes:t.#E,keyMap:t.#i,keyList:t.#r,valList:t.#e,next:t.#c,prev:t.#d,get head(){return t.#o},get tail(){return t.#s},free:t.#m,isBackgroundFetch:r=>t.#t(r),backgroundFetch:(r,n,i,s)=>t.#D(r,n,i,s),moveToTail:r=>t.#R(r),indexes:r=>t.#b(r),rindexes:r=>t.#S(r),isStale:r=>t.#h(r)}}get max(){return this.#u}get maxSize(){return this.#f}get calculatedSize(){return this.#g}get size(){return this.#n}get fetchMethod(){return this.#I}get dispose(){return this.#v}get disposeAfter(){return this.#p}constructor(t){let{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:a,updateAgeOnHas:o,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:f,noUpdateTTL:h,maxSize:p=0,maxEntrySize:m=0,sizeCalculation:_,fetchMethod:E,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:y,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:N,ignoreFetchAbort:L}=t;if(r!==0&&!es(r))throw new TypeError("max option must be a nonnegative integer");let V=r?W2(r):Array;if(!V)throw new Error("invalid max value: "+r);if(this.#u=r,this.#f=p,this.maxEntrySize=m||this.#f,this.sizeCalculation=_,this.sizeCalculation){if(!this.#f&&!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(E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#I=E,this.#x=!!E,this.#i=new Map,this.#r=new Array(r).fill(void 0),this.#e=new Array(r).fill(void 0),this.#c=new V(r),this.#d=new V(r),this.#o=0,this.#s=0,this.#m=L0.create(r),this.#n=0,this.#g=0,typeof l=="function"&&(this.#v=l),typeof u=="function"?(this.#p=u,this.#a=[]):(this.#p=void 0,this.#a=void 0),this.#_=!!this.#v,this.#l=!!this.#p,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!N,this.ignoreFetchAbort=!!L,this.maxEntrySize!==0){if(this.#f!==0&&!es(this.#f))throw new TypeError("maxSize must be a positive integer if specified");if(!es(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#M();}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!y,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!o,this.ttlResolution=es(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!es(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k();}if(this.#u===0&&this.ttl===0&&this.#f===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#u&&!this.#f){let X="LRU_CACHE_UNBOUNDED";tz(X)&&(V2.add(X),H2("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",X,e));}}getRemainingTTL(t){return this.#i.has(t)?1/0:0}#k(){let t=new Ga(this.#u),r=new Ga(this.#u);this.#y=t,this.#w=r,this.#O=(s,a,o=Iu.now())=>{if(r[s]=a!==0?o:0,t[s]=a,a!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#h(s)&&this.delete(this.#r[s]);},a+1);c.unref&&c.unref();}},this.#T=s=>{r[s]=t[s]!==0?Iu.now():0;},this.#C=(s,a)=>{if(t[a]){let o=t[a],c=r[a];s.ttl=o,s.start=c,s.now=n||i();let l=s.now-c;s.remainingTTL=o-l;}};let n=0,i=()=>{let s=Iu.now();if(this.ttlResolution>0){n=s;let a=setTimeout(()=>n=0,this.ttlResolution);a.unref&&a.unref();}return s};this.getRemainingTTL=s=>{let a=this.#i.get(s);if(a===void 0)return 0;let o=t[a],c=r[a];if(o===0||c===0)return 1/0;let l=(n||i())-c;return o-l},this.#h=s=>t[s]!==0&&r[s]!==0&&(n||i())-r[s]>t[s];}#T=()=>{};#C=()=>{};#O=()=>{};#h=()=>!1;#M(){let t=new Ga(this.#u);this.#g=0,this.#E=t,this.#A=r=>{this.#g-=t[r],t[r]=0;},this.#L=(r,n,i,s)=>{if(this.#t(n))return 0;if(!es(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(n,r),!es(i))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 i},this.#P=(r,n,i)=>{if(t[r]=n,this.#f){let s=this.#f-t[r];for(;this.#g>s;)this.#N(!0);}this.#g+=t[r],i&&(i.entrySize=n,i.totalCalculatedSize=this.#g);};}#A=t=>{};#P=(t,r,n)=>{};#L=(t,r,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#b({allowStale:t=this.allowStale}={}){if(this.#n)for(let r=this.#s;!(!this.#B(r)||((t||!this.#h(r))&&(yield r),r===this.#o));)r=this.#d[r];}*#S({allowStale:t=this.allowStale}={}){if(this.#n)for(let r=this.#o;!(!this.#B(r)||((t||!this.#h(r))&&(yield r),r===this.#s));)r=this.#c[r];}#B(t){return t!==void 0&&this.#i.get(this.#r[t])===t}*entries(){for(let t of this.#b())this.#e[t]!==void 0&&this.#r[t]!==void 0&&!this.#t(this.#e[t])&&(yield [this.#r[t],this.#e[t]]);}*rentries(){for(let t of this.#S())this.#e[t]!==void 0&&this.#r[t]!==void 0&&!this.#t(this.#e[t])&&(yield [this.#r[t],this.#e[t]]);}*keys(){for(let t of this.#b()){let r=this.#r[t];r!==void 0&&!this.#t(this.#e[t])&&(yield r);}}*rkeys(){for(let t of this.#S()){let r=this.#r[t];r!==void 0&&!this.#t(this.#e[t])&&(yield r);}}*values(){for(let t of this.#b())this.#e[t]!==void 0&&!this.#t(this.#e[t])&&(yield this.#e[t]);}*rvalues(){for(let t of this.#S())this.#e[t]!==void 0&&!this.#t(this.#e[t])&&(yield this.#e[t]);}[Symbol.iterator](){return this.entries()}find(t,r={}){for(let n of this.#b()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;if(s!==void 0&&t(s,this.#r[n],this))return this.get(this.#r[n],r)}}forEach(t,r=this){for(let n of this.#b()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;s!==void 0&&t.call(r,s,this.#r[n],this);}}rforEach(t,r=this){for(let n of this.#S()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;s!==void 0&&t.call(r,s,this.#r[n],this);}}purgeStale(){let t=!1;for(let r of this.#S({allowStale:!0}))this.#h(r)&&(this.delete(this.#r[r]),t=!0);return t}dump(){let t=[];for(let r of this.#b({allowStale:!0})){let n=this.#r[r],i=this.#e[r],s=this.#t(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let a={value:s};if(this.#y&&this.#w){a.ttl=this.#y[r];let o=Iu.now()-this.#w[r];a.start=Math.floor(Date.now()-o);}this.#E&&(a.size=this.#E[r]),t.unshift([n,a]);}return t}load(t){this.clear();for(let[r,n]of t){if(n.start){let i=Date.now()-n.start;n.start=Iu.now()-i;}this.set(r,n.value,n);}}set(t,r,n={}){if(r===void 0)return this.delete(t),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:c}=n,{noUpdateTTL:l=this.noUpdateTTL}=n,u=this.#L(t,r,n.size||0,o);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.delete(t),this;let f=this.#n===0?void 0:this.#i.get(t);if(f===void 0)f=this.#n===0?this.#s:this.#m.length!==0?this.#m.pop():this.#n===this.#u?this.#N(!1):this.#n,this.#r[f]=t,this.#e[f]=r,this.#i.set(t,f),this.#c[this.#s]=f,this.#d[f]=this.#s,this.#s=f,this.#n++,this.#P(f,u,c),c&&(c.set="add"),l=!1;else {this.#R(f);let h=this.#e[f];if(r!==h){if(this.#x&&this.#t(h)?h.__abortController.abort(new Error("replaced")):a||(this.#_&&this.#v?.(h,t,"set"),this.#l&&this.#a?.push([h,t,"set"])),this.#A(f),this.#P(f,u,c),this.#e[f]=r,c){c.set="replace";let p=h&&this.#t(h)?h.__staleWhileFetching:h;p!==void 0&&(c.oldValue=p);}}else c&&(c.set="update");}if(i!==0&&!this.#y&&this.#k(),this.#y&&(l||this.#O(f,i,s),c&&this.#C(c,f)),!a&&this.#l&&this.#a){let h=this.#a,p;for(;p=h?.shift();)this.#p?.(...p);}return this}pop(){try{for(;this.#n;){let t=this.#e[this.#o];if(this.#N(!0),this.#t(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#l&&this.#a){let t=this.#a,r;for(;r=t?.shift();)this.#p?.(...r);}}}#N(t){let r=this.#o,n=this.#r[r],i=this.#e[r];return this.#x&&this.#t(i)?i.__abortController.abort(new Error("evicted")):(this.#_||this.#l)&&(this.#_&&this.#v?.(i,n,"evict"),this.#l&&this.#a?.push([i,n,"evict"])),this.#A(r),t&&(this.#r[r]=void 0,this.#e[r]=void 0,this.#m.push(r)),this.#n===1?(this.#o=this.#s=0,this.#m.length=0):this.#o=this.#c[r],this.#i.delete(n),this.#n--,r}has(t,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=r,s=this.#i.get(t);if(s!==void 0){let a=this.#e[s];if(this.#t(a)&&a.__staleWhileFetching===void 0)return !1;if(this.#h(s))i&&(i.has="stale",this.#C(i,s));else return n&&this.#T(s),i&&(i.has="hit",this.#C(i,s)),!0}else i&&(i.has="miss");return !1}peek(t,r={}){let{allowStale:n=this.allowStale}=r,i=this.#i.get(t);if(i!==void 0&&(n||!this.#h(i))){let s=this.#e[i];return this.#t(s)?s.__staleWhileFetching:s}}#D(t,r,n,i){let s=r===void 0?void 0:this.#e[r];if(this.#t(s))return s;let a=new _f,{signal:o}=n;o?.addEventListener("abort",()=>a.abort(o.reason),{signal:a.signal});let c={signal:a.signal,options:n,context:i},l=(_,E=!1)=>{let{aborted:w}=a.signal,y=n.ignoreFetchAbort&&_!==void 0;if(n.status&&(w&&!E?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,y&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),w&&!y&&!E)return f(a.signal.reason);let b=p;return this.#e[r]===p&&(_===void 0?b.__staleWhileFetching?this.#e[r]=b.__staleWhileFetching:this.delete(t):(n.status&&(n.status.fetchUpdated=!0),this.set(t,_,c.options))),_},u=_=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=_),f(_)),f=_=>{let{aborted:E}=a.signal,w=E&&n.allowStaleOnFetchAbort,y=w||n.allowStaleOnFetchRejection,b=y||n.noDeleteOnFetchRejection,N=p;if(this.#e[r]===p&&(!b||N.__staleWhileFetching===void 0?this.delete(t):w||(this.#e[r]=N.__staleWhileFetching)),y)return n.status&&N.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),N.__staleWhileFetching;if(N.__returned===N)throw _},h=(_,E)=>{let w=this.#I?.(t,s,c);w&&w instanceof Promise&&w.then(y=>_(y),E),a.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(_(),n.allowStaleOnFetchAbort&&(_=y=>l(y,!0)));});};n.status&&(n.status.fetchDispatched=!0);let p=new Promise(h).then(l,u),m=Object.assign(p,{__abortController:a,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(t,m,{...c.options,status:void 0}),r=this.#i.get(t)):this.#e[r]=m,m}#t(t){if(!this.#x)return !1;let r=t;return !!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof _f}async fetch(t,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:_,forceRefresh:E=!1,status:w,signal:y}=r;if(!this.#x)return w&&(w.fetch="get"),this.get(t,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:w});let b={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:a,noDisposeOnSet:o,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:m,ignoreFetchAbort:p,status:w,signal:y},N=this.#i.get(t);if(N===void 0){w&&(w.fetch="miss");let L=this.#D(t,N,b,_);return L.__returned=L}else {let L=this.#e[N];if(this.#t(L)){let ee=n&&L.__staleWhileFetching!==void 0;return w&&(w.fetch="inflight",ee&&(w.returnedStale=!0)),ee?L.__staleWhileFetching:L.__returned=L}let V=this.#h(N);if(!E&&!V)return w&&(w.fetch="hit"),this.#R(N),i&&this.#T(N),w&&this.#C(w,N),L;let X=this.#D(t,N,b,_),G=X.__staleWhileFetching!==void 0&&n;return w&&(w.fetch=V?"stale":"refresh",G&&V&&(w.returnedStale=!0)),G?X.__staleWhileFetching:X.__returned=X}}get(t,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:a}=r,o=this.#i.get(t);if(o!==void 0){let c=this.#e[o],l=this.#t(c);return a&&this.#C(a,o),this.#h(o)?(a&&(a.get="stale"),l?(a&&n&&c.__staleWhileFetching!==void 0&&(a.returnedStale=!0),n?c.__staleWhileFetching:void 0):(s||this.delete(t),a&&n&&(a.returnedStale=!0),n?c:void 0)):(a&&(a.get="hit"),l?c.__staleWhileFetching:(this.#R(o),i&&this.#T(o),c))}else a&&(a.get="miss");}#F(t,r){this.#d[r]=t,this.#c[t]=r;}#R(t){t!==this.#s&&(t===this.#o?this.#o=this.#c[t]:this.#F(this.#d[t],this.#c[t]),this.#F(this.#s,t),this.#s=t);}delete(t){let r=!1;if(this.#n!==0){let n=this.#i.get(t);if(n!==void 0)if(r=!0,this.#n===1)this.clear();else {this.#A(n);let i=this.#e[n];this.#t(i)?i.__abortController.abort(new Error("deleted")):(this.#_||this.#l)&&(this.#_&&this.#v?.(i,t,"delete"),this.#l&&this.#a?.push([i,t,"delete"])),this.#i.delete(t),this.#r[n]=void 0,this.#e[n]=void 0,n===this.#s?this.#s=this.#d[n]:n===this.#o?this.#o=this.#c[n]:(this.#c[this.#d[n]]=this.#c[n],this.#d[this.#c[n]]=this.#d[n]),this.#n--,this.#m.push(n);}}if(this.#l&&this.#a?.length){let n=this.#a,i;for(;i=n?.shift();)this.#p?.(...i);}return r}clear(){for(let t of this.#S({allowStale:!0})){let r=this.#e[t];if(this.#t(r))r.__abortController.abort(new Error("deleted"));else {let n=this.#r[t];this.#_&&this.#v?.(r,n,"delete"),this.#l&&this.#a?.push([r,n,"delete"]);}}if(this.#i.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#y&&this.#w&&(this.#y.fill(0),this.#w.fill(0)),this.#E&&this.#E.fill(0),this.#o=0,this.#s=0,this.#m.length=0,this.#g=0,this.#n=0,this.#l&&this.#a){let t=this.#a,r;for(;r=t?.shift();)this.#p?.(...r);}}};var X2=ar(Z2());function nz(e){return e.trimEnd().match(uR)}var Gs=class{constructor(t){this.filepath=t.filepath,this.language=t.language,this.text=t.text,this.position=t.position,this.indentation=t.indentation,this.prefix=t.text.slice(0,t.position),this.suffix=t.text.slice(t.position),this.prefixLines=Lt(this.prefix),this.suffixLines=Lt(this.suffix),this.currentLinePrefix=this.prefixLines[this.prefixLines.length-1]??"",this.currentLineSuffix=this.suffixLines[0]??"",this.clipboard=t.clipboard?.trim()??"";let r=nz(this.suffixLines[0]??"");this.mode=r?"default":"fill-in-line",this.hash=(0, X2.default)({filepath:this.filepath,language:this.language,text:this.text,position:this.position,clipboard:this.clipboard});}};var Sf=class{constructor(){this.logger=dr("CompletionCache");this.options={maxCount:1e4,prebuildCache:{enabled:!0,perCharacter:{lines:1,max:50},perLine:{max:10},autoClosingPairCheck:{max:3}}};this.cache=new bf({max:this.options.maxCount});}has(t){return this.cache.has(t.hash)}buildCache(t,r){this.logger.debug({key:t,value:r},"Starting to build cache");let n=this.createCacheEntries(t,r);n.forEach(i=>{this.cache.set(i.key.hash,{value:i.value,rebuildFlag:i.rebuildFlag});}),this.logger.debug({newEntries:n.length,cacheSize:this.cache.size},"Cache updated");}get(t){let r=this.cache.get(t.hash);return r?.rebuildFlag&&this.buildCache(t,r?.value),r?.value}createCacheEntries(t,r){let n=[{key:t,value:r,rebuildFlag:!1}];if(this.options.prebuildCache.enabled)for(let s of r.choices){let a=s.text.slice(t.position-s.replaceRange.start),o=this.getPerLinePositions(a);this.logger.trace({completionText:a,perLinePositions:o},"Calculate per-line cache positions");for(let l of o){let u=a.slice(0,l),f=this.generateAutoClosedPrefixes(u);for(let h of [u,...f]){let p={key:new Gs({...t,text:t.text.slice(0,t.position)+h+t.text.slice(t.position),position:t.position+l}),value:{...r,choices:[{index:s.index,text:a.slice(l),replaceRange:{start:t.position+l,end:t.position+l}}]},rebuildFlag:!0};this.logger.trace({prefix:h,entry:p},"Build per-line cache entry"),n.push(p);}}let c=this.getPerCharacterPositions(a);this.logger.trace({completionText:a,perCharacterPositions:c},"Calculate per-character cache positions");for(let l of c){let u=l;for(;u>0&&a[u-1]!==`
`;)u--;let f=a.slice(0,l),h=this.generateAutoClosedPrefixes(f);for(let p of [f,...h]){let m={key:new Gs({...t,text:t.text.slice(0,t.position)+p+t.text.slice(t.position),position:t.position+l}),value:{...r,choices:[{index:s.index,text:a.slice(u),replaceRange:{start:t.position+u,end:t.position+l}}]},rebuildFlag:!1};this.logger.trace({prefix:p,entry:m},"Build per-character cache entry"),n.push(m);}}}return n.reduce((s,a)=>{let o=s.find(c=>c.key.hash===a.key.hash);return o?(o.value.choices.push(...a.value.choices),o.rebuildFlag=o.rebuildFlag||a.rebuildFlag):s.push(a),s},[])}getPerLinePositions(t){let r=[],n=this.options.prebuildCache,i=Lt(t),s=0,a=0;for(;s<i.length-1&&s<n.perLine.max;){a+=i[s]?.length??0,r.push(a-1),r.push(a);let o=a;for(;o<t.length&&t[o].match(/\s/);)o++;r.push(o),s++;}return r}getPerCharacterPositions(t){let r=[],n=this.options.prebuildCache,i=Lt(t).slice(0,n.perCharacter.lines).join(""),s=0;for(;s<i.length&&s<n.perCharacter.max;)r.push(s),s++;return r}generateAutoClosedPrefixes(t){let r=[],n=Kl(t),i=0,s="";for(;i<n.length&&i<this.options.prebuildCache.autoClosingPairCheck.max;)Em.filter(a=>{let o;return "open"in a?o=a.open:o=a.openOrClose,o.chars===n[n.length-1-i]}).forEach(a=>{let o;"close"in a?o=a.close:o=a.openOrClose,s+=o.chars,r.push(t+s);}),i++;return r}};function M0(e,t,r){return Math.max(e,Math.min(t,r))}var Ef=class{constructor(){this.lastCalledTimeStamp=0;this.baseInterval=200;this.calledIntervalHistory=[];this.options={baseIntervalSlideWindowAvg:{minSize:20,maxSize:100,min:100,max:400},adaptiveRate:{min:1.5,max:3},contextScoreWeights:{triggerCharacter:.5,noSuffixInCurrentLine:.4,noSuffix:.1},requestDelay:{min:100,max:1e3}};}async debounce(t,r){let{request:n,config:i,responseTime:s}=t;if(n.manually)return this.sleep(0,r);if(i.mode==="fixed")return this.sleep(i.interval,r);let a=Date.now();this.updateBaseInterval(a-this.lastCalledTimeStamp),this.lastCalledTimeStamp=a;let o=this.calcContextScore(n),l=(this.options.adaptiveRate.max-(this.options.adaptiveRate.max-this.options.adaptiveRate.min)*o)*this.baseInterval,u=M0(this.options.requestDelay.min,this.options.requestDelay.max,l-s);return this.sleep(u,r)}async sleep(t,r){return new Promise((n,i)=>{let s=setTimeout(n,Math.min(t,2147483647));r?.signal&&(r.signal.aborted?(clearTimeout(s),i(r.signal.reason)):r.signal.addEventListener("abort",()=>{clearTimeout(s),i(r.signal.reason);}));})}updateBaseInterval(t){if(!(t>this.options.baseIntervalSlideWindowAvg.max)&&(this.calledIntervalHistory.push(t),this.calledIntervalHistory.length>this.options.baseIntervalSlideWindowAvg.maxSize&&this.calledIntervalHistory.shift(),this.calledIntervalHistory.length>this.options.baseIntervalSlideWindowAvg.minSize)){let r=this.calledIntervalHistory.reduce((n,i)=>n+i,0)/this.calledIntervalHistory.length;this.baseInterval=M0(this.options.baseIntervalSlideWindowAvg.min,this.options.baseIntervalSlideWindowAvg.max,r);}}calcContextScore(t){let r=0,n=this.options.contextScoreWeights,i=t.text[t.position-1]??"";r+=i.match(/^\W*$/)?n.triggerCharacter:0;let s=t.text.slice(t.position)??"",a=Lt(s)[0]??"";return r+=a.match(/^\W*$/)?n.noSuffixInCurrentLine:0,r+=s.match(/^\W*$/)?n.noSuffix:0,r=M0(0,1,r),r}};Array.prototype.distinct||(Array.prototype.distinct=function(e){return [...new Map(this.map(t=>[e?.(t)??t,t])).values()]});Array.prototype.mapAsync||(Array.prototype.mapAsync=async function(e,t){return await Promise.all(this.map((r,n)=>e.call(t,r,n,this)))});var Nt=dr("Postprocess");function Qr(e,t){return q0(async r=>{let n=t.position-r.replaceRange.start,i=r.text.slice(n),s=await e(i,t);return r.text=r.text.slice(0,n)+(s??""),r},t)}function q0(e,t){return async r=>(r.choices=(await r.choices.mapAsync(async n=>await e(n,t))).filter(n=>!!n&&!!n.text).distinct(n=>n.text),r)}function iz(e){return /\n(\s*)\n/g}function J2(){return (e,t)=>{let r=e.split(iz()),n=0,i=2,s=r.length-2;for(;s>=1;){if(rt(r[s])){s--;continue}let a=s-1;for(;a>=0&&rt(r[a]);)a--;if(a<0)break;let o=r[s].trim(),c=r[a].trim(),l=Math.max(.1*o.length,.1*c.length);if(ja(o,c)<=l)n++,s--;else break}return n>=i?(Nt.debug({inputBlocks:r,repetitionCount:n},"Remove repetitive blocks."),r.slice(0,s+1).join("").trimEnd()):e}}function eP(){return e=>{let t=Lt(e),r=0,n=5,i=t.length-2;for(;i>=1;){if(rt(t[i])){i--;continue}let s=i-1;for(;s>=0&&rt(t[s]);)s--;if(s<0)break;let a=t[i].trim(),o=t[s].trim(),c=Math.max(.1*a.length,.1*o.length);if(ja(a,o)<=c)r++,i=s;else break}return r>=n?(Nt.debug({inputLines:t,repetitionCount:r},"Remove repetitive lines."),t.slice(0,i+1).join("").trimEnd()):e}}var sz=[/(.{3,}?)\1{5,}$/g,/(.{10,}?)\1{3,}$/g];function tP(){return e=>{let t=Lt(e),r=t.length-1;for(;r>=0&&rt(t[r]);)r--;if(r<0)return e;for(let n of sz){let i=t[r].match(n);if(i)return Nt.debug({inputLines:t,lineNumber:r,match:i},"Remove line ends with repetition."),r<1?null:t.slice(0,r).join("").trimEnd()}return e}}function rP(){return (e,t)=>{let{suffixLines:r,currentLinePrefix:n}=t,i=Lt(e);if(i.length<2)return e;let s=i.map((l,u)=>u===0?n+l:l);if(!Wl(s,i.length-1))return e;let a=i[i.length-1],o=1;for(;o<r.length&&rt(r[o]);)o++;if(o>=r.length)return e;let c=r[o];return a.startsWith(c.trimEnd())||c.startsWith(a.trimEnd())?(Nt.debug({inputLines:i,suffixLines:r},"Removing duplicated block closing line"),i.slice(0,i.length-1).join("").trimEnd()):e}}function az(e,t,r,n){let i={indentLevelLimit:0,allowClosingLine:!0},{prefixLines:s,suffixLines:a,currentLinePrefix:o}=r;if(e.length==0||s.length==0)return i;let c=rt(o),l=s.length-1;for(;l>=0&&rt(s[l]);)l--;if(l<0)return i;let u=s[l],f=ni(u),h=e[0],p=rt(h),m=0;for(;m<e.length&&rt(e[m]);)m++;if(m>=e.length)return i;let _=e[m],E;p?E=ni(_):E=ni(o+_),!p&&!c?n.experimentalKeepBlockScopeWhenCompletingLine?i.indentLevelLimit=f:(i.indentLevelLimit=f+1,i.allowClosingLine&&=Sm(t,0)):E>f?i.indentLevelLimit=f+1:(i.indentLevelLimit=f);let w=1;for(;w<a.length&&rt(a[w]);)w++;if(w<a.length){let y=a[w];i.allowClosingLine&&=ni(y)<i.indentLevelLimit;}return i}function nP(e){return (t,r)=>{let{prefixLines:n,suffixLines:i,currentLinePrefix:s}=r,a=Lt(t),o=a.map((u,f)=>f===0?s+u:u),c=az(a,o,r,e),l=1;for(;l<a.length;){let u=a[l],f=a[l-1];if(rt(u)){l++;continue}if(ni(u)<c.indentLevelLimit){if(Wl(o,l)&&Sm(o,l)){l++;continue}c.allowClosingLine&&(r.language!=="python"||!rt(f))&&l++;break}l++;}return l<a.length?(Nt.debug({inputLines:a,prefixLines:n,suffixLines:i,scopeLineCount:l},"Remove content out of indent scope"),a.slice(0,l).join("").trimEnd()):t}}var wf=ar(iP());var Qa={javascript:"tsx",typescript:"tsx",javascriptreact:"tsx",typescriptreact:"tsx",python:"python",go:"go",rust:"rust",ruby:"ruby"},aP=!1;async function oz(e){aP||(await wf.default.init({locateFile(n,i){let s=[i,"wasm",n];return xv__default.default.join(...s)}}),aP=!0);let t=new wf.default,r=[__dirname,"wasm",`tree-sitter-${e}.wasm`];return t.setLanguage(await wf.default.Language.load(xv__default.default.join(...r))),t}var oP=new Map;async function Cf(e){let t=oP.get(e);return t||(t=await oz(e),oP.set(e,t)),t}var uP={tsx:[["jsx_element","jsx_self_closing_element","for_statement","for_in_statement","if_statement","while_statement","do_statement","switch_statement","try_statement","with_statement","labeled_statement","class_declaration","abstract_class_declaration","interface_declaration","enum_declaration","type_alias_declaration","function_declaration","generator_function_declaration","ambient_declaration","method_definition","import_statement","export_statement","module"],["expression_statement","lexical_declaration"]],python:[["for_statement","if_statement","while_statement","match_statement","try_statement","with_statement","function_definition","decorated_definition","class_definition","import_statement","import_from_statement"]],go:[["for_statement","if_statement","expression_switch_statement","type_switch_statement","select_statement","labeled_statement","function_declaration","method_declaration","type_declaration","import_declaration","package_clause"]],rust:[["for_expression","if_expression","while_expression","loop_expression","match_expression","try_expression","function_item","type_item","enum_item","struct_item","union_item","trait_item","impl_item","use_declaration"]],ruby:[["for","if","unless","while","until","case","class","singleton_class","method","singleton_method","module"]]};var uz=Object.keys(Qa);function cz(e,t){let r=t-1;for(;r>=0&&e[r]?.match(/\s/);)r--;if(r<0)return 0;let n=e.lastIndexOf(`
`,r);if(n<0)return 0;let s=e.slice(n+1,t).search(/\S/);return n+1+s}function lz(e,t){let r=t;for(;r<e.length&&e[r]?.match(/\s/);)r++;if(r>=e.length)return e.length;let n=e.indexOf(`
`,r);return n<0?e.length:n}function fz(e,t){for(let r of t){let n=e;for(;n;){if(r.includes(n.type))return n;n=n.parent;}}return e}function cP(){return async(e,t)=>{let{position:r,text:n,language:i,prefix:s,suffix:a}=t;if(!uz.includes(i))throw new Error(`Language ${i} is not supported`);let o=Qa[i],c=await Cf(o),l=s+e+a,u=c.parse(l),f=cz(l,r),h=lz(l,r),p=fz(u.rootNode.namedDescendantForIndex(f,h),uP[o]??[]);if(p.type=="ERROR")throw new Error("Cannot determine syntax scope.");return p.endIndex<r+e.length?(Nt.debug({languageConfig:o,text:n,updatedText:l,position:r,lineBegin:f,lineEnd:h,scope:{type:p.type,start:p.startIndex,end:p.endIndex}},"Remove content out of syntax scope"),e.slice(0,p.endIndex-r)):e}}function lP(e){return async(t,r)=>{if(e.experimentalSyntax)try{return await cP()(t,r)}catch(i){Nt.debug({error:i},"Failed to limit scope by syntax parser");}return nP(e.indentation)(t,r)}}function U0(e){let t={"	":0,"  ":0,"    ":0};for(let r of e)if(r.match(/^\t/))t["	"]++;else {let n=r.match(/^ */)?.[0].length??0;n>0&&(n%4===0&&t["    "]++,n%2===0&&t["  "]++);}return t["	"]>0?"	":t["  "]>t["    "]?"  ":t["    "]>0?"    ":null}function dz(e,t){return t==="	"?e.match(/^\t*/)?.[0].length??0:(e.match(/^ */)?.[0].length??0)/t.length}function fP(){return (e,t)=>{let{prefixLines:r,suffixLines:n,currentLinePrefix:i,indentation:s}=t,a=Lt(e);if(!s)return e;let o=rt(i)?r.slice(0,r.length-1):r;if(r.length>1&&U0(o)!==null)return e;let c=n.slice(1);if(n.length>1&&U0(c)!==null)return e;let l=a.map((h,p)=>p===0?i+h:h),u=U0(l);if(u===null||u===s)return e;let f=l.map((h,p)=>{let m=dz(h,u);if(m===0)return a[p];let _=h.slice(u.length*m);return p===0?rt(i)?s.repeat(m).slice(i.length)+_:a[0]:s.repeat(m)+_});return Nt.debug({prefixLines:r,suffixLines:n,inputLines:a,formatted:f},"Format indentation."),f.join("")}}function j0(){return (e,t)=>{let{currentLinePrefix:r,currentLineSuffix:n}=t,i=e;return !rt(r)&&r.match(/\s$/)&&(i=i.trimStart()),(rt(n)||!rt(n)&&n.match(/^\s/))&&(i=i.trimEnd()),i}}function dP(){return (e,t)=>{let r=Lt(e);if(t.mode==="fill-in-line"&&r.length>1){let n=t.currentLineSuffix.trimEnd(),i=r[0].trimEnd();if(i.endsWith(n)){let s=i.slice(0,-n.length);if(s.length>0)return Nt.debug({inputLines:r,trimmedInputLine:s},"Trim content with multiple lines"),s}return Nt.debug({inputLines:r},"Drop content with multiple lines"),null}return e}}function $0(){return (e,t)=>{let{suffixLines:r}=t,n=Lt(e),i=0;for(;i<n.length&&rt(n[i]);)i++;let s=0;for(;s<r.length&&rt(r[s]);)s++;let a=Math.min(3,n.length-i,r.length-s);if(a<1)return e;let o=n.slice(i,i+a).join("").trim(),c=r.slice(s,s+a).join("").trim(),l=Math.max(1,.05*o.length,.05*c.length),u=ja(o,c);return u<=l?(Nt.debug({inputLines:n,suffixLines:r,inputToCompare:o,suffixToCompare:c,distance:u,threshold:l},"Drop completion due to duplicated."),null):e}}function V0(){return e=>rt(e)?null:e}function hP(e,t){let{currentLineSuffix:r}=t,n=r.trimEnd();if(rt(n))return e;let i=e.text.slice(t.position-e.replaceRange.start),s=Kl(i).join("");return rt(s)||(n.startsWith(s)?(e.replaceRange.end=t.position+s.length,Nt.trace({context:t,completion:e.text,range:e.replaceRange,unpaired:s},"Adjust replace range by bracket stack")):s.startsWith(n)&&(e.replaceRange.end=t.position+n.length,Nt.trace({context:t,completion:e.text,range:e.replaceRange,unpaired:s},"Adjust replace range by bracket stack"))),e}var hz=Object.keys(Qa);async function pP(e,t){let{position:r,prefix:n,suffix:i,prefixLines:s,currentLinePrefix:a,currentLineSuffix:o,language:c}=t,l=o.trimEnd();if(rt(l))return e;if(!hz.includes(c))throw new Error(`Language ${c} is not supported`);let u=Qa[c],f=await Cf(u),h=e.text.slice(r-e.replaceRange.start),p=Lt(h),m=0,_=f.parse(n+h+i),E=_.rootNode.namedDescendantForIndex(n.length+h.length,n.length+h.length+l.length-m);for(;E.hasError()&&m<l.length;){m++;let w=s.length-1+p.length-1,y=p[p.length-1]?.length??0;p.length==1&&(y+=a.length),_.edit({startIndex:n.length+h.length,oldEndIndex:n.length+h.length+1,newEndIndex:n.length+h.length,startPosition:{row:w,column:y},oldEndPosition:{row:w,column:y+1},newEndPosition:{row:w,column:y}}),_=f.parse(n+h+i.slice(m),_),E=_.rootNode.namedDescendantForIndex(n.length+h.length,n.length+h.length+l.length-m);}if(E.hasError())throw new Error("Syntax error when parsing completion");return e.replaceRange.end=r+m,Nt.trace({context:t,completion:e.text,range:e.replaceRange},"Adjust replace range by syntax"),e}function gP(e){return async(t,r)=>{if(e.experimentalSyntax)try{return await pP(t,r)}catch(i){Nt.debug({error:i},"Failed to calculate replace range by syntax parser");}return hP(t,r)}}async function mP(e,t,r){return Promise.resolve(r).then(Qr(dP(),e)).then(Qr(tP(),e)).then(Qr($0(),e)).then(Qr(j0(),e)).then(Qr(V0(),e))}async function yP(e,t,r){return Promise.resolve(r).then(Qr(J2(),e)).then(Qr(eP(),e)).then(Qr(lP(t.limitScope),e)).then(Qr(rP(),e)).then(Qr(fP(),e)).then(Qr($0(),e)).then(Qr(j0(),e)).then(Qr(V0(),e)).then(q0(gP(t.calculateReplaceRange),e))}var Nu="tabby-agent",Du="1.4.2";var xf=class{constructor(){this.anonymousUsageTrackingApi=Bs({baseUrl:"https://app.tabbyml.com/api"});this.logger=dr("AnonymousUsage");this.systemData={agent:`${Nu}, ${Du}`,browser:void 0,node:`${process.version} ${process.platform} ${_P__default.default.arch()} ${_P__default.default.release()}`};this.sessionProperties={};this.userProperties={};this.userPropertiesUpdated=!1;this.emittedUniqueEvent=[];this.disabled=!1;}async init(t){if(this.dataStore=t?.dataStore,this.dataStore)if(typeof this.dataStore.data.anonymousId=="string")this.anonymousId=this.dataStore.data.anonymousId;else {this.anonymousId=Xn(),this.dataStore.data.anonymousId=this.anonymousId;try{await this.dataStore.save();}catch(r){this.logger.debug({error:r},"Error when saving anonymousId");}}else this.anonymousId=Xn();}setSessionProperties(t,r){Ls(this.sessionProperties,t,r);}setUserProperties(t,r){Ls(this.userProperties,t,r),this.userPropertiesUpdated=!0;}async uniqueEvent(t,r={}){await this.event(t,r,!0);}async event(t,r={},n=!1){if(this.disabled||!this.anonymousId||n&&this.emittedUniqueEvent.includes(t))return;n&&this.emittedUniqueEvent.push(t);let i={...this.systemData,...this.sessionProperties,...r};this.userPropertiesUpdated&&(Ls(i,"$set",this.userProperties),this.userPropertiesUpdated=!1);try{await this.anonymousUsageTrackingApi.POST("/usage",{body:{distinctId:this.anonymousId,event:t,properties:i}});}catch(s){this.logger.error({error:s},"Error when sending anonymous usage data");}}};var z0=ar(wP()),Tf=class{constructor(){this.sum=0;this.quantity=0;}add(t){this.sum+=t,this.quantity+=1;}mean(){if(this.quantity!==0)return this.sum/this.quantity}count(){return this.quantity}},Af=class{constructor(t){this.values=[];this.maxSize=t;}add(t){this.values.push(t),this.values.length>this.maxSize&&this.values.shift();}getValues(){return this.values}},Rf=class{constructor(){this.config={windowSize:10,checks:{disable:!1,healthy:{windowSize:1,latency:3e3},slowResponseTime:{latency:5e3,count:1},highTimeoutRate:{rate:.5,count:1}}};this.autoCompletionCount=0;this.manualCompletionCount=0;this.cacheHitCount=0;this.cacheMissCount=0;this.eventMap=new Map;this.completionRequestLatencyStats=new z0.Univariate;this.completionRequestCanceledStats=new Tf;this.completionRequestTimeoutCount=0;this.recentCompletionRequestLatencies=new Af(this.config.windowSize);}add(t){let{triggerMode:r,cacheHit:n,aborted:i,requestSent:s,requestLatency:a,requestCanceled:o,requestTimeout:c}=t;i||(r==="auto"?this.autoCompletionCount+=1:this.manualCompletionCount+=1,n?this.cacheHitCount+=1:this.cacheMissCount+=1),s&&(o?this.completionRequestCanceledStats.add(a):c?this.completionRequestTimeoutCount+=1:this.completionRequestLatencyStats.add(a),o||this.recentCompletionRequestLatencies.add(a));}addEvent(t){let r=this.eventMap.get(t)||0;this.eventMap.set(t,r+1);}reset(){this.autoCompletionCount=0,this.manualCompletionCount=0,this.cacheHitCount=0,this.cacheMissCount=0,this.eventMap=new Map,this.completionRequestLatencyStats=new z0.Univariate,this.completionRequestCanceledStats=new Tf,this.completionRequestTimeoutCount=0;}resetWindowed(){this.recentCompletionRequestLatencies=new Af(this.config.windowSize);}stats(){let t=Object.fromEntries(Array.from(this.eventMap.entries()).map(([r,n])=>["count_"+r,n]));return {completion:{count_auto:this.autoCompletionCount,count_manual:this.manualCompletionCount,cache_hit:this.cacheHitCount,cache_miss:this.cacheMissCount,...t},completion_request:{count:this.completionRequestLatencyStats.count(),latency_avg:this.completionRequestLatencyStats.mean(),latency_p50:this.completionRequestLatencyStats.percentile(50),latency_p95:this.completionRequestLatencyStats.percentile(95),latency_p99:this.completionRequestLatencyStats.percentile(99)},completion_request_canceled:{count:this.completionRequestCanceledStats.count(),latency_avg:this.completionRequestCanceledStats.mean()},completion_request_timeout:{count:this.completionRequestTimeoutCount}}}windowed(){let t=this.recentCompletionRequestLatencies.getValues(),r=t.filter(s=>Number.isNaN(s)),n=t.filter(s=>!Number.isNaN(s)),i=n.reduce((s,a)=>s+a,0)/n.length;return {values:t,stats:{total:t.length,timeouts:r.length,responses:n.length,averageResponseTime:i}}}check(t){if(this.config.checks.disable)return null;let r=this.config.checks,{values:n,stats:{total:i,timeouts:s,responses:a,averageResponseTime:o}}=t;return n.slice(-Math.min(this.config.windowSize,r.healthy.windowSize)).every(c=>c<r.healthy.latency)?"healthy":s/i>r.highTimeoutRate.rate&&s>=r.highTimeoutRate.count?"highTimeoutRate":o>r.slowResponseTime.latency&&a>=r.slowResponseTime.count?"slowResponseTime":null}};var uO=ar(xl()),Tv=ar(wv()),cO=ar(sO());var _d=dr("CaCert"),vd=[],Cv;function lO(e){Cv||(Cv=aO__default.default.createSecureContext);let t=e.filter(n=>typeof n=="string"?n.trim().length>0:!0),r=[...vd,...t].distinct();_d.debug(`Loaded ${r.length-vd.length} extra certs.`),vd=r,aO__default.default.createSecureContext=n=>{let i=Cv(n);return vd.forEach(s=>{i.context.addCACert(s);}),i};}async function oO(e){_d.debug(`Loading extra certs from ${e}.`);let t=(await e.split(xv__default.default.delimiter).mapAsync(async r=>{try{return (await uO.default.readFile(r)).toString()}catch{return null}})).join(`
`).split(/(?=-----BEGIN\sCERTIFICATE-----)/g).distinct();lO(t);}async function fO(e){if(e.caCerts!=="bundled")if(e.caCerts==="system")if(process.platform==="win32")_d.debug("Loading extra certs from win-ca."),Tv.default.exe(xv__default.default.join("win-ca","roots.exe")),(0, Tv.default)({fallback:!0,inject:"+"});else if(process.platform==="darwin"){_d.debug("Loading extra certs from mac-ca.");let t=cO.get();lO(t);}else await oO(xv__default.default.join("/etc/ssl/certs/ca-certificates.crt"));else e.caCerts&&await oO(e.caCerts);}var bd=class e extends events.EventEmitter{constructor(){super();this.logger=dr("TabbyAgent");this.anonymousUsageLogger=new xf;this.config=Ru;this.userConfig={};this.clientConfig={};this.serverProvidedConfig={};this.status="notInitialized";this.issues=[];this.completionCache=new Sf;this.completionDebounce=new Ef;this.completionProviderStats=new Rf;this.tryingConnectTimer=setInterval(async()=>{this.status==="disconnected"&&(this.logger.debug("Trying to connect..."),await this.healthCheck());},e.tryConnectInterval),this.submitStatsTimer=setInterval(async()=>{await this.submitStats();},e.submitStatsInterval);}static{this.tryConnectInterval=1e3*30;}static{this.submitStatsInterval=1e3*60*60*24;}async applyConfig(){let r=this.config,n=this.status;this.config=dl(Ru,this.userConfig,this.clientConfig,this.serverProvidedConfig),Au.forEach(s=>s.level=this.config.logs.level),this.anonymousUsageLogger.disabled=this.config.anonymousUsageTracking.disable,await fO(this.config.tls),rt(this.config.server.token)&&this.config.server.requestHeaders.Authorization===void 0?this.config.server.endpoint!==this.auth?.endpoint&&(this.auth=new vf(this.config.server.endpoint),await this.auth.init({dataStore:this.dataStore}),this.auth.on("updated",()=>{this.setupApi();})):this.auth=void 0,(0, oa.default)(r.server,this.config.server)||(this.serverHealthState=void 0,this.completionProviderStats.resetWindowed(),this.popIssue("slowCompletionResponseTime"),this.popIssue("highCompletionTimeoutRate"),this.popIssue("connectionFailed"),this.connectionErrorMessage=void 0),(!this.api||!(0, oa.default)(r.server,this.config.server))&&(await this.setupApi(),this.fetchServerConfig()),(0, oa.default)(r.server,this.config.server)||n==="unauthorized"&&this.status==="unauthorized"&&this.emitAuthRequired();let i={event:"configUpdated",config:this.config};this.logger.debug({event:i},"Config updated"),super.emit("configUpdated",i);}async setupApi(){let r=rt(this.config.server.token)?this.auth?.token?`Bearer ${this.auth.token}`:void 0:`Bearer ${this.config.server.token}`;this.api=Bs({baseUrl:this.config.server.endpoint.replace(/\/+$/,""),headers:{Authorization:r,...this.config.server.requestHeaders}}),await this.healthCheck();}changeStatus(r){if(this.status!=r){this.status=r;let n={event:"statusChanged",status:r};this.logger.debug({event:n},"Status changed"),super.emit("statusChanged",n),this.status==="unauthorized"&&this.emitAuthRequired();}}issueFromName(r){switch(r){case"highCompletionTimeoutRate":return {name:"highCompletionTimeoutRate",completionResponseStats:this.completionProviderStats.windowed().stats};case"slowCompletionResponseTime":return {name:"slowCompletionResponseTime",completionResponseStats:this.completionProviderStats.windowed().stats};case"connectionFailed":return {name:"connectionFailed",message:this.connectionErrorMessage}}}pushIssue(r){this.issues.includes(r)||(this.issues.push(r),this.logger.debug({issue:r},"Issues Pushed"),this.emitIssueUpdated());}popIssue(r){let n=this.issues.indexOf(r);n>=0&&(this.issues.splice(n,1),this.logger.debug({issue:r},"Issues Popped"),this.emitIssueUpdated());}emitAuthRequired(){let r={event:"authRequired",server:this.config.server};super.emit("authRequired",r);}emitIssueUpdated(){let r={event:"issuesUpdated",issues:this.issues};super.emit("issuesUpdated",r);}async submitStats(){let r=this.completionProviderStats.stats();r.completion_request.count>0&&(await this.anonymousUsageLogger.event("AgentStats",{stats:r}),this.completionProviderStats.reset(),this.logger.debug({stats:r},"Stats submitted"));}createAbortSignal(r){let n=Math.min(2147483647,r?.timeout||this.config.server.requestTimeout);return vu([AbortSignal.timeout(n),r?.signal])}async healthCheck(r){let n=Xn(),i="/v1/health",s=this.config.server.endpoint+i,a={signal:this.createAbortSignal({signal:r?.signal})};try{if(!this.api)throw new Error("http client not initialized");this.logger.debug({requestId:n,requestOptions:a,url:s},"Health check request");let o;if(r?.method==="POST"?o=await this.api.POST(i,a):o=await this.api.GET(i,a),o.error||!o.response.ok)throw new Ir(o.response);this.logger.debug({requestId:n,response:o},"Health check response"),this.changeStatus("ready"),this.popIssue("connectionFailed"),this.connectionErrorMessage=void 0;let c=o.data;typeof c=="object"&&c.model!==void 0&&c.device!==void 0&&(this.serverHealthState=c,this.anonymousUsageLogger.uniqueEvent("AgentConnected",c),this.fetchServerConfig());}catch(o){if(this.serverHealthState=void 0,o instanceof Ir&&o.status==405&&r?.method!=="POST")return await this.healthCheck({method:"POST"});if(o instanceof Ir&&[401,403].includes(o.status))this.logger.debug({requestId:n,error:o},"Health check error: unauthorized"),this.changeStatus("unauthorized");else {if(_u(o))this.logger.debug({requestId:n,error:o},"Health check error: timeout"),this.connectionErrorMessage=`GET ${s}: Timed out.`;else if(Ai(o))this.logger.debug({requestId:n,error:o},"Health check error: canceled"),this.connectionErrorMessage=`GET ${s}: Canceled.`;else {this.logger.error({requestId:n,error:o},"Health check error: unknown error");let c=o instanceof Error?wm(o):JSON.stringify(o);this.connectionErrorMessage=`GET ${s}: Request failed: 
${c}`;}this.pushIssue("connectionFailed"),this.changeStatus("disconnected");}}}async fetchServerConfig(){let r=Xn();try{if(!this.api)throw new Error("http client not initialized");let n="/v1beta/server_setting";this.logger.debug({requestId:r,url:this.config.server.endpoint+n},"Fetch server config request");let i=await this.api.GET(n);if(i.error||!i.response.ok)throw new Ir(i.response);this.logger.debug({requestId:r,response:i},"Fetch server config response");let s=i.data,a={};if(s.disable_client_side_telemetry&&(a.anonymousUsageTracking={disable:!0}),!(0, oa.default)(a,this.serverProvidedConfig)&&(this.serverProvidedConfig=a,await this.applyConfig(),this.dataStore)){this.dataStore.data.serverConfig||(this.dataStore.data.serverConfig={}),this.dataStore.data.serverConfig[this.config.server.endpoint]=this.serverProvidedConfig;try{await this.dataStore.save();}catch(o){this.logger.error({error:o},"Error when saving serverConfig");}}}catch(n){this.logger.error({requestId:r,error:n},"Fetch server config error");}}createSegments(r){let n=this.config.completion.prompt.maxPrefixLines,i=this.config.completion.prompt.maxSuffixLines,{prefixLines:s,suffixLines:a}=r,o=s.slice(Math.max(s.length-n,0)).join(""),c;this.config.completion.prompt.experimentalStripAutoClosingCharacters&&r.mode!=="fill-in-line"?c=`
`+a.slice(1,i).join(""):c=a.slice(0,i).join("");let l,u=this.config.completion.prompt.clipboard;return r.clipboard.length>=u.minChars&&r.clipboard.length<=u.maxChars&&(l=r.clipboard),{prefix:o,suffix:c,clipboard:l}}async initialize(r){if(r.loggers&&(P0.loggers=r.loggers),this.dataStore=r.dataStore??_m,this.dataStore)try{await this.dataStore.load(),"watch"in this.dataStore&&typeof this.dataStore.watch=="function"&&this.dataStore.watch();}catch(n){this.logger.debug({error:n},"No stored data loaded.");}if(await this.anonymousUsageLogger.init({dataStore:this.dataStore}),r.clientProperties){let{user:n,session:i}=r.clientProperties;Au.forEach(s=>s.setBindings?.({...i})),i&&Object.entries(i).forEach(([s,a])=>{this.anonymousUsageLogger.setSessionProperties(s,a);}),n&&Object.entries(n).forEach(([s,a])=>{this.anonymousUsageLogger.setUserProperties(s,a);});}if(za&&(await za.load(),this.userConfig=za.config,za.on("updated",async n=>{this.userConfig=n,await this.applyConfig();}),za.watch()),r.config&&(this.clientConfig=r.config),this.dataStore){let n=dl(Ru,this.userConfig,this.clientConfig);this.serverProvidedConfig=this.dataStore?.data.serverConfig?.[n.server.endpoint]??{},this.dataStore instanceof events.EventEmitter&&this.dataStore.on("updated",async()=>{let i=dl(Ru,this.userConfig,this.clientConfig),s=_m?.data.serverConfig?.[i.server.endpoint];(0, oa.default)(s,this.serverProvidedConfig)||(this.serverProvidedConfig=s??{},await this.applyConfig());});}return await this.applyConfig(),await this.anonymousUsageLogger.uniqueEvent("AgentInitialized"),this.logger.debug({options:r},"Initialized"),this.status!=="notInitialized"}async finalize(){return this.status==="finalized"?!1:(await this.submitStats(),this.tryingConnectTimer&&clearInterval(this.tryingConnectTimer),this.submitStatsTimer&&clearInterval(this.submitStatsTimer),this.changeStatus("finalized"),!0)}async updateClientProperties(r,n,i){switch(r){case"session":Au.forEach(s=>s.setBindings?.(Ls({},n,i))),this.anonymousUsageLogger.setSessionProperties(n,i);break;case"user":this.anonymousUsageLogger.setUserProperties(n,i);break}return !0}async updateConfig(r,n){let i=hl(this.clientConfig,r);return (0, oa.default)(i,n)||(n===void 0?pl(this.clientConfig,r):Ls(this.clientConfig,r,n),await this.applyConfig()),!0}async clearConfig(r){return await this.updateConfig(r,void 0)}getConfig(){return this.config}getStatus(){return this.status}getIssues(){return this.issues}getIssueDetail(r){let n=this.getIssues();return r.index!==void 0&&r.index<n.length?this.issueFromName(n[r.index]):r.name!==void 0&&this.issues.includes(r.name)?this.issueFromName(r.name):null}getServerHealthState(){return this.serverHealthState??null}async requestAuthUrl(r){if(this.status==="notInitialized")throw new Error("Agent is not initialized");return await this.healthCheck(r),this.status!=="unauthorized"||!this.auth?null:await this.auth.requestAuthUrl(r)}async waitForAuthToken(r,n){if(this.status==="notInitialized")throw new Error("Agent is not initialized");this.status!=="unauthorized"||!this.auth||(await this.auth.pollingToken(r,n),await this.setupApi());}async provideCompletions(r,n){if(this.status==="notInitialized")throw new Error("Agent is not initialized");this.logger.trace({request:r},"Call provideCompletions"),this.nonParallelProvideCompletionAbortController&&this.nonParallelProvideCompletionAbortController.abort(),this.nonParallelProvideCompletionAbortController=new AbortController;let i=vu([this.nonParallelProvideCompletionAbortController.signal,n?.signal]),s,a={triggerMode:r.manually?"manual":"auto",cacheHit:!1,aborted:!1,requestSent:!1,requestLatency:0,requestCanceled:!1,requestTimeout:!1},o,c=new Gs(r);try{if(this.completionCache.has(c))a.cacheHit=!0,this.logger.debug({context:c},"Completion cache hit"),await this.completionDebounce.debounce({request:r,config:this.config.completion.debounce,responseTime:0},{signal:i}),s=this.completionCache.get(c);else {a.cacheHit=!1;let l=this.createSegments(c);if(rt(l.prefix))a=void 0,this.logger.debug("Segment prefix is blank, returning empty completion response"),s={id:"agent-"+Xn(),choices:[]};else {await this.completionDebounce.debounce({request:r,config:this.config.completion.debounce,responseTime:this.completionProviderStats.windowed().stats.averageResponseTime},n);let u=Xn();a.requestSent=!0,o=performance.now();try{if(!this.api)throw new Error("http client not initialized");let f="/v1/completions",h={body:{language:r.language,segments:l,user:this.auth?.user},signal:this.createAbortSignal({signal:i})};this.logger.debug({requestId:u,requestOptions:h,url:this.config.server.endpoint+f},"Completion request");let p=await this.api.POST(f,h);if(p.error||!p.response.ok)throw new Ir(p.response);this.logger.debug({requestId:u,response:p},"Completion response");let m=p.data;a.requestLatency=performance.now()-o,s={id:m.id,choices:m.choices.map(_=>({index:_.index,text:_.text,replaceRange:{start:r.position,end:r.position}}))};}catch(f){throw Ai(f)?(this.logger.debug({requestId:u,error:f},"Completion request canceled"),a.requestCanceled=!0,a.requestLatency=performance.now()-o):_u(f)?(this.logger.debug({requestId:u,error:f},"Completion request timeout"),a.requestTimeout=!0,a.requestLatency=NaN):(this.logger.error({requestId:u,error:f},"Completion request failed with unknown error"),this.healthCheck()),f}if(s=await mP(c,this.config.postprocess,s),i.aborted)throw i.reason;this.completionCache.buildCache(c,JSON.parse(JSON.stringify(s)));}}if(s=await yP(c,this.config.postprocess,s),i.aborted)throw i.reason}catch(l){throw Ai(l)||_u(l)?a&&(a.aborted=!0):a=void 0,l}finally{if(a&&(this.completionProviderStats.add(a),a.requestSent&&!a.requestCanceled)){let l=this.completionProviderStats.windowed();switch(this.completionProviderStats.check(l)){case"healthy":this.popIssue("slowCompletionResponseTime"),this.popIssue("highCompletionTimeoutRate");break;case"highTimeoutRate":this.popIssue("slowCompletionResponseTime"),this.pushIssue("highCompletionTimeoutRate");break;case"slowResponseTime":this.popIssue("highCompletionTimeoutRate"),this.pushIssue("slowCompletionResponseTime");break}}}return this.logger.trace({context:c,completionResponse:s},"Return from provideCompletions"),s}async postEvent(r,n){if(this.status==="notInitialized")throw new Error("Agent is not initialized");this.completionProviderStats.addEvent(r.type);let i=Xn();try{if(!this.api)throw new Error("http client not initialized");let s="/v1/events",a={body:r,params:{query:{select_kind:r.select_kind}},signal:this.createAbortSignal(n),parseAs:"text"};this.logger.debug({requestId:i,requestOptions:a,url:this.config.server.endpoint+s},"Event request");let o=await this.api.POST(s,a);if(o.error||!o.response.ok)throw new Ir(o.response);return this.logger.debug({requestId:i,response:o},"Event response"),!0}catch(s){return _u(s)?this.logger.debug({requestId:i,error:s},"Event request timeout"):Ai(s)?this.logger.debug({requestId:i,error:s},"Event request canceled"):this.logger.error({requestId:i,error:s},"Event request failed with unknown error"),!1}}};var hO=["statusChanged","configUpdated","authRequired","issuesUpdated"];var Sd=class{constructor(){this.process=process;this.inStream=process.stdin;this.outStream=process.stdout;this.logger=dr("JsonLineServer");this.abortControllers={};}async handleLine(t){let r;try{r=JSON.parse(t);}catch(i){this.logger.error({error:i},`Failed to parse request: ${t}`);return}this.logger.debug({request:r},"Received request");let n=await this.handleRequest(r);this.sendResponse(n),this.logger.debug({response:n},"Sent response");}async handleRequest(t){let r=0,n=[0,null],i=new AbortController;try{if(!this.agent)throw new Error(`Agent not bound.
`);r=t[0],n[0]=r;let s=t[1].func;if(s==="cancelRequest")n[1]=this.cancelRequest(t);else {let a=this.agent[s];if(!a)throw new Error(`Unknown function: ${s}`);let o=t[1].args;o.length>0&&typeof o[o.length-1]=="object"&&o[o.length-1].signal&&(this.abortControllers[r]=i,o[o.length-1].signal=i.signal),n[1]=await a.apply(this.agent,o);}}catch(s){Ai(s)?this.logger.debug({error:s,request:t},"Request canceled"):this.logger.error({error:s,request:t},"Failed to handle request");}finally{this.abortControllers[r]&&delete this.abortControllers[r];}return n}cancelRequest(t){let r=t[1].args[0],n=this.abortControllers[r];return n?(n.abort(),!0):!1}sendResponse(t){this.outStream.write(JSON.stringify(t)+`
`);}bind(t){this.agent=t;for(let r of hO)this.agent.on(r,n=>{this.sendResponse([0,n]);});}listen(){RZ__default.default.createInterface({input:this.inStream}).on("line",t=>{this.handleLine(t);}),["SIGTERM","SIGINT"].forEach(t=>{this.process.on(t,async()=>{this.agent&&this.agent.getStatus()!=="finalized"&&await this.agent.finalize(),this.process.exit(0);});});}};var bi=ar(FM());var Mh=class e{constructor(t,r,n,i){this._uri=t,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0;}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){let r=this.offsetAt(t.start),n=this.offsetAt(t.end);return this._content.substring(r,n)}return this._content}update(t,r){for(let n of t)if(e.isIncremental(n)){let i=qM(n.range),s=this.offsetAt(i.start),a=this.offsetAt(i.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(a,this._content.length);let o=Math.max(i.start.line,0),c=Math.max(i.end.line,0),l=this._lineOffsets,u=MM(n.text,!1,s);if(c-o===u.length)for(let h=0,p=u.length;h<p;h++)l[h+o+1]=u[h];else u.length<1e4?l.splice(o+1,c-o,...u):this._lineOffsets=l=l.slice(0,o+1).concat(u,l.slice(c+1));let f=n.text.length-(a-s);if(f!==0)for(let h=o+1+u.length,p=l.length;h<p;h++)l[h]=l[h]+f;}else if(e.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=r;}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=MM(this._content,!0)),this._lineOffsets}positionAt(t){t=Math.max(Math.min(t,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return {line:0,character:t};for(;n<i;){let a=Math.floor((n+i)/2);r[a]>t?i=a:n=a+1;}let s=n-1;return {line:s,character:t-r[s]}}offsetAt(t){let r=this.getLineOffsets();if(t.line>=r.length)return this._content.length;if(t.line<0)return 0;let n=r[t.line],i=t.line+1<r.length?r[t.line+1]:this._content.length;return Math.max(Math.min(n+t.character,i),n)}get lineCount(){return this.getLineOffsets().length}static isIncremental(t){let r=t;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(t){let r=t;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},qh;(function(e){function t(i,s,a,o){return new Mh(i,s,a,o)}e.create=t;function r(i,s,a){if(i instanceof Mh)return i.update(s,a),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}e.update=r;function n(i,s){let a=i.getText(),o=xb(s.map(HJ),(u,f)=>{let h=u.range.start.line-f.range.start.line;return h===0?u.range.start.character-f.range.start.character:h}),c=0,l=[];for(let u of o){let f=i.offsetAt(u.range.start);if(f<c)throw new Error("Overlapping edit");f>c&&l.push(a.substring(c,f)),u.newText.length&&l.push(u.newText),c=i.offsetAt(u.range.end);}return l.push(a.substr(c)),l.join("")}e.applyEdits=n;})(qh||(qh={}));function xb(e,t){if(e.length<=1)return e;let r=e.length/2|0,n=e.slice(0,r),i=e.slice(r);xb(n,t),xb(i,t);let s=0,a=0,o=0;for(;s<n.length&&a<i.length;)t(n[s],i[a])<=0?e[o++]=n[s++]:e[o++]=i[a++];for(;s<n.length;)e[o++]=n[s++];for(;a<i.length;)e[o++]=i[a++];return e}function MM(e,t,r=0){let n=t?[r]:[];for(let i=0;i<e.length;i++){let s=e.charCodeAt(i);(s===13||s===10)&&(s===13&&i+1<e.length&&e.charCodeAt(i+1)===10&&i++,n.push(r+i+1));}return n}function qM(e){let t=e.start,r=e.end;return t.line>r.line||t.line===r.line&&t.character>r.character?{start:r,end:t}:e}function HJ(e){let t=qM(e.range);return t!==e.range?{newText:e.newText,range:t}:e}var Uh=class{constructor(){this.connection=(0, bi.createConnection)();this.documents=new bi.TextDocuments(qh);this.logger=dr("LspServer");this.connection.onInitialize(async t=>await this.initialize(t)),this.connection.onShutdown(async()=>await this.shutdown()),this.connection.onExit(async()=>this.exit()),this.connection.onCompletion(async t=>await this.completion(t));}bind(t){this.agent=t,this.agent.on("statusChanged",r=>{(r.status==="disconnected"||r.status==="unauthorized")&&this.showMessage({type:bi.MessageType.Warning,message:`Tabby agent status: ${r.status}`});});}listen(){this.documents.listen(this.connection),this.connection.listen();}async initialize(t){if(this.logger.debug({params:t},"LSP: initialize: request"),!this.agent)throw new Error(`Agent not bound.
`);let{clientInfo:r,capabilities:n}=t;return await this.agent.initialize({clientProperties:{session:{client:`${r?.name} ${r?.version??""}`,ide:{name:r?.name,version:r?.version},tabby_plugin:{name:`${Nu} (LSP)`,version:Du}}}}),{capabilities:{textDocumentSync:{openClose:!0,change:bi.TextDocumentSyncKind.Incremental},completionProvider:{}},serverInfo:{name:Nu,version:Du}}}async shutdown(){if(this.logger.debug("LSP: shutdown: request"),!this.agent)throw new Error(`Agent not bound.
`);await this.agent.finalize();}exit(){return this.logger.debug("LSP: exit: request"),process.exit(0)}async showMessage(t){this.logger.debug({params:t},"LSP server notification: window/showMessage"),await this.connection.sendNotification("window/showMessage",t);}async completion(t){if(this.logger.debug({params:t},"LSP: textDocument/completion: request"),!this.agent)throw new Error(`Agent not bound.
`);try{let r=this.buildCompletionRequest(t),n=await this.agent.provideCompletions(r),i=this.toCompletionList(n,t);return this.logger.debug({completionList:i},"LSP: textDocument/completion: response"),i}catch(r){Ai(r)?this.logger.debug({error:r},"LSP: textDocument/completion: canceled"):this.logger.error({error:r},"LSP: textDocument/completion: error");}return {isIncomplete:!0,items:[]}}buildCompletionRequest(t,r=!1){let{textDocument:n,position:i}=t,s=this.documents.get(n.uri);return {filepath:s.uri,language:s.languageId,text:s.getText(),position:s.offsetAt(i),manually:r}}toCompletionList(t,r){let{textDocument:n,position:i}=r,s=this.documents.get(n.uri),a=s.getText({start:{line:i.line,character:0},end:i}),o=a.match(/(\w+)$/)?.[0]??"";return {isIncomplete:!0,items:t.choices.map(c=>{let l=c.text.slice(s.offsetAt(i)-c.replaceRange.start),u=Lt(l),f=u[0]||"",h=u[1]||"";return {label:o+f,labelDetails:{detail:h,description:"Tabby"},kind:bi.CompletionItemKind.Text,documentation:{kind:"markdown",value:`\`\`\`
${a+l}
\`\`\`
 ---
Suggested by Tabby.`},textEdit:{newText:o+l,range:{start:{line:i.line,character:i.character-o.length},end:s.positionAt(c.replaceRange.end)}},data:{completionId:t.id,choiceIndex:c.index}}})}}};var WJ=process.argv.slice(2),jh;WJ.indexOf("--lsp")>=0?jh=new Uh:jh=new Sd;var KJ=new bd;jh.bind(KJ);jh.listen();
/*! Bundled license information:

normalize-path/index.js:
  (*!
   * normalize-path <https://github.com/jonschlinkert/normalize-path>
   *
   * Copyright (c) 2014-2018, Jon Schlinkert.
   * Released under the MIT License.
   *)

is-extglob/index.js:
  (*!
   * is-extglob <https://github.com/jonschlinkert/is-extglob>
   *
   * Copyright (c) 2014-2016, Jon Schlinkert.
   * Licensed under the MIT License.
   *)

is-glob/index.js:
  (*!
   * is-glob <https://github.com/jonschlinkert/is-glob>
   *
   * Copyright (c) 2014-2017, Jon Schlinkert.
   * Released under the MIT License.
   *)

is-number/index.js:
  (*!
   * is-number <https://github.com/jonschlinkert/is-number>
   *
   * Copyright (c) 2014-present, Jon Schlinkert.
   * Released under the MIT License.
   *)

to-regex-range/index.js:
  (*!
   * to-regex-range <https://github.com/micromatch/to-regex-range>
   *
   * Copyright (c) 2015-present, Jon Schlinkert.
   * Released under the MIT License.
   *)

fill-range/index.js:
  (*!
   * fill-range <https://github.com/jonschlinkert/fill-range>
   *
   * Copyright (c) 2014-present, Jon Schlinkert.
   * Licensed under the MIT License.
   *)
*/
//# sourceMappingURL=out.js.map
//# sourceMappingURL=cli.js.map