UNPKG

next

Version:

The React Framework

9 lines 121 kB
(()=>{var e={775:(e,r,t)=>{"use strict";var n=t(181).Buffer;var a=t(181).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<e.length;a++){t|=e[a]^r[a]}return t===0}bufferEq.install=function(){n.prototype.equal=a.prototype.equal=function equal(e){return bufferEq(this,e)}};var i=n.prototype.equal;var s=a.prototype.equal;bufferEq.restore=function(){n.prototype.equal=i;a.prototype.equal=s}},210:(e,r,t)=>{"use strict";var n=t(725).Buffer;var a=t(335);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<l){throw new Error('"seq" specified length of "'+l+'", only "'+(o-u)+'" remaining')}if(e[u++]!==f){throw new Error('Could not find expected "int" for "r"')}var h=e[u++];if(o-u-2<h){throw new Error('"r" specified length of "'+h+'", only "'+(o-u-2)+'" available')}if(s<h){throw new Error('"r" specified length of "'+h+'", max of "'+s+'" is acceptable')}var p=u;u+=h;if(e[u++]!==f){throw new Error('Could not find expected "int" for "s"')}var d=e[u++];if(o-u!==d){throw new Error('"s" specified length of "'+d+'", expected "'+(o-u)+'"')}if(s<d){throw new Error('"s" specified length of "'+d+'", max of "'+s+'" is acceptable')}var y=u;u+=d;if(u!==o){throw new Error('Expected to consume entire buffer, but "'+(o-u)+'" bytes remain')}var g=t-h,v=t-d;var b=n.allocUnsafe(g+h+v+d);for(u=0;u<g;++u){b[u]=0}e.copy(b,u,p+Math.max(-g,0),p+h);u=t;for(var m=u;u<m+v;++u){b[u]=0}e.copy(b,u,y+Math.max(-v,0),y+d);b=b.toString("base64");b=base64Url(b);return b}function countPadding(e,r,t){var n=0;while(r+n<t&&e[r+n]===0){++n}var a=e[r+n]>=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<i;var y=n.allocUnsafe((d?2:3)+p);var g=0;y[g++]=c;if(d){y[g++]=p}else{y[g++]=i|1;y[g++]=p&255}y[g++]=f;y[g++]=l;if(o<0){y[g++]=0;g+=e.copy(y,g,0,t)}else{g+=e.copy(y,g,o,t)}y[g++]=f;y[g++]=h;if(u<0){y[g++]=0;e.copy(y,g,t)}else{e.copy(y,g,t+u)}return y}e.exports={derToJose:derToJose,joseToDer:joseToDer}},335:e=>{"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},400:(e,r,t)=>{var n=t(820);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}},532:(e,r,t)=>{e.exports={verify:t(167),sign:t(863),JsonWebTokenError:t(321),NotBeforeError:t(962),TokenExpiredError:t(752)};Object.defineProperty(e.exports,"decode",{enumerable:false,value:t(400)})},321: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},962:(e,r,t)=>{var n=t(321);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},752:(e,r,t)=>{var n=t(321);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},117:(e,r,t)=>{const n=t(187);e.exports=n.satisfies(process.version,">=15.7.0")},165:(e,r,t)=>{var n=t(187);e.exports=n.satisfies(process.version,"^6.12.0 || >=8.0.0")},43:(e,r,t)=>{const n=t(187);e.exports=n.satisfies(process.version,">=16.9.0")},59:(e,r,t)=>{var n=t(987);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}}},239:(e,r,t)=>{const n=t(117);const a=t(43);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}}}},863:(e,r,t)=>{const n=t(59);const a=t(165);const i=t(239);const s=t(820);const{includes:o,isBoolean:u,isInteger:l,isNumber:c,isPlainObject:f,isString:h,once:p}=t(464);const{KeyObject:d,createSecretKey:y,createPrivateKey:g}=t(982);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}}},167:(e,r,t)=>{const n=t(321);const a=t(962);const i=t(752);const s=t(400);const o=t(59);const u=t(239);const l=t(165);const c=t(820);const{KeyObject:f,createSecretKey:h,createPublicKey:p}=t(982);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)}))}},523:(e,r,t)=>{var n=t(775);var a=t(725).Buffer;var i=t(982);var s=t(210);var o=t(23);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<r;++t){e+="="}}return e.replace(/\-/g,"+").replace(/_/g,"/")}function typeError(e){var r=[].slice.call(arguments,1);var t=o.format.bind(o,e).apply(null,r);return new TypeError(t)}function bufferOrString(e){return a.isBuffer(e)||typeof e==="string"}function normalizeInput(e){if(!bufferOrString(e))e=JSON.stringify(e);return e}function createHmacSigner(e){return function sign(r,t){checkIsSecretKey(t);r=normalizeInput(r);var n=i.createHmac("sha"+e,t);var a=(n.update(r),n.digest("base64"));return fromBase64(a)}}function createHmacVerifier(e){return function verify(r,t,i){var s=createHmacSigner(e)(r,i);return n(a.from(t),a.from(s))}}function createKeySigner(e){return function sign(r,t){checkIsPrivateKey(t);r=normalizeInput(r);var n=i.createSign("RSA-SHA"+e);var a=(n.update(r),n.sign(t,"base64"));return fromBase64(a)}}function createKeyVerifier(e){return function verify(r,t,n){checkIsPublicKey(n);r=normalizeInput(r);t=toBase64(t);var a=i.createVerify("RSA-SHA"+e);a.update(r);return a.verify(n,t,"base64")}}function createPSSKeySigner(e){return function sign(r,t){checkIsPrivateKey(t);r=normalizeInput(r);var n=i.createSign("RSA-SHA"+e);var a=(n.update(r),n.sign({key:t,padding:i.constants.RSA_PKCS1_PSS_PADDING,saltLength:i.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return fromBase64(a)}}function createPSSKeyVerifier(e){return function verify(r,t,n){checkIsPublicKey(n);r=normalizeInput(r);t=toBase64(t);var a=i.createVerify("RSA-SHA"+e);a.update(r);return a.verify({key:n,padding:i.constants.RSA_PKCS1_PSS_PADDING,saltLength:i.constants.RSA_PSS_SALTLEN_DIGEST},t,"base64")}}function createECDSASigner(e){var r=createKeySigner(e);return function sign(){var t=r.apply(null,arguments);t=s.derToJose(t,"ES"+e);return t}}function createECDSAVerifer(e){var r=createKeyVerifier(e);return function verify(t,n,a){n=s.joseToDer(n,"ES"+e).toString("base64");var i=r(t,n,a);return i}}function createNoneSigner(){return function sign(){return""}}function createNoneVerifier(){return function verify(e,r){return r===""}}e.exports=function jwa(e){var r={hs:createHmacSigner,rs:createKeySigner,ps:createPSSKeySigner,es:createECDSASigner,none:createNoneSigner};var t={hs:createHmacVerifier,rs:createKeyVerifier,ps:createPSSKeyVerifier,es:createECDSAVerifer,none:createNoneVerifier};var n=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/i);if(!n)throw typeError(u,e);var a=(n[1]||n[3]).toLowerCase();var i=n[2];return{sign:r[a](i),verify:t[a](i)}}},820:(e,r,t)=>{var n=t(736);var a=t(344);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)}},263:(e,r,t)=>{var n=t(725).Buffer;var a=t(203);var i=t(23);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},736:(e,r,t)=>{var n=t(725).Buffer;var a=t(263);var i=t(523);var s=t(203);var o=t(174);var u=t(23);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},174:(e,r,t)=>{var n=t(181).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)}},344:(e,r,t)=>{var n=t(725).Buffer;var a=t(263);var i=t(523);var s=t(203);var o=t(174);var u=t(23);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},464:function(e,r,t){e=t.nmd(e); /** * @license * Lodash <https://lodash.com/> * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> * Released under MIT license <https://lodash.com/license> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */(function(){var t;var n="4.18.1";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`",u="Invalid `imports` option passed into `_.template`";var l="__lodash_hash_undefined__";var c=500;var f="__lodash_placeholder__";var h=1,p=2,d=4;var y=1,g=2;var v=1,b=2,m=4,_=8,w=16,S=32,I=64,A=128,x=256,k=512;var j=30,O="...";var E=800,R=16;var L=1,C=2,T=3;var W=1/0,P=9007199254740991,z=17976931348623157e292,B=0/0;var F=4294967295,M=F-1,D=F>>>1;var K=[["ary",A],["bind",v],["bindKey",b],["curry",_],["curryRight",w],["flip",k],["partial",S],["partialRight",I],["rearg",x]];var q="[object Arguments]",V="[object Array]",U="[object AsyncFunction]",N="[object Boolean]",H="[object Date]",G="[object DOMException]",$="[object Error]",J="[object Function]",Z="[object GeneratorFunction]",X="[object Map]",Y="[object Number]",Q="[object Null]",ee="[object Object]",re="[object Promise]",te="[object Proxy]",ne="[object RegExp]",ae="[object Set]",ie="[object String]",se="[object Symbol]",oe="[object Undefined]",ue="[object WeakMap]",le="[object WeakSet]";var ce="[object ArrayBuffer]",fe="[object DataView]",he="[object Float32Array]",pe="[object Float64Array]",de="[object Int8Array]",ye="[object Int16Array]",ge="[object Int32Array]",ve="[object Uint8Array]",be="[object Uint8ClampedArray]",me="[object Uint16Array]",_e="[object Uint32Array]";var we=/\b__p \+= '';/g,Se=/\b(__p \+=) '' \+/g,Ie=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var Ae=/&(?:amp|lt|gt|quot|#39);/g,xe=/[&<>"']/g,ke=RegExp(Ae.source),je=RegExp(xe.source);var Oe=/<%-([\s\S]+?)%>/g,Ee=/<%([\s\S]+?)%>/g,Re=/<%=([\s\S]+?)%>/g;var Le=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ce=/^\w*$/,Te=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;var We=/[\\^$.*+?()[\]{}|]/g,Pe=RegExp(We.source);var ze=/^\s+/;var Be=/\s/;var Fe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Me=/\{\n\/\* \[wrapped with (.+)\] \*/,De=/,? & /;var Ke=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var qe=/[()=,{}\[\]\/\s]/;var Ve=/\\(\\)?/g;var Ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var Ne=/\w*$/;var He=/^[-+]0x[0-9a-f]+$/i;var Ge=/^0b[01]+$/i;var $e=/^\[object .+?Constructor\]$/;var Je=/^0o[0-7]+$/i;var Ze=/^(?:0|[1-9]\d*)$/;var Xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;var Ye=/($^)/;var Qe=/['\n\r\u2028\u2029\\]/g;var er="\\ud800-\\udfff",rr="\\u0300-\\u036f",tr="\\ufe20-\\ufe2f",nr="\\u20d0-\\u20ff",ar=rr+tr+nr,ir="\\u2700-\\u27bf",sr="a-z\\xdf-\\xf6\\xf8-\\xff",or="\\xac\\xb1\\xd7\\xf7",ur="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",lr="\\u2000-\\u206f",cr=" \\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",fr="A-Z\\xc0-\\xd6\\xd8-\\xde",hr="\\ufe0e\\ufe0f",pr=or+ur+lr+cr;var dr="['’]",yr="["+er+"]",gr="["+pr+"]",vr="["+ar+"]",br="\\d+",mr="["+ir+"]",_r="["+sr+"]",wr="[^"+er+pr+br+ir+sr+fr+"]",Sr="\\ud83c[\\udffb-\\udfff]",Ir="(?:"+vr+"|"+Sr+")",Ar="[^"+er+"]",xr="(?:\\ud83c[\\udde6-\\uddff]){2}",kr="[\\ud800-\\udbff][\\udc00-\\udfff]",jr="["+fr+"]",Or="\\u200d";var Er="(?:"+_r+"|"+wr+")",Rr="(?:"+jr+"|"+wr+")",Lr="(?:"+dr+"(?:d|ll|m|re|s|t|ve))?",Cr="(?:"+dr+"(?:D|LL|M|RE|S|T|VE))?",Tr=Ir+"?",Wr="["+hr+"]?",Pr="(?:"+Or+"(?:"+[Ar,xr,kr].join("|")+")"+Wr+Tr+")*",zr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Br="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Fr=Wr+Tr+Pr,Mr="(?:"+[mr,xr,kr].join("|")+")"+Fr,Dr="(?:"+[Ar+vr+"?",vr,xr,kr,yr].join("|")+")";var Kr=RegExp(dr,"g");var qr=RegExp(vr,"g");var Vr=RegExp(Sr+"(?="+Sr+")|"+Dr+Fr,"g");var Ur=RegExp([jr+"?"+_r+"+"+Lr+"(?="+[gr,jr,"$"].join("|")+")",Rr+"+"+Cr+"(?="+[gr,jr+Er,"$"].join("|")+")",jr+"?"+Er+"+"+Lr,jr+"+"+Cr,Br,zr,br,Mr].join("|"),"g");var Nr=RegExp("["+Or+er+ar+hr+"]");var Hr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var Gr=["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 $r=-1;var Jr={};Jr[he]=Jr[pe]=Jr[de]=Jr[ye]=Jr[ge]=Jr[ve]=Jr[be]=Jr[me]=Jr[_e]=true;Jr[q]=Jr[V]=Jr[ce]=Jr[N]=Jr[fe]=Jr[H]=Jr[$]=Jr[J]=Jr[X]=Jr[Y]=Jr[ee]=Jr[ne]=Jr[ae]=Jr[ie]=Jr[ue]=false;var Zr={};Zr[q]=Zr[V]=Zr[ce]=Zr[fe]=Zr[N]=Zr[H]=Zr[he]=Zr[pe]=Zr[de]=Zr[ye]=Zr[ge]=Zr[X]=Zr[Y]=Zr[ee]=Zr[ne]=Zr[ae]=Zr[ie]=Zr[se]=Zr[ve]=Zr[be]=Zr[me]=Zr[_e]=true;Zr[$]=Zr[J]=Zr[ue]=false;var Xr={"À":"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 Yr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};var Qr={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"};var et={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};var rt=parseFloat,tt=parseInt;var nt=typeof global=="object"&&global&&global.Object===Object&&global;var at=typeof self=="object"&&self&&self.Object===Object&&self;var it=nt||at||Function("return this")();var st=true&&r&&!r.nodeType&&r;var ot=st&&"object"=="object"&&e&&!e.nodeType&&e;var ut=ot&&ot.exports===st;var lt=ut&&nt.process;var ct=function(){try{var e=ot&&ot.require&&ot.require("util").types;if(e){return e}return lt&&lt.binding&&lt.binding("util")}catch(e){}}();var ft=ct&&ct.isArrayBuffer,ht=ct&&ct.isDate,pt=ct&&ct.isMap,dt=ct&&ct.isRegExp,yt=ct&&ct.isSet,gt=ct&&ct.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<i){var s=e[a];r(n,s,t(s),e)}return n}function arrayEach(e,r){var t=-1,n=e==null?0:e.length;while(++t<n){if(r(e[t],t,e)===false){break}}return e}function arrayEachRight(e,r){var t=e==null?0:e.length;while(t--){if(r(e[t],t,e)===false){break}}return e}function arrayEvery(e,r){var t=-1,n=e==null?0:e.length;while(++t<n){if(!r(e[t],t,e)){return false}}return true}function arrayFilter(e,r){var t=-1,n=e==null?0:e.length,a=0,i=[];while(++t<n){var s=e[t];if(r(s,t,e)){i[a++]=s}}return i}function arrayIncludes(e,r){var t=e==null?0:e.length;return!!t&&baseIndexOf(e,r,0)>-1}function arrayIncludesWith(e,r,t){var n=-1,a=e==null?0:e.length;while(++n<a){if(t(r,e[n])){return true}}return false}function arrayMap(e,r){var t=-1,n=e==null?0:e.length,a=Array(n);while(++t<n){a[t]=r(e[t],t,e)}return a}function arrayPush(e,r){var t=-1,n=r.length,a=e.length;while(++t<n){e[a+t]=r[t]}return e}function arrayReduce(e,r,t,n){var a=-1,i=e==null?0:e.length;if(n&&i){t=e[++a]}while(++a<i){t=r(t,e[a],a,e)}return t}function arrayReduceRight(e,r,t,n){var a=e==null?0:e.length;if(n&&a){t=e[--a]}while(a--){t=r(t,e[a],a,e)}return t}function arraySome(e,r){var t=-1,n=e==null?0:e.length;while(++t<n){if(r(e[t],t,e)){return true}}return false}var vt=baseProperty("length");function asciiToArray(e){return e.split("")}function asciiWords(e){return e.match(Ke)||[]}function baseFindKey(e,r,t){var n;t(e,(function(e,t,a){if(r(e,t,a)){n=t;return false}}));return n}function baseFindIndex(e,r,t,n){var a=e.length,i=t+(n?1:-1);while(n?i--:++i<a){if(r(e[i],i,e)){return i}}return-1}function baseIndexOf(e,r,t){return r===r?strictIndexOf(e,r,t):baseFindIndex(e,baseIsNaN,t)}function baseIndexOfWith(e,r,t,n){var a=t-1,i=e.length;while(++a<i){if(n(e[a],r)){return a}}return-1}function baseIsNaN(e){return e!==e}function baseMean(e,r){var t=e==null?0:e.length;return t?baseSum(e,r)/t:B}function baseProperty(e){return function(r){return r==null?t:r[e]}}function basePropertyOf(e){return function(r){return e==null?t:e[r]}}function baseReduce(e,r,t,n,a){a(e,(function(e,a,i){t=n?(n=false,e):r(t,e,a,i)}));return t}function baseSortBy(e,r){var t=e.length;e.sort(r);while(t--){e[t]=e[t].value}return e}function baseSum(e,r){var n,a=-1,i=e.length;while(++a<i){var s=r(e[a]);if(s!==t){n=n===t?s:n+s}}return n}function baseTimes(e,r){var t=-1,n=Array(e);while(++t<e){n[t]=r(t)}return n}function baseToPairs(e,r){return arrayMap(r,(function(r){return[r,e[r]]}))}function baseTrim(e){return e?e.slice(0,trimmedEndIndex(e)+1).replace(ze,""):e}function baseUnary(e){return function(r){return e(r)}}function baseValues(e,r){return arrayMap(r,(function(r){return e[r]}))}function cacheHas(e,r){return e.has(r)}function charsStartIndex(e,r){var t=-1,n=e.length;while(++t<n&&baseIndexOf(r,e[t],0)>-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 bt=basePropertyOf(Xr);var mt=basePropertyOf(Yr);function escapeStringChar(e){return"\\"+et[e]}function getValue(e,r){return e==null?t:e[r]}function hasUnicode(e){return Nr.test(e)}function hasUnicodeWord(e){return Hr.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<n){var s=e[t];if(s===r||s===f){e[t]=f;i[a++]=t}}return i}function setToArray(e){var r=-1,t=Array(e.size);e.forEach((function(e){t[++r]=e}));return t}function setToPairs(e){var r=-1,t=Array(e.size);e.forEach((function(e){t[++r]=[e,e]}));return t}function strictIndexOf(e,r,t){var n=t-1,a=e.length;while(++n<a){if(e[n]===r){return n}}return-1}function strictLastIndexOf(e,r,t){var n=t+1;while(n--){if(e[n]===r){return n}}return n}function stringSize(e){return hasUnicode(e)?unicodeSize(e):vt(e)}function stringToArray(e){return hasUnicode(e)?unicodeToArray(e):asciiToArray(e)}function trimmedEndIndex(e){var r=e.length;while(r--&&Be.test(e.charAt(r))){}return r}var _t=basePropertyOf(Qr);function unicodeSize(e){var r=Vr.lastIndex=0;while(Vr.test(e)){++r}return r}function unicodeToArray(e){return e.match(Vr)||[]}function unicodeWords(e){return e.match(Ur)||[]}var wt=function runInContext(e){e=e==null?it:St.defaults(it.Object(),e,St.pick(it,Gr));var r=e.Array,Be=e.Date,Ke=e.Error,er=e.Function,rr=e.Math,tr=e.Object,nr=e.RegExp,ar=e.String,ir=e.TypeError;var sr=r.prototype,or=er.prototype,ur=tr.prototype;var lr=e["__core-js_shared__"];var cr=or.toString;var fr=ur.hasOwnProperty;var hr=0;var pr=function(){var e=/[^.]+$/.exec(lr&&lr.keys&&lr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var dr=ur.toString;var yr=cr.call(tr);var gr=it._;var vr=nr("^"+cr.call(fr).replace(We,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var br=ut?e.Buffer:t,mr=e.Symbol,_r=e.Uint8Array,wr=br?br.allocUnsafe:t,Sr=overArg(tr.getPrototypeOf,tr),Ir=tr.create,Ar=ur.propertyIsEnumerable,xr=sr.splice,kr=mr?mr.isConcatSpreadable:t,jr=mr?mr.iterator:t,Or=mr?mr.toStringTag:t;var Er=function(){try{var e=getNative(tr,"defineProperty");e({},"",{});return e}catch(e){}}();var Rr=e.clearTimeout!==it.clearTimeout&&e.clearTimeout,Lr=Be&&Be.now!==it.Date.now&&Be.now,Cr=e.setTimeout!==it.setTimeout&&e.setTimeout;var Tr=rr.ceil,Wr=rr.floor,Pr=tr.getOwnPropertySymbols,zr=br?br.isBuffer:t,Br=e.isFinite,Fr=sr.join,Mr=overArg(tr.keys,tr),Dr=rr.max,Vr=rr.min,Ur=Be.now,Nr=e.parseInt,Hr=rr.random,Xr=sr.reverse;var Yr=getNative(e,"DataView"),Qr=getNative(e,"Map"),et=getNative(e,"Promise"),nt=getNative(e,"Set"),at=getNative(e,"WeakMap"),st=getNative(tr,"create");var ot=at&&new at;var lt={};var ct=toSource(Yr),vt=toSource(Qr),wt=toSource(et),It=toSource(nt),At=toSource(at);var xt=mr?mr.prototype:t,kt=xt?xt.valueOf:t,jt=xt?xt.toString:t;function lodash(e){if(isObjectLike(e)&&!Cn(e)&&!(e instanceof LazyWrapper)){if(e instanceof LodashWrapper){return e}if(fr.call(e,"__wrapped__")){return wrapperClone(e)}}return new LodashWrapper(e)}var Ot=function(){function object(){}return function(e){if(!isObject(e)){return{}}if(Ir){return Ir(e)}object.prototype=e;var r=new object;object.prototype=t;return r}}();function baseLodash(){}function LodashWrapper(e,r){this.__wrapped__=e;this.__actions__=[];this.__chain__=!!r;this.__index__=0;this.__values__=t}lodash.templateSettings={escape:Oe,evaluate:Ee,interpolate:Re,variable:"",imports:{_:lodash}};lodash.prototype=baseLodash.prototype;lodash.prototype.constructor=lodash;LodashWrapper.prototype=Ot(baseLodash.prototype);LodashWrapper.prototype.constructor=LodashWrapper;function LazyWrapper(e){this.__wrapped__=e;this.__actions__=[];this.__dir__=1;this.__filtered__=false;this.__iteratees__=[];this.__takeCount__=F;this.__views__=[]}function lazyClone(){var e=new LazyWrapper(this.__wrapped__);e.__actions__=copyArray(this.__actions__);e.__dir__=this.__dir__;e.__filtered__=this.__filtered__;e.__iteratees__=copyArray(this.__iteratees__);e.__takeCount__=this.__takeCount__;e.__views__=copyArray(this.__views__);return e}function lazyReverse(){if(this.__filtered__){var e=new LazyWrapper(this);e.__dir__=-1;e.__filtered__=true}else{e=this.clone();e.__dir__*=-1}return e}function lazyValue(){var e=this.__wrapped__.value(),r=this.__dir__,t=Cn(e),n=r<0,a=t?e.length:0,i=getView(0,a,this.__views__),s=i.start,o=i.end,u=o-s,l=n?o:s-1,c=this.__iteratees__,f=c.length,h=0,p=Vr(u,this.__takeCount__);if(!t||!n&&a==u&&p==u){return baseWrapperValue(e,this.__actions__)}var d=[];e:while(u--&&h<p){l+=r;var y=-1,g=e[l];while(++y<f){var v=c[y],b=v.iteratee,m=v.type,_=b(g);if(m==C){g=_}else if(!_){if(m==L){continue e}else{break e}}}d[h++]=g}return d}LazyWrapper.prototype=Ot(baseLodash.prototype);LazyWrapper.prototype.constructor=LazyWrapper;function Hash(e){var r=-1,t=e==null?0:e.length;this.clear();while(++r<t){var n=e[r];this.set(n[0],n[1])}}function hashClear(){this.__data__=st?st(null):{};this.size=0}function hashDelete(e){var r=this.has(e)&&delete this.__data__[e];this.size-=r?1:0;return r}function hashGet(e){var r=this.__data__;if(st){var n=r[e];return n===l?t:n}return fr.call(r,e)?r[e]:t}function hashHas(e){var r=this.__data__;return st?r[e]!==t:fr.call(r,e)}function hashSet(e,r){var n=this.__data__;this.size+=this.has(e)?0:1;n[e]=st&&r===t?l:r;return this}Hash.prototype.clear=hashClear;Hash.prototype["delete"]=hashDelete;Hash.prototype.get=hashGet;Hash.prototype.has=hashHas;Hash.prototype.set=hashSet;function ListCache(e){var r=-1,t=e==null?0:e.length;this.clear();while(++r<t){var n=e[r];this.set(n[0],n[1])}}function listCacheClear(){this.__data__=[];this.size=0}function listCacheDelete(e){var r=this.__data__,t=assocIndexOf(r,e);if(t<0){return false}var n=r.length-1;if(t==n){r.pop()}else{xr.call(r,t,1)}--this.size;return true}function listCacheGet(e){var r=this.__data__,n=assocIndexOf(r,e);return n<0?t:r[n][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-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<t){var n=e[r];this.set(n[0],n[1])}}function mapCacheClear(){this.size=0;this.__data__={hash:new Hash,map:new(Qr||ListCache),string:new Hash}}function mapCacheDelete(e){var r=getMapData(this,e)["delete"](e);this.size-=r?1:0;return r}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,r){var t=getMapData(this,e),n=t.size;t.set(e,r);this.size+=t.size==n?0:1;return this}MapCache.prototype.clear=mapCacheClear;MapCache.prototype["delete"]=mapCacheDelete;MapCache.prototype.get=mapCacheGet;MapCache.prototype.has=mapCacheHas;MapCache.prototype.set=mapCacheSet;function SetCache(e){var r=-1,t=e==null?0:e.length;this.__data__=new MapCache;while(++r<t){this.add(e[r])}}function setCacheAdd(e){this.__data__.set(e,l);return this}function setCacheHas(e){return this.__data__.has(e)}SetCache.prototype.add=SetCache.prototype.push=setCacheAdd;SetCache.prototype.has=setCacheHas;function Stack(e){var r=this.__data__=new ListCache(e);this.size=r.size}function stackClear(){this.__data__=new ListCache;this.size=0}function stackDelete(e){var r=this.__data__,t=r["delete"](e);this.size=r.size;return t}function stackGet(e){return this.__data__.get(e)}function stackHas(e){return this.__data__.has(e)}function stackSet(e,r){var t=this.__data__;if(t instanceof ListCache){var n=t.__data__;if(!Qr||n.length<a-1){n.push([e,r]);this.size=++t.size;return this}t=this.__data__=new MapCache(n)}t.set(e,r);this.size=t.size;return this}Stack.prototype.clear=stackClear;Stack.prototype["delete"]=stackDelete;Stack.prototype.get=stackGet;Stack.prototype.has=stackHas;Stack.prototype.set=stackSet;function arrayLikeKeys(e,r){var t=Cn(e),n=!t&&Ln(e),a=!t&&!n&&Wn(e),i=!t&&!n&&!a&&Mn(e),s=t||n||a||i,o=s?baseTimes(e.length,ar):[],u=o.length;for(var l in e){if((r||fr.call(e,l))&&!(s&&(l=="length"||a&&(l=="offset"||l=="parent")||i&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||isIndex(l,u)))){o.push(l)}}return o}function arraySample(e){var r=e.length;return r?e[baseRandom(0,r-1)]:t}function arraySampleSize(e,r){return shuffleSelf(copyArray(e),baseClamp(r,0,e.length))}function arrayShuffle(e){return shuffleSelf(copyArray(e))}function assignMergeValue(e,r,n){if(n!==t&&!eq(e[r],n)||n===t&&!(r in e)){baseAssignValue(e,r,n)}}function assignValue(e,r,n){var a=e[r];if(!(fr.call(e,r)&&eq(a,n))||n===t&&!(r in e)){baseAssignValue(e,r,n)}}function assocIndexOf(e,r){var t=e.length;while(t--){if(eq(e[t][0],r)){return t}}return-1}function baseAggregator(e,r,t,n){Et(e,(function(e,a,i){r(n,e,t(e),i)}));return n}function baseAssign(e,r){return e&&copyObject(r,keys(r),e)}function baseAssignIn(e,r){return e&&copyObject(r,keysIn(r),e)}function baseAssignValue(e,r,t){if(r=="__proto__"&&Er){Er(e,r,{configurable:true,enumerable:true,value:t,writable:true})}else{e[r]=t}}function baseAt(e,n){var a=-1,i=n.length,s=r(i),o=e==null;while(++a<i){s[a]=o?t:get(e,n[a])}return s}function baseClamp(e,r,n){if(e===e){if(n!==t){e=e<=n?e:n}if(r!==t){e=e>=r?e:r}}return e}function baseClone(e,r,n,a,i,s){var o,u=r&h,l=r&p,c=r&d;if(n){o=i?n(e,a,i,s):n(e)}if(o!==t){return o}if(!isObject(e)){return e}var f=Cn(e);if(f){o=initCloneArray(e);if(!u){return copyArray(e,o)}}else{var y=Kt(e),g=y==J||y==Z;if(Wn(e)){return cloneBuffer(e,u)}if(y==ee||y==q||g&&!i){o=l||g?{}:initCloneObject(e);if(!u){return l?copySymbolsIn(e,baseAssignIn(o,e)):copySymbols(e,baseAssign(o,e))}}else{if(!Zr[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(Fn(e)){e.forEach((function(t){o.add(baseClone(t,r,n,t,e,s))}))}else if(zn(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=f?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=tr(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 ir(s)}return Ut((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(++i<u){var f=e[i],h=t==null?f:t(f);f=n||f!==0?f:0;if(o&&h===h){var p=c;while(p--){if(r[p]===h){continue e}}l.push(f)}else if(!s(r,h,n)){l.push(f)}}return l}var Et=createBaseEach(baseForOwn);var Rt=createBaseEach(baseForOwnRight,true);function baseEvery(e,r){var t=true;Et(e,(function(e,n,a){t=!!r(e,n,a);return t}));return t}function baseExtremum(e,r,n){var a=-1,i=e.length;while(++a<i){var s=e[a],o=r(s);if(o!=null&&(u===t?o===o&&!isSymbol(o):n(o,u))){var u=o,l=s}}return l}function baseFill(e,r,n,a){var i=e.length;n=toInteger(n);if(n<0){n=-n>i?0:i+n}a=a===t||a>i?i:toInteger(a);if(a<0){a+=i}a=n>a?0:toLength(a);while(n<a){e[n++]=r}return e}function baseFilter(e,r){var t=[];Et(e,(function(e,n,a){if(r(e,n,a)){t.push(e)}}));return t}function baseFlatten(e,r,t,n,a){var i=-1,s=e.length;t||(t=isFlattenable);a||(a=[]);while(++i<s){var o=e[i];if(r>0&&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 Lt=createBaseFor();var Ct=createBaseFor(true);function baseForOwn(e,r){return e&&Lt(e,r,keys)}function baseForOwnRight(e,r){return e&&Ct(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&&n<a){e=e[toKey(r[n++])]}return n&&n==a?e:t}function baseGetAllKeys(e,r,t){var n=r(e);return Cn(e)?n:arrayPush(n,t(e))}function baseGetTag(e){if(e==null){return e===t?oe:Q}return Or&&Or in tr(e)?getRawTag(e):objectToString(e)}function baseGt(e,r){return e>r}function baseHas(e,r){return e!=null&&fr.call(e,r)}function baseHasIn(e,r){return e!=null&&r in tr(e)}function baseInRange(e,r,t){return e>=Vr(r,t)&&e<Dr(r,t)}function baseIntersection(e,n,a){var i=a?arrayIncludesWith:arrayIncludes,s=e[0].length,o=e.length,u=o,l=r(o),c=Infinity,f=[];while(u--){var h=e[u];if(u&&n){h=arrayMap(h,baseUnary(n))}c=Vr(h.length,c);l[u]=!a&&(n||s>=120&&h.length>=120)?new SetCache(u&&h):t}h=e[0];var p=-1,d=l[0];e:while(++p<s&&f.length<c){var y=h[p],g=n?n(y):y;y=a||y!==0?y:0;if(!(d?cacheHas(d,g):i(f,g,a))){u=o;while(--u){var v=l[u];if(!(v?cacheHas(v,g):i(e[u],g,a))){continue e}}if(d){d.push(g)}f.push(y)}}return f}function baseInverter(e,r,t,n){baseForOwn(e,(function(e,a,i){r(n,t(e),a,i)}));return n}function baseInvoke(e,r,n){r=castPath(r,e);e=parent(e,r);var a=e==null?e:e[toKey(last(r))];return a==null?t:apply(a,e,n)}function baseIsArguments(e){return isObjectLike(e)&&baseGetTag(e)==q}function baseIsArrayBuffer(e){return isObjectLike(e)&&baseGetTag(e)==ce}function baseIsDate(e){return isObjectLike(e)&&baseGetTag(e)==H}function baseIsEqual(e,r,t,n,a){if(e===r){return true}if(e==null||r==null||!isObjectLike(e)&&!isObjectLike(r)){return e!==e&&r!==r}return baseIsEqualDeep(e,r,t,n,baseIsEqual,a)}function baseIsEqualDeep(e,r,t,n,a,i){var s=Cn(e),o=Cn(r),u=s?V:Kt(e),l=o?V:Kt(r);u=u==q?ee:u;l=l==q?ee:l;var c=u==ee,f=l==ee,h=u==l;if(h&&Wn(e)){if(!Wn(r)){return false}s=true;c=false}if(h&&!c){i||(i=new Stack);return s||Mn(e)?equalArrays(e,r,t,n,a,i):equalByTag(e,r,u,t,n,a,i)}if(!(t&y)){var p=c&&fr.call(e,"__wrapped__"),d=f&&fr.call(r,"__wrapped__");if(p||d){var g=p?e.value():e,v=d?r.value():r;i||(i=new Stack);return a(g,v,t,n,i)}}if(!h){return false}i||(i=new Stack);return equalObjects(e,r,t,n,a,i)}function baseIsMap(e){return isObjectLike(e)&&Kt(e)==X}function baseIsMatch(e,r,n,a){var i=n.length,s=i,o=!a;if(e==null){return!s}e=tr(e);while(i--){var u=n[i];if(o&&u[2]?u[1]!==e[u[0]]:!(u[0]in e)){return false}}while(++i<s){u=n[i];var l=u[0],c=e[l],f=u[1];if(o&&u[2]){if(c===t&&!(l in e)){return false}}else{var h=new Stack;if(a){var p=a(c,f,l,e,r,h)}if(!(p===t?baseIsEqual(f,c,y|g,a,h):p)){return false}}}return true}function baseIsNative(e){if(!isObject(e)||isMasked(e)){return false}var r=isFunction(e)?vr:$e;return r.test(toSource(e))}function baseIsRegExp(e){return isObjectLike(e)&&baseGetTag(e)==ne}function baseIsSet(e){return isObjectLike(e)&&Kt(e)==ae}function baseIsTypedArray(e){return isObjectLike(e)&&isLength(e.length)&&!!Jr[baseGetTag(e)]}function baseIteratee