diff --git a/packages/next/src/compiled/jsonwebtoken/index.js b/packages/next/src/compiled/jsonwebtoken/index.js index d909e5436ac25..dde9a6f012462 100644 --- a/packages/next/src/compiled/jsonwebtoken/index.js +++ b/packages/next/src/compiled/jsonwebtoken/index.js @@ -1,4 +1,4 @@ -(()=>{var e={112:(e,r,t)=>{"use strict";var n=t(300).Buffer;var a=t(300).SlowBuffer;e.exports=bufferEq;function bufferEq(e,r){if(!n.isBuffer(e)||!n.isBuffer(r)){return false}if(e.length!==r.length){return false}var t=0;for(var a=0;a{"use strict";var n=t(911).Buffer;var a=t(8);var i=128,s=0,o=32,u=16,l=2,c=u|o|s<<6,f=l|s<<6;function base64Url(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function signatureAsBuffer(e){if(n.isBuffer(e)){return e}else if("string"===typeof e){return n.from(e,"base64")}throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function derToJose(e,r){e=signatureAsBuffer(e);var t=a(r);var s=t+1;var o=e.length;var u=0;if(e[u++]!==c){throw new Error('Could not find expected "seq"')}var l=e[u++];if(l===(i|1)){l=e[u++]}if(o-u=i;if(a){--n}return n}function joseToDer(e,r){e=signatureAsBuffer(e);var t=a(r);var s=e.length;if(s!==t*2){throw new TypeError('"'+r+'" signatures must be "'+t*2+'" bytes, saw "'+s+'"')}var o=countPadding(e,0,t);var u=countPadding(e,t,e.length);var l=t-o;var h=t-u;var p=1+1+l+1+1+h;var d=p{"use strict";function getParamSize(e){var r=(e/8|0)+(e%8===0?0:1);return r}var r={ES256:getParamSize(256),ES384:getParamSize(384),ES512:getParamSize(521)};function getParamBytesForAlg(e){var t=r[e];if(t){return t}throw new Error('Unknown algorithm "'+e+'"')}e.exports=getParamBytesForAlg},443:(e,r,t)=>{var n=t(111);e.exports=function(e,r){r=r||{};var t=n.decode(e,r);if(!t){return null}var a=t.payload;if(typeof a==="string"){try{var i=JSON.parse(a);if(i!==null&&typeof i==="object"){a=i}}catch(e){}}if(r.complete===true){return{header:t.header,payload:a,signature:t.signature}}return a}},773:(e,r,t)=>{e.exports={verify:t(624),sign:t(743),JsonWebTokenError:t(131),NotBeforeError:t(422),TokenExpiredError:t(794)};Object.defineProperty(e.exports,"decode",{enumerable:false,value:t(443)})},131:e=>{var JsonWebTokenError=function(e,r){Error.call(this,e);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}this.name="JsonWebTokenError";this.message=e;if(r)this.inner=r};JsonWebTokenError.prototype=Object.create(Error.prototype);JsonWebTokenError.prototype.constructor=JsonWebTokenError;e.exports=JsonWebTokenError},422:(e,r,t)=>{var n=t(131);var NotBeforeError=function(e,r){n.call(this,e);this.name="NotBeforeError";this.date=r};NotBeforeError.prototype=Object.create(n.prototype);NotBeforeError.prototype.constructor=NotBeforeError;e.exports=NotBeforeError},794:(e,r,t)=>{var n=t(131);var TokenExpiredError=function(e,r){n.call(this,e);this.name="TokenExpiredError";this.expiredAt=r};TokenExpiredError.prototype=Object.create(n.prototype);TokenExpiredError.prototype.constructor=TokenExpiredError;e.exports=TokenExpiredError},186:(e,r,t)=>{const n=t(849);e.exports=n.satisfies(process.version,">=15.7.0")},900:(e,r,t)=>{var n=t(849);e.exports=n.satisfies(process.version,"^6.12.0 || >=8.0.0")},444:(e,r,t)=>{const n=t(849);e.exports=n.satisfies(process.version,">=16.9.0")},126:(e,r,t)=>{var n=t(958);e.exports=function(e,r){var t=r||Math.floor(Date.now()/1e3);if(typeof e==="string"){var a=n(e);if(typeof a==="undefined"){return}return Math.floor(t+a/1e3)}else if(typeof e==="number"){return t+e}else{return}}},253:(e,r,t)=>{const n=t(186);const a=t(444);const i={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]};const s={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};e.exports=function(e,r){if(!e||!r)return;const t=r.asymmetricKeyType;if(!t)return;const o=i[t];if(!o){throw new Error(`Unknown key type "${t}".`)}if(!o.includes(e)){throw new Error(`"alg" parameter for "${t}" key type must be one of: ${o.join(", ")}.`)}if(n){switch(t){case"ec":const t=r.asymmetricKeyDetails.namedCurve;const n=s[e];if(t!==n){throw new Error(`"alg" parameter "${e}" requires curve "${n}".`)}break;case"rsa-pss":if(a){const t=parseInt(e.slice(-3),10);const{hashAlgorithm:n,mgf1HashAlgorithm:a,saltLength:i}=r.asymmetricKeyDetails;if(n!==`sha${t}`||a!==n){throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`)}if(i!==undefined&&i>t>>3){throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}}break}}}},743:(e,r,t)=>{const n=t(126);const a=t(900);const i=t(253);const s=t(111);const{includes:o,isBoolean:u,isInteger:l,isNumber:c,isPlainObject:f,isString:h,once:p}=t(788);const{KeyObject:d,createSecretKey:y,createPrivateKey:g}=t(113);const v=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];if(a){v.splice(3,0,"PS256","PS384","PS512")}const b={expiresIn:{isValid:function(e){return l(e)||h(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return l(e)||h(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return h(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:o.bind(null,v),message:'"algorithm" must be a valid string enum value'},header:{isValid:f,message:'"header" must be an object'},encoding:{isValid:h,message:'"encoding" must be a string'},issuer:{isValid:h,message:'"issuer" must be a string'},subject:{isValid:h,message:'"subject" must be a string'},jwtid:{isValid:h,message:'"jwtid" must be a string'},noTimestamp:{isValid:u,message:'"noTimestamp" must be a boolean'},keyid:{isValid:h,message:'"keyid" must be a string'},mutatePayload:{isValid:u,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:u,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:u,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}};const m={iat:{isValid:c,message:'"iat" should be a number of seconds'},exp:{isValid:c,message:'"exp" should be a number of seconds'},nbf:{isValid:c,message:'"nbf" should be a number of seconds'}};function validate(e,r,t,n){if(!f(t)){throw new Error('Expected "'+n+'" to be a plain object.')}Object.keys(t).forEach((function(a){const i=e[a];if(!i){if(!r){throw new Error('"'+a+'" is not allowed in "'+n+'"')}return}if(!i.isValid(t[a])){throw new Error(i.message)}}))}function validateOptions(e){return validate(b,false,e,"options")}function validatePayload(e){return validate(m,true,e,"payload")}const _={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"};const w=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];e.exports=function(e,r,t,a){if(typeof t==="function"){a=t;t={}}else{t=t||{}}const o=typeof e==="object"&&!Buffer.isBuffer(e);const u=Object.assign({alg:t.algorithm||"HS256",typ:o?"JWT":undefined,kid:t.keyid},t.header);function failure(e){if(a){return a(e)}throw e}if(!r&&t.algorithm!=="none"){return failure(new Error("secretOrPrivateKey must have a value"))}if(r!=null&&!(r instanceof d)){try{r=g(r)}catch(e){try{r=y(typeof r==="string"?Buffer.from(r):r)}catch(e){return failure(new Error("secretOrPrivateKey is not valid key material"))}}}if(u.alg.startsWith("HS")&&r.type!=="secret"){return failure(new Error(`secretOrPrivateKey must be a symmetric key when using ${u.alg}`))}else if(/^(?:RS|PS|ES)/.test(u.alg)){if(r.type!=="private"){return failure(new Error(`secretOrPrivateKey must be an asymmetric key when using ${u.alg}`))}if(!t.allowInsecureKeySizes&&!u.alg.startsWith("ES")&&r.asymmetricKeyDetails!==undefined&&r.asymmetricKeyDetails.modulusLength<2048){return failure(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`))}}if(typeof e==="undefined"){return failure(new Error("payload is required"))}else if(o){try{validatePayload(e)}catch(e){return failure(e)}if(!t.mutatePayload){e=Object.assign({},e)}}else{const r=w.filter((function(e){return typeof t[e]!=="undefined"}));if(r.length>0){return failure(new Error("invalid "+r.join(",")+" option for "+typeof e+" payload"))}}if(typeof e.exp!=="undefined"&&typeof t.expiresIn!=="undefined"){return failure(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'))}if(typeof e.nbf!=="undefined"&&typeof t.notBefore!=="undefined"){return failure(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'))}try{validateOptions(t)}catch(e){return failure(e)}if(!t.allowInvalidAsymmetricKeyTypes){try{i(u.alg,r)}catch(e){return failure(e)}}const l=e.iat||Math.floor(Date.now()/1e3);if(t.noTimestamp){delete e.iat}else if(o){e.iat=l}if(typeof t.notBefore!=="undefined"){try{e.nbf=n(t.notBefore,l)}catch(e){return failure(e)}if(typeof e.nbf==="undefined"){return failure(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}}if(typeof t.expiresIn!=="undefined"&&typeof e==="object"){try{e.exp=n(t.expiresIn,l)}catch(e){return failure(e)}if(typeof e.exp==="undefined"){return failure(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}}Object.keys(_).forEach((function(r){const n=_[r];if(typeof t[r]!=="undefined"){if(typeof e[n]!=="undefined"){return failure(new Error('Bad "options.'+r+'" option. The payload already has an "'+n+'" property.'))}e[n]=t[r]}}));const c=t.encoding||"utf8";if(typeof a==="function"){a=a&&p(a);s.createSign({header:u,privateKey:r,payload:e,encoding:c}).once("error",a).once("done",(function(e){if(!t.allowInsecureKeySizes&&/^(?:RS|PS)/.test(u.alg)&&e.length<256){return a(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`))}a(null,e)}))}else{let n=s.sign({header:u,payload:e,secret:r,encoding:c});if(!t.allowInsecureKeySizes&&/^(?:RS|PS)/.test(u.alg)&&n.length<256){throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`)}return n}}},624:(e,r,t)=>{const n=t(131);const a=t(422);const i=t(794);const s=t(443);const o=t(126);const u=t(253);const l=t(900);const c=t(111);const{KeyObject:f,createSecretKey:h,createPublicKey:p}=t(113);const d=["RS256","RS384","RS512"];const y=["ES256","ES384","ES512"];const g=["RS256","RS384","RS512"];const v=["HS256","HS384","HS512"];if(l){d.splice(d.length,0,"PS256","PS384","PS512");g.splice(g.length,0,"PS256","PS384","PS512")}e.exports=function(e,r,t,l){if(typeof t==="function"&&!l){l=t;t={}}if(!t){t={}}t=Object.assign({},t);let b;if(l){b=l}else{b=function(e,r){if(e)throw e;return r}}if(t.clockTimestamp&&typeof t.clockTimestamp!=="number"){return b(new n("clockTimestamp must be a number"))}if(t.nonce!==undefined&&(typeof t.nonce!=="string"||t.nonce.trim()==="")){return b(new n("nonce must be a non-empty string"))}if(t.allowInvalidAsymmetricKeyTypes!==undefined&&typeof t.allowInvalidAsymmetricKeyTypes!=="boolean"){return b(new n("allowInvalidAsymmetricKeyTypes must be a boolean"))}const m=t.clockTimestamp||Math.floor(Date.now()/1e3);if(!e){return b(new n("jwt must be provided"))}if(typeof e!=="string"){return b(new n("jwt must be a string"))}const _=e.split(".");if(_.length!==3){return b(new n("jwt malformed"))}let w;try{w=s(e,{complete:true})}catch(e){return b(e)}if(!w){return b(new n("invalid token"))}const S=w.header;let I;if(typeof r==="function"){if(!l){return b(new n("verify must be called asynchronous if secret or public key is provided as a callback"))}I=r}else{I=function(e,t){return t(null,r)}}return I(S,(function(r,s){if(r){return b(new n("error in secret or public key callback: "+r.message))}const l=_[2].trim()!=="";if(!l&&s){return b(new n("jwt signature is required"))}if(l&&!s){return b(new n("secret or public key must be provided"))}if(!l&&!t.algorithms){return b(new n('please specify "none" in "algorithms" to verify unsigned tokens'))}if(s!=null&&!(s instanceof f)){try{s=p(s)}catch(e){try{s=h(typeof s==="string"?Buffer.from(s):s)}catch(e){return b(new n("secretOrPublicKey is not valid key material"))}}}if(!t.algorithms){if(s.type==="secret"){t.algorithms=v}else if(["rsa","rsa-pss"].includes(s.asymmetricKeyType)){t.algorithms=g}else if(s.asymmetricKeyType==="ec"){t.algorithms=y}else{t.algorithms=d}}if(t.algorithms.indexOf(w.header.alg)===-1){return b(new n("invalid algorithm"))}if(S.alg.startsWith("HS")&&s.type!=="secret"){return b(new n(`secretOrPublicKey must be a symmetric key when using ${S.alg}`))}else if(/^(?:RS|PS|ES)/.test(S.alg)&&s.type!=="public"){return b(new n(`secretOrPublicKey must be an asymmetric key when using ${S.alg}`))}if(!t.allowInvalidAsymmetricKeyTypes){try{u(S.alg,s)}catch(e){return b(e)}}let I;try{I=c.verify(e,w.header.alg,s)}catch(e){return b(e)}if(!I){return b(new n("invalid signature"))}const A=w.payload;if(typeof A.nbf!=="undefined"&&!t.ignoreNotBefore){if(typeof A.nbf!=="number"){return b(new n("invalid nbf value"))}if(A.nbf>m+(t.clockTolerance||0)){return b(new a("jwt not active",new Date(A.nbf*1e3)))}}if(typeof A.exp!=="undefined"&&!t.ignoreExpiration){if(typeof A.exp!=="number"){return b(new n("invalid exp value"))}if(m>=A.exp+(t.clockTolerance||0)){return b(new i("jwt expired",new Date(A.exp*1e3)))}}if(t.audience){const e=Array.isArray(t.audience)?t.audience:[t.audience];const r=Array.isArray(A.aud)?A.aud:[A.aud];const a=r.some((function(r){return e.some((function(e){return e instanceof RegExp?e.test(r):e===r}))}));if(!a){return b(new n("jwt audience invalid. expected: "+e.join(" or ")))}}if(t.issuer){const e=typeof t.issuer==="string"&&A.iss!==t.issuer||Array.isArray(t.issuer)&&t.issuer.indexOf(A.iss)===-1;if(e){return b(new n("jwt issuer invalid. expected: "+t.issuer))}}if(t.subject){if(A.sub!==t.subject){return b(new n("jwt subject invalid. expected: "+t.subject))}}if(t.jwtid){if(A.jti!==t.jwtid){return b(new n("jwt jwtid invalid. expected: "+t.jwtid))}}if(t.nonce){if(A.nonce!==t.nonce){return b(new n("jwt nonce invalid. expected: "+t.nonce))}}if(t.maxAge){if(typeof A.iat!=="number"){return b(new n("iat required when maxAge is specified"))}const e=o(t.maxAge,A.iat);if(typeof e==="undefined"){return b(new n('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(m>=e+(t.clockTolerance||0)){return b(new i("maxAge exceeded",new Date(e*1e3)))}}if(t.complete===true){const e=w.signature;return b(null,{header:S,payload:A,signature:e})}return b(null,A)}))}},251:(e,r,t)=>{var n=t(112);var a=t(911).Buffer;var i=t(113);var s=t(160);var o=t(837);var u='"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".';var l="secret must be a string or buffer";var c="key must be a string or a buffer";var f="key must be a string, a buffer or an object";var h=typeof i.createPublicKey==="function";if(h){c+=" or a KeyObject";l+="or a KeyObject"}function checkIsPublicKey(e){if(a.isBuffer(e)){return}if(typeof e==="string"){return}if(!h){throw typeError(c)}if(typeof e!=="object"){throw typeError(c)}if(typeof e.type!=="string"){throw typeError(c)}if(typeof e.asymmetricKeyType!=="string"){throw typeError(c)}if(typeof e.export!=="function"){throw typeError(c)}}function checkIsPrivateKey(e){if(a.isBuffer(e)){return}if(typeof e==="string"){return}if(typeof e==="object"){return}throw typeError(f)}function checkIsSecretKey(e){if(a.isBuffer(e)){return}if(typeof e==="string"){return e}if(!h){throw typeError(l)}if(typeof e!=="object"){throw typeError(l)}if(e.type!=="secret"){throw typeError(l)}if(typeof e.export!=="function"){throw typeError(l)}}function fromBase64(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function toBase64(e){e=e.toString();var r=4-e.length%4;if(r!==4){for(var t=0;t{var n=t(409);var a=t(851);var i=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];r.ALGORITHMS=i;r.sign=n.sign;r.verify=a.verify;r.decode=a.decode;r.isValid=a.isValid;r.createSign=function createSign(e){return new n(e)};r.createVerify=function createVerify(e){return new a(e)}},626:(e,r,t)=>{var n=t(911).Buffer;var a=t(781);var i=t(837);function DataStream(e){this.buffer=null;this.writable=true;this.readable=true;if(!e){this.buffer=n.alloc(0);return this}if(typeof e.pipe==="function"){this.buffer=n.alloc(0);e.pipe(this);return this}if(e.length||typeof e==="object"){this.buffer=e;this.writable=false;process.nextTick(function(){this.emit("end",e);this.readable=false;this.emit("close")}.bind(this));return this}throw new TypeError("Unexpected data type ("+typeof e+")")}i.inherits(DataStream,a);DataStream.prototype.write=function write(e){this.buffer=n.concat([this.buffer,n.from(e)]);this.emit("data",e)};DataStream.prototype.end=function end(e){if(e)this.write(e);this.emit("end",e);this.emit("close");this.writable=false;this.readable=false};e.exports=DataStream},409:(e,r,t)=>{var n=t(911).Buffer;var a=t(626);var i=t(251);var s=t(781);var o=t(730);var u=t(837);function base64url(e,r){return n.from(e,r).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function jwsSecuredInput(e,r,t){t=t||"utf8";var n=base64url(o(e),"binary");var a=base64url(o(r),t);return u.format("%s.%s",n,a)}function jwsSign(e){var r=e.header;var t=e.payload;var n=e.secret||e.privateKey;var a=e.encoding;var s=i(r.alg);var o=jwsSecuredInput(r,t,a);var l=s.sign(o,n);return u.format("%s.%s",o,l)}function SignStream(e){var r=e.secret||e.privateKey||e.key;var t=new a(r);this.readable=true;this.header=e.header;this.encoding=e.encoding;this.secret=this.privateKey=this.key=t;this.payload=new a(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))}u.inherits(SignStream,s);SignStream.prototype.sign=function sign(){try{var e=jwsSign({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});this.emit("done",e);this.emit("data",e);this.emit("end");this.readable=false;return e}catch(e){this.readable=false;this.emit("error",e);this.emit("close")}};SignStream.sign=jwsSign;e.exports=SignStream},730:(e,r,t)=>{var n=t(300).Buffer;e.exports=function toString(e){if(typeof e==="string")return e;if(typeof e==="number"||n.isBuffer(e))return e.toString();return JSON.stringify(e)}},851:(e,r,t)=>{var n=t(911).Buffer;var a=t(626);var i=t(251);var s=t(781);var o=t(730);var u=t(837);var l=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function isObject(e){return Object.prototype.toString.call(e)==="[object Object]"}function safeJsonParse(e){if(isObject(e))return e;try{return JSON.parse(e)}catch(e){return undefined}}function headerFromJWS(e){var r=e.split(".",1)[0];return safeJsonParse(n.from(r,"base64").toString("binary"))}function securedInputFromJWS(e){return e.split(".",2).join(".")}function signatureFromJWS(e){return e.split(".")[2]}function payloadFromJWS(e,r){r=r||"utf8";var t=e.split(".")[1];return n.from(t,"base64").toString(r)}function isValidJws(e){return l.test(e)&&!!headerFromJWS(e)}function jwsVerify(e,r,t){if(!r){var n=new Error("Missing algorithm parameter for jws.verify");n.code="MISSING_ALGORITHM";throw n}e=o(e);var a=signatureFromJWS(e);var s=securedInputFromJWS(e);var u=i(r);return u.verify(s,a,t)}function jwsDecode(e,r){r=r||{};e=o(e);if(!isValidJws(e))return null;var t=headerFromJWS(e);if(!t)return null;var n=payloadFromJWS(e);if(t.typ==="JWT"||r.json)n=JSON.parse(n,r.encoding);return{header:t,payload:n,signature:signatureFromJWS(e)}}function VerifyStream(e){e=e||{};var r=e.secret||e.publicKey||e.key;var t=new a(r);this.readable=true;this.algorithm=e.algorithm;this.encoding=e.encoding;this.secret=this.publicKey=this.key=t;this.signature=new a(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))}u.inherits(VerifyStream,s);VerifyStream.prototype.verify=function verify(){try{var e=jwsVerify(this.signature.buffer,this.algorithm,this.key.buffer);var r=jwsDecode(this.signature.buffer,this.encoding);this.emit("done",e,r);this.emit("data",e);this.emit("end");this.readable=false;return e}catch(e){this.readable=false;this.emit("error",e);this.emit("close")}};VerifyStream.decode=jwsDecode;VerifyStream.isValid=isValidJws;VerifyStream.verify=jwsVerify;e.exports=VerifyStream},788:function(e,r,t){e=t.nmd(e); +(()=>{var e={112:(e,r,t)=>{"use strict";var n=t(300).Buffer;var a=t(300).SlowBuffer;e.exports=bufferEq;function bufferEq(e,r){if(!n.isBuffer(e)||!n.isBuffer(r)){return false}if(e.length!==r.length){return false}var t=0;for(var a=0;a{"use strict";var n=t(911).Buffer;var a=t(8);var i=128,s=0,o=32,u=16,l=2,c=u|o|s<<6,f=l|s<<6;function base64Url(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function signatureAsBuffer(e){if(n.isBuffer(e)){return e}else if("string"===typeof e){return n.from(e,"base64")}throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function derToJose(e,r){e=signatureAsBuffer(e);var t=a(r);var s=t+1;var o=e.length;var u=0;if(e[u++]!==c){throw new Error('Could not find expected "seq"')}var l=e[u++];if(l===(i|1)){l=e[u++]}if(o-u=i;if(a){--n}return n}function joseToDer(e,r){e=signatureAsBuffer(e);var t=a(r);var s=e.length;if(s!==t*2){throw new TypeError('"'+r+'" signatures must be "'+t*2+'" bytes, saw "'+s+'"')}var o=countPadding(e,0,t);var u=countPadding(e,t,e.length);var l=t-o;var h=t-u;var p=1+1+l+1+1+h;var d=p{"use strict";function getParamSize(e){var r=(e/8|0)+(e%8===0?0:1);return r}var r={ES256:getParamSize(256),ES384:getParamSize(384),ES512:getParamSize(521)};function getParamBytesForAlg(e){var t=r[e];if(t){return t}throw new Error('Unknown algorithm "'+e+'"')}e.exports=getParamBytesForAlg},443:(e,r,t)=>{var n=t(111);e.exports=function(e,r){r=r||{};var t=n.decode(e,r);if(!t){return null}var a=t.payload;if(typeof a==="string"){try{var i=JSON.parse(a);if(i!==null&&typeof i==="object"){a=i}}catch(e){}}if(r.complete===true){return{header:t.header,payload:a,signature:t.signature}}return a}},773:(e,r,t)=>{e.exports={verify:t(624),sign:t(743),JsonWebTokenError:t(131),NotBeforeError:t(422),TokenExpiredError:t(794)};Object.defineProperty(e.exports,"decode",{enumerable:false,value:t(443)})},131:e=>{var JsonWebTokenError=function(e,r){Error.call(this,e);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}this.name="JsonWebTokenError";this.message=e;if(r)this.inner=r};JsonWebTokenError.prototype=Object.create(Error.prototype);JsonWebTokenError.prototype.constructor=JsonWebTokenError;e.exports=JsonWebTokenError},422:(e,r,t)=>{var n=t(131);var NotBeforeError=function(e,r){n.call(this,e);this.name="NotBeforeError";this.date=r};NotBeforeError.prototype=Object.create(n.prototype);NotBeforeError.prototype.constructor=NotBeforeError;e.exports=NotBeforeError},794:(e,r,t)=>{var n=t(131);var TokenExpiredError=function(e,r){n.call(this,e);this.name="TokenExpiredError";this.expiredAt=r};TokenExpiredError.prototype=Object.create(n.prototype);TokenExpiredError.prototype.constructor=TokenExpiredError;e.exports=TokenExpiredError},186:(e,r,t)=>{const n=t(521);e.exports=n.satisfies(process.version,">=15.7.0")},900:(e,r,t)=>{var n=t(521);e.exports=n.satisfies(process.version,"^6.12.0 || >=8.0.0")},444:(e,r,t)=>{const n=t(521);e.exports=n.satisfies(process.version,">=16.9.0")},126:(e,r,t)=>{var n=t(958);e.exports=function(e,r){var t=r||Math.floor(Date.now()/1e3);if(typeof e==="string"){var a=n(e);if(typeof a==="undefined"){return}return Math.floor(t+a/1e3)}else if(typeof e==="number"){return t+e}else{return}}},253:(e,r,t)=>{const n=t(186);const a=t(444);const i={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]};const s={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};e.exports=function(e,r){if(!e||!r)return;const t=r.asymmetricKeyType;if(!t)return;const o=i[t];if(!o){throw new Error(`Unknown key type "${t}".`)}if(!o.includes(e)){throw new Error(`"alg" parameter for "${t}" key type must be one of: ${o.join(", ")}.`)}if(n){switch(t){case"ec":const t=r.asymmetricKeyDetails.namedCurve;const n=s[e];if(t!==n){throw new Error(`"alg" parameter "${e}" requires curve "${n}".`)}break;case"rsa-pss":if(a){const t=parseInt(e.slice(-3),10);const{hashAlgorithm:n,mgf1HashAlgorithm:a,saltLength:i}=r.asymmetricKeyDetails;if(n!==`sha${t}`||a!==n){throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`)}if(i!==undefined&&i>t>>3){throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}}break}}}},743:(e,r,t)=>{const n=t(126);const a=t(900);const i=t(253);const s=t(111);const{includes:o,isBoolean:u,isInteger:l,isNumber:c,isPlainObject:f,isString:h,once:p}=t(788);const{KeyObject:d,createSecretKey:y,createPrivateKey:g}=t(113);const v=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];if(a){v.splice(3,0,"PS256","PS384","PS512")}const b={expiresIn:{isValid:function(e){return l(e)||h(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return l(e)||h(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return h(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:o.bind(null,v),message:'"algorithm" must be a valid string enum value'},header:{isValid:f,message:'"header" must be an object'},encoding:{isValid:h,message:'"encoding" must be a string'},issuer:{isValid:h,message:'"issuer" must be a string'},subject:{isValid:h,message:'"subject" must be a string'},jwtid:{isValid:h,message:'"jwtid" must be a string'},noTimestamp:{isValid:u,message:'"noTimestamp" must be a boolean'},keyid:{isValid:h,message:'"keyid" must be a string'},mutatePayload:{isValid:u,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:u,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:u,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}};const m={iat:{isValid:c,message:'"iat" should be a number of seconds'},exp:{isValid:c,message:'"exp" should be a number of seconds'},nbf:{isValid:c,message:'"nbf" should be a number of seconds'}};function validate(e,r,t,n){if(!f(t)){throw new Error('Expected "'+n+'" to be a plain object.')}Object.keys(t).forEach((function(a){const i=e[a];if(!i){if(!r){throw new Error('"'+a+'" is not allowed in "'+n+'"')}return}if(!i.isValid(t[a])){throw new Error(i.message)}}))}function validateOptions(e){return validate(b,false,e,"options")}function validatePayload(e){return validate(m,true,e,"payload")}const _={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"};const w=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];e.exports=function(e,r,t,a){if(typeof t==="function"){a=t;t={}}else{t=t||{}}const o=typeof e==="object"&&!Buffer.isBuffer(e);const u=Object.assign({alg:t.algorithm||"HS256",typ:o?"JWT":undefined,kid:t.keyid},t.header);function failure(e){if(a){return a(e)}throw e}if(!r&&t.algorithm!=="none"){return failure(new Error("secretOrPrivateKey must have a value"))}if(r!=null&&!(r instanceof d)){try{r=g(r)}catch(e){try{r=y(typeof r==="string"?Buffer.from(r):r)}catch(e){return failure(new Error("secretOrPrivateKey is not valid key material"))}}}if(u.alg.startsWith("HS")&&r.type!=="secret"){return failure(new Error(`secretOrPrivateKey must be a symmetric key when using ${u.alg}`))}else if(/^(?:RS|PS|ES)/.test(u.alg)){if(r.type!=="private"){return failure(new Error(`secretOrPrivateKey must be an asymmetric key when using ${u.alg}`))}if(!t.allowInsecureKeySizes&&!u.alg.startsWith("ES")&&r.asymmetricKeyDetails!==undefined&&r.asymmetricKeyDetails.modulusLength<2048){return failure(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`))}}if(typeof e==="undefined"){return failure(new Error("payload is required"))}else if(o){try{validatePayload(e)}catch(e){return failure(e)}if(!t.mutatePayload){e=Object.assign({},e)}}else{const r=w.filter((function(e){return typeof t[e]!=="undefined"}));if(r.length>0){return failure(new Error("invalid "+r.join(",")+" option for "+typeof e+" payload"))}}if(typeof e.exp!=="undefined"&&typeof t.expiresIn!=="undefined"){return failure(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'))}if(typeof e.nbf!=="undefined"&&typeof t.notBefore!=="undefined"){return failure(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'))}try{validateOptions(t)}catch(e){return failure(e)}if(!t.allowInvalidAsymmetricKeyTypes){try{i(u.alg,r)}catch(e){return failure(e)}}const l=e.iat||Math.floor(Date.now()/1e3);if(t.noTimestamp){delete e.iat}else if(o){e.iat=l}if(typeof t.notBefore!=="undefined"){try{e.nbf=n(t.notBefore,l)}catch(e){return failure(e)}if(typeof e.nbf==="undefined"){return failure(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}}if(typeof t.expiresIn!=="undefined"&&typeof e==="object"){try{e.exp=n(t.expiresIn,l)}catch(e){return failure(e)}if(typeof e.exp==="undefined"){return failure(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}}Object.keys(_).forEach((function(r){const n=_[r];if(typeof t[r]!=="undefined"){if(typeof e[n]!=="undefined"){return failure(new Error('Bad "options.'+r+'" option. The payload already has an "'+n+'" property.'))}e[n]=t[r]}}));const c=t.encoding||"utf8";if(typeof a==="function"){a=a&&p(a);s.createSign({header:u,privateKey:r,payload:e,encoding:c}).once("error",a).once("done",(function(e){if(!t.allowInsecureKeySizes&&/^(?:RS|PS)/.test(u.alg)&&e.length<256){return a(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`))}a(null,e)}))}else{let n=s.sign({header:u,payload:e,secret:r,encoding:c});if(!t.allowInsecureKeySizes&&/^(?:RS|PS)/.test(u.alg)&&n.length<256){throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`)}return n}}},624:(e,r,t)=>{const n=t(131);const a=t(422);const i=t(794);const s=t(443);const o=t(126);const u=t(253);const l=t(900);const c=t(111);const{KeyObject:f,createSecretKey:h,createPublicKey:p}=t(113);const d=["RS256","RS384","RS512"];const y=["ES256","ES384","ES512"];const g=["RS256","RS384","RS512"];const v=["HS256","HS384","HS512"];if(l){d.splice(d.length,0,"PS256","PS384","PS512");g.splice(g.length,0,"PS256","PS384","PS512")}e.exports=function(e,r,t,l){if(typeof t==="function"&&!l){l=t;t={}}if(!t){t={}}t=Object.assign({},t);let b;if(l){b=l}else{b=function(e,r){if(e)throw e;return r}}if(t.clockTimestamp&&typeof t.clockTimestamp!=="number"){return b(new n("clockTimestamp must be a number"))}if(t.nonce!==undefined&&(typeof t.nonce!=="string"||t.nonce.trim()==="")){return b(new n("nonce must be a non-empty string"))}if(t.allowInvalidAsymmetricKeyTypes!==undefined&&typeof t.allowInvalidAsymmetricKeyTypes!=="boolean"){return b(new n("allowInvalidAsymmetricKeyTypes must be a boolean"))}const m=t.clockTimestamp||Math.floor(Date.now()/1e3);if(!e){return b(new n("jwt must be provided"))}if(typeof e!=="string"){return b(new n("jwt must be a string"))}const _=e.split(".");if(_.length!==3){return b(new n("jwt malformed"))}let w;try{w=s(e,{complete:true})}catch(e){return b(e)}if(!w){return b(new n("invalid token"))}const S=w.header;let I;if(typeof r==="function"){if(!l){return b(new n("verify must be called asynchronous if secret or public key is provided as a callback"))}I=r}else{I=function(e,t){return t(null,r)}}return I(S,(function(r,s){if(r){return b(new n("error in secret or public key callback: "+r.message))}const l=_[2].trim()!=="";if(!l&&s){return b(new n("jwt signature is required"))}if(l&&!s){return b(new n("secret or public key must be provided"))}if(!l&&!t.algorithms){return b(new n('please specify "none" in "algorithms" to verify unsigned tokens'))}if(s!=null&&!(s instanceof f)){try{s=p(s)}catch(e){try{s=h(typeof s==="string"?Buffer.from(s):s)}catch(e){return b(new n("secretOrPublicKey is not valid key material"))}}}if(!t.algorithms){if(s.type==="secret"){t.algorithms=v}else if(["rsa","rsa-pss"].includes(s.asymmetricKeyType)){t.algorithms=g}else if(s.asymmetricKeyType==="ec"){t.algorithms=y}else{t.algorithms=d}}if(t.algorithms.indexOf(w.header.alg)===-1){return b(new n("invalid algorithm"))}if(S.alg.startsWith("HS")&&s.type!=="secret"){return b(new n(`secretOrPublicKey must be a symmetric key when using ${S.alg}`))}else if(/^(?:RS|PS|ES)/.test(S.alg)&&s.type!=="public"){return b(new n(`secretOrPublicKey must be an asymmetric key when using ${S.alg}`))}if(!t.allowInvalidAsymmetricKeyTypes){try{u(S.alg,s)}catch(e){return b(e)}}let I;try{I=c.verify(e,w.header.alg,s)}catch(e){return b(e)}if(!I){return b(new n("invalid signature"))}const A=w.payload;if(typeof A.nbf!=="undefined"&&!t.ignoreNotBefore){if(typeof A.nbf!=="number"){return b(new n("invalid nbf value"))}if(A.nbf>m+(t.clockTolerance||0)){return b(new a("jwt not active",new Date(A.nbf*1e3)))}}if(typeof A.exp!=="undefined"&&!t.ignoreExpiration){if(typeof A.exp!=="number"){return b(new n("invalid exp value"))}if(m>=A.exp+(t.clockTolerance||0)){return b(new i("jwt expired",new Date(A.exp*1e3)))}}if(t.audience){const e=Array.isArray(t.audience)?t.audience:[t.audience];const r=Array.isArray(A.aud)?A.aud:[A.aud];const a=r.some((function(r){return e.some((function(e){return e instanceof RegExp?e.test(r):e===r}))}));if(!a){return b(new n("jwt audience invalid. expected: "+e.join(" or ")))}}if(t.issuer){const e=typeof t.issuer==="string"&&A.iss!==t.issuer||Array.isArray(t.issuer)&&t.issuer.indexOf(A.iss)===-1;if(e){return b(new n("jwt issuer invalid. expected: "+t.issuer))}}if(t.subject){if(A.sub!==t.subject){return b(new n("jwt subject invalid. expected: "+t.subject))}}if(t.jwtid){if(A.jti!==t.jwtid){return b(new n("jwt jwtid invalid. expected: "+t.jwtid))}}if(t.nonce){if(A.nonce!==t.nonce){return b(new n("jwt nonce invalid. expected: "+t.nonce))}}if(t.maxAge){if(typeof A.iat!=="number"){return b(new n("iat required when maxAge is specified"))}const e=o(t.maxAge,A.iat);if(typeof e==="undefined"){return b(new n('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(m>=e+(t.clockTolerance||0)){return b(new i("maxAge exceeded",new Date(e*1e3)))}}if(t.complete===true){const e=w.signature;return b(null,{header:S,payload:A,signature:e})}return b(null,A)}))}},251:(e,r,t)=>{var n=t(112);var a=t(911).Buffer;var i=t(113);var s=t(160);var o=t(837);var u='"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".';var l="secret must be a string or buffer";var c="key must be a string or a buffer";var f="key must be a string, a buffer or an object";var h=typeof i.createPublicKey==="function";if(h){c+=" or a KeyObject";l+="or a KeyObject"}function checkIsPublicKey(e){if(a.isBuffer(e)){return}if(typeof e==="string"){return}if(!h){throw typeError(c)}if(typeof e!=="object"){throw typeError(c)}if(typeof e.type!=="string"){throw typeError(c)}if(typeof e.asymmetricKeyType!=="string"){throw typeError(c)}if(typeof e.export!=="function"){throw typeError(c)}}function checkIsPrivateKey(e){if(a.isBuffer(e)){return}if(typeof e==="string"){return}if(typeof e==="object"){return}throw typeError(f)}function checkIsSecretKey(e){if(a.isBuffer(e)){return}if(typeof e==="string"){return e}if(!h){throw typeError(l)}if(typeof e!=="object"){throw typeError(l)}if(e.type!=="secret"){throw typeError(l)}if(typeof e.export!=="function"){throw typeError(l)}}function fromBase64(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function toBase64(e){e=e.toString();var r=4-e.length%4;if(r!==4){for(var t=0;t{var n=t(409);var a=t(851);var i=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];r.ALGORITHMS=i;r.sign=n.sign;r.verify=a.verify;r.decode=a.decode;r.isValid=a.isValid;r.createSign=function createSign(e){return new n(e)};r.createVerify=function createVerify(e){return new a(e)}},626:(e,r,t)=>{var n=t(911).Buffer;var a=t(781);var i=t(837);function DataStream(e){this.buffer=null;this.writable=true;this.readable=true;if(!e){this.buffer=n.alloc(0);return this}if(typeof e.pipe==="function"){this.buffer=n.alloc(0);e.pipe(this);return this}if(e.length||typeof e==="object"){this.buffer=e;this.writable=false;process.nextTick(function(){this.emit("end",e);this.readable=false;this.emit("close")}.bind(this));return this}throw new TypeError("Unexpected data type ("+typeof e+")")}i.inherits(DataStream,a);DataStream.prototype.write=function write(e){this.buffer=n.concat([this.buffer,n.from(e)]);this.emit("data",e)};DataStream.prototype.end=function end(e){if(e)this.write(e);this.emit("end",e);this.emit("close");this.writable=false;this.readable=false};e.exports=DataStream},409:(e,r,t)=>{var n=t(911).Buffer;var a=t(626);var i=t(251);var s=t(781);var o=t(730);var u=t(837);function base64url(e,r){return n.from(e,r).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function jwsSecuredInput(e,r,t){t=t||"utf8";var n=base64url(o(e),"binary");var a=base64url(o(r),t);return u.format("%s.%s",n,a)}function jwsSign(e){var r=e.header;var t=e.payload;var n=e.secret||e.privateKey;var a=e.encoding;var s=i(r.alg);var o=jwsSecuredInput(r,t,a);var l=s.sign(o,n);return u.format("%s.%s",o,l)}function SignStream(e){var r=e.secret||e.privateKey||e.key;var t=new a(r);this.readable=true;this.header=e.header;this.encoding=e.encoding;this.secret=this.privateKey=this.key=t;this.payload=new a(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))}u.inherits(SignStream,s);SignStream.prototype.sign=function sign(){try{var e=jwsSign({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});this.emit("done",e);this.emit("data",e);this.emit("end");this.readable=false;return e}catch(e){this.readable=false;this.emit("error",e);this.emit("close")}};SignStream.sign=jwsSign;e.exports=SignStream},730:(e,r,t)=>{var n=t(300).Buffer;e.exports=function toString(e){if(typeof e==="string")return e;if(typeof e==="number"||n.isBuffer(e))return e.toString();return JSON.stringify(e)}},851:(e,r,t)=>{var n=t(911).Buffer;var a=t(626);var i=t(251);var s=t(781);var o=t(730);var u=t(837);var l=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function isObject(e){return Object.prototype.toString.call(e)==="[object Object]"}function safeJsonParse(e){if(isObject(e))return e;try{return JSON.parse(e)}catch(e){return undefined}}function headerFromJWS(e){var r=e.split(".",1)[0];return safeJsonParse(n.from(r,"base64").toString("binary"))}function securedInputFromJWS(e){return e.split(".",2).join(".")}function signatureFromJWS(e){return e.split(".")[2]}function payloadFromJWS(e,r){r=r||"utf8";var t=e.split(".")[1];return n.from(t,"base64").toString(r)}function isValidJws(e){return l.test(e)&&!!headerFromJWS(e)}function jwsVerify(e,r,t){if(!r){var n=new Error("Missing algorithm parameter for jws.verify");n.code="MISSING_ALGORITHM";throw n}e=o(e);var a=signatureFromJWS(e);var s=securedInputFromJWS(e);var u=i(r);return u.verify(s,a,t)}function jwsDecode(e,r){r=r||{};e=o(e);if(!isValidJws(e))return null;var t=headerFromJWS(e);if(!t)return null;var n=payloadFromJWS(e);if(t.typ==="JWT"||r.json)n=JSON.parse(n,r.encoding);return{header:t,payload:n,signature:signatureFromJWS(e)}}function VerifyStream(e){e=e||{};var r=e.secret||e.publicKey||e.key;var t=new a(r);this.readable=true;this.algorithm=e.algorithm;this.encoding=e.encoding;this.secret=this.publicKey=this.key=t;this.signature=new a(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))}u.inherits(VerifyStream,s);VerifyStream.prototype.verify=function verify(){try{var e=jwsVerify(this.signature.buffer,this.algorithm,this.key.buffer);var r=jwsDecode(this.signature.buffer,this.encoding);this.emit("done",e,r);this.emit("data",e);this.emit("end");this.readable=false;return e}catch(e){this.readable=false;this.emit("error",e);this.emit("close")}};VerifyStream.decode=jwsDecode;VerifyStream.isValid=isValidJws;VerifyStream.verify=jwsVerify;e.exports=VerifyStream},788:function(e,r,t){e=t.nmd(e); /** * @license * Lodash @@ -8,4 +8,4 @@ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */(function(){var t;var n="4.17.21";var a=200;var i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",o="Invalid `variable` option passed into `_.template`";var u="__lodash_hash_undefined__";var l=500;var c="__lodash_placeholder__";var f=1,h=2,p=4;var d=1,y=2;var g=1,v=2,b=4,m=8,_=16,w=32,S=64,I=128,A=256,x=512;var k=30,j="...";var O=800,E=16;var R=1,L=2,C=3;var T=1/0,W=9007199254740991,P=17976931348623157e292,z=0/0;var B=4294967295,F=B-1,M=B>>>1;var D=[["ary",I],["bind",g],["bindKey",v],["curry",m],["curryRight",_],["flip",x],["partial",w],["partialRight",S],["rearg",A]];var K="[object Arguments]",q="[object Array]",V="[object AsyncFunction]",U="[object Boolean]",N="[object Date]",H="[object DOMException]",G="[object Error]",$="[object Function]",J="[object GeneratorFunction]",Z="[object Map]",X="[object Number]",Y="[object Null]",Q="[object Object]",ee="[object Promise]",re="[object Proxy]",te="[object RegExp]",ne="[object Set]",ae="[object String]",ie="[object Symbol]",se="[object Undefined]",oe="[object WeakMap]",ue="[object WeakSet]";var le="[object ArrayBuffer]",ce="[object DataView]",fe="[object Float32Array]",he="[object Float64Array]",pe="[object Int8Array]",de="[object Int16Array]",ye="[object Int32Array]",ge="[object Uint8Array]",ve="[object Uint8ClampedArray]",be="[object Uint16Array]",me="[object Uint32Array]";var _e=/\b__p \+= '';/g,we=/\b(__p \+=) '' \+/g,Se=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var Ie=/&(?:amp|lt|gt|quot|#39);/g,Ae=/[&<>"']/g,xe=RegExp(Ie.source),ke=RegExp(Ae.source);var je=/<%-([\s\S]+?)%>/g,Oe=/<%([\s\S]+?)%>/g,Ee=/<%=([\s\S]+?)%>/g;var Re=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Le=/^\w*$/,Ce=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;var Te=/[\\^$.*+?()[\]{}|]/g,We=RegExp(Te.source);var Pe=/^\s+/;var ze=/\s/;var Be=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Fe=/\{\n\/\* \[wrapped with (.+)\] \*/,Me=/,? & /;var De=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var Ke=/[()=,{}\[\]\/\s]/;var qe=/\\(\\)?/g;var Ve=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var Ue=/\w*$/;var Ne=/^[-+]0x[0-9a-f]+$/i;var He=/^0b[01]+$/i;var Ge=/^\[object .+?Constructor\]$/;var $e=/^0o[0-7]+$/i;var Je=/^(?:0|[1-9]\d*)$/;var Ze=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;var Xe=/($^)/;var Ye=/['\n\r\u2028\u2029\\]/g;var Qe="\\ud800-\\udfff",er="\\u0300-\\u036f",rr="\\ufe20-\\ufe2f",tr="\\u20d0-\\u20ff",nr=er+rr+tr,ar="\\u2700-\\u27bf",ir="a-z\\xdf-\\xf6\\xf8-\\xff",sr="\\xac\\xb1\\xd7\\xf7",or="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ur="\\u2000-\\u206f",lr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",cr="A-Z\\xc0-\\xd6\\xd8-\\xde",fr="\\ufe0e\\ufe0f",hr=sr+or+ur+lr;var pr="['’]",dr="["+Qe+"]",yr="["+hr+"]",gr="["+nr+"]",vr="\\d+",br="["+ar+"]",mr="["+ir+"]",_r="[^"+Qe+hr+vr+ar+ir+cr+"]",wr="\\ud83c[\\udffb-\\udfff]",Sr="(?:"+gr+"|"+wr+")",Ir="[^"+Qe+"]",Ar="(?:\\ud83c[\\udde6-\\uddff]){2}",xr="[\\ud800-\\udbff][\\udc00-\\udfff]",kr="["+cr+"]",jr="\\u200d";var Or="(?:"+mr+"|"+_r+")",Er="(?:"+kr+"|"+_r+")",Rr="(?:"+pr+"(?:d|ll|m|re|s|t|ve))?",Lr="(?:"+pr+"(?:D|LL|M|RE|S|T|VE))?",Cr=Sr+"?",Tr="["+fr+"]?",Wr="(?:"+jr+"(?:"+[Ir,Ar,xr].join("|")+")"+Tr+Cr+")*",Pr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",zr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Br=Tr+Cr+Wr,Fr="(?:"+[br,Ar,xr].join("|")+")"+Br,Mr="(?:"+[Ir+gr+"?",gr,Ar,xr,dr].join("|")+")";var Dr=RegExp(pr,"g");var Kr=RegExp(gr,"g");var qr=RegExp(wr+"(?="+wr+")|"+Mr+Br,"g");var Vr=RegExp([kr+"?"+mr+"+"+Rr+"(?="+[yr,kr,"$"].join("|")+")",Er+"+"+Lr+"(?="+[yr,kr+Or,"$"].join("|")+")",kr+"?"+Or+"+"+Rr,kr+"+"+Lr,zr,Pr,vr,Fr].join("|"),"g");var Ur=RegExp("["+jr+Qe+nr+fr+"]");var Nr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var Hr=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"];var Gr=-1;var $r={};$r[fe]=$r[he]=$r[pe]=$r[de]=$r[ye]=$r[ge]=$r[ve]=$r[be]=$r[me]=true;$r[K]=$r[q]=$r[le]=$r[U]=$r[ce]=$r[N]=$r[G]=$r[$]=$r[Z]=$r[X]=$r[Q]=$r[te]=$r[ne]=$r[ae]=$r[oe]=false;var Jr={};Jr[K]=Jr[q]=Jr[le]=Jr[ce]=Jr[U]=Jr[N]=Jr[fe]=Jr[he]=Jr[pe]=Jr[de]=Jr[ye]=Jr[Z]=Jr[X]=Jr[Q]=Jr[te]=Jr[ne]=Jr[ae]=Jr[ie]=Jr[ge]=Jr[ve]=Jr[be]=Jr[me]=true;Jr[G]=Jr[$]=Jr[oe]=false;var Zr={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"};var Xr={"&":"&","<":"<",">":">",'"':""","'":"'"};var Yr={"&":"&","<":"<",">":">",""":'"',"'":"'"};var Qr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};var et=parseFloat,rt=parseInt;var tt=typeof global=="object"&&global&&global.Object===Object&&global;var nt=typeof self=="object"&&self&&self.Object===Object&&self;var at=tt||nt||Function("return this")();var it=true&&r&&!r.nodeType&&r;var st=it&&"object"=="object"&&e&&!e.nodeType&&e;var ot=st&&st.exports===it;var ut=ot&&tt.process;var lt=function(){try{var e=st&&st.require&&st.require("util").types;if(e){return e}return ut&&ut.binding&&ut.binding("util")}catch(e){}}();var ct=lt&<.isArrayBuffer,ft=lt&<.isDate,ht=lt&<.isMap,pt=lt&<.isRegExp,dt=lt&<.isSet,yt=lt&<.isTypedArray;function apply(e,r,t){switch(t.length){case 0:return e.call(r);case 1:return e.call(r,t[0]);case 2:return e.call(r,t[0],t[1]);case 3:return e.call(r,t[0],t[1],t[2])}return e.apply(r,t)}function arrayAggregator(e,r,t,n){var a=-1,i=e==null?0:e.length;while(++a-1}function arrayIncludesWith(e,r,t){var n=-1,a=e==null?0:e.length;while(++n-1){}return t}function charsEndIndex(e,r){var t=e.length;while(t--&&baseIndexOf(r,e[t],0)>-1){}return t}function countHolders(e,r){var t=e.length,n=0;while(t--){if(e[t]===r){++n}}return n}var vt=basePropertyOf(Zr);var bt=basePropertyOf(Xr);function escapeStringChar(e){return"\\"+Qr[e]}function getValue(e,r){return e==null?t:e[r]}function hasUnicode(e){return Ur.test(e)}function hasUnicodeWord(e){return Nr.test(e)}function iteratorToArray(e){var r,t=[];while(!(r=e.next()).done){t.push(r.value)}return t}function mapToArray(e){var r=-1,t=Array(e.size);e.forEach((function(e,n){t[++r]=[n,e]}));return t}function overArg(e,r){return function(t){return e(r(t))}}function replaceHolders(e,r){var t=-1,n=e.length,a=0,i=[];while(++t-1}function listCacheSet(e,r){var t=this.__data__,n=assocIndexOf(t,e);if(n<0){++this.size;t.push([e,r])}else{t[n][1]=r}return this}ListCache.prototype.clear=listCacheClear;ListCache.prototype["delete"]=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;function MapCache(e){var r=-1,t=e==null?0:e.length;this.clear();while(++r=r?e:r}}return e}function baseClone(e,r,n,a,i,s){var o,u=r&f,l=r&h,c=r&p;if(n){o=i?n(e,a,i,s):n(e)}if(o!==t){return o}if(!isObject(e)){return e}var d=Ln(e);if(d){o=initCloneArray(e);if(!u){return copyArray(e,o)}}else{var y=Dt(e),g=y==$||y==J;if(Tn(e)){return cloneBuffer(e,u)}if(y==Q||y==K||g&&!i){o=l||g?{}:initCloneObject(e);if(!u){return l?copySymbolsIn(e,baseAssignIn(o,e)):copySymbols(e,baseAssign(o,e))}}else{if(!Jr[y]){return i?e:{}}o=initCloneByTag(e,y,u)}}s||(s=new Stack);var v=s.get(e);if(v){return v}s.set(e,o);if(Bn(e)){e.forEach((function(t){o.add(baseClone(t,r,n,t,e,s))}))}else if(Pn(e)){e.forEach((function(t,a){o.set(a,baseClone(t,r,n,a,e,s))}))}var b=c?l?getAllKeysIn:getAllKeys:l?keysIn:keys;var m=d?t:b(e);arrayEach(m||e,(function(t,a){if(m){a=t;t=e[a]}assignValue(o,a,baseClone(t,r,n,a,e,s))}));return o}function baseConforms(e){var r=keys(e);return function(t){return baseConformsTo(t,e,r)}}function baseConformsTo(e,r,n){var a=n.length;if(e==null){return!a}e=rr(e);while(a--){var i=n[a],s=r[i],o=e[i];if(o===t&&!(i in e)||!s(o)){return false}}return true}function baseDelay(e,r,n){if(typeof e!="function"){throw new ar(s)}return Vt((function(){e.apply(t,n)}),r)}function baseDifference(e,r,t,n){var i=-1,s=arrayIncludes,o=true,u=e.length,l=[],c=r.length;if(!u){return l}if(t){r=arrayMap(r,baseUnary(t))}if(n){s=arrayIncludesWith;o=false}else if(r.length>=a){s=cacheHas;o=false;r=new SetCache(r)}e:while(++ii?0:i+n}a=a===t||a>i?i:toInteger(a);if(a<0){a+=i}a=n>a?0:toLength(a);while(n0&&t(o)){if(r>1){baseFlatten(o,r-1,t,n,a)}else{arrayPush(a,o)}}else if(!n){a[a.length]=o}}return a}var Rt=createBaseFor();var Lt=createBaseFor(true);function baseForOwn(e,r){return e&&Rt(e,r,keys)}function baseForOwnRight(e,r){return e&&Lt(e,r,keys)}function baseFunctions(e,r){return arrayFilter(r,(function(r){return isFunction(e[r])}))}function baseGet(e,r){r=castPath(r,e);var n=0,a=r.length;while(e!=null&&nr}function baseHas(e,r){return e!=null&&cr.call(e,r)}function baseHasIn(e,r){return e!=null&&r in rr(e)}function baseInRange(e,r,t){return e>=qr(r,t)&&e=120&&h.length>=120)?new SetCache(u&&h):t}h=e[0];var p=-1,d=l[0];e:while(++p-1){if(o!==e){Ar.call(o,u,1)}Ar.call(e,u,1)}}return e}function basePullAt(e,r){var t=e?r.length:0,n=t-1;while(t--){var a=r[t];if(t==n||a!==i){var i=a;if(isIndex(a)){Ar.call(e,a,1)}else{baseUnset(e,a)}}}return e}function baseRandom(e,r){return e+Tr(Nr()*(r-e+1))}function baseRange(e,t,n,a){var i=-1,s=Mr(Cr((t-e)/(n||1)),0),o=r(s);while(s--){o[a?s:++i]=e;e+=n}return o}function baseRepeat(e,r){var t="";if(!e||r<1||r>W){return t}do{if(r%2){t+=e}r=Tr(r/2);if(r){e+=e}}while(r);return t}function baseRest(e,r){return Ut(overRest(e,r,identity),e+"")}function baseSample(e){return arraySample(values(e))}function baseSampleSize(e,r){var t=values(e);return shuffleSelf(t,baseClamp(r,0,t.length))}function baseSet(e,r,n,a){if(!isObject(e)){return e}r=castPath(r,e);var i=-1,s=r.length,o=s-1,u=e;while(u!=null&&++ii?0:i+t}n=n>i?i:n;if(n<0){n+=i}i=t>n?0:n-t>>>0;t>>>=0;var s=r(i);while(++a>>1,s=e[i];if(s!==null&&!isSymbol(s)&&(t?s<=r:s=a){var c=r?null:zt(e);if(c){return setToArray(c)}o=false;i=cacheHas;l=new SetCache}else{l=r?[]:u}e:while(++n=a?e:baseSlice(e,r,n)}var Pt=Er||function(e){return at.clearTimeout(e)};function cloneBuffer(e,r){if(r){return e.slice()}var t=e.length,n=_r?_r(t):new e.constructor(t);e.copy(n);return n}function cloneArrayBuffer(e){var r=new e.constructor(e.byteLength);new mr(r).set(new mr(e));return r}function cloneDataView(e,r){var t=r?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}function cloneRegExp(e){var r=new e.constructor(e.source,Ue.exec(e));r.lastIndex=e.lastIndex;return r}function cloneSymbol(e){return xt?rr(xt.call(e)):{}}function cloneTypedArray(e,r){var t=r?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}function compareAscending(e,r){if(e!==r){var n=e!==t,a=e===null,i=e===e,s=isSymbol(e);var o=r!==t,u=r===null,l=r===r,c=isSymbol(r);if(!u&&!c&&!s&&e>r||s&&o&&l&&!u&&!c||a&&o&&l||!n&&l||!i){return 1}if(!a&&!s&&!c&&e=o){return u}var l=t[n];return u*(l=="desc"?-1:1)}}return e.index-r.index}function composeArgs(e,t,n,a){var i=-1,s=e.length,o=n.length,u=-1,l=t.length,c=Mr(s-o,0),f=r(l+c),h=!a;while(++u1?n[i-1]:t,o=i>2?n[2]:t;s=e.length>3&&typeof s=="function"?(i--,s):t;if(o&&isIterateeCall(n[0],n[1],o)){s=i<3?t:s;i=1}r=rr(r);while(++a-1?i[s?r[o]:o]:t}}function createFlow(e){return flatRest((function(r){var n=r.length,a=n,i=LodashWrapper.prototype.thru;if(e){r.reverse()}while(a--){var o=r[a];if(typeof o!="function"){throw new ar(s)}if(i&&!u&&getFuncName(o)=="wrapper"){var u=new LodashWrapper([],true)}}a=u?a:n;while(++a1){g.reverse()}if(h&&cu)){return false}var c=s.get(e);var f=s.get(r);if(c&&f){return c==r&&f==e}var h=-1,p=true,g=n&y?new SetCache:t;s.set(e,r);s.set(r,e);while(++h1?"& ":"")+r[n];r=r.join(t>2?", ":" ");return e.replace(Be,"{\n/* [wrapped with "+r+"] */\n")}function isFlattenable(e){return Ln(e)||Rn(e)||!!(xr&&e&&e[xr])}function isIndex(e,r){var t=typeof e;r=r==null?W:r;return!!r&&(t=="number"||t!="symbol"&&Je.test(e))&&(e>-1&&e%1==0&&e0){if(++r>=O){return arguments[0]}}else{r=0}return e.apply(t,arguments)}}function shuffleSelf(e,r){var n=-1,a=e.length,i=a-1;r=r===t?a:r;while(++n1?e[r-1]:t;n=typeof n=="function"?(e.pop(),n):t;return unzipWith(e,n)}));function chain(e){var r=lodash(e);r.__chain__=true;return r}function tap(e,r){r(e);return e}function thru(e,r){return r(e)}var cn=flatRest((function(e){var r=e.length,n=r?e[0]:0,a=this.__wrapped__,interceptor=function(r){return baseAt(r,e)};if(r>1||this.__actions__.length||!(a instanceof LazyWrapper)||!isIndex(n)){return this.thru(interceptor)}a=a.slice(n,+n+(r?1:0));a.__actions__.push({func:thru,args:[interceptor],thisArg:t});return new LodashWrapper(a,this.__chain__).thru((function(e){if(r&&!e.length){e.push(t)}return e}))}));function wrapperChain(){return chain(this)}function wrapperCommit(){return new LodashWrapper(this.value(),this.__chain__)}function wrapperNext(){if(this.__values__===t){this.__values__=toArray(this.value())}var e=this.__index__>=this.__values__.length,r=e?t:this.__values__[this.__index__++];return{done:e,value:r}}function wrapperToIterator(){return this}function wrapperPlant(e){var r,n=this;while(n instanceof baseLodash){var a=wrapperClone(n);a.__index__=0;a.__values__=t;if(r){i.__wrapped__=a}else{r=a}var i=a;n=n.__wrapped__}i.__wrapped__=e;return r}function wrapperReverse(){var e=this.__wrapped__;if(e instanceof LazyWrapper){var r=e;if(this.__actions__.length){r=new LazyWrapper(this)}r=r.reverse();r.__actions__.push({func:thru,args:[reverse],thisArg:t});return new LodashWrapper(r,this.__chain__)}return this.thru(reverse)}function wrapperValue(){return baseWrapperValue(this.__wrapped__,this.__actions__)}var fn=createAggregator((function(e,r,t){if(cr.call(e,t)){++e[t]}else{baseAssignValue(e,t,1)}}));function every(e,r,n){var a=Ln(e)?arrayEvery:baseEvery;if(n&&isIterateeCall(e,r,n)){r=t}return a(e,getIteratee(r,3))}function filter(e,r){var t=Ln(e)?arrayFilter:baseFilter;return t(e,getIteratee(r,3))}var hn=createFind(findIndex);var pn=createFind(findLastIndex);function flatMap(e,r){return baseFlatten(map(e,r),1)}function flatMapDeep(e,r){return baseFlatten(map(e,r),T)}function flatMapDepth(e,r,n){n=n===t?1:toInteger(n);return baseFlatten(map(e,r),n)}function forEach(e,r){var t=Ln(e)?arrayEach:Ot;return t(e,getIteratee(r,3))}function forEachRight(e,r){var t=Ln(e)?arrayEachRight:Et;return t(e,getIteratee(r,3))}var dn=createAggregator((function(e,r,t){if(cr.call(e,t)){e[t].push(r)}else{baseAssignValue(e,t,[r])}}));function includes(e,r,t,n){e=isArrayLike(e)?e:values(e);t=t&&!n?toInteger(t):0;var a=e.length;if(t<0){t=Mr(a+t,0)}return isString(e)?t<=a&&e.indexOf(r,t)>-1:!!a&&baseIndexOf(e,r,t)>-1}var yn=baseRest((function(e,t,n){var a=-1,i=typeof t=="function",s=isArrayLike(e)?r(e.length):[];Ot(e,(function(e){s[++a]=i?apply(t,e,n):baseInvoke(e,t,n)}));return s}));var gn=createAggregator((function(e,r,t){baseAssignValue(e,t,r)}));function map(e,r){var t=Ln(e)?arrayMap:baseMap;return t(e,getIteratee(r,3))}function orderBy(e,r,n,a){if(e==null){return[]}if(!Ln(r)){r=r==null?[]:[r]}n=a?t:n;if(!Ln(n)){n=n==null?[]:[n]}return baseOrderBy(e,r,n)}var vn=createAggregator((function(e,r,t){e[t?0:1].push(r)}),(function(){return[[],[]]}));function reduce(e,r,t){var n=Ln(e)?arrayReduce:baseReduce,a=arguments.length<3;return n(e,getIteratee(r,4),t,a,Ot)}function reduceRight(e,r,t){var n=Ln(e)?arrayReduceRight:baseReduce,a=arguments.length<3;return n(e,getIteratee(r,4),t,a,Et)}function reject(e,r){var t=Ln(e)?arrayFilter:baseFilter;return t(e,negate(getIteratee(r,3)))}function sample(e){var r=Ln(e)?arraySample:baseSample;return r(e)}function sampleSize(e,r,n){if(n?isIterateeCall(e,r,n):r===t){r=1}else{r=toInteger(r)}var a=Ln(e)?arraySampleSize:baseSampleSize;return a(e,r)}function shuffle(e){var r=Ln(e)?arrayShuffle:baseShuffle;return r(e)}function size(e){if(e==null){return 0}if(isArrayLike(e)){return isString(e)?stringSize(e):e.length}var r=Dt(e);if(r==Z||r==ne){return e.size}return baseKeys(e).length}function some(e,r,n){var a=Ln(e)?arraySome:baseSome;if(n&&isIterateeCall(e,r,n)){r=t}return a(e,getIteratee(r,3))}var bn=baseRest((function(e,r){if(e==null){return[]}var t=r.length;if(t>1&&isIterateeCall(e,r[0],r[1])){r=[]}else if(t>2&&isIterateeCall(r[0],r[1],r[2])){r=[r[0]]}return baseOrderBy(e,baseFlatten(r,1),[])}));var mn=Rr||function(){return at.Date.now()};function after(e,r){if(typeof r!="function"){throw new ar(s)}e=toInteger(e);return function(){if(--e<1){return r.apply(this,arguments)}}}function ary(e,r,n){r=n?t:r;r=e&&r==null?e.length:r;return createWrap(e,I,t,t,t,t,r)}function before(e,r){var n;if(typeof r!="function"){throw new ar(s)}e=toInteger(e);return function(){if(--e>0){n=r.apply(this,arguments)}if(e<=1){r=t}return n}}var _n=baseRest((function(e,r,t){var n=g;if(t.length){var a=replaceHolders(t,getHolder(_n));n|=w}return createWrap(e,n,r,t,a)}));var wn=baseRest((function(e,r,t){var n=g|v;if(t.length){var a=replaceHolders(t,getHolder(wn));n|=w}return createWrap(r,n,e,t,a)}));function curry(e,r,n){r=n?t:r;var a=createWrap(e,m,t,t,t,t,t,r);a.placeholder=curry.placeholder;return a}function curryRight(e,r,n){r=n?t:r;var a=createWrap(e,_,t,t,t,t,t,r);a.placeholder=curryRight.placeholder;return a}function debounce(e,r,n){var a,i,o,u,l,c,f=0,h=false,p=false,d=true;if(typeof e!="function"){throw new ar(s)}r=toNumber(r)||0;if(isObject(n)){h=!!n.leading;p="maxWait"in n;o=p?Mr(toNumber(n.maxWait)||0,r):o;d="trailing"in n?!!n.trailing:d}function invokeFunc(r){var n=a,s=i;a=i=t;f=r;u=e.apply(s,n);return u}function leadingEdge(e){f=e;l=Vt(timerExpired,r);return h?invokeFunc(e):u}function remainingWait(e){var t=e-c,n=e-f,a=r-t;return p?qr(a,o-n):a}function shouldInvoke(e){var n=e-c,a=e-f;return c===t||n>=r||n<0||p&&a>=o}function timerExpired(){var e=mn();if(shouldInvoke(e)){return trailingEdge(e)}l=Vt(timerExpired,remainingWait(e))}function trailingEdge(e){l=t;if(d&&a){return invokeFunc(e)}a=i=t;return u}function cancel(){if(l!==t){Pt(l)}f=0;a=c=i=l=t}function flush(){return l===t?u:trailingEdge(mn())}function debounced(){var e=mn(),n=shouldInvoke(e);a=arguments;i=this;c=e;if(n){if(l===t){return leadingEdge(c)}if(p){Pt(l);l=Vt(timerExpired,r);return invokeFunc(c)}}if(l===t){l=Vt(timerExpired,r)}return u}debounced.cancel=cancel;debounced.flush=flush;return debounced}var Sn=baseRest((function(e,r){return baseDelay(e,1,r)}));var In=baseRest((function(e,r,t){return baseDelay(e,toNumber(r)||0,t)}));function flip(e){return createWrap(e,x)}function memoize(e,r){if(typeof e!="function"||r!=null&&typeof r!="function"){throw new ar(s)}var memoized=function(){var t=arguments,n=r?r.apply(this,t):t[0],a=memoized.cache;if(a.has(n)){return a.get(n)}var i=e.apply(this,t);memoized.cache=a.set(n,i)||a;return i};memoized.cache=new(memoize.Cache||MapCache);return memoized}memoize.Cache=MapCache;function negate(e){if(typeof e!="function"){throw new ar(s)}return function(){var r=arguments;switch(r.length){case 0:return!e.call(this);case 1:return!e.call(this,r[0]);case 2:return!e.call(this,r[0],r[1]);case 3:return!e.call(this,r[0],r[1],r[2])}return!e.apply(this,r)}}function once(e){return before(2,e)}var An=Wt((function(e,r){r=r.length==1&&Ln(r[0])?arrayMap(r[0],baseUnary(getIteratee())):arrayMap(baseFlatten(r,1),baseUnary(getIteratee()));var t=r.length;return baseRest((function(n){var a=-1,i=qr(n.length,t);while(++a=r}));var Rn=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike(e)&&cr.call(e,"callee")&&!Ir.call(e,"callee")};var Ln=r.isArray;var Cn=ct?baseUnary(ct):baseIsArrayBuffer;function isArrayLike(e){return e!=null&&isLength(e.length)&&!isFunction(e)}function isArrayLikeObject(e){return isObjectLike(e)&&isArrayLike(e)}function isBoolean(e){return e===true||e===false||isObjectLike(e)&&baseGetTag(e)==U}var Tn=Pr||stubFalse;var Wn=ft?baseUnary(ft):baseIsDate;function isElement(e){return isObjectLike(e)&&e.nodeType===1&&!isPlainObject(e)}function isEmpty(e){if(e==null){return true}if(isArrayLike(e)&&(Ln(e)||typeof e=="string"||typeof e.splice=="function"||Tn(e)||Fn(e)||Rn(e))){return!e.length}var r=Dt(e);if(r==Z||r==ne){return!e.size}if(isPrototype(e)){return!baseKeys(e).length}for(var t in e){if(cr.call(e,t)){return false}}return true}function isEqual(e,r){return baseIsEqual(e,r)}function isEqualWith(e,r,n){n=typeof n=="function"?n:t;var a=n?n(e,r):t;return a===t?baseIsEqual(e,r,t,n):!!a}function isError(e){if(!isObjectLike(e)){return false}var r=baseGetTag(e);return r==G||r==H||typeof e.message=="string"&&typeof e.name=="string"&&!isPlainObject(e)}function isFinite(e){return typeof e=="number"&&zr(e)}function isFunction(e){if(!isObject(e)){return false}var r=baseGetTag(e);return r==$||r==J||r==V||r==re}function isInteger(e){return typeof e=="number"&&e==toInteger(e)}function isLength(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=W}function isObject(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}function isObjectLike(e){return e!=null&&typeof e=="object"}var Pn=ht?baseUnary(ht):baseIsMap;function isMatch(e,r){return e===r||baseIsMatch(e,r,getMatchData(r))}function isMatchWith(e,r,n){n=typeof n=="function"?n:t;return baseIsMatch(e,r,getMatchData(r),n)}function isNaN(e){return isNumber(e)&&e!=+e}function isNative(e){if(Kt(e)){throw new De(i)}return baseIsNative(e)}function isNull(e){return e===null}function isNil(e){return e==null}function isNumber(e){return typeof e=="number"||isObjectLike(e)&&baseGetTag(e)==X}function isPlainObject(e){if(!isObjectLike(e)||baseGetTag(e)!=Q){return false}var r=wr(e);if(r===null){return true}var t=cr.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&lr.call(t)==dr}var zn=pt?baseUnary(pt):baseIsRegExp;function isSafeInteger(e){return isInteger(e)&&e>=-W&&e<=W}var Bn=dt?baseUnary(dt):baseIsSet;function isString(e){return typeof e=="string"||!Ln(e)&&isObjectLike(e)&&baseGetTag(e)==ae}function isSymbol(e){return typeof e=="symbol"||isObjectLike(e)&&baseGetTag(e)==ie}var Fn=yt?baseUnary(yt):baseIsTypedArray;function isUndefined(e){return e===t}function isWeakMap(e){return isObjectLike(e)&&Dt(e)==oe}function isWeakSet(e){return isObjectLike(e)&&baseGetTag(e)==ue}var Mn=createRelationalOperation(baseLt);var Dn=createRelationalOperation((function(e,r){return e<=r}));function toArray(e){if(!e){return[]}if(isArrayLike(e)){return isString(e)?stringToArray(e):copyArray(e)}if(kr&&e[kr]){return iteratorToArray(e[kr]())}var r=Dt(e),t=r==Z?mapToArray:r==ne?setToArray:values;return t(e)}function toFinite(e){if(!e){return e===0?e:0}e=toNumber(e);if(e===T||e===-T){var r=e<0?-1:1;return r*P}return e===e?e:0}function toInteger(e){var r=toFinite(e),t=r%1;return r===r?t?r-t:r:0}function toLength(e){return e?baseClamp(toInteger(e),0,B):0}function toNumber(e){if(typeof e=="number"){return e}if(isSymbol(e)){return z}if(isObject(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=isObject(r)?r+"":r}if(typeof e!="string"){return e===0?e:+e}e=baseTrim(e);var t=He.test(e);return t||$e.test(e)?rt(e.slice(2),t?2:8):Ne.test(e)?z:+e}function toPlainObject(e){return copyObject(e,keysIn(e))}function toSafeInteger(e){return e?baseClamp(toInteger(e),-W,W):e===0?e:0}function toString(e){return e==null?"":baseToString(e)}var Kn=createAssigner((function(e,r){if(isPrototype(r)||isArrayLike(r)){copyObject(r,keys(r),e);return}for(var t in r){if(cr.call(r,t)){assignValue(e,t,r[t])}}}));var qn=createAssigner((function(e,r){copyObject(r,keysIn(r),e)}));var Vn=createAssigner((function(e,r,t,n){copyObject(r,keysIn(r),e,n)}));var Un=createAssigner((function(e,r,t,n){copyObject(r,keys(r),e,n)}));var Nn=flatRest(baseAt);function create(e,r){var t=jt(e);return r==null?t:baseAssign(t,r)}var Hn=baseRest((function(e,r){e=rr(e);var n=-1;var a=r.length;var i=a>2?r[2]:t;if(i&&isIterateeCall(r[0],r[1],i)){a=1}while(++n1);return r}));copyObject(e,getAllKeysIn(e),t);if(n){t=baseClone(t,f|h|p,customOmitClone)}var a=r.length;while(a--){baseUnset(t,r[a])}return t}));function omitBy(e,r){return pickBy(e,negate(getIteratee(r)))}var ea=flatRest((function(e,r){return e==null?{}:basePick(e,r)}));function pickBy(e,r){if(e==null){return{}}var t=arrayMap(getAllKeysIn(e),(function(e){return[e]}));r=getIteratee(r);return basePickBy(e,t,(function(e,t){return r(e,t[0])}))}function result(e,r,n){r=castPath(r,e);var a=-1,i=r.length;if(!i){i=1;e=t}while(++ar){var a=e;e=r;r=a}if(n||e%1||r%1){var i=Nr();return qr(e+i*(r-e+et("1e-"+((i+"").length-1))),r)}return baseRandom(e,r)}var na=createCompounder((function(e,r,t){r=r.toLowerCase();return e+(t?capitalize(r):r)}));function capitalize(e){return ca(toString(e).toLowerCase())}function deburr(e){e=toString(e);return e&&e.replace(Ze,vt).replace(Kr,"")}function endsWith(e,r,n){e=toString(e);r=baseToString(r);var a=e.length;n=n===t?a:baseClamp(toInteger(n),0,a);var i=n;n-=r.length;return n>=0&&e.slice(n,i)==r}function escape(e){e=toString(e);return e&&ke.test(e)?e.replace(Ae,bt):e}function escapeRegExp(e){e=toString(e);return e&&We.test(e)?e.replace(Te,"\\$&"):e}var aa=createCompounder((function(e,r,t){return e+(t?"-":"")+r.toLowerCase()}));var ia=createCompounder((function(e,r,t){return e+(t?" ":"")+r.toLowerCase()}));var sa=createCaseFirst("toLowerCase");function pad(e,r,t){e=toString(e);r=toInteger(r);var n=r?stringSize(e):0;if(!r||n>=r){return e}var a=(r-n)/2;return createPadding(Tr(a),t)+e+createPadding(Cr(a),t)}function padEnd(e,r,t){e=toString(e);r=toInteger(r);var n=r?stringSize(e):0;return r&&n>>0;if(!n){return[]}e=toString(e);if(e&&(typeof r=="string"||r!=null&&!zn(r))){r=baseToString(r);if(!r&&hasUnicode(e)){return castSlice(stringToArray(e),0,n)}}return e.split(r,n)}var ua=createCompounder((function(e,r,t){return e+(t?" ":"")+ca(r)}));function startsWith(e,r,t){e=toString(e);t=t==null?0:baseClamp(toInteger(t),0,e.length);r=baseToString(r);return e.slice(t,t+r.length)==r}function template(e,r,n){var a=lodash.templateSettings;if(n&&isIterateeCall(e,r,n)){r=t}e=toString(e);r=Vn({},r,a,customDefaultsAssignIn);var i=Vn({},r.imports,a.imports,customDefaultsAssignIn),s=keys(i),u=baseValues(i,s);var l,c,f=0,h=r.interpolate||Xe,p="__p += '";var d=tr((r.escape||Xe).source+"|"+h.source+"|"+(h===Ee?Ve:Xe).source+"|"+(r.evaluate||Xe).source+"|$","g");var y="//# sourceURL="+(cr.call(r,"sourceURL")?(r.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Gr+"]")+"\n";e.replace(d,(function(r,t,n,a,i,s){n||(n=a);p+=e.slice(f,s).replace(Ye,escapeStringChar);if(t){l=true;p+="' +\n__e("+t+") +\n'"}if(i){c=true;p+="';\n"+i+";\n__p += '"}if(n){p+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"}f=s+r.length;return r}));p+="';\n";var g=cr.call(r,"variable")&&r.variable;if(!g){p="with (obj) {\n"+p+"\n}\n"}else if(Ke.test(g)){throw new De(o)}p=(c?p.replace(_e,""):p).replace(we,"$1").replace(Se,"$1;");p="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(l?", __e = _.escape":"")+(c?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var v=fa((function(){return Qe(s,y+"return "+p).apply(t,u)}));v.source=p;if(isError(v)){throw v}return v}function toLower(e){return toString(e).toLowerCase()}function toUpper(e){return toString(e).toUpperCase()}function trim(e,r,n){e=toString(e);if(e&&(n||r===t)){return baseTrim(e)}if(!e||!(r=baseToString(r))){return e}var a=stringToArray(e),i=stringToArray(r),s=charsStartIndex(a,i),o=charsEndIndex(a,i)+1;return castSlice(a,s,o).join("")}function trimEnd(e,r,n){e=toString(e);if(e&&(n||r===t)){return e.slice(0,trimmedEndIndex(e)+1)}if(!e||!(r=baseToString(r))){return e}var a=stringToArray(e),i=charsEndIndex(a,stringToArray(r))+1;return castSlice(a,0,i).join("")}function trimStart(e,r,n){e=toString(e);if(e&&(n||r===t)){return e.replace(Pe,"")}if(!e||!(r=baseToString(r))){return e}var a=stringToArray(e),i=charsStartIndex(a,stringToArray(r));return castSlice(a,i).join("")}function truncate(e,r){var n=k,a=j;if(isObject(r)){var i="separator"in r?r.separator:i;n="length"in r?toInteger(r.length):n;a="omission"in r?baseToString(r.omission):a}e=toString(e);var s=e.length;if(hasUnicode(e)){var o=stringToArray(e);s=o.length}if(n>=s){return e}var u=n-stringSize(a);if(u<1){return a}var l=o?castSlice(o,0,u).join(""):e.slice(0,u);if(i===t){return l+a}if(o){u+=l.length-u}if(zn(i)){if(e.slice(u).search(i)){var c,f=l;if(!i.global){i=tr(i.source,toString(Ue.exec(i))+"g")}i.lastIndex=0;while(c=i.exec(f)){var h=c.index}l=l.slice(0,h===t?u:h)}}else if(e.indexOf(baseToString(i),u)!=u){var p=l.lastIndexOf(i);if(p>-1){l=l.slice(0,p)}}return l+a}function unescape(e){e=toString(e);return e&&xe.test(e)?e.replace(Ie,mt):e}var la=createCompounder((function(e,r,t){return e+(t?" ":"")+r.toUpperCase()}));var ca=createCaseFirst("toUpperCase");function words(e,r,n){e=toString(e);r=n?t:r;if(r===t){return hasUnicodeWord(e)?unicodeWords(e):asciiWords(e)}return e.match(r)||[]}var fa=baseRest((function(e,r){try{return apply(e,t,r)}catch(e){return isError(e)?e:new De(e)}}));var ha=flatRest((function(e,r){arrayEach(r,(function(r){r=toKey(r);baseAssignValue(e,r,_n(e[r],e))}));return e}));function cond(e){var r=e==null?0:e.length,t=getIteratee();e=!r?[]:arrayMap(e,(function(e){if(typeof e[1]!="function"){throw new ar(s)}return[t(e[0]),e[1]]}));return baseRest((function(t){var n=-1;while(++nW){return[]}var t=B,n=qr(e,B);r=getIteratee(r);e-=B;var a=baseTimes(n,r);while(++t0||r<0)){return new LazyWrapper(n)}if(e<0){n=n.takeRight(-e)}else if(e){n=n.drop(e)}if(r!==t){r=toInteger(r);n=r<0?n.dropRight(-r):n.take(r-e)}return n};LazyWrapper.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()};LazyWrapper.prototype.toArray=function(){return this.take(B)};baseForOwn(LazyWrapper.prototype,(function(e,r){var n=/^(?:filter|find|map|reject)|While$/.test(r),a=/^(?:head|last)$/.test(r),i=lodash[a?"take"+(r=="last"?"Right":""):r],s=a||/^find/.test(r);if(!i){return}lodash.prototype[r]=function(){var r=this.__wrapped__,o=a?[1]:arguments,u=r instanceof LazyWrapper,l=o[0],c=u||Ln(r);var interceptor=function(e){var r=i.apply(lodash,arrayPush([e],o));return a&&f?r[0]:r};if(c&&n&&typeof l=="function"&&l.length!=1){u=c=false}var f=this.__chain__,h=!!this.__actions__.length,p=s&&!f,d=u&&!h;if(!s&&c){r=d?r:new LazyWrapper(this);var y=e.apply(r,o);y.__actions__.push({func:thru,args:[interceptor],thisArg:t});return new LodashWrapper(y,f)}if(p&&d){return e.apply(this,o)}y=this.thru(interceptor);return p?a?y.value()[0]:y.value():y}}));arrayEach(["pop","push","shift","sort","splice","unshift"],(function(e){var r=ir[e],t=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);lodash.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var a=this.value();return r.apply(Ln(a)?a:[],e)}return this[t]((function(t){return r.apply(Ln(t)?t:[],e)}))}}));baseForOwn(LazyWrapper.prototype,(function(e,r){var t=lodash[r];if(t){var n=t.name+"";if(!cr.call(ut,n)){ut[n]=[]}ut[n].push({name:r,func:t})}}));ut[createHybrid(t,v).name]=[{name:"wrapper",func:t}];LazyWrapper.prototype.clone=lazyClone;LazyWrapper.prototype.reverse=lazyReverse;LazyWrapper.prototype.value=lazyValue;lodash.prototype.at=cn;lodash.prototype.chain=wrapperChain;lodash.prototype.commit=wrapperCommit;lodash.prototype.next=wrapperNext;lodash.prototype.plant=wrapperPlant;lodash.prototype.reverse=wrapperReverse;lodash.prototype.toJSON=lodash.prototype.valueOf=lodash.prototype.value=wrapperValue;lodash.prototype.first=lodash.prototype.head;if(kr){lodash.prototype[kr]=wrapperToIterator}return lodash};var wt=_t();if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){at._=wt;define((function(){return wt}))}else if(st){(st.exports=wt)._=wt;it._=wt}else{at._=wt}}).call(this)},958:e=>{var r=1e3;var t=r*60;var n=t*60;var a=n*24;var i=a*7;var s=a*365.25;e.exports=function(e,r){r=r||{};var t=typeof e;if(t==="string"&&e.length>0){return parse(e)}else if(t==="number"&&isFinite(e)){return r.long?fmtLong(e):fmtShort(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){e=String(e);if(e.length>100){return}var o=/^(-?(?:\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(!o){return}var u=parseFloat(o[1]);var l=(o[2]||"ms").toLowerCase();switch(l){case"years":case"year":case"yrs":case"yr":case"y":return u*s;case"weeks":case"week":case"w":return u*i;case"days":case"day":case"d":return u*a;case"hours":case"hour":case"hrs":case"hr":case"h":return u*n;case"minutes":case"minute":case"mins":case"min":case"m":return u*t;case"seconds":case"second":case"secs":case"sec":case"s":return u*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return undefined}}function fmtShort(e){var i=Math.abs(e);if(i>=a){return Math.round(e/a)+"d"}if(i>=n){return Math.round(e/n)+"h"}if(i>=t){return Math.round(e/t)+"m"}if(i>=r){return Math.round(e/r)+"s"}return e+"ms"}function fmtLong(e){var i=Math.abs(e);if(i>=a){return plural(e,i,a,"day")}if(i>=n){return plural(e,i,n,"hour")}if(i>=t){return plural(e,i,t,"minute")}if(i>=r){return plural(e,i,r,"second")}return e+" ms"}function plural(e,r,t,n){var a=r>=t*1.5;return Math.round(e/t)+" "+n+(a?"s":"")}},911:(e,r,t)=>{ /*! safe-buffer. MIT License. Feross Aboukhadijeh */ -var n=t(300);var a=n.Buffer;function copyProps(e,r){for(var t in e){r[t]=e[t]}}if(a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow){e.exports=n}else{copyProps(n,r);r.Buffer=SafeBuffer}function SafeBuffer(e,r,t){return a(e,r,t)}SafeBuffer.prototype=Object.create(a.prototype);copyProps(a,SafeBuffer);SafeBuffer.from=function(e,r,t){if(typeof e==="number"){throw new TypeError("Argument must not be a number")}return a(e,r,t)};SafeBuffer.alloc=function(e,r,t){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}var n=a(e);if(r!==undefined){if(typeof t==="string"){n.fill(r,t)}else{n.fill(r)}}else{n.fill(0)}return n};SafeBuffer.allocUnsafe=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return a(e)};SafeBuffer.allocUnsafeSlow=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return n.SlowBuffer(e)}},300:e=>{"use strict";e.exports=require("buffer")},113:e=>{"use strict";e.exports=require("crypto")},849:e=>{"use strict";e.exports=require("next/dist/compiled/semver")},781:e=>{"use strict";e.exports=require("stream")},837:e=>{"use strict";e.exports=require("util")}};var r={};function __nccwpck_require__(t){var n=r[t];if(n!==undefined){return n.exports}var a=r[t]={id:t,loaded:false,exports:{}};var i=true;try{e[t].call(a.exports,a,a.exports,__nccwpck_require__);i=false}finally{if(i)delete r[t]}a.loaded=true;return a.exports}(()=>{__nccwpck_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var t=__nccwpck_require__(773);module.exports=t})(); \ No newline at end of file +var n=t(300);var a=n.Buffer;function copyProps(e,r){for(var t in e){r[t]=e[t]}}if(a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow){e.exports=n}else{copyProps(n,r);r.Buffer=SafeBuffer}function SafeBuffer(e,r,t){return a(e,r,t)}SafeBuffer.prototype=Object.create(a.prototype);copyProps(a,SafeBuffer);SafeBuffer.from=function(e,r,t){if(typeof e==="number"){throw new TypeError("Argument must not be a number")}return a(e,r,t)};SafeBuffer.alloc=function(e,r,t){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}var n=a(e);if(r!==undefined){if(typeof t==="string"){n.fill(r,t)}else{n.fill(r)}}else{n.fill(0)}return n};SafeBuffer.allocUnsafe=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return a(e)};SafeBuffer.allocUnsafeSlow=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return n.SlowBuffer(e)}},300:e=>{"use strict";e.exports=require("buffer")},113:e=>{"use strict";e.exports=require("crypto")},521:e=>{"use strict";e.exports=require("next/dist/lib/semver-noop")},781:e=>{"use strict";e.exports=require("stream")},837:e=>{"use strict";e.exports=require("util")}};var r={};function __nccwpck_require__(t){var n=r[t];if(n!==undefined){return n.exports}var a=r[t]={id:t,loaded:false,exports:{}};var i=true;try{e[t].call(a.exports,a,a.exports,__nccwpck_require__);i=false}finally{if(i)delete r[t]}a.loaded=true;return a.exports}(()=>{__nccwpck_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var t=__nccwpck_require__(773);module.exports=t})(); \ No newline at end of file diff --git a/packages/next/src/lib/semver-noop.ts b/packages/next/src/lib/semver-noop.ts new file mode 100644 index 0000000000000..a9983d7ee5812 --- /dev/null +++ b/packages/next/src/lib/semver-noop.ts @@ -0,0 +1,7 @@ +// DO NOT MODIFY THIS FILE DIRECTLY +// It's for aliasing the `semver` package to be a noop for the `jsonwebtoken` package. +// We're trying to minimize the size of the worker bundle. + +export function satisfies() { + return true +} diff --git a/packages/next/taskfile.js b/packages/next/taskfile.js index 2cfe1549130a5..62d73669c09b2 100644 --- a/packages/next/taskfile.js +++ b/packages/next/taskfile.js @@ -1390,7 +1390,13 @@ externals['jsonwebtoken'] = 'next/dist/compiled/jsonwebtoken' export async function ncc_jsonwebtoken(task, opts) { await task .source(relative(__dirname, require.resolve('jsonwebtoken'))) - .ncc({ packageName: 'jsonwebtoken', externals }) + .ncc({ + packageName: 'jsonwebtoken', + externals: { + ...externals, + semver: 'next/dist/lib/semver-noop', + }, + }) .target('src/compiled/jsonwebtoken') } // eslint-disable-next-line camelcase