-
Notifications
You must be signed in to change notification settings - Fork 1
/
solid-auth-client.bundle.js.map
1 lines (1 loc) · 523 KB
/
solid-auth-client.bundle.js.map
1
{"version":3,"sources":["webpack://solid.auth/webpack/universalModuleDefinition","webpack://solid.auth/webpack/bootstrap","webpack://solid.auth/./node_modules/@babel/runtime/helpers/defineProperty.js","webpack://solid.auth/./node_modules/@trust/json-document/lib/index.js","webpack://solid.auth/./node_modules/base64url/index.js","webpack://solid.auth/./node_modules/@solid/jose/lib/index.js","webpack://solid.auth/./node_modules/buffer/index.js","webpack://solid.auth/(webpack)/buildin/global.js","webpack://solid.auth/external \"window\"","webpack://solid.auth/external \"fetch\"","webpack://solid.auth/external \"crypto\"","webpack://solid.auth/./node_modules/@solid/jose/lib/schemas/JWKSchema.js","webpack://solid.auth/./node_modules/assert/assert.js","webpack://solid.auth/./node_modules/@trust/json-document/lib/JSONPointer.js","webpack://solid.auth/./node_modules/@solid/jose/lib/jose/JWA.js","webpack://solid.auth/./node_modules/@solid/oidc-rp/src/FormUrlEncoded.js","webpack://solid.auth/./node_modules/@solid/oidc-rp/src/onHttpError.js","webpack://solid.auth/./node_modules/@solid/oidc-rp/src/index.js","webpack://solid.auth/./node_modules/auth-header/dist/util.js","webpack://solid.auth/./node_modules/@solid/oidc-rp/src/RelyingParty.js","webpack://solid.auth/./node_modules/@trust/json-document/lib/Formats.js","webpack://solid.auth/./node_modules/@trust/json-document/lib/Initializer.js","webpack://solid.auth/./node_modules/@trust/json-document/lib/JSONPatch.js","webpack://solid.auth/./node_modules/@trust/json-document/lib/Validator.js","webpack://solid.auth/./node_modules/@solid/jose/lib/text-encoder/index.js","webpack://solid.auth/./node_modules/@solid/jose/lib/errors/NotSupportedError.js","webpack://solid.auth/./node_modules/@solid/jose/lib/errors/index.js","webpack://solid.auth/./node_modules/@solid/jose/lib/errors/DataError.js","webpack://solid.auth/./node_modules/@solid/jose/lib/jose/JWK.js","webpack://solid.auth/./node_modules/@solid/jose/lib/schemas/JWKSetSchema.js","webpack://solid.auth/./node_modules/@solid/jose/lib/schemas/JWTSchema.js","webpack://solid.auth/./node_modules/@solid/jose/lib/schemas/Base64URLSchema.js","webpack://solid.auth/./node_modules/@solid/jose/lib/schemas/JWTClaimsSetSchema.js","webpack://solid.auth/./node_modules/@solid/jose/lib/schemas/JOSEHeaderSchema.js","webpack://solid.auth/./node_modules/@solid/jose/lib/jose/JWS.js","webpack://solid.auth/./node_modules/events/events.js","webpack://solid.auth/./node_modules/@babel/runtime/helpers/objectWithoutProperties.js","webpack://solid.auth/./node_modules/auth-header/dist/index.js","webpack://solid.auth/./node_modules/@solid/oidc-rp/lib/PoPToken.js","webpack://solid.auth/./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","webpack://solid.auth/./node_modules/auth-header/dist/format.js","webpack://solid.auth/./node_modules/auth-header/dist/parse.js","webpack://solid.auth/./node_modules/object-assign/index.js","webpack://solid.auth/./node_modules/util/util.js","webpack://solid.auth/./node_modules/process/browser.js","webpack://solid.auth/./node_modules/util/support/isBufferBrowser.js","webpack://solid.auth/./node_modules/util/node_modules/inherits/inherits_browser.js","webpack://solid.auth/./node_modules/@trust/json-document/lib/JSONDocument.js","webpack://solid.auth/./node_modules/@trust/json-document/lib/JSONMapping.js","webpack://solid.auth/./node_modules/@trust/json-document/lib/JSONSchema.js","webpack://solid.auth/./node_modules/base64url/dist/base64url.js","webpack://solid.auth/./node_modules/base64-js/index.js","webpack://solid.auth/./node_modules/ieee754/index.js","webpack://solid.auth/./node_modules/isarray/index.js","webpack://solid.auth/./node_modules/base64url/dist/pad-string.js","webpack://solid.auth/./node_modules/@solid/jose/lib/algorithms/index.js","webpack://solid.auth/./node_modules/@solid/jose/lib/algorithms/NONE.js","webpack://solid.auth/./node_modules/@solid/jose/lib/algorithms/HMAC.js","webpack://solid.auth/external \"TextEncoder\"","webpack://solid.auth/./node_modules/@solid/jose/lib/algorithms/RSASSA-PKCS1-v1_5.js","webpack://solid.auth/./node_modules/@solid/jose/lib/algorithms/SupportedAlgorithms.js","webpack://solid.auth/./node_modules/@solid/jose/lib/formats/index.js","webpack://solid.auth/./node_modules/@solid/jose/lib/jose/JWKSet.js","webpack://solid.auth/./node_modules/@solid/jose/lib/jose/JWT.js","webpack://solid.auth/./node_modules/@solid/oidc-rp/src/AuthenticationRequest.js","webpack://solid.auth/./node_modules/@solid/oidc-rp/src/AuthenticationResponse.js","webpack://solid.auth/./node_modules/@solid/oidc-rp/src/IDToken.js","webpack://solid.auth/./node_modules/@solid/oidc-rp/src/IDTokenSchema.js","webpack://solid.auth/./node_modules/@solid/oidc-rp/src/Session.js","webpack://solid.auth/./node_modules/@solid/oidc-rp/src/PoPToken.js","webpack://solid.auth/./node_modules/standard-http-error/index.js","webpack://solid.auth/./node_modules/standard-error/index.js","webpack://solid.auth/./node_modules/@solid/oidc-rp/src/RelyingPartySchema.js","webpack://solid.auth/./src/url-util.js","webpack://solid.auth/./src/ipc.js","webpack://solid.auth/./src/storage.js","webpack://solid.auth/./src/session.js","webpack://solid.auth/./src/webid-oidc.js","webpack://solid.auth/./src/host.js","webpack://solid.auth/./src/authn-fetch.js","webpack://solid.auth/./src/popup.js","webpack://solid.auth/./src/solid-auth-client.js","webpack://solid.auth/./src/index.js"],"names":["root","factory","exports","module","require","define","amd","window","__WEBPACK_EXTERNAL_MODULE__6__","__WEBPACK_EXTERNAL_MODULE__7__","__WEBPACK_EXTERNAL_MODULE__8__","__WEBPACK_EXTERNAL_MODULE__56__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","obj","configurable","writable","Formats","Initializer","JSONDocument","JSONMapping","JSONPatch","JSONPointer","JSONSchema","Validator","default","JWA","JWK","JWKSet","JWT","JWS","Base64URLSchema","JOSEHeaderSchema","JWKSchema","JWKSetSchema","JWTClaimsSetSchema","JWTSchema","base64","ieee754","isArray","kMaxLength","Buffer","TYPED_ARRAY_SUPPORT","createBuffer","that","length","RangeError","Uint8Array","__proto__","arg","encodingOrOffset","this","Error","allocUnsafe","from","TypeError","ArrayBuffer","array","byteOffset","byteLength","undefined","fromArrayLike","fromArrayBuffer","string","encoding","isEncoding","actual","write","slice","fromString","isBuffer","len","checked","copy","buffer","val","type","data","fromObject","assertSize","size","toString","isView","loweredCase","utf8ToBytes","base64ToBytes","toLowerCase","slowToString","start","end","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","swap","b","bidirectionalIndexOf","dir","isNaN","arrayIndexOf","indexOf","lastIndexOf","arr","indexSize","arrLength","valLength","String","read","buf","readUInt16BE","foundIndex","found","j","hexWrite","offset","Number","remaining","strLen","parsed","parseInt","substr","utf8Write","blitBuffer","asciiWrite","str","byteArray","push","charCodeAt","asciiToBytes","latin1Write","base64Write","ucs2Write","units","hi","lo","utf16leToBytes","fromByteArray","Math","min","res","secondByte","thirdByte","fourthByte","tempCodePoint","firstByte","codePoint","bytesPerSequence","codePoints","MAX_ARGUMENTS_LENGTH","fromCharCode","apply","decodeCodePointsArray","SlowBuffer","alloc","INSPECT_MAX_BYTES","global","foo","subarray","e","typedArraySupport","poolSize","_augment","species","fill","allocUnsafeSlow","_isBuffer","compare","a","x","y","concat","list","pos","swap16","swap32","swap64","arguments","equals","inspect","max","match","join","target","thisStart","thisEnd","thisCopy","targetCopy","includes","isFinite","toJSON","Array","_arr","ret","out","toHex","bytes","checkOffset","ext","checkInt","objectWriteUInt16","littleEndian","objectWriteUInt32","checkIEEE754","writeFloat","noAssert","writeDouble","newBuf","sliceLen","readUIntLE","mul","readUIntBE","readUInt8","readUInt16LE","readUInt32LE","readUInt32BE","readIntLE","pow","readIntBE","readInt8","readInt16LE","readInt16BE","readInt32LE","readInt32BE","readFloatLE","readFloatBE","readDoubleLE","readDoubleBE","writeUIntLE","writeUIntBE","writeUInt8","floor","writeUInt16LE","writeUInt16BE","writeUInt32LE","writeUInt32BE","writeIntLE","limit","sub","writeIntBE","writeInt8","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","writeFloatLE","writeFloatBE","writeDoubleLE","writeDoubleBE","targetStart","set","code","INVALID_BASE64_RE","Infinity","leadSurrogate","toByteArray","trim","replace","stringtrim","base64clean","src","dst","g","Function","BASE64_REGEXP","properties","kty","enum","use","key_ops","items","alg","kid","x5u","x5c","x5t","objectAssign","util","hasOwn","pSlice","functionsHaveNames","pToString","arrbuf","DataView","assert","ok","regex","getName","func","isFunction","truncate","something","rawname","fail","expected","message","operator","stackStartFunction","AssertionError","_deepEqual","strict","memos","isDate","getTime","isRegExp","source","multiline","lastIndex","ignoreCase","Float32Array","Float64Array","actualIndex","actualVisitedObjects","isPrimitive","getPrototypeOf","aIsArgs","isArguments","bIsArgs","ka","objectKeys","kb","sort","objEquiv","expectedException","test","isPrototypeOf","_throws","shouldThrow","block","error","_tryBlock","userProvidedMessage","isUnexpectedException","isError","options","self","generatedMessage","captureStackTrace","err","stack","fn_name","idx","next_line","substring","inherits","equal","notEqual","deepEqual","deepStrictEqual","notDeepEqual","notDeepStrictEqual","strictEqual","notStrictEqual","throws","doesNotThrow","ifError","keys","_createClass","defineProperties","props","descriptor","Constructor","protoProps","staticProps","THROW","expr","instance","_classCallCheck","tokens","charAt","parseURIFragmentIdentifier","parseJSONString","split","map","unescape","escape","decodeURIComponent","_this","token","encodeURIComponent","current","splice","supportedAlgorithms","NotSupportedError","normalizedAlgorithm","normalize","Promise","reject","sign","signature","verify","importKey","pairs","forEach","pair","response","status","errorMessage","statusText","statusCode","unquote","quote","isScheme","isToken","fetch","URL","Headers","AuthenticationRequest","AuthenticationResponse","RelyingPartySchema","onHttpError","FormUrlEncoded","RelyingParty","rp","validation","validate","valid","JSON","stringify","jwks","provider","importKeys","then","issuer","registration","url","defaults","assign","store","resolve","discover","register","pathname","json","configuration","registration_endpoint","uri","method","headers","params","body","serialize","jwks_uri","createRequest","session","validateResponse","redirect","authResponse","userinfo","userinfo_endpoint","access_token","logoutRequest","id_token_hint","post_logout_redirect_uri","state","end_session_endpoint","console","log","search","encode","href","logout","clearSession","credentials","SESSION_PRIVATE_KEY","popTokenFor","idToken","PoPToken","issueFor","DATETIME_REGEXP","URI_REGEXP","EMAIL_REGEXP","IPV4_REGEXP","IPV6_REGEXP","HOSTNAME_REGEXP","pattern","RegExp","format","formats","initialize","_typeof","iterator","constructor","schema","depth","level","declarations","member","item","declaration","index","additionalProperties","additionalItems","initializer","compile","_index","OPERATIONS","ops","operation","op","path","add","remove","pointer","indexCount","address","required","number","anyOf","allOf","not","oneOf","validations","keywords","filter","keyword","enumerated","conditions","subschema","validator","isRequired","segment","pop","patternValidations","additionalValidations","patternProperties","_schema","otherPropertiesCalled","otherProperties","minProperties","maxProperties","dependencies","dependency","_schema2","counter","minItems","maxItems","uniqueItems","minLength","maxLength","matcher","_schema3","minimum","exclusiveMinimum","_schema4","maximum","exclusiveMaximum","multipleOf","decimals","toFixed","TextEncoder","_Error","ReferenceError","_possibleConstructorReturn","subClass","superClass","setPrototypeOf","_inherits","DataError","_JSONDocument","jwk","segments","header","protected","unprotected","iv","aad","ciphertext","tag","recipients","encrypted_key","payload","signatures","verified","serialization","iss","aud","exp","nbf","iat","jti","typ","cty","jku","crit","enc","zip","_slicedToArray","_n","_d","_e","_s","_i","next","done","sliceIterator","base64url","jwt","_jwt$segments","ReflectOwnKeys","R","Reflect","ReflectApply","receiver","args","ownKeys","getOwnPropertySymbols","getOwnPropertyNames","NumberIsNaN","EventEmitter","init","_events","_eventsCount","_maxListeners","defaultMaxListeners","$getMaxListeners","_addListener","listener","prepend","events","existing","warning","newListener","emit","unshift","warned","w","emitter","count","warn","_onceWrap","fired","wrapFn","wrapped","removeListener","_listeners","unwrap","evlistener","unwrapListeners","arrayClone","listenerCount","setMaxListeners","getMaxListeners","doError","er","context","handler","listeners","addListener","on","prependListener","once","prependOnceListener","position","originalListener","shift","spliceOne","off","removeAllListeners","rawListeners","eventNames","objectWithoutPropertiesLoose","excluded","sourceSymbolKeys","propertyIsEnumerable","_format","_parse","_interopRequireDefault","_require2","_JWT","resourceServerUri","sessionKey","authorization","id_token","parse","importedSessionJwk","origin","client_id","issue","Date","now","token_type","cryptoKey","sourceKeys","_util","_toConsumableArray","arr2","_arrayWithoutHoles","iter","_iterableToArray","_nonIterableSpread","_arrayWithHoles","_iterableToArrayLimit","_nonIterableRest","build","reduce","prev","_ref","_ref2","values","transform","xxx","scheme","challenge","entries","_cur","cur","exec","parseProperties","propIsEnumerable","toObject","test1","test2","test3","letter","shouldUseNative","symbols","to","getOwnPropertyDescriptors","descriptors","getOwnPropertyDescriptor","formatRegExp","f","isString","objects","_","isNull","isObject","deprecate","fn","msg","process","noDeprecation","throwDeprecation","traceDeprecation","trace","debugEnviron","debugs","opts","ctx","seen","stylize","stylizeNoColor","colors","isBoolean","showHidden","_extend","isUndefined","customInspect","stylizeWithColor","formatValue","styleType","style","styles","recurseTimes","primitive","simple","isNumber","formatPrimitive","visibleKeys","hash","arrayToHash","formatError","output","base","braces","toUTCString","formatProperty","formatArray","numLinesEst","reduceToSingleString","desc","line","ar","re","objectToString","pad","debuglog","env","NODE_DEBUG","toUpperCase","pid","isNullOrUndefined","isSymbol","months","timestamp","time","getHours","getMinutes","getSeconds","getDate","getMonth","prop","kCustomPromisifiedSymbol","callbackifyOnRejected","reason","cb","newReason","promisify","original","promiseResolve","promiseReject","promise","custom","callbackify","callbackified","maybeCb","nextTick","rej","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","runTimeout","fun","setTimeout","clearTimeout","currentQueue","queue","draining","queueIndex","cleanUpNextTick","drainQueue","timeout","run","marker","runClearTimeout","Item","noop","title","browser","argv","version","versions","binding","cwd","chdir","umask","ctor","superCtor","super_","TempCtor","alternate","patch","mapping","project","RECOVER","Map","right","left","_defineProperty","writeable","extender","result","pad_string_1","input","fromBase64","toBase64","decode","toBuffer","b64","lens","getLens","validLen","placeHoldersLen","tmp","Arr","_byteLength","curByte","revLookup","uint8","extraBytes","parts","len2","encodeChunk","lookup","num","isLE","mLen","nBytes","eLen","eMax","eBias","nBits","NaN","rt","abs","LN2","stringLength","diff","padLength","paddedStringLength","None","HMAC","RSASSA_PKCS1_v1_5","crypto","algorithm","subtle","bitlength","usages","operations","SupportedAlgorithms","argument","registeredAlgorithms","SyntaxError","imported","importing","all","find","isJWE","JWE","encrypt","startsWith","endpoint","client","authenticate","authorization_endpoint","scope","response_type","redirect_uri","getRandomValues","nonce","digest","digests","generateSessionKeys","sessionKeys","storeSessionKeys","request_parameter_supported","encodeRequestParams","encodedParams","generateKey","modulusLength","publicExponent","keyPair","exportKey","publicKey","privateKey","jwkPair","publicJwk","privateJwk","public","private","excludeParams","keysToEncode","requestParamCompact","request","IDToken","Session","HttpError","parseResponse","errorResponse","matchRequest","validateStateParam","validateResponseMode","validateResponseParams","exchangeAuthorizationCode","validateIDToken","fromAuthResponse","errorCode","errorParams","info","octets","encoded","expectedParams","id","secret","token_endpoint","bodyContents","authMethod","tokenResponse","decryptIDToken","decodeIDToken","validateIssuer","validateAudience","resolveKeys","verifySignature","validateExpires","verifyNonce","validateAcr","validateAuthTime","validateAccessTokenHash","validateAuthorizationCodeHash","decoded","decodeError","cause","azp","expectedAlgorithm","IDTokenSchema","extend","auth_time","acr","amr","credentialType","idClaims","accessClaims","popToken","refresh_token","hasCredentials","fetchWithCredentials","bearerTokenFor","DEFAULT_MAX_AGE","StandardError","STATUS_CODE_TO_NAME","STATUS_NAME_TO_CODE","alias","statusMessage","has","proto","display","getLocation","location","currentUrl","currentUrlNoParams","navigateTo","originOf","toUrlString","NAMESPACE","Server","clientWindow","clientOrigin","handle","_clientWindow","_clientOrigin","_handler","_messageListener","event","_handleMessage","req","postMessage","addEventListener","stop","removeEventListener","defaultStorage","storage","getItem","setItem","removeItem","asyncStorage","localStorage","memStorage","async","getData","serialized","updateStorage","update","newData","getSession","login","idp","getStoredRp","redirect_uris","callbackUri","clientNameI18n","supplementaryOptions","logo_uri","logoUri","contacts","client_name","clientName","grant_types","response_types","registerRp","rpConfig","storeRp","getRegisteredRp","appHashFragment","saveAppHashFragment","sendAuthRequest","currentSession","restoreAppHashFragment","storeData","webId","origHeaders","updateHostFromResponse","resp","wwwAuthHeader","auth","WebIdOidc","host","requiresAuth","hosts","saveHost","shouldShareCredentials","requestHost","getHost","obtainSession","popup","popupServer","popupUri","foundSessionCb","popupHandler","globalFetch","SolidAuthClient","authnFetch","defaultLoginOptions","screenX","innerWidth","top","screenY","innerHeight","settings","open","openIdpPopup","_pendingSession","saveSession","callback","stopTrackSession"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,UAAWA,QAAQ,SAAUA,QAAQ,UAAWA,QAAQ,gBAChE,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,SAAU,QAAS,SAAU,eAAgBJ,GAC3B,iBAAZC,QACdA,QAAc,KAAID,EAAQG,QAAQ,UAAWA,QAAQ,SAAUA,QAAQ,UAAWA,QAAQ,iBAE1FJ,EAAY,MAAIA,EAAY,OAAK,GAAIA,EAAY,MAAQ,KAAIC,EAAQD,EAAa,OAAGA,EAAY,MAAGA,EAAa,OAAGA,EAAkB,cARxI,CASGO,OAAQ,SAASC,EAAgCC,EAAgCC,EAAgCC,GACpH,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUZ,QAGnC,IAAIC,EAASS,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHd,QAAS,IAUV,OANAe,EAAQH,GAAUI,KAAKf,EAAOD,QAASC,EAAQA,EAAOD,QAASW,GAG/DV,EAAOa,GAAI,EAGJb,EAAOD,QA0Df,OArDAW,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASnB,EAASoB,EAAMC,GAC3CV,EA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AQ6K,KAAK,sBACb7K,QAAQ/H,MAAMS,SLvEf8rB,eAA4BP,SAC3BU,EAAcV,EAAS77B,GAAQ,EAAJ,GAAUA,EAAV,CAAgBgX,QAAS,QKwEhDkB,CAAa2jB,KAKzB,SAAS6D,EAAoB7pB,GAC3B,MAAO,CACLknB,YAAalnB,EAAMA,EAAIrD,MAAM,KAAK,GAAK,GACvC4sB,SAAU,GACVvD,QAASD,KC7Gb,MAAM4C,EAAO,IAAIgB,EACFhB,YAYf,GARA7jC,OAAOwmB,oBAAoBqe,EAAgB3jC,WAAWgY,QAAQjY,IAC5D,MAAMV,EAAQsjC,EAAK5iC,GACE,mBAAVV,IACTsjC,EAAK5iC,GAAYV,EAAMO,KAAK+iC,MAKV,oBAAX/kC,OACT,GAAI,oBAAqBA,OACvBme,QAAQ6K,KAAK,+DACR,CACL,IAAIJ,GAAS,EACb1nB,OAAOC,eAAenB,OAAQ,kBAAmB,CAC/CoB,YAAY,EACZC,IAAK,KACEunB,IACHA,GAAS,EACTzK,QAAQ6K,KAAK,+CACb7K,QAAQ6K,KAAK,0CAER+b,S","file":"solid-auth-client.bundle.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"window\"), require(\"fetch\"), require(\"crypto\"), require(\"TextEncoder\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"window\", \"fetch\", \"crypto\", \"TextEncoder\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"auth\"] = factory(require(\"window\"), require(\"fetch\"), require(\"crypto\"), require(\"TextEncoder\"));\n\telse\n\t\troot[\"solid\"] = root[\"solid\"] || {}, root[\"solid\"][\"auth\"] = factory(root[\"window\"], root[\"fetch\"], root[\"crypto\"], root[\"TextEncoder\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__6__, __WEBPACK_EXTERNAL_MODULE__7__, __WEBPACK_EXTERNAL_MODULE__8__, __WEBPACK_EXTERNAL_MODULE__56__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 72);\n","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","'use strict';\n\nmodule.exports = {\n Formats: require('./Formats'),\n Initializer: require('./Initializer'),\n JSONDocument: require('./JSONDocument'),\n JSONMapping: require('./JSONMapping'),\n JSONPatch: require('./JSONPatch'),\n JSONPointer: require('./JSONPointer'),\n JSONSchema: require('./JSONSchema'),\n Validator: require('./Validator')\n};","module.exports = require('./dist/base64url').default;\nmodule.exports.default = module.exports;\n","'use strict';\n\n/**\n * @module JSON Object Signing and Encryption (JOSE)\n */\nvar JWA = require('./jose/JWA');\nvar JWK = require('./jose/JWK');\nvar JWKSet = require('./jose/JWKSet');\nvar JWT = require('./jose/JWT');\nvar JWS = require('./jose/JWS');\nvar Base64URLSchema = require('./schemas/Base64URLSchema');\nvar JOSEHeaderSchema = require('./schemas/JOSEHeaderSchema');\nvar JWKSchema = require('./schemas/JWKSchema');\nvar JWKSetSchema = require('./schemas/JWKSetSchema');\nvar JWTClaimsSetSchema = require('./schemas/JWTClaimsSetSchema');\nvar JWTSchema = require('./schemas/JWTSchema');\n\n/**\n * Export\n */\nmodule.exports = {\n JWA: JWA,\n JWK: JWK,\n JWKSet: JWKSet,\n JWT: JWT,\n JWS: JWS,\n Base64URLSchema: Base64URLSchema,\n JOSEHeaderSchema: JOSEHeaderSchema,\n JWKSchema: JWKSchema,\n JWKSetSchema: JWKSetSchema,\n JWTClaimsSetSchema: JWTClaimsSetSchema,\n JWTSchema: JWTSchema\n};","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>\n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return '<Buffer ' + str + '>'\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","module.exports = __WEBPACK_EXTERNAL_MODULE__6__;","module.exports = __WEBPACK_EXTERNAL_MODULE__7__;","module.exports = __WEBPACK_EXTERNAL_MODULE__8__;","'use strict';\n\n/**\n * Dependencies\n * @ignore\n */\n\nvar _require = require('@trust/json-document'),\n JSONSchema = _require.JSONSchema;\n\nvar _require2 = require('../formats'),\n BASE64_REGEXP = _require2.BASE64_REGEXP;\n\n/**\n * JWK Schema\n */\n\n\nvar JWKSchema = new JSONSchema({\n type: 'object',\n properties: {\n\n kty: {\n type: 'string',\n //format: 'case-sensitive',\n enum: ['RSA', 'EC', 'oct'] // other values MAY be used\n },\n\n use: {\n type: 'string',\n //format: 'case-sensitive',\n enum: ['sig', 'enc'] // other values MAY be used\n },\n\n key_ops: {\n type: 'array',\n //format: 'case-sensitive',\n items: {\n enum: ['sign', 'verify', 'encrypt', 'decrypt', 'wrapKey', 'unwrapKey', 'deriveKey', 'deriveBits'] // other values MAY be used\n }\n },\n\n alg: {\n type: 'string',\n //format: 'case-sensitive',\n enum: ['HS256', 'HS384', 'HS512', 'RS256', 'RS384', 'RS512', 'ES256', 'ES384', 'ES512', 'PS256', 'PS384', 'PS512', 'none'] // other values MAY be used\n },\n\n kid: {\n type: 'string'\n },\n\n x5u: {\n type: 'string'\n //format: 'url'\n },\n\n x5c: {\n type: 'array'\n //format: BASE64_REGEXP\n },\n\n x5t: {\n type: 'string'\n //format: BASE64_REGEXP\n }\n\n //'x5t#S256': {\n // type: 'string',\n // //format: BASE64_REGEXP\n //}\n }\n});\n\n/**\n * Export\n */\nmodule.exports = JWKSchema;","'use strict';\n\nvar objectAssign = require('object-assign');\n\n// compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js\n// original notice:\n\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>\n * @license MIT\n */\nfunction compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}\nfunction isBuffer(b) {\n if (global.Buffer && typeof global.Buffer.isBuffer === 'function') {\n return global.Buffer.isBuffer(b);\n }\n return !!(b != null && b._isBuffer);\n}\n\n// based on node assert, original notice:\n// NB: The URL to the CommonJS spec is kept just for tradition.\n// node-assert has evolved a lot since then, both in API and behavior.\n\n// http://wiki.commonjs.org/wiki/Unit_Testing/1.0\n//\n// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!\n//\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar util = require('util/');\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar pSlice = Array.prototype.slice;\nvar functionsHaveNames = (function () {\n return function foo() {}.name === 'foo';\n}());\nfunction pToString (obj) {\n return Object.prototype.toString.call(obj);\n}\nfunction isView(arrbuf) {\n if (isBuffer(arrbuf)) {\n return false;\n }\n if (typeof global.ArrayBuffer !== 'function') {\n return false;\n }\n if (typeof ArrayBuffer.isView === 'function') {\n return ArrayBuffer.isView(arrbuf);\n }\n if (!arrbuf) {\n return false;\n }\n if (arrbuf instanceof DataView) {\n return true;\n }\n if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {\n return true;\n }\n return false;\n}\n// 1. The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\n\nvar assert = module.exports = ok;\n\n// 2. The AssertionError is defined in assert.\n// new assert.AssertionError({ message: message,\n// actual: actual,\n// expected: expected })\n\nvar regex = /\\s*function\\s+([^\\(\\s]*)\\s*/;\n// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js\nfunction getName(func) {\n if (!util.isFunction(func)) {\n return;\n }\n if (functionsHaveNames) {\n return func.name;\n }\n var str = func.toString();\n var match = str.match(regex);\n return match && match[1];\n}\nassert.AssertionError = function AssertionError(options) {\n this.name = 'AssertionError';\n this.actual = options.actual;\n this.expected = options.expected;\n this.operator = options.operator;\n if (options.message) {\n this.message = options.message;\n this.generatedMessage = false;\n } else {\n this.message = getMessage(this);\n this.generatedMessage = true;\n }\n var stackStartFunction = options.stackStartFunction || fail;\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, stackStartFunction);\n } else {\n // non v8 browsers so we can have a stacktrace\n var err = new Error();\n if (err.stack) {\n var out = err.stack;\n\n // try to strip useless frames\n var fn_name = getName(stackStartFunction);\n var idx = out.indexOf('\\n' + fn_name);\n if (idx >= 0) {\n // once we have located the function frame\n // we need to strip out everything before it (and its line)\n var next_line = out.indexOf('\\n', idx + 1);\n out = out.substring(next_line + 1);\n }\n\n this.stack = out;\n }\n }\n};\n\n// assert.AssertionError instanceof Error\nutil.inherits(assert.AssertionError, Error);\n\nfunction truncate(s, n) {\n if (typeof s === 'string') {\n return s.length < n ? s : s.slice(0, n);\n } else {\n return s;\n }\n}\nfunction inspect(something) {\n if (functionsHaveNames || !util.isFunction(something)) {\n return util.inspect(something);\n }\n var rawname = getName(something);\n var name = rawname ? ': ' + rawname : '';\n return '[Function' + name + ']';\n}\nfunction getMessage(self) {\n return truncate(inspect(self.actual), 128) + ' ' +\n self.operator + ' ' +\n truncate(inspect(self.expected), 128);\n}\n\n// At present only the three keys mentioned above are used and\n// understood by the spec. Implementations or sub modules can pass\n// other keys to the AssertionError's constructor - they will be\n// ignored.\n\n// 3. All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\n\nfunction fail(actual, expected, message, operator, stackStartFunction) {\n throw new assert.AssertionError({\n message: message,\n actual: actual,\n expected: expected,\n operator: operator,\n stackStartFunction: stackStartFunction\n });\n}\n\n// EXTENSION! allows for well behaved errors defined elsewhere.\nassert.fail = fail;\n\n// 4. Pure assertion tests whether a value is truthy, as determined\n// by !!guard.\n// assert.ok(guard, message_opt);\n// This statement is equivalent to assert.equal(true, !!guard,\n// message_opt);. To test strictly for the value true, use\n// assert.strictEqual(true, guard, message_opt);.\n\nfunction ok(value, message) {\n if (!value) fail(value, true, message, '==', assert.ok);\n}\nassert.ok = ok;\n\n// 5. The equality assertion tests shallow, coercive equality with\n// ==.\n// assert.equal(actual, expected, message_opt);\n\nassert.equal = function equal(actual, expected, message) {\n if (actual != expected) fail(actual, expected, message, '==', assert.equal);\n};\n\n// 6. The non-equality assertion tests for whether two objects are not equal\n// with != assert.notEqual(actual, expected, message_opt);\n\nassert.notEqual = function notEqual(actual, expected, message) {\n if (actual == expected) {\n fail(actual, expected, message, '!=', assert.notEqual);\n }\n};\n\n// 7. The equivalence assertion tests a deep equality relation.\n// assert.deepEqual(actual, expected, message_opt);\n\nassert.deepEqual = function deepEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected, false)) {\n fail(actual, expected, message, 'deepEqual', assert.deepEqual);\n }\n};\n\nassert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected, true)) {\n fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual);\n }\n};\n\nfunction _deepEqual(actual, expected, strict, memos) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n } else if (isBuffer(actual) && isBuffer(expected)) {\n return compare(actual, expected) === 0;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (util.isDate(actual) && util.isDate(expected)) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (util.isRegExp(actual) && util.isRegExp(expected)) {\n return actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase;\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if ((actual === null || typeof actual !== 'object') &&\n (expected === null || typeof expected !== 'object')) {\n return strict ? actual === expected : actual == expected;\n\n // If both values are instances of typed arrays, wrap their underlying\n // ArrayBuffers in a Buffer each to increase performance\n // This optimization requires the arrays to have the same type as checked by\n // Object.prototype.toString (aka pToString). Never perform binary\n // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their\n // bit patterns are not identical.\n } else if (isView(actual) && isView(expected) &&\n pToString(actual) === pToString(expected) &&\n !(actual instanceof Float32Array ||\n actual instanceof Float64Array)) {\n return compare(new Uint8Array(actual.buffer),\n new Uint8Array(expected.buffer)) === 0;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else if (isBuffer(actual) !== isBuffer(expected)) {\n return false;\n } else {\n memos = memos || {actual: [], expected: []};\n\n var actualIndex = memos.actual.indexOf(actual);\n if (actualIndex !== -1) {\n if (actualIndex === memos.expected.indexOf(expected)) {\n return true;\n }\n }\n\n memos.actual.push(actual);\n memos.expected.push(expected);\n\n return objEquiv(actual, expected, strict, memos);\n }\n}\n\nfunction isArguments(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n}\n\nfunction objEquiv(a, b, strict, actualVisitedObjects) {\n if (a === null || a === undefined || b === null || b === undefined)\n return false;\n // if one is a primitive, the other must be same\n if (util.isPrimitive(a) || util.isPrimitive(b))\n return a === b;\n if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))\n return false;\n var aIsArgs = isArguments(a);\n var bIsArgs = isArguments(b);\n if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))\n return false;\n if (aIsArgs) {\n a = pSlice.call(a);\n b = pSlice.call(b);\n return _deepEqual(a, b, strict);\n }\n var ka = objectKeys(a);\n var kb = objectKeys(b);\n var key, i;\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length !== kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] !== kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects))\n return false;\n }\n return true;\n}\n\n// 8. The non-equivalence assertion tests for any deep inequality.\n// assert.notDeepEqual(actual, expected, message_opt);\n\nassert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (_deepEqual(actual, expected, false)) {\n fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);\n }\n};\n\nassert.notDeepStrictEqual = notDeepStrictEqual;\nfunction notDeepStrictEqual(actual, expected, message) {\n if (_deepEqual(actual, expected, true)) {\n fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);\n }\n}\n\n\n// 9. The strict equality assertion tests strict equality, as determined by ===.\n// assert.strictEqual(actual, expected, message_opt);\n\nassert.strictEqual = function strictEqual(actual, expected, message) {\n if (actual !== expected) {\n fail(actual, expected, message, '===', assert.strictEqual);\n }\n};\n\n// 10. The strict non-equality assertion tests for strict inequality, as\n// determined by !==. assert.notStrictEqual(actual, expected, message_opt);\n\nassert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (actual === expected) {\n fail(actual, expected, message, '!==', assert.notStrictEqual);\n }\n};\n\nfunction expectedException(actual, expected) {\n if (!actual || !expected) {\n return false;\n }\n\n if (Object.prototype.toString.call(expected) == '[object RegExp]') {\n return expected.test(actual);\n }\n\n try {\n if (actual instanceof expected) {\n return true;\n }\n } catch (e) {\n // Ignore. The instanceof check doesn't work for arrow functions.\n }\n\n if (Error.isPrototypeOf(expected)) {\n return false;\n }\n\n return expected.call({}, actual) === true;\n}\n\nfunction _tryBlock(block) {\n var error;\n try {\n block();\n } catch (e) {\n error = e;\n }\n return error;\n}\n\nfunction _throws(shouldThrow, block, expected, message) {\n var actual;\n\n if (typeof block !== 'function') {\n throw new TypeError('\"block\" argument must be a function');\n }\n\n if (typeof expected === 'string') {\n message = expected;\n expected = null;\n }\n\n actual = _tryBlock(block);\n\n message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +\n (message ? ' ' + message : '.');\n\n if (shouldThrow && !actual) {\n fail(actual, expected, 'Missing expected exception' + message);\n }\n\n var userProvidedMessage = typeof message === 'string';\n var isUnwantedException = !shouldThrow && util.isError(actual);\n var isUnexpectedException = !shouldThrow && actual && !expected;\n\n if ((isUnwantedException &&\n userProvidedMessage &&\n expectedException(actual, expected)) ||\n isUnexpectedException) {\n fail(actual, expected, 'Got unwanted exception' + message);\n }\n\n if ((shouldThrow && actual && expected &&\n !expectedException(actual, expected)) || (!shouldThrow && actual)) {\n throw actual;\n }\n}\n\n// 11. Expected to throw an error:\n// assert.throws(block, Error_opt, message_opt);\n\nassert.throws = function(block, /*optional*/error, /*optional*/message) {\n _throws(true, block, error, message);\n};\n\n// EXTENSION! This is annoying to write outside this module.\nassert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {\n _throws(false, block, error, message);\n};\n\nassert.ifError = function(err) { if (err) throw err; };\n\n// Expose a strict only variant of assert\nfunction strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}\nassert.strict = objectAssign(strict, assert, {\n equal: assert.strictEqual,\n deepEqual: assert.deepStrictEqual,\n notEqual: assert.notStrictEqual,\n notDeepEqual: assert.notDeepStrictEqual\n});\nassert.strict.strict = assert.strict;\n\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n if (hasOwn.call(obj, key)) keys.push(key);\n }\n return keys;\n};\n","'use strict';\n\n/**\n * Mode enumeration\n */\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar THROW = 0;\nvar RECOVER = 1;\nvar SILENT = 2;\n\n/**\n * JSONPointer\n *\n * @class\n * Implements RFC 6901: JavaScript Object Notation (JSON) Pointer\n * https://tools.ietf.org/html/rfc6901\n */\n\nvar JSONPointer = function () {\n\n /**\n * Constructor\n */\n function JSONPointer(expr, mode) {\n _classCallCheck(this, JSONPointer);\n\n this.expr = expr;\n this.mode = mode || THROW;\n this.tokens = expr && expr.charAt(0) === '#' ? this.parseURIFragmentIdentifier(expr) : this.parseJSONString(expr);\n }\n\n /**\n * Escape\n */\n\n\n _createClass(JSONPointer, [{\n key: 'escape',\n value: function escape(expr) {\n return expr.replace(/~/g, '~0').replace(/\\//g, '~1');\n }\n\n /**\n * Unescape\n */\n\n }, {\n key: 'unescape',\n value: function unescape(expr) {\n return expr.replace(/~1/g, '/').replace(/~0/g, '~');\n }\n\n /**\n * Parse\n */\n\n }, {\n key: 'parseJSONString',\n\n\n /**\n * Parse JSON String\n *\n * @description Parse an expression into a list of tokens\n * @param {string} expr\n * @returns {Array}\n */\n value: function parseJSONString(expr) {\n if (typeof expr !== 'string') {\n throw new Error('JSON Pointer must be a string');\n }\n\n if (expr === '') {\n return [];\n }\n\n if (expr.charAt(0) !== '/') {\n throw new Error('Invalid JSON Pointer');\n }\n\n if (expr === '/') {\n return [''];\n }\n\n return expr.substr(1).split('/').map(this.unescape);\n }\n\n /**\n * To JSON String\n *\n * @description Render a JSON string representation of a pointer\n * @returns {string}\n */\n\n }, {\n key: 'toJSONString',\n value: function toJSONString() {\n return '/' + this.tokens.map(this.escape).join('/');\n }\n\n /**\n * Parse URI Fragment Identifer\n */\n\n }, {\n key: 'parseURIFragmentIdentifier',\n value: function parseURIFragmentIdentifier(expr) {\n if (typeof expr !== 'string') {\n throw new Error('JSON Pointer must be a string');\n }\n\n if (expr.charAt(0) !== '#') {\n throw new Error('Invalid JSON Pointer URI Fragment Identifier');\n }\n\n return this.parseJSONString(decodeURIComponent(expr.substr(1)));\n }\n\n /**\n * To URI Fragment Identifier\n *\n * @description Render a URI Fragment Identifier representation of a pointer\n * @returns {string}\n */\n\n }, {\n key: 'toURIFragmentIdentifier',\n value: function toURIFragmentIdentifier() {\n var _this = this;\n\n var value = this.tokens.map(function (token) {\n return encodeURIComponent(_this.escape(token));\n }).join('/');\n\n return '#/' + value;\n }\n\n /**\n * Get\n *\n * @description Get a value from the source object referenced by the pointer\n * @param {Object} source\n * @returns {*}\n */\n\n }, {\n key: 'get',\n value: function get(source) {\n var current = source;\n var tokens = this.tokens;\n\n for (var i = 0; i < tokens.length; i++) {\n if (!current || current[tokens[i]] === undefined) {\n if (this.mode !== THROW) {\n return undefined;\n } else {\n throw new Error('Invalid JSON Pointer reference');\n }\n }\n\n current = current[tokens[i]];\n }\n\n return current;\n }\n\n /**\n * Add\n *\n * @description Set a value on a target object referenced by the pointer. Put\n * will insert an array element. To change an existing array elemnent, use\n * `pointer.set()`\n * @param {Object} target\n * @param {*} value\n */\n\n }, {\n key: 'add',\n value: function add(target, value) {\n var tokens = this.tokens;\n var current = target;\n\n // iterate through the tokens\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n // set the property on the target location\n if (i === tokens.length - 1) {\n if (token === '-') {\n current.push(value);\n } else if (Array.isArray(current)) {\n current.splice(token, 0, value);\n } else if (value !== undefined) {\n current[token] = value;\n }\n\n // handle missing target location based on \"mode\"\n } else if (!current[token]) {\n switch (this.mode) {\n case THROW:\n throw new Error('Invalid JSON Pointer reference');\n\n case RECOVER:\n current = current[token] = parseInt(token) ? [] : {};\n break;\n\n case SILENT:\n return;\n\n default:\n throw new Error('Invalid pointer mode');\n }\n\n // reference the next object in the path\n } else {\n current = current[token];\n }\n }\n }\n\n /**\n * Replace\n *\n * @description Set a value on a target object referenced by the pointer. Set will\n * overwrite an existing array element at the target location.\n * @param {Object} target\n * @param {*} value\n */\n\n }, {\n key: 'replace',\n value: function replace(target, value) {\n var tokens = this.tokens;\n var current = target;\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (i === tokens.length - 1) {\n current[token] = value;\n } else if (!current[token]) {\n current = current[token] = parseInt(token) ? [] : {};\n } else {\n current = current[token];\n }\n }\n }\n\n /**\n * Del\n *\n * - if this is an array it should splice the value out\n */\n\n }, {\n key: 'remove',\n value: function remove(target) {\n var tokens = this.tokens;\n var current = target;\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (current === undefined || current[token] === undefined) {\n return undefined;\n } else if (Array.isArray(current)) {\n current.splice(token, 1);\n return undefined;\n } else if (i === tokens.length - 1) {\n delete current[token];\n }\n\n current = current[token];\n }\n\n // delete from the target\n }\n }], [{\n key: 'parse',\n value: function parse(expr) {\n return new JSONPointer(expr);\n }\n }]);\n\n return JSONPointer;\n}();\n\n/**\n * Exports\n */\n\n\nmodule.exports = JSONPointer;","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Dependencies\n *\n * TODO\n * - switch between Node.js webcrypto package and browser implementation\n */\nvar base64url = require('base64url');\nvar supportedAlgorithms = require('../algorithms');\n\nvar _require = require('../errors'),\n NotSupportedError = _require.NotSupportedError;\n\n/**\n * JWA\n * https://tools.ietf.org/html/rfc7518\n */\n\n\nvar JWA = function () {\n function JWA() {\n _classCallCheck(this, JWA);\n }\n\n _createClass(JWA, null, [{\n key: 'sign',\n\n\n /**\n * Sign\n *\n * @description\n * Create a digital signature.\n *\n * @param {string} alg\n * @param {CryptoKey} key\n * @param {string|Buffer} data\n *\n * @return {Promise}\n */\n value: function sign(alg, key, data) {\n // normalize the algorithm\n var normalizedAlgorithm = supportedAlgorithms.normalize('sign', alg);\n\n // validate algorithm is supported\n if (normalizedAlgorithm instanceof Error) {\n return Promise.reject(new NotSupportedError(alg));\n }\n\n // validate type of key\n // TODO\n // - is the key suitable for the algorithm?\n // - does that get validated in webcrypto?\n //if (key instanceof CryptoKey) {\n // return Promise.reject(new InvalidKeyError())\n //}\n\n // sign the data\n return normalizedAlgorithm.sign(key, data);\n }\n\n /**\n * Verify\n *\n * @description\n * Verify a digital signature.\n *\n * @param {string} alg\n * @param {CryptoKey} privateKey\n * @param {string|Buffer} signature\n * @param {string|Buffer} data\n *\n * @return {Promise}\n */\n\n }, {\n key: 'verify',\n value: function verify(alg, key, signature, data) {\n var normalizedAlgorithm = supportedAlgorithms.normalize('verify', alg);\n\n if (normalizedAlgorithm instanceof Error) {\n return Promise.reject(new NotSupportedError(alg));\n }\n\n // TODO\n // validate publicKey\n\n // verify the signature\n return normalizedAlgorithm.verify(key, signature, data);\n }\n\n /**\n * Encrypt\n */\n\n /**\n * Decrypt\n */\n\n /**\n * Import\n */\n\n }, {\n key: 'importKey',\n value: function importKey(key) {\n var normalizedAlgorithm = supportedAlgorithms.normalize('importKey', key.alg);\n return normalizedAlgorithm.importKey(key);\n }\n }]);\n\n return JWA;\n}();\n\n/**\n * Export\n */\n\n\nmodule.exports = JWA;","/**\n * Dependencies\n */\n\n/**\n * FormUrlEncoded\n */\nclass FormUrlEncoded {\n\n /**\n * Encode\n *\n * @description\n * Represent an object as x-www-form-urlencoded string.\n *\n * @param {Object} data\n * @returns {string}\n */\n static encode (data) {\n let pairs = []\n\n Object.keys(data).forEach(function (key) {\n pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(data[key]))\n })\n\n return pairs.join('&')\n }\n\n /**\n * Decode\n *\n * @description\n * Parse a x-www-form-urlencoded into an object.\n *\n * @param {string} data\n * @returns {Object}\n */\n static decode (data) {\n let obj = {}\n\n data.split('&').forEach(function (property) {\n let pair = property.split('=')\n let key = decodeURIComponent(pair[0])\n let val = decodeURIComponent(pair[1])\n\n obj[key] = val\n })\n\n return obj\n }\n}\n\n/**\n * Export\n */\nmodule.exports = FormUrlEncoded\n","'use strict'\n\n/**\n * Throws an error when a fetch response status code indicates a 400 or 500\n * HTTP error. (The whatwg fetch api does not normally reject on http error\n * responses).\n *\n * Usage:\n *\n * ```\n * return fetch(url)\n * .then(onHttpError('Error while fetching resource')\n * .catch(err => console.log(err))\n *\n * // -> 'Error while fetching resource: 404 Not Found' error\n * // if a 404 response is encountered\n * ```\n *\n * @param [message] {string} Optional error message to clarify context\n *\n * @throws {Error} For http status codes > 300\n *\n * @return {Object} fetch response object (passed through if no error)\n */\nfunction onHttpError (message = 'fetch error') {\n return (response) => {\n if (response.status >= 200 && response.status < 300) {\n return response\n }\n\n let errorMessage = `${message}: ${response.status} ${response.statusText}`\n let error = new Error(errorMessage)\n error.response = response\n error.statusCode = response.status\n throw error\n }\n}\n\nmodule.exports = onHttpError\n","'use strict'\n\nmodule.exports = require('./RelyingParty')\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.unquote = exports.quote = exports.isScheme = exports.isToken = void 0;\nvar token = /^[^\\u0000-\\u001F\\u007F()<>@,;:\\\\\"/?={}\\[\\]\\u0020\\u0009]+$/;\n\nvar isToken = function isToken(str) {\n return typeof str === 'string' && token.test(str);\n};\n\nexports.isToken = isToken;\nvar isScheme = isToken;\nexports.isScheme = isScheme;\n\nvar quote = function quote(str) {\n return `\"${str.replace(/\"/g, '\\\\\"')}\"`;\n};\n\nexports.quote = quote;\n\nvar unquote = function unquote(str) {\n return str.substr(1, str.length - 2).replace(/\\\\\"/g, '\"');\n};\n\nexports.unquote = unquote;\n//# sourceMappingURL=util.js.map","/**\n * Dependencies\n */\nconst assert = require('assert')\nconst fetch = require('node-fetch')\nconst { URL } = require('whatwg-url')\nconst Headers = fetch.Headers ? fetch.Headers : global.Headers\nconst {JSONDocument} = require('@trust/json-document')\nconst {JWKSet} = require('@solid/jose')\nconst AuthenticationRequest = require('./AuthenticationRequest')\nconst AuthenticationResponse = require('./AuthenticationResponse')\nconst RelyingPartySchema = require('./RelyingPartySchema')\nconst onHttpError = require('./onHttpError')\nconst FormUrlEncoded = require('./FormUrlEncoded')\n\n/**\n * RelyingParty\n *\n * @class\n * Client interface for OpenID Connect Relying Party.\n *\n * @example\n * let client = RelyingParty({\n * provider: {\n * name: 'Anvil Research, Inc.',\n * url: 'https://forge.anvil.io'\n * // configuration\n * // jwks\n * },\n * defaults: {\n * popToken: false,\n * authenticate: {\n * response_type: 'code',\n * display: 'popup',\n * scope: 'openid profile email'\n * },\n * register: {\n * client_name: 'Example',\n * client_uri: 'https://example.com',\n * logo_uri: 'https://example.com/assets/logo.png',\n * redirect_uris: ['https://app.example.com/callback'],\n * response_types: ['code', 'code id_token token'],\n * grant_types: ['authorization_code'],\n * default_max_age: 7200,\n * post_logout_redirect_uris: ['https://app.example.com']\n * },\n * },\n * registration: {\n * // if you have it saved somewhere\n * },\n * store: localStorage || req.session\n * })\n *\n * client.discover() => Promise\n * client.jwks() => Promise\n * client.authenticate()\n * client.authenticateUri()\n * client.validateResponse(uri) => Promise\n * client.userinfo() => Promise\n * client.logout()\n */\nclass RelyingParty extends JSONDocument {\n\n /**\n * Schema\n */\n static get schema () {\n return RelyingPartySchema\n }\n\n /**\n * from\n *\n * @description\n * Create a RelyingParty instance from a previously registered client.\n *\n * @param {Object} data\n * @returns {Promise<RelyingParty>}\n */\n static from (data) {\n let rp = new RelyingParty(data)\n let validation = rp.validate()\n\n // schema validation\n if (!validation.valid) {\n return Promise.reject(new Error(JSON.stringify(validation)))\n }\n\n let jwks = rp.provider.jwks\n\n // request the JWK Set if missing\n if (!jwks) {\n return rp.jwks().then(() => rp)\n }\n\n // otherwise import the JWK Set to webcrypto\n return JWKSet.importKeys(jwks).then(jwks => {\n rp.provider.jwks = jwks\n return rp\n })\n }\n\n /**\n * register\n *\n * @param issuer {string} Provider URL\n * @param registration {Object} Client dynamic registration options\n * @param options {Object}\n * @param options.defaults\n * @param [options.store] {Session|Storage}\n * @returns {Promise<RelyingParty>} RelyingParty instance, registered.\n */\n static register (issuer, registration, options) {\n let rp = new RelyingParty({\n provider: { url: issuer },\n defaults: Object.assign({}, options.defaults),\n store: options.store\n })\n\n return Promise.resolve()\n .then(() => rp.discover())\n .then(() => rp.jwks())\n .then(() => rp.register(registration))\n .then(() => rp)\n }\n\n /**\n * Discover\n *\n * @description Fetches the issuer's OpenID Configuration.\n * @returns {Promise<Object>} Resolves with the provider configuration response\n */\n discover () {\n try {\n let issuer = this.provider.url\n\n assert(issuer, 'RelyingParty provider must define \"url\"')\n\n let url = new URL(issuer)\n url.pathname = '.well-known/openid-configuration'\n\n return fetch(url.toString())\n .then(onHttpError('Error fetching openid configuration'))\n .then(response => {\n return response.json().then(json => this.provider.configuration = json)\n })\n\n } catch (error) {\n return Promise.reject(error)\n }\n }\n\n /**\n * Register\n *\n * @description Register's a client with provider as a Relying Party\n *\n * @param options {Object}\n * @returns {Promise<Object>} Resolves with the registration response object\n */\n register (options) {\n try {\n let configuration = this.provider.configuration\n\n assert(configuration, 'OpenID Configuration is not initialized.')\n assert(configuration.registration_endpoint, 'OpenID Configuration is missing registration_endpoint.')\n\n let uri = configuration.registration_endpoint\n let method = 'post'\n let headers = new Headers({ 'Content-Type': 'application/json' })\n let params = this.defaults.register\n let body = JSON.stringify(Object.assign({}, params, options))\n\n return fetch(uri, {method, headers, body})\n .then(onHttpError('Error registering client'))\n .then(response => {\n return response.json().then(json => this.registration = json)\n })\n\n } catch (error) {\n return Promise.reject(error)\n }\n }\n\n serialize () {\n return JSON.stringify(this)\n }\n\n /**\n * jwks\n *\n * @description Promises the issuer's JWK Set.\n * @returns {Promise}\n */\n jwks () {\n try {\n let configuration = this.provider.configuration\n\n assert(configuration, 'OpenID Configuration is not initialized.')\n assert(configuration.jwks_uri, 'OpenID Configuration is missing jwks_uri.')\n\n let uri = configuration.jwks_uri\n\n return fetch(uri)\n .then(onHttpError('Error resolving provider keys'))\n .then(response => {\n return response\n .json()\n .then(json => JWKSet.importKeys(json))\n .then(jwks => this.provider.jwks = jwks)\n })\n\n } catch (error) {\n return Promise.reject(error)\n }\n }\n\n /**\n * createRequest\n *\n * @param options {Object} Authn request options hashmap\n * @param options.redirect_uri {string}\n * @param options.response_type {string} e.g. 'code' or 'id_token token'\n * @param session {Session|Storage} req.session or localStorage\n * @returns {Promise<string>} Authn request URL\n */\n createRequest (options, session) {\n return AuthenticationRequest.create(this, options, session || this.store)\n }\n\n /**\n * Validate Response\n *\n * @param response {string} req.query or req.body.text\n * @param session {Session|Storage} req.session or localStorage or similar\n *\n * @returns {Promise<Session>}\n */\n validateResponse (response, session = this.store) {\n let options\n\n if (response.match(/^http(s?):\\/\\//)) {\n options = { rp: this, redirect: response, session }\n } else {\n options = { rp: this, body: response, session }\n }\n\n const authResponse = new AuthenticationResponse(options)\n\n return AuthenticationResponse.validateResponse(authResponse)\n }\n\n /**\n * userinfo\n *\n * @description Promises the authenticated user's claims.\n * @returns {Promise}\n */\n userinfo () {\n try {\n let configuration = this.provider.configuration\n\n assert(configuration, 'OpenID Configuration is not initialized.')\n assert(configuration.userinfo_endpoint, 'OpenID Configuration is missing userinfo_endpoint.')\n\n let uri = configuration.userinfo_endpoint\n let access_token = this.store.access_token\n\n assert(access_token, 'Missing access token.')\n\n let headers = new Headers({\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${access_token}`\n })\n\n return fetch(uri, {headers})\n .then(onHttpError('Error fetching userinfo'))\n .then(response => response.json())\n\n } catch (error) {\n return Promise.reject(error)\n }\n }\n\n /**\n * logoutRequest\n *\n * Composes and returns the logout request URI, based on the OP's\n * `end_session_endpoint`, with appropriate parameters.\n *\n * Note: Calling client code has the responsibility to clear the local\n * session state (for example, by calling `rp.clearSession()`). In addition,\n * some IdPs (such as Google) may not provide an `end_session_endpoint`,\n * in which case, this method will return null.\n *\n * @see https://openid.net/specs/openid-connect-session-1_0.html#RPLogout\n *\n * @throws {Error} If provider config is not initialized\n *\n * @throws {Error} If `post_logout_redirect_uri` was provided without a\n * corresponding `id_token_hint`\n *\n * @param [options={}] {object}\n *\n * @param [options.id_token_hint] {string} RECOMMENDED.\n * Previously issued ID Token passed to the logout endpoint as\n * a hint about the End-User's current authenticated session with the\n * Client. This is used as an indication of the identity of the End-User\n * that the RP is requesting be logged out by the OP. The OP *need not* be\n * listed as an audience of the ID Token when it is used as an\n * `id_token_hint` value.\n *\n * @param [options.post_logout_redirect_uri] {string} OPTIONAL. URL to which\n * the RP is requesting that the End-User's User Agent be redirected after\n * a logout has been performed. The value MUST have been previously\n * registered with the OP, either using the `post_logout_redirect_uris`\n * Registration parameter or via another mechanism. If supplied, the OP\n * SHOULD honor this request following the logout.\n *\n * Note: The requirement to validate the uri for previous registration means\n * that, in practice, the `id_token_hint` is REQUIRED if\n * `post_logout_redirect_uri` is used. Otherwise, the OP has no way to get\n * the `client_id` to load the saved client registration, to validate the\n * uri. The only way it can get it is by decoding the `id_token_hint`.\n *\n * @param [options.state] {string} OPTIONAL. Opaque value used by the RP to\n * maintain state between the logout request and the callback to the\n * endpoint specified by the `post_logout_redirect_uri` query parameter. If\n * included in the logout request, the OP passes this value back to the RP\n * using the `state` query parameter when redirecting the User Agent back to\n * the RP.\n *\n * TODO: In the future, consider adding `response_mode` param, for the OP to\n * determine how to return the `state` back the RP.\n * @see http://openid.net/specs/oauth-v2-multiple-response-types-1_0.html#ResponseModes\n *\n * TODO: Handle special cases for popular providers (Google, MSFT)\n *\n * @returns {string|null} Logout uri (or null if no end_session_endpoint was\n * provided in the IdP config)\n */\n logoutRequest (options = {}) {\n const { id_token_hint, post_logout_redirect_uri, state } = options\n let configuration\n\n assert(this.provider, 'OpenID Configuration is not initialized')\n configuration = this.provider.configuration\n assert(configuration, 'OpenID Configuration is not initialized')\n\n if (!configuration.end_session_endpoint) {\n console.log(`OpenId Configuration for ` +\n `${configuration.issuer} is missing end_session_endpoint`)\n return null\n }\n\n if (post_logout_redirect_uri && !id_token_hint) {\n throw new Error('id_token_hint is required when using post_logout_redirect_uri')\n }\n\n const params = {}\n\n if (id_token_hint) {\n params.id_token_hint = id_token_hint\n }\n if (post_logout_redirect_uri) {\n params.post_logout_redirect_uri = post_logout_redirect_uri\n }\n if (state) {\n params.state = state\n }\n\n const url = new URL(configuration.end_session_endpoint)\n url.search = FormUrlEncoded.encode(params)\n\n return url.href\n }\n\n /**\n * Logout\n *\n * @deprecated\n *\n * TODO: Add deprecation warnings, then remove. Client code should\n * use `logoutRequest()` instead\n *\n * @returns {Promise}\n */\n logout () {\n let configuration\n try {\n assert(this.provider, 'OpenID Configuration is not initialized.')\n configuration = this.provider.configuration\n assert(configuration, 'OpenID Configuration is not initialized.')\n assert(configuration.end_session_endpoint,\n 'OpenID Configuration is missing end_session_endpoint.')\n } catch (error) {\n return Promise.reject(error)\n }\n\n if (!configuration.end_session_endpoint) {\n this.clearSession()\n return Promise.resolve(undefined)\n }\n\n let uri = configuration.end_session_endpoint\n let method = 'get'\n\n return fetch(uri, {method, credentials: 'include'})\n .then(onHttpError('Error logging out'))\n .then(() => this.clearSession())\n\n // TODO: Validate `frontchannel_logout_uri` if necessary\n /**\n * frontchannel_logout_uri - OPTIONAL. RP URL that will cause the RP to log\n * itself out when rendered in an iframe by the OP.\n *\n * An `iss` (issuer) query parameter and a `sid`\n * (session ID) query parameter MAY be included by the OP to enable the RP\n * to validate the request and to determine which of the potentially\n * multiple sessions is to be logged out. If a sid (session ID) query\n * parameter is included, an iss (issuer) query parameter MUST also be\n * included.\n * @see https://openid.net/specs/openid-connect-frontchannel-1_0.html#RPLogout\n */\n }\n\n clearSession () {\n let session = this.store\n\n if (!session) { return }\n\n delete session[SESSION_PRIVATE_KEY]\n }\n\n /**\n * @param uri {string} Target Resource Server URI\n * @param idToken {IDToken} ID Token to be embedded in the PoP token\n *\n * @returns {Promise<PoPToken>}\n */\n popTokenFor (uri, idToken) {\n return PoPToken.issueFor(uri, idToken)\n }\n}\n\nconst SESSION_PRIVATE_KEY = 'oidc.session.privateKey'\n\nRelyingParty.SESSION_PRIVATE_KEY = SESSION_PRIVATE_KEY\n\nmodule.exports = RelyingParty\n","'use strict';\n\n/**\n * JSON Schema Formats\n *\n * TODO\n * Is there a good way to express these over multiple lines with comments\n * for easier debugging and auditing?\n */\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar DATETIME_REGEXP = /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d[t\\s][0-2]\\d:[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:z|[+-]\\d\\d:\\d\\d)$/i;\nvar URI_REGEXP = /^(?:[a-z][a-z0-9+-.]*)?(?:\\:|\\/)\\/?[^\\s]*$/i;\nvar EMAIL_REGEXP = /^[a-z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i;\nvar IPV4_REGEXP = /^(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$/;\nvar IPV6_REGEXP = /^\\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(?:%.+)?\\s*$/i;\nvar HOSTNAME_REGEXP = /^[a-z](?:(?:[-0-9a-z]{0,61})?[0-9a-z])?(\\.[a-z](?:(?:[-0-9a-z]{0,61})?[0-9a-z])?)*$/i;\n\n/**\n * Formats\n */\n\nvar Formats = function () {\n function Formats() {\n _classCallCheck(this, Formats);\n }\n\n _createClass(Formats, [{\n key: 'register',\n\n\n /**\n * Register\n *\n * @description\n * Register a new mapping from named format to RegExp instance\n *\n * TODO\n * We can do some extra validation of the RegExp to\n * ensure it's the acceptable subset of RegExps allowed\n * by JSON Schema.\n *\n * @param {string} name\n * @param {RegExp} pattern\n * @returns {RegExp}\n */\n value: function register(name, pattern) {\n // verify name is a string\n if (typeof name !== 'string') {\n throw new Error('Format name must be a string');\n }\n\n // cast a string to RegExp\n if (typeof pattern === 'string') {\n pattern = new RegExp(pattern);\n }\n\n return this[name] = pattern;\n }\n\n /**\n * Resolve\n *\n * @description\n * Given a format name, return the corresponding registered validation. In the\n * event a format is not registered, throw an error.\n *\n * @param {string} name\n * @returns {RegExp}\n */\n\n }, {\n key: 'resolve',\n value: function resolve(name) {\n var format = this[name];\n\n if (!format) {\n throw new Error('Unknown JSON Schema format.');\n }\n\n return format;\n }\n\n /**\n * Test\n *\n * @description\n * Test that a value conforms to a format.\n *\n * @param {string} name\n * @param {string} value\n * @returns {Boolean}\n */\n\n }, {\n key: 'test',\n value: function test(name, value) {\n var format = this.resolve(name);\n return format.test(value);\n }\n }], [{\n key: 'initialize',\n\n\n /**\n * Initialize\n *\n * @description\n * Create a new Formats instance and register default formats\n *\n * @returns {Formats}\n */\n value: function initialize() {\n var formats = new Formats();\n formats.register('date-time', DATETIME_REGEXP);\n formats.register('uri', URI_REGEXP);\n formats.register('email', EMAIL_REGEXP);\n formats.register('ipv4', IPV4_REGEXP);\n formats.register('ipv6', IPV6_REGEXP);\n formats.register('hostname', HOSTNAME_REGEXP);\n return formats;\n }\n }]);\n\n return Formats;\n}();\n\n/**\n * Export\n */\n\n\nmodule.exports = Formats.initialize();","'use strict';\n\n/**\n * Initializer\n */\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Initializer = function () {\n\n /**\n * constructor\n */\n function Initializer(schema, options) {\n _classCallCheck(this, Initializer);\n\n Object.assign(this, options || {});\n this.root = this.root || this;\n\n this.root.depth = this.root.depth || 1;\n\n if (this.level > this.root.depth) {\n this.root.depth = this.level;\n }\n\n this.level = this.level || 0;\n this.schema = schema;\n }\n\n /**\n * compile (static)\n */\n\n\n _createClass(Initializer, [{\n key: 'compile',\n\n\n /**\n * compile\n */\n value: function compile() {\n var root = this.root,\n depth = this.depth,\n level = this.level;\n\n var declarations = '';\n var body = '';\n\n // traverse the schema and generate code\n body += this.default();\n body += this.properties();\n //body += this.additionalProperties()\n body += this.items();\n //body += this.additionalItems()\n\n\n // value\n body += this.member();\n body += this.item();\n\n // after traversing the schema\n // generate the variable declarations\n if (root === this) {\n for (var i = 1; i <= this.root.depth; i++) {\n declarations += this.declaration(i);\n }\n\n return '\\n options = options || {}\\n\\n if (options.filter === false) {\\n Object.assign(target, JSON.parse(JSON.stringify(source)))\\n }\\n\\n ' + declarations + '\\n ' + body + '\\n ';\n }\n\n return body;\n }\n\n /**\n * declaration\n */\n\n }, {\n key: 'declaration',\n value: function declaration(level) {\n return '\\n var target' + level + '\\n var source' + level + '\\n var count' + level + '\\n ';\n }\n\n /**\n * default\n */\n\n }, {\n key: 'default',\n value: function _default() {\n var schema = this.schema,\n level = this.level,\n key = this.key,\n index = this.index;\n var value = schema.default; // rename default to value because it's a keyword and syntax highlighter breaks\n\n var block = '';\n\n if (schema.hasOwnProperty('default')) {\n\n if (key) {\n block += '\\n target' + level + '[\\'' + key + '\\'] = ' + JSON.stringify(value) + '\\n ';\n }\n\n if (index) {\n block += '\\n target' + level + '[' + index + '] = ' + JSON.stringify(value) + '\\n ';\n }\n\n if (level > 1) {\n block += '\\n count' + level + '++\\n ';\n }\n\n block = '\\n if (options.defaults !== false) {\\n ' + block + '\\n }\\n ';\n }\n\n return block;\n }\n\n /**\n * member\n */\n\n }, {\n key: 'member',\n value: function member() {\n var schema = this.schema,\n root = this.root,\n level = this.level,\n key = this.key;\n var properties = schema.properties,\n additionalProperties = schema.additionalProperties,\n items = schema.items,\n additionalItems = schema.additionalItems;\n\n var block = '';\n\n // `key` tells us to treat this subschema as an object member vs an array item\n // and the absence of the other values here indicates we are dealing with a\n // primitive value\n if (key && !properties && !additionalProperties && !items && !additionalItems) {\n\n // first generate the assignment statement\n block += '\\n target' + level + '[\\'' + key + '\\'] = source' + level + '[\\'' + key + '\\']\\n ';\n\n // for nested container objects, add the counter incrementing statement\n if (level > 1) {\n block += '\\n count' + level + '++\\n ';\n }\n\n // wrap the foregoing in a check for presence on the source\n block = '\\n if (source' + level + '.hasOwnProperty(\\'' + key + '\\')) {\\n ' + block + '\\n }\\n ';\n }\n\n return block;\n }\n\n /**\n * item\n */\n\n }, {\n key: 'item',\n value: function item() {\n var schema = this.schema,\n root = this.root,\n level = this.level,\n index = this.index;\n var properties = schema.properties,\n additionalProperties = schema.additionalProperties,\n items = schema.items,\n additionalItems = schema.additionalItems;\n\n var block = '';\n\n if (index && !properties && !additionalProperties && !items && !additionalItems) {\n\n block += '\\n target' + level + '[' + index + '] = source' + level + '[' + index + ']\\n ';\n\n if (level > 1) {\n block += '\\n count' + level + '++\\n ';\n }\n\n block = '\\n if (' + index + ' < len) {\\n ' + block + '\\n }\\n ';\n }\n\n return block;\n }\n\n /**\n * properties\n */\n\n }, {\n key: 'properties',\n value: function properties() {\n var schema = this.schema,\n root = this.root,\n level = this.level,\n key = this.key,\n index = this.index;\n var properties = schema.properties;\n\n var block = '';\n\n if (properties) {\n Object.keys(properties).forEach(function (key) {\n var subschema = properties[key];\n var initializer = new Initializer(subschema, { key: key, root: root, level: level + 1 });\n\n block += initializer.compile();\n });\n\n // root-level properties boilerplate\n if (root === this) {\n block = '\\n if (typeof source === \\'object\\' && source !== null && !Array.isArray(source)) {\\n if (typeof target !== \\'object\\') {\\n throw new Error(\\'?\\')\\n }\\n\\n source1 = source\\n target1 = target\\n count1 = 0\\n\\n ' + block + '\\n }\\n ';\n\n // nested properties boilerplate\n } else {\n\n if (index) {\n block = '\\n if (' + index + ' < source' + level + '.length || typeof source' + level + '[' + index + '] === \\'object\\') {\\n\\n source' + (level + 1) + ' = source' + level + '[' + index + '] || {}\\n count' + (level + 1) + ' = 0\\n\\n if (' + index + ' < target' + level + '.length || typeof target' + level + '[' + index + '] !== \\'object\\') {\\n target' + (level + 1) + ' = {}\\n if (' + index + ' < source' + level + '.length) {\\n count' + (level + 1) + '++\\n }\\n } else {\\n target' + (level + 1) + ' = target' + level + '[' + index + ']\\n }\\n\\n ' + block + '\\n\\n if (count' + (level + 1) + ' > 0) {\\n target' + level + '[' + index + '] = target' + (level + 1) + '\\n count' + level + '++\\n }\\n\\n } else {\\n target' + level + '[' + index + '] = source' + level + '[' + index + ']\\n count' + level + '++\\n }\\n ';\n }\n\n if (key) {\n block = '\\n if ((typeof source' + level + '[\\'' + key + '\\'] === \\'object\\'\\n && source' + level + '[\\'' + key + '\\'] !== null\\n && !Array.isArray(source' + level + '[\\'' + key + '\\']))\\n || !source' + level + '.hasOwnProperty(\\'' + key + '\\')) {\\n\\n source' + (level + 1) + ' = source' + level + '[\\'' + key + '\\'] || {}\\n count' + (level + 1) + ' = 0\\n\\n if (!target' + level + '.hasOwnProperty(\\'' + key + '\\')\\n || typeof target' + level + '[\\'' + key + '\\'] !== \\'object\\'\\n || target' + level + '[\\'' + key + '\\'] === null\\n || Array.isArray(target' + level + '[\\'' + key + '\\'])) {\\n target' + (level + 1) + ' = {}\\n if (source' + level + '.hasOwnProperty(\\'' + key + '\\')) {\\n count' + (level + 1) + '++\\n }\\n } else {\\n target' + (level + 1) + ' = target' + level + '[\\'' + key + '\\']\\n count' + (level + 1) + '++\\n }\\n\\n ' + block + '\\n\\n if (count' + (level + 1) + ' > 0) {\\n target' + level + '[\\'' + key + '\\'] = target' + (level + 1) + '\\n count' + level + '++\\n }\\n\\n } else {\\n target' + level + '[\\'' + key + '\\'] = source' + level + '[\\'' + key + '\\']\\n count' + level + '++\\n }\\n ';\n }\n }\n }\n\n return block;\n }\n\n /**\n *\n */\n\n }, {\n key: 'additionalProperties',\n value: function additionalProperties() {}\n\n /**\n * items\n */\n\n }, {\n key: 'items',\n value: function items() {\n var schema = this.schema,\n root = this.root,\n level = this.level,\n key = this.key,\n index = this.index;\n var items = schema.items;\n\n var block = '';\n\n if (items) {\n\n if (Array.isArray(items)) {\n // TODO\n //\n //\n //\n //\n //\n // ...\n\n } else if ((typeof items === 'undefined' ? 'undefined' : _typeof(items)) === 'object' && items !== null) {\n var _index = 'i' + (level + 1);\n var initializer = new Initializer(items, { index: _index, root: root, level: level + 1 });\n\n block += '\\n var sLen = source' + (level + 1) + '.length || 0\\n var tLen = target' + (level + 1) + '.length || 0\\n var len = 0\\n\\n if (sLen > len) { len = sLen }\\n // THIS IS WRONG, CAUSED SIMPLE ARRAY INIT TO FAIL (OVERWRITE\\n // EXISTING TARGET VALUES WITH UNDEFINED WHEN SOURCE IS SHORTER THAN\\n // TARGET). LEAVING HERE UNTIL WE FINISH TESTING AND SEE WHY IT MIGHT\\n // HAVE BEEN HERE IN THE FIRST PLACE.\\n //\\n // if (tLen > len) { len = tLen }\\n\\n for (var ' + _index + ' = 0; ' + _index + ' < len; ' + _index + '++) {\\n ' + initializer.compile() + '\\n }\\n ';\n }\n\n // root-level properties boilerplate\n if (root === this) {\n block = '\\n if (Array.isArray(source)) {\\n if (!Array.isArray(target)) {\\n throw new Error(\\'?\\')\\n }\\n\\n source1 = source\\n target1 = target\\n\\n ' + block + '\\n }\\n ';\n\n // nested properties boilerplate\n } else {\n block = '\\n if (Array.isArray(source' + level + '[\\'' + key + '\\']) || !source' + level + '.hasOwnProperty(\\'' + key + '\\')) {\\n\\n source' + (level + 1) + ' = source' + level + '[\\'' + key + '\\'] || []\\n count' + (level + 1) + ' = 0\\n\\n if (!target' + level + '.hasOwnProperty(\\'' + key + '\\') || !Array.isArray(target' + level + '[\\'' + key + '\\'])) {\\n target' + (level + 1) + ' = []\\n if (source' + level + '.hasOwnProperty(\\'' + key + '\\')) {\\n count' + (level + 1) + '++\\n }\\n\\n } else {\\n target' + (level + 1) + ' = target' + level + '[\\'' + key + '\\']\\n count' + (level + 1) + '++\\n }\\n\\n ' + block + '\\n\\n if (count' + (level + 1) + ' > 0) {\\n target' + level + '[\\'' + key + '\\'] = target' + (level + 1) + '\\n count' + level + '++\\n }\\n\\n } else {\\n target' + level + '[\\'' + key + '\\'] = source' + level + '[\\'' + key + '\\']\\n count' + level + '++\\n }\\n ';\n }\n }\n\n return block;\n }\n\n /**\n *\n */\n\n }, {\n key: 'additionalItems',\n value: function additionalItems() {}\n }], [{\n key: 'compile',\n value: function compile(schema) {\n var initializer = new Initializer(schema);\n var block = initializer.compile();\n\n //console.log(beautify(block))\n try {\n return new Function('target', 'source', 'options', block);\n } catch (e) {\n console.log(e, e.stack);\n }\n }\n }]);\n\n return Initializer;\n}();\n\nmodule.exports = Initializer;","'use strict';\n\n/**\n * Module dependencies\n * @ignore\n */\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar JSONPointer = require('./JSONPointer');\n\n/**\n * Modes\n */\nvar THROW = 0;\nvar RECOVER = 1;\nvar SILENT = 2;\n\n/**\n * Operations list\n */\nvar OPERATIONS = ['add', 'remove', 'replace', 'move', 'copy', 'test'];\n\n/**\n * Patch\n *\n * @class\n * Implements RFC 6902: JavaScript Object Notation (JSON) Patch\n * https://tools.ietf.org/html/rfc6902\n */\n\nvar JSONPatch = function () {\n\n /**\n * Constructor\n *\n * @param {Array} ops\n */\n function JSONPatch(ops) {\n _classCallCheck(this, JSONPatch);\n\n this.ops = ops || [];\n }\n\n /**\n * Apply\n *\n * @todo handle errors/roll back\n * @todo protect properties that are private in the schema\n * @todo map JSON Pointers real property names\n *\n * @param {Object} target\n */\n\n\n _createClass(JSONPatch, [{\n key: 'apply',\n value: function apply(target) {\n var _this = this;\n\n this.ops.forEach(function (operation) {\n var op = operation.op;\n\n if (!op) {\n throw new Error('Missing \"op\" in JSON Patch operation');\n }\n\n if (OPERATIONS.indexOf(op) === -1) {\n throw new Error('Invalid \"op\" in JSON Patch operation');\n }\n\n if (!operation.path) {\n throw new Error('Missing \"path\" in JSON Patch operation');\n }\n\n _this[op](operation, target);\n });\n }\n\n /**\n * Add\n *\n * @param {Object} op\n * @param {Object} target\n */\n\n }, {\n key: 'add',\n value: function add(op, target) {\n if (op.value === undefined) {\n throw new Error('Missing \"value\" in JSON Patch add operation');\n }\n\n var pointer = new JSONPointer(op.path, SILENT);\n pointer.add(target, op.value);\n }\n\n /**\n * Remove\n *\n * @param {Object} op\n * @param {Object} target\n */\n\n }, {\n key: 'remove',\n value: function remove(op, target) {\n var pointer = new JSONPointer(op.path);\n pointer.remove(target);\n }\n\n /**\n * Replace\n *\n * @param {Object} op\n * @param {Object} target\n */\n\n }, {\n key: 'replace',\n value: function replace(op, target) {\n if (op.value === undefined) {\n throw new Error('Missing \"value\" in JSON Patch replace operation');\n }\n\n var pointer = new JSONPointer(op.path);\n pointer.replace(target, op.value);\n }\n\n /**\n * Move\n *\n * @param {Object} op\n * @param {Object} target\n */\n\n }, {\n key: 'move',\n value: function move(op, target) {\n if (op.from === undefined) {\n throw new Error('Missing \"from\" in JSON Patch move operation');\n }\n\n if (op.path.match(new RegExp('^' + op.from))) {\n throw new Error('Invalid \"from\" in JSON Patch move operation');\n }\n\n var pointer = new JSONPointer(op.path);\n var from = new JSONPointer(op.from);\n var value = from.get(target);\n\n from.remove(target);\n pointer.add(target, value);\n }\n\n /**\n * Copy\n *\n * @param {Object} op\n * @param {Object} target\n */\n\n }, {\n key: 'copy',\n value: function copy(op, target) {\n if (op.from === undefined) {\n throw new Error('Missing \"from\" in JSON Patch copy operation');\n }\n\n var pointer = new JSONPointer(op.path);\n var from = new JSONPointer(op.from);\n var value = from.get(target);\n\n pointer.add(target, value);\n }\n\n /**\n * Test\n *\n * @param {Object} op\n * @param {Object} target\n */\n\n }, {\n key: 'test',\n value: function test(op, target) {\n if (op.value === undefined) {\n throw new Error('Missing \"value\" in JSON Patch test operation');\n }\n\n var pointer = new JSONPointer(op.path);\n var value = pointer.get(target);\n\n switch (_typeof(op.value)) {\n //case 'string':\n //case 'number':\n //case 'boolean':\n // if (value !== op.value) {\n // throw new Error('Mismatching JSON Patch test value')\n // }\n default:\n if (value !== op.value) {\n throw new Error('Mismatching JSON Patch test value');\n }\n }\n }\n }]);\n\n return JSONPatch;\n}();\n\n/**\n * Exports\n */\n\n\nmodule.exports = JSONPatch;","'use strict';\n\n/**\n * Module dependencies\n * @ignore\n */\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar formats = require('./Formats');\n\n/**\n * For variable iterator counter\n *\n * @type {number}\n */\nvar indexCount = 0;\n\n/**\n * Validator\n *\n * Compile an object describing a JSON Schema into a validation function.\n */\n\nvar Validator = function () {\n _createClass(Validator, null, [{\n key: 'compile',\n\n\n /**\n * Compile (static)\n *\n * @description\n * Compile an object describing a JSON Schema into a validation function.\n *\n * @param {Object} schema\n * @returns {Function}\n */\n value: function compile(schema) {\n var validator = new Validator(schema);\n\n var body = '\\n // \"cursor\"\\n let value = data\\n let container\\n let stack = []\\n let top = -1\\n\\n // error state\\n let valid = true\\n let errors = []\\n\\n // complex schema state\\n let initialValidity\\n let anyValid\\n let notValid\\n let countOfValid\\n let initialErrorCount\\n let accumulatedErrorCount\\n\\n // validation code\\n ' + validator.compile() + '\\n\\n // validation result\\n return {\\n valid,\\n errors\\n }\\n ';\n\n return new Function('data', body);\n }\n\n /**\n * Return current iterator index counter and increase value\n *\n * @returns {number}\n */\n\n }, {\n key: 'counter',\n get: function get() {\n return indexCount++;\n }\n\n /**\n * Constructor\n *\n * @param {Object} schema - object representation of a schema\n * @param {string} options - compilation options\n */\n\n }]);\n\n function Validator(schema) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Validator);\n\n // assign schema to this\n this.schema = schema;\n\n // assign all options to this\n Object.assign(this, options);\n\n // ensure address is defined\n if (!this.address) {\n this.address = '';\n }\n\n // ensure require is boolean\n if (this.require !== true) {\n this.require = false;\n }\n }\n\n /**\n * Compile\n *\n * @description\n * The instance compile method is \"dumb\". It only sequences invocation of\n * more specific compilation methods. It generates code to\n *\n * - read a value from input\n * - validate type(s) of input\n * - validate constraints described by various schema keywords\n *\n * Conditional logic related to code generation is pushed downsteam to\n * type-specific methods.\n */\n\n\n _createClass(Validator, [{\n key: 'compile',\n value: function compile() {\n var block = '';\n\n if (this.require) {\n block += this.required();\n }\n\n // type validation\n block += this.type();\n\n // type specific validation generators\n // null and boolean are covered by this.type()\n // integer should be covered by number and this.type()\n block += this.array();\n block += this.number();\n block += this.object();\n block += this.string();\n\n // non-type-specific validation generators\n block += this.enum();\n block += this.anyOf();\n block += this.allOf();\n block += this.not();\n block += this.oneOf();\n\n return block;\n }\n\n /**\n * push\n */\n\n }, {\n key: 'push',\n value: function push() {\n return '\\n stack.push(value)\\n container = value\\n top++\\n ';\n }\n\n /**\n * pop\n */\n\n }, {\n key: 'pop',\n value: function pop() {\n return '\\n if (stack.length > 1) {\\n top--\\n stack.pop()\\n }\\n\\n value = container = stack[top]\\n ';\n }\n\n /**\n * type\n *\n * @description\n * > An instance matches successfully if its primitive type is one of the\n * > types defined by keyword. Recall: \"number\" includes \"integer\".\n * > JSON Schema Validation Section 5.5.2\n *\n * @returns {string}\n */\n\n }, {\n key: 'type',\n value: function type() {\n var type = this.schema.type,\n address = this.address;\n\n var block = '';\n\n if (type) {\n var types = Array.isArray(type) ? type : [type];\n var conditions = types.map(function (type) {\n // TODO: can we make a mapping object for this to clean it up?\n if (type === 'array') return '!Array.isArray(value)';\n if (type === 'boolean') return 'typeof value !== \\'boolean\\'';\n if (type === 'integer') return '!Number.isInteger(value)';\n if (type === 'null') return 'value !== null';\n if (type === 'number') return 'typeof value !== \\'number\\'';\n if (type === 'object') return '(typeof value !== \\'object\\' || Array.isArray(value) || value === null)';\n if (type === 'string') return 'typeof value !== \\'string\\'';\n }).join(' && ');\n\n block += '\\n // ' + address + ' type checking\\n if (value !== undefined && ' + conditions + ') {\\n valid = false\\n errors.push({\\n keyword: \\'type\\',\\n message: \\'invalid type\\'\\n })\\n }\\n ';\n }\n\n return block;\n }\n\n /**\n * Type-specific validations\n *\n * Type checking is optional in JSON Schema, and a schema can allow\n * multiple types. Generated code needs to apply type-specific validations\n * only to appropriate values, and ignore everything else. Type validation\n * itself is handled separately from other validation keywords.\n *\n * The methods `array`, `number`, `object`, `string` generate type-specific\n * validation code blocks, wrapped in a conditional such that they will\n * only be applied to values of that type.\n *\n * For example, the `number` method, given the schema\n *\n * { minimum: 3 }\n *\n * will generate\n *\n * if (typeof value === 'number') {\n * if (value < 3) {\n * valid = false\n * errors.push({ message: '...' })\n * }\n * }\n *\n * Integer values are also numbers, and are validated the same as numbers\n * other than the type validation itself. Therefore no `integer` method is\n * needed.\n */\n\n /**\n * array\n *\n * @description\n * Invoke methods for array-specific keywords and wrap resulting code in\n * type-checking conditional so that any resulting validations are only\n * applied to array values.\n *\n * @returns {string}\n */\n\n }, {\n key: 'array',\n value: function array() {\n var keywords = ['additionalItems', 'items', 'minItems', 'maxItems', 'uniqueItems'];\n var validations = this.validations(keywords);\n var block = '';\n\n if (validations.length > 0) {\n block += '\\n /**\\n * Array validations\\n */\\n if (Array.isArray(value)) {\\n ' + validations + '\\n }\\n ';\n }\n\n return block;\n }\n\n /**\n * number\n *\n * @description\n * Invoke methods for number-specific keywords and wrap resulting code in\n * type-checking conditional so that any resulting validations are only\n * applied to number values.\n *\n * @returns {string}\n */\n\n }, {\n key: 'number',\n value: function number() {\n var keywords = ['minimum', 'maximum', 'multipleOf'];\n var validations = this.validations(keywords);\n var block = '';\n\n if (validations.length > 0) {\n block += '\\n /**\\n * Number validations\\n */\\n if (typeof value === \\'number\\') {\\n ' + validations + '\\n }\\n ';\n }\n\n return block;\n }\n\n /**\n * object\n *\n * @description\n * Invoke methods for object-specific keywords and wrap resulting code in\n * type-checking conditional so that any resulting validations are only\n * applied to object values.\n *\n * @returns {string}\n */\n\n }, {\n key: 'object',\n value: function object() {\n var keywords = ['maxProperties', 'minProperties', 'additionalProperties', 'properties', 'patternProperties', 'dependencies', 'schemaDependencies', 'propertyDependencies'];\n var validations = this.validations(keywords);\n var block = '';\n\n if (validations.length > 0) {\n block += '\\n /**\\n * Object validations\\n */\\n if (typeof value === \\'object\\' && value !== null && !Array.isArray(value)) {\\n ' + validations + '\\n }\\n ';\n }\n\n return block;\n }\n\n /**\n * string\n *\n * @description\n * Invoke methods for string-specific keywords and wrap resulting code in\n * type-checking conditional so that any resulting validations are only\n * applied to string values.\n *\n * @returns {string}\n */\n\n }, {\n key: 'string',\n value: function string() {\n var keywords = ['maxLength', 'minLength', 'pattern', 'format'];\n var validations = this.validations(keywords);\n var block = '';\n\n if (validations.length > 0) {\n block += '\\n /**\\n * String validations\\n */\\n if (typeof value === \\'string\\') {\\n ' + validations + '\\n }\\n ';\n }\n\n return block;\n }\n\n /**\n * validations\n *\n * @description\n * Iterate over an array of keywords and invoke code generator methods\n * for each. Concatenate the results together and return. Used by \"type\"\n * methods such as this.array() and this.string()\n *\n * @param {Array} keywords\n * @returns {string}\n */\n\n }, {\n key: 'validations',\n value: function validations(keywords) {\n var _this = this;\n\n var schema = this.schema;\n\n var block = '';\n\n var constraints = Object.keys(schema).filter(function (key) {\n return keywords.indexOf(key) !== -1;\n });\n\n constraints.forEach(function (keyword) {\n block += _this[keyword]();\n });\n\n return block;\n }\n\n /**\n * enum\n *\n * @description\n * > An instance validates successfully against this keyword if its value\n * > is equal to one of the elements in this keyword's array value.\n * > JSON Schema Validation Section 5.5.1\n *\n * @returns {string}\n */\n\n }, {\n key: 'enum',\n value: function _enum() {\n var enumerated = this.schema.enum,\n address = this.address;\n\n var conditions = ['value !== undefined'];\n var block = '';\n\n if (enumerated) {\n enumerated.forEach(function (value) {\n switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) {\n case 'boolean':\n conditions.push('value !== ' + value);\n break;\n\n case 'number':\n conditions.push('value !== ' + value);\n break;\n\n case 'string':\n conditions.push('value !== \"' + value + '\"');\n break;\n\n case 'object':\n if (value === null) {\n conditions.push('value !== null');\n } else {\n conditions.push('\\'' + JSON.stringify(value) + '\\' !== JSON.stringify(value)');\n }\n break;\n\n default:\n throw new Error('Things are not well in the land of enum');\n\n }\n });\n\n block += '\\n /**\\n * Validate \"' + address + '\" enum\\n */\\n if (' + conditions.join(' && ') + ') {\\n valid = false\\n errors.push({\\n keyword: \\'enum\\',\\n message: JSON.stringify(value) + \\' is not an enumerated value\\'\\n })\\n }\\n ';\n }\n\n return block;\n }\n\n /**\n * anyOf\n *\n * @description\n * > An instance validates successfully against this keyword if it\n * > validates successfully against at least one schema defined by this\n * > keyword's value.\n * > JSON Schema Validation Section 5.5.4\n *\n * @returns {string}\n */\n\n }, {\n key: 'anyOf',\n value: function anyOf() {\n var anyOf = this.schema.anyOf,\n address = this.address;\n\n var block = '';\n\n if (Array.isArray(anyOf)) {\n block += '\\n initialValidity = valid\\n initialErrorCount = errors.length\\n anyValid = false\\n ';\n\n anyOf.forEach(function (subschema) {\n var validator = new Validator(subschema, { address: address });\n block += '\\n accumulatedErrorCount = errors.length\\n ' + validator.compile() + '\\n if (accumulatedErrorCount === errors.length) {\\n anyValid = true\\n }\\n ';\n });\n\n block += '\\n if (anyValid === true) {\\n valid = initialValidity\\n errors = errors.slice(0, initialErrorCount)\\n }\\n ';\n }\n\n return block;\n }\n\n /**\n * allOf\n *\n * @description\n * > An instance validates successfully against this keyword if it\n * > validates successfully against all schemas defined by this keyword's\n * > value.\n * > JSON Schema Validation Section 5.5.3\n *\n * @returns {string}\n */\n\n }, {\n key: 'allOf',\n value: function allOf() {\n var allOf = this.schema.allOf,\n address = this.address;\n\n var block = '';\n\n if (Array.isArray(allOf)) {\n allOf.forEach(function (subschema) {\n var validator = new Validator(subschema, { address: address });\n block += '\\n ' + validator.compile() + '\\n ';\n });\n }\n\n return block;\n }\n\n /**\n * oneOf\n *\n * @description\n * > An instance validates successfully against this keyword if it\n * > validates successfully against exactly one schema defined by this\n * > keyword's value.\n * > JSON Schema Validation Section 5.5.5\n *\n * @returns {string}\n */\n\n }, {\n key: 'oneOf',\n value: function oneOf() {\n var oneOf = this.schema.oneOf,\n address = this.address;\n\n var block = '';\n\n if (Array.isArray(oneOf)) {\n block += '\\n /**\\n * Validate ' + address + ' oneOf\\n */\\n initialValidity = valid\\n initialErrorCount = errors.length\\n countOfValid = 0\\n ';\n\n oneOf.forEach(function (subschema) {\n var validator = new Validator(subschema, { address: address });\n block += '\\n accumulatedErrorCount = errors.length\\n ' + validator.compile() + '\\n if (accumulatedErrorCount === errors.length) {\\n countOfValid += 1\\n }\\n ';\n });\n\n block += '\\n if (countOfValid === 1) {\\n valid = initialValidity\\n errors = errors.slice(0, initialErrorCount)\\n } else {\\n valid = false\\n errors.push({\\n keyword: \\'oneOf\\',\\n message: \\'what is a reasonable error message for this case?\\'\\n })\\n }\\n ';\n }\n\n return block;\n }\n\n /**\n * not\n *\n * @description\n * > An instance is valid against this keyword if it fails to validate\n * > successfully against the schema defined by this keyword.\n * > JSON Schema Validation Section 5.5.6\n *\n * @returns {string}\n */\n\n }, {\n key: 'not',\n value: function not() {\n var not = this.schema.not,\n address = this.address;\n\n var block = '';\n\n if ((typeof not === 'undefined' ? 'undefined' : _typeof(not)) === 'object' && not !== null && !Array.isArray(not)) {\n var subschema = not;\n var validator = new Validator(subschema, { address: address });\n\n block += '\\n /**\\n * NOT\\n */\\n if (value !== undefined) {\\n initialValidity = valid\\n initialErrorCount = errors.length\\n notValid = true\\n\\n accumulatedErrorCount = errors.length\\n\\n ' + validator.compile() + '\\n\\n if (accumulatedErrorCount === errors.length) {\\n notValid = false\\n }\\n\\n if (notValid === true) {\\n valid = initialValidity\\n errors = errors.slice(0, initialErrorCount)\\n } else {\\n valid = false\\n errors = errors.slice(0, initialErrorCount)\\n errors.push({\\n keyword: \\'not\\',\\n message: \\'hmm...\\'\\n })\\n }\\n }\\n ';\n }\n\n return block;\n }\n\n /**\n * properties\n *\n * @description\n * Iterate over the `properties` schema property if it is an object. For each\n * key, initialize a new Validator for the subschema represented by the property\n * value and invoke compile. Append the result of compiling each subschema to\n * the block of code being generated.\n *\n * @returns {string}\n */\n\n }, {\n key: 'properties',\n value: function properties() {\n var schema = this.schema,\n address = this.address;\n var properties = schema.properties,\n required = schema.required;\n\n var block = this.push();\n\n // ensure the value of \"required\" schema property is an array\n required = Array.isArray(required) ? required : [];\n\n if ((typeof properties === 'undefined' ? 'undefined' : _typeof(properties)) === 'object') {\n Object.keys(properties).forEach(function (key) {\n var subschema = properties[key];\n var isRequired = required.indexOf(key) !== -1;\n // TODO\n // how should we be calculating these things? should be json pointer?\n // needs a separate function\n var pointer = [address, key].filter(function (segment) {\n return !!segment;\n }).join('.');\n var validation = new Validator(subschema, { address: pointer, require: isRequired });\n\n // read the value\n block += '\\n value = container[\\'' + key + '\\']\\n ';\n\n block += validation.compile();\n });\n }\n\n block += this.pop();\n\n return block;\n }\n\n /**\n * Other Properties\n *\n * @description\n * This method is not for a keyword. It wraps validations for\n * patternProperties and additionalProperties in a single iteration over\n * an object-type value's properties.\n *\n * It should only be invoked once for a given subschema.\n *\n * @returns {string}\n */\n\n }, {\n key: 'otherProperties',\n value: function otherProperties() {\n return '\\n /**\\n * Validate Other Properties\\n */\\n ' + this.push() + '\\n\\n for (let key in container) {\\n value = container[key]\\n matched = false\\n\\n ' + this.patternValidations() + '\\n ' + this.additionalValidations() + '\\n }\\n\\n ' + this.pop() + '\\n ';\n }\n\n /**\n * Pattern Validations\n *\n * @description\n * Generate validation code from a subschema for properties matching a\n * regular expression.\n *\n * @returns {string}\n */\n\n }, {\n key: 'patternValidations',\n value: function patternValidations() {\n var patternProperties = this.schema.patternProperties;\n\n var block = '';\n\n if ((typeof patternProperties === 'undefined' ? 'undefined' : _typeof(patternProperties)) === 'object') {\n Object.keys(patternProperties).forEach(function (pattern) {\n var subschema = patternProperties[pattern];\n var validator = new Validator(subschema);\n block += '\\n if (key.match(\\'' + pattern + '\\')) {\\n matched = true\\n ' + validator.compile() + '\\n }\\n ';\n });\n }\n\n return block;\n }\n\n /**\n * Additional Validations\n *\n * @description\n * Generate validation code, either from a subschema for properties not\n * defined in the schema, or to disallow properties not defined in the\n * schema.\n *\n * @returns {string}\n */\n\n }, {\n key: 'additionalValidations',\n value: function additionalValidations() {\n var _schema = this.schema,\n properties = _schema.properties,\n additionalProperties = _schema.additionalProperties,\n address = this.address;\n\n var validations = '';\n var block = '';\n\n // catch additional unmatched properties\n var conditions = ['matched !== true'];\n\n // ignore defined properties\n Object.keys(properties || {}).forEach(function (key) {\n conditions.push('key !== \\'' + key + '\\'');\n });\n\n // validate additional properties\n if ((typeof additionalProperties === 'undefined' ? 'undefined' : _typeof(additionalProperties)) === 'object') {\n var subschema = additionalProperties;\n var validator = new Validator(subschema, { address: address + '[APKey]' });\n block += '\\n // validate additional properties\\n if (' + conditions.join(' && ') + ') {\\n ' + validator.compile() + '\\n }\\n ';\n }\n\n // error for additional properties\n if (additionalProperties === false) {\n block += '\\n // validate non-presence of additional properties\\n if (' + conditions.join(' && ') + ') {\\n valid = false\\n errors.push({\\n keyword: \\'additionalProperties\\',\\n message: key + \\' is not a defined property\\'\\n })\\n }\\n ';\n }\n\n return block;\n }\n\n /**\n * patternProperties\n *\n * @description\n * Generate validation code for properties matching a pattern\n * defined by the property name (key), which must be a string\n * representing a valid regular expression.\n *\n * @returns {string}\n */\n\n }, {\n key: 'patternProperties',\n value: function patternProperties() {\n var block = '';\n\n if (!this.otherPropertiesCalled) {\n this.otherPropertiesCalled = true;\n block += this.otherProperties();\n }\n\n return block;\n }\n\n /**\n * additionalProperties\n *\n * @description\n * Generate validation code for additional properties not defined\n * in the schema, or disallow additional properties if the value of\n * `additionalProperties` in the schema is `false`.\n *\n * @returns {string}\n */\n\n }, {\n key: 'additionalProperties',\n value: function additionalProperties() {\n var block = '';\n\n if (!this.otherPropertiesCalled) {\n this.otherPropertiesCalled = true;\n block += this.otherProperties();\n }\n\n return block;\n }\n\n /**\n * minProperties\n *\n * @description\n * > An object instance is valid against \"minProperties\" if its number of\n * > properties is greater than, or equal to, the value of this keyword.\n * > JSON Schema Validation Section 5.4.2\n *\n * @returns {string}\n */\n\n }, {\n key: 'minProperties',\n value: function minProperties() {\n var minProperties = this.schema.minProperties,\n address = this.address;\n\n\n return '\\n // ' + address + ' min properties\\n if (Object.keys(value).length < ' + minProperties + ') {\\n valid = false\\n errors.push({\\n keyword: \\'minProperties\\',\\n message: \\'too few properties\\'\\n })\\n }\\n ';\n }\n\n /**\n * maxProperties\n *\n * @description\n * > An object instance is valid against \"maxProperties\" if its number of\n * > properties is less than, or equal to, the value of this keyword.\n * > JSON Schema Validation Section 5.4.1\n *\n * @returns {string}\n */\n\n }, {\n key: 'maxProperties',\n value: function maxProperties() {\n var maxProperties = this.schema.maxProperties,\n address = this.address;\n\n\n return '\\n // ' + address + ' max properties\\n if (Object.keys(value).length > ' + maxProperties + ') {\\n valid = false\\n errors.push({\\n keyword: \\'maxProperties\\',\\n message: \\'too many properties\\'\\n })\\n }\\n ';\n }\n\n /**\n * Dependencies\n *\n * @description\n * > For all (name, schema) pair of schema dependencies, if the instance has\n * > a property by this name, then it must also validate successfully against\n * > the schema.\n * >\n * > Note that this is the instance itself which must validate successfully,\n * > not the value associated with the property name.\n * >\n * > For each (name, propertyset) pair of property dependencies, if the\n * > instance has a property by this name, then it must also have properties\n * > with the same names as propertyset.\n * > JSON Schema Validation Section 5.4.5.2\n *\n * @returns {string}\n */\n\n }, {\n key: 'dependencies',\n value: function dependencies() {\n var dependencies = this.schema.dependencies,\n address = this.address;\n\n\n var block = this.push();\n\n if ((typeof dependencies === 'undefined' ? 'undefined' : _typeof(dependencies)) === 'object') {\n Object.keys(dependencies).forEach(function (key) {\n var dependency = dependencies[key];\n var conditions = [];\n\n if (Array.isArray(dependency)) {\n dependency.forEach(function (item) {\n conditions.push('container[\\'' + item + '\\'] === undefined');\n });\n\n block += '\\n if (container[\\'' + key + '\\'] !== undefined && (' + conditions.join(' || ') + ')) {\\n valid = false\\n errors.push({\\n keyword: \\'dependencies\\',\\n message: \\'unmet dependencies\\'\\n })\\n }\\n ';\n } else if ((typeof dependency === 'undefined' ? 'undefined' : _typeof(dependency)) === 'object') {\n var subschema = dependency;\n var validator = new Validator(subschema, { address: address });\n\n block += '\\n if (container[\\'' + key + '\\'] !== undefined) {\\n ' + validator.compile() + '\\n }\\n ';\n }\n });\n }\n\n block += this.pop();\n\n return block;\n }\n\n /**\n * Required\n *\n * @description\n * > An object instance is valid against this keyword if its property set\n * > contains all elements in this keyword's array value.\n * > JSON Schema Validation Section 5.4.3\n *\n * @returns {string}\n */\n\n }, {\n key: 'required',\n value: function required() {\n var properties = this.schema.properties,\n address = this.address;\n\n var block = '';\n\n block += '\\n // validate ' + address + ' presence\\n if (value === undefined) {\\n valid = false\\n errors.push({\\n keyword: \\'required\\',\\n message: \\'is required\\'\\n })\\n }\\n ';\n\n return block;\n }\n\n /**\n * additionalItems\n *\n * @description\n * > Successful validation of an array instance with regards to these two\n * > keywords is determined as follows: if \"items\" is not present, or its\n * > value is an object, validation of the instance always succeeds,\n * > regardless of the value of \"additionalItems\"; if the value of\n * > \"additionalItems\" is boolean value true or an object, validation of\n * > the instance always succeeds; if the value of \"additionalItems\" is\n * > boolean value false and the value of \"items\" is an array, the\n * > instance is valid if its size is less than, or equal to, the size\n * > of \"items\".\n * > JSON Schema Validation Section 5.3.1\n *\n * @returns {string}\n */\n\n }, {\n key: 'additionalItems',\n value: function additionalItems() {\n var _schema2 = this.schema,\n items = _schema2.items,\n additionalItems = _schema2.additionalItems,\n address = this.address;\n\n var block = '';\n\n if (additionalItems === false && Array.isArray(items)) {\n block += '\\n // don\\'t allow additional items\\n if (value.length > ' + items.length + ') {\\n valid = false\\n errors.push({\\n keyword: \\'additionalItems\\',\\n message: \\'additional items not allowed\\'\\n })\\n }\\n ';\n }\n\n if ((typeof additionalItems === 'undefined' ? 'undefined' : _typeof(additionalItems)) === 'object' && additionalItems !== null && Array.isArray(items)) {\n var subschema = additionalItems;\n var validator = new Validator(subschema);\n var counter = Validator.counter;\n\n block += '\\n // additional items\\n ' + this.push() + '\\n\\n for (var i' + counter + ' = ' + items.length + '; i' + counter + ' <= container.length; i' + counter + '++) {\\n value = container[i' + counter + ']\\n ' + validator.compile() + '\\n }\\n\\n ' + this.pop() + '\\n ';\n }\n\n return block;\n }\n\n /**\n * Items\n *\n * @description\n * > Successful validation of an array instance with regards to these two\n * > keywords is determined as follows: if \"items\" is not present, or its\n * > value is an object, validation of the instance always succeeds,\n * > regardless of the value of \"additionalItems\"; if the value of\n * > \"additionalItems\" is boolean value true or an object, validation of\n * > the instance always succeeds; if the value of \"additionalItems\" is\n * > boolean value false and the value of \"items\" is an array, the\n * > instance is valid if its size is less than, or equal to, the size\n * > of \"items\".\n * > JSON Schema Validation Section 5.3.1\n *\n * Code to generate\n *\n * // this outer conditional is generated by this.array()\n * if (Array.isArray(value) {\n * let parent = value\n * for (let i = 0; i < parent.length; i++) {\n * value = parent[i]\n * // other validation code depending on value here\n * }\n * value = parent\n * }\n *\n *\n * @returns {string}\n */\n\n }, {\n key: 'items',\n value: function items() {\n var items = this.schema.items,\n address = this.address;\n\n var block = '';\n\n // if items is an array\n if (Array.isArray(items)) {\n block += this.push();\n\n items.forEach(function (item, index) {\n var subschema = item;\n var validator = new Validator(subschema, { address: address + '[' + index + ']' });\n\n block += '\\n // item #' + index + '\\n value = container[' + index + ']\\n ' + validator.compile() + '\\n ';\n });\n\n block += this.pop();\n\n // if items is an object\n } else if ((typeof items === 'undefined' ? 'undefined' : _typeof(items)) === 'object' && items !== null) {\n var subschema = items;\n var validator = new Validator(subschema);\n var counter = Validator.counter;\n\n block += '\\n // items\\n ' + this.push() + '\\n\\n for (var i' + counter + ' = 0; i' + counter + ' < container.length; i' + counter + '++) {\\n // read array element\\n value = container[i' + counter + ']\\n ' + validator.compile() + '\\n }\\n\\n ' + this.pop() + '\\n ';\n }\n\n return block;\n }\n\n /**\n * minItems\n *\n * @description\n * > An array instance is valid against \"minItems\" if its size is greater\n * > than, or equal to, the value of this keyword.\n * > JSON Schema Validation Section 5.3.3\n *\n * @returns {string}\n */\n\n }, {\n key: 'minItems',\n value: function minItems() {\n var minItems = this.schema.minItems,\n address = this.address;\n\n\n return '\\n // ' + address + ' min items\\n if (value.length < ' + minItems + ') {\\n valid = false\\n errors.push({\\n keyword: \\'minItems\\',\\n message: \\'too few properties\\'\\n })\\n }\\n ';\n }\n\n /**\n * maxItems\n *\n * @description\n * > An array instance is valid against \"maxItems\" if its size is less\n * > than, or equal to, the value of this keyword.\n * > JSON Schema Validation Section 5.3.2\n *\n * @returns {string}\n */\n\n }, {\n key: 'maxItems',\n value: function maxItems() {\n var maxItems = this.schema.maxItems,\n address = this.address;\n\n\n return '\\n // ' + address + ' max items\\n if (value.length > ' + maxItems + ') {\\n valid = false\\n errors.push({\\n keyword: \\'maxItems\\',\\n message: \\'too many properties\\'\\n })\\n }\\n ';\n }\n\n /**\n * uniqueItems\n *\n * @description\n * > If this keyword has boolean value false, the instance validates\n * > successfully. If it has boolean value true, the instance validates\n * > successfully if all of its elements are unique.\n * > JSON Schema Validation Section 5.3.4\n *\n * TODO\n * optimize\n *\n * @returns {string}\n */\n\n }, {\n key: 'uniqueItems',\n value: function uniqueItems() {\n var uniqueItems = this.schema.uniqueItems,\n address = this.address;\n\n var block = '';\n\n if (uniqueItems === true) {\n block += '\\n // validate ' + address + ' unique items\\n let values = value.map(v => JSON.stringify(v)) // TODO: optimize\\n let set = new Set(values)\\n if (values.length !== set.size) {\\n valid = false\\n errors.push({\\n keyword: \\'uniqueItems\\',\\n message: \\'items must be unique\\'\\n })\\n }\\n ';\n }\n\n return block;\n }\n\n /**\n * minLength\n *\n * @description\n * > A string instance is valid against this keyword if its length is\n * > greater than, or equal to, the value of this keyword. The length of\n * > a string instance is defined as the number of its characters as\n * > defined by RFC 4627 [RFC4627].\n * > JSON Schema Validation Section 5.2.2\n *\n * @returns {string}\n */\n\n }, {\n key: 'minLength',\n value: function minLength() {\n var minLength = this.schema.minLength,\n address = this.address;\n\n\n return '\\n // ' + address + ' validate minLength\\n if (Array.from(value).length < ' + minLength + ') {\\n valid = false\\n errors.push({\\n keyword: \\'minLength\\',\\n message: \\'too short\\'\\n })\\n }\\n ';\n }\n\n /**\n * maxLength\n *\n * @description\n * > A string instance is valid against this keyword if its length is less\n * > than, or equal to, the value of this keyword. The length of a string\n * > instance is defined as the number of its characters as defined by\n * > RFC 4627 [RFC4627].\n * > JSON Schema Validation Section 5.2.1\n *\n * @returns {string}\n */\n\n }, {\n key: 'maxLength',\n value: function maxLength() {\n var maxLength = this.schema.maxLength,\n address = this.address;\n\n\n return '\\n // ' + address + ' validate maxLength\\n if (Array.from(value).length > ' + maxLength + ') {\\n valid = false\\n errors.push({\\n keyword: \\'maxLength\\',\\n message: \\'too long\\'\\n })\\n }\\n ';\n }\n\n /**\n * Pattern\n *\n * @description\n * > A string instance is considered valid if the regular expression\n * > matches the instance successfully.\n * > JSON Schema Validation Section 5.2.3\n *\n * @returns {string}\n */\n\n }, {\n key: 'pattern',\n value: function pattern() {\n var pattern = this.schema.pattern,\n address = this.address;\n\n\n if (pattern) {\n return '\\n // ' + address + ' validate pattern\\n if (!value.match(new RegExp(\\'' + pattern + '\\'))) {\\n valid = false\\n errors.push({\\n keyword: \\'pattern\\',\\n message: \\'does not match the required pattern\\'\\n })\\n }\\n ';\n }\n }\n\n /**\n * Format\n *\n * @description\n * > Structural validation alone may be insufficient to validate that\n * > an instance meets all the requirements of an application. The\n * > \"format\" keyword is defined to allow interoperable semantic\n * > validation for a fixed subset of values which are accurately\n * > described by authoritative resources, be they RFCs or other\n * > external specifications.\n * > JSON Schema Validation Section 7.1\n *\n * @returns {string}\n */\n\n }, {\n key: 'format',\n value: function format() {\n var format = this.schema.format,\n address = this.address;\n\n var matcher = formats.resolve(format);\n\n if (matcher) {\n return '\\n // ' + address + ' validate format\\n if (!value.match(' + matcher + ')) {\\n valid = false\\n errors.push({\\n keyword: \\'format\\',\\n message: \\'is not \"' + format + '\" format\\'\\n })\\n }\\n ';\n }\n }\n\n /**\n * Minimum\n *\n * @description\n * > Successful validation depends on the presence and value of\n * > \"exclusiveMinimum\": if \"exclusiveMinimum\" is not present, or has\n * > boolean value false, then the instance is valid if it is greater\n * > than, or equal to, the value of \"minimum\"; if \"exclusiveMinimum\" is\n * > present and has boolean value true, the instance is valid if it is\n * > strictly greater than the value of \"minimum\".\n * > JSON Schema Validation Section 5.1.3\n *\n * @returns {string}\n */\n\n }, {\n key: 'minimum',\n value: function minimum() {\n var _schema3 = this.schema,\n minimum = _schema3.minimum,\n exclusiveMinimum = _schema3.exclusiveMinimum,\n address = this.address;\n\n var operator = exclusiveMinimum === true ? '<=' : '<';\n\n return '\\n // ' + address + ' validate minimum\\n if (value ' + operator + ' ' + minimum + ') {\\n valid = false\\n errors.push({\\n keyword: \\'minimum\\',\\n message: \\'too small\\'\\n })\\n }\\n ';\n }\n\n /**\n * Maximum\n *\n * @description\n * > Successful validation depends on the presence and value of\n * > \"exclusiveMaximum\": if \"exclusiveMaximum\" is not present, or has\n * > boolean value false, then the instance is valid if it is lower than,\n * > or equal to, the value of \"maximum\"; if \"exclusiveMaximum\" has\n * > boolean value true, the instance is valid if it is strictly lower\n * > than the value of \"maximum\".\n * > JSON Schema Validation Section 5.1.2\n *\n * @returns {string}\n */\n\n }, {\n key: 'maximum',\n value: function maximum() {\n var _schema4 = this.schema,\n maximum = _schema4.maximum,\n exclusiveMaximum = _schema4.exclusiveMaximum,\n address = this.address;\n\n var operator = exclusiveMaximum === true ? '>=' : '>';\n\n return '\\n // ' + address + ' validate maximum\\n if (value ' + operator + ' ' + maximum + ') {\\n valid = false\\n errors.push({\\n keyword: \\'maximum\\',\\n message: \\'too large\\'\\n })\\n }\\n ';\n }\n\n /**\n * multipleOf\n *\n * @description\n * > A numeric instance is valid against \"multipleOf\" if the result of\n * > the division of the instance by this keyword's value is an integer.\n * > JSON Schema Validation Section 5.1.1\n *\n * @returns {string}\n */\n\n }, {\n key: 'multipleOf',\n value: function multipleOf() {\n var multipleOf = this.schema.multipleOf;\n\n var block = '';\n\n if (typeof multipleOf === 'number') {\n var length = multipleOf.toString().length;\n var decimals = length - multipleOf.toFixed(0).length - 1;\n var pow = decimals > 0 ? Math.pow(10, decimals) : 1;\n var condition = void 0;\n\n if (decimals > 0) {\n condition = '(value * ' + pow + ') % ' + multipleOf * pow + ' !== 0';\n } else {\n condition = 'value % ' + multipleOf + ' !== 0';\n }\n\n block += '\\n if (' + condition + ') {\\n valid = false\\n errors.push({\\n keyword: \\'multipleOf\\',\\n message: \\'must be a multiple of ' + multipleOf + '\\'\\n })\\n }\\n ';\n }\n\n return block;\n }\n }]);\n\n return Validator;\n}();\n\n/**\n * Export\n */\n\n\nmodule.exports = Validator;","'use strict';\n\nvar TextEncoder = global.TextEncoder ? global.TextEncoder // browser\n: require('text-encoding').TextEncoder; // node shim\nmodule.exports = TextEncoder;","\"use strict\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * NotSupportedError\n */\nvar NotSupportedError = function (_Error) {\n _inherits(NotSupportedError, _Error);\n\n function NotSupportedError(alg) {\n _classCallCheck(this, NotSupportedError);\n\n var _this = _possibleConstructorReturn(this, (NotSupportedError.__proto__ || Object.getPrototypeOf(NotSupportedError)).call(this));\n\n _this.message = alg + \" is not a supported algorithm\";\n return _this;\n }\n\n return NotSupportedError;\n}(Error);\n\n/**\n * Export\n */\n\n\nmodule.exports = NotSupportedError;","'use strict';\n\nmodule.exports = {\n DataError: require('./DataError'),\n NotSupportedError: require('./NotSupportedError')\n};","\"use strict\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * DataError\n */\nvar DataError = function (_Error) {\n _inherits(DataError, _Error);\n\n function DataError(message) {\n _classCallCheck(this, DataError);\n\n return _possibleConstructorReturn(this, (DataError.__proto__ || Object.getPrototypeOf(DataError)).call(this, message));\n }\n\n return DataError;\n}(Error);\n\n/**\n * Export\n */\n\n\nmodule.exports = DataError;","'use strict';\n\n/**\n * Dependencies\n * @ignore\n */\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar _require = require('@trust/json-document'),\n JSONDocument = _require.JSONDocument;\n\nvar JWKSchema = require('../schemas/JWKSchema');\nvar JWA = require('./JWA');\n\n/**\n * JWK Class\n */\n\nvar JWK = function (_JSONDocument) {\n _inherits(JWK, _JSONDocument);\n\n function JWK() {\n _classCallCheck(this, JWK);\n\n return _possibleConstructorReturn(this, (JWK.__proto__ || Object.getPrototypeOf(JWK)).apply(this, arguments));\n }\n\n _createClass(JWK, null, [{\n key: 'importKey',\n\n\n /**\n * importKey\n *\n * TODO:\n * - should this be on JWA?\n */\n value: function importKey(jwk) {\n return JWA.importKey(jwk);\n }\n }, {\n key: 'schema',\n\n\n /**\n * Schema\n */\n get: function get() {\n return JWKSchema;\n }\n }]);\n\n return JWK;\n}(JSONDocument);\n\n/**\n * Export\n */\n\n\nmodule.exports = JWK;","'use strict';\n\n/**\n * Dependencies\n */\n\nvar _require = require('@trust/json-document'),\n JSONSchema = _require.JSONSchema;\n\nvar JWKSchema = require('./JWKSchema');\n\n/**\n * JWKSetSchema\n */\nvar JWKSetSchema = new JSONSchema({\n type: 'object',\n properties: {\n keys: {\n type: 'array',\n items: JWKSchema\n }\n }\n});\n\n/**\n * Export\n */\nmodule.exports = JWKSetSchema;","'use strict';\n\n/**\n * Dependencies\n */\nvar Base64URLSchema = require('./Base64URLSchema');\nvar JWTClaimsSetSchema = require('./JWTClaimsSetSchema');\nvar JOSEHeaderSchema = require('./JOSEHeaderSchema');\n\nvar _require = require('@trust/json-document'),\n JSONSchema = _require.JSONSchema;\n\n/**\n * JWTSchema\n *\n * @description\n * This schema represents all the things a deserialized JWT can be, i.e.,\n * either a JWS or JWE, and any serialization of them. Validation of well-\n * formedness for a given serialization is accomplished at the time of\n * encoding.\n */\n\n\nvar JWTSchema = new JSONSchema({\n type: 'object',\n properties: {\n\n /**\n * type\n */\n type: {\n type: 'string',\n enum: ['JWS', 'JWE']\n },\n\n /**\n * segments\n */\n segments: {\n type: 'array'\n },\n\n /**\n * header\n */\n header: JOSEHeaderSchema,\n\n /**\n * protected\n */\n protected: JOSEHeaderSchema,\n\n /**\n * unprotected\n */\n unprotected: JOSEHeaderSchema,\n\n /**\n * iv\n */\n iv: Base64URLSchema,\n\n /**\n * aad\n */\n aad: Base64URLSchema,\n\n /**\n * ciphertext\n */\n ciphertext: Base64URLSchema,\n\n /**\n * tag\n */\n tag: Base64URLSchema,\n\n /**\n * recipients\n */\n recipients: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n header: JOSEHeaderSchema,\n encrypted_key: Base64URLSchema\n }\n }\n },\n\n /**\n * payload\n */\n payload: JWTClaimsSetSchema,\n\n /**\n * signatures\n */\n signatures: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n protected: JOSEHeaderSchema,\n header: JOSEHeaderSchema,\n signature: Base64URLSchema,\n key: { type: 'object' }\n }\n }\n },\n\n /**\n * signature\n */\n signature: Base64URLSchema,\n\n /**\n * verified\n */\n verified: {\n type: 'boolean',\n default: false\n },\n\n /**\n * key\n */\n key: {\n type: 'object'\n },\n\n /**\n * serialization\n */\n serialization: {\n type: 'string',\n enum: ['compact', 'json', 'flattened'],\n default: 'compact'\n }\n }\n});\n\n/**\n * Export\n */\nmodule.exports = JWTSchema;","'use strict';\n\n/**\n * Dependencies\n */\nvar _require = require('@trust/json-document'),\n JSONSchema = _require.JSONSchema;\n\n/**\n * Base64URLSchema\n */\n\n\nvar Base64URLSchema = new JSONSchema({\n type: 'string',\n format: 'base64url'\n});\n\n/**\n * Export\n */\nmodule.exports = Base64URLSchema;","'use strict';\n\n/**\n * Dependencies\n */\nvar _require = require('@trust/json-document'),\n JSONSchema = _require.JSONSchema;\n\n/**\n * JWTClaimsSetSchema\n *\n * JSON Web Token (JWT)\n * https://tools.ietf.org/html/rfc7519#section-4\n *\n * 4. JWT Claims\n *\n * The JWT Claims Set represents a JSON object whose members are the\n * claims conveyed by the JWT. The Claim Names within a JWT Claims Set\n * MUST be unique; JWT parsers MUST either reject JWTs with duplicate\n * Claim Names or use a JSON parser that returns only the lexically last\n * duplicate member name, as specified in Section 15.12 (\"The JSON\n * Object\") of ECMAScript 5.1 [ECMAScript].\n *\n * The set of claims that a JWT must contain to be considered valid is\n * context dependent and is outside the scope of this specification.\n * Specific applications of JWTs will require implementations to\n * understand and process some claims in particular ways. However, in\n * the absence of such requirements, all claims that are not understood\n * by implementations MUST be ignored.\n *\n * There are three classes of JWT Claim Names: Registered Claim Names,\n * Public Claim Names, and Private Claim Names.\n */\n\n\nvar JWTClaimsSetSchema = new JSONSchema({\n properties: {\n\n /**\n * JSON Web Token (JWT)\n * https://tools.ietf.org/html/rfc7519#section-4.1\n *\n * 4.1. Registered Claim Names\n *\n * The following Claim Names are registered in the IANA \"JSON Web Token\n * Claims\" registry established by Section 10.1. None of the claims\n * defined below are intended to be mandatory to use or implement in all\n * cases, but rather they provide a starting point for a set of useful,\n * interoperable claims. Applications using JWTs should define which\n * specific claims they use and when they are required or optional. All\n * the names are short because a core goal of JWTs is for the\n * representation to be compact.\n */\n\n /**\n * iss\n *\n * JSON Web Token (JWT)\n * https://tools.ietf.org/html/rfc7519#section-4.1.1\n *\n * 4.1.1. \"iss\" (Issuer) Claim\n *\n * The \"iss\" (issuer) claim identifies the principal that issued the\n * JWT. The processing of this claim is generally application specific.\n * The \"iss\" value is a case-sensitive string containing a StringOrURI\n * value. Use of this claim is OPTIONAL.\n */\n iss: {\n type: 'string',\n format: 'StringOrURI'\n },\n\n /**\n * sub\n *\n * JSON Web Token (JWT)\n * https://tools.ietf.org/html/rfc7519#section-4.1.2\n *\n * 4.1.2. \"sub\" (Subject) Claim\n *\n * The \"sub\" (subject) claim identifies the principal that is the\n * subject of the JWT. The claims in a JWT are normally statements\n * about the subject. The subject value MUST either be scoped to be\n * locally unique in the context of the issuer or be globally unique.\n * The processing of this claim is generally application specific. The\n * \"sub\" value is a case-sensitive string containing a StringOrURI\n * value. Use of this claim is OPTIONAL.\n */\n sub: {\n type: 'string',\n format: 'StringOrURI'\n },\n\n /**\n * aud\n *\n * JSON Web Token (JWT)\n * https://tools.ietf.org/html/rfc7519#section-4.1.3\n *\n * 4.1.3. \"aud\" (Audience) Claim\n *\n * The \"aud\" (audience) claim identifies the recipients that the JWT is\n * intended for. Each principal intended to process the JWT MUST\n * identify itself with a value in the audience claim. If the principal\n * processing the claim does not identify itself with a value in the\n * \"aud\" claim when this claim is present, then the JWT MUST be\n * rejected. In the general case, the \"aud\" value is an array of case-\n * sensitive strings, each containing a StringOrURI value. In the\n * special case when the JWT has one audience, the \"aud\" value MAY be a\n * single case-sensitive string containing a StringOrURI value. The\n * interpretation of audience values is generally application specific.\n * Use of this claim is OPTIONAL.\n */\n aud: {\n type: ['array', 'string'],\n format: 'StringOrURI',\n items: {\n format: 'StringOrURI'\n }\n },\n\n /**\n * exp\n *\n * JSON Web Token (JWT)\n * https://tools.ietf.org/html/rfc7519#section-4.1.4\n *\n * 4.1.4. \"exp\" (Expiration Time) Claim\n *\n * The \"exp\" (expiration time) claim identifies the expiration time on\n * or after which the JWT MUST NOT be accepted for processing. The\n * processing of the \"exp\" claim requires that the current date/time\n * MUST be before the expiration date/time listed in the \"exp\" claim.\n *\n * Implementers MAY provide for some small leeway, usually no more than\n * a few minutes, to account for clock skew. Its value MUST be a number\n * containing a NumericDate value. Use of this claim is OPTIONAL.\n *\n */\n exp: {\n type: 'number',\n format: 'NumericDate'\n },\n\n /**\n * nbf\n *\n * JSON Web Token (JWT)\n * https://tools.ietf.org/html/rfc7519#section-4.1.5\n *\n * 4.1.5. \"nbf\" (Not Before) Claim\n *\n * The \"nbf\" (not before) claim identifies the time before which the JWT\n * MUST NOT be accepted for processing. The processing of the \"nbf\"\n * claim requires that the current date/time MUST be after or equal to\n * the not-before date/time listed in the \"nbf\" claim. Implementers MAY\n * provide for some small leeway, usually no more than a few minutes, to\n * account for clock skew. Its value MUST be a number containing a\n * NumericDate value. Use of this claim is OPTIONAL.\n */\n nbf: {\n type: 'number',\n format: 'NumericDate'\n },\n\n /**\n * iat\n *\n * JSON Web Token (JWT)\n * https://tools.ietf.org/html/rfc7519#section-4.1.6\n *\n * 4.1.6. \"iat\" (Issued At) Claim\n *\n * The \"iat\" (issued at) claim identifies the time at which the JWT was\n * issued. This claim can be used to determine the age of the JWT. Its\n * value MUST be a number containing a NumericDate value. Use of this\n * claim is OPTIONAL.\n */\n iat: {\n type: 'number',\n format: 'NumericDate'\n },\n\n /**\n * jti\n *\n * JSON Web Token (JWT)\n * https://tools.ietf.org/html/rfc7519#section-4.1.7\n *\n * 4.1.7. \"jti\" (JWT ID) Claim\n *\n * The \"jti\" (JWT ID) claim provides a unique identifier for the JWT.\n * The identifier value MUST be assigned in a manner that ensures that\n * there is a negligible probability that the same value will be\n * accidentally assigned to a different data object; if the application\n * uses multiple issuers, collisions MUST be prevented among values\n * produced by different issuers as well. The \"jti\" claim can be used\n * to prevent the JWT from being replayed. The \"jti\" value is a case-\n * sensitive string. Use of this claim is OPTIONAL.\n */\n jti: {\n type: 'string'\n }\n }\n});\n\n/**\n * Export\n */\nmodule.exports = JWTClaimsSetSchema;","'use strict';\n\n/**\n * Dependencies\n */\nvar JWKSchema = require('./JWKSchema');\n\nvar _require = require('@trust/json-document'),\n JSONSchema = _require.JSONSchema;\n\n/**\n * JOSEHeaderSchema\n *\n * JSON Web Token (JWT)\n * https://tools.ietf.org/html/rfc7519#section-5\n *\n * 5. JOSE Header\n *\n * For a JWT object, the members of the JSON object represented by the\n * JOSE Header describe the cryptographic operations applied to the JWT\n * and optionally, additional properties of the JWT. Depending upon\n * whether the JWT is a JWS or JWE, the corresponding rules for the JOSE\n * Header values apply.\n */\n\n\nvar JOSEHeaderSchema = new JSONSchema({\n type: 'object',\n properties: {\n\n /**\n * typ\n *\n * JSON Web Token (JWT)\n * https://tools.ietf.org/html/rfc7519#section-5.1\n *\n * 5.1. \"typ\" (Type) Header Parameter\n *\n * The \"typ\" (type) Header Parameter defined by [JWS] and [JWE] is used\n * by JWT applications to declare the media type [IANA.MediaTypes] of\n * this complete JWT. This is intended for use by the JWT application\n * when values that are not JWTs could also be present in an application\n * data structure that can contain a JWT object; the application can use\n * this value to disambiguate among the different kinds of objects that\n * might be present. It will typically not be used by applications when\n * it is already known that the object is a JWT. This parameter is\n * ignored by JWT implementations; any processing of this parameter is\n * performed by the JWT application. If present, it is RECOMMENDED that\n * its value be \"JWT\" to indicate that this object is a JWT. While\n * media type names are not case sensitive, it is RECOMMENDED that \"JWT\"\n * always be spelled using uppercase characters for compatibility with\n * legacy implementations. Use of this Header Parameter is OPTIONAL.\n *\n * JSON Web Signature (JWS)\n * https://tools.ietf.org/html/rfc7515#section-4.1.9\n *\n * 4.1.9. \"typ\" (Type) Header Parameter\n *\n * The \"typ\" (type) Header Parameter is used by JWS applications to\n * declare the media type [IANA.MediaTypes] of this complete JWS. This\n * is intended for use by the application when more than one kind of\n * object could be present in an application data structure that can\n * contain a JWS; the application can use this value to disambiguate\n * among the different kinds of objects that might be present. It will\n * typically not be used by applications when the kind of object is\n * already known. This parameter is ignored by JWS implementations; any\n * processing of this parameter is performed by the JWS application.\n * Use of this Header Parameter is OPTIONAL.\n *\n * Per RFC 2045 [RFC2045], all media type values, subtype values, and\n * parameter names are case insensitive. However, parameter values are\n * case sensitive unless otherwise specified for the specific parameter.\n *\n * To keep messages compact in common situations, it is RECOMMENDED that\n * producers omit an \"application/\" prefix of a media type value in a\n * \"typ\" Header Parameter when no other '/' appears in the media type\n * value. A recipient using the media type value MUST treat it as if\n * \"application/\" were prepended to any \"typ\" value not containing a\n * '/'. For instance, a \"typ\" value of \"example\" SHOULD be used to\n * represent the \"application/example\" media type, whereas the media\n * type \"application/example;part=\"1/2\"\" cannot be shortened to\n * \"example;part=\"1/2\"\".\n *\n * The \"typ\" value \"JOSE\" can be used by applications to indicate that\n * this object is a JWS or JWE using the JWS Compact Serialization or\n * the JWE Compact Serialization. The \"typ\" value \"JOSE+JSON\" can be\n * used by applications to indicate that this object is a JWS or JWE\n * using the JWS JSON Serialization or the JWE JSON Serialization.\n * Other type values can also be used by applications.\n *\n * JSON Web Encryption (JWE)\n * https://tools.ietf.org/html/rfc7516#section-4.1.11\n *\n * 4.1.11. \"typ\" (Type) Header Parameter\n *\n * This parameter has the same meaning, syntax, and processing rules as\n * the \"typ\" Header Parameter defined in Section 4.1.9 of [JWS], except\n * that the type is that of this complete JWE.\n */\n typ: {\n type: 'string'\n },\n\n /**\n * cty\n *\n * JSON Web Token (JWT)\n * https://tools.ietf.org/html/rfc7519#section-5.2\n *\n * 5.2. \"cty\" (Content Type) Header Parameter\n *\n * The \"cty\" (content type) Header Parameter defined by [JWS] and [JWE]\n * is used by this specification to convey structural information about\n * the JWT.\n *\n * In the normal case in which nested signing or encryption operations\n * are not employed, the use of this Header Parameter is NOT\n * RECOMMENDED. In the case that nested signing or encryption is\n * employed, this Header Parameter MUST be present; in this case, the\n * value MUST be \"JWT\", to indicate that a Nested JWT is carried in this\n * JWT. While media type names are not case sensitive, it is\n * RECOMMENDED that \"JWT\" always be spelled using uppercase characters\n * for compatibility with legacy implementations. See Appendix A.2 for\n * an example of a Nested JWT.\n *\n *\n * JSON Web Signature (JWS)\n * https://tools.ietf.org/html/rfc7515#section-4.1.10\n *\n * 4.1.10. \"cty\" (Content Type) Header Parameter\n *\n * The \"cty\" (content type) Header Parameter is used by JWS applications\n * to declare the media type [IANA.MediaTypes] of the secured content\n * (the payload). This is intended for use by the application when more\n * than one kind of object could be present in the JWS Payload; the\n * application can use this value to disambiguate among the different\n * kinds of objects that might be present. It will typically not be\n * used by applications when the kind of object is already known. This\n * parameter is ignored by JWS implementations; any processing of this\n * parameter is performed by the JWS application. Use of this Header\n * Parameter is OPTIONAL.\n *\n * Per RFC 2045 [RFC2045], all media type values, subtype values, and\n * parameter names are case insensitive. However, parameter values are\n * case sensitive unless otherwise specified for the specific parameter.\n *\n * To keep messages compact in common situations, it is RECOMMENDED that\n * producers omit an \"application/\" prefix of a media type value in a\n * \"cty\" Header Parameter when no other '/' appears in the media type\n * value. A recipient using the media type value MUST treat it as if\n * \"application/\" were prepended to any \"cty\" value not containing a\n * '/'. For instance, a \"cty\" value of \"example\" SHOULD be used to\n * represent the \"application/example\" media type, whereas the media\n * type \"application/example;part=\"1/2\"\" cannot be shortened to\n * \"example;part=\"1/2\"\".\n *\n * JSON Web Encryption (JWE)\n * https://tools.ietf.org/html/rfc7516#section-4.1.12\n *\n * 4.1.12. \"cty\" (Content Type) Header Parameter\n *\n * This parameter has the same meaning, syntax, and processing rules as\n * the \"cty\" Header Parameter defined in Section 4.1.10 of [JWS], except\n * that the type is that of the secured content (the plaintext).\n */\n cty: {\n type: 'string',\n enum: ['JWT']\n },\n\n /**\n * alg\n *\n * JSON Web Signature (JWS)\n * https://tools.ietf.org/html/rfc7515#section-4.1.1\n *\n * 4.1.1. \"alg\" (Algorithm) Header Parameter\n *\n * The \"alg\" (algorithm) Header Parameter identifies the cryptographic\n * algorithm used to secure the JWS. The JWS Signature value is not\n * valid if the \"alg\" value does not represent a supported algorithm or\n * if there is not a key for use with that algorithm associated with the\n * party that digitally signed or MACed the content. \"alg\" values\n * should either be registered in the IANA \"JSON Web Signature and\n * Encryption Algorithms\" registry established by [JWA] or be a value\n * that contains a Collision-Resistant Name. The \"alg\" value is a case-\n * sensitive ASCII string containing a StringOrURI value. This Header\n * Parameter MUST be present and MUST be understood and processed by\n * implementations.\n *\n * A list of defined \"alg\" values for this use can be found in the IANA\n * \"JSON Web Signature and Encryption Algorithms\" registry established\n * by [JWA]; the initial contents of this registry are the values\n * defined in Section 3.1 of [JWA].\n *\n * JSON Web Encryption (JWE)\n * https://tools.ietf.org/html/rfc7516#section-4.1.1\n *\n * 4.1.1. \"alg\" (Algorithm) Header Parameter\n *\n * This parameter has the same meaning, syntax, and processing rules as\n * the \"alg\" Header Parameter defined in Section 4.1.1 of [JWS], except\n * that the Header Parameter identifies the cryptographic algorithm used\n * to encrypt or determine the value of the CEK. The encrypted content\n * is not usable if the \"alg\" value does not represent a supported\n * algorithm, or if the recipient does not have a key that can be used\n * with that algorithm.\n *\n * A list of defined \"alg\" values for this use can be found in the IANA\n * \"JSON Web Signature and Encryption Algorithms\" registry established\n * by [JWA]; the initial contents of this registry are the values\n * defined in Section 4.1 of [JWA].\n */\n alg: {\n type: 'string',\n format: 'StringOrURI'\n },\n\n /**\n * jku\n *\n * JSON Web Signature (JWS)\n * https://tools.ietf.org/html/rfc7515#section-4.1.2\n *\n * 4.1.2. \"jku\" (JWK Set URL) Header Parameter (JWS)\n *\n * The \"jku\" (JWK Set URL) Header Parameter is a URI [RFC3986] that\n * refers to a resource for a set of JSON-encoded public keys, one of\n * which corresponds to the key used to digitally sign the JWS. The\n * keys MUST be encoded as a JWK Set [JWK]. The protocol used to\n * acquire the resource MUST provide integrity protection; an HTTP GET\n * request to retrieve the JWK Set MUST use Transport Layer Security\n * (TLS) [RFC2818] [RFC5246]; and the identity of the server MUST be\n * validated, as per Section 6 of RFC 6125 [RFC6125]. Also, see\n * Section 8 on TLS requirements. Use of this Header Parameter is\n * OPTIONAL.\n *\n * JSON Web Encryption (JWE)\n * https://tools.ietf.org/html/rfc7516#section-4.1.4\n *\n * 4.1.4. \"jku\" (JWK Set URL) Header Parameter (JWE)\n *\n * This parameter has the same meaning, syntax, and processing rules as\n * the \"jku\" Header Parameter defined in Section 4.1.2 of [JWS], except\n * that the JWK Set resource contains the public key to which the JWE\n * was encrypted; this can be used to determine the private key needed\n * to decrypt the JWE.\n */\n jku: {\n type: 'string',\n format: 'URI'\n },\n\n /**\n * jwk\n *\n * JSON Web Signature (JWS)\n * https://tools.ietf.org/html/rfc7515#section-4.1.3\n *\n * 4.1.3. \"jwk\" (JSON Web Key) Header Parameter\n *\n * The \"jwk\" (JSON Web Key) Header Parameter is the public key that\n * corresponds to the key used to digitally sign the JWS. This key is\n * represented as a JSON Web Key [JWK]. Use of this Header Parameter is\n * OPTIONAL.\n *\n * JSON Web Encryption (JWE)\n * https://tools.ietf.org/html/rfc7516#section-4.1.5\n *\n * 4.1.5. \"jwk\" (JSON Web Key) Header Parameter\n *\n * This parameter has the same meaning, syntax, and processing rules as\n * the \"jwk\" Header Parameter defined in Section 4.1.3 of [JWS], except\n * that the key is the public key to which the JWE was encrypted; this\n * can be used to determine the private key needed to decrypt the JWE.\n */\n //jwk: JWKSchema,\n\n /**\n * kid\n *\n * JSON Web Signature (JWS)\n * https://tools.ietf.org/html/rfc7515#section-4.1.4\n *\n * 4.1.4. \"kid\" (Key ID) Header Parameter\n *\n * The \"kid\" (key ID) Header Parameter is a hint indicating which key\n * was used to secure the JWS. This parameter allows originators to\n * explicitly signal a change of key to recipients. The structure of\n * the \"kid\" value is unspecified. Its value MUST be a case-sensitive\n * string. Use of this Header Parameter is OPTIONAL.\n *\n * When used with a JWK, the \"kid\" value is used to match a JWK \"kid\"\n * parameter value.\n *\n *\n * JSON Web Encryption (JWE)\n * https://tools.ietf.org/html/rfc7516#section-4.1.6\n *\n * 4.1.6. \"kid\" (Key ID) Header Parameter\n *\n * This parameter has the same meaning, syntax, and processing rules as\n * the \"kid\" Header Parameter defined in Section 4.1.4 of [JWS], except\n * that the key hint references the public key to which the JWE was\n * encrypted; this can be used to determine the private key needed to\n * decrypt the JWE. This parameter allows originators to explicitly\n * signal a change of key to JWE recipients.\n */\n kid: {\n type: 'string'\n },\n\n /**\n * x5u\n *\n * JSON Web Signature (JWS)\n * https://tools.ietf.org/html/rfc7515#section-4.1.5\n *\n * 4.1.5. \"x5u\" (X.509 URL) Header Parameter\n *\n * The \"x5u\" (X.509 URL) Header Parameter is a URI [RFC3986] that refers\n * to a resource for the X.509 public key certificate or certificate\n * chain [RFC5280] corresponding to the key used to digitally sign the\n * JWS. The identified resource MUST provide a representation of the\n * certificate or certificate chain that conforms to RFC 5280 [RFC5280]\n * in PEM-encoded form, with each certificate delimited as specified in\n * Section 6.1 of RFC 4945 [RFC4945]. The certificate containing the\n * public key corresponding to the key used to digitally sign the JWS\n * MUST be the first certificate. This MAY be followed by additional\n * certificates, with each subsequent certificate being the one used to\n * certify the previous one. The protocol used to acquire the resource\n * MUST provide integrity protection; an HTTP GET request to retrieve\n * the certificate MUST use TLS [RFC2818] [RFC5246]; and the identity of\n * the server MUST be validated, as per Section 6 of RFC 6125 [RFC6125].\n * Also, see Section 8 on TLS requirements. Use of this Header\n * Parameter is OPTIONAL.\n *\n * JSON Web Encryption (JWE)\n * https://tools.ietf.org/html/rfc7516#section-4.1.7\n *\n * 4.1.7. \"x5u\" (X.509 URL) Header Parameter\n *\n * This parameter has the same meaning, syntax, and processing rules as\n * the \"x5u\" Header Parameter defined in Section 4.1.5 of [JWS], except\n * that the X.509 public key certificate or certificate chain [RFC5280]\n * contains the public key to which the JWE was encrypted; this can be\n * used to determine the private key needed to decrypt the JWE.\n */\n x5u: {\n type: 'string',\n format: 'URI'\n },\n\n /**\n * x5c\n *\n * JSON Web Signature (JWS)\n * https://tools.ietf.org/html/rfc7515#section-4.1.6\n *\n * 4.1.6. \"x5c\" (X.509 Certificate Chain) Header Parameter\n *\n * The \"x5c\" (X.509 certificate chain) Header Parameter contains the\n * X.509 public key certificate or certificate chain [RFC5280]\n * corresponding to the key used to digitally sign the JWS. The\n * certificate or certificate chain is represented as a JSON array of\n * certificate value strings. Each string in the array is a\n * base64-encoded (Section 4 of [RFC4648] -- not base64url-encoded) DER\n * [ITU.X690.2008] PKIX certificate value. The certificate containing\n * the public key corresponding to the key used to digitally sign the\n * JWS MUST be the first certificate. This MAY be followed by\n * additional certificates, with each subsequent certificate being the\n * one used to certify the previous one. The recipient MUST validate\n * the certificate chain according to RFC 5280 [RFC5280] and consider\n * the certificate or certificate chain to be invalid if any validation\n * failure occurs. Use of this Header Parameter is OPTIONAL.\n *\n * JSON Web Encryption (JWE)\n * https://tools.ietf.org/html/rfc7516#section-4.1.8\n *\n * 4.1.8. \"x5c\" (X.509 Certificate Chain) Header Parameter\n *\n * This parameter has the same meaning, syntax, and processing rules as\n * the \"x5c\" Header Parameter defined in Section 4.1.6 of [JWS], except\n * that the X.509 public key certificate or certificate chain [RFC5280]\n * contains the public key to which the JWE was encrypted; this can be\n * used to determine the private key needed to decrypt the JWE.\n */\n x5c: {\n type: 'array',\n items: {\n type: 'string',\n format: 'base64'\n }\n },\n\n /**\n * x5t\n *\n * JSON Web Signature (JWS)\n * https://tools.ietf.org/html/rfc7515#section-4.1.7\n *\n * 4.1.7. \"x5t\" (X.509 Certificate SHA-1 Thumbprint) Header Parameter\n *\n * The \"x5t\" (X.509 certificate SHA-1 thumbprint) Header Parameter is a\n * base64url-encoded SHA-1 thumbprint (a.k.a. digest) of the DER\n * encoding of the X.509 certificate [RFC5280] corresponding to the key\n * used to digitally sign the JWS. Note that certificate thumbprints\n * are also sometimes known as certificate fingerprints. Use of this\n * Header Parameter is OPTIONAL.\n *\n * JSON Web Encryption (JWE)\n * https://tools.ietf.org/html/rfc7516#section-4.1.9\n *\n * 4.1.9. \"x5t\" (X.509 Certificate SHA-1 Thumbprint) Header Parameter\n *\n * This parameter has the same meaning, syntax, and processing rules as\n * the \"x5t\" Header Parameter defined in Section 4.1.7 of [JWS], except\n * that the certificate referenced by the thumbprint contains the public\n * key to which the JWE was encrypted; this can be used to determine the\n * private key needed to decrypt the JWE. Note that certificate\n * thumbprints are also sometimes known as certificate fingerprints.\n */\n x5t: {\n type: 'string',\n format: 'base64url'\n },\n\n /**\n * x5t#S256\n *\n * JSON Web Signature (JWS)\n * https://tools.ietf.org/html/rfc7515#section-4.1.8\n *\n * 4.1.8. \"x5t#S256\" (X.509 Certificate SHA-256 Thumbprint) Header\n * Parameter\n *\n * The \"x5t#S256\" (X.509 certificate SHA-256 thumbprint) Header\n * Parameter is a base64url-encoded SHA-256 thumbprint (a.k.a. digest)\n * of the DER encoding of the X.509 certificate [RFC5280] corresponding\n * to the key used to digitally sign the JWS. Note that certificate\n * thumbprints are also sometimes known as certificate fingerprints.\n * Use of this Header Parameter is OPTIONAL.\n *\n *\n * JSON Web Encryption (JWE)\n * https://tools.ietf.org/html/rfc7516#section-4.1.10\n *\n * 4.1.10. \"x5t#S256\" (X.509 Certificate SHA-256 Thumbprint) Header\n * Parameter\n *\n * This parameter has the same meaning, syntax, and processing rules as\n * the \"x5t#S256\" Header Parameter defined in Section 4.1.8 of [JWS],\n * except that the certificate referenced by the thumbprint contains the\n * public key to which the JWE was encrypted; this can be used to\n * determine the private key needed to decrypt the JWE. Note that\n * certificate thumbprints are also sometimes known as certificate\n * fingerprints.\n */\n //'x5t#S256': {\n // type: 'string',\n // format: 'base64url'\n //},\n\n /**\n * crit\n *\n * JSON Web Signature (JWS)\n * https://tools.ietf.org/html/rfc7515#section-4.1.11\n *\n * 4.1.11. \"crit\" (Critical) Header Parameter\n *\n * The \"crit\" (critical) Header Parameter indicates that extensions to\n * this specification and/or [JWA] are being used that MUST be\n * understood and processed. Its value is an array listing the Header\n * Parameter names present in the JOSE Header that use those extensions.\n * If any of the listed extension Header Parameters are not understood\n * and supported by the recipient, then the JWS is invalid. Producers\n * MUST NOT include Header Parameter names defined by this specification\n * or [JWA] for use with JWS, duplicate names, or names that do not\n * occur as Header Parameter names within the JOSE Header in the \"crit\"\n * list. Producers MUST NOT use the empty list \"[]\" as the \"crit\"\n * value. Recipients MAY consider the JWS to be invalid if the critical\n * list contains any Header Parameter names defined by this\n * specification or [JWA] for use with JWS or if any other constraints\n * on its use are violated. When used, this Header Parameter MUST be\n * integrity protected; therefore, it MUST occur only within the JWS\n * Protected Header. Use of this Header Parameter is OPTIONAL. This\n * Header Parameter MUST be understood and processed by implementations.\n *\n * An example use, along with a hypothetical \"exp\" (expiration time)\n * field is:\n *\n * {\"alg\":\"ES256\",\n * \"crit\":[\"exp\"],\n * \"exp\":1363284000\n * }\n *\n * JSON Web Encryption (JWE)\n * https://tools.ietf.org/html/rfc7516#section-4.1.13\n *\n * 4.1.13. \"crit\" (Critical) Header Parameter\n *\n * This parameter has the same meaning, syntax, and processing rules as\n * the \"crit\" Header Parameter defined in Section 4.1.11 of [JWS],\n * except that Header Parameters for a JWE are being referred to, rather\n * than Header Parameters for a JWS.\n */\n crit: {\n type: 'array',\n items: {\n type: 'string'\n },\n minItems: 1\n },\n\n /**\n * enc\n *\n * JSON Web Encryption (JWE)\n * https://tools.ietf.org/html/rfc7516#section-4.1.2\n *\n * 4.1.2. \"enc\" (Encryption Algorithm) Header Parameter\n *\n * The \"enc\" (encryption algorithm) Header Parameter identifies the\n * content encryption algorithm used to perform authenticated encryption\n * on the plaintext to produce the ciphertext and the Authentication\n * Tag. This algorithm MUST be an AEAD algorithm with a specified key\n * length. The encrypted content is not usable if the \"enc\" value does\n * not represent a supported algorithm. \"enc\" values should either be\n * registered in the IANA \"JSON Web Signature and Encryption Algorithms\"\n * registry established by [JWA] or be a value that contains a\n * Collision-Resistant Name. The \"enc\" value is a case-sensitive ASCII\n * string containing a StringOrURI value. This Header Parameter MUST be\n * present and MUST be understood and processed by implementations.\n *\n * A list of defined \"enc\" values for this use can be found in the IANA\n * \"JSON Web Signature and Encryption Algorithms\" registry established\n * by [JWA]; the initial contents of this registry are the values\n * defined in Section 5.1 of [JWA].\n */\n enc: {\n type: 'string',\n format: 'StringOrURI'\n },\n\n /**\n * zip\n *\n * JSON Web Encryption (JWE)\n * https://tools.ietf.org/html/rfc7516#section-4.1.3\n *\n * 4.1.3. \"zip\" (Compression Algorithm) Header Parameter\n *\n * The \"zip\" (compression algorithm) applied to the plaintext before\n * encryption, if any. The \"zip\" value defined by this specification\n * is:\n *\n * o \"DEF\" - Compression with the DEFLATE [RFC1951] algorithm\n *\n * Other values MAY be used. Compression algorithm values can be\n * registered in the IANA \"JSON Web Encryption Compression Algorithms\"\n * registry established by [JWA]. The \"zip\" value is a case-sensitive\n * string. If no \"zip\" parameter is present, no compression is applied\n * to the plaintext before encryption. When used, this Header Parameter\n * MUST be integrity protected; therefore, it MUST occur only within the\n * JWE Protected Header. Use of this Header Parameter is OPTIONAL.\n * This Header Parameter MUST be understood and processed by\n * implementations.\n */\n zip: {\n type: 'string'\n }\n }\n});\n\n/**\n * Export\n */\nmodule.exports = JOSEHeaderSchema;","'use strict';\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Dependencies\n */\nvar base64url = require('base64url');\nvar JWA = require('./JWA');\n\nvar _require = require('../errors'),\n DataError = _require.DataError;\n\n/**\n * JWS\n */\n\n\nvar JWS = function () {\n function JWS() {\n _classCallCheck(this, JWS);\n }\n\n _createClass(JWS, null, [{\n key: 'sign',\n\n\n /**\n * sign\n *\n * @description\n * Encode a JWT instance\n *\n * @param {Object} token\n * @returns {Promise}\n */\n value: function sign(token) {\n var payload = base64url(JSON.stringify(token.payload));\n\n // compact serialization\n if (token.serialization === 'compact') {\n var key = token.key,\n alg = token.header.alg;\n\n var header = base64url(JSON.stringify(token.header));\n var data = header + '.' + payload;\n\n return JWA.sign(alg, key, data).then(function (signature) {\n return data + '.' + signature;\n });\n }\n\n // JSON serialization\n if (token.serialization === 'json') {}\n\n // Flattened serialization\n if (token.serialization === 'flattened') {}\n\n return Promise.reject(new DataError('Unsupported serialization'));\n }\n\n /**\n * verify\n */\n\n }, {\n key: 'verify',\n value: function verify(jwt) {\n // multiple signatures\n if (jwt.signatures) {\n // ...\n }\n\n var key = jwt.key,\n signature = jwt.signature,\n alg = jwt.header.alg;\n\n // one signature\n\n if (jwt.signature) {\n var _jwt$segments = _slicedToArray(jwt.segments, 2),\n header = _jwt$segments[0],\n payload = _jwt$segments[1];\n\n var data = header + '.' + payload;\n\n if (alg === 'none') {\n return Promise.reject(new DataError('Signature provided to verify with alg: none'));\n }\n\n return JWA.verify(alg, key, signature, data).then(function (verified) {\n jwt.verified = verified;\n return verified;\n });\n }\n\n if (alg === 'none') {\n if (!key && !signature) {\n jwt.verified = true;\n\n return Promise.resolve(true);\n }\n\n if (key) {\n return Promise.reject(new DataError('Key provided to verify signature with alg: none'));\n }\n }\n\n // no signatures to verify\n return Promise.reject(new DataError('Missing signature(s)'));\n }\n }]);\n\n return JWS;\n}();\n\n/**\n * Export\n */\n\n\nmodule.exports = JWS;","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction $getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return $getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = $getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n var args = [];\n for (var i = 0; i < arguments.length; i++) args.push(arguments[i]);\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n ReflectApply(this.listener, this.target, args);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n","var objectWithoutPropertiesLoose = require(\"./objectWithoutPropertiesLoose\");\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutProperties;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"format\", {\n enumerable: true,\n get: function get() {\n return _format.default;\n }\n});\nObject.defineProperty(exports, \"parse\", {\n enumerable: true,\n get: function get() {\n return _parse.default;\n }\n});\n\nvar _format = _interopRequireDefault(require(\"./format\"));\n\nvar _parse = _interopRequireDefault(require(\"./parse\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar _require = require('whatwg-url'),\n URL = _require.URL;\n\nvar _require2 = require('@solid/jose'),\n JWT = _require2.JWT,\n JWK = _require2.JWK;\n\nvar DEFAULT_MAX_AGE = 3600; // Default token expiration, in seconds\n\nvar PoPToken = function (_JWT) {\n _inherits(PoPToken, _JWT);\n\n function PoPToken() {\n _classCallCheck(this, PoPToken);\n\n return _possibleConstructorReturn(this, (PoPToken.__proto__ || Object.getPrototypeOf(PoPToken)).apply(this, arguments));\n }\n\n _createClass(PoPToken, null, [{\n key: 'issueFor',\n\n /**\n * @param resourceServerUri {string} RS URI for which this token is intended\n *\n * @param session {Session}\n * @param session.sessionKey {string}\n * @param session.authorization.client_id {string}\n * @param session.authorization.id_token {string}\n *\n * @returns {Promise<string>} PoPToken, encoded as compact JWT\n */\n value: function issueFor(resourceServerUri, session) {\n if (!resourceServerUri) {\n throw new Error('Cannot issue PoPToken - missing resource server URI');\n }\n\n if (!session.sessionKey) {\n throw new Error('Cannot issue PoPToken - missing session key');\n }\n\n if (!session.authorization.id_token) {\n throw new Error('Cannot issue PoPToken - missing id token');\n }\n\n var jwk = JSON.parse(session.sessionKey);\n\n return JWK.importKey(jwk).then(function (importedSessionJwk) {\n var options = {\n aud: new URL(resourceServerUri).origin,\n key: importedSessionJwk,\n iss: session.authorization.client_id,\n id_token: session.authorization.id_token\n };\n\n return PoPToken.issue(options);\n }).then(function (jwt) {\n return jwt.encode();\n });\n }\n\n /**\n * issue\n *\n * @param options {Object}\n * @param options.iss {string} Token issuer (RP client_id)\n * @param options.aud {string|Array<string>} Audience for the token\n * (such as the Resource Server url)\n * @param options.key {JWK} Proof of Possession (private) signing key, see\n * https://tools.ietf.org/html/rfc7800#section-3.1\n *\n * @param options.id_token {string} JWT compact encoded ID Token\n *\n * Optional:\n * @param [options.iat] {number} Issued at timestamp (in seconds)\n * @param [options.max] {number} Max token lifetime in seconds\n *\n * @returns {PoPToken} Proof of Possession Token (JWT instance)\n */\n\n }, {\n key: 'issue',\n value: function issue(options) {\n var aud = options.aud,\n iss = options.iss,\n key = options.key;\n\n\n var alg = key.alg;\n var iat = options.iat || Math.floor(Date.now() / 1000);\n var max = options.max || DEFAULT_MAX_AGE;\n\n var exp = iat + max; // token expiration\n\n var header = { alg: alg };\n var payload = { iss: iss, aud: aud, exp: exp, iat: iat, id_token: options.id_token, token_type: 'pop' };\n\n var jwt = new PoPToken({ header: header, payload: payload, key: key.cryptoKey }, { filter: false });\n\n return jwt;\n }\n }]);\n\n return PoPToken;\n}(JWT);\n\nmodule.exports = PoPToken;","function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutPropertiesLoose;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _util = require(\"./util\");\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance\"); }\n\nfunction _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar xxx = function xxx(key) {\n return function (value) {\n return `${key}=${value && !(0, _util.isToken)(value) ? (0, _util.quote)(value) : value}`;\n };\n};\n\nvar build = function build(params) {\n return params.reduce(function (prev, _ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n key = _ref2[0],\n values = _ref2[1];\n\n var transform = xxx(key);\n\n if (!(0, _util.isToken)(key)) {\n throw new TypeError();\n }\n\n if (Array.isArray(values)) {\n return _toConsumableArray(prev).concat(_toConsumableArray(values.map(transform)));\n }\n\n return _toConsumableArray(prev).concat([transform(values)]);\n }, []);\n};\n\nvar challenge = function challenge(params, options) {\n if (Array.isArray(params)) {\n return build(params);\n } else if (typeof params === 'object') {\n var entries = params;\n return challenge(Object.keys(params).map(function (key) {\n return [key, entries[key]];\n }), options);\n }\n\n throw new TypeError();\n};\n\nvar _default = function _default(scheme, token, params) {\n var obj = typeof scheme === 'string' ? {\n scheme,\n token,\n params\n } : scheme;\n\n if (typeof obj !== 'object') {\n throw new TypeError();\n } else if (!(0, _util.isScheme)(obj.scheme)) {\n throw new TypeError('Invalid scheme.');\n }\n\n return [obj.scheme].concat(_toConsumableArray(typeof obj.token !== 'undefined' ? [obj.token] : []), _toConsumableArray(typeof obj.params !== 'undefined' ? challenge(obj.params) : [])).join(' ');\n};\n\nexports.default = _default;\n//# sourceMappingURL=format.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _util = require(\"./util\");\n\n// lol dis\nvar body = /((?:[a-zA-Z0-9._~+\\/-]+=*(?:\\s+|$))|[^\\u0000-\\u001F\\u007F()<>@,;:\\\\\"/?={}\\[\\]\\u0020\\u0009]+)(?:=([^\\\\\"=\\s,]+|\"(?:[^\"\\\\]|\\\\.)*\"))?/g; // eslint-disable-line\n\nvar normalize = function normalize(prev, _cur) {\n // Fixup quoted strings and tokens with spaces around them\n var cur = _cur.charAt(0) === '\"' ? (0, _util.unquote)(_cur) : _cur.trim(); // Marshal\n\n if (Array.isArray(prev)) {\n return prev.concat(cur);\n } else if (typeof prev === 'string') {\n return [prev, cur];\n }\n\n return cur;\n};\n\nvar parseProperties = function parseProperties(scheme, string) {\n var token = null;\n var params = {}; // eslint-disable-next-line no-constant-condition\n\n while (true) {\n var res = body.exec(string);\n\n if (res === null) {\n break;\n }\n\n if (res[2]) {\n params[res[1]] = normalize(params[res[1]], res[2]);\n } else {\n token = normalize(token, res[1]);\n }\n }\n\n return {\n scheme,\n params,\n token\n };\n};\n\nvar _default = function _default(str) {\n if (typeof str !== 'string') {\n throw new TypeError('Header value must be a string.');\n }\n\n var start = str.indexOf(' ');\n var scheme = str.substr(0, start);\n\n if (!(0, _util.isScheme)(scheme)) {\n throw new TypeError(`Invalid scheme ${scheme}`);\n }\n\n return parseProperties(scheme, str.substr(start));\n};\n\nexports.default = _default;\n//# sourceMappingURL=parse.js.map","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors ||\n function getOwnPropertyDescriptors(obj) {\n var keys = Object.keys(obj);\n var descriptors = {};\n for (var i = 0; i < keys.length; i++) {\n descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);\n }\n return descriptors;\n };\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n if (typeof process !== 'undefined' && process.noDeprecation === true) {\n return fn;\n }\n\n // Allow for deprecating things in the process of starting up.\n if (typeof process === 'undefined') {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexports.debuglog = function(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = process.env.NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = require('./support/isBuffer');\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = require('inherits');\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nvar kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined;\n\nexports.promisify = function promisify(original) {\n if (typeof original !== 'function')\n throw new TypeError('The \"original\" argument must be of type Function');\n\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== 'function') {\n throw new TypeError('The \"util.promisify.custom\" argument must be of type Function');\n }\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn, enumerable: false, writable: false, configurable: true\n });\n return fn;\n }\n\n function fn() {\n var promiseResolve, promiseReject;\n var promise = new Promise(function (resolve, reject) {\n promiseResolve = resolve;\n promiseReject = reject;\n });\n\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n args.push(function (err, value) {\n if (err) {\n promiseReject(err);\n } else {\n promiseResolve(value);\n }\n });\n\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n\n return promise;\n }\n\n Object.setPrototypeOf(fn, Object.getPrototypeOf(original));\n\n if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn, enumerable: false, writable: false, configurable: true\n });\n return Object.defineProperties(\n fn,\n getOwnPropertyDescriptors(original)\n );\n}\n\nexports.promisify.custom = kCustomPromisifiedSymbol\n\nfunction callbackifyOnRejected(reason, cb) {\n // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).\n // Because `null` is a special error value in callbacks which means \"no error\n // occurred\", we error-wrap so the callback consumer can distinguish between\n // \"the promise rejected with null\" or \"the promise fulfilled with undefined\".\n if (!reason) {\n var newReason = new Error('Promise was rejected with a falsy value');\n newReason.reason = reason;\n reason = newReason;\n }\n return cb(reason);\n}\n\nfunction callbackify(original) {\n if (typeof original !== 'function') {\n throw new TypeError('The \"original\" argument must be of type Function');\n }\n\n // We DO NOT return the promise as it gives the user a false sense that\n // the promise is actually somehow related to the callback's execution\n // and that the callback throwing will reject the promise.\n function callbackified() {\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n var maybeCb = args.pop();\n if (typeof maybeCb !== 'function') {\n throw new TypeError('The last argument must be of type Function');\n }\n var self = this;\n var cb = function() {\n return maybeCb.apply(self, arguments);\n };\n // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n original.apply(this, args)\n .then(function(ret) { process.nextTick(cb, null, ret) },\n function(rej) { process.nextTick(callbackifyOnRejected, rej, cb) });\n }\n\n Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));\n Object.defineProperties(callbackified,\n getOwnPropertyDescriptors(original));\n return callbackified;\n}\nexports.callbackify = callbackify;\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","module.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n","'use strict';\n\n/**\n * Module dependencies\n * @ignore\n */\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar JSONPatch = require('./JSONPatch');\n\n/**\n * JSONDocument\n *\n * @class\n * JSONDocument is a high level interface that binds together all other features of\n * this package and provides the principle method of data modeling.\n */\n\nvar JSONDocument = function () {\n _createClass(JSONDocument, null, [{\n key: 'schema',\n\n\n /**\n * Schema\n */\n get: function get() {\n throw new Error('Schema must be defined by classes extending JSONDocument');\n }\n\n /**\n * Constructor\n *\n * @param {Object} data\n * @param {Object} options\n */\n\n }]);\n\n function JSONDocument() {\n var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, JSONDocument);\n\n this.initialize(data, options);\n }\n\n /**\n * Initialize\n *\n * @param {Object} data\n * @param {Object} options\n */\n\n\n _createClass(JSONDocument, [{\n key: 'initialize',\n value: function initialize() {\n var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var schema = this.constructor.schema;\n\n schema.initialize(this, data, options);\n }\n\n /**\n * Validate\n *\n * @param {JSONSchema} alternate - OPTIONAL alternate schema\n * @returns {Object}\n */\n\n }, {\n key: 'validate',\n value: function validate(alternate) {\n var schema = this.constructor.schema;\n\n return (alternate || schema).validate(this);\n }\n\n /**\n * Patch\n *\n * @param {Array} ops\n */\n\n }, {\n key: 'patch',\n value: function patch(ops) {\n var patch = new JSONPatch(ops);\n patch.apply(this);\n }\n\n /**\n * Select\n */\n\n }, {\n key: 'select',\n value: function select() {}\n\n /**\n * Project\n *\n * @description\n * Given a mapping, return an object projected from the current instance.\n *\n * @example\n * let schema = new JSONSchema({\n * properties: {\n * foo: { type: 'Array' }\n * }\n * })\n *\n * let mapping = new JSONMapping({\n * '/foo/0': '/bar/baz'\n * })\n *\n * class FooTracker extends JSONDocument {\n * static get schema () { return schema }\n * }\n *\n * let instance = new FooTracker({ foo: ['qux'] })\n * instance.project(mapping)\n * // => { bar: { baz: 'qux' } }\n *\n * @param {JSONMapping} mapping\n * @return {Object}\n */\n\n }, {\n key: 'project',\n value: function project(mapping) {\n return mapping.project(this);\n }\n\n /**\n * Serialize\n *\n * @param {Object} object\n * @returns {string}\n */\n\n }], [{\n key: 'serialize',\n value: function serialize(object) {\n return JSON.stringify(object);\n }\n\n /**\n * Deserialize\n *\n * @param {string} data\n * @return {*}\n */\n\n }, {\n key: 'deserialize',\n value: function deserialize(data) {\n try {\n return JSON.parse(data);\n } catch (e) {\n throw new Error('Failed to parse JSON');\n }\n }\n }]);\n\n return JSONDocument;\n}();\n\n/**\n * Export\n */\n\n\nmodule.exports = JSONDocument;","'use strict';\n\n/**\n * Module dependencies\n * @ignore\n */\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar JSONPointer = require('./JSONPointer');\n\n/**\n * JSONPointer mode\n */\nvar RECOVER = 1;\n\n/**\n * JSONMapping\n *\n * @class\n * Defines a means to declaratively translate between object\n * representations using JSON Pointer syntax.\n */\n\nvar JSONMapping = function () {\n\n /**\n * Constructor\n *\n * @description Translate pointers from JSON Strings into Pointer objects\n * @param {Object} mapping\n */\n function JSONMapping(mapping) {\n var _this = this;\n\n _classCallCheck(this, JSONMapping);\n\n Object.defineProperty(this, 'mapping', {\n enumerable: false,\n value: new Map()\n });\n\n Object.keys(mapping).forEach(function (key) {\n var value = mapping[key];\n _this.mapping.set(new JSONPointer(key, RECOVER), new JSONPointer(value, RECOVER));\n });\n }\n\n /**\n * Map\n *\n * @description Assign values from source to target by reading the mapping\n * from right to left.\n * @param {Object} target\n * @param {Object} source\n */\n\n\n _createClass(JSONMapping, [{\n key: 'map',\n value: function map(target, source) {\n this.mapping.forEach(function (right, left) {\n left.add(target, right.get(source));\n });\n }\n\n /**\n * Project\n *\n * @description Assign values from source to target by reading the mapping\n * from left to right.\n * @param {Object} source\n * @param {Object} target\n */\n\n }, {\n key: 'project',\n value: function project(source, target) {\n this.mapping.forEach(function (right, left) {\n right.add(target, left.get(source));\n });\n }\n }]);\n\n return JSONMapping;\n}();\n\n/**\n * Exports\n */\n\n\nmodule.exports = JSONMapping;","'use strict';\n\n/**\n * Module dependencies\n * @ignore\n */\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Initializer = require('./Initializer');\nvar Validator = require('./Validator');\n\n/**\n * JSONSchema\n *\n * @class\n * Compiles JSON Schema documents to an object with object initialization\n * and validation methods.\n */\n\nvar JSONSchema = function () {\n\n /**\n * Constructor\n *\n * @param {Object} schema\n */\n function JSONSchema(schema) {\n _classCallCheck(this, JSONSchema);\n\n // TODO: optionally parse JSON string?\n Object.assign(this, schema);\n\n // add schema-derived initialize and validate methods\n Object.defineProperties(this, {\n initialize: {\n enumerable: false,\n writeable: false,\n value: Initializer.compile(schema)\n },\n validate: {\n enumerable: false,\n writeable: false,\n value: Validator.compile(schema)\n }\n });\n }\n\n /**\n * Extend\n *\n * @description\n * ...\n * Dear future,\n *\n * This function was meticulously plagiarized from some curious amalgam of\n * stackoverflow posts whilst dozing off at my keyboard, too deprived of REM-\n * sleep to recurse unassisted. If it sucks, you have only yourself to blame.\n *\n * Goodnight.\n *\n * @param {Object} schema\n * @returns {JSONSchema}\n */\n\n\n _createClass(JSONSchema, [{\n key: 'extend',\n value: function extend(schema) {\n function isObject(data) {\n return data && (typeof data === 'undefined' ? 'undefined' : _typeof(data)) === 'object' && data !== null && !Array.isArray(data);\n }\n\n function extender(target, source) {\n var result = Object.assign({}, target);\n if (isObject(target) && isObject(source)) {\n Object.keys(source).forEach(function (key) {\n if (isObject(source[key])) {\n if (!(key in target)) {\n Object.assign(result, _defineProperty({}, key, source[key]));\n } else {\n result[key] = extender(target[key], source[key]);\n }\n } else {\n Object.assign(result, _defineProperty({}, key, source[key]));\n }\n });\n }\n return result;\n }\n\n var descriptor = extender(this, schema);\n return new JSONSchema(descriptor);\n }\n }]);\n\n return JSONSchema;\n}();\n\n/**\n * Export\n */\n\n\nmodule.exports = JSONSchema;","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar pad_string_1 = require(\"./pad-string\");\nfunction encode(input, encoding) {\n if (encoding === void 0) { encoding = \"utf8\"; }\n if (Buffer.isBuffer(input)) {\n return fromBase64(input.toString(\"base64\"));\n }\n return fromBase64(Buffer.from(input, encoding).toString(\"base64\"));\n}\n;\nfunction decode(base64url, encoding) {\n if (encoding === void 0) { encoding = \"utf8\"; }\n return Buffer.from(toBase64(base64url), \"base64\").toString(encoding);\n}\nfunction toBase64(base64url) {\n base64url = base64url.toString();\n return pad_string_1.default(base64url)\n .replace(/\\-/g, \"+\")\n .replace(/_/g, \"/\");\n}\nfunction fromBase64(base64) {\n return base64\n .replace(/=/g, \"\")\n .replace(/\\+/g, \"-\")\n .replace(/\\//g, \"_\");\n}\nfunction toBuffer(base64url) {\n return Buffer.from(toBase64(base64url), \"base64\");\n}\nvar base64url = encode;\nbase64url.encode = encode;\nbase64url.decode = decode;\nbase64url.toBase64 = toBase64;\nbase64url.fromBase64 = fromBase64;\nbase64url.toBuffer = toBuffer;\nexports.default = base64url;\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction padString(input) {\n var segmentLength = 4;\n var stringLength = input.length;\n var diff = stringLength % segmentLength;\n if (!diff) {\n return input;\n }\n var position = stringLength;\n var padLength = segmentLength - diff;\n var paddedStringLength = stringLength + padLength;\n var buffer = Buffer.alloc(paddedStringLength);\n buffer.write(input);\n while (padLength--) {\n buffer.write(\"=\", position++);\n }\n return buffer.toString();\n}\nexports.default = padString;\n","'use strict';\n\n/**\n * Local dependencies\n */\nvar None = require('./NONE');\nvar HMAC = require('./HMAC');\nvar RSASSA_PKCS1_v1_5 = require('./RSASSA-PKCS1-v1_5');\nvar SupportedAlgorithms = require('./SupportedAlgorithms');\n\n/**\n * Register Supported Algorithms\n */\nvar supportedAlgorithms = new SupportedAlgorithms();\n\n/**\n * Sign\n */\nsupportedAlgorithms.define('HS256', 'sign', new HMAC({\n name: 'HMAC',\n hash: {\n name: 'SHA-256'\n }\n}));\n\nsupportedAlgorithms.define('HS384', 'sign', new HMAC({\n name: 'HMAC',\n hash: {\n name: 'SHA-384'\n }\n}));\n\nsupportedAlgorithms.define('HS512', 'sign', new HMAC({\n name: 'HMAC',\n hash: {\n name: 'SHA-512'\n }\n}));\n\nsupportedAlgorithms.define('RS256', 'sign', new RSASSA_PKCS1_v1_5({\n name: 'RSASSA-PKCS1-v1_5',\n hash: {\n name: 'SHA-256'\n }\n}));\n\nsupportedAlgorithms.define('RS384', 'sign', new RSASSA_PKCS1_v1_5({\n name: 'RSASSA-PKCS1-v1_5',\n hash: {\n name: 'SHA-384'\n }\n}));\n\nsupportedAlgorithms.define('RS512', 'sign', new RSASSA_PKCS1_v1_5({\n name: 'RSASSA-PKCS1-v1_5',\n hash: {\n name: 'SHA-512'\n }\n}));\n//supportedAlgorithms.define('ES256', 'sign', {})\n//supportedAlgorithms.define('ES384', 'sign', {})\n//supportedAlgorithms.define('ES512', 'sign', {})\n//supportedAlgorithms.define('PS256', 'sign', {})\n//supportedAlgorithms.define('PS384', 'sign', {})\n//supportedAlgorithms.define('PS512', 'sign', {})\n\nsupportedAlgorithms.define('none', 'sign', new None({\n // nothing goes here\n}));\n\n/**\n * Verify\n */\nsupportedAlgorithms.define('HS256', 'verify', new HMAC({\n name: 'HMAC',\n hash: {\n name: 'SHA-256'\n }\n}));\n\nsupportedAlgorithms.define('HS384', 'verify', new HMAC({\n name: 'HMAC',\n hash: {\n name: 'SHA-384'\n }\n}));\n\nsupportedAlgorithms.define('HS512', 'verify', new HMAC({\n name: 'HMAC',\n hash: {\n name: 'SHA-512'\n }\n}));\n\nsupportedAlgorithms.define('RS256', 'verify', new RSASSA_PKCS1_v1_5({\n name: 'RSASSA-PKCS1-v1_5',\n hash: {\n name: 'SHA-256'\n }\n}));\n\nsupportedAlgorithms.define('RS384', 'verify', new RSASSA_PKCS1_v1_5({\n name: 'RSASSA-PKCS1-v1_5',\n hash: {\n name: 'SHA-384'\n }\n}));\n\nsupportedAlgorithms.define('RS512', 'verify', new RSASSA_PKCS1_v1_5({\n name: 'RSASSA-PKCS1-v1_5',\n hash: {\n name: 'SHA-512'\n }\n}));\n//supportedAlgorithms.define('ES256', 'verify', {})\n//supportedAlgorithms.define('ES384', 'verify', {})\n//supportedAlgorithms.define('ES512', 'verify', {})\n//supportedAlgorithms.define('PS256', 'verify', {})\n//supportedAlgorithms.define('PS384', 'verify', {})\n//supportedAlgorithms.define('PS512', 'verify', {})\n\nsupportedAlgorithms.define('none', 'verify', new None({\n // nothing goes here\n}));\n\nsupportedAlgorithms.define('RS256', 'importKey', new RSASSA_PKCS1_v1_5({\n name: 'RSASSA-PKCS1-v1_5',\n hash: {\n name: 'SHA-256'\n }\n}));\n\nsupportedAlgorithms.define('RS384', 'importKey', new RSASSA_PKCS1_v1_5({\n name: 'RSASSA-PKCS1-v1_5',\n hash: {\n name: 'SHA-384'\n }\n}));\n\nsupportedAlgorithms.define('RS512', 'importKey', new RSASSA_PKCS1_v1_5({\n name: 'RSASSA-PKCS1-v1_5',\n hash: {\n name: 'SHA-512'\n }\n}));\n\n/**\n * Export\n */\nmodule.exports = supportedAlgorithms;","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * None\n */\nvar None = function () {\n function None() {\n _classCallCheck(this, None);\n }\n\n _createClass(None, [{\n key: 'sign',\n\n /**\n * sign\n */\n value: function sign() {\n return Promise.resolve('');\n }\n\n /**\n * verify\n */\n\n }, {\n key: 'verify',\n value: function verify() {\n // this will never get called. but you looked.\n }\n }]);\n\n return None;\n}();\n\n/**\n * Export\n */\n\n\nmodule.exports = None;","'use strict';\n\n/**\n * Dependencies\n * @ignore\n */\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar base64url = require('base64url');\nvar crypto = require('@trust/webcrypto');\nvar TextEncoder = require('../text-encoder');\n\n/**\n * HMAC with SHA-2 Functions\n */\n\nvar HMAC = function () {\n\n /**\n * Constructor\n *\n * @param {string} bitlength\n */\n function HMAC(params) {\n _classCallCheck(this, HMAC);\n\n this.params = params;\n }\n\n /**\n * Sign\n *\n * @description\n * Generate a hash-based message authentication code for a\n * given input and key. Enforce the key length is equal to\n * or greater than the bitlength.\n *\n * @param {CryptoKey} key\n * @param {string} data\n *\n * @returns {string}\n */\n\n\n _createClass(HMAC, [{\n key: 'sign',\n value: function sign(key, data) {\n var algorithm = this.params;\n\n // TODO: validate key length\n\n data = new TextEncoder().encode(data);\n\n return crypto.subtle.sign(algorithm, key, data).then(function (signature) {\n return base64url(Buffer.from(signature));\n });\n }\n\n /**\n * Verify\n *\n * @description\n * Verify a digital signature for a given input and private key.\n *\n * @param {CryptoKey} key\n * @param {string} signature\n * @param {string} data\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'verify',\n value: function verify(key, signature, data) {\n var algorithm = this.params;\n\n if (typeof signature === 'string') {\n signature = Uint8Array.from(base64url.toBuffer(signature));\n }\n\n if (typeof data === 'string') {\n data = new TextEncoder().encode(data);\n }\n\n return crypto.subtle.verify(algorithm, key, signature, data);\n }\n\n /**\n * Assert Sufficient Key Length\n *\n * @description Assert that the key length is sufficient\n * @param {string} key\n */\n\n }, {\n key: 'assertSufficientKeyLength',\n value: function assertSufficientKeyLength(key) {\n if (key.length < this.bitlength) {\n throw new Error('The key is too short.');\n }\n }\n }]);\n\n return HMAC;\n}();\n\n/**\n * Export\n */\n\n\nmodule.exports = HMAC;","module.exports = __WEBPACK_EXTERNAL_MODULE__56__;","'use strict';\n\n/**\n * Dependencies\n * @ignore\n */\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar base64url = require('base64url');\nvar crypto = require('@trust/webcrypto');\nvar TextEncoder = require('../text-encoder');\n\n/**\n * RSASSA-PKCS1-v1_5\n */\n\nvar RSASSA_PKCS1_v1_5 = function () {\n\n /**\n * constructor\n *\n * @param {string} bitlength\n */\n function RSASSA_PKCS1_v1_5(params) {\n _classCallCheck(this, RSASSA_PKCS1_v1_5);\n\n this.params = params;\n }\n\n /**\n * sign\n *\n * @description\n * Generate a digital signature for a given input and private key.\n *\n * @param {CryptoKey} key\n * @param {BufferSource} data\n *\n * @returns {Promise}\n */\n\n\n _createClass(RSASSA_PKCS1_v1_5, [{\n key: 'sign',\n value: function sign(key, data) {\n var algorithm = this.params;\n\n // TODO\n //if (!this.sufficientKeySize()) {\n // return Promise.reject(\n // new Error(\n // 'A key size of 2048 bits or larger must be used with RSASSA-PKCS1-v1_5'\n // )\n // )\n //}\n\n data = new TextEncoder().encode(data);\n\n return crypto.subtle.sign(algorithm, key, data).then(function (signature) {\n return base64url(Buffer.from(signature));\n });\n }\n\n /**\n * verify\n *\n * @description\n * Verify a digital signature for a given input and private key.\n *\n * @param {CryptoKey} key\n * @param {BufferSource} signature\n * @param {BufferSource} data\n *\n * @returns {Promise}\n */\n\n }, {\n key: 'verify',\n value: function verify(key, signature, data) {\n var algorithm = this.params;\n\n if (typeof signature === 'string') {\n signature = Uint8Array.from(base64url.toBuffer(signature));\n }\n\n if (typeof data === 'string') {\n data = new TextEncoder().encode(data);\n }\n // ...\n\n return crypto.subtle.verify(algorithm, key, signature, data);\n }\n\n /**\n * importKey\n *\n * @param {JWK} key\n * @returns {Promise}\n */\n\n }, {\n key: 'importKey',\n value: function importKey(key) {\n var jwk = Object.assign({}, key);\n var algorithm = this.params;\n var usages = key['key_ops'] || [];\n\n if (key.use === 'sig') {\n usages.push('verify');\n }\n\n if (key.use === 'enc') {\n // TODO: handle encryption keys\n return Promise.resolve(key);\n }\n\n if (key.key_ops) {\n usages = key.key_ops;\n }\n\n return crypto.subtle.importKey('jwk', jwk, algorithm, true, usages).then(function (cryptoKey) {\n Object.defineProperty(jwk, 'cryptoKey', {\n enumerable: false,\n value: cryptoKey\n });\n\n return jwk;\n });\n }\n }]);\n\n return RSASSA_PKCS1_v1_5;\n}();\n\n/**\n * Export\n */\n\n\nmodule.exports = RSASSA_PKCS1_v1_5;","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Dependencies\n */\nvar NotSupportedError = require('../errors/NotSupportedError');\n\n/**\n * Operations\n */\nvar operations = ['sign', 'verify', 'encrypt', 'decrypt', 'importKey'];\n\n/**\n * SupportedAlgorithms\n */\n\nvar SupportedAlgorithms = function () {\n\n /**\n * constructor\n */\n function SupportedAlgorithms() {\n var _this = this;\n\n _classCallCheck(this, SupportedAlgorithms);\n\n operations.forEach(function (op) {\n _this[op] = {};\n });\n }\n\n /**\n * Supported Operations\n */\n\n\n _createClass(SupportedAlgorithms, [{\n key: 'define',\n\n\n /**\n * define\n *\n * @description\n * Register Web Crypto API algorithm parameter for an algorithm\n * and operation.\n *\n * @param {string} alg\n * @param {string} op\n * @param {Object} argument\n */\n value: function define(alg, op, argument) {\n var registeredAlgorithms = this[op];\n registeredAlgorithms[alg] = argument;\n }\n\n /**\n * normalize\n *\n * @description\n * Map JWA alg name to Web Crypto API algorithm parameter\n *\n * @param {string} op\n * @param {Object} alg\n *\n * @returns {Object}\n */\n\n }, {\n key: 'normalize',\n value: function normalize(op, alg) {\n var registeredAlgorithms = this[op];\n\n if (!registeredAlgorithms) {\n return new SyntaxError(); // what kind of error should this be?\n }\n\n var argument = registeredAlgorithms[alg];\n\n if (!argument) {\n return new NotSupportedError(alg);\n }\n\n return argument;\n }\n }], [{\n key: 'operations',\n get: function get() {\n return operations;\n }\n }]);\n\n return SupportedAlgorithms;\n}();\n\n/**\n * Export\n */\n\n\nmodule.exports = SupportedAlgorithms;","'use strict';\n\n/**\n * Package dependencies\n */\nvar _require = require('@trust/json-document'),\n Formats = _require.Formats;\n\n/**\n * Format extensions\n */\n\n\nFormats.register('StringOrURI', new RegExp());\nFormats.register('NumericDate', new RegExp());\nFormats.register('URI', new RegExp());\nFormats.register('url', new RegExp());\nFormats.register('base64', new RegExp());\nFormats.register('base64url', new RegExp());\nFormats.register('MediaType', new RegExp());","'use strict';\n\n/**\n * Dependencies\n */\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar _require = require('@trust/json-document'),\n JSONDocument = _require.JSONDocument;\n\nvar JWKSetSchema = require('../schemas/JWKSetSchema');\nvar JWK = require('./JWK');\n\n/**\n * JWKSet\n *\n * @class\n * JWKSet represents a JSON Web Key Set as described in Section 5 of RFC 7517:\n * https://tools.ietf.org/html/rfc7517#section-5\n */\n\nvar JWKSet = function (_JSONDocument) {\n _inherits(JWKSet, _JSONDocument);\n\n function JWKSet() {\n _classCallCheck(this, JWKSet);\n\n return _possibleConstructorReturn(this, (JWKSet.__proto__ || Object.getPrototypeOf(JWKSet)).apply(this, arguments));\n }\n\n _createClass(JWKSet, null, [{\n key: 'importKeys',\n\n\n /**\n * importKeys\n */\n value: function importKeys(jwks) {\n var validation = this.schema.validate(jwks);\n\n if (!validation.valid) {\n return Promise.reject(new Error('Invalid JWKSet: ' + JSON.stringify(validation, null, 2)));\n }\n\n if (!jwks.keys) {\n return Promise.reject(new Error('Cannot import JWKSet: keys property is empty'));\n }\n\n var imported = void 0,\n importing = void 0;\n\n try {\n imported = new JWKSet(jwks);\n importing = jwks.keys.map(function (key) {\n return JWK.importKey(key);\n });\n } catch (err) {\n return Promise.reject(err);\n }\n\n return Promise.all(importing).then(function (keys) {\n imported.keys = keys;\n return imported;\n });\n }\n }, {\n key: 'schema',\n\n\n /**\n * schema\n */\n get: function get() {\n return JWKSetSchema;\n }\n }]);\n\n return JWKSet;\n}(JSONDocument);\n\n/**\n * Export\n */\n\n\nmodule.exports = JWKSet;","'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Dependencies\n */\nvar base64url = require('base64url');\n\nvar _require = require('@trust/json-document'),\n JSONDocument = _require.JSONDocument;\n\nvar JWTSchema = require('../schemas/JWTSchema');\nvar JWS = require('./JWS');\nvar DataError = require('../errors/DataError');\n\n/**\n * JWT\n */\n\nvar JWT = function (_JSONDocument) {\n _inherits(JWT, _JSONDocument);\n\n function JWT() {\n _classCallCheck(this, JWT);\n\n return _possibleConstructorReturn(this, (JWT.__proto__ || Object.getPrototypeOf(JWT)).apply(this, arguments));\n }\n\n _createClass(JWT, [{\n key: 'isJWE',\n\n\n /**\n * isJWE\n */\n value: function isJWE() {\n return !!this.header.enc;\n }\n\n /**\n * resolveKeys\n */\n\n }, {\n key: 'resolveKeys',\n value: function resolveKeys(jwks) {\n var kid = this.header.kid;\n var keys = void 0,\n match = void 0;\n\n // treat an array as the \"keys\" property of a JWK Set\n if (Array.isArray(jwks)) {\n keys = jwks;\n }\n\n // presence of keys indicates object is a JWK Set\n if (jwks.keys) {\n keys = jwks.keys;\n }\n\n // wrap a plain object they is not a JWK Set in Array\n if (!jwks.keys && (typeof jwks === 'undefined' ? 'undefined' : _typeof(jwks)) === 'object') {\n keys = [jwks];\n }\n\n // ensure there are keys to search\n if (!keys) {\n throw new DataError('Invalid JWK argument');\n }\n\n // match by \"kid\" or \"use\" header\n if (kid) {\n match = keys.find(function (jwk) {\n return jwk.kid === kid;\n });\n } else {\n match = keys.find(function (jwk) {\n return jwk.use === 'sig';\n });\n }\n\n // assign matching key to JWT and return a boolean\n if (match) {\n this.key = match.cryptoKey;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * encode\n *\n * @description\n * Encode a JWT instance\n *\n * @returns {Promise}\n */\n\n }, {\n key: 'encode',\n value: function encode() {\n // validate\n var validation = this.validate();\n\n if (!validation.valid) {\n return Promise.reject(validation);\n }\n\n var token = this;\n\n if (this.isJWE()) {\n return JWE.encrypt(token);\n } else {\n return JWS.sign(token);\n }\n }\n\n /**\n * verify\n *\n * @description\n * Verify a decoded JWT instance\n *\n * @returns {Promise}\n */\n\n }, {\n key: 'verify',\n value: function verify() {\n var validation = this.validate();\n\n if (!validation.valid) {\n return Promise.reject(validation);\n }\n\n return JWS.verify(this);\n }\n }], [{\n key: 'decode',\n\n\n /**\n * decode\n *\n * @description\n * Decode a JSON Web Token\n *\n * @param {string} data\n * @returns {JWT}\n */\n value: function decode(data) {\n var ExtendedJWT = this;\n var jwt = void 0;\n\n if (typeof data !== 'string') {\n throw new DataError('JWT must be a string');\n }\n\n // JSON of Flattened JSON Serialization\n if (data.startsWith('{')) {\n try {\n data = JSON.parse(data, function () {});\n } catch (error) {\n throw new DataError('Invalid JWT serialization');\n }\n\n if (data.signatures || data.recipients) {\n data.serialization = 'json';\n } else {\n data.serialization = 'flattened';\n }\n\n jwt = new ExtendedJWT(data, { filter: false });\n\n // Compact Serialization\n } else {\n try {\n var serialization = 'compact';\n var segments = data.split('.');\n var length = segments.length;\n\n if (length !== 3 && length !== 5) {\n throw new Error('Malformed JWT');\n }\n\n var header = JSON.parse(base64url.decode(segments[0]));\n\n // JSON Web Signature\n if (length === 3) {\n var type = 'JWS';\n var payload = JSON.parse(base64url.decode(segments[1]));\n var signature = segments[2];\n\n jwt = new ExtendedJWT({ type: type, segments: segments, header: header, payload: payload, signature: signature, serialization: serialization }, { filter: false });\n }\n\n // JSON Web Encryption\n if (length === 5) {\n //let type = 'JWE'\n //let [protected, encryption_key, iv, ciphertext, tag] = segments\n\n //jwt = new ExtendedJWT({\n // type,\n // protected: base64url.decode(JSON.parse(protected)),\n // encryption_key,\n // iv,\n // ciphertext,\n // tag,\n // serialization\n //})\n }\n } catch (error) {\n throw new DataError('Invalid JWT compact serialization');\n }\n }\n\n return jwt;\n }\n\n /**\n * encode\n *\n * @description\n * Encode a JSON Web Token\n *\n * @param {Object} header\n * @param {Object} payload\n * @param {CryptoKey} key\n *\n * @returns {Promise}\n */\n\n }, {\n key: 'encode',\n value: function encode(header, payload, key) {\n var jwt = new JWT(header, payload);\n return jwt.encode(key);\n }\n\n /**\n * verify\n *\n * @description\n *\n * @param {CryptoKey} key\n * @param {string} token\n *\n * @returns {Promise}\n */\n\n }, {\n key: 'verify',\n value: function verify(key, token) {\n var jwt = JWT.decode(token);\n jwt.key = key;\n return jwt.verify().then(function (verified) {\n return jwt;\n });\n }\n }, {\n key: 'schema',\n\n\n /**\n * schema\n */\n get: function get() {\n return JWTSchema;\n }\n }]);\n\n return JWT;\n}(JSONDocument);\n\n/**\n * Export\n */\n\n\nmodule.exports = JWT;","/**\n * Dependencies\n */\nconst assert = require('assert')\nconst base64url = require('base64url')\nconst crypto = require('@trust/webcrypto')\nconst { JWT } = require('@solid/jose')\nconst FormUrlEncoded = require('./FormUrlEncoded')\nconst { URL } = require('whatwg-url')\n\n/**\n * Authentication Request\n */\nclass AuthenticationRequest {\n /**\n * create\n *\n * @description\n * Create a new authentication request with generated state and nonce,\n * validate presence of required parameters, serialize the request data and\n * persist it to the session, and return a promise for an authentication\n * request URI.\n *\n * @param {RelyingParty} rp – instance of RelyingParty\n * @param {Object} options - optional request parameters\n * @param {Object} session – reference to localStorage or other session object\n *\n * @returns {Promise}\n */\n static create (rp, options, session) {\n const {provider, defaults, registration} = rp\n\n let issuer, endpoint, client, params\n\n return Promise.resolve()\n .then(() => {\n // validate presence of OP configuration, RP client registration,\n // and default parameters\n assert(provider.configuration,\n 'RelyingParty provider OpenID Configuration is missing')\n\n assert(defaults.authenticate,\n 'RelyingParty default authentication parameters are missing')\n\n assert(registration,\n 'RelyingParty client registration is missing')\n\n // define basic elements of the request\n issuer = provider.configuration.issuer\n endpoint = provider.configuration.authorization_endpoint\n client = { client_id: registration.client_id}\n params = Object.assign(defaults.authenticate, client, options)\n\n // validate presence of required configuration and parameters\n assert(issuer,\n 'Missing issuer in provider OpenID Configuration')\n\n assert(endpoint,\n 'Missing authorization_endpoint in provider OpenID Configuration')\n\n assert(params.scope,\n 'Missing scope parameter in authentication request')\n\n assert(params.response_type,\n 'Missing response_type parameter in authentication request')\n\n assert(params.client_id,\n 'Missing client_id parameter in authentication request')\n\n assert(params.redirect_uri,\n 'Missing redirect_uri parameter in authentication request')\n\n // generate state and nonce random octets\n params.state = Array.from(crypto.getRandomValues(new Uint8Array(16)))\n params.nonce = Array.from(crypto.getRandomValues(new Uint8Array(16)))\n\n // hash the state and nonce parameter values\n return Promise.all([\n crypto.subtle.digest({ name: 'SHA-256' }, new Uint8Array(params.state)),\n crypto.subtle.digest({ name: 'SHA-256' }, new Uint8Array(params.nonce))\n ])\n })\n\n // serialize the request with original values, store in session by\n // encoded state param, and replace state/nonce octets with encoded\n // digests\n .then(digests => {\n let state = base64url(Buffer.from(digests[0]))\n let nonce = base64url(Buffer.from(digests[1]))\n let key = `${issuer}/requestHistory/${state}`\n\n // store the request params for response validation\n // with serialized octet values for state and nonce\n session[key] = JSON.stringify(params)\n\n // replace state and nonce octets with base64url encoded digests\n params.state = state\n params.nonce = nonce\n })\n\n .then(() => AuthenticationRequest.generateSessionKeys())\n\n .then(sessionKeys => {\n AuthenticationRequest.storeSessionKeys(sessionKeys, params, session)\n })\n\n // optionally encode a JWT with the request parameters\n // and replace params with `{ request: <jwt> }\n .then(() => {\n if (provider.configuration.request_parameter_supported) {\n return AuthenticationRequest.encodeRequestParams(params)\n\n .then(encodedParams => { params = encodedParams })\n }\n })\n\n // render the request URI and terminate the algorithm\n .then(() => {\n let url = new URL(endpoint)\n url.search = FormUrlEncoded.encode(params)\n\n return url.href\n })\n }\n\n static generateSessionKeys () {\n return crypto.subtle.generateKey(\n {\n name: \"RSASSA-PKCS1-v1_5\",\n modulusLength: 2048,\n publicExponent: new Uint8Array([0x01, 0x00, 0x01]),\n hash: { name: \"SHA-256\" },\n },\n true,\n [\"sign\", \"verify\"]\n )\n .then((keyPair) => {\n // returns a keypair object\n return Promise.all([\n crypto.subtle.exportKey('jwk', keyPair.publicKey),\n crypto.subtle.exportKey('jwk', keyPair.privateKey)\n ])\n })\n .then(jwkPair => {\n let [ publicJwk, privateJwk ] = jwkPair\n\n return { public: publicJwk, private: privateJwk }\n })\n }\n\n static storeSessionKeys (sessionKeys, params, session) {\n // store the private one in session, public one goes into params\n session['oidc.session.privateKey'] = JSON.stringify(sessionKeys.private)\n params.key = sessionKeys.public\n }\n\n static encodeRequestParams (params) {\n const excludeParams = ['scope', 'client_id', 'response_type', 'state']\n\n const keysToEncode = Object.keys(params).filter(key => !excludeParams.includes(key))\n\n let payload = {}\n\n keysToEncode.forEach(key => {\n payload[key] = params[key]\n })\n\n let requestParamJwt = new JWT({\n header: { alg: 'none' },\n payload\n }, { filter: false })\n\n return requestParamJwt.encode()\n .then(requestParamCompact => {\n let newParams = {\n scope: params['scope'],\n client_id: params['client_id'],\n response_type: params['response_type'],\n request: requestParamCompact,\n state: params['state']\n }\n\n return newParams\n })\n }\n}\n\n/**\n * Export\n */\nmodule.exports = AuthenticationRequest\n","/**\n * Dependencies\n */\nconst { URL } = require('whatwg-url')\nconst assert = require('assert')\nconst crypto = require('@trust/webcrypto')\nconst base64url = require('base64url')\nconst fetch = require('node-fetch')\nconst Headers = fetch.Headers ? fetch.Headers : global.Headers\nconst FormUrlEncoded = require('./FormUrlEncoded')\nconst IDToken = require('./IDToken')\nconst Session = require('./Session')\nconst onHttpError = require('./onHttpError')\nconst HttpError = require('standard-http-error')\n\n/**\n * AuthenticationResponse\n */\nclass AuthenticationResponse {\n /**\n * @param rp {RelyingParty}\n * @param [redirect] {string} req.query\n * @param [body] {string} req.body.text\n * @param session {Session|Storage} req.session or localStorage or similar\n * @param params {object} hashmap\n * @param mode {string} 'query'/'fragment'/'form_post',\n * determined in `parseResponse()`\n */\n constructor ({rp, redirect, body, session, mode, params = {}}) {\n this.rp = rp\n this.redirect = redirect\n this.body = body\n this.session = session\n this.mode = mode\n this.params = params\n }\n\n /**\n * validateResponse\n *\n * @description\n * Authentication response validation.\n *\n * @param {string|Object} response\n *\n * @returns {Promise<Session>}\n */\n static validateResponse (response) {\n return Promise.resolve(response)\n .then(this.parseResponse)\n .then(this.errorResponse)\n .then(this.matchRequest)\n .then(this.validateStateParam)\n .then(this.validateResponseMode)\n .then(this.validateResponseParams)\n .then(this.exchangeAuthorizationCode)\n .then(this.validateIDToken)\n .then(Session.fromAuthResponse)\n }\n\n /**\n * parseResponse\n *\n * @param {object} response\n *\n * @returns {object}\n */\n static parseResponse (response) {\n let {redirect, body} = response\n\n // response must be either a redirect uri or request body, but not both\n if ((redirect && body) || (!redirect && !body)) {\n throw new HttpError(400, 'Invalid response mode')\n }\n\n // parse redirect uri\n if (redirect) {\n let url = new URL(redirect)\n let {search, hash} = url\n\n if ((search && hash) || (!search && !hash)) {\n throw new HttpError(400, 'Invalid response mode')\n }\n\n if (search) {\n response.params = FormUrlEncoded.decode(search.substring(1))\n response.mode = 'query'\n }\n\n if (hash) {\n response.params = FormUrlEncoded.decode(hash.substring(1))\n response.mode = 'fragment'\n }\n }\n\n // parse request form body\n if (body) {\n response.params = FormUrlEncoded.decode(body)\n response.mode = 'form_post'\n }\n\n return response\n }\n\n /**\n * errorResponse\n *\n * @param {AuthenticationResponse} response\n *\n * @throws {Error} If response params include the OAuth2 'error' param,\n * throws an error based on it.\n *\n * @returns {AuthenticationResponse} Chainable\n *\n * @todo Figure out HTTP status code (typically 400, 401 or 403)\n * based on the OAuth2/OIDC `error` code, probably using an external library\n */\n static errorResponse (response) {\n const errorCode = response.params.error\n\n if (errorCode) {\n const errorParams = {}\n errorParams['error'] = errorCode\n errorParams['error_description'] = response.params['error_description']\n errorParams['error_uri'] = response.params['error_uri']\n errorParams['state'] = response.params['state']\n\n const error = new Error(`AuthenticationResponse error: ${errorCode}`)\n error.info = errorParams\n throw error\n }\n\n return response\n }\n\n /**\n * matchRequest\n *\n * @param {Object} response\n * @returns {Promise}\n */\n static matchRequest (response) {\n let {rp, params, session} = response\n let state = params.state\n let issuer = rp.provider.configuration.issuer\n\n if (!state) {\n throw new Error(\n 'Missing state parameter in authentication response')\n }\n\n let key = `${issuer}/requestHistory/${state}`\n let request = session[key]\n\n if (!request) {\n throw new Error(\n 'Mismatching state parameter in authentication response')\n }\n\n response.request = JSON.parse(request)\n return response\n }\n\n /**\n * validateStateParam\n *\n * @param {Object} response\n * @returns {Promise}\n */\n static validateStateParam (response) {\n let octets = new Uint8Array(response.request.state)\n let encoded = response.params.state\n\n return crypto.subtle.digest({ name: 'SHA-256' }, octets).then(digest => {\n if (encoded !== base64url(Buffer.from(digest))) {\n throw new Error(\n 'Mismatching state parameter in authentication response')\n }\n\n return response\n })\n }\n\n /**\n * validateResponseMode\n *\n * @param {Object} response\n * @returns {Promise}\n */\n static validateResponseMode (response) {\n if (response.request.response_type !== 'code' && response.mode === 'query') {\n throw new Error('Invalid response mode')\n }\n\n return response\n }\n\n /**\n * validateResponseParams\n *\n * @param {Object} response\n * @returns {Promise}\n */\n static validateResponseParams (response) {\n let {request, params} = response\n let expectedParams = request.response_type.split(' ')\n\n if (expectedParams.includes('code')) {\n assert(params.code,\n 'Missing authorization code in authentication response')\n // TODO assert novelty of code\n }\n\n if (expectedParams.includes('id_token')) {\n assert(params.id_token,\n 'Missing id_token in authentication response')\n }\n\n if (expectedParams.includes('token')) {\n assert(params.access_token,\n 'Missing access_token in authentication response')\n\n assert(params.token_type,\n 'Missing token_type in authentication response')\n }\n\n return response\n }\n\n /**\n * exchangeAuthorizationCode\n *\n * @param {Object} response\n * @returns {Promise} response object\n */\n static exchangeAuthorizationCode (response) {\n let {rp, params, request} = response\n let code = params.code\n\n // only exchange the authorization code when the response type is \"code\"\n if (!code || request['response_type'] !== 'code') {\n return Promise.resolve(response)\n }\n\n let {provider, registration} = rp\n let id = registration['client_id']\n let secret = registration['client_secret']\n\n // verify the client is not public\n if (!secret) {\n return Promise.reject(new Error(\n 'Client cannot exchange authorization code because ' +\n 'it is not a confidential client'))\n }\n\n // initialize token request arguments\n let endpoint = provider.configuration.token_endpoint\n let method = 'POST'\n\n // initialize headers\n let headers = new Headers({\n 'Content-Type': 'application/x-www-form-urlencoded'\n })\n\n // initialize the token request parameters\n let bodyContents = {\n 'grant_type': 'authorization_code',\n 'code': code,\n 'redirect_uri': request['redirect_uri']\n }\n\n // determine client authentication method\n let authMethod = registration['token_endpoint_auth_method']\n || 'client_secret_basic'\n\n // client secret basic authentication\n if (authMethod === 'client_secret_basic') {\n let credentials = new Buffer(`${id}:${secret}`).toString('base64')\n headers.set('Authorization', `Basic ${credentials}`)\n }\n\n // client secret post authentication\n if (authMethod === 'client_secret_post') {\n bodyContents['client_id'] = id\n bodyContents['client_secret'] = secret\n }\n\n let body = FormUrlEncoded.encode(bodyContents)\n\n // TODO\n // client_secret_jwt authentication\n // private_key_jwt\n\n // make the token request\n\n return fetch(endpoint, {method, headers, body})\n .then(onHttpError('Error exchanging authorization code'))\n .then(tokenResponse => tokenResponse.json())\n .then(tokenResponse => {\n assert(tokenResponse['access_token'],\n 'Missing access_token in token response')\n\n assert(tokenResponse['token_type'],\n 'Missing token_type in token response')\n\n assert(tokenResponse['id_token'],\n 'Missing id_token in token response')\n\n // anything else?\n\n // IS THIS THE RIGHT THING TO DO HERE?\n response.params = Object.assign(response.params, tokenResponse)\n return response\n })\n }\n\n\n /**\n * validateIDToken\n *\n * @param {Object} response\n * @returns {Promise}\n */\n static validateIDToken (response) {\n // only validate the ID Token if present in the response\n if (!response.params.id_token) {\n return Promise.resolve(response)\n }\n\n return Promise.resolve(response)\n .then(AuthenticationResponse.decryptIDToken)\n .then(AuthenticationResponse.decodeIDToken)\n .then(AuthenticationResponse.validateIssuer)\n .then(AuthenticationResponse.validateAudience)\n .then(AuthenticationResponse.resolveKeys)\n .then(AuthenticationResponse.verifySignature)\n .then(AuthenticationResponse.validateExpires)\n .then(AuthenticationResponse.verifyNonce)\n .then(AuthenticationResponse.validateAcr)\n .then(AuthenticationResponse.validateAuthTime)\n .then(AuthenticationResponse.validateAccessTokenHash)\n .then(AuthenticationResponse.validateAuthorizationCodeHash)\n }\n\n /**\n * decryptIDToken\n *\n * @param {Object} response\n * @returns {Promise}\n */\n static decryptIDToken (response) {\n // TODO\n return Promise.resolve(response)\n }\n\n /**\n * decodeIDToken\n *\n * Note: If the `id_token` is not present in params, this method does not\n * get called (short-circuited in `validateIDToken()`).\n *\n * @param response {AuthenticationResponse}\n * @param response.params {object}\n * @param [response.params.id_token] {string} IDToken encoded as a JWT\n *\n * @returns {AuthenticationResponse} Chainable\n */\n static decodeIDToken (response) {\n let jwt = response.params.id_token\n\n try {\n response.decoded = IDToken.decode(jwt)\n } catch (decodeError) {\n const error = new HttpError(400, 'Error decoding ID Token')\n error.cause = decodeError\n error.info = { id_token: jwt }\n throw error\n }\n\n return response\n }\n\n\n /**\n * validateIssuer\n *\n * @param {Object} response\n * @returns {Promise}\n */\n static validateIssuer (response) {\n let configuration = response.rp.provider.configuration\n let payload = response.decoded.payload\n\n // validate issuer of token matches this relying party's provider\n if (payload.iss !== configuration.issuer) {\n throw new Error('Mismatching issuer in ID Token')\n }\n\n return response\n }\n\n /**\n * validateAudience\n *\n * @param {Object} response\n * @returns {Promise}\n */\n static validateAudience (response) {\n let registration = response.rp.registration\n let {aud, azp} = response.decoded.payload\n\n // validate audience includes this relying party\n if (typeof aud === 'string' && aud !== registration['client_id']) {\n throw new Error('Mismatching audience in id_token')\n }\n\n // validate audience includes this relying party\n if (Array.isArray(aud) && !aud.includes(registration['client_id'])) {\n throw new Error('Mismatching audience in id_token')\n }\n\n // validate authorized party is present if required\n if (Array.isArray(aud) && !azp) {\n throw new Error('Missing azp claim in id_token')\n }\n\n // validate authorized party is this relying party\n if (azp && azp !== registration['client_id']) {\n throw new Error('Mismatching azp claim in id_token')\n }\n\n return response\n }\n\n\n /**\n * resolveKeys\n *\n * @param {Object} response\n * @returns {Promise}\n */\n static resolveKeys (response) {\n let rp = response.rp\n let provider = rp.provider\n let decoded = response.decoded\n\n return Promise.resolve(provider.jwks)\n\n .then(jwks => jwks ? jwks : rp.jwks())\n\n .then(jwks => {\n if (decoded.resolveKeys(jwks)) {\n return Promise.resolve(response)\n } else {\n throw new Error('Cannot resolve signing key for ID Token')\n }\n })\n }\n\n /**\n * verifySignature\n *\n * @param {Object} response\n * @returns {Promise}\n */\n static verifySignature (response) {\n let alg = response.decoded.header.alg\n let registration = response.rp.registration\n let expectedAlgorithm = registration['id_token_signed_response_alg'] || 'RS256'\n\n // validate signing algorithm matches expectation\n if (alg !== expectedAlgorithm) {\n throw new Error(\n `Expected ID Token to be signed with ${expectedAlgorithm}`)\n }\n\n return response.decoded.verify().then(verified => {\n if (!verified) {\n throw new Error('Invalid ID Token signature')\n }\n\n return response\n })\n }\n\n /**\n * validateExpires\n *\n * @param {Object} response\n * @returns {Promise}\n */\n static validateExpires (response) {\n let exp = response.decoded.payload.exp\n\n // validate expiration of token\n if (exp <= Math.floor(Date.now() / 1000)) {\n throw new Error('Expired ID Token')\n }\n\n return response\n }\n\n /**\n * verifyNonce\n *\n * @param {Object} response\n * @returns {Promise}\n */\n static verifyNonce (response) {\n let octets = new Uint8Array(response.request.nonce)\n let nonce = response.decoded.payload.nonce\n\n if (!nonce) {\n throw new Error('Missing nonce in ID Token')\n }\n\n return crypto.subtle.digest({ name: 'SHA-256' }, octets).then(digest => {\n if (nonce !== base64url(Buffer.from(digest))) {\n throw new Error('Mismatching nonce in ID Token')\n }\n\n return response\n })\n }\n\n /**\n * validateAcr\n *\n * @param {Object} response\n * @returns {Object}\n */\n static validateAcr (response) {\n // TODO\n return response\n }\n\n /**\n * validateAuthTime\n *\n * @param {Object} response\n * @returns {Promise}\n */\n static validateAuthTime (response) {\n // TODO\n return response\n }\n\n /**\n * validateAccessTokenHash\n *\n * @param {Object} response\n * @returns {Promise}\n */\n static validateAccessTokenHash (response) {\n // TODO\n return response\n }\n\n /**\n * validateAuthorizationCodeHash\n *\n * @param {Object} response\n * @returns {Promise}\n */\n static validateAuthorizationCodeHash (response) {\n // TODO\n return response\n }\n}\n\n/**\n * Export\n */\nmodule.exports = AuthenticationResponse\n","/**\n * Local dependencies\n */\nconst {JWT} = require('@solid/jose')\nconst IDTokenSchema = require('./IDTokenSchema')\n\n/**\n * IDToken\n */\nclass IDToken extends JWT {\n\n /**\n * Schema\n */\n static get schema () {\n return IDTokenSchema\n }\n}\n\n/**\n * Export\n */\nmodule.exports = IDToken\n","/**\n * Local dependencies\n */\nconst {JWTSchema} = require('@solid/jose')\n\n/**\n * IDToken Schema\n */\nconst IDTokenSchema = JWTSchema.extend({\n properties: {\n\n /**\n * header\n * http://openid.net/specs/openid-connect-core-1_0.html#IDToken\n * ID Tokens SHOULD NOT use the JWS or JWE x5u, x5c, jku, or jwk Header\n * Parameter fields. Instead, references to keys used are communicated in\n * advance using Discovery and Registration parameters, per Section 10.\n */\n header: {\n //not: { required: ['x5u', 'x5c', 'jku', 'jwk'] }\n },\n\n /**\n * payload\n */\n payload: {\n properties: {\n\n /**\n * iss\n *\n * REQUIRED. Issuer Identifier for the Issuer of the response.\n * The iss value is a case sensitive URL using the https scheme\n * that contains scheme, host, and optionally, port number and\n * path components and no query or fragment components.\n */\n iss: { type: 'string', format: 'url' },\n\n /**\n * sub\n *\n * REQUIRED. Subject Identifier. A locally unique and never\n * reassigned identifier within the Issuer for the End-User, which\n * is intended to be consumed by the Client, e.g., 24400320 or\n * AItOawmwtWwcT0k51BayewNvutrJUqsvl6qs7A4. It MUST NOT exceed 255\n * ASCII characters in length. The sub value is a case sensitive\n * string.\n */\n sub: { type: 'string', maxLength: 255 },\n\n /**\n * aud\n *\n * REQUIRED. Audience(s) that this ID Token is intended for. It\n * MUST contain the OAuth 2.0 client_id of the Relying Party as an\n * audience value. It MAY also contain identifiers for other audiences.\n * In the general case, the aud value is an array of case sensitive\n * strings. In the common special case when there is one audience,\n * the aud value MAY be a single case sensitive string.\n */\n // inherited from JWTClaimsSetSchema\n\n /**\n * exp\n *\n * REQUIRED. Expiration time on or after which the ID Token MUST NOT\n * be accepted for processing. The processing of this parameter\n * requires that the current date/time MUST be before the expiration\n * date/time listed in the value. Implementers MAY provide for some\n * small leeway, usually no more than a few minutes, to account for\n * clock skew. Its value is a JSON number representing the number of\n * seconds from 1970-01-01T0:0:0Z as measured in UTC until the\n * date/time. See RFC 3339 [RFC3339] for details regarding date/times\n * in general and UTC in particular.\n */\n // inherited from JWTClaimsSetSchema\n\n /**\n * iat\n *\n * REQUIRED. Time at which the JWT was issued. Its value is a\n * JSON number representing the number of seconds from\n * 1970-01-01T0:0:0Z as measured in UTC until the date/time.\n */\n // inherited from JWTClaimsSetSchema\n\n /**\n * auth_time\n *\n * Time when the End-User authentication occurred. Its value is a\n * JSON number representing the number of seconds from\n * 1970-01-01T0:0:0Z as measured in UTC until the date/time. When a\n * max_age request is made or when auth_time is requested as an\n * Essential Claim, then this Claim is REQUIRED; otherwise, its\n * inclusion is OPTIONAL. (The auth_time Claim semantically\n * corresponds to the OpenID 2.0 PAPE [OpenID.PAPE] auth_time\n * response parameter.)\n */\n auth_time: { type: 'integer', format: 'NumericDate' },\n\n /**\n * nonce\n *\n * String value used to associate a Client session with an ID Token,\n * and to mitigate replay attacks. The value is passed through\n * unmodified from the Authentication Request to the ID Token. If\n * present in the ID Token, Clients MUST verify that the nonce Claim\n * Value is equal to the value of the nonce parameter sent in the\n * Authentication Request. If present in the Authentication Request,\n * Authorization Servers MUST include a nonce Claim in the ID Token\n * with the Claim Value being the nonce value sent in the\n * Authentication Request. Authorization Servers SHOULD perform no\n * other processing on nonce values used. The nonce value is a case\n * sensitive string.\n */\n nonce: { type: 'string' },\n\n /**\n * acr\n *\n * OPTIONAL. Authentication Context Class Reference. String\n * specifying an Authentication Context Class Reference value that\n * identifies the Authentication Context Class that the authentication\n * performed satisfied. The value \"0\" indicates the End-User\n * authentication did not meet the requirements of ISO/IEC 29115\n * [ISO29115] level 1. Authentication using a long-lived browser\n * cookie, for instance, is one example where the use of \"level 0\" is\n * appropriate. Authentications with level 0 SHOULD NOT be used to\n * authorize access to any resource of any monetary value. (This\n * corresponds to the OpenID 2.0 PAPE [OpenID.PAPE] nist_auth_level\n * 0.) An absolute URI or an RFC 6711 [RFC6711] registered name\n * SHOULD be used as the acr value; registered names MUST NOT be used\n * with a different meaning than that which is registered. Parties\n * using this claim will need to agree upon the meanings of the\n * values used, which may be context-specific. The acr value is a\n * case sensitive string.\n */\n acr: { type: 'string' },\n\n /**\n * amr\n * OPTIONAL. Authentication Methods References. JSON array of strings\n * that are identifiers for authentication methods used in the\n * authentication. For instance, values might indicate that both\n * password and OTP authentication methods were used. The definition\n * of particular values to be used in the amr Claim is beyond the\n * scope of this specification. Parties using this claim will need to\n * agree upon the meanings of the values used, which may be context-\n * specific. The amr value is an array of case sensitive strings.\n */\n amr: { type: 'array', items: { type: 'string' } },\n\n /**\n * azp\n * OPTIONAL. Authorized party - the party to which the ID Token was\n * issued. If present, it MUST contain the OAuth 2.0 Client ID of this\n * party. This Claim is only needed when the ID Token has a single\n * audience value and that audience is different than the authorized\n * party. It MAY be included even when the authorized party is the\n * same as the sole audience. The azp value is a case sensitive string\n * containing a StringOrURI value.\n */\n azp: { type: 'string', format: 'StringOrURI' }\n },\n\n /**\n * Required Claims\n */\n required: ['iss', 'sub', 'aud', 'exp', 'iat']\n }\n }\n})\n\n/**\n * Export\n */\nmodule.exports = IDTokenSchema\n","'use strict'\n\nconst fetch = require('node-fetch')\nconst onHttpError = require('./onHttpError')\nconst PoPToken = require('./PoPToken')\n\nclass Session {\n /**\n * @param options {Object}\n *\n * @param options.credentialType {string} 'access_token' or 'pop_token'\n *\n * @param options.issuer {string} Identity provider (issuer of ID/Access Token)\n *\n * @param options.authorization {object}\n * @param options.authorization.client_id {string} OIDC/OAuth2 client id\n * @param [options.authorization.id_token] {string} Compact-serialized id_token param\n * @param [options.authorization.access_token] {string} Compact-serialized access_token param\n * @param [options.authorization.refresh_token] {string} Compact-serialized refresh_token\n *\n * @param [options.sessionKey] {string} Serialized client session key generated\n * during the Authentication Request, used to issue PoPTokens\n *\n * @param [options.idClaims] {object} Decoded/verified ID Token JWT payload\n *\n * @param [options.accessClaims] {object} Decoded/verified Access Token JWT payload\n */\n constructor (options) {\n this.credentialType = options.credentialType || 'access_token'\n\n this.issuer = options.issuer\n\n this.authorization = options.authorization || {}\n\n this.sessionKey = options.sessionKey\n\n this.idClaims = options.idClaims\n this.accessClaims = options.accessClaims\n }\n\n static from (options) {\n return new Session(options)\n }\n\n /**\n * @param response {AuthenticationResponse}\n *\n * @returns {Session} RelyingParty Session object\n */\n static fromAuthResponse (response) {\n const RelyingParty = require('./RelyingParty') // import here due to circular dep\n\n let idClaims = response.decoded && response.decoded.payload || {}\n\n let { rp } = response\n\n let registration = rp.registration\n let rpAuthOptions = rp.defaults.authenticate || {}\n\n let credentialType = rpAuthOptions['credential_type'] ||\n rp.defaults.popToken ? 'pop_token' : 'access_token'\n\n let sessionKey = response.session[RelyingParty.SESSION_PRIVATE_KEY]\n\n let options = {\n credentialType,\n sessionKey,\n issuer: idClaims.iss,\n idClaims,\n authorization: {\n client_id: registration['client_id'],\n access_token: response.params['access_token'],\n id_token: response.params['id_token'],\n refresh_token: response.params['refresh_token']\n }\n }\n\n return Session.from(options)\n }\n\n /**\n * Authenticated fetch() getter\n *\n * @returns {function}\n */\n get fetch () {\n /**\n * fetch() function signature\n *\n * @param url {RequestInfo|string}\n * @param options {object}\n *\n * @returns {Function<Promise<Response>>}\n */\n return (url, options) => {\n return Promise.resolve()\n\n .then(() => {\n if (this.hasCredentials()) {\n return this.fetchWithCredentials(url, options)\n } else {\n return fetch(url, options)\n }\n })\n\n .then(onHttpError('Error while fetching resource'))\n }\n }\n\n /**\n * bearerTokenFor\n *\n * @param url {string}\n *\n * @returns {Promise<string>}\n */\n bearerTokenFor (url) {\n switch (this.credentialType) {\n case 'pop_token':\n return PoPToken.issueFor(url, this)\n\n default: // 'access_token' etc\n return Promise.resolve(this.authorization[this.credentialType])\n }\n }\n\n /**\n * hasCredentials\n *\n * @returns {boolean}\n */\n hasCredentials () {\n switch (this.credentialType) {\n case 'pop_token':\n return !!this.authorization['id_token']\n\n default: // 'access_token' etc\n return !!this.authorization[this.credentialType]\n }\n }\n\n /**\n * fetchWithCredentials\n *\n * @param url {RequestInfo|string}\n * @param options {object}\n *\n * @returns {Promise<Response>}\n */\n fetchWithCredentials (url, options = {}) {\n options.headers = options.headers || {}\n\n return this.bearerTokenFor(url)\n\n .then(token => {\n options.headers.authorization = `Bearer ${token}`\n\n return fetch(url, options)\n })\n }\n}\n\nmodule.exports = Session\n","'use strict'\n\nconst { URL } = require('whatwg-url')\nconst {JWT, JWK} = require('@solid/jose')\n\nconst DEFAULT_MAX_AGE = 3600 // Default token expiration, in seconds\n\nclass PoPToken extends JWT {\n /**\n * @param resourceServerUri {string} RS URI for which this token is intended\n *\n * @param session {Session}\n * @param session.sessionKey {string}\n * @param session.authorization.client_id {string}\n * @param session.authorization.id_token {string}\n *\n * @returns {Promise<string>} PoPToken, encoded as compact JWT\n */\n static issueFor (resourceServerUri, session) {\n if (!resourceServerUri) {\n throw new Error('Cannot issue PoPToken - missing resource server URI')\n }\n\n if (!session.sessionKey) {\n throw new Error('Cannot issue PoPToken - missing session key')\n }\n\n if (!session.authorization.id_token) {\n throw new Error('Cannot issue PoPToken - missing id token')\n }\n\n let jwk = JSON.parse(session.sessionKey)\n\n return JWK.importKey(jwk)\n .then(importedSessionJwk => {\n let options = {\n aud: (new URL(resourceServerUri)).origin,\n key: importedSessionJwk,\n iss: session.authorization.client_id,\n id_token: session.authorization.id_token\n }\n\n return PoPToken.issue(options)\n })\n .then(jwt => {\n return jwt.encode()\n })\n }\n\n /**\n * issue\n *\n * @param options {Object}\n * @param options.iss {string} Token issuer (RP client_id)\n * @param options.aud {string|Array<string>} Audience for the token\n * (such as the Resource Server url)\n * @param options.key {JWK} Proof of Possession (private) signing key, see\n * https://tools.ietf.org/html/rfc7800#section-3.1\n *\n * @param options.id_token {string} JWT compact encoded ID Token\n *\n * Optional:\n * @param [options.iat] {number} Issued at timestamp (in seconds)\n * @param [options.max] {number} Max token lifetime in seconds\n *\n * @returns {PoPToken} Proof of Possession Token (JWT instance)\n */\n static issue (options) {\n let { aud, iss, key } = options\n\n let alg = key.alg\n let iat = options.iat || Math.floor(Date.now() / 1000)\n let max = options.max || DEFAULT_MAX_AGE\n\n let exp = iat + max // token expiration\n\n let header = { alg }\n let payload = { iss, aud, exp, iat, id_token: options.id_token, token_type: 'pop' }\n\n let jwt = new PoPToken({ header, payload, key: key.cryptoKey }, { filter: false })\n\n return jwt\n }\n}\n\nmodule.exports = PoPToken\n","exports = module.exports = HttpError\nvar StandardError = require(\"standard-error\")\nvar STATUS_CODE_TO_NAME = require(\"./codes\")\nvar STATUS_NAME_TO_CODE = exports\n\nfunction HttpError(code, msg, props) {\n if (typeof code == \"string\") code = STATUS_NAME_TO_CODE[code]\n if (typeof code != \"number\") throw new TypeError(\"Non-numeric HTTP code\")\n if (typeof msg == \"object\" && msg != null) { props = msg; msg = null }\n StandardError.call(this, msg || STATUS_CODE_TO_NAME[code], props)\n this.code = code\n}\n\nHttpError.prototype = Object.create(StandardError.prototype, {\n constructor: {value: HttpError, configurable: true, writable: true}\n})\n\n// Set name explicitly for when the code gets minified.\nHttpError.prototype.name = \"HttpError\"\n\nObject.defineProperties(HttpError.prototype, {\n statusCode: alias(\"code\"),\n statusMessage: alias(\"message\"),\n\n status: {\n configurable: true,\n get: function() { return this.code },\n set: function(value) {\n Object.defineProperty(this, \"status\", {\n value: value, configurable: true, enumerable: true, writable: true\n })\n }\n }\n})\n\nHttpError.prototype.toString = function() {\n return this.name + \": \" + this.code + \" \" + this.message\n}\n\nfor (var code in STATUS_CODE_TO_NAME) {\n var name = STATUS_CODE_TO_NAME[code]\n exports[name.replace(\"'\", \"\").replace(/[- ]/g, \"_\").toUpperCase()] = +code\n}\n\nfunction alias(name) {\n return {\n configurable: true,\n get: function() { return this[name] },\n set: function(value) { return this[name] = value }\n }\n}\n","var has = Object.hasOwnProperty\nvar proto = Object.getPrototypeOf\nvar trace = Error.captureStackTrace\nmodule.exports = StandardError\n\nfunction StandardError(msg, props) {\n // Let all properties be enumerable for easier serialization.\n if (msg && typeof msg == \"object\") props = msg, msg = undefined\n else this.message = msg\n\n // Name has to be an own property (or on the prototype a single step up) for\n // the stack to be printed with the correct name.\n if (props) for (var key in props) this[key] = props[key]\n if (!has.call(this, \"name\"))\n this.name = has.call(proto(this), \"name\")? this.name : this.constructor.name\n\n if (trace && !(\"stack\" in this)) trace(this, this.constructor)\n}\n\nStandardError.prototype = Object.create(Error.prototype, {\n constructor: {value: StandardError, configurable: true, writable: true}\n})\n\n// Set name explicitly for when the code gets minified.\nStandardError.prototype.name = \"StandardError\"\n","/**\n * Dependencies\n */\nconst {JSONSchema} = require('@trust/json-document')\n\n/**\n * RelyingParty Schema\n *\n * This schema initializes and verifies Relying Party client configuration.\n * RelyingParty objects can be persisted and rehydrated. By encapsulating this data in\n * it's own class, it's possible to have multiple RP configurations running\n * simultaneously.\n */\nconst RelyingPartySchema = new JSONSchema({\n type: 'object',\n properties: {\n\n /**\n * provider\n *\n * Information about the provider, including issuer URL, human readable name,\n * and any configuration or provider metadata retrieved from the OP.\n */\n provider: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n url: { type: 'string', format: 'uri' },\n // NOTE:\n // OpenID Configuration (discovery response) and JSON Web Keys Set for an\n // issuer can be cached here. However the cache should not be persisted or\n // relied upon.\n //\n configuration: {}, // .well-known/openid-configuration\n jwks: {} // /jwks\n },\n required: ['url']\n },\n\n /**\n * defaults\n *\n * Default request parameters for authentication and dynamic registration requests.\n * These values can be extended or overridden via arguments to the respective\n * request methods.\n *\n * These are part of the relying party client configuration and can be serialized\n * and persisted.\n */\n defaults: {\n type: 'object',\n properties: {\n\n /**\n * Use Proof of Possession token semantics for the ID Token\n */\n popToken: {\n type: 'boolean',\n default: false\n },\n\n /**\n * Default authentication request parameters\n */\n authenticate: {\n type: 'object',\n properties: {\n redirect_uri: {\n type: 'string',\n format: 'uri'\n },\n response_type: {\n type: 'string',\n default: 'id_token token', // browser detection\n enum: [\n 'code',\n 'token',\n 'id_token token',\n 'id_token token code'\n ]\n },\n display: {\n type: 'string',\n default: 'page',\n enum: [\n 'page',\n 'popup'\n ]\n },\n scope: {\n type: ['string', 'array'],\n default: ['openid']\n }\n }\n },\n\n /**\n * Default client registration parameters\n */\n register: {}\n }\n },\n\n /**\n * registration\n *\n * This is the client registration response from dynamic registration. It should\n * always reflect the client configuration on the openid provider. A client access\n * token is stored here\n */\n registration: {},// ClientMetadataSchema\n\n /**\n * store\n */\n store: {\n type: 'object',\n default: {}\n }\n }\n})\n\n/**\n * Export\n */\nmodule.exports = RelyingPartySchema\n","// @flow\n/* eslint-env browser */\n\nfunction getLocation() {\n return typeof window !== 'undefined'\n ? window.location\n : { href: 'https://example.org/', pathname: '/', origin: 'example.org' }\n}\n\nexport const currentUrl = (): string => getLocation().href\n\nexport const currentUrlNoParams = (): string =>\n getLocation().origin + getLocation().pathname\n\nexport const navigateTo = (url: string) => {\n getLocation().href = url\n}\n\nexport const originOf = (url: string): string => new URL(url).origin\n\nexport const toUrlString = (url: any): string => {\n if (typeof url !== 'string') {\n url = 'url' in url ? url.url : url.toString()\n }\n return new URL(url, currentUrl()).toString()\n}\n","// @flow\n\n/*\n This module describes a simple IPC interface for communicating between browser windows.\n window.postMessage() is the transport interface, and a request/response interface\n is defined on top of it as follows:\n\n const request = {\n 'solid-auth-client': {\n id: 1234,\n method: 'doSomethingPlease',\n args: [ 'one', 'two', 'three' ]\n }\n }\n\n const response = {\n 'solid-auth-client': {\n id: 1234,\n ret: 'the_value'\n }\n }\n*/\n\ntype handler = (string, ...args: any[]) => ?Promise<any>\n\nconst NAMESPACE = 'solid-auth-client'\n\n/**\n * Receives and handles remote procedure calls.\n */\nexport class Server {\n _clientWindow: window\n _clientOrigin: string\n _handler: handler\n _messageListener: MessageEvent => Promise<void>\n\n constructor(clientWindow: window, clientOrigin: string, handle: handler) {\n this._clientWindow = clientWindow\n this._clientOrigin = clientOrigin\n this._handler = handle\n this._messageListener = event => this._handleMessage(event)\n }\n\n async _handleMessage({ data, origin }: MessageEvent) {\n // Ensure we can post to the origin\n if (origin !== this._clientOrigin) {\n console.warn(\n `solid-auth-client is listening to ${this._clientOrigin} ` +\n `so ignored a message received from ${origin}.`\n )\n return\n }\n\n // Parse the request and send it to the handler\n const req = data && (data: any)[NAMESPACE]\n if (req && req.method) {\n const { id, method, args } = (req: any)\n const ret = await this._handler(method, ...args)\n this._clientWindow.postMessage(\n { [NAMESPACE]: { id, ret } },\n this._clientOrigin\n )\n }\n }\n\n start() {\n window.addEventListener('message', this._messageListener)\n }\n\n stop() {\n window.removeEventListener('message', this._messageListener)\n }\n}\n\n/**\n * Makes remote procedure calls.\n */\nexport class Client {\n _serverWindow: window\n _serverOrigin: string\n\n constructor(serverWindow: window, serverOrigin: string) {\n this._serverWindow = serverWindow\n this._serverOrigin = serverOrigin\n }\n\n request(method: string, ...args: any[]): Promise<any> {\n // Send the request as a message to the server window\n const id = Math.random()\n this._serverWindow.postMessage(\n { [NAMESPACE]: { id, method, args } },\n this._serverOrigin\n )\n\n // Create a promise that resolves to the request's return value\n return new Promise((resolve, reject) => {\n // Listen for responses to the request\n window.addEventListener('message', responseListener)\n\n // Cancel if the response takes too long\n const timeout = setTimeout(() => {\n reject(new Error('Could not connect to main window.'))\n window.removeEventListener('message', responseListener)\n }, 2000)\n\n // Processes a possible response to the request\n function responseListener({ data }) {\n const resp = data && data[NAMESPACE]\n if (resp && resp.id === id && resp.hasOwnProperty('ret')) {\n resolve(resp.ret)\n clearTimeout(timeout)\n window.removeEventListener('message', responseListener)\n }\n }\n })\n }\n}\n","// @flow\nimport { Client } from './ipc'\n\nexport const NAMESPACE = 'solid-auth-client'\n\nexport interface AsyncStorage {\n getItem(key: string): Promise<?string>;\n setItem(key: string, val: string): Promise<void>;\n removeItem(key: string): Promise<void>;\n}\n\nexport type Storage = Storage | AsyncStorage\n\nexport const defaultStorage = () => {\n const hasLocalStorage =\n typeof window !== 'undefined' && 'localStorage' in window\n return asyncStorage(hasLocalStorage ? window.localStorage : memStorage())\n}\n\n/**\n * Gets the deserialized stored data\n */\nexport async function getData(store: Storage): Promise<Object> {\n let serialized\n let data\n try {\n serialized = await store.getItem(NAMESPACE)\n data = JSON.parse(serialized || '{}')\n } catch (e) {\n console.warn('Could not deserialize data:', serialized)\n console.error(e)\n data = {}\n }\n return data\n}\n\n/**\n * Updates a Storage object without mutating its intermediate representation.\n */\nexport async function updateStorage(\n store: Storage,\n update: Object => Object\n): Promise<Object> {\n const currentData = await getData(store)\n const newData = update(currentData)\n await store.setItem(NAMESPACE, JSON.stringify(newData))\n return newData\n}\n\n/**\n * Takes a synchronous storage interface and wraps it with an async interface.\n */\nexport function asyncStorage(storage: Storage): AsyncStorage {\n return {\n getItem: (key: string): Promise<?string> => {\n return Promise.resolve(storage.getItem(key))\n },\n\n setItem: (key: string, val: string): Promise<void> => {\n return Promise.resolve(storage.setItem(key, val))\n },\n\n removeItem: (key: string): Promise<void> => {\n return Promise.resolve(storage.removeItem(key))\n }\n }\n}\n\nexport const memStorage = (): Storage => {\n const store = {}\n return {\n getItem: (key: string): ?string => {\n if (typeof store[key] === 'undefined') return null\n return store[key]\n },\n setItem: (key: string, val: string): void => {\n store[key] = val\n },\n removeItem: (key: string): void => {\n delete store[key]\n }\n }\n}\n\nexport function ipcStorage(client: Client): AsyncStorage {\n return {\n getItem: (key: string): Promise<?string> =>\n client.request('storage/getItem', key),\n\n setItem: (key: string, val: string): Promise<void> =>\n client.request('storage/setItem', key, val),\n\n removeItem: (key: string): Promise<void> =>\n client.request('storage/removeItem', key)\n }\n}\n","// @flow\n\nimport type { AsyncStorage } from './storage'\nimport { getData, updateStorage } from './storage'\n\nexport type webIdOidcSession = {\n idp: string,\n webId: string,\n accessToken: string,\n idToken: string,\n clientId: string,\n sessionKey: string\n}\n\nexport type Session = webIdOidcSession\n\nexport async function getSession(storage: AsyncStorage): Promise<?Session> {\n const data = await getData(storage)\n return data.session || null\n}\n\nexport function saveSession(\n storage: AsyncStorage\n): (session: Session) => Promise<Session> {\n return async session => {\n const data = await updateStorage(storage, data => ({ ...data, session }))\n return data.session\n }\n}\n\nexport async function clearSession(storage: AsyncStorage): Promise<void> {\n await updateStorage(storage, data => ({ ...data, session: null }))\n}\n","// @flow\n/* global Response */\nimport * as authorization from 'auth-header'\nimport RelyingParty from '@solid/oidc-rp'\nimport PoPToken from '@solid/oidc-rp/lib/PoPToken'\n\nimport type { loginOptions } from './solid-auth-client'\nimport { currentUrl, navigateTo, toUrlString } from './url-util'\nimport type { webIdOidcSession } from './session'\nimport type { AsyncStorage } from './storage'\nimport { defaultStorage, getData, updateStorage } from './storage'\n\nexport async function login(\n idp: string,\n options: loginOptions\n): Promise<?null> {\n try {\n const rp = await getRegisteredRp(idp, options)\n await saveAppHashFragment(options.storage)\n return sendAuthRequest(rp, options)\n } catch (err) {\n console.warn('Error logging in with WebID-OIDC')\n console.error(err)\n return null\n }\n}\n\nexport async function currentSession(\n storage: AsyncStorage = defaultStorage()\n): Promise<?webIdOidcSession> {\n try {\n // Obtain the Relying Party\n const rp = await getStoredRp(storage)\n if (!rp) {\n return null\n }\n\n // Obtain and clear the OIDC URL fragment\n const url = currentUrl()\n if (!/#(.*&)?access_token=/.test(url)) {\n return null\n }\n window.location.hash = ''\n await restoreAppHashFragment(storage)\n\n // Obtain a session from the Relying Party\n const storeData = await getData(storage)\n const session = await rp.validateResponse(url, storeData)\n if (!session) {\n return null\n }\n return {\n ...session,\n webId: session.idClaims.sub,\n idp: session.issuer\n }\n } catch (err) {\n console.warn('Error finding a WebID-OIDC session')\n console.error(err)\n return null\n }\n}\n\nexport async function logout(\n storage: AsyncStorage,\n fetch: Function\n): Promise<void> {\n const rp = await getStoredRp(storage)\n if (rp) {\n try {\n // First log out from the IDP\n await rp.logout()\n // Then, log out from the RP\n try {\n await fetch('/.well-known/solid/logout', { credentials: 'include' })\n } catch (e) {\n // Ignore errors for when we are not on a Solid pod\n }\n } catch (err) {\n console.warn('Error logging out of the WebID-OIDC session')\n console.error(err)\n }\n }\n}\n\nexport async function getRegisteredRp(\n idp: string,\n options: loginOptions\n): Promise<RelyingParty> {\n // To reuse a possible previous RP,\n // it be for the same IDP and redirect URI\n let rp = await getStoredRp(options.storage)\n if (\n !rp ||\n rp.provider.url !== idp ||\n !rp.registration.redirect_uris.includes(options.callbackUri)\n ) {\n // Register a new RP\n rp = await registerRp(idp, options)\n await storeRp(options.storage, idp, rp)\n }\n return rp\n}\n\nasync function getStoredRp(storage: AsyncStorage): Promise<?RelyingParty> {\n const data = await getData(storage)\n const { rpConfig } = data\n if (rpConfig) {\n rpConfig.store = storage\n return RelyingParty.from(rpConfig)\n } else {\n return null\n }\n}\n\nasync function storeRp(\n storage: AsyncStorage,\n idp: string,\n rp: RelyingParty\n): Promise<RelyingParty> {\n await updateStorage(storage, data => ({\n ...data,\n rpConfig: rp\n }))\n return rp\n}\n\nfunction registerRp(idp: string, opts: loginOptions): Promise<RelyingParty> {\n const { storage, callbackUri } = opts\n const responseType = 'id_token token'\n\n const clientNameI18n = {}\n Object.entries(opts)\n .filter(([key, _]) => key.startsWith('clientName#'))\n .forEach(\n ([key, value]) =>\n (clientNameI18n[key.replace('clientName#', 'client_name#')] = value)\n )\n\n const supplementaryOptions = {\n logo_uri: opts.logoUri,\n contacts: opts.contacts,\n client_name: opts.clientName\n }\n\n const registration = {\n issuer: idp,\n grant_types: ['implicit'],\n redirect_uris: [callbackUri],\n response_types: [responseType],\n scope: 'openid profile',\n ...clientNameI18n,\n ...supplementaryOptions\n }\n\n const options = {\n defaults: {\n authenticate: {\n redirect_uri: callbackUri,\n response_type: responseType\n }\n },\n store: storage\n }\n\n return RelyingParty.register(idp, registration, options)\n}\n\nasync function sendAuthRequest(\n rp: RelyingParty,\n { callbackUri, storage }: loginOptions\n): Promise<void> {\n const data = await getData(storage)\n const url = await rp.createRequest({ redirect_uri: callbackUri }, data)\n await updateStorage(storage, () => data)\n return navigateTo(url)\n}\n\nasync function saveAppHashFragment(store: AsyncStorage): Promise<void> {\n await updateStorage(store, data => ({\n ...data,\n appHashFragment: window.location.hash\n }))\n}\n\nasync function restoreAppHashFragment(store: AsyncStorage): Promise<void> {\n await updateStorage(store, ({ appHashFragment = '', ...data }) => {\n window.location.hash = appHashFragment\n return data\n })\n}\n\n/**\n * Answers whether a HTTP response requires WebID-OIDC authentication.\n */\nexport function requiresAuth(resp: Response): boolean {\n if (resp.status !== 401) {\n return false\n }\n const wwwAuthHeader = resp.headers.get('www-authenticate')\n if (!wwwAuthHeader) {\n return false\n }\n const auth = authorization.parse(wwwAuthHeader)\n return (\n auth.scheme === 'Bearer' &&\n auth.params &&\n auth.params.scope === 'openid webid'\n )\n}\n\n/**\n * Fetches a resource, providing the WebID-OIDC ID Token as authentication.\n * Assumes that the resource has requested those tokens in a previous response.\n */\nexport async function fetchWithCredentials(\n session: webIdOidcSession,\n fetch: Function,\n input: any,\n options?: RequestOptions\n): Promise<Response> {\n // Create a copy of the headers\n const headers = {}\n const origHeaders = options ? options.headers : input.headers\n if (origHeaders) {\n const entries =\n typeof origHeaders.entries === 'function'\n ? origHeaders.entries()\n : Object.entries(origHeaders)\n for (const [name, value] of entries) {\n headers[name] = value\n }\n }\n\n // Add Authorization header\n const popToken = await PoPToken.issueFor(toUrlString(input), session)\n headers.authorization = `Bearer ${popToken}`\n return fetch(input, { ...options, credentials: 'include', headers })\n}\n","// @flow\n/* globalRequest, Response, URL */\nimport { getSession } from './session'\nimport type { AsyncStorage } from './storage'\nimport { getData, updateStorage } from './storage'\nimport * as WebIdOidc from './webid-oidc'\n\nexport type host = {\n url: string,\n requiresAuth: boolean\n}\n\nexport function getHost(storage: AsyncStorage): string => Promise<?host> {\n return async url => {\n const { host } = new URL(url)\n const session = await getSession(storage)\n if (session && host === new URL(session.idp).host) {\n return { url: host, requiresAuth: true }\n }\n const { hosts } = await getData(storage)\n return hosts && hosts[host]\n }\n}\n\nexport function saveHost(storage: AsyncStorage): host => Promise<void> {\n return async ({ url, requiresAuth }) => {\n await updateStorage(storage, data => ({\n ...data,\n hosts: {\n ...data.hosts,\n [url]: { requiresAuth }\n }\n }))\n }\n}\n\nexport function updateHostFromResponse(\n storage: AsyncStorage\n): Response => Promise<void> {\n return async resp => {\n if (WebIdOidc.requiresAuth(resp)) {\n const { host } = new URL(resp.url)\n await saveHost(storage)({ url: host, requiresAuth: true })\n }\n }\n}\n","// @flow\nimport 'isomorphic-fetch'\n\nimport { toUrlString } from './url-util'\nimport { getHost, updateHostFromResponse } from './host'\nimport { getSession } from './session'\nimport type { AsyncStorage } from './storage'\nimport { fetchWithCredentials } from './webid-oidc'\n\nexport async function authnFetch(\n storage: AsyncStorage,\n fetch: Function,\n input: RequestInfo,\n options?: RequestOptions\n): Promise<Response> {\n // If not authenticated, perform a regular fetch\n const session = await getSession(storage)\n if (!session) {\n return fetch(input, options)\n }\n\n // If we know the server expects credentials, send them\n if (await shouldShareCredentials(storage, input)) {\n return fetchWithCredentials(session, fetch, input, options)\n }\n\n // If we don't know for sure, try a regular fetch first\n let resp = await fetch(input, options)\n\n // If the server then requests credentials, send them\n if (resp.status === 401) {\n await updateHostFromResponse(storage)(resp)\n if (await shouldShareCredentials(storage, input)) {\n resp = fetchWithCredentials(session, fetch, input, options)\n }\n }\n return resp\n}\n\nasync function shouldShareCredentials(\n storage: AsyncStorage,\n input: RequestInfo\n): Promise<boolean> {\n const requestHost = await getHost(storage)(toUrlString(input))\n return requestHost != null && requestHost.requiresAuth\n}\n","// @flow\nimport type { loginOptions } from './solid-auth-client'\nimport { Server } from './ipc'\nimport type { Session } from './session'\nimport type { AsyncStorage } from './storage'\nimport { originOf } from './url-util'\n\nexport function openIdpPopup(popupUri: string): window {\n const width = 650\n const height = 400\n const left = window.screenX + (window.innerWidth - width) / 2\n const top = window.screenY + (window.innerHeight - height) / 2\n const settings = `width=${width},height=${height},left=${left},top=${top}`\n return window.open(popupUri, 'solid-auth-client', settings)\n}\n\nexport function obtainSession(\n store: AsyncStorage,\n popup: window,\n options: loginOptions\n): Promise<?Session> {\n return new Promise((resolve, reject) => {\n const popupServer = new Server(\n popup,\n originOf(options.popupUri || ''),\n popupHandler(store, options, (session: Session) => {\n popupServer.stop()\n resolve(session)\n })\n )\n popupServer.start()\n })\n}\n\nexport function popupHandler(\n store: AsyncStorage,\n { popupUri, callbackUri }: loginOptions,\n foundSessionCb: Session => void\n) {\n return async (method: string, ...args: any[]) => {\n switch (method) {\n // Origin\n case 'getAppOrigin':\n return window.location.origin\n\n // Storage\n case 'storage/getItem':\n return store.getItem(...args)\n case 'storage/setItem':\n return store.setItem(...args)\n case 'storage/removeItem':\n return store.removeItem(...args)\n\n // Login\n case 'getLoginOptions':\n return { popupUri, callbackUri }\n case 'foundSession':\n foundSessionCb(...args)\n }\n }\n}\n","// @flow\n/* global fetch */\nimport EventEmitter from 'events'\nimport { authnFetch } from './authn-fetch'\nimport { openIdpPopup, obtainSession } from './popup'\nimport type { Session } from './session'\nimport { getSession, saveSession, clearSession } from './session'\nimport type { AsyncStorage } from './storage'\nimport { defaultStorage } from './storage'\nimport { toUrlString, currentUrlNoParams } from './url-util'\nimport * as WebIdOidc from './webid-oidc'\n\n// Store the global fetch, so the user is free to override it\nconst globalFetch = fetch\n\nexport type loginOptions = {\n callbackUri: string,\n clientName?: string,\n contacts?: Array<string>,\n logoUri?: string,\n popupUri: string,\n storage: AsyncStorage\n}\n\nexport default class SolidAuthClient extends EventEmitter {\n _pendingSession: ?Promise<?Session>\n\n fetch(input: RequestInfo, options?: RequestOptions): Promise<Response> {\n this.emit('request', toUrlString(input))\n return authnFetch(defaultStorage(), globalFetch, input, options)\n }\n\n login(idp: string, options: loginOptions): Promise<?Session> {\n options = { ...defaultLoginOptions(currentUrlNoParams()), ...options }\n return WebIdOidc.login(idp, options)\n }\n\n async popupLogin(options: loginOptions): Promise<?Session> {\n options = { ...defaultLoginOptions(), ...options }\n if (!/https?:/.test(options.popupUri)) {\n options.popupUri = new URL(\n options.popupUri || '/.well-known/solid/login',\n window.location\n ).toString()\n }\n if (!options.callbackUri) {\n options.callbackUri = options.popupUri\n }\n const popup = openIdpPopup(options.popupUri)\n const session = await obtainSession(options.storage, popup, options)\n this.emit('login', session)\n this.emit('session', session)\n return session\n }\n\n async currentSession(\n storage: AsyncStorage = defaultStorage()\n ): Promise<?Session> {\n // Try to obtain a stored or pending session\n let session = this._pendingSession || (await getSession(storage))\n\n // If none found, attempt to create a new session\n if (!session) {\n // Try to create a new OIDC session from stored tokens\n try {\n this._pendingSession = WebIdOidc.currentSession(storage)\n session = await this._pendingSession\n } catch (err) {\n console.error(err)\n }\n\n // Save the new session and emit session events\n if (session) {\n await saveSession(storage)(session)\n this.emit('login', session)\n this.emit('session', session)\n }\n delete this._pendingSession\n }\n return session\n }\n\n async trackSession(callback: Function): Promise<void> {\n /* eslint-disable standard/no-callback-literal */\n callback(await this.currentSession())\n this.on('session', callback)\n }\n\n stopTrackSession(callback: Function): void {\n this.removeListener('session', callback)\n }\n\n async logout(storage: AsyncStorage = defaultStorage()): Promise<void> {\n const session = await getSession(storage)\n if (session) {\n try {\n await WebIdOidc.logout(storage, globalFetch)\n this.emit('logout')\n this.emit('session', null)\n } catch (err) {\n console.warn('Error logging out:')\n console.error(err)\n }\n await clearSession(storage)\n }\n }\n}\n\nfunction defaultLoginOptions(url: ?string): loginOptions {\n return {\n callbackUri: url ? url.split('#')[0] : '',\n popupUri: '',\n storage: defaultStorage()\n }\n}\n","import SolidAuthClient from './solid-auth-client'\n\n// Export a singleton instance of SolidAuthClient\nconst auth = new SolidAuthClient()\nexport default auth\n\n// Bind methods to instance, so they can be invoked as regular functions\n// (e.g., to pass around the fetch function)\nObject.getOwnPropertyNames(SolidAuthClient.prototype).forEach(property => {\n const value = auth[property]\n if (typeof value === 'function') {\n auth[property] = value.bind(auth)\n }\n})\n\n// Expose window.SolidAuthClient for backward compatibility\nif (typeof window !== 'undefined') {\n if ('SolidAuthClient' in window) {\n console.warn('Caution: multiple versions of solid-auth-client active.')\n } else {\n let warned = false\n Object.defineProperty(window, 'SolidAuthClient', {\n enumerable: true,\n get: () => {\n if (!warned) {\n warned = true\n console.warn('window.SolidAuthClient has been deprecated.')\n console.warn('Please use window.solid.auth instead.')\n }\n return auth\n }\n })\n }\n}\n"],"sourceRoot":""}