@liflig/cdk-cloudfront-auth 1.10.21 → 1.10.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,14 @@
1
- var ef=Object.create;var{getPrototypeOf:tf,defineProperty:Be,getOwnPropertyNames:gi,getOwnPropertyDescriptor:rf}=Object,Ir=Object.prototype.hasOwnProperty;function yi(e){return this[e]}var nf,sf,Cr=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var i=t?nf??=new WeakMap:sf??=new WeakMap,s=i.get(e);if(s)return s}r=e!=null?ef(tf(e)):{};let o=t||!e||!e.__esModule||!Ir.call(e,"default")?Be(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let c of gi(e))if(!Ir.call(o,c))Be(o,c,{get:yi.bind(e,c),enumerable:!0})}if(n)i.set(e,o);return o},of=(e)=>{var t=(mi??=new WeakMap).get(e),r;if(t)return t;if(t=Be({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var n of gi(e))if(!Ir.call(t,n))Be(t,n,{get:yi.bind(e,n),enumerable:!(r=rf(e,n))||r.enumerable})}return mi.set(e,t),t},mi,d=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var af=(e)=>e;function cf(e,t){this[e]=af.bind(null,t)}var uf=(e,t)=>{for(var r in t)Be(e,r,{get:t[r],enumerable:!0,configurable:!0,set:cf.bind(t,r)})};var q=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var we=d(function(kr,Ci){var ft=require("buffer"),Y=ft.Buffer;function Ii(e,t){for(var r in e)t[r]=e[r]}if(Y.from&&Y.alloc&&Y.allocUnsafe&&Y.allocUnsafeSlow)Ci.exports=ft;else Ii(ft,kr),kr.Buffer=Se;function Se(e,t,r){return Y(e,t,r)}Ii(Y,Se);Se.from=function(e,t,r){if(typeof e==="number")throw TypeError("Argument must not be a number");return Y(e,t,r)};Se.alloc=function(e,t,r){if(typeof e!=="number")throw TypeError("Argument must be a number");var n=Y(e);if(t!==void 0)if(typeof r==="string")n.fill(t,r);else n.fill(t);else n.fill(0);return n};Se.allocUnsafe=function(e){if(typeof e!=="number")throw TypeError("Argument must be a number");return Y(e)};Se.allocUnsafeSlow=function(e){if(typeof e!=="number")throw TypeError("Argument must be a number");return ft.SlowBuffer(e)}});var $r=d(function(XS,Ri){var ht=we().Buffer,Sf=require("stream"),wf=require("util");function dt(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=ht.alloc(0),this;if(typeof e.pipe==="function")return this.buffer=ht.alloc(0),e.pipe(this),this;if(e.length||typeof e==="object")return this.buffer=e,this.writable=!1,process.nextTick(function(){this.emit("end",e),this.readable=!1,this.emit("close")}.bind(this)),this;throw TypeError("Unexpected data type ("+typeof e+")")}wf.inherits(dt,Sf);dt.prototype.write=function(t){this.buffer=ht.concat([this.buffer,ht.from(t)]),this.emit("data",t)};dt.prototype.end=function(t){if(t)this.write(t);this.emit("end",t),this.emit("close"),this.writable=!1,this.readable=!1};Ri.exports=dt});var _i=d(function(YS,xi){function Lr(e){var t=(e/8|0)+(e%8===0?0:1);return t}var bf={ES256:Lr(256),ES384:Lr(384),ES512:Lr(521)};function vf(e){var t=bf[e];if(t)return t;throw Error('Unknown algorithm "'+e+'"')}xi.exports=vf});var qi=d(function(ZS,Ni){var pt=we().Buffer,ki=_i(),mt=128,$i=0,Tf=32,Af=16,If=2,Li=Af|Tf|$i<<6,gt=If|$i<<6;function Cf(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Pi(e){if(pt.isBuffer(e))return e;else if(typeof e==="string")return pt.from(e,"base64");throw TypeError("ECDSA signature must be a Base64 string or a Buffer")}function Rf(e,t){e=Pi(e);var r=ki(t),n=r+1,i=e.length,s=0;if(e[s++]!==Li)throw Error('Could not find expected "seq"');var o=e[s++];if(o===(mt|1))o=e[s++];if(i-s<o)throw Error('"seq" specified length of "'+o+'", only "'+(i-s)+'" remaining');if(e[s++]!==gt)throw Error('Could not find expected "int" for "r"');var c=e[s++];if(i-s-2<c)throw Error('"r" specified length of "'+c+'", only "'+(i-s-2)+'" available');if(n<c)throw Error('"r" specified length of "'+c+'", max of "'+n+'" is acceptable');var u=s;if(s+=c,e[s++]!==gt)throw Error('Could not find expected "int" for "s"');var a=e[s++];if(i-s!==a)throw Error('"s" specified length of "'+a+'", expected "'+(i-s)+'"');if(n<a)throw Error('"s" specified length of "'+a+'", max of "'+n+'" is acceptable');var l=s;if(s+=a,s!==i)throw Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var f=r-c,m=r-a,h=pt.allocUnsafe(f+c+m+a);for(s=0;s<f;++s)h[s]=0;e.copy(h,s,u+Math.max(-f,0),u+c),s=r;for(var g=s;s<g+m;++s)h[s]=0;return e.copy(h,s,l+Math.max(-m,0),l+a),h=h.toString("base64"),h=Cf(h),h}function Oi(e,t,r){var n=0;while(t+n<r&&e[t+n]===0)++n;var i=e[t+n]>=mt;if(i)--n;return n}function xf(e,t){e=Pi(e);var r=ki(t),n=e.length;if(n!==r*2)throw TypeError('"'+t+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=Oi(e,0,r),s=Oi(e,r,e.length),o=r-i,c=r-s,u=2+o+1+1+c,a=u<mt,l=pt.allocUnsafe((a?2:3)+u),f=0;if(l[f++]=Li,a)l[f++]=u;else l[f++]=mt|1,l[f++]=u&255;if(l[f++]=gt,l[f++]=o,i<0)l[f++]=0,f+=e.copy(l,f,0,r);else f+=e.copy(l,f,i,r);if(l[f++]=gt,l[f++]=c,s<0)l[f++]=0,e.copy(l,f,r);else e.copy(l,f,r+s);return l}Ni.exports={derToJose:Rf,joseToDer:xf}});var ji=d(function(QS,Fi){var Je=require("buffer").Buffer,Pr=require("buffer").SlowBuffer;Fi.exports=yt;function yt(e,t){if(!Je.isBuffer(e)||!Je.isBuffer(t))return!1;if(e.length!==t.length)return!1;var r=0;for(var n=0;n<e.length;n++)r|=e[n]^t[n];return r===0}yt.install=function(){Je.prototype.equal=Pr.prototype.equal=function(t){return yt(this,t)}};var _f=Je.prototype.equal,Of=Pr.prototype.equal;yt.restore=function(){Je.prototype.equal=_f,Pr.prototype.equal=Of}});var jr=d(function(ew,Mi){var ve=we().Buffer,D=require("crypto"),Di=qi(),Ki=require("util"),kf=`"%s" is not a valid algorithm.
1
+ var ef=Object.create;var{getPrototypeOf:tf,defineProperty:Be,getOwnPropertyNames:gi,getOwnPropertyDescriptor:rf}=Object,Ir=Object.prototype.hasOwnProperty;function yi(e){return this[e]}var nf,sf,Cr=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var i=t?nf??=new WeakMap:sf??=new WeakMap,s=i.get(e);if(s)return s}r=e!=null?ef(tf(e)):{};let o=t||!e||!e.__esModule||!Ir.call(e,"default")?Be(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let c of gi(e))if(!Ir.call(o,c))Be(o,c,{get:yi.bind(e,c),enumerable:!0})}if(n)i.set(e,o);return o},of=(e)=>{var t=(mi??=new WeakMap).get(e),r;if(t)return t;if(t=Be({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var n of gi(e))if(!Ir.call(t,n))Be(t,n,{get:yi.bind(e,n),enumerable:!(r=rf(e,n))||r.enumerable})}return mi.set(e,t),t},mi,d=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var af=(e)=>e;function cf(e,t){this[e]=af.bind(null,t)}var uf=(e,t)=>{for(var r in t)Be(e,r,{get:t[r],enumerable:!0,configurable:!0,set:cf.bind(t,r)})};var q=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var Se=d(function(kr,Ci){var ft=require("buffer"),Y=ft.Buffer;function Ii(e,t){for(var r in e)t[r]=e[r]}if(Y.from&&Y.alloc&&Y.allocUnsafe&&Y.allocUnsafeSlow)Ci.exports=ft;else Ii(ft,kr),kr.Buffer=we;function we(e,t,r){return Y(e,t,r)}Ii(Y,we);we.from=function(e,t,r){if(typeof e==="number")throw TypeError("Argument must not be a number");return Y(e,t,r)};we.alloc=function(e,t,r){if(typeof e!=="number")throw TypeError("Argument must be a number");var n=Y(e);if(t!==void 0)if(typeof r==="string")n.fill(t,r);else n.fill(t);else n.fill(0);return n};we.allocUnsafe=function(e){if(typeof e!=="number")throw TypeError("Argument must be a number");return Y(e)};we.allocUnsafeSlow=function(e){if(typeof e!=="number")throw TypeError("Argument must be a number");return ft.SlowBuffer(e)}});var $r=d(function(Xw,Ri){var ht=Se().Buffer,wf=require("stream"),Sf=require("util");function dt(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=ht.alloc(0),this;if(typeof e.pipe==="function")return this.buffer=ht.alloc(0),e.pipe(this),this;if(e.length||typeof e==="object")return this.buffer=e,this.writable=!1,process.nextTick(function(){this.emit("end",e),this.readable=!1,this.emit("close")}.bind(this)),this;throw TypeError("Unexpected data type ("+typeof e+")")}Sf.inherits(dt,wf);dt.prototype.write=function(t){this.buffer=ht.concat([this.buffer,ht.from(t)]),this.emit("data",t)};dt.prototype.end=function(t){if(t)this.write(t);this.emit("end",t),this.emit("close"),this.writable=!1,this.readable=!1};Ri.exports=dt});var _i=d(function(Yw,xi){function Pr(e){var t=(e/8|0)+(e%8===0?0:1);return t}var bf={ES256:Pr(256),ES384:Pr(384),ES512:Pr(521)};function vf(e){var t=bf[e];if(t)return t;throw Error('Unknown algorithm "'+e+'"')}xi.exports=vf});var qi=d(function(Zw,Ni){var pt=Se().Buffer,ki=_i(),mt=128,$i=0,Tf=32,Af=16,If=2,Pi=Af|Tf|$i<<6,gt=If|$i<<6;function Cf(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Li(e){if(pt.isBuffer(e))return e;else if(typeof e==="string")return pt.from(e,"base64");throw TypeError("ECDSA signature must be a Base64 string or a Buffer")}function Rf(e,t){e=Li(e);var r=ki(t),n=r+1,i=e.length,s=0;if(e[s++]!==Pi)throw Error('Could not find expected "seq"');var o=e[s++];if(o===(mt|1))o=e[s++];if(i-s<o)throw Error('"seq" specified length of "'+o+'", only "'+(i-s)+'" remaining');if(e[s++]!==gt)throw Error('Could not find expected "int" for "r"');var c=e[s++];if(i-s-2<c)throw Error('"r" specified length of "'+c+'", only "'+(i-s-2)+'" available');if(n<c)throw Error('"r" specified length of "'+c+'", max of "'+n+'" is acceptable');var u=s;if(s+=c,e[s++]!==gt)throw Error('Could not find expected "int" for "s"');var a=e[s++];if(i-s!==a)throw Error('"s" specified length of "'+a+'", expected "'+(i-s)+'"');if(n<a)throw Error('"s" specified length of "'+a+'", max of "'+n+'" is acceptable');var l=s;if(s+=a,s!==i)throw Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var f=r-c,m=r-a,h=pt.allocUnsafe(f+c+m+a);for(s=0;s<f;++s)h[s]=0;e.copy(h,s,u+Math.max(-f,0),u+c),s=r;for(var g=s;s<g+m;++s)h[s]=0;return e.copy(h,s,l+Math.max(-m,0),l+a),h=h.toString("base64"),h=Cf(h),h}function Oi(e,t,r){var n=0;while(t+n<r&&e[t+n]===0)++n;var i=e[t+n]>=mt;if(i)--n;return n}function xf(e,t){e=Li(e);var r=ki(t),n=e.length;if(n!==r*2)throw TypeError('"'+t+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=Oi(e,0,r),s=Oi(e,r,e.length),o=r-i,c=r-s,u=2+o+1+1+c,a=u<mt,l=pt.allocUnsafe((a?2:3)+u),f=0;if(l[f++]=Pi,a)l[f++]=u;else l[f++]=mt|1,l[f++]=u&255;if(l[f++]=gt,l[f++]=o,i<0)l[f++]=0,f+=e.copy(l,f,0,r);else f+=e.copy(l,f,i,r);if(l[f++]=gt,l[f++]=c,s<0)l[f++]=0,e.copy(l,f,r);else e.copy(l,f,r+s);return l}Ni.exports={derToJose:Rf,joseToDer:xf}});var ji=d(function(Qw,Fi){var Je=require("buffer").Buffer,Lr=require("buffer").SlowBuffer;Fi.exports=yt;function yt(e,t){if(!Je.isBuffer(e)||!Je.isBuffer(t))return!1;if(e.length!==t.length)return!1;var r=0;for(var n=0;n<e.length;n++)r|=e[n]^t[n];return r===0}yt.install=function(){Je.prototype.equal=Lr.prototype.equal=function(t){return yt(this,t)}};var _f=Je.prototype.equal,Of=Lr.prototype.equal;yt.restore=function(){Je.prototype.equal=_f,Lr.prototype.equal=Of}});var jr=d(function(eS,Mi){var ve=Se().Buffer,D=require("crypto"),Di=qi(),Ki=require("util"),kf=`"%s" is not a valid algorithm.
2
2
  Supported algorithms are:
3
- "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,We="secret must be a string or buffer",be="key must be a string or a buffer",$f="key must be a string, a buffer or an object",qr=typeof D.createPublicKey==="function";if(qr)be+=" or a KeyObject",We+="or a KeyObject";function Ui(e){if(ve.isBuffer(e))return;if(typeof e==="string")return;if(!qr)throw H(be);if(typeof e!=="object")throw H(be);if(typeof e.type!=="string")throw H(be);if(typeof e.asymmetricKeyType!=="string")throw H(be);if(typeof e.export!=="function")throw H(be)}function Bi(e){if(ve.isBuffer(e))return;if(typeof e==="string")return;if(typeof e==="object")return;throw H($f)}function Lf(e){if(ve.isBuffer(e))return;if(typeof e==="string")return e;if(!qr)throw H(We);if(typeof e!=="object")throw H(We);if(e.type!=="secret")throw H(We);if(typeof e.export!=="function")throw H(We)}function Fr(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Ji(e){e=e.toString();var t=4-e.length%4;if(t!==4)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function H(e){var t=[].slice.call(arguments,1),r=Ki.format.bind(Ki,e).apply(null,t);return TypeError(r)}function Pf(e){return ve.isBuffer(e)||typeof e==="string"}function Ge(e){if(!Pf(e))e=JSON.stringify(e);return e}function Wi(e){return function(r,n){Lf(n),r=Ge(r);var i=D.createHmac("sha"+e,n),s=(i.update(r),i.digest("base64"));return Fr(s)}}var Nr,Nf="timingSafeEqual"in D?function(t,r){if(t.byteLength!==r.byteLength)return!1;return D.timingSafeEqual(t,r)}:function(t,r){if(!Nr)Nr=ji();return Nr(t,r)};function qf(e){return function(r,n,i){var s=Wi(e)(r,i);return Nf(ve.from(n),ve.from(s))}}function Gi(e){return function(r,n){Bi(n),r=Ge(r);var i=D.createSign("RSA-SHA"+e),s=(i.update(r),i.sign(n,"base64"));return Fr(s)}}function Hi(e){return function(r,n,i){Ui(i),r=Ge(r),n=Ji(n);var s=D.createVerify("RSA-SHA"+e);return s.update(r),s.verify(i,n,"base64")}}function Ff(e){return function(r,n){Bi(n),r=Ge(r);var i=D.createSign("RSA-SHA"+e),s=(i.update(r),i.sign({key:n,padding:D.constants.RSA_PKCS1_PSS_PADDING,saltLength:D.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Fr(s)}}function jf(e){return function(r,n,i){Ui(i),r=Ge(r),n=Ji(n);var s=D.createVerify("RSA-SHA"+e);return s.update(r),s.verify({key:i,padding:D.constants.RSA_PKCS1_PSS_PADDING,saltLength:D.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function Kf(e){var t=Gi(e);return function(){var n=t.apply(null,arguments);return n=Di.derToJose(n,"ES"+e),n}}function Df(e){var t=Hi(e);return function(n,i,s){i=Di.joseToDer(i,"ES"+e).toString("base64");var o=t(n,i,s);return o}}function Uf(){return function(){return""}}function Bf(){return function(t,r){return r===""}}Mi.exports=function(t){var r={hs:Wi,rs:Gi,ps:Ff,es:Kf,none:Uf},n={hs:qf,rs:Hi,ps:jf,es:Df,none:Bf},i=t.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw H(kf,t);var s=(i[1]||i[3]).toLowerCase(),o=i[2];return{sign:r[s](o),verify:n[s](o)}}});var Kr=d(function(tw,zi){var Jf=require("buffer").Buffer;zi.exports=function(t){if(typeof t==="string")return t;if(typeof t==="number"||Jf.isBuffer(t))return t.toString();return JSON.stringify(t)}});var es=d(function(rw,Qi){var Wf=we().Buffer,Vi=$r(),Gf=jr(),Hf=require("stream"),Xi=Kr(),Dr=require("util");function Yi(e,t){return Wf.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Mf(e,t,r){r=r||"utf8";var n=Yi(Xi(e),"binary"),i=Yi(Xi(t),r);return Dr.format("%s.%s",n,i)}function Zi(e){var{header:t,payload:r}=e,n=e.secret||e.privateKey,i=e.encoding,s=Gf(t.alg),o=Mf(t,r,i),c=s.sign(o,n);return Dr.format("%s.%s",o,c)}function Et(e){var t=e.secret;if(t=t==null?e.privateKey:t,t=t==null?e.key:t,/^hs/i.test(e.header.alg)===!0&&t==null)throw TypeError("secret must be a string or buffer or a KeyObject");var r=new Vi(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new Vi(e.payload),this.secret.once("close",function(){if(!this.payload.writable&&this.readable)this.sign()}.bind(this)),this.payload.once("close",function(){if(!this.secret.writable&&this.readable)this.sign()}.bind(this))}Dr.inherits(Et,Hf);Et.prototype.sign=function(){try{var t=Zi({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",t),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}};Et.sign=Zi;Qi.exports=Et});var ls=d(function(nw,us){var rs=we().Buffer,ts=$r(),zf=jr(),Vf=require("stream"),ns=Kr(),Xf=require("util"),Yf=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function Zf(e){return Object.prototype.toString.call(e)==="[object Object]"}function Qf(e){if(Zf(e))return e;try{return JSON.parse(e)}catch(t){return}}function is(e){var t=e.split(".",1)[0];return Qf(rs.from(t,"base64").toString("binary"))}function eh(e){return e.split(".",2).join(".")}function ss(e){return e.split(".")[2]}function th(e,t){t=t||"utf8";var r=e.split(".")[1];return rs.from(r,"base64").toString(t)}function os(e){return Yf.test(e)&&!!is(e)}function as(e,t,r){if(!t){var n=Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}e=ns(e);var i=ss(e),s=eh(e),o=zf(t);return o.verify(s,i,r)}function cs(e,t){if(t=t||{},e=ns(e),!os(e))return null;var r=is(e);if(!r)return null;var n=th(e);if(r.typ==="JWT"||t.json)n=JSON.parse(n,t.encoding);return{header:r,payload:n,signature:ss(e)}}function Te(e){e=e||{};var t=e.secret;if(t=t==null?e.publicKey:t,t=t==null?e.key:t,/^hs/i.test(e.algorithm)===!0&&t==null)throw TypeError("secret must be a string or buffer or a KeyObject");var r=new ts(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new ts(e.signature),this.secret.once("close",function(){if(!this.signature.writable&&this.readable)this.verify()}.bind(this)),this.signature.once("close",function(){if(!this.secret.writable&&this.readable)this.verify()}.bind(this))}Xf.inherits(Te,Vf);Te.prototype.verify=function(){try{var t=as(this.signature.buffer,this.algorithm,this.key.buffer),r=cs(this.signature.buffer,this.encoding);return this.emit("done",t,r),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};Te.decode=cs;Te.isValid=os;Te.verify=as;us.exports=Te});var wt=d(function(re){var fs=es(),St=ls(),rh=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];re.ALGORITHMS=rh;re.sign=fs.sign;re.verify=St.verify;re.decode=St.decode;re.isValid=St.isValid;re.createSign=function(t){return new fs(t)};re.createVerify=function(t){return new St(t)}});var Ur=d(function(sw,hs){var nh=wt();hs.exports=function(e,t){t=t||{};var r=nh.decode(e,t);if(!r)return null;var n=r.payload;if(typeof n==="string")try{var i=JSON.parse(n);if(i!==null&&typeof i==="object")n=i}catch(s){}if(t.complete===!0)return{header:r.header,payload:n,signature:r.signature};return n}});var He=d(function(ow,ds){var bt=function(e,t){if(Error.call(this,e),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);if(this.name="JsonWebTokenError",this.message=e,t)this.inner=t};bt.prototype=Object.create(Error.prototype);bt.prototype.constructor=bt;ds.exports=bt});var Br=d(function(aw,ms){var ps=He(),vt=function(e,t){ps.call(this,e),this.name="NotBeforeError",this.date=t};vt.prototype=Object.create(ps.prototype);vt.prototype.constructor=vt;ms.exports=vt});var Jr=d(function(cw,ys){var gs=He(),Tt=function(e,t){gs.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};Tt.prototype=Object.create(gs.prototype);Tt.prototype.constructor=Tt;ys.exports=Tt});var Wr=d(function(uw,Es){var Ae=1000,Ie=Ae*60,Ce=Ie*60,fe=Ce*24,ih=fe*7,sh=fe*365.25;Es.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return oh(e);else if(r==="number"&&isFinite(e))return t.long?ch(e):ah(e);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function oh(e){if(e=String(e),e.length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*sh;case"weeks":case"week":case"w":return r*ih;case"days":case"day":case"d":return r*fe;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Ce;case"minutes":case"minute":case"mins":case"min":case"m":return r*Ie;case"seconds":case"second":case"secs":case"sec":case"s":return r*Ae;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}function ah(e){var t=Math.abs(e);if(t>=fe)return Math.round(e/fe)+"d";if(t>=Ce)return Math.round(e/Ce)+"h";if(t>=Ie)return Math.round(e/Ie)+"m";if(t>=Ae)return Math.round(e/Ae)+"s";return e+"ms"}function ch(e){var t=Math.abs(e);if(t>=fe)return At(e,t,fe,"day");if(t>=Ce)return At(e,t,Ce,"hour");if(t>=Ie)return At(e,t,Ie,"minute");if(t>=Ae)return At(e,t,Ae,"second");return e+" ms"}function At(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}});var Gr=d(function(lw,Ss){var uh=Wr();Ss.exports=function(e,t){var r=t||Math.floor(Date.now()/1000);if(typeof e==="string"){var n=uh(e);if(typeof n>"u")return;return Math.floor(r+n/1000)}else if(typeof e==="number")return r+e;else return}});var he=d(function(fw,ws){var lh=Number.MAX_SAFE_INTEGER||9007199254740991,fh=["\t",`
4
- `,"\v","\f","\r"," "," "," "," "," "," "," "," "," "," "," "," "," "," ","\u2028","\u2029"," "," "," ","\uFEFF"],hh=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ws.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:lh,WHITESPACE_CHARACTERS:fh,RELEASE_TYPES:hh,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Me=d(function(hw,bs){var dh=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};bs.exports=dh});var Re=d(function(X,vs){var{MAX_SAFE_COMPONENT_LENGTH:Hr,MAX_SAFE_BUILD_LENGTH:ph,MAX_LENGTH:mh}=he(),gh=Me();X=vs.exports={};var yh=X.re=[],Eh=X.safeRe=[],y=X.src=[],Sh=X.safeSrc=[],E=X.t={},wh=0,Mr="[a-zA-Z0-9-]",bh=[["\\s",1],["\\d",mh],[Mr,ph]],vh=(e)=>{for(let[t,r]of bh)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},v=(e,t,r)=>{let n=vh(t),i=wh++;gh(e,i,t),E[e]=i,y[i]=t,Sh[i]=n,yh[i]=new RegExp(t,r?"g":void 0),Eh[i]=new RegExp(n,r?"g":void 0)};v("NUMERICIDENTIFIER","0|[1-9]\\d*");v("NUMERICIDENTIFIERLOOSE","\\d+");v("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Mr}*`);v("MAINVERSION",`(${y[E.NUMERICIDENTIFIER]})\\.(${y[E.NUMERICIDENTIFIER]})\\.(${y[E.NUMERICIDENTIFIER]})`);v("MAINVERSIONLOOSE",`(${y[E.NUMERICIDENTIFIERLOOSE]})\\.(${y[E.NUMERICIDENTIFIERLOOSE]})\\.(${y[E.NUMERICIDENTIFIERLOOSE]})`);v("PRERELEASEIDENTIFIER",`(?:${y[E.NONNUMERICIDENTIFIER]}|${y[E.NUMERICIDENTIFIER]})`);v("PRERELEASEIDENTIFIERLOOSE",`(?:${y[E.NONNUMERICIDENTIFIER]}|${y[E.NUMERICIDENTIFIERLOOSE]})`);v("PRERELEASE",`(?:-(${y[E.PRERELEASEIDENTIFIER]}(?:\\.${y[E.PRERELEASEIDENTIFIER]})*))`);v("PRERELEASELOOSE",`(?:-?(${y[E.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${y[E.PRERELEASEIDENTIFIERLOOSE]})*))`);v("BUILDIDENTIFIER",`${Mr}+`);v("BUILD",`(?:\\+(${y[E.BUILDIDENTIFIER]}(?:\\.${y[E.BUILDIDENTIFIER]})*))`);v("FULLPLAIN",`v?${y[E.MAINVERSION]}${y[E.PRERELEASE]}?${y[E.BUILD]}?`);v("FULL",`^${y[E.FULLPLAIN]}$`);v("LOOSEPLAIN",`[v=\\s]*${y[E.MAINVERSIONLOOSE]}${y[E.PRERELEASELOOSE]}?${y[E.BUILD]}?`);v("LOOSE",`^${y[E.LOOSEPLAIN]}$`);v("GTLT","((?:<|>)?=?)");v("XRANGEIDENTIFIERLOOSE",`${y[E.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);v("XRANGEIDENTIFIER",`${y[E.NUMERICIDENTIFIER]}|x|X|\\*`);v("XRANGEPLAIN",`[v=\\s]*(${y[E.XRANGEIDENTIFIER]})(?:\\.(${y[E.XRANGEIDENTIFIER]})(?:\\.(${y[E.XRANGEIDENTIFIER]})(?:${y[E.PRERELEASE]})?${y[E.BUILD]}?)?)?`);v("XRANGEPLAINLOOSE",`[v=\\s]*(${y[E.XRANGEIDENTIFIERLOOSE]})(?:\\.(${y[E.XRANGEIDENTIFIERLOOSE]})(?:\\.(${y[E.XRANGEIDENTIFIERLOOSE]})(?:${y[E.PRERELEASELOOSE]})?${y[E.BUILD]}?)?)?`);v("XRANGE",`^${y[E.GTLT]}\\s*${y[E.XRANGEPLAIN]}$`);v("XRANGELOOSE",`^${y[E.GTLT]}\\s*${y[E.XRANGEPLAINLOOSE]}$`);v("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Hr}})(?:\\.(\\d{1,${Hr}}))?(?:\\.(\\d{1,${Hr}}))?`);v("COERCE",`${y[E.COERCEPLAIN]}(?:$|[^\\d])`);v("COERCEFULL",y[E.COERCEPLAIN]+`(?:${y[E.PRERELEASE]})?(?:${y[E.BUILD]})?(?:$|[^\\d])`);v("COERCERTL",y[E.COERCE],!0);v("COERCERTLFULL",y[E.COERCEFULL],!0);v("LONETILDE","(?:~>?)");v("TILDETRIM",`(\\s*)${y[E.LONETILDE]}\\s+`,!0);X.tildeTrimReplace="$1~";v("TILDE",`^${y[E.LONETILDE]}${y[E.XRANGEPLAIN]}$`);v("TILDELOOSE",`^${y[E.LONETILDE]}${y[E.XRANGEPLAINLOOSE]}$`);v("LONECARET","(?:\\^)");v("CARETTRIM",`(\\s*)${y[E.LONECARET]}\\s+`,!0);X.caretTrimReplace="$1^";v("CARET",`^${y[E.LONECARET]}${y[E.XRANGEPLAIN]}$`);v("CARETLOOSE",`^${y[E.LONECARET]}${y[E.XRANGEPLAINLOOSE]}$`);v("COMPARATORLOOSE",`^${y[E.GTLT]}\\s*(${y[E.LOOSEPLAIN]})$|^$`);v("COMPARATOR",`^${y[E.GTLT]}\\s*(${y[E.FULLPLAIN]})$|^$`);v("COMPARATORTRIM",`(\\s*)${y[E.GTLT]}\\s*(${y[E.LOOSEPLAIN]}|${y[E.XRANGEPLAIN]})`,!0);X.comparatorTrimReplace="$1$2$3";v("HYPHENRANGE",`^\\s*(${y[E.XRANGEPLAIN]})\\s+-\\s+(${y[E.XRANGEPLAIN]})\\s*$`);v("HYPHENRANGELOOSE",`^\\s*(${y[E.XRANGEPLAINLOOSE]})\\s+-\\s+(${y[E.XRANGEPLAINLOOSE]})\\s*$`);v("STAR","(<|>)?=?\\s*\\*");v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var It=d(function(dw,Ts){var Th=Object.freeze({loose:!0}),Ah=Object.freeze({}),Ih=(e)=>{if(!e)return Ah;if(typeof e!=="object")return Th;return e};Ts.exports=Ih});var zr=d(function(pw,Cs){var As=/^[0-9]+$/,Is=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=As.test(e),n=As.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},Ch=(e,t)=>Is(t,e);Cs.exports={compareIdentifiers:Is,rcompareIdentifiers:Ch}});var P=d(function(mw,xs){var Ct=Me(),{MAX_LENGTH:Rs,MAX_SAFE_INTEGER:Rt}=he(),{safeRe:xt,t:_t}=Re(),Rh=It(),{compareIdentifiers:Vr}=zr(),xh=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(Vr(e[n],r[n])!==0)return!1;return!0};class M{constructor(e,t){if(t=Rh(t),e instanceof M)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Rs)throw TypeError(`version is longer than ${Rs} characters`);Ct("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?xt[_t.LOOSE]:xt[_t.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Rt||this.major<0)throw TypeError("Invalid major version");if(this.minor>Rt||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Rt||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((n)=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<Rt)return i}return n});this.build=r[5]?r[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(Ct("SemVer.compare",this.version,this.options,e),!(e instanceof M)){if(typeof e==="string"&&e===this.version)return 0;e=new M(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof M))e=new M(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof M))e=new M(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(Ct("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return Vr(r,n)}while(++t)}compareBuild(e){if(!(e instanceof M))e=new M(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(Ct("build compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return Vr(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?xt[_t.PRERELEASELOOSE]:xt[_t.PRERELEASE]);if(!n||n[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,r);this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let i=this.prerelease.length;while(--i>=0)if(typeof this.prerelease[i]==="number")this.prerelease[i]++,i=-2;if(i===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let i=[t,n];if(r===!1)i=[t];if(xh(this.prerelease,t)){let s=this.prerelease[t.split(".").length];if(isNaN(s))this.prerelease=i}else this.prerelease=i}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}xs.exports=M});var ne=d(function(gw,Os){var _s=P(),_h=(e,t,r=!1)=>{if(e instanceof _s)return e;try{return new _s(e,t)}catch(n){if(!r)return null;throw n}};Os.exports=_h});var $s=d(function(yw,ks){var Oh=ne(),kh=(e,t)=>{let r=Oh(e,t);return r?r.version:null};ks.exports=kh});var Ps=d(function(Ew,Ls){var $h=ne(),Lh=(e,t)=>{let r=$h(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Ls.exports=Lh});var Fs=d(function(Sw,qs){var Ns=P(),Ph=(e,t,r,n,i)=>{if(typeof r==="string")i=n,n=r,r=void 0;try{return new Ns(e instanceof Ns?e.version:e,r).inc(t,n,i).version}catch(s){return null}};qs.exports=Ph});var Ds=d(function(ww,Ks){var js=ne(),Nh=(e,t)=>{let r=js(e,null,!0),n=js(t,null,!0),i=r.compare(n);if(i===0)return null;let s=i>0,o=s?r:n,c=s?n:r,u=!!o.prerelease.length;if(!!c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(c.compareMain(o)===0){if(c.minor&&!c.patch)return"minor";return"patch"}}let l=u?"pre":"";if(r.major!==n.major)return l+"major";if(r.minor!==n.minor)return l+"minor";if(r.patch!==n.patch)return l+"patch";return"prerelease"};Ks.exports=Nh});var Bs=d(function(bw,Us){var qh=P(),Fh=(e,t)=>new qh(e,t).major;Us.exports=Fh});var Ws=d(function(vw,Js){var jh=P(),Kh=(e,t)=>new jh(e,t).minor;Js.exports=Kh});var Hs=d(function(Tw,Gs){var Dh=P(),Uh=(e,t)=>new Dh(e,t).patch;Gs.exports=Uh});var zs=d(function(Aw,Ms){var Bh=ne(),Jh=(e,t)=>{let r=Bh(e,t);return r&&r.prerelease.length?r.prerelease:null};Ms.exports=Jh});var U=d(function(Iw,Xs){var Vs=P(),Wh=(e,t,r)=>new Vs(e,r).compare(new Vs(t,r));Xs.exports=Wh});var Zs=d(function(Cw,Ys){var Gh=U(),Hh=(e,t,r)=>Gh(t,e,r);Ys.exports=Hh});var eo=d(function(Rw,Qs){var Mh=U(),zh=(e,t)=>Mh(e,t,!0);Qs.exports=zh});var Ot=d(function(xw,ro){var to=P(),Vh=(e,t,r)=>{let n=new to(e,r),i=new to(t,r);return n.compare(i)||n.compareBuild(i)};ro.exports=Vh});var io=d(function(_w,no){var Xh=Ot(),Yh=(e,t)=>e.sort((r,n)=>Xh(r,n,t));no.exports=Yh});var oo=d(function(Ow,so){var Zh=Ot(),Qh=(e,t)=>e.sort((r,n)=>Zh(n,r,t));so.exports=Qh});var ze=d(function(kw,ao){var ed=U(),td=(e,t,r)=>ed(e,t,r)>0;ao.exports=td});var kt=d(function($w,co){var rd=U(),nd=(e,t,r)=>rd(e,t,r)<0;co.exports=nd});var Xr=d(function(Lw,uo){var id=U(),sd=(e,t,r)=>id(e,t,r)===0;uo.exports=sd});var Yr=d(function(Pw,lo){var od=U(),ad=(e,t,r)=>od(e,t,r)!==0;lo.exports=ad});var $t=d(function(Nw,fo){var cd=U(),ud=(e,t,r)=>cd(e,t,r)>=0;fo.exports=ud});var Lt=d(function(qw,ho){var ld=U(),fd=(e,t,r)=>ld(e,t,r)<=0;ho.exports=fd});var Zr=d(function(Fw,po){var hd=Xr(),dd=Yr(),pd=ze(),md=$t(),gd=kt(),yd=Lt(),Ed=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e===r;case"!==":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e!==r;case"":case"=":case"==":return hd(e,r,n);case"!=":return dd(e,r,n);case">":return pd(e,r,n);case">=":return md(e,r,n);case"<":return gd(e,r,n);case"<=":return yd(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};po.exports=Ed});var go=d(function(jw,mo){var Sd=P(),wd=ne(),{safeRe:Pt,t:Nt}=Re(),bd=(e,t)=>{if(e instanceof Sd)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Pt[Nt.COERCEFULL]:Pt[Nt.COERCE]);else{let u=t.includePrerelease?Pt[Nt.COERCERTLFULL]:Pt[Nt.COERCERTL],a;while((a=u.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||a.index+a[0].length!==r.index+r[0].length)r=a;u.lastIndex=a.index+a[1].length+a[2].length}u.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",s=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",c=t.includePrerelease&&r[6]?`+${r[6]}`:"";return wd(`${n}.${i}.${s}${o}${c}`,t)};mo.exports=bd});var So=d(function(Kw,Eo){var vd=ne(),yo=he(),Td=P(),Ad=(e,t,r)=>{if(!yo.RELEASE_TYPES.includes(t))return null;let n=Id(e,r);return n&&Cd(n,t)},Id=(e,t)=>{let r=e instanceof Td?e.version:e;return vd(r,t)},Cd=(e,t)=>{if(Rd(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},Rd=(e)=>e.startsWith("pre");Eo.exports=Ad});var vo=d(function(Dw,bo){class wo{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}}bo.exports=wo});var Po=d(function(Uw,Lo){var{MAX_LENGTH:en,MAX_SAFE_BUILD_LENGTH:Co,WHITESPACE_CHARACTERS:xd}=he(),Ro=new Uint8Array(65536);for(let e of xd)Ro[e.charCodeAt(0)]=1;var tn=(e)=>e!==void 0&&Ro[e.charCodeAt(0)]===1,To=(e)=>e==="v"||e==="="||tn(e),Ve=(e)=>e!==void 0&&e>="0"&&e<="9",xo=(e)=>e!==void 0&&(e>="a"&&e<="z"||e>="A"&&e<="Z"),_o=(e)=>Ve(e)||xo(e)||e==="-",rn=(e)=>Ve(e)||e==="x"||e==="X"||e==="*",Oo=(e,t,r,n)=>{if(!Ve(e[t]))return t;if(t>=n.start&&t<n.end)return Math.min(t+r,n.end);if(t>=n.previousStart&&t<n.previousEnd)return Math.min(t+r,n.previousEnd);let i=t+1;while(Ve(e[i]))i++;return n.previousStart=n.start,n.previousEnd=n.end,n.start=t,n.end=i,Math.min(t+r,i)},nn=(e,t,r,n)=>{if(!r&&e[t]==="0")return t+1;return Oo(e,t,r?en:en+1,n)},Qr=(e,t,r,n)=>{let i=Oo(e,t,en,n);if(xo(e[i])||e[i]==="-"){let s=i+1,o=s+Co;while(s<o&&_o(e[s]))s++;return s}return nn(e,t,r,n)},ko=(e,t,r,n)=>{let i=e[t]==="-";if(!r&&!i)return t;let s=t+(i?1:0),o=Qr(e,s,r,n);if(o===s){if(!r||!i)return t;o=Qr(e,t,r,n)}while(e[o]==="."){let c=Qr(e,o+1,r,n);if(c===o+1)break;o=c}return o},Ao=(e,t)=>{let r=t;while(r-t<Co&&_o(e[r]))r++;return r},$o=(e,t)=>{if(e[t]!=="+")return t;let r=Ao(e,t+1);if(r===t+1)return t;while(e[r]==="."){let n=Ao(e,r+1);if(n===r+1)break;r=n}return r},_d=(e,t,r)=>{let n=t;for(let s=0;s<3;s++){let o=nn(e,n,!0,r);if(o===n)return t;if(n=o,s<2){if(e[n]!==".")return t;n++}}let i=ko(e,n,!0,r);return $o(e,i)},Io=(e,t,r)=>{if(Ve(e[t]))return nn(e,t,!1,r);return rn(e[t])?t+1:t},Od=(e,t,r)=>{let n=Io(e,t,r);for(let s=0;s<2;s++){if(e[n]!==".")return n;let o=Io(e,n+1,r);if(o===n+1)return n;n=o}let i=ko(e,n,!1,r);return $o(e,i)},kd=(e,t,r)=>{let n=_d(e,t,r);return n!==t?n:Od(e,t,r)},$d=(e,t)=>{let r=t;if(tn(e[r]))r++;if(e[r]==="<"||e[r]===">")r++;if(e[r]==="=")r++;return tn(e[r])?r:-1},Ld=(e)=>{let t="",r=0,n=0,i={start:-1,end:-1,previousStart:-1,previousEnd:-1};while(n<e.length){let s=n;if(e[n]==="<"||e[n]===">")n++;else if(!To(e[n])&&!rn(e[n])){n++;continue}while(n<e.length&&To(e[n]))n++;if(!rn(e[n]))continue;let o=$d(e,s);if(o!==-1)t+=e.slice(r,o),r=o+1;n=kd(e,n,i)}return t+e.slice(r)};Lo.exports=Ld});var B=d(function(Bw,jo){var Pd=/\s+/g;class Xe{constructor(e,t){if(t=qd(t),e instanceof Xe)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new Xe(e.raw,t);if(e instanceof qt)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(Pd," "),this.set=this.raw.split("||").map((r)=>this.parseRange(r.trim())).filter((r)=>r.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter((n)=>!qo(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&Gd(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let r=0;r<t.length;r++){if(r>0)this.formatted+=" ";this.formatted+=t[r].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(Wd,"");let r=((this.options.includePrerelease&&Bd)|(this.options.loose&&Jd))+":"+e,n=No.get(r);if(n)return n;let i=this.options.loose,s=i?F[N.HYPHENRANGELOOSE]:F[N.HYPHENRANGE];e=e.replace(s,rp(this.options.includePrerelease)),x("hyphen replace",e),e=jd(e),x("comparator trim",e),e=e.replace(F[N.TILDETRIM],Dd),x("tilde trim",e),e=e.replace(F[N.CARETTRIM],Ud),x("caret trim",e);let o=e.split(" ").map((l)=>Hd(l,this.options)).join(" ").split(/\s+/).map((l)=>tp(l,this.options));if(i)o=o.filter((l)=>(x("loose invalid filter",l,this.options),!!l.match(F[N.COMPARATORLOOSE])));x("range list",o);let c=new Map,u=o.map((l)=>new qt(l,this.options));for(let l of u){if(qo(l))return[l];c.set(l.value,l)}if(c.size>1&&c.has(""))c.delete("");let a=[...c.values()];return No.set(r,a),a}intersects(e,t){if(!(e instanceof Xe))throw TypeError("a Range is required");return this.set.some((r)=>Fo(r,t)&&e.set.some((n)=>Fo(n,t)&&r.every((i)=>n.every((s)=>i.intersects(s,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new Fd(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(np(this.set[t],e,this.options))return!0;return!1}}jo.exports=Xe;var Nd=vo(),No=new Nd,qd=It(),qt=Ye(),x=Me(),Fd=P(),jd=Po(),{safeRe:F,src:Kd,t:N,tildeTrimReplace:Dd,caretTrimReplace:Ud}=Re(),{FLAG_INCLUDE_PRERELEASE:Bd,FLAG_LOOSE:Jd}=he(),Wd=new RegExp(Kd[N.BUILD],"g"),qo=(e)=>e.value==="<0.0.0-0",Gd=(e)=>e.value==="",Fo=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();while(r&&n.length)r=n.every((s)=>i.intersects(s,t)),i=n.pop();return r},Hd=(e,t)=>(e=e.replace(F[N.BUILD],""),x("comp",e,t),e=Xd(e,t),x("caret",e),e=zd(e,t),x("tildes",e),e=Zd(e,t),x("xrange",e),e=ep(e,t),x("stars",e),e),O=(e)=>!e||e.toLowerCase()==="x"||e==="*",Md=(e,t,r)=>O(e)&&!O(t)||O(t)&&r&&!O(r),zd=(e,t)=>e.trim().split(/\s+/).map((r)=>Vd(r,t)).join(" "),Vd=(e,t)=>{let r=t.loose?F[N.TILDELOOSE]:F[N.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,c,u)=>{x("tilde",e,i,s,o,c,u);let a;if(O(s))a="";else if(O(o))a=`>=${s}.0.0${n} <${+s+1}.0.0-0`;else if(O(c))a=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`;else if(u)x("replaceTilde pr",u),a=`>=${s}.${o}.${c}-${u} <${s}.${+o+1}.0-0`;else a=`>=${s}.${o}.${c} <${s}.${+o+1}.0-0`;return x("tilde return",a),a})},Xd=(e,t)=>e.trim().split(/\s+/).map((r)=>Yd(r,t)).join(" "),Yd=(e,t)=>{x("caret",e,t);let r=t.loose?F[N.CARETLOOSE]:F[N.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,c,u)=>{x("caret",e,i,s,o,c,u);let a;if(O(s))a="";else if(O(o))a=`>=${s}.0.0${n} <${+s+1}.0.0-0`;else if(O(c))if(s==="0")a=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`;else a=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`;else if(u)if(x("replaceCaret pr",u),s==="0")if(o==="0")a=`>=${s}.${o}.${c}-${u} <${s}.${o}.${+c+1}-0`;else a=`>=${s}.${o}.${c}-${u} <${s}.${+o+1}.0-0`;else a=`>=${s}.${o}.${c}-${u} <${+s+1}.0.0-0`;else if(x("no pr"),s==="0")if(o==="0")a=`>=${s}.${o}.${c} <${s}.${o}.${+c+1}-0`;else a=`>=${s}.${o}.${c} <${s}.${+o+1}.0-0`;else a=`>=${s}.${o}.${c} <${+s+1}.0.0-0`;return x("caret return",a),a})},Zd=(e,t)=>(x("replaceXRanges",e,t),e.split(/\s+/).map((r)=>Qd(r,t)).join(" ")),Qd=(e,t)=>{e=e.trim();let r=t.loose?F[N.XRANGELOOSE]:F[N.XRANGE];return e.replace(r,(n,i,s,o,c,u)=>{if(x("xRange",e,n,i,s,o,c,u),Md(s,o,c))return e;let a=O(s),l=a||O(o),f=l||O(c),m=f;if(i==="="&&m)i="";if(u=t.includePrerelease?"-0":"",a)if(i===">"||i==="<")n="<0.0.0-0";else n="*";else if(i&&m){if(l)o=0;if(c=0,i===">")if(i=">=",l)s=+s+1,o=0,c=0;else o=+o+1,c=0;else if(i==="<=")if(i="<",l)s=+s+1;else o=+o+1;if(i==="<")u="-0";n=`${i+s}.${o}.${c}${u}`}else if(l)n=`>=${s}.0.0${u} <${+s+1}.0.0-0`;else if(f)n=`>=${s}.${o}.0${u} <${s}.${+o+1}.0-0`;return x("xRange return",n),n})},ep=(e,t)=>(x("replaceStars",e,t),e.trim().replace(F[N.STAR],"")),tp=(e,t)=>(x("replaceGTE0",e,t),e.trim().replace(F[t.includePrerelease?N.GTE0PRE:N.GTE0],"")),rp=(e)=>(t,r,n,i,s,o,c,u,a,l,f,m)=>{if(O(n))r="";else if(O(i))r=`>=${n}.0.0${e?"-0":""}`;else if(O(s))r=`>=${n}.${i}.0${e?"-0":""}`;else if(o)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(O(a))u="";else if(O(l))u=`<${+a+1}.0.0-0`;else if(O(f))u=`<${a}.${+l+1}.0-0`;else if(m)u=`<=${a}.${l}.${f}-${m}`;else if(e)u=`<${a}.${l}.${+f+1}-0`;else u=`<=${u}`;return`${r} ${u}`.trim()},np=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++){if(x(e[n].semver),e[n].semver===qt.ANY)continue;if(e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}}return!1}return!0}});var Ye=d(function(Jw,Wo){var Ze=Symbol("SemVer ANY");class Ft{static get ANY(){return Ze}constructor(e,t){if(t=Ko(t),e instanceof Ft)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),on("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Ze)this.value="";else this.value=this.operator+this.semver.version;on("comp",this)}parse(e){let t=this.options.loose?Do[Uo.COMPARATORLOOSE]:Do[Uo.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=r[1]!==void 0?r[1]:"",this.operator==="=")this.operator="";if(!r[2])this.semver=Ze;else this.semver=new Bo(r[2],this.options.loose)}toString(){return this.value}test(e){if(on("Comparator.test",e,this.options.loose),this.semver===Ze||e===Ze)return!0;if(typeof e==="string")try{e=new Bo(e,this.options)}catch(t){return!1}return sn(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Ft))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Jo(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new Jo(this.value,t).test(e.semver)}if(t=Ko(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(sn(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(sn(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}Wo.exports=Ft;var Ko=It(),{safeRe:Do,t:Uo}=Re(),sn=Zr(),on=Me(),Bo=P(),Jo=B()});var Qe=d(function(Ww,Go){var ip=B(),sp=(e,t,r)=>{try{t=new ip(t,r)}catch(n){return!1}return t.test(e)};Go.exports=sp});var Mo=d(function(Gw,Ho){var op=B(),ap=(e,t)=>new op(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));Ho.exports=ap});var Vo=d(function(Hw,zo){var cp=P(),up=B(),lp=(e,t,r)=>{let n=null,i=null,s=null;try{s=new up(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===-1)n=o,i=new cp(n,r)}}),n};zo.exports=lp});var Yo=d(function(Mw,Xo){var fp=P(),hp=B(),dp=(e,t,r)=>{let n=null,i=null,s=null;try{s=new hp(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===1)n=o,i=new fp(n,r)}}),n};Xo.exports=dp});var ea=d(function(zw,Qo){var an=P(),pp=B(),Zo=ze(),mp=(e,t)=>{e=new pp(e,t);let r=new an("0.0.0");if(e.test(r))return r;if(r=new an("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],s=null;if(i.forEach((o)=>{let c=new an(o.semver.version);switch(o.operator){case">":if(c.prerelease.length===0)c.patch++;else c.prerelease.push(0);c.raw=c.format();case"":case">=":if(!s||Zo(c,s))s=c;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||Zo(r,s)))r=s}if(r&&e.test(r))return r;return null};Qo.exports=mp});var ra=d(function(Vw,ta){var gp=B(),yp=(e,t)=>{try{return new gp(e,t).range||"*"}catch(r){return null}};ta.exports=yp});var jt=d(function(Xw,oa){var Ep=P(),sa=Ye(),{ANY:Sp}=sa,wp=B(),bp=Qe(),na=ze(),ia=kt(),vp=Lt(),Tp=$t(),Ap=(e,t,r,n)=>{e=new Ep(e,n),t=new wp(t,n);let i,s,o,c,u;switch(r){case">":i=na,s=vp,o=ia,c=">",u=">=";break;case"<":i=ia,s=Tp,o=na,c="<",u="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(bp(e,t,n))return!1;for(let a=0;a<t.set.length;++a){let l=t.set[a],f=null,m=null;if(l.forEach((h)=>{if(h.semver===Sp)h=new sa(">=0.0.0");if(f=f||h,m=m||h,i(h.semver,f.semver,n))f=h;else if(o(h.semver,m.semver,n))m=h}),f.operator===c||f.operator===u)return!1;if((!m.operator||m.operator===c)&&s(e,m.semver))return!1;else if(m.operator===u&&o(e,m.semver))return!1}return!0};oa.exports=Ap});var ca=d(function(Yw,aa){var Ip=jt(),Cp=(e,t,r)=>Ip(e,t,">",r);aa.exports=Cp});var la=d(function(Zw,ua){var Rp=jt(),xp=(e,t,r)=>Rp(e,t,"<",r);ua.exports=xp});var da=d(function(Qw,ha){var fa=B(),_p=(e,t,r)=>(e=new fa(e,r),t=new fa(t,r),e.intersects(t,r));ha.exports=_p});var ma=d(function(eb,pa){var Op=Qe(),kp=U();pa.exports=(e,t,r)=>{let n=[],i=null,s=null,o=e.sort((l,f)=>kp(l,f,r));for(let l of o)if(Op(l,t,r)){if(s=l,!i)i=l}else{if(s)n.push([i,s]);s=null,i=null}if(i)n.push([i,null]);let c=[];for(let[l,f]of n)if(l===f)c.push(l);else if(!f&&l===o[0])c.push("*");else if(!f)c.push(`>=${l}`);else if(l===o[0])c.push(`<=${f}`);else c.push(`${l} - ${f}`);let u=c.join(" || "),a=typeof t.raw==="string"?t.raw:String(t);return u.length<a.length?u:t}});var ba=d(function(tb,wa){var ga=B(),ln=Ye(),{ANY:cn}=ln,un=Qe(),fn=U(),$p=(e,t,r={})=>{if(e===t)return!0;e=new ga(e,r),t=new ga(t,r);let n=!1;e:for(let i of e.set){for(let s of t.set){let o=Pp(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},Lp=[new ln(">=0.0.0-0")],ya=[new ln(">=0.0.0")],Pp=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===cn)if(t.length===1&&t[0].semver===cn)return!0;else if(r.includePrerelease)e=Lp;else e=ya;if(t.length===1&&t[0].semver===cn)if(r.includePrerelease)return!0;else t=ya;let n=new Set,i,s;for(let h of e)if(h.operator===">"||h.operator===">=")i=Ea(i,h,r);else if(h.operator==="<"||h.operator==="<=")s=Sa(s,h,r);else n.add(h.semver);if(n.size>1)return null;let o;if(i&&s){if(o=fn(i.semver,s.semver,r),o>0)return null;else if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let h of n){if(i&&!un(h,String(i),r))return null;if(s&&!un(h,String(s),r))return null;for(let g of t)if(!un(h,String(g),r))return!1;return!0}let c,u,a,l,f=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,m=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;if(f&&f.prerelease.length===1&&s.operator==="<"&&f.prerelease[0]===0)f=!1;for(let h of t){if(l=l||h.operator===">"||h.operator===">=",a=a||h.operator==="<"||h.operator==="<=",i){if(m){if(h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===m.major&&h.semver.minor===m.minor&&h.semver.patch===m.patch)m=!1}if(h.operator===">"||h.operator===">="){if(c=Ea(i,h,r),c===h&&c!==i)return!1}else if(i.operator===">="&&!h.test(i.semver))return!1}if(s){if(f){if(h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch)f=!1}if(h.operator==="<"||h.operator==="<="){if(u=Sa(s,h,r),u===h&&u!==s)return!1}else if(s.operator==="<="&&!h.test(s.semver))return!1}if(!h.operator&&(s||i)&&o!==0)return!1}if(i&&a&&!s&&o!==0)return!1;if(s&&l&&!i&&o!==0)return!1;if(m||f)return!1;return!0},Ea=(e,t,r)=>{if(!e)return t;let n=fn(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},Sa=(e,t,r)=>{if(!e)return t;let n=fn(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};wa.exports=$p});var Ut=d(function(rb,va){var xe=Re(),Kt=he(),Np=P(),Dt=zr(),qp=ne(),Fp=$s(),jp=Ps(),Kp=Fs(),Dp=Ds(),Up=Bs(),Bp=Ws(),Jp=Hs(),Wp=zs(),Gp=U(),Hp=Zs(),Mp=eo(),zp=Ot(),Vp=io(),Xp=oo(),Yp=ze(),Zp=kt(),Qp=Xr(),em=Yr(),tm=$t(),rm=Lt(),nm=Zr(),im=go(),sm=So(),om=Ye(),am=B(),cm=Qe(),um=Mo(),lm=Vo(),fm=Yo(),hm=ea(),dm=ra(),pm=jt(),mm=ca(),gm=la(),ym=da(),Em=ma(),Sm=ba();va.exports={parse:qp,valid:Fp,clean:jp,inc:Kp,diff:Dp,major:Up,minor:Bp,patch:Jp,prerelease:Wp,compare:Gp,rcompare:Hp,compareLoose:Mp,compareBuild:zp,sort:Vp,rsort:Xp,gt:Yp,lt:Zp,eq:Qp,neq:em,gte:tm,lte:rm,cmp:nm,coerce:im,truncate:sm,Comparator:om,Range:am,satisfies:cm,toComparators:um,maxSatisfying:lm,minSatisfying:fm,minVersion:hm,validRange:dm,outside:pm,gtr:mm,ltr:gm,intersects:ym,simplifyRange:Em,subset:Sm,SemVer:Np,re:xe.re,src:xe.src,tokens:xe.t,SEMVER_SPEC_VERSION:Kt.SEMVER_SPEC_VERSION,RELEASE_TYPES:Kt.RELEASE_TYPES,compareIdentifiers:Dt.compareIdentifiers,rcompareIdentifiers:Dt.rcompareIdentifiers}});var Ia=d(function(nb,Aa){var Ta=Ut();Aa.exports=Ta.satisfies(process.version,">=15.7.0")});var xa=d(function(ib,Ra){var Ca=Ut();Ra.exports=Ca.satisfies(process.version,">=16.9.0")});var hn=d(function(sb,_a){var wm=Ia(),bm=xa(),vm={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},Tm={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};_a.exports=function(e,t){if(!e||!t)return;let r=t.asymmetricKeyType;if(!r)return;let n=vm[r];if(!n)throw Error(`Unknown key type "${r}".`);if(!n.includes(e))throw Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(wm)switch(r){case"ec":let i=t.asymmetricKeyDetails.namedCurve,s=Tm[e];if(i!==s)throw Error(`"alg" parameter "${e}" requires curve "${s}".`);break;case"rsa-pss":if(bm){let o=parseInt(e.slice(-3),10),{hashAlgorithm:c,mgf1HashAlgorithm:u,saltLength:a}=t.asymmetricKeyDetails;if(c!==`sha${o}`||u!==c)throw Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(a!==void 0&&a>o>>3)throw Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}break}}});var dn=d(function(ob,Oa){var Am=Ut();Oa.exports=Am.satisfies(process.version,"^6.12.0 || >=8.0.0")});var Pa=d(function(ab,La){var I=He(),Im=Br(),ka=Jr(),Cm=Ur(),Rm=Gr(),xm=hn(),_m=dn(),$a=wt(),{KeyObject:Om,createSecretKey:km,createPublicKey:$m}=require("crypto"),pn=["RS256","RS384","RS512"],Lm=["ES256","ES384","ES512"],mn=["RS256","RS384","RS512"],Pm=["HS256","HS384","HS512"];if(_m)pn.splice(pn.length,0,"PS256","PS384","PS512"),mn.splice(mn.length,0,"PS256","PS384","PS512");La.exports=function(e,t,r,n){if(typeof r==="function"&&!n)n=r,r={};if(!r)r={};r=Object.assign({},r);let i;if(n)i=n;else i=function(l,f){if(l)throw l;return f};if(r.clockTimestamp&&typeof r.clockTimestamp!=="number")return i(new I("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!=="string"||r.nonce.trim()===""))return i(new I("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!=="boolean")return i(new I("allowInvalidAsymmetricKeyTypes must be a boolean"));let s=r.clockTimestamp||Math.floor(Date.now()/1000);if(!e)return i(new I("jwt must be provided"));if(typeof e!=="string")return i(new I("jwt must be a string"));let o=e.split(".");if(o.length!==3)return i(new I("jwt malformed"));let c;try{c=Cm(e,{complete:!0})}catch(l){return i(l)}if(!c)return i(new I("invalid token"));let u=c.header,a;if(typeof t==="function"){if(!n)return i(new I("verify must be called asynchronous if secret or public key is provided as a callback"));a=t}else a=function(l,f){return f(null,t)};return a(u,function(l,f){if(l)return i(new I("error in secret or public key callback: "+l.message));let m=o[2].trim()!=="";if(!m&&f)return i(new I("jwt signature is required"));if(m&&!f)return i(new I("secret or public key must be provided"));if(!m&&!r.algorithms)return i(new I('please specify "none" in "algorithms" to verify unsigned tokens'));if(f!=null&&!(f instanceof Om))try{f=$m(f)}catch(p){try{f=km(typeof f==="string"?Buffer.from(f):f)}catch(b){return i(new I("secretOrPublicKey is not valid key material"))}}if(!r.algorithms)if(f.type==="secret")r.algorithms=Pm;else if(["rsa","rsa-pss"].includes(f.asymmetricKeyType))r.algorithms=mn;else if(f.asymmetricKeyType==="ec")r.algorithms=Lm;else r.algorithms=pn;if(r.algorithms.indexOf(c.header.alg)===-1)return i(new I("invalid algorithm"));if(u.alg.startsWith("HS")&&f.type!=="secret")return i(new I(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));else if(/^(?:RS|PS|ES)/.test(u.alg)&&f.type!=="public")return i(new I(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{xm(u.alg,f)}catch(p){return i(p)}let h;try{h=$a.verify(e,c.header.alg,f)}catch(p){return i(p)}if(!h)return i(new I("invalid signature"));let g=c.payload;if(typeof g.nbf<"u"&&!r.ignoreNotBefore){if(typeof g.nbf!=="number")return i(new I("invalid nbf value"));if(g.nbf>s+(r.clockTolerance||0))return i(new Im("jwt not active",new Date(g.nbf*1000)))}if(typeof g.exp<"u"&&!r.ignoreExpiration){if(typeof g.exp!=="number")return i(new I("invalid exp value"));if(s>=g.exp+(r.clockTolerance||0))return i(new ka("jwt expired",new Date(g.exp*1000)))}if(r.audience){let p=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(g.aud)?g.aud:[g.aud]).some(function(w){return p.some(function(A){return A instanceof RegExp?A.test(w):A===w})}))return i(new I("jwt audience invalid. expected: "+p.join(" or ")))}if(r.issuer){if(typeof r.issuer==="string"&&g.iss!==r.issuer||Array.isArray(r.issuer)&&r.issuer.indexOf(g.iss)===-1)return i(new I("jwt issuer invalid. expected: "+r.issuer))}if(r.subject){if(g.sub!==r.subject)return i(new I("jwt subject invalid. expected: "+r.subject))}if(r.jwtid){if(g.jti!==r.jwtid)return i(new I("jwt jwtid invalid. expected: "+r.jwtid))}if(r.nonce){if(g.nonce!==r.nonce)return i(new I("jwt nonce invalid. expected: "+r.nonce))}if(r.maxAge){if(typeof g.iat!=="number")return i(new I("iat required when maxAge is specified"));let p=Rm(r.maxAge,g.iat);if(typeof p>"u")return i(new I('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(s>=p+(r.clockTolerance||0))return i(new ka("maxAge exceeded",new Date(p*1000)))}if(r.complete===!0){let p=c.signature;return i(null,{header:u,payload:g,signature:p})}return i(null,g)})}});var Da=d(function(cb,Ka){var Na=1/0,Fa=9007199254740991,Nm=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,qa=NaN,qm="[object Arguments]",Fm="[object Function]",jm="[object GeneratorFunction]",Km="[object String]",Dm="[object Symbol]",Um=/^\s+|\s+$/g,Bm=/^[-+]0x[0-9a-f]+$/i,Jm=/^0b[01]+$/i,Wm=/^0o[0-7]+$/i,Gm=/^(?:0|[1-9]\d*)$/,Hm=parseInt;function Mm(e,t){var r=-1,n=e?e.length:0,i=Array(n);while(++r<n)i[r]=t(e[r],r,e);return i}function zm(e,t,r,n){var i=e.length,s=r+(n?1:-1);while(n?s--:++s<i)if(t(e[s],s,e))return s;return-1}function Vm(e,t,r){if(t!==t)return zm(e,Xm,r);var n=r-1,i=e.length;while(++n<i)if(e[n]===t)return n;return-1}function Xm(e){return e!==e}function Ym(e,t){var r=-1,n=Array(e);while(++r<e)n[r]=t(r);return n}function Zm(e,t){return Mm(t,function(r){return e[r]})}function Qm(e,t){return function(r){return e(t(r))}}var Bt=Object.prototype,{hasOwnProperty:yn,toString:Jt,propertyIsEnumerable:eg}=Bt,tg=Qm(Object.keys,Object),rg=Math.max;function ng(e,t){var r=ja(e)||cg(e)?Ym(e.length,String):[],n=r.length,i=!!n;for(var s in e)if((t||yn.call(e,s))&&!(i&&(s=="length"||sg(s,n))))r.push(s);return r}function ig(e){if(!og(e))return tg(e);var t=[];for(var r in Object(e))if(yn.call(e,r)&&r!="constructor")t.push(r);return t}function sg(e,t){return t=t==null?Fa:t,!!t&&(typeof e=="number"||Gm.test(e))&&(e>-1&&e%1==0&&e<t)}function og(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Bt;return e===r}function ag(e,t,r,n){e=En(e)?e:Eg(e),r=r&&!n?mg(r):0;var i=e.length;if(r<0)r=rg(i+r,0);return hg(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Vm(e,t,r)>-1}function cg(e){return ug(e)&&yn.call(e,"callee")&&(!eg.call(e,"callee")||Jt.call(e)==qm)}var ja=Array.isArray;function En(e){return e!=null&&fg(e.length)&&!lg(e)}function ug(e){return Sn(e)&&En(e)}function lg(e){var t=gn(e)?Jt.call(e):"";return t==Fm||t==jm}function fg(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Fa}function gn(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Sn(e){return!!e&&typeof e=="object"}function hg(e){return typeof e=="string"||!ja(e)&&Sn(e)&&Jt.call(e)==Km}function dg(e){return typeof e=="symbol"||Sn(e)&&Jt.call(e)==Dm}function pg(e){if(!e)return e===0?e:0;if(e=gg(e),e===Na||e===-Na){var t=e<0?-1:1;return t*Nm}return e===e?e:0}function mg(e){var t=pg(e),r=t%1;return t===t?r?t-r:t:0}function gg(e){if(typeof e=="number")return e;if(dg(e))return qa;if(gn(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=gn(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Um,"");var r=Jm.test(e);return r||Wm.test(e)?Hm(e.slice(2),r?2:8):Bm.test(e)?qa:+e}function yg(e){return En(e)?ng(e):ig(e)}function Eg(e){return e?Zm(e,yg(e)):[]}Ka.exports=ag});var Ba=d(function(ub,Ua){var Sg="[object Boolean]",wg=Object.prototype,bg=wg.toString;function vg(e){return e===!0||e===!1||Tg(e)&&bg.call(e)==Sg}function Tg(e){return!!e&&typeof e=="object"}Ua.exports=vg});var Ma=d(function(lb,Ha){var Ja=1/0,Ag=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,Wa=NaN,Ig="[object Symbol]",Cg=/^\s+|\s+$/g,Rg=/^[-+]0x[0-9a-f]+$/i,xg=/^0b[01]+$/i,_g=/^0o[0-7]+$/i,Og=parseInt,kg=Object.prototype,$g=kg.toString;function Lg(e){return typeof e=="number"&&e==Fg(e)}function Ga(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Pg(e){return!!e&&typeof e=="object"}function Ng(e){return typeof e=="symbol"||Pg(e)&&$g.call(e)==Ig}function qg(e){if(!e)return e===0?e:0;if(e=jg(e),e===Ja||e===-Ja){var t=e<0?-1:1;return t*Ag}return e===e?e:0}function Fg(e){var t=qg(e),r=t%1;return t===t?r?t-r:t:0}function jg(e){if(typeof e=="number")return e;if(Ng(e))return Wa;if(Ga(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ga(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Cg,"");var r=xg.test(e);return r||_g.test(e)?Og(e.slice(2),r?2:8):Rg.test(e)?Wa:+e}Ha.exports=Lg});var Va=d(function(fb,za){var Kg="[object Number]",Dg=Object.prototype,Ug=Dg.toString;function Bg(e){return!!e&&typeof e=="object"}function Jg(e){return typeof e=="number"||Bg(e)&&Ug.call(e)==Kg}za.exports=Jg});var Qa=d(function(hb,Za){var Wg="[object Object]";function Gg(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function Hg(e,t){return function(r){return e(t(r))}}var Mg=Function.prototype,Xa=Object.prototype,Ya=Mg.toString,zg=Xa.hasOwnProperty,Vg=Ya.call(Object),Xg=Xa.toString,Yg=Hg(Object.getPrototypeOf,Object);function Zg(e){return!!e&&typeof e=="object"}function Qg(e){if(!Zg(e)||Xg.call(e)!=Wg||Gg(e))return!1;var t=Yg(e);if(t===null)return!0;var r=zg.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Ya.call(r)==Vg}Za.exports=Qg});var tc=d(function(db,ec){var ey="[object String]",ty=Object.prototype,ry=ty.toString,ny=Array.isArray;function iy(e){return!!e&&typeof e=="object"}function sy(e){return typeof e=="string"||!ny(e)&&iy(e)&&ry.call(e)==ey}ec.exports=sy});var oc=d(function(pb,sc){var oy="Expected a function",rc=1/0,ay=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,nc=NaN,cy="[object Symbol]",uy=/^\s+|\s+$/g,ly=/^[-+]0x[0-9a-f]+$/i,fy=/^0b[01]+$/i,hy=/^0o[0-7]+$/i,dy=parseInt,py=Object.prototype,my=py.toString;function gy(e,t){var r;if(typeof t!="function")throw TypeError(oy);return e=by(e),function(){if(--e>0)r=t.apply(this,arguments);if(e<=1)t=void 0;return r}}function yy(e){return gy(2,e)}function ic(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Ey(e){return!!e&&typeof e=="object"}function Sy(e){return typeof e=="symbol"||Ey(e)&&my.call(e)==cy}function wy(e){if(!e)return e===0?e:0;if(e=vy(e),e===rc||e===-rc){var t=e<0?-1:1;return t*ay}return e===e?e:0}function by(e){var t=wy(e),r=t%1;return t===t?r?t-r:t:0}function vy(e){if(typeof e=="number")return e;if(Sy(e))return nc;if(ic(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ic(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(uy,"");var r=fy.test(e);return r||hy.test(e)?dy(e.slice(2),r?2:8):ly.test(e)?nc:+e}sc.exports=yy});var mc=d(function(mb,pc){var ac=Gr(),Ty=dn(),Ay=hn(),Gt=wt(),lc=Da(),Wt=Ba(),cc=Ma(),wn=Va(),fc=Qa(),ie=tc(),Iy=oc(),{KeyObject:Cy,createSecretKey:Ry,createPrivateKey:xy}=require("crypto"),hc=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];if(Ty)hc.splice(3,0,"PS256","PS384","PS512");var _y={expiresIn:{isValid:function(e){return cc(e)||ie(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return cc(e)||ie(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return ie(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:lc.bind(null,hc),message:'"algorithm" must be a valid string enum value'},header:{isValid:fc,message:'"header" must be an object'},encoding:{isValid:ie,message:'"encoding" must be a string'},issuer:{isValid:ie,message:'"issuer" must be a string'},subject:{isValid:ie,message:'"subject" must be a string'},jwtid:{isValid:ie,message:'"jwtid" must be a string'},noTimestamp:{isValid:Wt,message:'"noTimestamp" must be a boolean'},keyid:{isValid:ie,message:'"keyid" must be a string'},mutatePayload:{isValid:Wt,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:Wt,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:Wt,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},Oy={iat:{isValid:wn,message:'"iat" should be a number of seconds'},exp:{isValid:wn,message:'"exp" should be a number of seconds'},nbf:{isValid:wn,message:'"nbf" should be a number of seconds'}};function dc(e,t,r,n){if(!fc(r))throw Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(i){let s=e[i];if(!s){if(!t)throw Error('"'+i+'" is not allowed in "'+n+'"');return}if(!s.isValid(r[i]))throw Error(s.message)})}function ky(e){return dc(_y,!1,e,"options")}function $y(e){return dc(Oy,!0,e,"payload")}var uc={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},Ly=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];pc.exports=function(e,t,r,n){if(typeof r==="function")n=r,r={};else r=r||{};let i=typeof e==="object"&&!Buffer.isBuffer(e),s=Object.assign({alg:r.algorithm||"HS256",typ:i?"JWT":void 0,kid:r.keyid},r.header);function o(a){if(n)return n(a);throw a}if(!t&&r.algorithm!=="none")return o(Error("secretOrPrivateKey must have a value"));if(t!=null&&!(t instanceof Cy))try{t=xy(t)}catch(a){try{t=Ry(typeof t==="string"?Buffer.from(t):t)}catch(l){return o(Error("secretOrPrivateKey is not valid key material"))}}if(s.alg.startsWith("HS")&&t.type!=="secret")return o(Error(`secretOrPrivateKey must be a symmetric key when using ${s.alg}`));else if(/^(?:RS|PS|ES)/.test(s.alg)){if(t.type!=="private")return o(Error(`secretOrPrivateKey must be an asymmetric key when using ${s.alg}`));if(!r.allowInsecureKeySizes&&!s.alg.startsWith("ES")&&t.asymmetricKeyDetails!==void 0&&t.asymmetricKeyDetails.modulusLength<2048)return o(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`))}if(typeof e>"u")return o(Error("payload is required"));else if(i){try{$y(e)}catch(a){return o(a)}if(!r.mutatePayload)e=Object.assign({},e)}else{let a=Ly.filter(function(l){return typeof r[l]<"u"});if(a.length>0)return o(Error("invalid "+a.join(",")+" option for "+typeof e+" payload"))}if(typeof e.exp<"u"&&typeof r.expiresIn<"u")return o(Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof e.nbf<"u"&&typeof r.notBefore<"u")return o(Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{ky(r)}catch(a){return o(a)}if(!r.allowInvalidAsymmetricKeyTypes)try{Ay(s.alg,t)}catch(a){return o(a)}let c=e.iat||Math.floor(Date.now()/1000);if(r.noTimestamp)delete e.iat;else if(i)e.iat=c;if(typeof r.notBefore<"u"){try{e.nbf=ac(r.notBefore,c)}catch(a){return o(a)}if(typeof e.nbf>"u")return o(Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof r.expiresIn<"u"&&typeof e==="object"){try{e.exp=ac(r.expiresIn,c)}catch(a){return o(a)}if(typeof e.exp>"u")return o(Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(uc).forEach(function(a){let l=uc[a];if(typeof r[a]<"u"){if(typeof e[l]<"u")return o(Error('Bad "options.'+a+'" option. The payload already has an "'+l+'" property.'));e[l]=r[a]}});let u=r.encoding||"utf8";if(typeof n==="function")n=n&&Iy(n),Gt.createSign({header:s,privateKey:t,payload:e,encoding:u}).once("error",n).once("done",function(a){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&a.length<256)return n(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`));n(null,a)});else{let a=Gt.sign({header:s,payload:e,secret:t,encoding:u});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&a.length<256)throw Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`);return a}}});var yc=d(function(gb,gc){gc.exports={decode:Ur(),verify:Pa(),sign:mc(),JsonWebTokenError:He(),NotBeforeError:Br(),TokenExpiredError:Jr()}});var bn=d(function(yb,Ec){function Py(e){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=c,r.humanize=Wr(),r.destroy=a,Object.keys(e).forEach((l)=>{r[l]=e[l]}),r.names=[],r.skips=[],r.formatters={};function t(l){let f=0;for(let m=0;m<l.length;m++)f=(f<<5)-f+l.charCodeAt(m),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=t;function r(l){let f,m=null,h,g;function p(...b){if(!p.enabled)return;let S=p,w=Number(new Date),A=w-(f||w);if(S.diff=A,S.prev=f,S.curr=w,f=w,b[0]=r.coerce(b[0]),typeof b[0]!=="string")b.unshift("%O");let T=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(K,G)=>{if(K==="%%")return"%";T++;let z=r.formatters[G];if(typeof z==="function"){let V=b[T];K=z.call(S,V),b.splice(T,1),T--}return K}),r.formatArgs.call(S,b),(S.log||r.log).apply(S,b)}if(p.namespace=l,p.useColors=r.useColors(),p.color=r.selectColor(l),p.extend=n,p.destroy=r.destroy,Object.defineProperty(p,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(m!==null)return m;if(h!==r.namespaces)h=r.namespaces,g=r.enabled(l);return g},set:(b)=>{m=b}}),typeof r.init==="function")r.init(p);return p}function n(l,f){let m=r(this.namespace+(typeof f>"u"?":":f)+l);return m.log=this.log,m}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f=(typeof l==="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of f)if(m[0]==="-")r.skips.push(m.slice(1));else r.names.push(m)}function s(l,f){let m=0,h=0,g=-1,p=0;while(m<l.length)if(h<f.length&&(f[h]===l[m]||f[h]==="*"))if(f[h]==="*")g=h,p=m,h++;else m++,h++;else if(g!==-1)h=g+1,p++,m=p;else return!1;while(h<f.length&&f[h]==="*")h++;return h===f.length}function o(){let l=[...r.names,...r.skips.map((f)=>"-"+f)].join(",");return r.enable(""),l}function c(l){for(let f of r.skips)if(s(l,f))return!1;for(let f of r.names)if(s(l,f))return!0;return!1}function u(l){if(l instanceof Error)return l.stack||l.message;return l}function a(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}Ec.exports=Py});var Sc=d(function(j,Ht){j.formatArgs=qy;j.save=Fy;j.load=jy;j.useColors=Ny;j.storage=Ky();j.destroy=(()=>{let e=!1;return()=>{if(!e)e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();j.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Ny(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function qy(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+Ht.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,(i)=>{if(i==="%%")return;if(r++,i==="%c")n=r}),e.splice(n,0,t)}j.log=console.debug||console.log||(()=>{});function Fy(e){try{if(e)j.storage.setItem("debug",e);else j.storage.removeItem("debug")}catch(t){}}function jy(){let e;try{e=j.storage.getItem("debug")||j.storage.getItem("DEBUG")}catch(t){}if(!e&&typeof process<"u"&&"env"in process)e=process.env.DEBUG;return e}function Ky(){try{return localStorage}catch(e){}}Ht.exports=bn()(j);var{formatters:Dy}=Ht.exports;Dy.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var bc=d(function(Eb,wc){wc.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n<i)}});var Ac=d(function(Sb,Tc){var vc=require("os"),Mt=require("tty"),J=bc(),{env:k}=process,se;if(J("no-color")||J("no-colors")||J("color=false")||J("color=never"))se=0;else if(J("color")||J("colors")||J("color=true")||J("color=always"))se=1;if("FORCE_COLOR"in k)if(k.FORCE_COLOR==="true")se=1;else if(k.FORCE_COLOR==="false")se=0;else se=k.FORCE_COLOR.length===0?1:Math.min(parseInt(k.FORCE_COLOR,10),3);function vn(e){if(e===0)return!1;return{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Tn(e,t){if(se===0)return 0;if(J("color=16m")||J("color=full")||J("color=truecolor"))return 3;if(J("color=256"))return 2;if(e&&!t&&se===void 0)return 0;let r=se||0;if(k.TERM==="dumb")return r;if(process.platform==="win32"){let n=vc.release().split(".");if(Number(n[0])>=10&&Number(n[2])>=10586)return Number(n[2])>=14931?3:2;return 1}if("CI"in k){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((n)=>(n in k))||k.CI_NAME==="codeship")return 1;return r}if("TEAMCITY_VERSION"in k)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(k.TEAMCITY_VERSION)?1:0;if(k.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in k){let n=parseInt((k.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(k.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(k.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(k.TERM))return 1;if("COLORTERM"in k)return 1;return r}function Uy(e){let t=Tn(e,e&&e.isTTY);return vn(t)}Tc.exports={supportsColor:Uy,stdout:vn(Tn(!0,Mt.isatty(1))),stderr:vn(Tn(!0,Mt.isatty(2)))}});var Rc=d(function(L,zt){var Ic=require("tty"),oe=require("util");L.init=zy;L.log=Gy;L.formatArgs=Jy;L.save=Hy;L.load=My;L.useColors=By;L.destroy=oe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");L.colors=[6,2,3,4,5,1];try{let e=Ac();if(e&&(e.stderr||e).level>=2)L.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(e){}L.inspectOpts=Object.keys(process.env).filter((e)=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[t];if(/^(yes|on|true|enabled)$/i.test(n))n=!0;else if(/^(no|off|false|disabled)$/i.test(n))n=!1;else if(n==="null")n=null;else n=Number(n);return e[r]=n,e},{});function By(){return"colors"in L.inspectOpts?Boolean(L.inspectOpts.colors):Ic.isatty(process.stderr.fd)}function Jy(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${t} \x1B[0m`;e[0]=s+e[0].split(`
3
+ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,We="secret must be a string or buffer",be="key must be a string or a buffer",$f="key must be a string, a buffer or an object",qr=typeof D.createPublicKey==="function";if(qr)be+=" or a KeyObject",We+="or a KeyObject";function Ui(e){if(ve.isBuffer(e))return;if(typeof e==="string")return;if(!qr)throw H(be);if(typeof e!=="object")throw H(be);if(typeof e.type!=="string")throw H(be);if(typeof e.asymmetricKeyType!=="string")throw H(be);if(typeof e.export!=="function")throw H(be)}function Bi(e){if(ve.isBuffer(e))return;if(typeof e==="string")return;if(typeof e==="object")return;throw H($f)}function Pf(e){if(ve.isBuffer(e))return;if(typeof e==="string")return e;if(!qr)throw H(We);if(typeof e!=="object")throw H(We);if(e.type!=="secret")throw H(We);if(typeof e.export!=="function")throw H(We)}function Fr(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Ji(e){e=e.toString();var t=4-e.length%4;if(t!==4)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function H(e){var t=[].slice.call(arguments,1),r=Ki.format.bind(Ki,e).apply(null,t);return TypeError(r)}function Lf(e){return ve.isBuffer(e)||typeof e==="string"}function Ge(e){if(!Lf(e))e=JSON.stringify(e);return e}function Wi(e){return function(r,n){Pf(n),r=Ge(r);var i=D.createHmac("sha"+e,n),s=(i.update(r),i.digest("base64"));return Fr(s)}}var Nr,Nf="timingSafeEqual"in D?function(t,r){if(t.byteLength!==r.byteLength)return!1;return D.timingSafeEqual(t,r)}:function(t,r){if(!Nr)Nr=ji();return Nr(t,r)};function qf(e){return function(r,n,i){var s=Wi(e)(r,i);return Nf(ve.from(n),ve.from(s))}}function Gi(e){return function(r,n){Bi(n),r=Ge(r);var i=D.createSign("RSA-SHA"+e),s=(i.update(r),i.sign(n,"base64"));return Fr(s)}}function Hi(e){return function(r,n,i){Ui(i),r=Ge(r),n=Ji(n);var s=D.createVerify("RSA-SHA"+e);return s.update(r),s.verify(i,n,"base64")}}function Ff(e){return function(r,n){Bi(n),r=Ge(r);var i=D.createSign("RSA-SHA"+e),s=(i.update(r),i.sign({key:n,padding:D.constants.RSA_PKCS1_PSS_PADDING,saltLength:D.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Fr(s)}}function jf(e){return function(r,n,i){Ui(i),r=Ge(r),n=Ji(n);var s=D.createVerify("RSA-SHA"+e);return s.update(r),s.verify({key:i,padding:D.constants.RSA_PKCS1_PSS_PADDING,saltLength:D.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function Kf(e){var t=Gi(e);return function(){var n=t.apply(null,arguments);return n=Di.derToJose(n,"ES"+e),n}}function Df(e){var t=Hi(e);return function(n,i,s){i=Di.joseToDer(i,"ES"+e).toString("base64");var o=t(n,i,s);return o}}function Uf(){return function(){return""}}function Bf(){return function(t,r){return r===""}}Mi.exports=function(t){var r={hs:Wi,rs:Gi,ps:Ff,es:Kf,none:Uf},n={hs:qf,rs:Hi,ps:jf,es:Df,none:Bf},i=t.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw H(kf,t);var s=(i[1]||i[3]).toLowerCase(),o=i[2];return{sign:r[s](o),verify:n[s](o)}}});var Kr=d(function(tS,zi){var Jf=require("buffer").Buffer;zi.exports=function(t){if(typeof t==="string")return t;if(typeof t==="number"||Jf.isBuffer(t))return t.toString();return JSON.stringify(t)}});var es=d(function(rS,Qi){var Wf=Se().Buffer,Vi=$r(),Gf=jr(),Hf=require("stream"),Xi=Kr(),Dr=require("util");function Yi(e,t){return Wf.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Mf(e,t,r){r=r||"utf8";var n=Yi(Xi(e),"binary"),i=Yi(Xi(t),r);return Dr.format("%s.%s",n,i)}function Zi(e){var{header:t,payload:r}=e,n=e.secret||e.privateKey,i=e.encoding,s=Gf(t.alg),o=Mf(t,r,i),c=s.sign(o,n);return Dr.format("%s.%s",o,c)}function Et(e){var t=e.secret;if(t=t==null?e.privateKey:t,t=t==null?e.key:t,/^hs/i.test(e.header.alg)===!0&&t==null)throw TypeError("secret must be a string or buffer or a KeyObject");var r=new Vi(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new Vi(e.payload),this.secret.once("close",function(){if(!this.payload.writable&&this.readable)this.sign()}.bind(this)),this.payload.once("close",function(){if(!this.secret.writable&&this.readable)this.sign()}.bind(this))}Dr.inherits(Et,Hf);Et.prototype.sign=function(){try{var t=Zi({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",t),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}};Et.sign=Zi;Qi.exports=Et});var ls=d(function(nS,us){var rs=Se().Buffer,ts=$r(),zf=jr(),Vf=require("stream"),ns=Kr(),Xf=require("util"),Yf=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function Zf(e){return Object.prototype.toString.call(e)==="[object Object]"}function Qf(e){if(Zf(e))return e;try{return JSON.parse(e)}catch(t){return}}function is(e){var t=e.split(".",1)[0];return Qf(rs.from(t,"base64").toString("binary"))}function eh(e){return e.split(".",2).join(".")}function ss(e){return e.split(".")[2]}function th(e,t){t=t||"utf8";var r=e.split(".")[1];return rs.from(r,"base64").toString(t)}function os(e){return Yf.test(e)&&!!is(e)}function as(e,t,r){if(!t){var n=Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}e=ns(e);var i=ss(e),s=eh(e),o=zf(t);return o.verify(s,i,r)}function cs(e,t){if(t=t||{},e=ns(e),!os(e))return null;var r=is(e);if(!r)return null;var n=th(e);if(r.typ==="JWT"||t.json)n=JSON.parse(n,t.encoding);return{header:r,payload:n,signature:ss(e)}}function Te(e){e=e||{};var t=e.secret;if(t=t==null?e.publicKey:t,t=t==null?e.key:t,/^hs/i.test(e.algorithm)===!0&&t==null)throw TypeError("secret must be a string or buffer or a KeyObject");var r=new ts(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new ts(e.signature),this.secret.once("close",function(){if(!this.signature.writable&&this.readable)this.verify()}.bind(this)),this.signature.once("close",function(){if(!this.secret.writable&&this.readable)this.verify()}.bind(this))}Xf.inherits(Te,Vf);Te.prototype.verify=function(){try{var t=as(this.signature.buffer,this.algorithm,this.key.buffer),r=cs(this.signature.buffer,this.encoding);return this.emit("done",t,r),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};Te.decode=cs;Te.isValid=os;Te.verify=as;us.exports=Te});var St=d(function(re){var fs=es(),wt=ls(),rh=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];re.ALGORITHMS=rh;re.sign=fs.sign;re.verify=wt.verify;re.decode=wt.decode;re.isValid=wt.isValid;re.createSign=function(t){return new fs(t)};re.createVerify=function(t){return new wt(t)}});var Ur=d(function(sS,hs){var nh=St();hs.exports=function(e,t){t=t||{};var r=nh.decode(e,t);if(!r)return null;var n=r.payload;if(typeof n==="string")try{var i=JSON.parse(n);if(i!==null&&typeof i==="object")n=i}catch(s){}if(t.complete===!0)return{header:r.header,payload:n,signature:r.signature};return n}});var He=d(function(oS,ds){var bt=function(e,t){if(Error.call(this,e),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);if(this.name="JsonWebTokenError",this.message=e,t)this.inner=t};bt.prototype=Object.create(Error.prototype);bt.prototype.constructor=bt;ds.exports=bt});var Br=d(function(aS,ms){var ps=He(),vt=function(e,t){ps.call(this,e),this.name="NotBeforeError",this.date=t};vt.prototype=Object.create(ps.prototype);vt.prototype.constructor=vt;ms.exports=vt});var Jr=d(function(cS,ys){var gs=He(),Tt=function(e,t){gs.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};Tt.prototype=Object.create(gs.prototype);Tt.prototype.constructor=Tt;ys.exports=Tt});var Wr=d(function(uS,Es){var Ae=1000,Ie=Ae*60,Ce=Ie*60,fe=Ce*24,ih=fe*7,sh=fe*365.25;Es.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return oh(e);else if(r==="number"&&isFinite(e))return t.long?ch(e):ah(e);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function oh(e){if(e=String(e),e.length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*sh;case"weeks":case"week":case"w":return r*ih;case"days":case"day":case"d":return r*fe;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Ce;case"minutes":case"minute":case"mins":case"min":case"m":return r*Ie;case"seconds":case"second":case"secs":case"sec":case"s":return r*Ae;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}function ah(e){var t=Math.abs(e);if(t>=fe)return Math.round(e/fe)+"d";if(t>=Ce)return Math.round(e/Ce)+"h";if(t>=Ie)return Math.round(e/Ie)+"m";if(t>=Ae)return Math.round(e/Ae)+"s";return e+"ms"}function ch(e){var t=Math.abs(e);if(t>=fe)return At(e,t,fe,"day");if(t>=Ce)return At(e,t,Ce,"hour");if(t>=Ie)return At(e,t,Ie,"minute");if(t>=Ae)return At(e,t,Ae,"second");return e+" ms"}function At(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}});var Gr=d(function(lS,ws){var uh=Wr();ws.exports=function(e,t){var r=t||Math.floor(Date.now()/1000);if(typeof e==="string"){var n=uh(e);if(typeof n>"u")return;return Math.floor(r+n/1000)}else if(typeof e==="number")return r+e;else return}});var he=d(function(fS,Ss){var lh=Number.MAX_SAFE_INTEGER||9007199254740991,fh=["\t",`
4
+ `,"\v","\f","\r"," "," "," "," "," "," "," "," "," "," "," "," "," "," ","\u2028","\u2029"," "," "," ","\uFEFF"],hh=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Ss.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:lh,WHITESPACE_CHARACTERS:fh,RELEASE_TYPES:hh,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Me=d(function(hS,bs){var dh=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};bs.exports=dh});var Re=d(function(X,vs){var{MAX_SAFE_COMPONENT_LENGTH:Hr,MAX_SAFE_BUILD_LENGTH:ph,MAX_LENGTH:mh}=he(),gh=Me();X=vs.exports={};var yh=X.re=[],Eh=X.safeRe=[],y=X.src=[],wh=X.safeSrc=[],E=X.t={},Sh=0,Mr="[a-zA-Z0-9-]",bh=[["\\s",1],["\\d",mh],[Mr,ph]],vh=(e)=>{for(let[t,r]of bh)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},v=(e,t,r)=>{let n=vh(t),i=Sh++;gh(e,i,t),E[e]=i,y[i]=t,wh[i]=n,yh[i]=new RegExp(t,r?"g":void 0),Eh[i]=new RegExp(n,r?"g":void 0)};v("NUMERICIDENTIFIER","0|[1-9]\\d*");v("NUMERICIDENTIFIERLOOSE","\\d+");v("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Mr}*`);v("MAINVERSION",`(${y[E.NUMERICIDENTIFIER]})\\.(${y[E.NUMERICIDENTIFIER]})\\.(${y[E.NUMERICIDENTIFIER]})`);v("MAINVERSIONLOOSE",`(${y[E.NUMERICIDENTIFIERLOOSE]})\\.(${y[E.NUMERICIDENTIFIERLOOSE]})\\.(${y[E.NUMERICIDENTIFIERLOOSE]})`);v("PRERELEASEIDENTIFIER",`(?:${y[E.NONNUMERICIDENTIFIER]}|${y[E.NUMERICIDENTIFIER]})`);v("PRERELEASEIDENTIFIERLOOSE",`(?:${y[E.NONNUMERICIDENTIFIER]}|${y[E.NUMERICIDENTIFIERLOOSE]})`);v("PRERELEASE",`(?:-(${y[E.PRERELEASEIDENTIFIER]}(?:\\.${y[E.PRERELEASEIDENTIFIER]})*))`);v("PRERELEASELOOSE",`(?:-?(${y[E.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${y[E.PRERELEASEIDENTIFIERLOOSE]})*))`);v("BUILDIDENTIFIER",`${Mr}+`);v("BUILD",`(?:\\+(${y[E.BUILDIDENTIFIER]}(?:\\.${y[E.BUILDIDENTIFIER]})*))`);v("FULLPLAIN",`v?${y[E.MAINVERSION]}${y[E.PRERELEASE]}?${y[E.BUILD]}?`);v("FULL",`^${y[E.FULLPLAIN]}$`);v("LOOSEPLAIN",`[v=\\s]*${y[E.MAINVERSIONLOOSE]}${y[E.PRERELEASELOOSE]}?${y[E.BUILD]}?`);v("LOOSE",`^${y[E.LOOSEPLAIN]}$`);v("GTLT","((?:<|>)?=?)");v("XRANGEIDENTIFIERLOOSE",`${y[E.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);v("XRANGEIDENTIFIER",`${y[E.NUMERICIDENTIFIER]}|x|X|\\*`);v("XRANGEPLAIN",`[v=\\s]*(${y[E.XRANGEIDENTIFIER]})(?:\\.(${y[E.XRANGEIDENTIFIER]})(?:\\.(${y[E.XRANGEIDENTIFIER]})(?:${y[E.PRERELEASE]})?${y[E.BUILD]}?)?)?`);v("XRANGEPLAINLOOSE",`[v=\\s]*(${y[E.XRANGEIDENTIFIERLOOSE]})(?:\\.(${y[E.XRANGEIDENTIFIERLOOSE]})(?:\\.(${y[E.XRANGEIDENTIFIERLOOSE]})(?:${y[E.PRERELEASELOOSE]})?${y[E.BUILD]}?)?)?`);v("XRANGE",`^${y[E.GTLT]}\\s*${y[E.XRANGEPLAIN]}$`);v("XRANGELOOSE",`^${y[E.GTLT]}\\s*${y[E.XRANGEPLAINLOOSE]}$`);v("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Hr}})(?:\\.(\\d{1,${Hr}}))?(?:\\.(\\d{1,${Hr}}))?`);v("COERCE",`${y[E.COERCEPLAIN]}(?:$|[^\\d])`);v("COERCEFULL",y[E.COERCEPLAIN]+`(?:${y[E.PRERELEASE]})?(?:${y[E.BUILD]})?(?:$|[^\\d])`);v("COERCERTL",y[E.COERCE],!0);v("COERCERTLFULL",y[E.COERCEFULL],!0);v("LONETILDE","(?:~>?)");v("TILDETRIM",`(\\s*)${y[E.LONETILDE]}\\s+`,!0);X.tildeTrimReplace="$1~";v("TILDE",`^${y[E.LONETILDE]}${y[E.XRANGEPLAIN]}$`);v("TILDELOOSE",`^${y[E.LONETILDE]}${y[E.XRANGEPLAINLOOSE]}$`);v("LONECARET","(?:\\^)");v("CARETTRIM",`(\\s*)${y[E.LONECARET]}\\s+`,!0);X.caretTrimReplace="$1^";v("CARET",`^${y[E.LONECARET]}${y[E.XRANGEPLAIN]}$`);v("CARETLOOSE",`^${y[E.LONECARET]}${y[E.XRANGEPLAINLOOSE]}$`);v("COMPARATORLOOSE",`^${y[E.GTLT]}\\s*(${y[E.LOOSEPLAIN]})$|^$`);v("COMPARATOR",`^${y[E.GTLT]}\\s*(${y[E.FULLPLAIN]})$|^$`);v("COMPARATORTRIM",`(\\s*)${y[E.GTLT]}\\s*(${y[E.LOOSEPLAIN]}|${y[E.XRANGEPLAIN]})`,!0);X.comparatorTrimReplace="$1$2$3";v("HYPHENRANGE",`^\\s*(${y[E.XRANGEPLAIN]})\\s+-\\s+(${y[E.XRANGEPLAIN]})\\s*$`);v("HYPHENRANGELOOSE",`^\\s*(${y[E.XRANGEPLAINLOOSE]})\\s+-\\s+(${y[E.XRANGEPLAINLOOSE]})\\s*$`);v("STAR","(<|>)?=?\\s*\\*");v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var It=d(function(dS,Ts){var Th=Object.freeze({loose:!0}),Ah=Object.freeze({}),Ih=(e)=>{if(!e)return Ah;if(typeof e!=="object")return Th;return e};Ts.exports=Ih});var zr=d(function(pS,Cs){var As=/^[0-9]+$/,Is=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=As.test(e),n=As.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},Ch=(e,t)=>Is(t,e);Cs.exports={compareIdentifiers:Is,rcompareIdentifiers:Ch}});var L=d(function(mS,xs){var Ct=Me(),{MAX_LENGTH:Rs,MAX_SAFE_INTEGER:Rt}=he(),{safeRe:xt,t:_t}=Re(),Rh=It(),{compareIdentifiers:Vr}=zr(),xh=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(Vr(e[n],r[n])!==0)return!1;return!0};class M{constructor(e,t){if(t=Rh(t),e instanceof M)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Rs)throw TypeError(`version is longer than ${Rs} characters`);Ct("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?xt[_t.LOOSE]:xt[_t.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Rt||this.major<0)throw TypeError("Invalid major version");if(this.minor>Rt||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Rt||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((n)=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<Rt)return i}return n});this.build=r[5]?r[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(Ct("SemVer.compare",this.version,this.options,e),!(e instanceof M)){if(typeof e==="string"&&e===this.version)return 0;e=new M(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof M))e=new M(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof M))e=new M(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(Ct("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return Vr(r,n)}while(++t)}compareBuild(e){if(!(e instanceof M))e=new M(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(Ct("build compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return Vr(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?xt[_t.PRERELEASELOOSE]:xt[_t.PRERELEASE]);if(!n||n[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,r);this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let i=this.prerelease.length;while(--i>=0)if(typeof this.prerelease[i]==="number")this.prerelease[i]++,i=-2;if(i===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let i=[t,n];if(r===!1)i=[t];if(xh(this.prerelease,t)){let s=this.prerelease[t.split(".").length];if(isNaN(s))this.prerelease=i}else this.prerelease=i}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}xs.exports=M});var ne=d(function(gS,Os){var _s=L(),_h=(e,t,r=!1)=>{if(e instanceof _s)return e;try{return new _s(e,t)}catch(n){if(!r)return null;throw n}};Os.exports=_h});var $s=d(function(yS,ks){var Oh=ne(),kh=(e,t)=>{let r=Oh(e,t);return r?r.version:null};ks.exports=kh});var Ls=d(function(ES,Ps){var $h=ne(),Ph=(e,t)=>{let r=$h(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Ps.exports=Ph});var Fs=d(function(wS,qs){var Ns=L(),Lh=(e,t,r,n,i)=>{if(typeof r==="string")i=n,n=r,r=void 0;try{return new Ns(e instanceof Ns?e.version:e,r).inc(t,n,i).version}catch(s){return null}};qs.exports=Lh});var Ds=d(function(SS,Ks){var js=ne(),Nh=(e,t)=>{let r=js(e,null,!0),n=js(t,null,!0),i=r.compare(n);if(i===0)return null;let s=i>0,o=s?r:n,c=s?n:r,u=!!o.prerelease.length;if(!!c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(c.compareMain(o)===0){if(c.minor&&!c.patch)return"minor";return"patch"}}let l=u?"pre":"";if(r.major!==n.major)return l+"major";if(r.minor!==n.minor)return l+"minor";if(r.patch!==n.patch)return l+"patch";return"prerelease"};Ks.exports=Nh});var Bs=d(function(bS,Us){var qh=L(),Fh=(e,t)=>new qh(e,t).major;Us.exports=Fh});var Ws=d(function(vS,Js){var jh=L(),Kh=(e,t)=>new jh(e,t).minor;Js.exports=Kh});var Hs=d(function(TS,Gs){var Dh=L(),Uh=(e,t)=>new Dh(e,t).patch;Gs.exports=Uh});var zs=d(function(AS,Ms){var Bh=ne(),Jh=(e,t)=>{let r=Bh(e,t);return r&&r.prerelease.length?r.prerelease:null};Ms.exports=Jh});var U=d(function(IS,Xs){var Vs=L(),Wh=(e,t,r)=>new Vs(e,r).compare(new Vs(t,r));Xs.exports=Wh});var Zs=d(function(CS,Ys){var Gh=U(),Hh=(e,t,r)=>Gh(t,e,r);Ys.exports=Hh});var eo=d(function(RS,Qs){var Mh=U(),zh=(e,t)=>Mh(e,t,!0);Qs.exports=zh});var Ot=d(function(xS,ro){var to=L(),Vh=(e,t,r)=>{let n=new to(e,r),i=new to(t,r);return n.compare(i)||n.compareBuild(i)};ro.exports=Vh});var io=d(function(_S,no){var Xh=Ot(),Yh=(e,t)=>e.sort((r,n)=>Xh(r,n,t));no.exports=Yh});var oo=d(function(OS,so){var Zh=Ot(),Qh=(e,t)=>e.sort((r,n)=>Zh(n,r,t));so.exports=Qh});var ze=d(function(kS,ao){var ed=U(),td=(e,t,r)=>ed(e,t,r)>0;ao.exports=td});var kt=d(function($S,co){var rd=U(),nd=(e,t,r)=>rd(e,t,r)<0;co.exports=nd});var Xr=d(function(PS,uo){var id=U(),sd=(e,t,r)=>id(e,t,r)===0;uo.exports=sd});var Yr=d(function(LS,lo){var od=U(),ad=(e,t,r)=>od(e,t,r)!==0;lo.exports=ad});var $t=d(function(NS,fo){var cd=U(),ud=(e,t,r)=>cd(e,t,r)>=0;fo.exports=ud});var Pt=d(function(qS,ho){var ld=U(),fd=(e,t,r)=>ld(e,t,r)<=0;ho.exports=fd});var Zr=d(function(FS,po){var hd=Xr(),dd=Yr(),pd=ze(),md=$t(),gd=kt(),yd=Pt(),Ed=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e===r;case"!==":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e!==r;case"":case"=":case"==":return hd(e,r,n);case"!=":return dd(e,r,n);case">":return pd(e,r,n);case">=":return md(e,r,n);case"<":return gd(e,r,n);case"<=":return yd(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};po.exports=Ed});var go=d(function(jS,mo){var wd=L(),Sd=ne(),{safeRe:Lt,t:Nt}=Re(),bd=(e,t)=>{if(e instanceof wd)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Lt[Nt.COERCEFULL]:Lt[Nt.COERCE]);else{let u=t.includePrerelease?Lt[Nt.COERCERTLFULL]:Lt[Nt.COERCERTL],a;while((a=u.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||a.index+a[0].length!==r.index+r[0].length)r=a;u.lastIndex=a.index+a[1].length+a[2].length}u.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",s=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",c=t.includePrerelease&&r[6]?`+${r[6]}`:"";return Sd(`${n}.${i}.${s}${o}${c}`,t)};mo.exports=bd});var wo=d(function(KS,Eo){var vd=ne(),yo=he(),Td=L(),Ad=(e,t,r)=>{if(!yo.RELEASE_TYPES.includes(t))return null;let n=Id(e,r);return n&&Cd(n,t)},Id=(e,t)=>{let r=e instanceof Td?e.version:e;return vd(r,t)},Cd=(e,t)=>{if(Rd(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},Rd=(e)=>e.startsWith("pre");Eo.exports=Ad});var vo=d(function(DS,bo){class So{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}}bo.exports=So});var Lo=d(function(US,Po){var{MAX_LENGTH:en,MAX_SAFE_BUILD_LENGTH:Co,WHITESPACE_CHARACTERS:xd}=he(),Ro=new Uint8Array(65536);for(let e of xd)Ro[e.charCodeAt(0)]=1;var tn=(e)=>e!==void 0&&Ro[e.charCodeAt(0)]===1,To=(e)=>e==="v"||e==="="||tn(e),Ve=(e)=>e!==void 0&&e>="0"&&e<="9",xo=(e)=>e!==void 0&&(e>="a"&&e<="z"||e>="A"&&e<="Z"),_o=(e)=>Ve(e)||xo(e)||e==="-",rn=(e)=>Ve(e)||e==="x"||e==="X"||e==="*",Oo=(e,t,r,n)=>{if(!Ve(e[t]))return t;if(t>=n.start&&t<n.end)return Math.min(t+r,n.end);if(t>=n.previousStart&&t<n.previousEnd)return Math.min(t+r,n.previousEnd);let i=t+1;while(Ve(e[i]))i++;return n.previousStart=n.start,n.previousEnd=n.end,n.start=t,n.end=i,Math.min(t+r,i)},nn=(e,t,r,n)=>{if(!r&&e[t]==="0")return t+1;return Oo(e,t,r?en:en+1,n)},Qr=(e,t,r,n)=>{let i=Oo(e,t,en,n);if(xo(e[i])||e[i]==="-"){let s=i+1,o=s+Co;while(s<o&&_o(e[s]))s++;return s}return nn(e,t,r,n)},ko=(e,t,r,n)=>{let i=e[t]==="-";if(!r&&!i)return t;let s=t+(i?1:0),o=Qr(e,s,r,n);if(o===s){if(!r||!i)return t;o=Qr(e,t,r,n)}while(e[o]==="."){let c=Qr(e,o+1,r,n);if(c===o+1)break;o=c}return o},Ao=(e,t)=>{let r=t;while(r-t<Co&&_o(e[r]))r++;return r},$o=(e,t)=>{if(e[t]!=="+")return t;let r=Ao(e,t+1);if(r===t+1)return t;while(e[r]==="."){let n=Ao(e,r+1);if(n===r+1)break;r=n}return r},_d=(e,t,r)=>{let n=t;for(let s=0;s<3;s++){let o=nn(e,n,!0,r);if(o===n)return t;if(n=o,s<2){if(e[n]!==".")return t;n++}}let i=ko(e,n,!0,r);return $o(e,i)},Io=(e,t,r)=>{if(Ve(e[t]))return nn(e,t,!1,r);return rn(e[t])?t+1:t},Od=(e,t,r)=>{let n=Io(e,t,r);for(let s=0;s<2;s++){if(e[n]!==".")return n;let o=Io(e,n+1,r);if(o===n+1)return n;n=o}let i=ko(e,n,!1,r);return $o(e,i)},kd=(e,t,r)=>{let n=_d(e,t,r);return n!==t?n:Od(e,t,r)},$d=(e,t)=>{let r=t;if(tn(e[r]))r++;if(e[r]==="<"||e[r]===">")r++;if(e[r]==="=")r++;return tn(e[r])?r:-1},Pd=(e)=>{let t="",r=0,n=0,i={start:-1,end:-1,previousStart:-1,previousEnd:-1};while(n<e.length){let s=n;if(e[n]==="<"||e[n]===">")n++;else if(!To(e[n])&&!rn(e[n])){n++;continue}while(n<e.length&&To(e[n]))n++;if(!rn(e[n]))continue;let o=$d(e,s);if(o!==-1)t+=e.slice(r,o),r=o+1;n=kd(e,n,i)}return t+e.slice(r)};Po.exports=Pd});var B=d(function(BS,jo){var Ld=/\s+/g;class Xe{constructor(e,t){if(t=qd(t),e instanceof Xe)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new Xe(e.raw,t);if(e instanceof qt)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(Ld," "),this.set=this.raw.split("||").map((r)=>this.parseRange(r.trim())).filter((r)=>r.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter((n)=>!qo(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&Gd(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let r=0;r<t.length;r++){if(r>0)this.formatted+=" ";this.formatted+=t[r].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(Wd,"");let r=((this.options.includePrerelease&&Bd)|(this.options.loose&&Jd))+":"+e,n=No.get(r);if(n)return n;let i=this.options.loose,s=i?F[N.HYPHENRANGELOOSE]:F[N.HYPHENRANGE];e=e.replace(s,rp(this.options.includePrerelease)),x("hyphen replace",e),e=jd(e),x("comparator trim",e),e=e.replace(F[N.TILDETRIM],Dd),x("tilde trim",e),e=e.replace(F[N.CARETTRIM],Ud),x("caret trim",e);let o=e.split(" ").map((l)=>Hd(l,this.options)).join(" ").split(/\s+/).map((l)=>tp(l,this.options));if(i)o=o.filter((l)=>(x("loose invalid filter",l,this.options),!!l.match(F[N.COMPARATORLOOSE])));x("range list",o);let c=new Map,u=o.map((l)=>new qt(l,this.options));for(let l of u){if(qo(l))return[l];c.set(l.value,l)}if(c.size>1&&c.has(""))c.delete("");let a=[...c.values()];return No.set(r,a),a}intersects(e,t){if(!(e instanceof Xe))throw TypeError("a Range is required");return this.set.some((r)=>Fo(r,t)&&e.set.some((n)=>Fo(n,t)&&r.every((i)=>n.every((s)=>i.intersects(s,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new Fd(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(np(this.set[t],e,this.options))return!0;return!1}}jo.exports=Xe;var Nd=vo(),No=new Nd,qd=It(),qt=Ye(),x=Me(),Fd=L(),jd=Lo(),{safeRe:F,src:Kd,t:N,tildeTrimReplace:Dd,caretTrimReplace:Ud}=Re(),{FLAG_INCLUDE_PRERELEASE:Bd,FLAG_LOOSE:Jd}=he(),Wd=new RegExp(Kd[N.BUILD],"g"),qo=(e)=>e.value==="<0.0.0-0",Gd=(e)=>e.value==="",Fo=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();while(r&&n.length)r=n.every((s)=>i.intersects(s,t)),i=n.pop();return r},Hd=(e,t)=>(e=e.replace(F[N.BUILD],""),x("comp",e,t),e=Xd(e,t),x("caret",e),e=zd(e,t),x("tildes",e),e=Zd(e,t),x("xrange",e),e=ep(e,t),x("stars",e),e),O=(e)=>!e||e.toLowerCase()==="x"||e==="*",Md=(e,t,r)=>O(e)&&!O(t)||O(t)&&r&&!O(r),zd=(e,t)=>e.trim().split(/\s+/).map((r)=>Vd(r,t)).join(" "),Vd=(e,t)=>{let r=t.loose?F[N.TILDELOOSE]:F[N.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,c,u)=>{x("tilde",e,i,s,o,c,u);let a;if(O(s))a="";else if(O(o))a=`>=${s}.0.0${n} <${+s+1}.0.0-0`;else if(O(c))a=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`;else if(u)x("replaceTilde pr",u),a=`>=${s}.${o}.${c}-${u} <${s}.${+o+1}.0-0`;else a=`>=${s}.${o}.${c} <${s}.${+o+1}.0-0`;return x("tilde return",a),a})},Xd=(e,t)=>e.trim().split(/\s+/).map((r)=>Yd(r,t)).join(" "),Yd=(e,t)=>{x("caret",e,t);let r=t.loose?F[N.CARETLOOSE]:F[N.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,c,u)=>{x("caret",e,i,s,o,c,u);let a;if(O(s))a="";else if(O(o))a=`>=${s}.0.0${n} <${+s+1}.0.0-0`;else if(O(c))if(s==="0")a=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`;else a=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`;else if(u)if(x("replaceCaret pr",u),s==="0")if(o==="0")a=`>=${s}.${o}.${c}-${u} <${s}.${o}.${+c+1}-0`;else a=`>=${s}.${o}.${c}-${u} <${s}.${+o+1}.0-0`;else a=`>=${s}.${o}.${c}-${u} <${+s+1}.0.0-0`;else if(x("no pr"),s==="0")if(o==="0")a=`>=${s}.${o}.${c} <${s}.${o}.${+c+1}-0`;else a=`>=${s}.${o}.${c} <${s}.${+o+1}.0-0`;else a=`>=${s}.${o}.${c} <${+s+1}.0.0-0`;return x("caret return",a),a})},Zd=(e,t)=>(x("replaceXRanges",e,t),e.split(/\s+/).map((r)=>Qd(r,t)).join(" ")),Qd=(e,t)=>{e=e.trim();let r=t.loose?F[N.XRANGELOOSE]:F[N.XRANGE];return e.replace(r,(n,i,s,o,c,u)=>{if(x("xRange",e,n,i,s,o,c,u),Md(s,o,c))return e;let a=O(s),l=a||O(o),f=l||O(c),m=f;if(i==="="&&m)i="";if(u=t.includePrerelease?"-0":"",a)if(i===">"||i==="<")n="<0.0.0-0";else n="*";else if(i&&m){if(l)o=0;if(c=0,i===">")if(i=">=",l)s=+s+1,o=0,c=0;else o=+o+1,c=0;else if(i==="<=")if(i="<",l)s=+s+1;else o=+o+1;if(i==="<")u="-0";n=`${i+s}.${o}.${c}${u}`}else if(l)n=`>=${s}.0.0${u} <${+s+1}.0.0-0`;else if(f)n=`>=${s}.${o}.0${u} <${s}.${+o+1}.0-0`;return x("xRange return",n),n})},ep=(e,t)=>(x("replaceStars",e,t),e.trim().replace(F[N.STAR],"")),tp=(e,t)=>(x("replaceGTE0",e,t),e.trim().replace(F[t.includePrerelease?N.GTE0PRE:N.GTE0],"")),rp=(e)=>(t,r,n,i,s,o,c,u,a,l,f,m)=>{if(O(n))r="";else if(O(i))r=`>=${n}.0.0${e?"-0":""}`;else if(O(s))r=`>=${n}.${i}.0${e?"-0":""}`;else if(o)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(O(a))u="";else if(O(l))u=`<${+a+1}.0.0-0`;else if(O(f))u=`<${a}.${+l+1}.0-0`;else if(m)u=`<=${a}.${l}.${f}-${m}`;else if(e)u=`<${a}.${l}.${+f+1}-0`;else u=`<=${u}`;return`${r} ${u}`.trim()},np=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++){if(x(e[n].semver),e[n].semver===qt.ANY)continue;if(e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}}return!1}return!0}});var Ye=d(function(JS,Wo){var Ze=Symbol("SemVer ANY");class Ft{static get ANY(){return Ze}constructor(e,t){if(t=Ko(t),e instanceof Ft)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),on("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Ze)this.value="";else this.value=this.operator+this.semver.version;on("comp",this)}parse(e){let t=this.options.loose?Do[Uo.COMPARATORLOOSE]:Do[Uo.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=r[1]!==void 0?r[1]:"",this.operator==="=")this.operator="";if(!r[2])this.semver=Ze;else this.semver=new Bo(r[2],this.options.loose)}toString(){return this.value}test(e){if(on("Comparator.test",e,this.options.loose),this.semver===Ze||e===Ze)return!0;if(typeof e==="string")try{e=new Bo(e,this.options)}catch(t){return!1}return sn(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Ft))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Jo(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new Jo(this.value,t).test(e.semver)}if(t=Ko(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(sn(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(sn(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}Wo.exports=Ft;var Ko=It(),{safeRe:Do,t:Uo}=Re(),sn=Zr(),on=Me(),Bo=L(),Jo=B()});var Qe=d(function(WS,Go){var ip=B(),sp=(e,t,r)=>{try{t=new ip(t,r)}catch(n){return!1}return t.test(e)};Go.exports=sp});var Mo=d(function(GS,Ho){var op=B(),ap=(e,t)=>new op(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));Ho.exports=ap});var Vo=d(function(HS,zo){var cp=L(),up=B(),lp=(e,t,r)=>{let n=null,i=null,s=null;try{s=new up(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===-1)n=o,i=new cp(n,r)}}),n};zo.exports=lp});var Yo=d(function(MS,Xo){var fp=L(),hp=B(),dp=(e,t,r)=>{let n=null,i=null,s=null;try{s=new hp(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===1)n=o,i=new fp(n,r)}}),n};Xo.exports=dp});var ea=d(function(zS,Qo){var an=L(),pp=B(),Zo=ze(),mp=(e,t)=>{e=new pp(e,t);let r=new an("0.0.0");if(e.test(r))return r;if(r=new an("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],s=null;if(i.forEach((o)=>{let c=new an(o.semver.version);switch(o.operator){case">":if(c.prerelease.length===0)c.patch++;else c.prerelease.push(0);c.raw=c.format();case"":case">=":if(!s||Zo(c,s))s=c;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||Zo(r,s)))r=s}if(r&&e.test(r))return r;return null};Qo.exports=mp});var ra=d(function(VS,ta){var gp=B(),yp=(e,t)=>{try{return new gp(e,t).range||"*"}catch(r){return null}};ta.exports=yp});var jt=d(function(XS,oa){var Ep=L(),sa=Ye(),{ANY:wp}=sa,Sp=B(),bp=Qe(),na=ze(),ia=kt(),vp=Pt(),Tp=$t(),Ap=(e,t,r,n)=>{e=new Ep(e,n),t=new Sp(t,n);let i,s,o,c,u;switch(r){case">":i=na,s=vp,o=ia,c=">",u=">=";break;case"<":i=ia,s=Tp,o=na,c="<",u="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(bp(e,t,n))return!1;for(let a=0;a<t.set.length;++a){let l=t.set[a],f=null,m=null;if(l.forEach((h)=>{if(h.semver===wp)h=new sa(">=0.0.0");if(f=f||h,m=m||h,i(h.semver,f.semver,n))f=h;else if(o(h.semver,m.semver,n))m=h}),f.operator===c||f.operator===u)return!1;if((!m.operator||m.operator===c)&&s(e,m.semver))return!1;else if(m.operator===u&&o(e,m.semver))return!1}return!0};oa.exports=Ap});var ca=d(function(YS,aa){var Ip=jt(),Cp=(e,t,r)=>Ip(e,t,">",r);aa.exports=Cp});var la=d(function(ZS,ua){var Rp=jt(),xp=(e,t,r)=>Rp(e,t,"<",r);ua.exports=xp});var da=d(function(QS,ha){var fa=B(),_p=(e,t,r)=>(e=new fa(e,r),t=new fa(t,r),e.intersects(t,r));ha.exports=_p});var ma=d(function(eb,pa){var Op=Qe(),kp=U();pa.exports=(e,t,r)=>{let n=[],i=null,s=null,o=e.sort((l,f)=>kp(l,f,r));for(let l of o)if(Op(l,t,r)){if(s=l,!i)i=l}else{if(s)n.push([i,s]);s=null,i=null}if(i)n.push([i,null]);let c=[];for(let[l,f]of n)if(l===f)c.push(l);else if(!f&&l===o[0])c.push("*");else if(!f)c.push(`>=${l}`);else if(l===o[0])c.push(`<=${f}`);else c.push(`${l} - ${f}`);let u=c.join(" || "),a=typeof t.raw==="string"?t.raw:String(t);return u.length<a.length?u:t}});var ba=d(function(tb,Sa){var ga=B(),ln=Ye(),{ANY:cn}=ln,un=Qe(),fn=U(),$p=(e,t,r={})=>{if(e===t)return!0;e=new ga(e,r),t=new ga(t,r);let n=!1;e:for(let i of e.set){for(let s of t.set){let o=Lp(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},Pp=[new ln(">=0.0.0-0")],ya=[new ln(">=0.0.0")],Lp=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===cn)if(t.length===1&&t[0].semver===cn)return!0;else if(r.includePrerelease)e=Pp;else e=ya;if(t.length===1&&t[0].semver===cn)if(r.includePrerelease)return!0;else t=ya;let n=new Set,i,s;for(let h of e)if(h.operator===">"||h.operator===">=")i=Ea(i,h,r);else if(h.operator==="<"||h.operator==="<=")s=wa(s,h,r);else n.add(h.semver);if(n.size>1)return null;let o;if(i&&s){if(o=fn(i.semver,s.semver,r),o>0)return null;else if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let h of n){if(i&&!un(h,String(i),r))return null;if(s&&!un(h,String(s),r))return null;for(let g of t)if(!un(h,String(g),r))return!1;return!0}let c,u,a,l,f=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,m=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;if(f&&f.prerelease.length===1&&s.operator==="<"&&f.prerelease[0]===0)f=!1;for(let h of t){if(l=l||h.operator===">"||h.operator===">=",a=a||h.operator==="<"||h.operator==="<=",i){if(m){if(h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===m.major&&h.semver.minor===m.minor&&h.semver.patch===m.patch)m=!1}if(h.operator===">"||h.operator===">="){if(c=Ea(i,h,r),c===h&&c!==i)return!1}else if(i.operator===">="&&!h.test(i.semver))return!1}if(s){if(f){if(h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch)f=!1}if(h.operator==="<"||h.operator==="<="){if(u=wa(s,h,r),u===h&&u!==s)return!1}else if(s.operator==="<="&&!h.test(s.semver))return!1}if(!h.operator&&(s||i)&&o!==0)return!1}if(i&&a&&!s&&o!==0)return!1;if(s&&l&&!i&&o!==0)return!1;if(m||f)return!1;return!0},Ea=(e,t,r)=>{if(!e)return t;let n=fn(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},wa=(e,t,r)=>{if(!e)return t;let n=fn(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};Sa.exports=$p});var Ut=d(function(rb,va){var xe=Re(),Kt=he(),Np=L(),Dt=zr(),qp=ne(),Fp=$s(),jp=Ls(),Kp=Fs(),Dp=Ds(),Up=Bs(),Bp=Ws(),Jp=Hs(),Wp=zs(),Gp=U(),Hp=Zs(),Mp=eo(),zp=Ot(),Vp=io(),Xp=oo(),Yp=ze(),Zp=kt(),Qp=Xr(),em=Yr(),tm=$t(),rm=Pt(),nm=Zr(),im=go(),sm=wo(),om=Ye(),am=B(),cm=Qe(),um=Mo(),lm=Vo(),fm=Yo(),hm=ea(),dm=ra(),pm=jt(),mm=ca(),gm=la(),ym=da(),Em=ma(),wm=ba();va.exports={parse:qp,valid:Fp,clean:jp,inc:Kp,diff:Dp,major:Up,minor:Bp,patch:Jp,prerelease:Wp,compare:Gp,rcompare:Hp,compareLoose:Mp,compareBuild:zp,sort:Vp,rsort:Xp,gt:Yp,lt:Zp,eq:Qp,neq:em,gte:tm,lte:rm,cmp:nm,coerce:im,truncate:sm,Comparator:om,Range:am,satisfies:cm,toComparators:um,maxSatisfying:lm,minSatisfying:fm,minVersion:hm,validRange:dm,outside:pm,gtr:mm,ltr:gm,intersects:ym,simplifyRange:Em,subset:wm,SemVer:Np,re:xe.re,src:xe.src,tokens:xe.t,SEMVER_SPEC_VERSION:Kt.SEMVER_SPEC_VERSION,RELEASE_TYPES:Kt.RELEASE_TYPES,compareIdentifiers:Dt.compareIdentifiers,rcompareIdentifiers:Dt.rcompareIdentifiers}});var Ia=d(function(nb,Aa){var Ta=Ut();Aa.exports=Ta.satisfies(process.version,">=15.7.0")});var xa=d(function(ib,Ra){var Ca=Ut();Ra.exports=Ca.satisfies(process.version,">=16.9.0")});var hn=d(function(sb,_a){var Sm=Ia(),bm=xa(),vm={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},Tm={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};_a.exports=function(e,t){if(!e||!t)return;let r=t.asymmetricKeyType;if(!r)return;let n=vm[r];if(!n)throw Error(`Unknown key type "${r}".`);if(!n.includes(e))throw Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(Sm)switch(r){case"ec":let i=t.asymmetricKeyDetails.namedCurve,s=Tm[e];if(i!==s)throw Error(`"alg" parameter "${e}" requires curve "${s}".`);break;case"rsa-pss":if(bm){let o=parseInt(e.slice(-3),10),{hashAlgorithm:c,mgf1HashAlgorithm:u,saltLength:a}=t.asymmetricKeyDetails;if(c!==`sha${o}`||u!==c)throw Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(a!==void 0&&a>o>>3)throw Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}break}}});var dn=d(function(ob,Oa){var Am=Ut();Oa.exports=Am.satisfies(process.version,"^6.12.0 || >=8.0.0")});var La=d(function(ab,Pa){var I=He(),Im=Br(),ka=Jr(),Cm=Ur(),Rm=Gr(),xm=hn(),_m=dn(),$a=St(),{KeyObject:Om,createSecretKey:km,createPublicKey:$m}=require("crypto"),pn=["RS256","RS384","RS512"],Pm=["ES256","ES384","ES512"],mn=["RS256","RS384","RS512"],Lm=["HS256","HS384","HS512"];if(_m)pn.splice(pn.length,0,"PS256","PS384","PS512"),mn.splice(mn.length,0,"PS256","PS384","PS512");Pa.exports=function(e,t,r,n){if(typeof r==="function"&&!n)n=r,r={};if(!r)r={};r=Object.assign({},r);let i;if(n)i=n;else i=function(l,f){if(l)throw l;return f};if(r.clockTimestamp&&typeof r.clockTimestamp!=="number")return i(new I("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!=="string"||r.nonce.trim()===""))return i(new I("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!=="boolean")return i(new I("allowInvalidAsymmetricKeyTypes must be a boolean"));let s=r.clockTimestamp||Math.floor(Date.now()/1000);if(!e)return i(new I("jwt must be provided"));if(typeof e!=="string")return i(new I("jwt must be a string"));let o=e.split(".");if(o.length!==3)return i(new I("jwt malformed"));let c;try{c=Cm(e,{complete:!0})}catch(l){return i(l)}if(!c)return i(new I("invalid token"));let u=c.header,a;if(typeof t==="function"){if(!n)return i(new I("verify must be called asynchronous if secret or public key is provided as a callback"));a=t}else a=function(l,f){return f(null,t)};return a(u,function(l,f){if(l)return i(new I("error in secret or public key callback: "+l.message));let m=o[2].trim()!=="";if(!m&&f)return i(new I("jwt signature is required"));if(m&&!f)return i(new I("secret or public key must be provided"));if(!m&&!r.algorithms)return i(new I('please specify "none" in "algorithms" to verify unsigned tokens'));if(f!=null&&!(f instanceof Om))try{f=$m(f)}catch(p){try{f=km(typeof f==="string"?Buffer.from(f):f)}catch(b){return i(new I("secretOrPublicKey is not valid key material"))}}if(!r.algorithms)if(f.type==="secret")r.algorithms=Lm;else if(["rsa","rsa-pss"].includes(f.asymmetricKeyType))r.algorithms=mn;else if(f.asymmetricKeyType==="ec")r.algorithms=Pm;else r.algorithms=pn;if(r.algorithms.indexOf(c.header.alg)===-1)return i(new I("invalid algorithm"));if(u.alg.startsWith("HS")&&f.type!=="secret")return i(new I(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));else if(/^(?:RS|PS|ES)/.test(u.alg)&&f.type!=="public")return i(new I(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{xm(u.alg,f)}catch(p){return i(p)}let h;try{h=$a.verify(e,c.header.alg,f)}catch(p){return i(p)}if(!h)return i(new I("invalid signature"));let g=c.payload;if(typeof g.nbf<"u"&&!r.ignoreNotBefore){if(typeof g.nbf!=="number")return i(new I("invalid nbf value"));if(g.nbf>s+(r.clockTolerance||0))return i(new Im("jwt not active",new Date(g.nbf*1000)))}if(typeof g.exp<"u"&&!r.ignoreExpiration){if(typeof g.exp!=="number")return i(new I("invalid exp value"));if(s>=g.exp+(r.clockTolerance||0))return i(new ka("jwt expired",new Date(g.exp*1000)))}if(r.audience){let p=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(g.aud)?g.aud:[g.aud]).some(function(S){return p.some(function(A){return A instanceof RegExp?A.test(S):A===S})}))return i(new I("jwt audience invalid. expected: "+p.join(" or ")))}if(r.issuer){if(typeof r.issuer==="string"&&g.iss!==r.issuer||Array.isArray(r.issuer)&&r.issuer.indexOf(g.iss)===-1)return i(new I("jwt issuer invalid. expected: "+r.issuer))}if(r.subject){if(g.sub!==r.subject)return i(new I("jwt subject invalid. expected: "+r.subject))}if(r.jwtid){if(g.jti!==r.jwtid)return i(new I("jwt jwtid invalid. expected: "+r.jwtid))}if(r.nonce){if(g.nonce!==r.nonce)return i(new I("jwt nonce invalid. expected: "+r.nonce))}if(r.maxAge){if(typeof g.iat!=="number")return i(new I("iat required when maxAge is specified"));let p=Rm(r.maxAge,g.iat);if(typeof p>"u")return i(new I('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(s>=p+(r.clockTolerance||0))return i(new ka("maxAge exceeded",new Date(p*1000)))}if(r.complete===!0){let p=c.signature;return i(null,{header:u,payload:g,signature:p})}return i(null,g)})}});var Da=d(function(cb,Ka){var Na=1/0,Fa=9007199254740991,Nm=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,qa=NaN,qm="[object Arguments]",Fm="[object Function]",jm="[object GeneratorFunction]",Km="[object String]",Dm="[object Symbol]",Um=/^\s+|\s+$/g,Bm=/^[-+]0x[0-9a-f]+$/i,Jm=/^0b[01]+$/i,Wm=/^0o[0-7]+$/i,Gm=/^(?:0|[1-9]\d*)$/,Hm=parseInt;function Mm(e,t){var r=-1,n=e?e.length:0,i=Array(n);while(++r<n)i[r]=t(e[r],r,e);return i}function zm(e,t,r,n){var i=e.length,s=r+(n?1:-1);while(n?s--:++s<i)if(t(e[s],s,e))return s;return-1}function Vm(e,t,r){if(t!==t)return zm(e,Xm,r);var n=r-1,i=e.length;while(++n<i)if(e[n]===t)return n;return-1}function Xm(e){return e!==e}function Ym(e,t){var r=-1,n=Array(e);while(++r<e)n[r]=t(r);return n}function Zm(e,t){return Mm(t,function(r){return e[r]})}function Qm(e,t){return function(r){return e(t(r))}}var Bt=Object.prototype,{hasOwnProperty:yn,toString:Jt,propertyIsEnumerable:eg}=Bt,tg=Qm(Object.keys,Object),rg=Math.max;function ng(e,t){var r=ja(e)||cg(e)?Ym(e.length,String):[],n=r.length,i=!!n;for(var s in e)if((t||yn.call(e,s))&&!(i&&(s=="length"||sg(s,n))))r.push(s);return r}function ig(e){if(!og(e))return tg(e);var t=[];for(var r in Object(e))if(yn.call(e,r)&&r!="constructor")t.push(r);return t}function sg(e,t){return t=t==null?Fa:t,!!t&&(typeof e=="number"||Gm.test(e))&&(e>-1&&e%1==0&&e<t)}function og(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Bt;return e===r}function ag(e,t,r,n){e=En(e)?e:Eg(e),r=r&&!n?mg(r):0;var i=e.length;if(r<0)r=rg(i+r,0);return hg(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Vm(e,t,r)>-1}function cg(e){return ug(e)&&yn.call(e,"callee")&&(!eg.call(e,"callee")||Jt.call(e)==qm)}var ja=Array.isArray;function En(e){return e!=null&&fg(e.length)&&!lg(e)}function ug(e){return wn(e)&&En(e)}function lg(e){var t=gn(e)?Jt.call(e):"";return t==Fm||t==jm}function fg(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Fa}function gn(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function wn(e){return!!e&&typeof e=="object"}function hg(e){return typeof e=="string"||!ja(e)&&wn(e)&&Jt.call(e)==Km}function dg(e){return typeof e=="symbol"||wn(e)&&Jt.call(e)==Dm}function pg(e){if(!e)return e===0?e:0;if(e=gg(e),e===Na||e===-Na){var t=e<0?-1:1;return t*Nm}return e===e?e:0}function mg(e){var t=pg(e),r=t%1;return t===t?r?t-r:t:0}function gg(e){if(typeof e=="number")return e;if(dg(e))return qa;if(gn(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=gn(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Um,"");var r=Jm.test(e);return r||Wm.test(e)?Hm(e.slice(2),r?2:8):Bm.test(e)?qa:+e}function yg(e){return En(e)?ng(e):ig(e)}function Eg(e){return e?Zm(e,yg(e)):[]}Ka.exports=ag});var Ba=d(function(ub,Ua){var wg="[object Boolean]",Sg=Object.prototype,bg=Sg.toString;function vg(e){return e===!0||e===!1||Tg(e)&&bg.call(e)==wg}function Tg(e){return!!e&&typeof e=="object"}Ua.exports=vg});var Ma=d(function(lb,Ha){var Ja=1/0,Ag=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,Wa=NaN,Ig="[object Symbol]",Cg=/^\s+|\s+$/g,Rg=/^[-+]0x[0-9a-f]+$/i,xg=/^0b[01]+$/i,_g=/^0o[0-7]+$/i,Og=parseInt,kg=Object.prototype,$g=kg.toString;function Pg(e){return typeof e=="number"&&e==Fg(e)}function Ga(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Lg(e){return!!e&&typeof e=="object"}function Ng(e){return typeof e=="symbol"||Lg(e)&&$g.call(e)==Ig}function qg(e){if(!e)return e===0?e:0;if(e=jg(e),e===Ja||e===-Ja){var t=e<0?-1:1;return t*Ag}return e===e?e:0}function Fg(e){var t=qg(e),r=t%1;return t===t?r?t-r:t:0}function jg(e){if(typeof e=="number")return e;if(Ng(e))return Wa;if(Ga(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ga(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Cg,"");var r=xg.test(e);return r||_g.test(e)?Og(e.slice(2),r?2:8):Rg.test(e)?Wa:+e}Ha.exports=Pg});var Va=d(function(fb,za){var Kg="[object Number]",Dg=Object.prototype,Ug=Dg.toString;function Bg(e){return!!e&&typeof e=="object"}function Jg(e){return typeof e=="number"||Bg(e)&&Ug.call(e)==Kg}za.exports=Jg});var Qa=d(function(hb,Za){var Wg="[object Object]";function Gg(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function Hg(e,t){return function(r){return e(t(r))}}var Mg=Function.prototype,Xa=Object.prototype,Ya=Mg.toString,zg=Xa.hasOwnProperty,Vg=Ya.call(Object),Xg=Xa.toString,Yg=Hg(Object.getPrototypeOf,Object);function Zg(e){return!!e&&typeof e=="object"}function Qg(e){if(!Zg(e)||Xg.call(e)!=Wg||Gg(e))return!1;var t=Yg(e);if(t===null)return!0;var r=zg.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Ya.call(r)==Vg}Za.exports=Qg});var tc=d(function(db,ec){var ey="[object String]",ty=Object.prototype,ry=ty.toString,ny=Array.isArray;function iy(e){return!!e&&typeof e=="object"}function sy(e){return typeof e=="string"||!ny(e)&&iy(e)&&ry.call(e)==ey}ec.exports=sy});var oc=d(function(pb,sc){var oy="Expected a function",rc=1/0,ay=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,nc=NaN,cy="[object Symbol]",uy=/^\s+|\s+$/g,ly=/^[-+]0x[0-9a-f]+$/i,fy=/^0b[01]+$/i,hy=/^0o[0-7]+$/i,dy=parseInt,py=Object.prototype,my=py.toString;function gy(e,t){var r;if(typeof t!="function")throw TypeError(oy);return e=by(e),function(){if(--e>0)r=t.apply(this,arguments);if(e<=1)t=void 0;return r}}function yy(e){return gy(2,e)}function ic(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Ey(e){return!!e&&typeof e=="object"}function wy(e){return typeof e=="symbol"||Ey(e)&&my.call(e)==cy}function Sy(e){if(!e)return e===0?e:0;if(e=vy(e),e===rc||e===-rc){var t=e<0?-1:1;return t*ay}return e===e?e:0}function by(e){var t=Sy(e),r=t%1;return t===t?r?t-r:t:0}function vy(e){if(typeof e=="number")return e;if(wy(e))return nc;if(ic(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ic(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(uy,"");var r=fy.test(e);return r||hy.test(e)?dy(e.slice(2),r?2:8):ly.test(e)?nc:+e}sc.exports=yy});var mc=d(function(mb,pc){var ac=Gr(),Ty=dn(),Ay=hn(),Gt=St(),lc=Da(),Wt=Ba(),cc=Ma(),Sn=Va(),fc=Qa(),ie=tc(),Iy=oc(),{KeyObject:Cy,createSecretKey:Ry,createPrivateKey:xy}=require("crypto"),hc=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];if(Ty)hc.splice(3,0,"PS256","PS384","PS512");var _y={expiresIn:{isValid:function(e){return cc(e)||ie(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return cc(e)||ie(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return ie(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:lc.bind(null,hc),message:'"algorithm" must be a valid string enum value'},header:{isValid:fc,message:'"header" must be an object'},encoding:{isValid:ie,message:'"encoding" must be a string'},issuer:{isValid:ie,message:'"issuer" must be a string'},subject:{isValid:ie,message:'"subject" must be a string'},jwtid:{isValid:ie,message:'"jwtid" must be a string'},noTimestamp:{isValid:Wt,message:'"noTimestamp" must be a boolean'},keyid:{isValid:ie,message:'"keyid" must be a string'},mutatePayload:{isValid:Wt,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:Wt,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:Wt,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},Oy={iat:{isValid:Sn,message:'"iat" should be a number of seconds'},exp:{isValid:Sn,message:'"exp" should be a number of seconds'},nbf:{isValid:Sn,message:'"nbf" should be a number of seconds'}};function dc(e,t,r,n){if(!fc(r))throw Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(i){let s=e[i];if(!s){if(!t)throw Error('"'+i+'" is not allowed in "'+n+'"');return}if(!s.isValid(r[i]))throw Error(s.message)})}function ky(e){return dc(_y,!1,e,"options")}function $y(e){return dc(Oy,!0,e,"payload")}var uc={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},Py=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];pc.exports=function(e,t,r,n){if(typeof r==="function")n=r,r={};else r=r||{};let i=typeof e==="object"&&!Buffer.isBuffer(e),s=Object.assign({alg:r.algorithm||"HS256",typ:i?"JWT":void 0,kid:r.keyid},r.header);function o(a){if(n)return n(a);throw a}if(!t&&r.algorithm!=="none")return o(Error("secretOrPrivateKey must have a value"));if(t!=null&&!(t instanceof Cy))try{t=xy(t)}catch(a){try{t=Ry(typeof t==="string"?Buffer.from(t):t)}catch(l){return o(Error("secretOrPrivateKey is not valid key material"))}}if(s.alg.startsWith("HS")&&t.type!=="secret")return o(Error(`secretOrPrivateKey must be a symmetric key when using ${s.alg}`));else if(/^(?:RS|PS|ES)/.test(s.alg)){if(t.type!=="private")return o(Error(`secretOrPrivateKey must be an asymmetric key when using ${s.alg}`));if(!r.allowInsecureKeySizes&&!s.alg.startsWith("ES")&&t.asymmetricKeyDetails!==void 0&&t.asymmetricKeyDetails.modulusLength<2048)return o(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`))}if(typeof e>"u")return o(Error("payload is required"));else if(i){try{$y(e)}catch(a){return o(a)}if(!r.mutatePayload)e=Object.assign({},e)}else{let a=Py.filter(function(l){return typeof r[l]<"u"});if(a.length>0)return o(Error("invalid "+a.join(",")+" option for "+typeof e+" payload"))}if(typeof e.exp<"u"&&typeof r.expiresIn<"u")return o(Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof e.nbf<"u"&&typeof r.notBefore<"u")return o(Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{ky(r)}catch(a){return o(a)}if(!r.allowInvalidAsymmetricKeyTypes)try{Ay(s.alg,t)}catch(a){return o(a)}let c=e.iat||Math.floor(Date.now()/1000);if(r.noTimestamp)delete e.iat;else if(i)e.iat=c;if(typeof r.notBefore<"u"){try{e.nbf=ac(r.notBefore,c)}catch(a){return o(a)}if(typeof e.nbf>"u")return o(Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof r.expiresIn<"u"&&typeof e==="object"){try{e.exp=ac(r.expiresIn,c)}catch(a){return o(a)}if(typeof e.exp>"u")return o(Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(uc).forEach(function(a){let l=uc[a];if(typeof r[a]<"u"){if(typeof e[l]<"u")return o(Error('Bad "options.'+a+'" option. The payload already has an "'+l+'" property.'));e[l]=r[a]}});let u=r.encoding||"utf8";if(typeof n==="function")n=n&&Iy(n),Gt.createSign({header:s,privateKey:t,payload:e,encoding:u}).once("error",n).once("done",function(a){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&a.length<256)return n(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`));n(null,a)});else{let a=Gt.sign({header:s,payload:e,secret:t,encoding:u});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&a.length<256)throw Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`);return a}}});var yc=d(function(gb,gc){gc.exports={decode:Ur(),verify:La(),sign:mc(),JsonWebTokenError:He(),NotBeforeError:Br(),TokenExpiredError:Jr()}});var bn=d(function(yb,Ec){function Ly(e){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=c,r.humanize=Wr(),r.destroy=a,Object.keys(e).forEach((l)=>{r[l]=e[l]}),r.names=[],r.skips=[],r.formatters={};function t(l){let f=0;for(let m=0;m<l.length;m++)f=(f<<5)-f+l.charCodeAt(m),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=t;function r(l){let f,m=null,h,g;function p(...b){if(!p.enabled)return;let w=p,S=Number(new Date),A=S-(f||S);if(w.diff=A,w.prev=f,w.curr=S,f=S,b[0]=r.coerce(b[0]),typeof b[0]!=="string")b.unshift("%O");let T=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(K,G)=>{if(K==="%%")return"%";T++;let z=r.formatters[G];if(typeof z==="function"){let V=b[T];K=z.call(w,V),b.splice(T,1),T--}return K}),r.formatArgs.call(w,b),(w.log||r.log).apply(w,b)}if(p.namespace=l,p.useColors=r.useColors(),p.color=r.selectColor(l),p.extend=n,p.destroy=r.destroy,Object.defineProperty(p,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(m!==null)return m;if(h!==r.namespaces)h=r.namespaces,g=r.enabled(l);return g},set:(b)=>{m=b}}),typeof r.init==="function")r.init(p);return p}function n(l,f){let m=r(this.namespace+(typeof f>"u"?":":f)+l);return m.log=this.log,m}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f=(typeof l==="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of f)if(m[0]==="-")r.skips.push(m.slice(1));else r.names.push(m)}function s(l,f){let m=0,h=0,g=-1,p=0;while(m<l.length)if(h<f.length&&(f[h]===l[m]||f[h]==="*"))if(f[h]==="*")g=h,p=m,h++;else m++,h++;else if(g!==-1)h=g+1,p++,m=p;else return!1;while(h<f.length&&f[h]==="*")h++;return h===f.length}function o(){let l=[...r.names,...r.skips.map((f)=>"-"+f)].join(",");return r.enable(""),l}function c(l){for(let f of r.skips)if(s(l,f))return!1;for(let f of r.names)if(s(l,f))return!0;return!1}function u(l){if(l instanceof Error)return l.stack||l.message;return l}function a(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}Ec.exports=Ly});var wc=d(function(j,Ht){j.formatArgs=qy;j.save=Fy;j.load=jy;j.useColors=Ny;j.storage=Ky();j.destroy=(()=>{let e=!1;return()=>{if(!e)e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();j.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Ny(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function qy(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+Ht.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,(i)=>{if(i==="%%")return;if(r++,i==="%c")n=r}),e.splice(n,0,t)}j.log=console.debug||console.log||(()=>{});function Fy(e){try{if(e)j.storage.setItem("debug",e);else j.storage.removeItem("debug")}catch(t){}}function jy(){let e;try{e=j.storage.getItem("debug")||j.storage.getItem("DEBUG")}catch(t){}if(!e&&typeof process<"u"&&"env"in process)e=process.env.DEBUG;return e}function Ky(){try{return localStorage}catch(e){}}Ht.exports=bn()(j);var{formatters:Dy}=Ht.exports;Dy.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var bc=d(function(Eb,Sc){Sc.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n<i)}});var Ac=d(function(wb,Tc){var vc=require("os"),Mt=require("tty"),J=bc(),{env:k}=process,se;if(J("no-color")||J("no-colors")||J("color=false")||J("color=never"))se=0;else if(J("color")||J("colors")||J("color=true")||J("color=always"))se=1;if("FORCE_COLOR"in k)if(k.FORCE_COLOR==="true")se=1;else if(k.FORCE_COLOR==="false")se=0;else se=k.FORCE_COLOR.length===0?1:Math.min(parseInt(k.FORCE_COLOR,10),3);function vn(e){if(e===0)return!1;return{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Tn(e,t){if(se===0)return 0;if(J("color=16m")||J("color=full")||J("color=truecolor"))return 3;if(J("color=256"))return 2;if(e&&!t&&se===void 0)return 0;let r=se||0;if(k.TERM==="dumb")return r;if(process.platform==="win32"){let n=vc.release().split(".");if(Number(n[0])>=10&&Number(n[2])>=10586)return Number(n[2])>=14931?3:2;return 1}if("CI"in k){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((n)=>(n in k))||k.CI_NAME==="codeship")return 1;return r}if("TEAMCITY_VERSION"in k)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(k.TEAMCITY_VERSION)?1:0;if(k.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in k){let n=parseInt((k.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(k.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(k.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(k.TERM))return 1;if("COLORTERM"in k)return 1;return r}function Uy(e){let t=Tn(e,e&&e.isTTY);return vn(t)}Tc.exports={supportsColor:Uy,stdout:vn(Tn(!0,Mt.isatty(1))),stderr:vn(Tn(!0,Mt.isatty(2)))}});var Rc=d(function(P,zt){var Ic=require("tty"),oe=require("util");P.init=zy;P.log=Gy;P.formatArgs=Jy;P.save=Hy;P.load=My;P.useColors=By;P.destroy=oe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");P.colors=[6,2,3,4,5,1];try{let e=Ac();if(e&&(e.stderr||e).level>=2)P.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(e){}P.inspectOpts=Object.keys(process.env).filter((e)=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[t];if(/^(yes|on|true|enabled)$/i.test(n))n=!0;else if(/^(no|off|false|disabled)$/i.test(n))n=!1;else if(n==="null")n=null;else n=Number(n);return e[r]=n,e},{});function By(){return"colors"in P.inspectOpts?Boolean(P.inspectOpts.colors):Ic.isatty(process.stderr.fd)}function Jy(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${t} \x1B[0m`;e[0]=s+e[0].split(`
5
5
  `).join(`
6
- `+s),e.push(i+"m+"+zt.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=Wy()+t+" "+e[0]}function Wy(){if(L.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function Gy(...e){return process.stderr.write(oe.formatWithOptions(L.inspectOpts,...e)+`
7
- `)}function Hy(e){if(e)process.env.DEBUG=e;else delete process.env.DEBUG}function My(){return process.env.DEBUG}function zy(e){e.inspectOpts={};let t=Object.keys(L.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=L.inspectOpts[t[r]]}zt.exports=bn()(L);var{formatters:Cc}=zt.exports;Cc.o=function(e){return this.inspectOpts.colors=this.useColors,oe.inspect(e,this.inspectOpts).split(`
8
- `).map((t)=>t.trim()).join(" ")};Cc.O=function(e){return this.inspectOpts.colors=this.useColors,oe.inspect(e,this.inspectOpts)}});var Vt=d(function(wb,An){if(typeof process>"u"||process.type==="renderer"||!1||process.__nwjs)An.exports=Sc();else An.exports=Rc()});function In(e,t=!1){if(Uint8Array.prototype.toBase64)return e.toBase64({alphabet:t?"base64url":"base64",omitPadding:t});let r=32768,n=[];for(let s=0;s<e.length;s+=r)n.push(String.fromCharCode.apply(null,e.subarray(s,s+r)));let i=btoa(n.join(""));return t?i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"):i}function Cn(e,t=!1){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e,{alphabet:t?"base64url":"base64"});if(t){if(e.includes("+")||e.includes("/"))throw TypeError("Invalid base64url");e=e.replace(/-/g,"+").replace(/_/g,"/")}let r=atob(e),n=new Uint8Array(r.length);for(let i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return n}var xc,Xt;var et=q(()=>{xc=new TextDecoder,Xt=new TextDecoder("utf-8",{fatal:!0})});var Rn,Z,Q;var _e=q(()=>{Rn=class Rn extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}};Z=class Z extends Rn{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"};Q=class Q extends Rn{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}});function Oe(e){try{return Cn(typeof e=="string"?e:xc.decode(e),!0)}catch(t){throw TypeError(Vy,{cause:t})}}var Vy="The input to be decoded is not correctly encoded.";var Yt=q(()=>{et()});function tt(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function _c(e,t,r){let n;try{n=JSON.parse(Xt.decode(Oe(e)))}catch(i){throw new t(r,{cause:i})}if(!tt(n))throw new t(r);return n}var Zt=q(()=>{Yt();et()});function Xy(e,t,...r){if(r.length>2){let n=r.pop();e+=`one of type ${r.join(", ")}, or ${n}.`}else r.length===2?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return t==null?e+=` Received ${t}`:typeof t=="function"&&t.name?e+=` Received function ${t.name}`:typeof t=="object"&&t!=null&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}function Yy(e){return{__proto__:null,...e}}function Lc(e){let t=Yy(e);if(t.ext!==void 0&&typeof t.ext!="boolean")throw TypeError('"ext" (Extractable) Parameter must be a boolean');if(t.key_ops!==void 0){let r=t.key_ops,n=Array.isArray(r)?[...r]:void 0;if(!n||n.some((i)=>typeof i!="string")||new Set(n).size!==n.length)throw TypeError('"key_ops" (Key Operations) Parameter must be an array of unique strings');t.key_ops=n}return t}function xn(e){if(e!==void 0&&typeof e!="boolean")throw TypeError('"extractable" option must be a boolean');return e}async function _n(e,t,r){if(!e.kty.includes(t.kty))throw new Z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');let n=e.resolve?.({kty:t.kty,crv:t.crv})??e.subtle,i=!!(t.d||t.priv),s={...t,ext:r??t.ext};return s.kty!=="AKP"&&delete s.alg,delete s.use,crypto.subtle.importKey("jwk",s,n,s.ext??!i,t.key_ops??e.usages[i?1:0])}var Oc=(e)=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},kc=(e)=>e?.[Symbol.toStringTag]==="KeyObject",$c=(e,...t)=>Xy("Key must be ",e,...t);var On=q(()=>{_e()});function rt(e){let t={__proto__:null};for(let r in e)t[r]={...e[r],alg:r};return t}var kn=()=>{};function Qt(e){return{kty:["RSA"],mode:"key-encryption",subtle:{name:"RSA-OAEP",hash:`SHA-${e}`},usages:Zy,ops:["wrapKey","unwrapKey"]}}function er(e){return{kty:["EC","OKP"],mode:e,subtle:{name:"ECDH"},resolve:({kty:t,crv:r,asymmetricKeyType:n})=>{if(r==="X25519"||n==="x25519")return{name:"X25519"};if(t==="OKP")throw new Z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:r}},usages:Qy,ops:[void 0,"deriveBits"]}}function ke(e,t=!1){return{kty:["oct"],mode:"key-wrapping",secret:!0,subtle:{name:t?"AES-GCM":"AES-KW",length:e},usages:tr,ops:t?["encrypt","decrypt"]:["wrapKey","unwrapKey"]}}function $n(){return{kty:["oct"],mode:"key-wrapping",secret:!0,subtle:{name:"PBKDF2"},usages:tr,ops:["deriveBits","deriveBits"]}}function $e(e,t=!1){return{kty:["oct"],secret:!0,subtle:{name:t?"AES-CBC":"AES-GCM",length:e},usages:tr,ops:eE,cekBits:e,ivBits:t?128:96,cbc:t}}var Zy,Qy,tr,Pc,eE,Nb;var Nc=q(()=>{_e();kn();Zy=[["encrypt","wrapKey"],["decrypt","unwrapKey"]],Qy=[[],["deriveBits"]],tr=[[],[]];Pc=rt({dir:{kty:["oct"],mode:"direct-encryption",secret:!0,subtle:{name:"AES-GCM"},usages:tr,ops:["encrypt","decrypt"]},"RSA-OAEP":Qt(1),"RSA-OAEP-256":Qt(256),"RSA-OAEP-384":Qt(384),"RSA-OAEP-512":Qt(512),"ECDH-ES":er("direct-key-agreement"),"ECDH-ES+A128KW":er("key-agreement-with-key-wrapping"),"ECDH-ES+A192KW":er("key-agreement-with-key-wrapping"),"ECDH-ES+A256KW":er("key-agreement-with-key-wrapping"),A128KW:ke(128),A192KW:ke(192),A256KW:ke(256),A128GCMKW:ke(128,!0),A192GCMKW:ke(192,!0),A256GCMKW:ke(256,!0),"PBES2-HS256+A128KW":$n(),"PBES2-HS384+A192KW":$n(),"PBES2-HS512+A256KW":$n()}),eE=["encrypt","decrypt"];Nb=rt({A128GCM:$e(128),A192GCM:$e(192),A256GCM:$e(256),"A128CBC-HS256":$e(256,!0),"A192CBC-HS384":$e(384,!0),"A256CBC-HS512":$e(512,!0)})});function Ln(e){let t={name:"HMAC",hash:`SHA-${e}`};return{kty:["oct"],secret:!0,subtle:t,signing:t,usages:nt}}function Le(e,t){let r={name:t?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:`SHA-${e}`};return{kty:["RSA"],subtle:r,signing:t?{...r,saltLength:t}:r,usages:nt,minRsaBits:2048}}function Pn(e,t){return{kty:["EC"],crv:e,subtle:{name:"ECDSA",namedCurve:e},signing:{name:"ECDSA",hash:`SHA-${t}`},usages:nt}}function qc(){let e={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:e,signing:e,usages:nt}}function Nn(e){let t={name:`ML-DSA-${e}`};return{kty:["AKP"],subtle:t,signing:t,usages:nt}}var nt,Fc;var jc=q(()=>{kn();nt=[["verify"],["sign"]];Fc=rt({HS256:Ln(256),HS384:Ln(384),HS512:Ln(512),RS256:Le(256),RS384:Le(384),RS512:Le(512),PS256:Le(256,32),PS384:Le(384,48),PS512:Le(512,64),ES256:Pn("P-256",256),ES384:Pn("P-384",384),ES512:Pn("P-521",512),EdDSA:qc(),Ed25519:qc(),"ML-DSA-44":Nn(44),"ML-DSA-65":Nn(65),"ML-DSA-87":Nn(87)})});function tE(e='JWK "alg" (Algorithm) Parameter'){throw new Z(`Invalid or unsupported ${e} value`)}function qn(e,t){return(typeof e=="string"?Fc[e]??Pc[e]:void 0)??tE(t)}var Kc=q(()=>{_e();jc();Nc()});var rE=(e,t)=>{let r=(e.match(/.{1,64}/g)||[]).join(`
6
+ `+s),e.push(i+"m+"+zt.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=Wy()+t+" "+e[0]}function Wy(){if(P.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function Gy(...e){return process.stderr.write(oe.formatWithOptions(P.inspectOpts,...e)+`
7
+ `)}function Hy(e){if(e)process.env.DEBUG=e;else delete process.env.DEBUG}function My(){return process.env.DEBUG}function zy(e){e.inspectOpts={};let t=Object.keys(P.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=P.inspectOpts[t[r]]}zt.exports=bn()(P);var{formatters:Cc}=zt.exports;Cc.o=function(e){return this.inspectOpts.colors=this.useColors,oe.inspect(e,this.inspectOpts).split(`
8
+ `).map((t)=>t.trim()).join(" ")};Cc.O=function(e){return this.inspectOpts.colors=this.useColors,oe.inspect(e,this.inspectOpts)}});var Vt=d(function(Sb,An){if(typeof process>"u"||process.type==="renderer"||!1||process.__nwjs)An.exports=wc();else An.exports=Rc()});function In(e,t=!1){if(Uint8Array.prototype.toBase64)return e.toBase64({alphabet:t?"base64url":"base64",omitPadding:t});let r=32768,n=[];for(let s=0;s<e.length;s+=r)n.push(String.fromCharCode.apply(null,e.subarray(s,s+r)));let i=btoa(n.join(""));return t?i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"):i}function Cn(e,t=!1){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e,{alphabet:t?"base64url":"base64"});if(t){if(e.includes("+")||e.includes("/"))throw TypeError("Invalid base64url");e=e.replace(/-/g,"+").replace(/_/g,"/")}let r=atob(e),n=new Uint8Array(r.length);for(let i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return n}var xc,Xt;var et=q(()=>{xc=new TextDecoder,Xt=new TextDecoder("utf-8",{fatal:!0})});var Rn,Z,Q;var _e=q(()=>{Rn=class Rn extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}};Z=class Z extends Rn{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"};Q=class Q extends Rn{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}});function Oe(e){try{return Cn(typeof e=="string"?e:xc.decode(e),!0)}catch(t){throw TypeError(Vy,{cause:t})}}var Vy="The input to be decoded is not correctly encoded.";var Yt=q(()=>{et()});function tt(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function _c(e,t,r){let n;try{n=JSON.parse(Xt.decode(Oe(e)))}catch(i){throw new t(r,{cause:i})}if(!tt(n))throw new t(r);return n}var Zt=q(()=>{Yt();et()});function Xy(e,t,...r){if(r.length>2){let n=r.pop();e+=`one of type ${r.join(", ")}, or ${n}.`}else r.length===2?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return t==null?e+=` Received ${t}`:typeof t=="function"&&t.name?e+=` Received function ${t.name}`:typeof t=="object"&&t!=null&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}function Yy(e){return{__proto__:null,...e}}function Pc(e){let t=Yy(e);if(t.ext!==void 0&&typeof t.ext!="boolean")throw TypeError('"ext" (Extractable) Parameter must be a boolean');if(t.key_ops!==void 0){let r=t.key_ops,n=Array.isArray(r)?[...r]:void 0;if(!n||n.some((i)=>typeof i!="string")||new Set(n).size!==n.length)throw TypeError('"key_ops" (Key Operations) Parameter must be an array of unique strings');t.key_ops=n}return t}function xn(e){if(e!==void 0&&typeof e!="boolean")throw TypeError('"extractable" option must be a boolean');return e}async function _n(e,t,r){if(!e.kty.includes(t.kty))throw new Z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');let n=e.resolve?.({kty:t.kty,crv:t.crv})??e.subtle,i=!!(t.d||t.priv),s={...t,ext:r??t.ext};return s.kty!=="AKP"&&delete s.alg,delete s.use,crypto.subtle.importKey("jwk",s,n,s.ext??!i,t.key_ops??e.usages[i?1:0])}var Oc=(e)=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},kc=(e)=>e?.[Symbol.toStringTag]==="KeyObject",$c=(e,...t)=>Xy("Key must be ",e,...t);var On=q(()=>{_e()});function rt(e){let t={__proto__:null};for(let r in e)t[r]={...e[r],alg:r};return t}var kn=()=>{};function Qt(e){return{kty:["RSA"],mode:"key-encryption",subtle:{name:"RSA-OAEP",hash:`SHA-${e}`},usages:Zy,ops:["wrapKey","unwrapKey"]}}function er(e){return{kty:["EC","OKP"],mode:e,subtle:{name:"ECDH"},resolve:({kty:t,crv:r,asymmetricKeyType:n})=>{if(r==="X25519"||n==="x25519")return{name:"X25519"};if(t==="OKP")throw new Z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:r}},usages:Qy,ops:[void 0,"deriveBits"]}}function ke(e,t=!1){return{kty:["oct"],mode:"key-wrapping",secret:!0,subtle:{name:t?"AES-GCM":"AES-KW",length:e},usages:tr,ops:t?["encrypt","decrypt"]:["wrapKey","unwrapKey"]}}function $n(){return{kty:["oct"],mode:"key-wrapping",secret:!0,subtle:{name:"PBKDF2"},usages:tr,ops:["deriveBits","deriveBits"]}}function $e(e,t=!1){return{kty:["oct"],secret:!0,subtle:{name:t?"AES-CBC":"AES-GCM",length:e},usages:tr,ops:eE,cekBits:e,ivBits:t?128:96,cbc:t}}var Zy,Qy,tr,Lc,eE,Nb;var Nc=q(()=>{_e();kn();Zy=[["encrypt","wrapKey"],["decrypt","unwrapKey"]],Qy=[[],["deriveBits"]],tr=[[],[]];Lc=rt({dir:{kty:["oct"],mode:"direct-encryption",secret:!0,subtle:{name:"AES-GCM"},usages:tr,ops:["encrypt","decrypt"]},"RSA-OAEP":Qt(1),"RSA-OAEP-256":Qt(256),"RSA-OAEP-384":Qt(384),"RSA-OAEP-512":Qt(512),"ECDH-ES":er("direct-key-agreement"),"ECDH-ES+A128KW":er("key-agreement-with-key-wrapping"),"ECDH-ES+A192KW":er("key-agreement-with-key-wrapping"),"ECDH-ES+A256KW":er("key-agreement-with-key-wrapping"),A128KW:ke(128),A192KW:ke(192),A256KW:ke(256),A128GCMKW:ke(128,!0),A192GCMKW:ke(192,!0),A256GCMKW:ke(256,!0),"PBES2-HS256+A128KW":$n(),"PBES2-HS384+A192KW":$n(),"PBES2-HS512+A256KW":$n()}),eE=["encrypt","decrypt"];Nb=rt({A128GCM:$e(128),A192GCM:$e(192),A256GCM:$e(256),"A128CBC-HS256":$e(256,!0),"A192CBC-HS384":$e(384,!0),"A256CBC-HS512":$e(512,!0)})});function Pn(e){let t={name:"HMAC",hash:`SHA-${e}`};return{kty:["oct"],secret:!0,subtle:t,signing:t,usages:nt}}function Pe(e,t){let r={name:t?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:`SHA-${e}`};return{kty:["RSA"],subtle:r,signing:t?{...r,saltLength:t}:r,usages:nt,minRsaBits:2048}}function Ln(e,t){return{kty:["EC"],crv:e,subtle:{name:"ECDSA",namedCurve:e},signing:{name:"ECDSA",hash:`SHA-${t}`},usages:nt}}function qc(){let e={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:e,signing:e,usages:nt}}function Nn(e){let t={name:`ML-DSA-${e}`};return{kty:["AKP"],subtle:t,signing:t,usages:nt}}var nt,Fc;var jc=q(()=>{kn();nt=[["verify"],["sign"]];Fc=rt({HS256:Pn(256),HS384:Pn(384),HS512:Pn(512),RS256:Pe(256),RS384:Pe(384),RS512:Pe(512),PS256:Pe(256,32),PS384:Pe(384,48),PS512:Pe(512,64),ES256:Ln("P-256",256),ES384:Ln("P-384",384),ES512:Ln("P-521",512),EdDSA:qc(),Ed25519:qc(),"ML-DSA-44":Nn(44),"ML-DSA-65":Nn(65),"ML-DSA-87":Nn(87)})});function tE(e='JWK "alg" (Algorithm) Parameter'){throw new Z(`Invalid or unsupported ${e} value`)}function qn(e,t){return(typeof e=="string"?Fc[e]??Lc[e]:void 0)??tE(t)}var Kc=q(()=>{_e();jc();Nc()});var rE=(e,t)=>{let r=(e.match(/.{1,64}/g)||[]).join(`
9
9
  `);return`-----BEGIN ${t}-----
10
10
  ${r}
11
- -----END ${t}-----`},nE=async(e,t,r)=>{if(kc(r)){if(r.type!==e)throw TypeError(`key is not a ${e} key`);return r.export({format:"pem",type:t})}if(!Oc(r))throw TypeError($c(r,"CryptoKey","KeyObject"));if(!r.extractable)throw TypeError("CryptoKey is not extractable");if(r.type!==e)throw TypeError(`key is not a ${e} key`);return rE(In(new Uint8Array(await crypto.subtle.exportKey(t,r))),`${e.toUpperCase()} KEY`)},Dc=(e)=>nE("public","spki",e);var Uc=q(()=>{On();et()});function Bc(e){return Dc(e)}var Jc=q(()=>{Uc()});async function Wc(e,t,r){if(!tt(e))throw TypeError("JWK must be an object");let n=Lc(e),i=xn(r?.extractable),{alg:s}=n;if(t??=s,n.kty!=="oct"&&!t)throw TypeError('"alg" argument is required when "jwk.alg" is not present');switch(n.kty){case"oct":if(typeof n.k!="string")throw TypeError('missing "k" (Key Value) Parameter value');return Oe(n.k);case"AKP":{if(typeof s!="string"||!s)throw TypeError('missing "alg" (Algorithm) Parameter value');if(t!==s)throw TypeError("JWK alg and alg option value mismatch");return _n(qn(t),n,i)}case"RSA":case"EC":case"OKP":return _n(qn(t),n,i);default:throw new Z('Unsupported "kty" (Key Type) Parameter value')}}var Gc=q(()=>{Yt();On();Kc();_e();Zt()});function Hc(e){let t;if(typeof e=="string"){let n=e.split(".");(n.length===3||n.length===5)&&([t]=n)}else if(typeof e=="object"&&e)if("protected"in e)t=e.protected;else throw TypeError("Token does not contain a Protected Header");let r="Invalid Token or Protected Header formatting";if(typeof t!="string"||!t)throw TypeError(r);return _c(t,TypeError,r)}var Mc=q(()=>{Zt()});function zc(e){if(typeof e!="string")throw new Q("JWTs must use Compact JWS serialization, JWT must be a string");let{1:t,length:r}=e.split(".");if(r===5)throw new Q("Only JWTs using Compact JWS serialization can be decoded");if(r!==3)throw new Q("Invalid JWT");if(!t)throw new Q("JWTs must contain a payload");let n;try{n=Oe(t)}catch(s){throw new Q("Failed to base64url decode the payload",{cause:s})}let i;try{i=JSON.parse(Xt.decode(n))}catch(s){throw new Q("Failed to parse the decoded payload as JSON",{cause:s})}if(!tt(i))throw new Q("Invalid JWT Claims Set");return i}var Vc=q(()=>{Yt();et();Zt();_e()});var Fn=q(()=>{Jc();Gc();Mc();Vc()});var nr=d(function(Ev,Xc){function rr(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="JwksError",this.message=e}rr.prototype=Object.create(Error.prototype);rr.prototype.constructor=rr;Xc.exports=rr});var jn=d(function(Sv,Zc){var Yc=(Fn(),{}),iE=nr();function sE(e){if(e.alg)return e.alg;if(e.kty==="RSA")return"RS256";if(e.kty==="EC")switch(e.crv){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512"}if(e.kty==="OKP")switch(e.crv){case"Ed25519":case"Ed448":return"EdDSA"}throw new iE("Unsupported JWK")}async function oE(e){let t=[];e=e.filter(({use:r})=>r==="sig"||r===void 0).filter(({kty:r})=>r==="RSA"||r==="EC"||r==="OKP");for(let r of e)try{let n=await Wc({...r,ext:!0},sE(r));if(n.type!=="public")continue;let i;switch(n[Symbol.toStringTag]){case"CryptoKey":{let s=await Bc(n);i=()=>s;break}case"KeyObject":default:i=()=>n.export({format:"pem",type:"spki"})}t.push({get publicKey(){return i()},get rsaPublicKey(){return i()},getPublicKey(){return i()},...typeof r.kid==="string"&&r.kid?{kid:r.kid}:void 0,...typeof r.alg==="string"&&r.alg?{alg:r.alg}:void 0})}catch(n){continue}return t}Zc.exports={retrieveSigningKeys:oE}});var Kn=d(function(wv,Qc){function ir(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="ArgumentError",this.message=e}ir.prototype=Object.create(Error.prototype);ir.prototype.constructor=ir;Qc.exports=ir});var tu=d(function(bv,eu){var aE=require("http"),cE=require("https"),uE=Kn();eu.exports.default=(e)=>{if(e.fetcher)return e.fetcher(e.uri);return new Promise((t,r)=>{let n;try{n=new URL(e.uri)}catch(h){throw new uE("Invalid JWKS URI: The provided URI is not a valid URL.")}let{hostname:i,port:s,protocol:o,pathname:c,search:u}=n,a=c+u,l={hostname:i,path:a,port:s,method:"GET",...e.headers&&{headers:{...e.headers}},...e.timeout&&{timeout:e.timeout},...e.agent&&{agent:e.agent}},m=(o==="https:"?cE:aE).request(l,(h)=>{let g="";h.setEncoding("utf8"),h.on("data",(p)=>{g+=p}),h.on("end",()=>{if(h.statusCode<200||h.statusCode>=300){let p=h.body&&(h.body.message||h.body)||h.statusMessage||`Http Error ${h.statusCode}`;r({errorMsg:p})}else try{t(g&&JSON.parse(g))}catch(p){r(p)}})});m.on("timeout",()=>m.destroy()).on("error",(h)=>r(h)).end()})}});var ar=d(function(or){var nu=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),lE=nu((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.tracing=e.metrics=void 0;var t=require("node:diagnostics_channel");e.metrics=(0,t.channel)("lru-cache:metrics"),e.tracing=(0,t.tracingChannel)("lru-cache")}),fE=nu((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.defaultPerf=void 0,e.defaultPerf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date});Object.defineProperty(or,"__esModule",{value:!0});or.LRUCache=void 0;var _=lE(),hE=fE(),Dn=()=>_.metrics.hasSubscribers||_.tracing.hasSubscribers,iu=new Set,ru=typeof process=="object"&&process?process:{},dE=(e,t,r,n)=>{typeof ru.emitWarning=="function"?ru.emitWarning(e,t,r,n):console.error(`[${r}] ${t}: ${e}`)},pE=(e)=>!iu.has(e),ae=(e)=>!!e&&e===Math.floor(e)&&e>0&&isFinite(e),su=(e)=>ae(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?sr:null:null,sr=class extends Array{constructor(e){super(e),this.fill(0)}},mE=class e{heap;length;static#a=!1;static create(t){let r=su(t);if(!r)return[];e.#a=!0;let n=new e(t,r);return e.#a=!1,n}constructor(t,r){if(!e.#a)throw 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]}},gE=class e{#a;#f;#g;#_;#y;#N;#q;#E;get perf(){return this.#E}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#i;#S;#n;#r;#e;#u;#h;#c;#s;#w;#o;#b;#v;#d;#p;#T;#F;#l;#O;static unsafeExposeInternals(t){return{starts:t.#v,ttls:t.#d,autopurgeTimers:t.#p,sizes:t.#b,keyMap:t.#n,keyList:t.#r,valList:t.#e,next:t.#u,prev:t.#h,get head(){return t.#c},get tail(){return t.#s},free:t.#w,isBackgroundFetch:(r)=>t.#t(r),backgroundFetch:(r,n,i,s)=>t.#D(r,n,i,s),moveToTail:(r)=>t.#P(r),indexes:(r)=>t.#A(r),rindexes:(r)=>t.#I(r),isStale:(r)=>t.#m(r)}}get max(){return this.#a}get maxSize(){return this.#f}get calculatedSize(){return this.#S}get size(){return this.#i}get fetchMethod(){return this.#N}get memoMethod(){return this.#q}get dispose(){return this.#g}get onInsert(){return this.#_}get disposeAfter(){return this.#y}constructor(t){let{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:u,dispose:a,onInsert:l,disposeAfter:f,noDisposeOnSet:m,noUpdateTTL:h,maxSize:g=0,maxEntrySize:p=0,sizeCalculation:b,fetchMethod:S,memoMethod:w,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:K,ignoreFetchAbort:G,backgroundFetchSize:z=1,perf:V}=t;if(this.backgroundFetchSize=z,V!==void 0&&typeof V?.now!="function")throw TypeError("perf option must have a now() method if specified");if(this.#E=V??hE.defaultPerf,r!==0&&!ae(r))throw TypeError("max option must be a nonnegative integer");let le=r?su(r):Array;if(!le)throw Error("invalid max value: "+r);if(this.#a=r,this.#f=g,this.maxEntrySize=p||this.#f,this.sizeCalculation=b,this.sizeCalculation){if(!this.#f&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw TypeError("memoMethod must be a function if defined");if(this.#q=w,S!==void 0&&typeof S!="function")throw TypeError("fetchMethod must be a function if specified");if(this.#N=S,this.#F=!!S,this.#n=new Map,this.#r=Array.from({length:r}).fill(void 0),this.#e=Array.from({length:r}).fill(void 0),this.#u=new le(r),this.#h=new le(r),this.#c=0,this.#s=0,this.#w=mE.create(r),this.#i=0,this.#S=0,typeof a=="function"&&(this.#g=a),typeof l=="function"&&(this.#_=l),typeof f=="function"?(this.#y=f,this.#o=[]):(this.#y=void 0,this.#o=void 0),this.#T=!!this.#g,this.#O=!!this.#_,this.#l=!!this.#y,this.noDisposeOnSet=!!m,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!R,this.allowStaleOnFetchAbort=!!K,this.ignoreFetchAbort=!!G,this.maxEntrySize!==0){if(this.#f!==0&&!ae(this.#f))throw TypeError("maxSize must be a positive integer if specified");if(!ae(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#z()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=ae(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!ae(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#U()}if(this.#a===0&&this.ttl===0&&this.#f===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#a&&!this.#f){let ct="LRU_CACHE_UNBOUNDED";pE(ct)&&(iu.add(ct),dE("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ct,e))}}getRemainingTTL(t){return this.#n.has(t)?1/0:0}#U(){let t=new sr(this.#a),r=new sr(this.#a);this.#d=t,this.#v=r;let n=this.ttlAutopurge?Array.from({length:this.#a}):void 0;this.#p=n,this.#B=(u,a,l=this.#E.now())=>{r[u]=a!==0?l:0,t[u]=a,i(u,a)},this.#k=(u)=>{r[u]=t[u]!==0?this.#E.now():0,i(u,t[u])};let i=this.ttlAutopurge?(u,a)=>{if(n?.[u]&&(clearTimeout(n[u]),n[u]=void 0),a&&a!==0&&n){let l=setTimeout(()=>{this.#m(u)?(this.#C(this.#r[u],"expire"),n[u]=void 0):i(u,c(u))},a+1);l.unref&&l.unref(),n[u]=l}}:()=>{};this.#R=(u,a)=>{if(t[a]){let l=t[a],f=r[a];if(!l||!f)return;u.ttl=l,u.start=f,u.now=s||o();let m=u.now-f;u.remainingTTL=l-m}};let s=0,o=()=>{let u=this.#E.now();if(this.ttlResolution>0){s=u;let a=setTimeout(()=>s=0,this.ttlResolution);a.unref&&a.unref()}return u};this.getRemainingTTL=(u)=>{let a=this.#n.get(u);return a===void 0?0:c(a)};let c=(u)=>{let a=t[u],l=r[u];if(!a||!l)return 1/0;let f=(s||o())-l;return a-f};this.#m=(u)=>{let a=r[u],l=t[u];return!!l&&!!a&&(s||o())-a>l}}#k=()=>{};#R=()=>{};#B=()=>{};#m=()=>!1;#z(){let t=new sr(this.#a);this.#S=0,this.#b=t,this.#$=(r)=>{this.#S-=t[r],t[r]=0},this.#J=(r,n,i,s)=>{if(!ae(i)){if(this.#t(n))return this.backgroundFetchSize;if(s){if(typeof s!="function")throw TypeError("sizeCalculation must be a function");if(i=s(n,r),!ae(i))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return i},this.#j=(r,n,i)=>{if(t[r]=n,this.#f){let s=this.#f-t[r];for(;this.#S>s;)this.#K(!0)}this.#S+=t[r],i&&(i.entrySize=n,i.totalCalculatedSize=this.#S)}}#$=(t)=>{};#j=(t,r,n)=>{};#J=(t,r,n,i)=>{if(n||i)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#i)for(let r=this.#s;this.#W(r)&&((t||!this.#m(r))&&(yield r),r!==this.#c);)r=this.#h[r]}*#I({allowStale:t=this.allowStale}={}){if(this.#i)for(let r=this.#c;this.#W(r)&&((t||!this.#m(r))&&(yield r),r!==this.#s);)r=this.#u[r]}#W(t){return t!==void 0&&this.#n.get(this.#r[t])===t}*entries(){for(let t of this.#A())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.#I())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.#A()){let r=this.#r[t];r!==void 0&&!this.#t(this.#e[t])&&(yield r)}}*rkeys(){for(let t of this.#I()){let r=this.#r[t];r!==void 0&&!this.#t(this.#e[t])&&(yield r)}}*values(){for(let t of this.#A())this.#e[t]!==void 0&&!this.#t(this.#e[t])&&(yield this.#e[t])}*rvalues(){for(let t of this.#I())this.#e[t]!==void 0&&!this.#t(this.#e[t])&&(yield this.#e[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,r={}){for(let n of this.#A()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;if(s!==void 0&&t(s,this.#r[n],this))return this.#L(this.#r[n],r)}}forEach(t,r=this){for(let n of this.#A()){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.#I()){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.#I({allowStale:!0}))this.#m(r)&&(this.#C(this.#r[r],"expire"),t=!0);return t}info(t){let r=this.#n.get(t);if(r===void 0)return;let n=this.#e[r],i=this.#t(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#d&&this.#v){let o=this.#d[r],c=this.#v[r];if(o&&c){let u=o-(this.#E.now()-c);s.ttl=u,s.start=Date.now()}}return this.#b&&(s.size=this.#b[r]),s}dump(){let t=[];for(let r of this.#A({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 o={value:s};if(this.#d&&this.#v){o.ttl=this.#d[r];let c=this.#E.now()-this.#v[r];o.start=Math.floor(Date.now()-c)}this.#b&&(o.size=this.#b[r]),t.unshift([n,o])}return t}load(t){this.clear();for(let[r,n]of t){if(n.start){let i=Date.now()-n.start;n.start=this.#E.now()-i}this.#x(r,n.value,n)}}set(t,r,n={}){let{status:i=_.metrics.hasSubscribers?{}:void 0}=n;n.status=i,i&&(i.op="set",i.key=t,r!==void 0&&(i.value=r),i.cache=this);let s=this.#x(t,r,n);return i&&_.metrics.hasSubscribers&&_.metrics.publish(i),s}#x(t,r,n,i){let{ttl:s=this.ttl,start:o,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:a}=n,l=this.#t(r);if(r===void 0)return a&&(a.set="deleted"),this.delete(t),this;let{noUpdateTTL:f=this.noUpdateTTL}=n;a&&!l&&(a.value=r);let m=this.#J(t,r,n.size||0,u,a);if(this.maxEntrySize&&m>this.maxEntrySize)return this.#C(t,"set"),a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this;let h=this.#i===0?void 0:this.#n.get(t);if(h===void 0)h=this.#i===0?this.#s:this.#w.length!==0?this.#w.pop():this.#i===this.#a?this.#K(!1):this.#i,this.#r[h]=t,this.#e[h]=r,this.#n.set(t,h),this.#u[this.#s]=h,this.#h[h]=this.#s,this.#s=h,this.#i++,this.#j(h,m,a),a&&(a.set="add"),f=!1,this.#O&&!l&&this.#_?.(r,t,"add");else{this.#P(h);let g=this.#e[h];if(r!==g){if(!c)if(this.#t(g)){g!==i&&g.__abortController.abort(Error("replaced"));let{__staleWhileFetching:p}=g;p!==void 0&&p!==r&&(this.#T&&this.#g?.(p,t,"set"),this.#l&&this.#o?.push([p,t,"set"]))}else this.#T&&this.#g?.(g,t,"set"),this.#l&&this.#o?.push([g,t,"set"]);if(this.#$(h),this.#j(h,m,a),this.#e[h]=r,!l){let p=g&&this.#t(g)?g.__staleWhileFetching:g,b=p===void 0?"add":r!==p?"replace":"update";a&&(a.set=b,p!==void 0&&(a.oldValue=p)),this.#O&&this.onInsert?.(r,t,b)}}else l||(a&&(a.set="update"),this.#O&&this.onInsert?.(r,t,"update"))}if(s!==0&&!this.#d&&this.#U(),this.#d&&(f||this.#B(h,s,o),a&&this.#R(a,h)),!c&&this.#l&&this.#o){let g=this.#o,p;for(;p=g?.shift();)this.#y?.(...p)}return this}pop(){try{for(;this.#i;){let t=this.#e[this.#c];if(this.#K(!0),this.#t(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#l&&this.#o){let t=this.#o,r;for(;r=t?.shift();)this.#y?.(...r)}}}#K(t){let r=this.#c,n=this.#r[r],i=this.#e[r],s=this.#t(i);s&&i.__abortController.abort(Error("evicted"));let o=s?i.__staleWhileFetching:i;return(this.#T||this.#l)&&o!==void 0&&(this.#T&&this.#g?.(o,n,"evict"),this.#l&&this.#o?.push([o,n,"evict"])),this.#$(r),this.#p?.[r]&&(clearTimeout(this.#p[r]),this.#p[r]=void 0),t&&(this.#r[r]=void 0,this.#e[r]=void 0,this.#w.push(r)),this.#i===1?(this.#c=this.#s=0,this.#w.length=0):this.#c=this.#u[r],this.#n.delete(n),this.#i--,r}has(t,r={}){let{status:n=_.metrics.hasSubscribers?{}:void 0}=r;r.status=n,n&&(n.op="has",n.key=t,n.cache=this);let i=this.#V(t,r);return _.metrics.hasSubscribers&&_.metrics.publish(n),i}#V(t,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=r,s=this.#n.get(t);if(s!==void 0){let o=this.#e[s];if(this.#t(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#m(s))i&&(i.has="stale",this.#R(i,s));else return n&&this.#k(s),i&&(i.has="hit",this.#R(i,s)),!0}else i&&(i.has="miss");return!1}peek(t,r={}){let{status:n=Dn()?{}:void 0}=r;n&&(n.op="peek",n.key=t,n.cache=this),r.status=n;let i=this.#X(t,r);return _.metrics.hasSubscribers&&_.metrics.publish(n),i}#X(t,r){let{status:n,allowStale:i=this.allowStale}=r,s=this.#n.get(t);if(s===void 0||!i&&this.#m(s)){n&&(n.peek=s===void 0?"miss":"stale");return}let o=this.#e[s],c=this.#t(o)?o.__staleWhileFetching:o;return n&&(c!==void 0?(n.peek="hit",n.value=c):n.peek="miss"),c}#D(t,r,n,i){let s=r===void 0?void 0:this.#e[r];if(this.#t(s))return s;let o=new AbortController,{signal:c}=n;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let u={signal:o.signal,options:n,context:i},a=(p,b=!1)=>{let{aborted:S}=o.signal,w=n.ignoreFetchAbort&&p!==void 0,A=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&p!==void 0);if(n.status&&(S&&!b?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,w&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),S&&!w&&!b)return f(o.signal.reason,A);let T=h,R=this.#e[r];return(R===h||R===void 0&&w&&b)&&(p===void 0?T.__staleWhileFetching!==void 0?this.#e[r]=T.__staleWhileFetching:this.#C(t,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.#x(t,p,u.options,T))),p},l=(p)=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=p),f(p,!1)),f=(p,b)=>{let{aborted:S}=o.signal,w=S&&n.allowStaleOnFetchAbort,A=w||n.allowStaleOnFetchRejection,T=A||n.noDeleteOnFetchRejection,R=h;if(this.#e[r]===h&&(!T||!b&&R.__staleWhileFetching===void 0?this.#C(t,"fetch"):w||(this.#e[r]=R.__staleWhileFetching)),A)return n.status&&R.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),R.__staleWhileFetching;if(R.__returned===R)throw p},m=(p,b)=>{let S=this.#N?.(t,s,u);o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(p(void 0),n.allowStaleOnFetchAbort&&(p=(w)=>a(w,!0)))}),S&&S instanceof Promise?S.then((w)=>p(w===void 0?void 0:w),b):S!==void 0&&p(S)};n.status&&(n.status.fetchDispatched=!0);let h=new Promise(m).then(a,l),g=Object.assign(h,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.#x(t,g,{...u.options,status:void 0}),r=this.#n.get(t)):this.#e[r]=g,g}#t(t){if(!this.#F)return!1;let r=t;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof AbortController}fetch(t,r={}){let n=_.tracing.hasSubscribers,{status:i=Dn()?{}:void 0}=r;r.status=i,i&&r.context&&(i.context=r.context);let s=this.#G(t,r);return i&&n&&(i.trace=!0,_.tracing.tracePromise(()=>s,i).catch(()=>{})),s}async#G(t,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:u=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:p,forceRefresh:b=!1,status:S,signal:w}=r;if(S&&(S.op="fetch",S.key=t,b&&(S.forceRefresh=!0),S.cache=this),!this.#F)return S&&(S.fetch="get"),this.#L(t,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:S});let A={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:c,size:u,sizeCalculation:a,noUpdateTTL:l,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:g,ignoreFetchAbort:h,status:S,signal:w},T=this.#n.get(t);if(T===void 0){S&&(S.fetch="miss");let R=this.#D(t,T,A,p);return R.__returned=R}else{let R=this.#e[T];if(this.#t(R)){let V=n&&R.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",V&&(S.returnedStale=!0)),V?R.__staleWhileFetching:R.__returned=R}let K=this.#m(T);if(!b&&!K)return S&&(S.fetch="hit"),this.#P(T),i&&this.#k(T),S&&this.#R(S,T),R;let G=this.#D(t,T,A,p),z=G.__staleWhileFetching!==void 0&&n;return S&&(S.fetch=K?"stale":"refresh",z&&K&&(S.returnedStale=!0)),z?G.__staleWhileFetching:G.__returned=G}}forceFetch(t,r={}){let n=_.tracing.hasSubscribers,{status:i=Dn()?{}:void 0}=r;r.status=i,i&&r.context&&(i.context=r.context);let s=this.#Y(t,r);return i&&n&&(i.trace=!0,_.tracing.tracePromise(()=>s,i).catch(()=>{})),s}async#Y(t,r={}){let n=await this.#G(t,r);if(n===void 0)throw Error("fetch() returned undefined");return n}memo(t,r={}){let{status:n=_.metrics.hasSubscribers?{}:void 0}=r;r.status=n,n&&(n.op="memo",n.key=t,r.context&&(n.context=r.context),n.cache=this);let i=this.#Z(t,r);return n&&(n.value=i),_.metrics.hasSubscribers&&_.metrics.publish(n),i}#Z(t,r={}){let n=this.#q;if(!n)throw Error("no memoMethod provided to constructor");let{context:i,status:s,forceRefresh:o,...c}=r;s&&o&&(s.forceRefresh=!0);let u=this.#L(t,c),a=o||u===void 0;if(s&&(s.memo=a?"miss":"hit",a||(s.value=u)),!a)return u;let l=n(t,u,{options:c,context:i});return s&&(s.value=l),this.#x(t,l,c),l}get(t,r={}){let{status:n=_.metrics.hasSubscribers?{}:void 0}=r;r.status=n,n&&(n.op="get",n.key=t,n.cache=this);let i=this.#L(t,r);return n&&(i!==void 0&&(n.value=i),_.metrics.hasSubscribers&&_.metrics.publish(n)),i}#L(t,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=r,c=this.#n.get(t);if(c===void 0){o&&(o.get="miss");return}let u=this.#e[c],a=this.#t(u);return o&&this.#R(o,c),this.#m(c)?a?(o&&(o.get="stale-fetching"),n&&u.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),u.__staleWhileFetching):void 0):(s||this.#C(t,"expire"),o&&(o.get="stale"),n?(o&&(o.returnedStale=!0),u):void 0):(o&&(o.get=a?"fetching":"hit"),this.#P(c),i&&this.#k(c),a?u.__staleWhileFetching:u)}#H(t,r){this.#h[r]=t,this.#u[t]=r}#P(t){t!==this.#s&&(t===this.#c?this.#c=this.#u[t]:this.#H(this.#h[t],this.#u[t]),this.#H(this.#s,t),this.#s=t)}delete(t){return this.#C(t,"delete")}#C(t,r){_.metrics.hasSubscribers&&_.metrics.publish({op:"delete",delete:r,key:t,cache:this});let n=!1;if(this.#i!==0){let i=this.#n.get(t);if(i!==void 0)if(this.#p?.[i]&&(clearTimeout(this.#p[i]),this.#p[i]=void 0),n=!0,this.#i===1)this.#M(r);else{this.#$(i);let s=this.#e[i];if(this.#t(s)?s.__abortController.abort(Error("deleted")):(this.#T||this.#l)&&(this.#T&&this.#g?.(s,t,r),this.#l&&this.#o?.push([s,t,r])),this.#n.delete(t),this.#r[i]=void 0,this.#e[i]=void 0,i===this.#s)this.#s=this.#h[i];else if(i===this.#c)this.#c=this.#u[i];else{let o=this.#h[i];this.#u[o]=this.#u[i];let c=this.#u[i];this.#h[c]=this.#h[i]}this.#i--,this.#w.push(i)}}if(this.#l&&this.#o?.length){let i=this.#o,s;for(;s=i?.shift();)this.#y?.(...s)}return n}clear(){return this.#M("delete")}#M(t){for(let r of this.#I({allowStale:!0})){let n=this.#e[r];if(this.#t(n))n.__abortController.abort(Error("deleted"));else{let i=this.#r[r];this.#T&&this.#g?.(n,i,t),this.#l&&this.#o?.push([n,i,t])}}if(this.#n.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#d&&this.#v){this.#d.fill(0),this.#v.fill(0);for(let r of this.#p??[])r!==void 0&&clearTimeout(r);this.#p?.fill(void 0)}if(this.#b&&this.#b.fill(0),this.#c=0,this.#s=0,this.#w.length=0,this.#S=0,this.#i=0,this.#l&&this.#o){let r=this.#o,n;for(;n=r?.shift();)this.#y?.(...n)}}};or.LRUCache=gE});var ti=d(function(it,Pe){var yE=200,yu="__lodash_hash_undefined__",Eu=9007199254740991,zn="[object Arguments]",EE="[object Array]",Su="[object Boolean]",wu="[object Date]",SE="[object Error]",Vn="[object Function]",bu="[object GeneratorFunction]",cr="[object Map]",vu="[object Number]",Xn="[object Object]",ou="[object Promise]",Tu="[object RegExp]",ur="[object Set]",Au="[object String]",Iu="[object Symbol]",Bn="[object WeakMap]",Cu="[object ArrayBuffer]",lr="[object DataView]",Ru="[object Float32Array]",xu="[object Float64Array]",_u="[object Int8Array]",Ou="[object Int16Array]",ku="[object Int32Array]",$u="[object Uint8Array]",Lu="[object Uint8ClampedArray]",Pu="[object Uint16Array]",Nu="[object Uint32Array]",wE=/[\\^$.*+?()[\]{}|]/g,bE=/\w*$/,vE=/^\[object .+?Constructor\]$/,TE=/^(?:0|[1-9]\d*)$/,C={};C[zn]=C[EE]=C[Cu]=C[lr]=C[Su]=C[wu]=C[Ru]=C[xu]=C[_u]=C[Ou]=C[ku]=C[cr]=C[vu]=C[Xn]=C[Tu]=C[ur]=C[Au]=C[Iu]=C[$u]=C[Lu]=C[Pu]=C[Nu]=!0;C[SE]=C[Vn]=C[Bn]=!1;var AE=typeof global=="object"&&global&&global.Object===Object&&global,IE=typeof self=="object"&&self&&self.Object===Object&&self,ee=AE||IE||Function("return this")(),qu=typeof it=="object"&&it&&!it.nodeType&&it,au=qu&&typeof Pe=="object"&&Pe&&!Pe.nodeType&&Pe,CE=au&&au.exports===qu;function RE(e,t){return e.set(t[0],t[1]),e}function xE(e,t){return e.add(t),e}function _E(e,t){var r=-1,n=e?e.length:0;while(++r<n)if(t(e[r],r,e)===!1)break;return e}function OE(e,t){var r=-1,n=t.length,i=e.length;while(++r<n)e[i+r]=t[r];return e}function Fu(e,t,r,n){var i=-1,s=e?e.length:0;if(n&&s)r=e[++i];while(++i<s)r=t(r,e[i],i,e);return r}function kE(e,t){var r=-1,n=Array(e);while(++r<e)n[r]=t(r);return n}function $E(e,t){return e==null?void 0:e[t]}function ju(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function cu(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function Yn(e,t){return function(r){return e(t(r))}}function uu(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var LE=Array.prototype,PE=Function.prototype,fr=Object.prototype,Un=ee["__core-js_shared__"],lu=function(){var e=/[^.]+$/.exec(Un&&Un.keys&&Un.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ku=PE.toString,{hasOwnProperty:ce,toString:hr}=fr,NE=RegExp("^"+Ku.call(ce).replace(wE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fu=CE?ee.Buffer:void 0,{Symbol:hu,Uint8Array:du}=ee,qE=Yn(Object.getPrototypeOf,Object),FE=Object.create,jE=fr.propertyIsEnumerable,KE=LE.splice,pu=Object.getOwnPropertySymbols,DE=fu?fu.isBuffer:void 0,UE=Yn(Object.keys,Object),Jn=Fe(ee,"DataView"),st=Fe(ee,"Map"),Wn=Fe(ee,"Promise"),Gn=Fe(ee,"Set"),Hn=Fe(ee,"WeakMap"),ot=Fe(Object,"create"),BE=me(Jn),JE=me(st),WE=me(Wn),GE=me(Gn),HE=me(Hn),mu=hu?hu.prototype:void 0,gu=mu?mu.valueOf:void 0;function pe(e){var t=-1,r=e?e.length:0;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}function ME(){this.__data__=ot?ot(null):{}}function zE(e){return this.has(e)&&delete this.__data__[e]}function VE(e){var t=this.__data__;if(ot){var r=t[e];return r===yu?void 0:r}return ce.call(t,e)?t[e]:void 0}function XE(e){var t=this.__data__;return ot?t[e]!==void 0:ce.call(t,e)}function YE(e,t){var r=this.__data__;return r[e]=ot&&t===void 0?yu:t,this}pe.prototype.clear=ME;pe.prototype.delete=zE;pe.prototype.get=VE;pe.prototype.has=XE;pe.prototype.set=YE;function te(e){var t=-1,r=e?e.length:0;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}function ZE(){this.__data__=[]}function QE(e){var t=this.__data__,r=dr(t,e);if(r<0)return!1;var n=t.length-1;if(r==n)t.pop();else KE.call(t,r,1);return!0}function e0(e){var t=this.__data__,r=dr(t,e);return r<0?void 0:t[r][1]}function t0(e){return dr(this.__data__,e)>-1}function r0(e,t){var r=this.__data__,n=dr(r,e);if(n<0)r.push([e,t]);else r[n][1]=t;return this}te.prototype.clear=ZE;te.prototype.delete=QE;te.prototype.get=e0;te.prototype.has=t0;te.prototype.set=r0;function Ne(e){var t=-1,r=e?e.length:0;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}function n0(){this.__data__={hash:new pe,map:new(st||te),string:new pe}}function i0(e){return pr(this,e).delete(e)}function s0(e){return pr(this,e).get(e)}function o0(e){return pr(this,e).has(e)}function a0(e,t){return pr(this,e).set(e,t),this}Ne.prototype.clear=n0;Ne.prototype.delete=i0;Ne.prototype.get=s0;Ne.prototype.has=o0;Ne.prototype.set=a0;function qe(e){this.__data__=new te(e)}function c0(){this.__data__=new te}function u0(e){return this.__data__.delete(e)}function l0(e){return this.__data__.get(e)}function f0(e){return this.__data__.has(e)}function h0(e,t){var r=this.__data__;if(r instanceof te){var n=r.__data__;if(!st||n.length<yE-1)return n.push([e,t]),this;r=this.__data__=new Ne(n)}return r.set(e,t),this}qe.prototype.clear=c0;qe.prototype.delete=u0;qe.prototype.get=l0;qe.prototype.has=f0;qe.prototype.set=h0;function d0(e,t){var r=Qn(e)||F0(e)?kE(e.length,String):[],n=r.length,i=!!n;for(var s in e)if((t||ce.call(e,s))&&!(i&&(s=="length"||L0(s,n))))r.push(s);return r}function Du(e,t,r){var n=e[t];if(!(ce.call(e,t)&&Wu(n,r))||r===void 0&&!(t in e))e[t]=r}function dr(e,t){var r=e.length;while(r--)if(Wu(e[r][0],t))return r;return-1}function p0(e,t){return e&&Uu(t,ei(t),e)}function Mn(e,t,r,n,i,s,o){var c;if(n)c=s?n(e,i,s,o):n(e);if(c!==void 0)return c;if(!mr(e))return e;var u=Qn(e);if(u){if(c=O0(e),!t)return R0(e,c)}else{var a=de(e),l=a==Vn||a==bu;if(K0(e))return w0(e,t);if(a==Xn||a==zn||l&&!s){if(ju(e))return s?e:{};if(c=k0(l?{}:e),!t)return x0(e,p0(c,e))}else{if(!C[a])return s?e:{};c=$0(e,a,Mn,t)}}o||(o=new qe);var f=o.get(e);if(f)return f;if(o.set(e,c),!u)var m=r?_0(e):ei(e);return _E(m||e,function(h,g){if(m)g=h,h=e[g];Du(c,g,Mn(h,t,r,n,g,e,o))}),c}function m0(e){return mr(e)?FE(e):{}}function g0(e,t,r){var n=t(e);return Qn(e)?n:OE(n,r(e))}function y0(e){return hr.call(e)}function E0(e){if(!mr(e)||N0(e))return!1;var t=Hu(e)||ju(e)?NE:vE;return t.test(me(e))}function S0(e){if(!Ju(e))return UE(e);var t=[];for(var r in Object(e))if(ce.call(e,r)&&r!="constructor")t.push(r);return t}function w0(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}function Zn(e){var t=new e.constructor(e.byteLength);return new du(t).set(new du(e)),t}function b0(e,t){var r=t?Zn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function v0(e,t,r){var n=t?r(cu(e),!0):cu(e);return Fu(n,RE,new e.constructor)}function T0(e){var t=new e.constructor(e.source,bE.exec(e));return t.lastIndex=e.lastIndex,t}function A0(e,t,r){var n=t?r(uu(e),!0):uu(e);return Fu(n,xE,new e.constructor)}function I0(e){return gu?Object(gu.call(e)):{}}function C0(e,t){var r=t?Zn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function R0(e,t){var r=-1,n=e.length;t||(t=Array(n));while(++r<n)t[r]=e[r];return t}function Uu(e,t,r,n){r||(r={});var i=-1,s=t.length;while(++i<s){var o=t[i],c=n?n(r[o],e[o],o,r,e):void 0;Du(r,o,c===void 0?e[o]:c)}return r}function x0(e,t){return Uu(e,Bu(e),t)}function _0(e){return g0(e,ei,Bu)}function pr(e,t){var r=e.__data__;return P0(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Fe(e,t){var r=$E(e,t);return E0(r)?r:void 0}var Bu=pu?Yn(pu,Object):B0,de=y0;if(Jn&&de(new Jn(new ArrayBuffer(1)))!=lr||st&&de(new st)!=cr||Wn&&de(Wn.resolve())!=ou||Gn&&de(new Gn)!=ur||Hn&&de(new Hn)!=Bn)de=function(e){var t=hr.call(e),r=t==Xn?e.constructor:void 0,n=r?me(r):void 0;if(n)switch(n){case BE:return lr;case JE:return cr;case WE:return ou;case GE:return ur;case HE:return Bn}return t};function O0(e){var t=e.length,r=e.constructor(t);if(t&&typeof e[0]=="string"&&ce.call(e,"index"))r.index=e.index,r.input=e.input;return r}function k0(e){return typeof e.constructor=="function"&&!Ju(e)?m0(qE(e)):{}}function $0(e,t,r,n){var i=e.constructor;switch(t){case Cu:return Zn(e);case Su:case wu:return new i(+e);case lr:return b0(e,n);case Ru:case xu:case _u:case Ou:case ku:case $u:case Lu:case Pu:case Nu:return C0(e,n);case cr:return v0(e,n,r);case vu:case Au:return new i(e);case Tu:return T0(e);case ur:return A0(e,n,r);case Iu:return I0(e)}}function L0(e,t){return t=t==null?Eu:t,!!t&&(typeof e=="number"||TE.test(e))&&(e>-1&&e%1==0&&e<t)}function P0(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function N0(e){return!!lu&&lu in e}function Ju(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||fr;return e===r}function me(e){if(e!=null){try{return Ku.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function q0(e){return Mn(e,!0,!0)}function Wu(e,t){return e===t||e!==e&&t!==t}function F0(e){return j0(e)&&ce.call(e,"callee")&&(!jE.call(e,"callee")||hr.call(e)==zn)}var Qn=Array.isArray;function Gu(e){return e!=null&&D0(e.length)&&!Hu(e)}function j0(e){return U0(e)&&Gu(e)}var K0=DE||J0;function Hu(e){var t=mr(e)?hr.call(e):"";return t==Vn||t==bu}function D0(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Eu}function mr(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function U0(e){return!!e&&typeof e=="object"}function ei(e){return Gu(e)?d0(e):S0(e)}function B0(){return[]}function J0(){return!1}Pe.exports=q0});var ri=d(function(gr){Object.defineProperty(gr,"__esModule",{value:!0});gr.deepFreeze=void 0;function Mu(e){if(e)Object.freeze(e),Object.getOwnPropertyNames(e).forEach(function(t){if(e.hasOwnProperty(t)&&e[t]!==null&&(typeof e[t]==="object"||typeof e[t]==="function")&&e[t].constructor!==Buffer&&!Object.isFrozen(e[t]))Mu(e[t])});return e}gr.deepFreeze=Mu});var Yu=d(function(je){var W0=je&&je.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(je,"__esModule",{value:!0});je.syncMemoizer=void 0;var Vu=ar(),Xu=require("events"),zu=W0(ti()),yr=ri();function G0(e){let t=new Vu.LRUCache(e),{load:r,hash:n,bypass:i,itemTTL:s,freeze:o,clone:c}=e,u=new Xu.EventEmitter,a=Object.assign({del:l,reset:()=>t.clear(),keys:()=>[...t.keys()],on:u.on.bind(u),once:u.once.bind(u)},e);if(e.disable)return Object.assign(r,a);function l(){let p=n(...arguments);t.delete(p)}function f(p,...b){u.emit(p,...b)}function m(p){return p&&p.then&&typeof p.then==="function"}function h(p){let b=p;if(c)if(m(b))b=b.then(zu.default);else b=(0,zu.default)(b);if(o)if(m(b))b=b.then(yr.deepFreeze);else yr.deepFreeze(b);return b}return Object.assign(function(...p){if(i&&i(...p))return f("miss",...p),r(...p);var b=n(...p),S=t.get(b);if(S)return f("hit",...p),h(S);f("miss",...p);let w=r(...p);if(s)t.set(b,w,{ttl:s(...p.concat([w]))});else t.set(b,w);return h(w)},a)}je.syncMemoizer=G0});var nl=d(function(Ke){var H0=Ke&&Ke.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.asyncMemoizer=void 0;var Zu=ar(),Qu=require("events"),M0=H0(ti()),el=ri(),tl=Yu();function rl(e){let t=new Zu.LRUCache(e),{load:r,hash:n,bypass:i,itemTTL:s,freeze:o,clone:c}=e,u=e.queueTTL||1000,a=new Map,l=new Qu.EventEmitter,f=Object.assign({del:m,reset:()=>t.clear(),keys:()=>[...t.keys()],on:l.on.bind(l),once:l.once.bind(l)},e);if(e.disable)return Object.assign(r,f);function m(...S){let w=n(...S);t.delete(w)}function h(S,w,A){if(o)A.forEach(el.deepFreeze);if(s)t.set(S,A,{ttl:s(...w.concat(A))});else t.set(S,A)}function g(S,w){for(let A of S)if(c)setImmediate(A,...w.map(M0.default));else setImmediate(A,...w)}function p(S,...w){l.emit(S,...w)}function b(...S){let w=S.slice(0,-1),A=S.slice(-1).pop(),T;if(i&&i(...w))return p("miss",...w),r(...S);if(w.length===0&&!n)T="_";else T=n(...w);let R=t.get(T);if(R)return p("hit",...w),g([A],[null].concat(R));let K=a.get(T);if(K&&K.expiresAt>Date.now()){K.queue.push(A),p("queue",...w);return}p("miss",...w);let G=Date.now(),z=[A];a.set(T,{queue:z,expiresAt:G+u});let V=(...le)=>{if(!le[0])h(T,w,le.slice(1));a.delete(T),p("loaded",Date.now()-G,...w),g(z,le)};r(...w,V)}return Object.assign(b,f)}Ke.asyncMemoizer=rl;rl.sync=tl.syncMemoizer});var ol=d(function(Rv,sl){var il=nl();sl.exports=il.asyncMemoizer});var ul=d(function(xv,cl){var ni=Vt()("jwks"),z0=ol(),{LRUCache:V0}=ar(),{promisify:X0,callbackify:al}=require("util");function Y0(e,{cacheMaxEntries:t=5,cacheMaxAge:r=600000,cacheMaxAgeFallback:n,onStaleCacheFallback:i}){ni(`Configured caching of signing keys. Max: ${t} / Age: ${r}${n?` / Fallback: ${n}`:""}`);let s;if(n){let o=new V0({max:t}),c=e.getSigningKey.bind(e);s=al(async(u)=>{try{let a=await c(u);return o.set(u,{key:a,fetchedAt:Date.now()}),a}catch(a){if(a.isEndpointUnavailable){let l=o.get(u);if(l&&Date.now()-l.fetchedAt<r+n){if(ni(`JWKS endpoint unavailable, serving stale signing key for '${u}': ${a.message}`),i)i(a,u,l.key);return l.key}ni(`JWKS endpoint unavailable and no valid stale entry for '${u}', fallback window expired or key never fetched`)}throw a}})}else s=al(e.getSigningKey.bind(e));return X0(z0({hash:(o)=>o,load:s,ttl:r,max:t}))}cl.exports.default=Y0});var ii=d(function(_v,fl){var ll=function(e,t,r,n){if(this.bucketSize=e,this.tokensPerInterval=t,typeof r==="string")switch(r){case"sec":case"second":this.interval=1000;break;case"min":case"minute":this.interval=60000;break;case"hr":case"hour":this.interval=3600000;break;case"day":this.interval=86400000;break;default:throw Error("Invaid interval "+r)}else this.interval=r;this.parentBucket=n,this.content=0,this.lastDrip=+new Date};ll.prototype={bucketSize:1,tokensPerInterval:1,interval:1000,parentBucket:null,content:0,lastDrip:0,removeTokens:function(e,t){var r=this;if(!this.bucketSize)return process.nextTick(t.bind(null,null,e,Number.POSITIVE_INFINITY)),!0;if(e>this.bucketSize)return process.nextTick(t.bind(null,"Requested tokens "+e+" exceeds bucket size "+this.bucketSize,null)),!1;if(this.drip(),e>this.content)return n();if(this.parentBucket)return this.parentBucket.removeTokens(e,function(i,s){if(i)return t(i,null);if(e>r.content)return n();r.content-=e,t(null,Math.min(s,r.content))});else return this.content-=e,process.nextTick(t.bind(null,null,this.content)),!0;function n(){var i=Math.ceil((e-r.content)*(r.interval/r.tokensPerInterval));return setTimeout(function(){r.removeTokens(e,t)},i),!1}},tryRemoveTokens:function(e){if(!this.bucketSize)return!0;if(e>this.bucketSize)return!1;if(this.drip(),e>this.content)return!1;if(this.parentBucket&&!this.parentBucket.tryRemoveTokens(e))return!1;return this.content-=e,!0},drip:function(){if(!this.tokensPerInterval){this.content=this.bucketSize;return}var e=+new Date,t=Math.max(e-this.lastDrip,0);this.lastDrip=e;var r=t*(this.tokensPerInterval/this.interval);this.content=Math.min(this.content+r,this.bucketSize)}};fl.exports=ll});var dl=d(function(Ov,hl){var Z0=function(){if(typeof process<"u"&&process.hrtime){var e=process.hrtime(),t=e[0],r=e[1];return t*1000+Math.floor(r/1e6)}return new Date().getTime()};hl.exports=Z0});var gl=d(function(kv,ml){var Q0=ii(),si=dl(),pl=function(e,t,r){this.tokenBucket=new Q0(e,e,t,null),this.tokenBucket.content=e,this.curIntervalStart=si(),this.tokensThisInterval=0,this.fireImmediately=r};pl.prototype={tokenBucket:null,curIntervalStart:0,tokensThisInterval:0,fireImmediately:!1,removeTokens:function(e,t){if(e>this.tokenBucket.bucketSize)return process.nextTick(t.bind(null,"Requested tokens "+e+" exceeds maximum tokens per interval "+this.tokenBucket.bucketSize,null)),!1;var r=this,n=si();if(n<this.curIntervalStart||n-this.curIntervalStart>=this.tokenBucket.interval)this.curIntervalStart=n,this.tokensThisInterval=0;if(e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval){if(this.fireImmediately)process.nextTick(t.bind(null,null,-1));else{var i=Math.ceil(this.curIntervalStart+this.tokenBucket.interval-n);setTimeout(function(){r.tokenBucket.removeTokens(e,s)},i)}return!1}return this.tokenBucket.removeTokens(e,s);function s(o,c){if(o)return t(o,null);r.tokensThisInterval+=e,t(null,c)}},tryRemoveTokens:function(e){if(e>this.tokenBucket.bucketSize)return!1;var t=si();if(t<this.curIntervalStart||t-this.curIntervalStart>=this.tokenBucket.interval)this.curIntervalStart=t,this.tokensThisInterval=0;if(e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval)return!1;var r=this.tokenBucket.tryRemoveTokens(e);if(r)this.tokensThisInterval+=e;return r},getTokensRemaining:function(){return this.tokenBucket.drip(),this.tokenBucket.content}};ml.exports=pl});var yl=d(function(oi){oi.RateLimiter=gl();oi.TokenBucket=ii()});var ai=d(function(Lv,El){function Er(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="JwksRateLimitError",this.message=e}Er.prototype=Object.create(Error.prototype);Er.prototype.constructor=Er;El.exports=Er});var wl=d(function(Pv,Sl){var ci=Vt()("jwks"),{RateLimiter:eS}=yl(),tS=ai();function rS(e,{jwksRequestsPerMinute:t=10}){let r=e.getSigningKey.bind(e),n=new eS(t,"minute",!0);return ci(`Configured rate limiting to JWKS endpoint at ${t}/minute`),async(i)=>await new Promise((s,o)=>{n.removeTokens(1,async(c,u)=>{if(c)o(c);if(ci("Requests to the JWKS endpoint available for the next minute:",u),u<0)ci("Too many requests to the JWKS endpoint"),o(new tS("Too many requests to the JWKS endpoint"));else try{let a=await r(i);s(a)}catch(a){o(a)}})})}Sl.exports.default=rS});var vl=d(function(Nv,bl){var nS=jn().retrieveSigningKeys;function iS(e,{getKeysInterceptor:t}){let r=e.getSigningKey.bind(e);return async(n)=>{let i=await t(),s;if(i&&i.length)s=await nS(i);if(s&&s.length){let o=s.find((c)=>!n||c.kid===n);if(o)return o}return r(n)}}bl.exports.default=iS});var Al=d(function(qv,Tl){var{callbackify:sS}=require("util"),oS=(e)=>{let t=e.getSigningKey.bind(e);return(r,n)=>{if(n)return sS(t)(r,n);return t(r)}};Tl.exports.default=oS});var Cl=d(function(Fv,Il){Il.exports={request:tu().default,cacheSigningKey:ul().default,rateLimitSigningKey:wl().default,getKeysInterceptor:vl().default,callbackSupport:Al().default}});var ui=d(function(jv,Rl){function Sr(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="SigningKeyNotFoundError",this.message=e}Sr.prototype=Object.create(Error.prototype);Sr.prototype.constructor=Sr;Rl.exports=Sr});var De=d(function(Kv,Ol){var ge=Vt()("jwks"),{retrieveSigningKeys:aS}=jn(),{request:cS,cacheSigningKey:uS,rateLimitSigningKey:lS,getKeysInterceptor:fS,callbackSupport:hS}=Cl(),li=nr(),xl=ui();class _l{constructor(e){if(this.options={rateLimit:!1,cache:!0,timeout:30000,...e},this.options.getKeysInterceptor)this.getSigningKey=fS(this,e);if(this.options.rateLimit)this.getSigningKey=lS(this,e);if(this.options.cache)this.getSigningKey=uS(this,e);this.getSigningKey=hS(this,e)}async getKeys(){ge(`Fetching keys from '${this.options.jwksUri}'`);try{let e=await cS({uri:this.options.jwksUri,headers:this.options.requestHeaders,agent:this.options.requestAgent,timeout:this.options.timeout,fetcher:this.options.fetcher});return ge("Keys:",e.keys),e.keys}catch(e){let{errorMsg:t}=e;ge("Failure:",t||e);let r=t?new li(t):e;throw r.isEndpointUnavailable=!0,r}}async getSigningKeys(){let e=await this.getKeys();if(!e||!e.length)throw new li("The JWKS endpoint did not contain any keys");let t=await aS(e);if(!t.length)throw new li("The JWKS endpoint did not contain any signing keys");return ge("Signing Keys:",t),t}async getSigningKey(e){ge(`Fetching signing key for '${e}'`);let t=await this.getSigningKeys(),r=e!==void 0&&e!==null;if(!r&&t.length>1)throw ge("No KID specified and JWKS endpoint returned more than 1 key"),new xl("No KID specified and JWKS endpoint returned more than 1 key");let n=t.find((i)=>!r||i.kid===e);if(n)return n;else throw ge(`Unable to find a signing key that matches '${e}'`),new xl(`Unable to find a signing key that matches '${e}'`)}}Ol.exports={JwksClient:_l}});var Ue=d(function(Dv,kl){kl.exports={ArgumentError:Kn(),JwksError:nr(),JwksRateLimitError:ai(),SigningKeyNotFoundError:ui()}});var at=d(function(Uv,$l){var dS=["RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512","EdDSA"];$l.exports=dS});var Pl=d(function(Bv,wr){var{ArgumentError:pS}=Ue(),{JwksClient:mS}=De(),Ll=at(),gS=(e,t)=>{if(e&&e.name==="SigningKeyNotFoundError")return t(e,null,null);if(e)return t(e,null,null)};wr.exports.hapiJwt2KeyAsync=(e)=>{let t=wr.exports.hapiJwt2Key(e);return function(r){return new Promise((n,i)=>{t(r,(o,c)=>{!c||o?i(o):n({key:c})})})}};wr.exports.hapiJwt2Key=function(e){if(e===null||e===void 0)throw new pS("An options object must be provided when initializing hapiJwt2Key");let t=new mS(e),r=e.handleSigningKeyError||gS;return function(i,s){if(!i||!i.header)return s(Error("Cannot find a signing certificate if there is no header"),null,null);if(!Ll.includes(i.header.alg))return s(Error("Unsupported algorithm "+i.header.alg+" supplied."),null,null);t.getSigningKey(i.header.kid).then((o)=>s(null,o.publicKey||o.rsaPublicKey,o)).catch((o)=>r(o,(c)=>s(c,null,null)))}}});var Fl=d(function(Jv,ql){var{ArgumentError:yS}=Ue(),{JwksClient:ES}=De(),Nl=at(),SS=(e,t)=>{if(e&&e.name==="SigningKeyNotFoundError")return t(null);if(e)return t(e)};ql.exports.expressJwtSecret=function(e){if(e===null||e===void 0)throw new yS("An options object must be provided when initializing expressJwtSecret");let t=new ES(e),r=e.handleSigningKeyError||SS,n=async(i,s)=>{if(!s)return;let o=s.header;if(!o||!Nl.includes(o.alg))return;try{let c=await t.getSigningKey(o.kid);return c.publicKey||c.rsaPublicKey}catch(c){return new Promise((u,a)=>{r(c,(l)=>{if(!l)return u();a(l)})})}};return function(s,o,c,u){if(arguments.length===4){n(s,{header:o}).then((a)=>{setImmediate(u,null,a)}).catch((a)=>{setImmediate(u,a)});return}return n(s,arguments[1])}}});var Dl=d(function(Wv,Kl){var{ArgumentError:wS}=Ue(),{JwksClient:bS}=De(),jl=at();Kl.exports.koaJwtSecret=function(e={}){if(!e.jwksUri)throw new wS("No JWKS provided. Please provide a jwksUri");let t=new bS(e);return function({alg:n,kid:i}={}){return new Promise((s,o)=>{if(!jl.includes(n))return o(Error("Missing / invalid token algorithm"));t.getSigningKey(i).then((c)=>{s(c.publicKey||c.rsaPublicKey)}).catch((c)=>{if(e.handleSigningKeyError)return e.handleSigningKeyError(c).then(o);return o(c)})})}}});var Gl=d(function(Gv,Wl){var Ul=(Fn(),{}),{ArgumentError:Bl}=Ue(),{JwksClient:vS}=De(),Jl=at(),TS=(e,t)=>{if(e&&e.name==="SigningKeyNotFoundError")return t(null);if(e)return t(e)};Wl.exports.passportJwtSecret=function(e){if(e===null||e===void 0)throw new Bl("An options object must be provided when initializing passportJwtSecret");if(!e.jwksUri)throw new Bl("No JWKS provided. Please provide a jwksUri");let t=new vS(e),r=e.handleSigningKeyError||TS;return function(i,s,o){let c;try{c={payload:zc(s),header:Hc(s)}}catch(u){c=null}if(!c||!Jl.includes(c.header.alg))return o(null,null);t.getSigningKey(c.header.kid).then((u)=>{o(null,u.publicKey||u.rsaPublicKey)}).catch((u)=>{r(u,(a)=>o(a,null))})}}});var Ml=d(function(Hv,W){var{JwksClient:Hl}=De(),ue=Ue(),{hapiJwt2Key:AS,hapiJwt2KeyAsync:IS}=Pl(),{expressJwtSecret:CS}=Fl(),{koaJwtSecret:RS}=Dl(),{passportJwtSecret:xS}=Gl();W.exports=(e)=>new Hl(e);W.exports.JwksClient=Hl;W.exports.ArgumentError=ue.ArgumentError;W.exports.JwksError=ue.JwksError;W.exports.JwksRateLimitError=ue.JwksRateLimitError;W.exports.SigningKeyNotFoundError=ue.SigningKeyNotFoundError;W.exports.expressJwtSecret=CS;W.exports.hapiJwt2Key=AS;W.exports.hapiJwt2KeyAsync=IS;W.exports.koaJwtSecret=RS;W.exports.passportJwtSecret=xS});var qS={};uf(qS,{handler:()=>LS,isAuthorized:()=>Ql});module.exports=of(qS);var Ar=require("node:crypto");function Rr(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function jS(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");return Buffer.from(t,"base64").toString()}var Ei=`<!DOCTYPE html>
11
+ -----END ${t}-----`},nE=async(e,t,r)=>{if(kc(r)){if(r.type!==e)throw TypeError(`key is not a ${e} key`);return r.export({format:"pem",type:t})}if(!Oc(r))throw TypeError($c(r,"CryptoKey","KeyObject"));if(!r.extractable)throw TypeError("CryptoKey is not extractable");if(r.type!==e)throw TypeError(`key is not a ${e} key`);return rE(In(new Uint8Array(await crypto.subtle.exportKey(t,r))),`${e.toUpperCase()} KEY`)},Dc=(e)=>nE("public","spki",e);var Uc=q(()=>{On();et()});function Bc(e){return Dc(e)}var Jc=q(()=>{Uc()});async function Wc(e,t,r){if(!tt(e))throw TypeError("JWK must be an object");let n=Pc(e),i=xn(r?.extractable),{alg:s}=n;if(t??=s,n.kty!=="oct"&&!t)throw TypeError('"alg" argument is required when "jwk.alg" is not present');switch(n.kty){case"oct":if(typeof n.k!="string")throw TypeError('missing "k" (Key Value) Parameter value');return Oe(n.k);case"AKP":{if(typeof s!="string"||!s)throw TypeError('missing "alg" (Algorithm) Parameter value');if(t!==s)throw TypeError("JWK alg and alg option value mismatch");return _n(qn(t),n,i)}case"RSA":case"EC":case"OKP":return _n(qn(t),n,i);default:throw new Z('Unsupported "kty" (Key Type) Parameter value')}}var Gc=q(()=>{Yt();On();Kc();_e();Zt()});function Hc(e){let t;if(typeof e=="string"){let n=e.split(".");(n.length===3||n.length===5)&&([t]=n)}else if(typeof e=="object"&&e)if("protected"in e)t=e.protected;else throw TypeError("Token does not contain a Protected Header");let r="Invalid Token or Protected Header formatting";if(typeof t!="string"||!t)throw TypeError(r);return _c(t,TypeError,r)}var Mc=q(()=>{Zt()});function zc(e){if(typeof e!="string")throw new Q("JWTs must use Compact JWS serialization, JWT must be a string");let{1:t,length:r}=e.split(".");if(r===5)throw new Q("Only JWTs using Compact JWS serialization can be decoded");if(r!==3)throw new Q("Invalid JWT");if(!t)throw new Q("JWTs must contain a payload");let n;try{n=Oe(t)}catch(s){throw new Q("Failed to base64url decode the payload",{cause:s})}let i;try{i=JSON.parse(Xt.decode(n))}catch(s){throw new Q("Failed to parse the decoded payload as JSON",{cause:s})}if(!tt(i))throw new Q("Invalid JWT Claims Set");return i}var Vc=q(()=>{Yt();et();Zt();_e()});var Fn=q(()=>{Jc();Gc();Mc();Vc()});var nr=d(function(Ev,Xc){function rr(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="JwksError",this.message=e}rr.prototype=Object.create(Error.prototype);rr.prototype.constructor=rr;Xc.exports=rr});var jn=d(function(wv,Zc){var Yc=(Fn(),{}),iE=nr();function sE(e){if(e.alg)return e.alg;if(e.kty==="RSA")return"RS256";if(e.kty==="EC")switch(e.crv){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512"}if(e.kty==="OKP")switch(e.crv){case"Ed25519":case"Ed448":return"EdDSA"}throw new iE("Unsupported JWK")}async function oE(e){let t=[];e=e.filter(({use:r})=>r==="sig"||r===void 0).filter(({kty:r})=>r==="RSA"||r==="EC"||r==="OKP");for(let r of e)try{let n=await Wc({...r,ext:!0},sE(r));if(n.type!=="public")continue;let i;switch(n[Symbol.toStringTag]){case"CryptoKey":{let s=await Bc(n);i=()=>s;break}case"KeyObject":default:i=()=>n.export({format:"pem",type:"spki"})}t.push({get publicKey(){return i()},get rsaPublicKey(){return i()},getPublicKey(){return i()},...typeof r.kid==="string"&&r.kid?{kid:r.kid}:void 0,...typeof r.alg==="string"&&r.alg?{alg:r.alg}:void 0})}catch(n){continue}return t}Zc.exports={retrieveSigningKeys:oE}});var Kn=d(function(Sv,Qc){function ir(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="ArgumentError",this.message=e}ir.prototype=Object.create(Error.prototype);ir.prototype.constructor=ir;Qc.exports=ir});var tu=d(function(bv,eu){var aE=require("http"),cE=require("https"),uE=Kn();eu.exports.default=(e)=>{if(e.fetcher)return e.fetcher(e.uri);return new Promise((t,r)=>{let n;try{n=new URL(e.uri)}catch(h){throw new uE("Invalid JWKS URI: The provided URI is not a valid URL.")}let{hostname:i,port:s,protocol:o,pathname:c,search:u}=n,a=c+u,l={hostname:i,path:a,port:s,method:"GET",...e.headers&&{headers:{...e.headers}},...e.timeout&&{timeout:e.timeout},...e.agent&&{agent:e.agent}},m=(o==="https:"?cE:aE).request(l,(h)=>{let g="";h.setEncoding("utf8"),h.on("data",(p)=>{g+=p}),h.on("end",()=>{if(h.statusCode<200||h.statusCode>=300){let p=h.body&&(h.body.message||h.body)||h.statusMessage||`Http Error ${h.statusCode}`;r({errorMsg:p})}else try{t(g&&JSON.parse(g))}catch(p){r(p)}})});m.on("timeout",()=>m.destroy()).on("error",(h)=>r(h)).end()})}});var ar=d(function(or){var nu=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),lE=nu((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.tracing=e.metrics=void 0;var t=require("node:diagnostics_channel");e.metrics=(0,t.channel)("lru-cache:metrics"),e.tracing=(0,t.tracingChannel)("lru-cache")}),fE=nu((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.defaultPerf=void 0,e.defaultPerf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date});Object.defineProperty(or,"__esModule",{value:!0});or.LRUCache=void 0;var _=lE(),hE=fE(),Dn=()=>_.metrics.hasSubscribers||_.tracing.hasSubscribers,iu=new Set,ru=typeof process=="object"&&process?process:{},dE=(e,t,r,n)=>{typeof ru.emitWarning=="function"?ru.emitWarning(e,t,r,n):console.error(`[${r}] ${t}: ${e}`)},pE=(e)=>!iu.has(e),ae=(e)=>!!e&&e===Math.floor(e)&&e>0&&isFinite(e),su=(e)=>ae(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?sr:null:null,sr=class extends Array{constructor(e){super(e),this.fill(0)}},mE=class e{heap;length;static#a=!1;static create(t){let r=su(t);if(!r)return[];e.#a=!0;let n=new e(t,r);return e.#a=!1,n}constructor(t,r){if(!e.#a)throw 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]}},gE=class e{#a;#f;#g;#_;#y;#N;#q;#E;get perf(){return this.#E}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#i;#w;#n;#r;#e;#u;#h;#c;#s;#S;#o;#b;#v;#d;#p;#T;#F;#l;#O;static unsafeExposeInternals(t){return{starts:t.#v,ttls:t.#d,autopurgeTimers:t.#p,sizes:t.#b,keyMap:t.#n,keyList:t.#r,valList:t.#e,next:t.#u,prev:t.#h,get head(){return t.#c},get tail(){return t.#s},free:t.#S,isBackgroundFetch:(r)=>t.#t(r),backgroundFetch:(r,n,i,s)=>t.#D(r,n,i,s),moveToTail:(r)=>t.#L(r),indexes:(r)=>t.#A(r),rindexes:(r)=>t.#I(r),isStale:(r)=>t.#m(r)}}get max(){return this.#a}get maxSize(){return this.#f}get calculatedSize(){return this.#w}get size(){return this.#i}get fetchMethod(){return this.#N}get memoMethod(){return this.#q}get dispose(){return this.#g}get onInsert(){return this.#_}get disposeAfter(){return this.#y}constructor(t){let{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:u,dispose:a,onInsert:l,disposeAfter:f,noDisposeOnSet:m,noUpdateTTL:h,maxSize:g=0,maxEntrySize:p=0,sizeCalculation:b,fetchMethod:w,memoMethod:S,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:K,ignoreFetchAbort:G,backgroundFetchSize:z=1,perf:V}=t;if(this.backgroundFetchSize=z,V!==void 0&&typeof V?.now!="function")throw TypeError("perf option must have a now() method if specified");if(this.#E=V??hE.defaultPerf,r!==0&&!ae(r))throw TypeError("max option must be a nonnegative integer");let le=r?su(r):Array;if(!le)throw Error("invalid max value: "+r);if(this.#a=r,this.#f=g,this.maxEntrySize=p||this.#f,this.sizeCalculation=b,this.sizeCalculation){if(!this.#f&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw TypeError("sizeCalculation set to non-function")}if(S!==void 0&&typeof S!="function")throw TypeError("memoMethod must be a function if defined");if(this.#q=S,w!==void 0&&typeof w!="function")throw TypeError("fetchMethod must be a function if specified");if(this.#N=w,this.#F=!!w,this.#n=new Map,this.#r=Array.from({length:r}).fill(void 0),this.#e=Array.from({length:r}).fill(void 0),this.#u=new le(r),this.#h=new le(r),this.#c=0,this.#s=0,this.#S=mE.create(r),this.#i=0,this.#w=0,typeof a=="function"&&(this.#g=a),typeof l=="function"&&(this.#_=l),typeof f=="function"?(this.#y=f,this.#o=[]):(this.#y=void 0,this.#o=void 0),this.#T=!!this.#g,this.#O=!!this.#_,this.#l=!!this.#y,this.noDisposeOnSet=!!m,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!R,this.allowStaleOnFetchAbort=!!K,this.ignoreFetchAbort=!!G,this.maxEntrySize!==0){if(this.#f!==0&&!ae(this.#f))throw TypeError("maxSize must be a positive integer if specified");if(!ae(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#z()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=ae(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!ae(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#U()}if(this.#a===0&&this.ttl===0&&this.#f===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#a&&!this.#f){let ct="LRU_CACHE_UNBOUNDED";pE(ct)&&(iu.add(ct),dE("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ct,e))}}getRemainingTTL(t){return this.#n.has(t)?1/0:0}#U(){let t=new sr(this.#a),r=new sr(this.#a);this.#d=t,this.#v=r;let n=this.ttlAutopurge?Array.from({length:this.#a}):void 0;this.#p=n,this.#B=(u,a,l=this.#E.now())=>{r[u]=a!==0?l:0,t[u]=a,i(u,a)},this.#k=(u)=>{r[u]=t[u]!==0?this.#E.now():0,i(u,t[u])};let i=this.ttlAutopurge?(u,a)=>{if(n?.[u]&&(clearTimeout(n[u]),n[u]=void 0),a&&a!==0&&n){let l=setTimeout(()=>{this.#m(u)?(this.#C(this.#r[u],"expire"),n[u]=void 0):i(u,c(u))},a+1);l.unref&&l.unref(),n[u]=l}}:()=>{};this.#R=(u,a)=>{if(t[a]){let l=t[a],f=r[a];if(!l||!f)return;u.ttl=l,u.start=f,u.now=s||o();let m=u.now-f;u.remainingTTL=l-m}};let s=0,o=()=>{let u=this.#E.now();if(this.ttlResolution>0){s=u;let a=setTimeout(()=>s=0,this.ttlResolution);a.unref&&a.unref()}return u};this.getRemainingTTL=(u)=>{let a=this.#n.get(u);return a===void 0?0:c(a)};let c=(u)=>{let a=t[u],l=r[u];if(!a||!l)return 1/0;let f=(s||o())-l;return a-f};this.#m=(u)=>{let a=r[u],l=t[u];return!!l&&!!a&&(s||o())-a>l}}#k=()=>{};#R=()=>{};#B=()=>{};#m=()=>!1;#z(){let t=new sr(this.#a);this.#w=0,this.#b=t,this.#$=(r)=>{this.#w-=t[r],t[r]=0},this.#J=(r,n,i,s)=>{if(!ae(i)){if(this.#t(n))return this.backgroundFetchSize;if(s){if(typeof s!="function")throw TypeError("sizeCalculation must be a function");if(i=s(n,r),!ae(i))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return i},this.#j=(r,n,i)=>{if(t[r]=n,this.#f){let s=this.#f-t[r];for(;this.#w>s;)this.#K(!0)}this.#w+=t[r],i&&(i.entrySize=n,i.totalCalculatedSize=this.#w)}}#$=(t)=>{};#j=(t,r,n)=>{};#J=(t,r,n,i)=>{if(n||i)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#i)for(let r=this.#s;this.#W(r)&&((t||!this.#m(r))&&(yield r),r!==this.#c);)r=this.#h[r]}*#I({allowStale:t=this.allowStale}={}){if(this.#i)for(let r=this.#c;this.#W(r)&&((t||!this.#m(r))&&(yield r),r!==this.#s);)r=this.#u[r]}#W(t){return t!==void 0&&this.#n.get(this.#r[t])===t}*entries(){for(let t of this.#A())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.#I())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.#A()){let r=this.#r[t];r!==void 0&&!this.#t(this.#e[t])&&(yield r)}}*rkeys(){for(let t of this.#I()){let r=this.#r[t];r!==void 0&&!this.#t(this.#e[t])&&(yield r)}}*values(){for(let t of this.#A())this.#e[t]!==void 0&&!this.#t(this.#e[t])&&(yield this.#e[t])}*rvalues(){for(let t of this.#I())this.#e[t]!==void 0&&!this.#t(this.#e[t])&&(yield this.#e[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,r={}){for(let n of this.#A()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;if(s!==void 0&&t(s,this.#r[n],this))return this.#P(this.#r[n],r)}}forEach(t,r=this){for(let n of this.#A()){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.#I()){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.#I({allowStale:!0}))this.#m(r)&&(this.#C(this.#r[r],"expire"),t=!0);return t}info(t){let r=this.#n.get(t);if(r===void 0)return;let n=this.#e[r],i=this.#t(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#d&&this.#v){let o=this.#d[r],c=this.#v[r];if(o&&c){let u=o-(this.#E.now()-c);s.ttl=u,s.start=Date.now()}}return this.#b&&(s.size=this.#b[r]),s}dump(){let t=[];for(let r of this.#A({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 o={value:s};if(this.#d&&this.#v){o.ttl=this.#d[r];let c=this.#E.now()-this.#v[r];o.start=Math.floor(Date.now()-c)}this.#b&&(o.size=this.#b[r]),t.unshift([n,o])}return t}load(t){this.clear();for(let[r,n]of t){if(n.start){let i=Date.now()-n.start;n.start=this.#E.now()-i}this.#x(r,n.value,n)}}set(t,r,n={}){let{status:i=_.metrics.hasSubscribers?{}:void 0}=n;n.status=i,i&&(i.op="set",i.key=t,r!==void 0&&(i.value=r),i.cache=this);let s=this.#x(t,r,n);return i&&_.metrics.hasSubscribers&&_.metrics.publish(i),s}#x(t,r,n,i){let{ttl:s=this.ttl,start:o,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:a}=n,l=this.#t(r);if(r===void 0)return a&&(a.set="deleted"),this.delete(t),this;let{noUpdateTTL:f=this.noUpdateTTL}=n;a&&!l&&(a.value=r);let m=this.#J(t,r,n.size||0,u,a);if(this.maxEntrySize&&m>this.maxEntrySize)return this.#C(t,"set"),a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this;let h=this.#i===0?void 0:this.#n.get(t);if(h===void 0)h=this.#i===0?this.#s:this.#S.length!==0?this.#S.pop():this.#i===this.#a?this.#K(!1):this.#i,this.#r[h]=t,this.#e[h]=r,this.#n.set(t,h),this.#u[this.#s]=h,this.#h[h]=this.#s,this.#s=h,this.#i++,this.#j(h,m,a),a&&(a.set="add"),f=!1,this.#O&&!l&&this.#_?.(r,t,"add");else{this.#L(h);let g=this.#e[h];if(r!==g){if(!c)if(this.#t(g)){g!==i&&g.__abortController.abort(Error("replaced"));let{__staleWhileFetching:p}=g;p!==void 0&&p!==r&&(this.#T&&this.#g?.(p,t,"set"),this.#l&&this.#o?.push([p,t,"set"]))}else this.#T&&this.#g?.(g,t,"set"),this.#l&&this.#o?.push([g,t,"set"]);if(this.#$(h),this.#j(h,m,a),this.#e[h]=r,!l){let p=g&&this.#t(g)?g.__staleWhileFetching:g,b=p===void 0?"add":r!==p?"replace":"update";a&&(a.set=b,p!==void 0&&(a.oldValue=p)),this.#O&&this.onInsert?.(r,t,b)}}else l||(a&&(a.set="update"),this.#O&&this.onInsert?.(r,t,"update"))}if(s!==0&&!this.#d&&this.#U(),this.#d&&(f||this.#B(h,s,o),a&&this.#R(a,h)),!c&&this.#l&&this.#o){let g=this.#o,p;for(;p=g?.shift();)this.#y?.(...p)}return this}pop(){try{for(;this.#i;){let t=this.#e[this.#c];if(this.#K(!0),this.#t(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#l&&this.#o){let t=this.#o,r;for(;r=t?.shift();)this.#y?.(...r)}}}#K(t){let r=this.#c,n=this.#r[r],i=this.#e[r],s=this.#t(i);s&&i.__abortController.abort(Error("evicted"));let o=s?i.__staleWhileFetching:i;return(this.#T||this.#l)&&o!==void 0&&(this.#T&&this.#g?.(o,n,"evict"),this.#l&&this.#o?.push([o,n,"evict"])),this.#$(r),this.#p?.[r]&&(clearTimeout(this.#p[r]),this.#p[r]=void 0),t&&(this.#r[r]=void 0,this.#e[r]=void 0,this.#S.push(r)),this.#i===1?(this.#c=this.#s=0,this.#S.length=0):this.#c=this.#u[r],this.#n.delete(n),this.#i--,r}has(t,r={}){let{status:n=_.metrics.hasSubscribers?{}:void 0}=r;r.status=n,n&&(n.op="has",n.key=t,n.cache=this);let i=this.#V(t,r);return _.metrics.hasSubscribers&&_.metrics.publish(n),i}#V(t,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=r,s=this.#n.get(t);if(s!==void 0){let o=this.#e[s];if(this.#t(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#m(s))i&&(i.has="stale",this.#R(i,s));else return n&&this.#k(s),i&&(i.has="hit",this.#R(i,s)),!0}else i&&(i.has="miss");return!1}peek(t,r={}){let{status:n=Dn()?{}:void 0}=r;n&&(n.op="peek",n.key=t,n.cache=this),r.status=n;let i=this.#X(t,r);return _.metrics.hasSubscribers&&_.metrics.publish(n),i}#X(t,r){let{status:n,allowStale:i=this.allowStale}=r,s=this.#n.get(t);if(s===void 0||!i&&this.#m(s)){n&&(n.peek=s===void 0?"miss":"stale");return}let o=this.#e[s],c=this.#t(o)?o.__staleWhileFetching:o;return n&&(c!==void 0?(n.peek="hit",n.value=c):n.peek="miss"),c}#D(t,r,n,i){let s=r===void 0?void 0:this.#e[r];if(this.#t(s))return s;let o=new AbortController,{signal:c}=n;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let u={signal:o.signal,options:n,context:i},a=(p,b=!1)=>{let{aborted:w}=o.signal,S=n.ignoreFetchAbort&&p!==void 0,A=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&p!==void 0);if(n.status&&(w&&!b?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,S&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),w&&!S&&!b)return f(o.signal.reason,A);let T=h,R=this.#e[r];return(R===h||R===void 0&&S&&b)&&(p===void 0?T.__staleWhileFetching!==void 0?this.#e[r]=T.__staleWhileFetching:this.#C(t,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.#x(t,p,u.options,T))),p},l=(p)=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=p),f(p,!1)),f=(p,b)=>{let{aborted:w}=o.signal,S=w&&n.allowStaleOnFetchAbort,A=S||n.allowStaleOnFetchRejection,T=A||n.noDeleteOnFetchRejection,R=h;if(this.#e[r]===h&&(!T||!b&&R.__staleWhileFetching===void 0?this.#C(t,"fetch"):S||(this.#e[r]=R.__staleWhileFetching)),A)return n.status&&R.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),R.__staleWhileFetching;if(R.__returned===R)throw p},m=(p,b)=>{let w=this.#N?.(t,s,u);o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(p(void 0),n.allowStaleOnFetchAbort&&(p=(S)=>a(S,!0)))}),w&&w instanceof Promise?w.then((S)=>p(S===void 0?void 0:S),b):w!==void 0&&p(w)};n.status&&(n.status.fetchDispatched=!0);let h=new Promise(m).then(a,l),g=Object.assign(h,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.#x(t,g,{...u.options,status:void 0}),r=this.#n.get(t)):this.#e[r]=g,g}#t(t){if(!this.#F)return!1;let r=t;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof AbortController}fetch(t,r={}){let n=_.tracing.hasSubscribers,{status:i=Dn()?{}:void 0}=r;r.status=i,i&&r.context&&(i.context=r.context);let s=this.#G(t,r);return i&&n&&(i.trace=!0,_.tracing.tracePromise(()=>s,i).catch(()=>{})),s}async#G(t,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:u=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:p,forceRefresh:b=!1,status:w,signal:S}=r;if(w&&(w.op="fetch",w.key=t,b&&(w.forceRefresh=!0),w.cache=this),!this.#F)return w&&(w.fetch="get"),this.#P(t,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:w});let A={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:c,size:u,sizeCalculation:a,noUpdateTTL:l,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:g,ignoreFetchAbort:h,status:w,signal:S},T=this.#n.get(t);if(T===void 0){w&&(w.fetch="miss");let R=this.#D(t,T,A,p);return R.__returned=R}else{let R=this.#e[T];if(this.#t(R)){let V=n&&R.__staleWhileFetching!==void 0;return w&&(w.fetch="inflight",V&&(w.returnedStale=!0)),V?R.__staleWhileFetching:R.__returned=R}let K=this.#m(T);if(!b&&!K)return w&&(w.fetch="hit"),this.#L(T),i&&this.#k(T),w&&this.#R(w,T),R;let G=this.#D(t,T,A,p),z=G.__staleWhileFetching!==void 0&&n;return w&&(w.fetch=K?"stale":"refresh",z&&K&&(w.returnedStale=!0)),z?G.__staleWhileFetching:G.__returned=G}}forceFetch(t,r={}){let n=_.tracing.hasSubscribers,{status:i=Dn()?{}:void 0}=r;r.status=i,i&&r.context&&(i.context=r.context);let s=this.#Y(t,r);return i&&n&&(i.trace=!0,_.tracing.tracePromise(()=>s,i).catch(()=>{})),s}async#Y(t,r={}){let n=await this.#G(t,r);if(n===void 0)throw Error("fetch() returned undefined");return n}memo(t,r={}){let{status:n=_.metrics.hasSubscribers?{}:void 0}=r;r.status=n,n&&(n.op="memo",n.key=t,r.context&&(n.context=r.context),n.cache=this);let i=this.#Z(t,r);return n&&(n.value=i),_.metrics.hasSubscribers&&_.metrics.publish(n),i}#Z(t,r={}){let n=this.#q;if(!n)throw Error("no memoMethod provided to constructor");let{context:i,status:s,forceRefresh:o,...c}=r;s&&o&&(s.forceRefresh=!0);let u=this.#P(t,c),a=o||u===void 0;if(s&&(s.memo=a?"miss":"hit",a||(s.value=u)),!a)return u;let l=n(t,u,{options:c,context:i});return s&&(s.value=l),this.#x(t,l,c),l}get(t,r={}){let{status:n=_.metrics.hasSubscribers?{}:void 0}=r;r.status=n,n&&(n.op="get",n.key=t,n.cache=this);let i=this.#P(t,r);return n&&(i!==void 0&&(n.value=i),_.metrics.hasSubscribers&&_.metrics.publish(n)),i}#P(t,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=r,c=this.#n.get(t);if(c===void 0){o&&(o.get="miss");return}let u=this.#e[c],a=this.#t(u);return o&&this.#R(o,c),this.#m(c)?a?(o&&(o.get="stale-fetching"),n&&u.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),u.__staleWhileFetching):void 0):(s||this.#C(t,"expire"),o&&(o.get="stale"),n?(o&&(o.returnedStale=!0),u):void 0):(o&&(o.get=a?"fetching":"hit"),this.#L(c),i&&this.#k(c),a?u.__staleWhileFetching:u)}#H(t,r){this.#h[r]=t,this.#u[t]=r}#L(t){t!==this.#s&&(t===this.#c?this.#c=this.#u[t]:this.#H(this.#h[t],this.#u[t]),this.#H(this.#s,t),this.#s=t)}delete(t){return this.#C(t,"delete")}#C(t,r){_.metrics.hasSubscribers&&_.metrics.publish({op:"delete",delete:r,key:t,cache:this});let n=!1;if(this.#i!==0){let i=this.#n.get(t);if(i!==void 0)if(this.#p?.[i]&&(clearTimeout(this.#p[i]),this.#p[i]=void 0),n=!0,this.#i===1)this.#M(r);else{this.#$(i);let s=this.#e[i];if(this.#t(s)?s.__abortController.abort(Error("deleted")):(this.#T||this.#l)&&(this.#T&&this.#g?.(s,t,r),this.#l&&this.#o?.push([s,t,r])),this.#n.delete(t),this.#r[i]=void 0,this.#e[i]=void 0,i===this.#s)this.#s=this.#h[i];else if(i===this.#c)this.#c=this.#u[i];else{let o=this.#h[i];this.#u[o]=this.#u[i];let c=this.#u[i];this.#h[c]=this.#h[i]}this.#i--,this.#S.push(i)}}if(this.#l&&this.#o?.length){let i=this.#o,s;for(;s=i?.shift();)this.#y?.(...s)}return n}clear(){return this.#M("delete")}#M(t){for(let r of this.#I({allowStale:!0})){let n=this.#e[r];if(this.#t(n))n.__abortController.abort(Error("deleted"));else{let i=this.#r[r];this.#T&&this.#g?.(n,i,t),this.#l&&this.#o?.push([n,i,t])}}if(this.#n.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#d&&this.#v){this.#d.fill(0),this.#v.fill(0);for(let r of this.#p??[])r!==void 0&&clearTimeout(r);this.#p?.fill(void 0)}if(this.#b&&this.#b.fill(0),this.#c=0,this.#s=0,this.#S.length=0,this.#w=0,this.#i=0,this.#l&&this.#o){let r=this.#o,n;for(;n=r?.shift();)this.#y?.(...n)}}};or.LRUCache=gE});var ti=d(function(it,Le){var yE=200,yu="__lodash_hash_undefined__",Eu=9007199254740991,zn="[object Arguments]",EE="[object Array]",wu="[object Boolean]",Su="[object Date]",wE="[object Error]",Vn="[object Function]",bu="[object GeneratorFunction]",cr="[object Map]",vu="[object Number]",Xn="[object Object]",ou="[object Promise]",Tu="[object RegExp]",ur="[object Set]",Au="[object String]",Iu="[object Symbol]",Bn="[object WeakMap]",Cu="[object ArrayBuffer]",lr="[object DataView]",Ru="[object Float32Array]",xu="[object Float64Array]",_u="[object Int8Array]",Ou="[object Int16Array]",ku="[object Int32Array]",$u="[object Uint8Array]",Pu="[object Uint8ClampedArray]",Lu="[object Uint16Array]",Nu="[object Uint32Array]",SE=/[\\^$.*+?()[\]{}|]/g,bE=/\w*$/,vE=/^\[object .+?Constructor\]$/,TE=/^(?:0|[1-9]\d*)$/,C={};C[zn]=C[EE]=C[Cu]=C[lr]=C[wu]=C[Su]=C[Ru]=C[xu]=C[_u]=C[Ou]=C[ku]=C[cr]=C[vu]=C[Xn]=C[Tu]=C[ur]=C[Au]=C[Iu]=C[$u]=C[Pu]=C[Lu]=C[Nu]=!0;C[wE]=C[Vn]=C[Bn]=!1;var AE=typeof global=="object"&&global&&global.Object===Object&&global,IE=typeof self=="object"&&self&&self.Object===Object&&self,ee=AE||IE||Function("return this")(),qu=typeof it=="object"&&it&&!it.nodeType&&it,au=qu&&typeof Le=="object"&&Le&&!Le.nodeType&&Le,CE=au&&au.exports===qu;function RE(e,t){return e.set(t[0],t[1]),e}function xE(e,t){return e.add(t),e}function _E(e,t){var r=-1,n=e?e.length:0;while(++r<n)if(t(e[r],r,e)===!1)break;return e}function OE(e,t){var r=-1,n=t.length,i=e.length;while(++r<n)e[i+r]=t[r];return e}function Fu(e,t,r,n){var i=-1,s=e?e.length:0;if(n&&s)r=e[++i];while(++i<s)r=t(r,e[i],i,e);return r}function kE(e,t){var r=-1,n=Array(e);while(++r<e)n[r]=t(r);return n}function $E(e,t){return e==null?void 0:e[t]}function ju(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function cu(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function Yn(e,t){return function(r){return e(t(r))}}function uu(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var PE=Array.prototype,LE=Function.prototype,fr=Object.prototype,Un=ee["__core-js_shared__"],lu=function(){var e=/[^.]+$/.exec(Un&&Un.keys&&Un.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ku=LE.toString,{hasOwnProperty:ce,toString:hr}=fr,NE=RegExp("^"+Ku.call(ce).replace(SE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fu=CE?ee.Buffer:void 0,{Symbol:hu,Uint8Array:du}=ee,qE=Yn(Object.getPrototypeOf,Object),FE=Object.create,jE=fr.propertyIsEnumerable,KE=PE.splice,pu=Object.getOwnPropertySymbols,DE=fu?fu.isBuffer:void 0,UE=Yn(Object.keys,Object),Jn=Fe(ee,"DataView"),st=Fe(ee,"Map"),Wn=Fe(ee,"Promise"),Gn=Fe(ee,"Set"),Hn=Fe(ee,"WeakMap"),ot=Fe(Object,"create"),BE=me(Jn),JE=me(st),WE=me(Wn),GE=me(Gn),HE=me(Hn),mu=hu?hu.prototype:void 0,gu=mu?mu.valueOf:void 0;function pe(e){var t=-1,r=e?e.length:0;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}function ME(){this.__data__=ot?ot(null):{}}function zE(e){return this.has(e)&&delete this.__data__[e]}function VE(e){var t=this.__data__;if(ot){var r=t[e];return r===yu?void 0:r}return ce.call(t,e)?t[e]:void 0}function XE(e){var t=this.__data__;return ot?t[e]!==void 0:ce.call(t,e)}function YE(e,t){var r=this.__data__;return r[e]=ot&&t===void 0?yu:t,this}pe.prototype.clear=ME;pe.prototype.delete=zE;pe.prototype.get=VE;pe.prototype.has=XE;pe.prototype.set=YE;function te(e){var t=-1,r=e?e.length:0;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}function ZE(){this.__data__=[]}function QE(e){var t=this.__data__,r=dr(t,e);if(r<0)return!1;var n=t.length-1;if(r==n)t.pop();else KE.call(t,r,1);return!0}function e0(e){var t=this.__data__,r=dr(t,e);return r<0?void 0:t[r][1]}function t0(e){return dr(this.__data__,e)>-1}function r0(e,t){var r=this.__data__,n=dr(r,e);if(n<0)r.push([e,t]);else r[n][1]=t;return this}te.prototype.clear=ZE;te.prototype.delete=QE;te.prototype.get=e0;te.prototype.has=t0;te.prototype.set=r0;function Ne(e){var t=-1,r=e?e.length:0;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}function n0(){this.__data__={hash:new pe,map:new(st||te),string:new pe}}function i0(e){return pr(this,e).delete(e)}function s0(e){return pr(this,e).get(e)}function o0(e){return pr(this,e).has(e)}function a0(e,t){return pr(this,e).set(e,t),this}Ne.prototype.clear=n0;Ne.prototype.delete=i0;Ne.prototype.get=s0;Ne.prototype.has=o0;Ne.prototype.set=a0;function qe(e){this.__data__=new te(e)}function c0(){this.__data__=new te}function u0(e){return this.__data__.delete(e)}function l0(e){return this.__data__.get(e)}function f0(e){return this.__data__.has(e)}function h0(e,t){var r=this.__data__;if(r instanceof te){var n=r.__data__;if(!st||n.length<yE-1)return n.push([e,t]),this;r=this.__data__=new Ne(n)}return r.set(e,t),this}qe.prototype.clear=c0;qe.prototype.delete=u0;qe.prototype.get=l0;qe.prototype.has=f0;qe.prototype.set=h0;function d0(e,t){var r=Qn(e)||F0(e)?kE(e.length,String):[],n=r.length,i=!!n;for(var s in e)if((t||ce.call(e,s))&&!(i&&(s=="length"||P0(s,n))))r.push(s);return r}function Du(e,t,r){var n=e[t];if(!(ce.call(e,t)&&Wu(n,r))||r===void 0&&!(t in e))e[t]=r}function dr(e,t){var r=e.length;while(r--)if(Wu(e[r][0],t))return r;return-1}function p0(e,t){return e&&Uu(t,ei(t),e)}function Mn(e,t,r,n,i,s,o){var c;if(n)c=s?n(e,i,s,o):n(e);if(c!==void 0)return c;if(!mr(e))return e;var u=Qn(e);if(u){if(c=O0(e),!t)return R0(e,c)}else{var a=de(e),l=a==Vn||a==bu;if(K0(e))return S0(e,t);if(a==Xn||a==zn||l&&!s){if(ju(e))return s?e:{};if(c=k0(l?{}:e),!t)return x0(e,p0(c,e))}else{if(!C[a])return s?e:{};c=$0(e,a,Mn,t)}}o||(o=new qe);var f=o.get(e);if(f)return f;if(o.set(e,c),!u)var m=r?_0(e):ei(e);return _E(m||e,function(h,g){if(m)g=h,h=e[g];Du(c,g,Mn(h,t,r,n,g,e,o))}),c}function m0(e){return mr(e)?FE(e):{}}function g0(e,t,r){var n=t(e);return Qn(e)?n:OE(n,r(e))}function y0(e){return hr.call(e)}function E0(e){if(!mr(e)||N0(e))return!1;var t=Hu(e)||ju(e)?NE:vE;return t.test(me(e))}function w0(e){if(!Ju(e))return UE(e);var t=[];for(var r in Object(e))if(ce.call(e,r)&&r!="constructor")t.push(r);return t}function S0(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}function Zn(e){var t=new e.constructor(e.byteLength);return new du(t).set(new du(e)),t}function b0(e,t){var r=t?Zn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function v0(e,t,r){var n=t?r(cu(e),!0):cu(e);return Fu(n,RE,new e.constructor)}function T0(e){var t=new e.constructor(e.source,bE.exec(e));return t.lastIndex=e.lastIndex,t}function A0(e,t,r){var n=t?r(uu(e),!0):uu(e);return Fu(n,xE,new e.constructor)}function I0(e){return gu?Object(gu.call(e)):{}}function C0(e,t){var r=t?Zn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function R0(e,t){var r=-1,n=e.length;t||(t=Array(n));while(++r<n)t[r]=e[r];return t}function Uu(e,t,r,n){r||(r={});var i=-1,s=t.length;while(++i<s){var o=t[i],c=n?n(r[o],e[o],o,r,e):void 0;Du(r,o,c===void 0?e[o]:c)}return r}function x0(e,t){return Uu(e,Bu(e),t)}function _0(e){return g0(e,ei,Bu)}function pr(e,t){var r=e.__data__;return L0(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Fe(e,t){var r=$E(e,t);return E0(r)?r:void 0}var Bu=pu?Yn(pu,Object):B0,de=y0;if(Jn&&de(new Jn(new ArrayBuffer(1)))!=lr||st&&de(new st)!=cr||Wn&&de(Wn.resolve())!=ou||Gn&&de(new Gn)!=ur||Hn&&de(new Hn)!=Bn)de=function(e){var t=hr.call(e),r=t==Xn?e.constructor:void 0,n=r?me(r):void 0;if(n)switch(n){case BE:return lr;case JE:return cr;case WE:return ou;case GE:return ur;case HE:return Bn}return t};function O0(e){var t=e.length,r=e.constructor(t);if(t&&typeof e[0]=="string"&&ce.call(e,"index"))r.index=e.index,r.input=e.input;return r}function k0(e){return typeof e.constructor=="function"&&!Ju(e)?m0(qE(e)):{}}function $0(e,t,r,n){var i=e.constructor;switch(t){case Cu:return Zn(e);case wu:case Su:return new i(+e);case lr:return b0(e,n);case Ru:case xu:case _u:case Ou:case ku:case $u:case Pu:case Lu:case Nu:return C0(e,n);case cr:return v0(e,n,r);case vu:case Au:return new i(e);case Tu:return T0(e);case ur:return A0(e,n,r);case Iu:return I0(e)}}function P0(e,t){return t=t==null?Eu:t,!!t&&(typeof e=="number"||TE.test(e))&&(e>-1&&e%1==0&&e<t)}function L0(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function N0(e){return!!lu&&lu in e}function Ju(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||fr;return e===r}function me(e){if(e!=null){try{return Ku.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function q0(e){return Mn(e,!0,!0)}function Wu(e,t){return e===t||e!==e&&t!==t}function F0(e){return j0(e)&&ce.call(e,"callee")&&(!jE.call(e,"callee")||hr.call(e)==zn)}var Qn=Array.isArray;function Gu(e){return e!=null&&D0(e.length)&&!Hu(e)}function j0(e){return U0(e)&&Gu(e)}var K0=DE||J0;function Hu(e){var t=mr(e)?hr.call(e):"";return t==Vn||t==bu}function D0(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Eu}function mr(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function U0(e){return!!e&&typeof e=="object"}function ei(e){return Gu(e)?d0(e):w0(e)}function B0(){return[]}function J0(){return!1}Le.exports=q0});var ri=d(function(gr){Object.defineProperty(gr,"__esModule",{value:!0});gr.deepFreeze=void 0;function Mu(e){if(e)Object.freeze(e),Object.getOwnPropertyNames(e).forEach(function(t){if(e.hasOwnProperty(t)&&e[t]!==null&&(typeof e[t]==="object"||typeof e[t]==="function")&&e[t].constructor!==Buffer&&!Object.isFrozen(e[t]))Mu(e[t])});return e}gr.deepFreeze=Mu});var Yu=d(function(je){var W0=je&&je.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(je,"__esModule",{value:!0});je.syncMemoizer=void 0;var Vu=ar(),Xu=require("events"),zu=W0(ti()),yr=ri();function G0(e){let t=new Vu.LRUCache(e),{load:r,hash:n,bypass:i,itemTTL:s,freeze:o,clone:c}=e,u=new Xu.EventEmitter,a=Object.assign({del:l,reset:()=>t.clear(),keys:()=>[...t.keys()],on:u.on.bind(u),once:u.once.bind(u)},e);if(e.disable)return Object.assign(r,a);function l(){let p=n(...arguments);t.delete(p)}function f(p,...b){u.emit(p,...b)}function m(p){return p&&p.then&&typeof p.then==="function"}function h(p){let b=p;if(c)if(m(b))b=b.then(zu.default);else b=(0,zu.default)(b);if(o)if(m(b))b=b.then(yr.deepFreeze);else yr.deepFreeze(b);return b}return Object.assign(function(...p){if(i&&i(...p))return f("miss",...p),r(...p);var b=n(...p),w=t.get(b);if(w)return f("hit",...p),h(w);f("miss",...p);let S=r(...p);if(s)t.set(b,S,{ttl:s(...p.concat([S]))});else t.set(b,S);return h(S)},a)}je.syncMemoizer=G0});var nl=d(function(Ke){var H0=Ke&&Ke.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.asyncMemoizer=void 0;var Zu=ar(),Qu=require("events"),M0=H0(ti()),el=ri(),tl=Yu();function rl(e){let t=new Zu.LRUCache(e),{load:r,hash:n,bypass:i,itemTTL:s,freeze:o,clone:c}=e,u=e.queueTTL||1000,a=new Map,l=new Qu.EventEmitter,f=Object.assign({del:m,reset:()=>t.clear(),keys:()=>[...t.keys()],on:l.on.bind(l),once:l.once.bind(l)},e);if(e.disable)return Object.assign(r,f);function m(...w){let S=n(...w);t.delete(S)}function h(w,S,A){if(o)A.forEach(el.deepFreeze);if(s)t.set(w,A,{ttl:s(...S.concat(A))});else t.set(w,A)}function g(w,S){for(let A of w)if(c)setImmediate(A,...S.map(M0.default));else setImmediate(A,...S)}function p(w,...S){l.emit(w,...S)}function b(...w){let S=w.slice(0,-1),A=w.slice(-1).pop(),T;if(i&&i(...S))return p("miss",...S),r(...w);if(S.length===0&&!n)T="_";else T=n(...S);let R=t.get(T);if(R)return p("hit",...S),g([A],[null].concat(R));let K=a.get(T);if(K&&K.expiresAt>Date.now()){K.queue.push(A),p("queue",...S);return}p("miss",...S);let G=Date.now(),z=[A];a.set(T,{queue:z,expiresAt:G+u});let V=(...le)=>{if(!le[0])h(T,S,le.slice(1));a.delete(T),p("loaded",Date.now()-G,...S),g(z,le)};r(...S,V)}return Object.assign(b,f)}Ke.asyncMemoizer=rl;rl.sync=tl.syncMemoizer});var ol=d(function(Rv,sl){var il=nl();sl.exports=il.asyncMemoizer});var ul=d(function(xv,cl){var ni=Vt()("jwks"),z0=ol(),{LRUCache:V0}=ar(),{promisify:X0,callbackify:al}=require("util");function Y0(e,{cacheMaxEntries:t=5,cacheMaxAge:r=600000,cacheMaxAgeFallback:n,onStaleCacheFallback:i}){ni(`Configured caching of signing keys. Max: ${t} / Age: ${r}${n?` / Fallback: ${n}`:""}`);let s;if(n){let o=new V0({max:t}),c=e.getSigningKey.bind(e);s=al(async(u)=>{try{let a=await c(u);return o.set(u,{key:a,fetchedAt:Date.now()}),a}catch(a){if(a.isEndpointUnavailable){let l=o.get(u);if(l&&Date.now()-l.fetchedAt<r+n){if(ni(`JWKS endpoint unavailable, serving stale signing key for '${u}': ${a.message}`),i)i(a,u,l.key);return l.key}ni(`JWKS endpoint unavailable and no valid stale entry for '${u}', fallback window expired or key never fetched`)}throw a}})}else s=al(e.getSigningKey.bind(e));return X0(z0({hash:(o)=>o,load:s,ttl:r,max:t}))}cl.exports.default=Y0});var ii=d(function(_v,fl){var ll=function(e,t,r,n){if(this.bucketSize=e,this.tokensPerInterval=t,typeof r==="string")switch(r){case"sec":case"second":this.interval=1000;break;case"min":case"minute":this.interval=60000;break;case"hr":case"hour":this.interval=3600000;break;case"day":this.interval=86400000;break;default:throw Error("Invaid interval "+r)}else this.interval=r;this.parentBucket=n,this.content=0,this.lastDrip=+new Date};ll.prototype={bucketSize:1,tokensPerInterval:1,interval:1000,parentBucket:null,content:0,lastDrip:0,removeTokens:function(e,t){var r=this;if(!this.bucketSize)return process.nextTick(t.bind(null,null,e,Number.POSITIVE_INFINITY)),!0;if(e>this.bucketSize)return process.nextTick(t.bind(null,"Requested tokens "+e+" exceeds bucket size "+this.bucketSize,null)),!1;if(this.drip(),e>this.content)return n();if(this.parentBucket)return this.parentBucket.removeTokens(e,function(i,s){if(i)return t(i,null);if(e>r.content)return n();r.content-=e,t(null,Math.min(s,r.content))});else return this.content-=e,process.nextTick(t.bind(null,null,this.content)),!0;function n(){var i=Math.ceil((e-r.content)*(r.interval/r.tokensPerInterval));return setTimeout(function(){r.removeTokens(e,t)},i),!1}},tryRemoveTokens:function(e){if(!this.bucketSize)return!0;if(e>this.bucketSize)return!1;if(this.drip(),e>this.content)return!1;if(this.parentBucket&&!this.parentBucket.tryRemoveTokens(e))return!1;return this.content-=e,!0},drip:function(){if(!this.tokensPerInterval){this.content=this.bucketSize;return}var e=+new Date,t=Math.max(e-this.lastDrip,0);this.lastDrip=e;var r=t*(this.tokensPerInterval/this.interval);this.content=Math.min(this.content+r,this.bucketSize)}};fl.exports=ll});var dl=d(function(Ov,hl){var Z0=function(){if(typeof process<"u"&&process.hrtime){var e=process.hrtime(),t=e[0],r=e[1];return t*1000+Math.floor(r/1e6)}return new Date().getTime()};hl.exports=Z0});var gl=d(function(kv,ml){var Q0=ii(),si=dl(),pl=function(e,t,r){this.tokenBucket=new Q0(e,e,t,null),this.tokenBucket.content=e,this.curIntervalStart=si(),this.tokensThisInterval=0,this.fireImmediately=r};pl.prototype={tokenBucket:null,curIntervalStart:0,tokensThisInterval:0,fireImmediately:!1,removeTokens:function(e,t){if(e>this.tokenBucket.bucketSize)return process.nextTick(t.bind(null,"Requested tokens "+e+" exceeds maximum tokens per interval "+this.tokenBucket.bucketSize,null)),!1;var r=this,n=si();if(n<this.curIntervalStart||n-this.curIntervalStart>=this.tokenBucket.interval)this.curIntervalStart=n,this.tokensThisInterval=0;if(e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval){if(this.fireImmediately)process.nextTick(t.bind(null,null,-1));else{var i=Math.ceil(this.curIntervalStart+this.tokenBucket.interval-n);setTimeout(function(){r.tokenBucket.removeTokens(e,s)},i)}return!1}return this.tokenBucket.removeTokens(e,s);function s(o,c){if(o)return t(o,null);r.tokensThisInterval+=e,t(null,c)}},tryRemoveTokens:function(e){if(e>this.tokenBucket.bucketSize)return!1;var t=si();if(t<this.curIntervalStart||t-this.curIntervalStart>=this.tokenBucket.interval)this.curIntervalStart=t,this.tokensThisInterval=0;if(e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval)return!1;var r=this.tokenBucket.tryRemoveTokens(e);if(r)this.tokensThisInterval+=e;return r},getTokensRemaining:function(){return this.tokenBucket.drip(),this.tokenBucket.content}};ml.exports=pl});var yl=d(function(oi){oi.RateLimiter=gl();oi.TokenBucket=ii()});var ai=d(function(Pv,El){function Er(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="JwksRateLimitError",this.message=e}Er.prototype=Object.create(Error.prototype);Er.prototype.constructor=Er;El.exports=Er});var Sl=d(function(Lv,wl){var ci=Vt()("jwks"),{RateLimiter:ew}=yl(),tw=ai();function rw(e,{jwksRequestsPerMinute:t=10}){let r=e.getSigningKey.bind(e),n=new ew(t,"minute",!0);return ci(`Configured rate limiting to JWKS endpoint at ${t}/minute`),async(i)=>await new Promise((s,o)=>{n.removeTokens(1,async(c,u)=>{if(c)o(c);if(ci("Requests to the JWKS endpoint available for the next minute:",u),u<0)ci("Too many requests to the JWKS endpoint"),o(new tw("Too many requests to the JWKS endpoint"));else try{let a=await r(i);s(a)}catch(a){o(a)}})})}wl.exports.default=rw});var vl=d(function(Nv,bl){var nw=jn().retrieveSigningKeys;function iw(e,{getKeysInterceptor:t}){let r=e.getSigningKey.bind(e);return async(n)=>{let i=await t(),s;if(i&&i.length)s=await nw(i);if(s&&s.length){let o=s.find((c)=>!n||c.kid===n);if(o)return o}return r(n)}}bl.exports.default=iw});var Al=d(function(qv,Tl){var{callbackify:sw}=require("util"),ow=(e)=>{let t=e.getSigningKey.bind(e);return(r,n)=>{if(n)return sw(t)(r,n);return t(r)}};Tl.exports.default=ow});var Cl=d(function(Fv,Il){Il.exports={request:tu().default,cacheSigningKey:ul().default,rateLimitSigningKey:Sl().default,getKeysInterceptor:vl().default,callbackSupport:Al().default}});var ui=d(function(jv,Rl){function wr(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="SigningKeyNotFoundError",this.message=e}wr.prototype=Object.create(Error.prototype);wr.prototype.constructor=wr;Rl.exports=wr});var De=d(function(Kv,Ol){var ge=Vt()("jwks"),{retrieveSigningKeys:aw}=jn(),{request:cw,cacheSigningKey:uw,rateLimitSigningKey:lw,getKeysInterceptor:fw,callbackSupport:hw}=Cl(),li=nr(),xl=ui();class _l{constructor(e){if(this.options={rateLimit:!1,cache:!0,timeout:30000,...e},this.options.getKeysInterceptor)this.getSigningKey=fw(this,e);if(this.options.rateLimit)this.getSigningKey=lw(this,e);if(this.options.cache)this.getSigningKey=uw(this,e);this.getSigningKey=hw(this,e)}async getKeys(){ge(`Fetching keys from '${this.options.jwksUri}'`);try{let e=await cw({uri:this.options.jwksUri,headers:this.options.requestHeaders,agent:this.options.requestAgent,timeout:this.options.timeout,fetcher:this.options.fetcher});return ge("Keys:",e.keys),e.keys}catch(e){let{errorMsg:t}=e;ge("Failure:",t||e);let r=t?new li(t):e;throw r.isEndpointUnavailable=!0,r}}async getSigningKeys(){let e=await this.getKeys();if(!e||!e.length)throw new li("The JWKS endpoint did not contain any keys");let t=await aw(e);if(!t.length)throw new li("The JWKS endpoint did not contain any signing keys");return ge("Signing Keys:",t),t}async getSigningKey(e){ge(`Fetching signing key for '${e}'`);let t=await this.getSigningKeys(),r=e!==void 0&&e!==null;if(!r&&t.length>1)throw ge("No KID specified and JWKS endpoint returned more than 1 key"),new xl("No KID specified and JWKS endpoint returned more than 1 key");let n=t.find((i)=>!r||i.kid===e);if(n)return n;else throw ge(`Unable to find a signing key that matches '${e}'`),new xl(`Unable to find a signing key that matches '${e}'`)}}Ol.exports={JwksClient:_l}});var Ue=d(function(Dv,kl){kl.exports={ArgumentError:Kn(),JwksError:nr(),JwksRateLimitError:ai(),SigningKeyNotFoundError:ui()}});var at=d(function(Uv,$l){var dw=["RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512","EdDSA"];$l.exports=dw});var Ll=d(function(Bv,Sr){var{ArgumentError:pw}=Ue(),{JwksClient:mw}=De(),Pl=at(),gw=(e,t)=>{if(e&&e.name==="SigningKeyNotFoundError")return t(e,null,null);if(e)return t(e,null,null)};Sr.exports.hapiJwt2KeyAsync=(e)=>{let t=Sr.exports.hapiJwt2Key(e);return function(r){return new Promise((n,i)=>{t(r,(o,c)=>{!c||o?i(o):n({key:c})})})}};Sr.exports.hapiJwt2Key=function(e){if(e===null||e===void 0)throw new pw("An options object must be provided when initializing hapiJwt2Key");let t=new mw(e),r=e.handleSigningKeyError||gw;return function(i,s){if(!i||!i.header)return s(Error("Cannot find a signing certificate if there is no header"),null,null);if(!Pl.includes(i.header.alg))return s(Error("Unsupported algorithm "+i.header.alg+" supplied."),null,null);t.getSigningKey(i.header.kid).then((o)=>s(null,o.publicKey||o.rsaPublicKey,o)).catch((o)=>r(o,(c)=>s(c,null,null)))}}});var Fl=d(function(Jv,ql){var{ArgumentError:yw}=Ue(),{JwksClient:Ew}=De(),Nl=at(),ww=(e,t)=>{if(e&&e.name==="SigningKeyNotFoundError")return t(null);if(e)return t(e)};ql.exports.expressJwtSecret=function(e){if(e===null||e===void 0)throw new yw("An options object must be provided when initializing expressJwtSecret");let t=new Ew(e),r=e.handleSigningKeyError||ww,n=async(i,s)=>{if(!s)return;let o=s.header;if(!o||!Nl.includes(o.alg))return;try{let c=await t.getSigningKey(o.kid);return c.publicKey||c.rsaPublicKey}catch(c){return new Promise((u,a)=>{r(c,(l)=>{if(!l)return u();a(l)})})}};return function(s,o,c,u){if(arguments.length===4){n(s,{header:o}).then((a)=>{setImmediate(u,null,a)}).catch((a)=>{setImmediate(u,a)});return}return n(s,arguments[1])}}});var Dl=d(function(Wv,Kl){var{ArgumentError:Sw}=Ue(),{JwksClient:bw}=De(),jl=at();Kl.exports.koaJwtSecret=function(e={}){if(!e.jwksUri)throw new Sw("No JWKS provided. Please provide a jwksUri");let t=new bw(e);return function({alg:n,kid:i}={}){return new Promise((s,o)=>{if(!jl.includes(n))return o(Error("Missing / invalid token algorithm"));t.getSigningKey(i).then((c)=>{s(c.publicKey||c.rsaPublicKey)}).catch((c)=>{if(e.handleSigningKeyError)return e.handleSigningKeyError(c).then(o);return o(c)})})}}});var Gl=d(function(Gv,Wl){var Ul=(Fn(),{}),{ArgumentError:Bl}=Ue(),{JwksClient:vw}=De(),Jl=at(),Tw=(e,t)=>{if(e&&e.name==="SigningKeyNotFoundError")return t(null);if(e)return t(e)};Wl.exports.passportJwtSecret=function(e){if(e===null||e===void 0)throw new Bl("An options object must be provided when initializing passportJwtSecret");if(!e.jwksUri)throw new Bl("No JWKS provided. Please provide a jwksUri");let t=new vw(e),r=e.handleSigningKeyError||Tw;return function(i,s,o){let c;try{c={payload:zc(s),header:Hc(s)}}catch(u){c=null}if(!c||!Jl.includes(c.header.alg))return o(null,null);t.getSigningKey(c.header.kid).then((u)=>{o(null,u.publicKey||u.rsaPublicKey)}).catch((u)=>{r(u,(a)=>o(a,null))})}}});var Ml=d(function(Hv,W){var{JwksClient:Hl}=De(),ue=Ue(),{hapiJwt2Key:Aw,hapiJwt2KeyAsync:Iw}=Ll(),{expressJwtSecret:Cw}=Fl(),{koaJwtSecret:Rw}=Dl(),{passportJwtSecret:xw}=Gl();W.exports=(e)=>new Hl(e);W.exports.JwksClient=Hl;W.exports.ArgumentError=ue.ArgumentError;W.exports.JwksError=ue.JwksError;W.exports.JwksRateLimitError=ue.JwksRateLimitError;W.exports.SigningKeyNotFoundError=ue.SigningKeyNotFoundError;W.exports.expressJwtSecret=Cw;W.exports.hapiJwt2Key=Aw;W.exports.hapiJwt2KeyAsync=Iw;W.exports.koaJwtSecret=Rw;W.exports.passportJwtSecret=xw});var qw={};uf(qw,{handler:()=>Pw,isAuthorized:()=>Ql});module.exports=of(qw);var Ar=require("node:crypto");function Rr(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function jw(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");return Buffer.from(t,"base64").toString()}var Ei=`<!DOCTYPE html>
12
12
  <html lang="en">
13
13
  <head>
14
14
  <meta charset="utf-8" />
@@ -28,4 +28,4 @@ ${r}
28
28
  </p>
29
29
  </body>
30
30
  </html>
31
- `;var wi=require("node:fs"),lt=Cr(require("node:path"),1),bi=require("node:url");var ff=(()=>{let e=function(){};return e.prototype=Object.create(null),e})();function ut(e,t){let r=new ff,n=e.length;if(n<2)return r;let i=t?.decode??pf,s=0;do{let o=df(e,s,n);if(o===n)break;let c=hf(e,s,n);if(o>c){s=e.lastIndexOf(";",o-1)+1;continue}let u=Si(e,s,o);if(r[u]===void 0)r[u]=i(Si(e,o+1,c));s=c+1}while(s<n);return r}function hf(e,t,r){let n=e.indexOf(";",t);return n===-1?r:n}function df(e,t,r){let n=e.indexOf("=",t);return n===-1?r:n}function Si(e,t,r){if(t===r)return"";let n=t,i=r;do{let s=e.charCodeAt(n);if(s!==32&&s!==9)break}while(++n<i);while(i>n){let s=e.charCodeAt(i-1);if(s!==32&&s!==9)break;i--}return e.slice(n,i)}function pf(e){if(e.indexOf("%")===-1)return e;try{return decodeURIComponent(e)}catch(t){return e}}var Ee={none:0,error:10,warn:20,info:30,debug:40};class xr{logLevel;constructor(e){this.logLevel=e}jsonify(e){return e.map((t)=>{if(typeof t==="object")try{return JSON.stringify(t)}catch{return t}return t})}info(...e){if(this.logLevel>=Ee.info)console.log(...this.jsonify(e))}warn(...e){if(this.logLevel>=Ee.warn)console.warn(...this.jsonify(e))}error(...e){if(this.logLevel>=Ee.error)console.error(...this.jsonify(e))}debug(...e){if(this.logLevel>=Ee.debug)console.trace(...this.jsonify(e))}}var mf=bi.fileURLToPath("file:///home/runner/work/cdk-cloudfront-auth/cdk-cloudfront-auth/src/handlers/util/config.ts"),gf=lt.dirname(mf);function _r(){let t=process.env.LAMBDA_TASK_ROOT||gf,r=lt.join(t,"config.json");console.log("Loading config from",r);let n=JSON.parse(wi.readFileSync(r,"utf-8")),s=`https://cognito-idp.${/^(\S+?)_\S+$/.exec(n.userPoolId)[1]}.amazonaws.com/${n.userPoolId}`,o=`${s}/.well-known/jwks.json`;return{nonceMaxAge:Number.parseInt(ut(n.cookieSettings.nonce.toLowerCase())["max-age"]??"",10)||86400,...n,tokenIssuer:s,tokenJwksUri:o,logger:new xr(Ee[n.logLevel])}}function yf(e){return Object.entries(e).reduce((t,[r,n])=>Object.assign(t,{[r.toLowerCase()]:[{key:r,value:n}]}),{})}function Or(e,t){let r=t?.cookies?{"set-cookie":t.cookies.map((n)=>({key:"set-cookie",value:n}))}:{};return{status:"307",statusDescription:"Temporary Redirect",headers:{location:[{key:"location",value:e}],...r}}}function vi(e){return{body:Ef(e),status:e.statusCode??"500",headers:{"content-type":[{key:"Content-Type",value:"text/html; charset=UTF-8"}]}}}function Ef(e){let t={...e,region:process.env.AWS_REGION};return Ei.replace(/\${([^}]*)}/g,(r,n)=>t[n]||"")}function Ti(e,t){if(!t)throw Error("Expected response value");return{...t,headers:{...t.headers??{},...yf(e.httpHeaders)}}}function Ai(e){let t;return async(r)=>{if(!t)t=_r();t.logger.debug("Handling event:",r);let n=Ti(t,await e(t,r));return t.logger.debug("Returning response:",n),n}}function zS(e){let t;return async(r)=>{if(!t)t=_r();t.logger.debug("Handling event:",r);let n=Ti(t,await e(t,r));return t.logger.debug("Returning response:",n),n}}var hi=Cr(yc(),1),zl=Cr(Ml(),1),fi;function _S(e){return"rsaPublicKey"in e}async function OS(e,t){if(!fi)fi=zl.default({cache:!0,rateLimit:!0,jwksUri:e});let r=await fi.getSigningKey(t);return _S(r)?r.rsaPublicKey:r.publicKey}async function Vl(e,t,r,n){let i=hi.default.decode(e,{complete:!0});if(!i||typeof i==="string")return{validationError:Error("Cannot parse JWT token")};let s=i.header.kid;if(!s)return{validationError:Error("JWT header is missing 'kid' claim")};let o=await OS(t,s);if(o instanceof Error)return{validationError:o};let c={audience:n,issuer:r,ignoreExpiration:!1};return new Promise((u)=>hi.default.verify(e,o,c,(a)=>a?u({validationError:a}):u(void 0)))}function br(e){let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(Buffer.from(r,"base64").toString())}function kS(e){if(!e.cookie)return{};return e.cookie.reduce((r,n)=>({...r,...ut(n.value)}),{})}function ye(e,t){if(t.toLowerCase().indexOf("domain")===-1)return`${t}; Domain=.${e}`;return t}function Xl(e,t){let r=kS(e);if(!r)return{};let n=`CognitoIdentityServiceProvider.${t}`,i=r[`${n}.LastAuthUser`];return{tokenUserName:i,idToken:r[`${n}.${i??""}.idToken`],accessToken:r[`${n}.${i??""}.accessToken`],refreshToken:r[`${n}.${i??""}.refreshToken`],scopes:r[`${n}.${i??""}.tokenScopesString`],nonce:r["spa-auth-edge-nonce"],nonceHmac:r["spa-auth-edge-nonce-hmac"],pkce:r["spa-auth-edge-pkce"]}}function Xv(e){let t=br(e.tokens.idToken),r=t["cognito:username"],n=`CognitoIdentityServiceProvider.${e.clientId}`,i=`${n}.${r}.idToken`,s=`${n}.${r}.accessToken`,o=`${n}.${r}.refreshToken`,c=`${n}.LastAuthUser`,u=`${n}.${r}.tokenScopesString`,a=e.oauthScopes.join(" "),l=`${n}.${r}.userData`,f=JSON.stringify({UserAttributes:[{Name:"sub",Value:t.sub},{Name:"email",Value:t.email}],Username:r}),m={[i]:`${e.tokens.idToken}; ${ye(e.domainName,e.cookieSettings.idToken)}`,[s]:`${e.tokens.accessToken}; ${ye(e.domainName,e.cookieSettings.accessToken)}`,[o]:`${e.tokens.refreshToken}; ${ye(e.domainName,e.cookieSettings.refreshToken)}`,[c]:`${r}; ${ye(e.domainName,e.cookieSettings.idToken)}`,[u]:`${a}; ${ye(e.domainName,e.cookieSettings.accessToken)}`,[l]:`${encodeURIComponent(f)}; ${ye(e.domainName,e.cookieSettings.idToken)}`,"amplify-signin-with-hostedUI":`true; ${ye(e.domainName,e.cookieSettings.accessToken)}`};if(e.event==="signOut")Object.keys(m).forEach((h)=>m[h]=di(m[h]));else if(e.event==="refreshFailed")m[o]=di(m[o]);return["spa-auth-edge-nonce","spa-auth-edge-nonce-hmac","spa-auth-edge-pkce"].forEach((h)=>{m[h]=di(m[h])}),Object.entries(m).map(([h,g])=>`${h}=${g}`)}function di(e=""){let t=e.split(";").map((n)=>n.trim()).filter((n)=>!n.toLowerCase().startsWith("max-age")).filter((n)=>!n.toLowerCase().startsWith("expires")),r=`Expires=${new Date(0).toUTCString()}`;return["",...t.slice(1),r].join("; ")}var vr=require("node:crypto");function $S(e,t){let r=Number.parseInt(e.slice(0,e.indexOf("T")),10);if(Number.isNaN(r))return{clientError:"Invalid nonce"};if(Yl()-r>t)return{clientError:`Nonce is too old (nonce is from ${new Date(r*1000).toISOString()})`}}function Zv(e,t,r){let n=$S(e,r.nonceMaxAge);if(n)return n;let i=Tr(e,r);if(i!==t)return{clientError:`Nonce signature mismatch! Expected ${i} but got ${t}`}}function pi(){let e=vr.randomBytes(16).toString("hex");return`${Yl()}T${e}`}function Tr(e,t){return vr.createHmac("sha256",t.nonceSigningSecret).update(e).digest("hex")}function Yl(){return Date.now()/1000|0}var LS=Ai(async(e,t)=>{let r=t.Records[0].cf.request,n=r.headers.host[0].value,i=`${r.uri}${r.querystring?`?${r.querystring}`:""}`,{idToken:s,refreshToken:o,nonce:c,nonceHmac:u}=Xl(r.headers,e.clientId);if(e.logger.debug("Extracted cookies:",{idToken:s,refreshToken:o,nonce:c,nonceHmac:u}),!s)return Zl({config:e,domainName:n,requestedUri:i});let a=br(s),{exp:l}=a;if(e.logger.debug("ID token exp:",l,new Date(l*1000).toISOString()),Date.now()/1000>l-600&&o)return PS({config:e,domainName:n,requestedUri:i});e.logger.info("Validating JWT");let f=await Vl(s,e.tokenJwksUri,e.tokenIssuer,e.clientId);if(f!==void 0)return e.logger.debug("ID token not valid:",f.validationError),Zl({config:e,domainName:n,requestedUri:i});if(e.logger.info("JWT is valid"),!Ql(e,a))return vi({title:"Not authorized",statusCode:"403",message:"You are not authorized for this resource.",details:"Your sign in was successful, but your user is not allowed to access this resource.",linkHref:`https://${n}${e.signOutPath}`,linkText:"Sign out"});return r});function Ql(e,t){if(e.requireGroupAnyOf){let r=t["cognito:groups"]||[];if(!e.requireGroupAnyOf.some((n)=>r.includes(n)))return!1}return!0}function PS({config:e,domainName:t,requestedUri:r}){e.logger.info("Redirecting to refresh endpoint");let n=pi(),i=new URLSearchParams({requestedUri:r,nonce:n}).toString();return Or(`https://${t}${e.refreshAuthPath}?${i}`,{cookies:[`spa-auth-edge-nonce=${encodeURIComponent(n)}; ${e.cookieSettings.nonce}`,`spa-auth-edge-nonce-hmac=${encodeURIComponent(Tr(n,e))}; ${e.cookieSettings.nonce}`]})}function Zl({config:e,domainName:t,requestedUri:r}){let n=pi(),i={nonce:n,nonceHmac:Tr(n,e),...NS(e)};e.logger.debug("Using new state:",i);let s=new URLSearchParams({redirect_uri:`https://${t}${e.callbackPath}`,response_type:"code",client_id:e.clientId,state:Rr(Buffer.from(JSON.stringify({nonce:i.nonce,requestedUri:r})).toString("base64")),scope:e.oauthScopes.join(" "),code_challenge_method:"S256",code_challenge:i.pkceHash}).toString();return Or(`https://${e.cognitoAuthDomain}/oauth2/authorize?${s}`,{cookies:[`spa-auth-edge-nonce=${encodeURIComponent(i.nonce)}; ${e.cookieSettings.nonce}`,`spa-auth-edge-nonce-hmac=${encodeURIComponent(i.nonceHmac)}; ${e.cookieSettings.nonce}`,`spa-auth-edge-pkce=${encodeURIComponent(i.pkce)}; ${e.cookieSettings.nonce}`]})}function NS(e){let t=Ar.randomBytes(26).toString("hex"),r={pkce:t,pkceHash:Rr(Ar.createHash("sha256").update(t,"utf8").digest("base64"))};return e.logger.debug("Generated PKCE verifier:",r),r}
31
+ `;var Si=require("node:fs"),lt=Cr(require("node:path"),1),bi=require("node:url");var ff=(()=>{let e=function(){};return e.prototype=Object.create(null),e})();function ut(e,t){let r=new ff,n=e.length;if(n<2)return r;let i=t?.decode??pf,s=0;do{let o=df(e,s,n);if(o===n)break;let c=hf(e,s,n);if(o>c){s=e.lastIndexOf(";",o-1)+1;continue}let u=wi(e,s,o);if(r[u]===void 0)r[u]=i(wi(e,o+1,c));s=c+1}while(s<n);return r}function hf(e,t,r){let n=e.indexOf(";",t);return n===-1?r:n}function df(e,t,r){let n=e.indexOf("=",t);return n===-1?r:n}function wi(e,t,r){if(t===r)return"";let n=t,i=r;do{let s=e.charCodeAt(n);if(s!==32&&s!==9)break}while(++n<i);while(i>n){let s=e.charCodeAt(i-1);if(s!==32&&s!==9)break;i--}return e.slice(n,i)}function pf(e){if(e.indexOf("%")===-1)return e;try{return decodeURIComponent(e)}catch(t){return e}}var Ee={none:0,error:10,warn:20,info:30,debug:40};class xr{logLevel;constructor(e){this.logLevel=e}jsonify(e){return e.map((t)=>{if(typeof t==="object")try{return JSON.stringify(t)}catch{return t}return t})}info(...e){if(this.logLevel>=Ee.info)console.log(...this.jsonify(e))}warn(...e){if(this.logLevel>=Ee.warn)console.warn(...this.jsonify(e))}error(...e){if(this.logLevel>=Ee.error)console.error(...this.jsonify(e))}debug(...e){if(this.logLevel>=Ee.debug)console.trace(...this.jsonify(e))}}var mf=bi.fileURLToPath("file:///home/runner/work/cdk-cloudfront-auth/cdk-cloudfront-auth/src/handlers/util/config.ts"),gf=lt.dirname(mf);function _r(){let t=process.env.LAMBDA_TASK_ROOT||gf,r=lt.join(t,"config.json");console.log("Loading config from",r);let n=JSON.parse(Si.readFileSync(r,"utf-8")),s=`https://cognito-idp.${/^(\S+?)_\S+$/.exec(n.userPoolId)[1]}.amazonaws.com/${n.userPoolId}`,o=`${s}/.well-known/jwks.json`;return{nonceMaxAge:Number.parseInt(ut(n.cookieSettings.nonce.toLowerCase())["max-age"]??"",10)||86400,...n,tokenIssuer:s,tokenJwksUri:o,logger:new xr(Ee[n.logLevel])}}function yf(e){return Object.entries(e).reduce((t,[r,n])=>Object.assign(t,{[r.toLowerCase()]:[{key:r,value:n}]}),{})}function Or(e,t){let r=t?.cookies?{"set-cookie":t.cookies.map((n)=>({key:"set-cookie",value:n}))}:{};return{status:"307",statusDescription:"Temporary Redirect",headers:{location:[{key:"location",value:e}],...r}}}function vi(e){return{body:Ef(e),status:e.statusCode??"500",headers:{"content-type":[{key:"Content-Type",value:"text/html; charset=UTF-8"}]}}}function Ef(e){let t={...e,region:process.env.AWS_REGION};return Ei.replace(/\${([^}]*)}/g,(r,n)=>t[n]||"")}function Ti(e,t){if(!t)throw Error("Expected response value");return{...t,headers:{...t.headers??{},...yf(e.httpHeaders)}}}function Ai(e){let t;return async(r)=>{if(!t)t=_r();t.logger.debug("Handling event:",r);let n=Ti(t,await e(t,r));return t.logger.debug("Returning response:",n),n}}function zw(e){let t;return async(r)=>{if(!t)t=_r();t.logger.debug("Handling event:",r);let n=Ti(t,await e(t,r));return t.logger.debug("Returning response:",n),n}}var hi=Cr(yc(),1),zl=Cr(Ml(),1),fi;function _w(e){return"rsaPublicKey"in e}async function Ow(e,t){if(!fi)fi=zl.default({cache:!0,rateLimit:!0,jwksUri:e});let r=await fi.getSigningKey(t);return _w(r)?r.rsaPublicKey:r.publicKey}async function Vl(e,t,r,n){let i=hi.default.decode(e,{complete:!0});if(!i||typeof i==="string")return{validationError:Error("Cannot parse JWT token")};let s=i.header.kid;if(!s)return{validationError:Error("JWT header is missing 'kid' claim")};let o=await Ow(t,s);if(o instanceof Error)return{validationError:o};let c={audience:n,issuer:r,ignoreExpiration:!1};return new Promise((u)=>hi.default.verify(e,o,c,(a)=>a?u({validationError:a}):u(void 0)))}function br(e){let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(Buffer.from(r,"base64").toString())}function kw(e){if(!e.cookie)return{};return e.cookie.reduce((r,n)=>({...r,...ut(n.value)}),{})}function ye(e,t){if(t.toLowerCase().indexOf("domain")===-1)return`${t}; Domain=.${e}`;return t}function Xl(e,t){let r=kw(e);if(!r)return{};let n=`CognitoIdentityServiceProvider.${t}`,i=r[`${n}.LastAuthUser`];return{tokenUserName:i,idToken:r[`${n}.${i??""}.idToken`],accessToken:r[`${n}.${i??""}.accessToken`],refreshToken:r[`${n}.${i??""}.refreshToken`],scopes:r[`${n}.${i??""}.tokenScopesString`],nonce:r["spa-auth-edge-nonce"],nonceHmac:r["spa-auth-edge-nonce-hmac"],pkce:r["spa-auth-edge-pkce"]}}function Xv(e){let t=br(e.tokens.idToken),r=t["cognito:username"],n=`CognitoIdentityServiceProvider.${e.clientId}`,i=`${n}.${r}.idToken`,s=`${n}.${r}.accessToken`,o=`${n}.${r}.refreshToken`,c=`${n}.LastAuthUser`,u=`${n}.${r}.tokenScopesString`,a=e.oauthScopes.join(" "),l=`${n}.${r}.userData`,f=JSON.stringify({UserAttributes:[{Name:"sub",Value:t.sub},{Name:"email",Value:t.email}],Username:r}),m={[i]:`${e.tokens.idToken}; ${ye(e.domainName,e.cookieSettings.idToken)}`,[s]:`${e.tokens.accessToken}; ${ye(e.domainName,e.cookieSettings.accessToken)}`,[o]:`${e.tokens.refreshToken}; ${ye(e.domainName,e.cookieSettings.refreshToken)}`,[c]:`${r}; ${ye(e.domainName,e.cookieSettings.idToken)}`,[u]:`${a}; ${ye(e.domainName,e.cookieSettings.accessToken)}`,[l]:`${encodeURIComponent(f)}; ${ye(e.domainName,e.cookieSettings.idToken)}`,"amplify-signin-with-hostedUI":`true; ${ye(e.domainName,e.cookieSettings.accessToken)}`};if(e.event==="signOut")Object.keys(m).forEach((h)=>m[h]=di(m[h]));else if(e.event==="refreshFailed")m[o]=di(m[o]);return["spa-auth-edge-nonce","spa-auth-edge-nonce-hmac","spa-auth-edge-pkce"].forEach((h)=>{m[h]=di(m[h])}),Object.entries(m).map(([h,g])=>`${h}=${g}`)}function di(e=""){let t=e.split(";").map((n)=>n.trim()).filter((n)=>!n.toLowerCase().startsWith("max-age")).filter((n)=>!n.toLowerCase().startsWith("expires")),r=`Expires=${new Date(0).toUTCString()}`;return["",...t.slice(1),r].join("; ")}var vr=require("node:crypto");function $w(e,t){let r=Number.parseInt(e.slice(0,e.indexOf("T")),10);if(Number.isNaN(r))return{clientError:"Invalid nonce"};if(Yl()-r>t)return{clientError:`Nonce is too old (nonce is from ${new Date(r*1000).toISOString()})`}}function Zv(e,t,r){let n=$w(e,r.nonceMaxAge);if(n)return n;let i=Tr(e,r);if(i!==t)return{clientError:`Nonce signature mismatch! Expected ${i} but got ${t}`}}function pi(){let e=vr.randomBytes(16).toString("hex");return`${Yl()}T${e}`}function Tr(e,t){return vr.createHmac("sha256",t.nonceSigningSecret).update(e).digest("hex")}function Yl(){return Date.now()/1000|0}var Pw=Ai(async(e,t)=>{let r=t.Records[0].cf.request,n=r.headers.host[0].value,i=`${r.uri}${r.querystring?`?${r.querystring}`:""}`,{idToken:s,refreshToken:o,nonce:c,nonceHmac:u}=Xl(r.headers,e.clientId);if(e.logger.debug("Extracted cookies:",{idToken:s,refreshToken:o,nonce:c,nonceHmac:u}),!s)return Zl({config:e,domainName:n,requestedUri:i});let a=br(s),{exp:l}=a;if(e.logger.debug("ID token exp:",l,new Date(l*1000).toISOString()),Date.now()/1000>l-600&&o)return Lw({config:e,domainName:n,requestedUri:i});e.logger.info("Validating JWT");let f=await Vl(s,e.tokenJwksUri,e.tokenIssuer,e.clientId);if(f!==void 0)return e.logger.debug("ID token not valid:",f.validationError),Zl({config:e,domainName:n,requestedUri:i});if(e.logger.info("JWT is valid"),!Ql(e,a))return vi({title:"Not authorized",statusCode:"403",message:"You are not authorized for this resource.",details:"Your sign in was successful, but your user is not allowed to access this resource.",linkHref:`https://${n}${e.signOutPath}`,linkText:"Sign out"});return r});function Ql(e,t){if(e.requireGroupAnyOf){let r=t["cognito:groups"]||[];if(!e.requireGroupAnyOf.some((n)=>r.includes(n)))return!1}return!0}function Lw({config:e,domainName:t,requestedUri:r}){e.logger.info("Redirecting to refresh endpoint");let n=pi(),i=new URLSearchParams({requestedUri:r,nonce:n}).toString();return Or(`https://${t}${e.refreshAuthPath}?${i}`,{cookies:[`spa-auth-edge-nonce=${encodeURIComponent(n)}; ${e.cookieSettings.nonce}`,`spa-auth-edge-nonce-hmac=${encodeURIComponent(Tr(n,e))}; ${e.cookieSettings.nonce}`]})}function Zl({config:e,domainName:t,requestedUri:r}){let n=pi(),i={nonce:n,nonceHmac:Tr(n,e),...Nw(e)};e.logger.debug("Using new state:",i);let s=new URLSearchParams({redirect_uri:`https://${t}${e.callbackPath}`,response_type:"code",client_id:e.clientId,state:Rr(Buffer.from(JSON.stringify({nonce:i.nonce,requestedUri:r})).toString("base64")),scope:e.oauthScopes.join(" "),code_challenge_method:"S256",code_challenge:i.pkceHash}).toString();return Or(`https://${e.cognitoAuthDomain}/oauth2/authorize?${s}`,{cookies:[`spa-auth-edge-nonce=${encodeURIComponent(i.nonce)}; ${e.cookieSettings.nonce}`,`spa-auth-edge-nonce-hmac=${encodeURIComponent(i.nonceHmac)}; ${e.cookieSettings.nonce}`,`spa-auth-edge-pkce=${encodeURIComponent(i.pkce)}; ${e.cookieSettings.nonce}`]})}function Nw(e){let t=Ar.randomBytes(26).toString("hex"),r={pkce:t,pkceHash:Rr(Ar.createHash("sha256").update(t,"utf8").digest("base64"))};return e.logger.debug("Generated PKCE verifier:",r),r}