filer/dist/filer.js.map

1 line
908 KiB
Plaintext

{"version":3,"sources":["../node_modules/es6-promisify/dist/promisify.mjs","../node_modules/process/browser.js","../node_modules/path-browserify/index.js","path.js","constants.js","../node_modules/base64-js/index.js","../node_modules/ieee754/index.js","../node_modules/isarray/index.js","../node_modules/buffer/index.js","providers/indexeddb.js","../lib/async.js","providers/memory.js","providers/index.js","errors.js","shell/environment.js","../node_modules/concat-map/index.js","../node_modules/balanced-match/index.js","../node_modules/brace-expansion/index.js","../node_modules/minimatch/minimatch.js","shell/shell.js","../lib/eventemitter.js","shared.js","../lib/intercom.js","fs-watcher.js","directory-entry.js","open-files.js","node.js","open-file-description.js","super-node.js","stats.js","dirent.js","filesystem/implementation.js","filesystem/interface.js","../node_modules/schema-utils/dist/keywords/absolutePath.js","../node_modules/schema-utils/dist/util/Range.js","../node_modules/schema-utils/dist/util/hints.js","../node_modules/schema-utils/dist/ValidationError.js","../../src/util.ts","../../src/regexps-uri.ts","../../src/regexps-iri.ts","../../node_modules/punycode/punycode.es6.js","../../src/uri.ts","../../src/schemes/http.ts","../../src/schemes/https.ts","../../src/schemes/mailto.ts","../../src/schemes/urn.ts","../../src/schemes/urn-uuid.ts","../../src/index.ts","../node_modules/schema-utils/node_modules/fast-deep-equal/index.js","../node_modules/schema-utils/node_modules/ajv/lib/compile/ucs2length.js","../node_modules/schema-utils/node_modules/ajv/lib/compile/util.js","../node_modules/schema-utils/node_modules/ajv/lib/compile/schema_obj.js","../node_modules/json-schema-traverse/index.js","../node_modules/schema-utils/node_modules/ajv/lib/compile/resolve.js","../node_modules/schema-utils/node_modules/ajv/lib/compile/error_classes.js","../node_modules/fast-json-stable-stringify/index.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/validate.js","../node_modules/schema-utils/node_modules/ajv/lib/compile/index.js","../node_modules/schema-utils/node_modules/ajv/lib/cache.js","../node_modules/schema-utils/node_modules/ajv/lib/compile/formats.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/ref.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/allOf.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/anyOf.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/comment.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/const.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/contains.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/dependencies.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/enum.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/format.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/if.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/items.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/_limit.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/_limitItems.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/_limitLength.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/_limitProperties.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/multipleOf.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/not.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/oneOf.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/pattern.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/properties.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/propertyNames.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/required.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/uniqueItems.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/index.js","../node_modules/schema-utils/node_modules/ajv/lib/compile/rules.js","../node_modules/schema-utils/node_modules/ajv/lib/data.js","../node_modules/schema-utils/node_modules/ajv/lib/compile/async.js","../node_modules/schema-utils/node_modules/ajv/lib/dotjs/custom.js","../node_modules/schema-utils/node_modules/ajv/lib/refs/json-schema-draft-07.json","../node_modules/schema-utils/node_modules/ajv/lib/definition_schema.js","../node_modules/schema-utils/node_modules/ajv/lib/keyword.js","../node_modules/schema-utils/node_modules/ajv/lib/refs/data.json","../node_modules/schema-utils/node_modules/ajv/lib/ajv.js","../node_modules/ajv-keywords/keywords/instanceof.js","../node_modules/ajv-keywords/keywords/range.js","../node_modules/ajv-keywords/keywords/regexp.js","../node_modules/ajv-keywords/keywords/typeof.js","../node_modules/ajv-keywords/keywords/dynamicDefaults.js","../node_modules/ajv-keywords/keywords/allRequired.js","../node_modules/ajv-keywords/keywords/anyRequired.js","../node_modules/ajv-keywords/keywords/oneRequired.js","../node_modules/ajv-keywords/keywords/prohibited.js","../node_modules/ajv-keywords/keywords/uniqueItemProperties.js","../node_modules/ajv-keywords/keywords/_util.js","../node_modules/ajv-keywords/keywords/deepProperties.js","../node_modules/ajv-keywords/keywords/deepRequired.js","../node_modules/ajv-keywords/keywords/dotjs/_formatLimit.js","../node_modules/ajv-keywords/keywords/_formatLimit.js","../node_modules/ajv-keywords/keywords/formatMinimum.js","../node_modules/ajv-keywords/keywords/formatMaximum.js","../node_modules/ajv-keywords/keywords/dotjs/patternRequired.js","../node_modules/ajv-keywords/keywords/patternRequired.js","../node_modules/ajv-keywords/keywords/dotjs/switch.js","../node_modules/ajv-keywords/keywords/switch.js","../node_modules/ajv-keywords/keywords/select.js","../node_modules/ajv-keywords/keywords/transform.js","../node_modules/ajv-keywords/keywords/index.js","../node_modules/ajv-keywords/index.js","../node_modules/schema-utils/dist/validate.js","../node_modules/schema-utils/dist/index.js","webpack-plugin/utils.js","webpack-plugin/schema.js","webpack-plugin/processors.js","webpack-plugin/index.js","index.js"],"names":["customArgumentsToken","promisify","a","TypeError","b","c","Promise","Error","d","arguments","length","e","Array","f","push","g","h","forEach","apply","argumentNames","process","module","exports","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","setTimeout","clearTimeout","runTimeout","fun","call","runClearTimeout","marker","queue","draining","currentQueue","queueIndex","cleanUpNextTick","concat","drainQueue","timeout","len","run","nextTick","args","i","Item","array","prototype","title","env","argv","version","versions","noop","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","name","binding","cwd","chdir","dir","umask","nodePath","require","filerPath","Object","assign","basename","path","ext","normalize","removeTrailing","isNull","indexOf","addTrailing","replace","O_READ","O_WRITE","O_CREATE","O_EXCLUSIVE","O_TRUNCATE","O_APPEND","XATTR_CREATE","XATTR_REPLACE","FILE_SYSTEM_NAME","FILE_STORE_NAME","IDB_RO","IDB_RW","WSQL_VERSION","WSQL_SIZE","WSQL_DESC","NODE_TYPE_FILE","NODE_TYPE_DIRECTORY","NODE_TYPE_SYMBOLIC_LINK","NODE_TYPE_META","DEFAULT_DIR_PERMISSIONS","DEFAULT_FILE_PERMISSIONS","FULL_READ_WRITE_EXEC_PERMISSIONS","READ_WRITE_PERMISSIONS","SYMLOOP_MAX","BINARY_MIME_TYPE","JSON_MIME_TYPE","ROOT_DIRECTORY_NAME","FS_FORMAT","FS_NOCTIME","FS_NOMTIME","FS_NODUPEIDCHECK","O_FLAGS","FS_READY","FS_PENDING","FS_ERROR","SUPER_NODE_ID","STDIN","STDOUT","STDERR","FIRST_DESCRIPTOR","ENVIRONMENT","TMP","PATH","fsConstants","O_RDONLY","O_WRONLY","O_RDWR","S_IFMT","S_IFREG","S_IFDIR","S_IFCHR","S_IFBLK","S_IFIFO","S_IFLNK","S_IFSOCK","O_CREAT","O_EXCL","O_NOCTTY","O_TRUNC","O_DIRECTORY","O_NOFOLLOW","O_SYNC","O_DSYNC","O_SYMLINK","O_NONBLOCK","S_IRWXU","S_IRUSR","S_IWUSR","S_IXUSR","S_IRWXG","S_IRGRP","S_IWGRP","S_IXGRP","S_IRWXO","S_IROTH","S_IWOTH","S_IXOTH","F_OK","R_OK","W_OK","X_OK","UV_FS_COPYFILE_EXCL","COPYFILE_EXCL","IndexedDBContext","db","mode","_getObjectStore","objectStore","transaction","clear","callback","request","onsuccess","onerror","event","preventDefault","error","err","_get","key","get","result","target","getObject","getBuffer","arrayBuffer","Buffer","from","_put","value","put","putObject","putBuffer","uint8BackedBuffer","buf","buffer","delete","IndexedDB","isSupported","indexedDB","global","mozIndexedDB","webkitIndexedDB","msIndexedDB","open","that","openRequest","onupgradeneeded","objectStoreNames","contains","deleteObjectStore","createObjectStore","getReadOnlyContext","getReadWriteContext","async","setImmediate","fn","eachSeries","arr","iterator","completed","iterate","forEachSeries","define","amd","root","asyncCallback","createDB","pool","getOrCreate","hasOwnProperty","MemoryContext","readOnly","keys","Memory","Default","errors","split","errno","errName","defaultMessage","FilerError","msg","code","message","stack","create","constructor","toString","pathInfo","defaults","Environment","set","Path","Errors","minimatch","Shell","fs","options","defineProperty","enumerable","cd","resolve","stat","stats","ENOTDIR","type","pwd","promises","methodName","bind","exec","sh","readFile","data","cmd","Function","touch","createFile","writeFile","updateTimes","now","Date","atime","date","mtime","utimes","updateOnly","cat","files","all","EINVAL","append","item","filename","ls","list","pathname","readdir","entries","getDirEntry","join","entry","recursive","items","contents","rm","remove","unlink","rmdir","ENOTEMPTY","map","tempDir","tmp","mkdir","mkdirp","_mkdirp","isDirectory","isFile","parent","dirname","find","next","found","processPath","maybeProcessPath","rawPath","regex","test","walk","removeItem","splice","EventEmitter","createInterface","space","methods","trigger","slice","self","pvt","_on","_off","_trigger","pub","unshift","generateRandom","template","r","Math","random","v","guid","toUpperCase","randomChars","n","repeat","nop","throttle","delay","last","extend","localStorage","window","getItem","setItem","Intercom","origin","lastMessage","receivedIDs","previousValues","storageHandler","_onStorageEvent","document","attachEvent","addEventListener","_transaction","TIMEOUT","WAIT","executed","listening","waitTimer","lock","activeLock","INDEX_LOCK","unlock","_cleanup_emit","threshold","THRESHOLD_TTL_EMIT","changed","messages","JSON","parse","INDEX_EMIT","timestamp","stringify","_cleanup_once","ttl","table","INDEX_ONCE","_once_expired","THRESHOLD_TTL_ONCE","_localStorageChanged","field","currentValue","id","payload","_emit","String","packet","delimiter","substring","supported","destroy","getInstance","intercom","FSWatcher","recursivePathPrefix","onchange","start","filename_","persistent_","recursive_","close","DirectoryEntry","openFiles","getEmptyDescriptor","fd","getOpenFileDescription","ofd","allocDescriptor","openFileDescription","releaseDescriptor","ensureID","prop","generateMode","nodeType","modePermissions","Node","size","ctime","flags","xattrs","nlinks","permissions","uid","gid","OpenFileDescription","position","getNode","context","check_if_node_exists","node","EBADF","Constants","SuperNode","rnode","dateFromMs","ms","Number","Stats","fileNode","devName","dev","atimeMs","mtimeMs","ctimeMs","isSymbolicLink","isSocket","isFIFO","isCharacterDevice","isBlockDevice","Dirent","isAbsolutePath","isAbsolute","shared","update_node_times","times","includes","update","complete","changes","make_node","parentPath","parentNode","parentNodeData","create_node_in_parent","parentDirectoryNode","find_node","EEXIST","ENOENT","create_node","update_parent_node_data","update_time","followedCount","read_root_directory_node","nodeData","superNode","EFILESYSTEMERROR","check_root_directory_node","rootDirectoryNode","read_parent_directory_data","get_node_from_parent_directory_data","parentDirectoryData","nodeId","is_symbolic_link","ELOOP","follow_symbolic_link","set_extended_attribute","flag","ENOATTR","ensure_root_directory","directoryNode","directoryData","ensure_super_node","existingNode","write_directory_node","write_directory_data","make_directory","check_if_directory_exists","update_parent_directory_data","access_file","st_mode","validateAndMaskMode","EACCES","remove_directory","EBUSY","check_if_node_is_directory","check_if_directory_is_empty","remove_directory_entry_from_parent_directory_node","remove_directory_node","remove_directory_data","open_file","directoryEntry","fileData","EISDIR","set_file_node","read_directory_data","check_if_file_exists","check_if_symbolic_link","write_file_node","undefined","write_file_data","alloc","update_directory_data","handle_update_result","replace_data","offset","return_nbytes","update_file_node","newData","copy","write_data","update_file_data","EIO","_position","newSize","max","read_file_data","read_data","handle_file_data","stat_file","fstat_file","lstat_file","link_node","oldpath","newpath","oldname","oldParentPath","newname","newParentPath","oldDirectoryNode","oldDirectoryData","newDirectoryNode","newDirectoryData","fileNodeID","read_file_node","check_if_new_file_exists","read_new_directory_data","check_if_old_file_exists","EPERM","read_old_directory_data","unlink_node","delete_file_data","read_directory","validate_directory_options","handle_directory_data","encoding","fileBuffers","file","fileBuffer","withFileTypes","dirEnts","to_dir_entry","filepath","get_dir_entry","dirEnt","check_result","enc","make_symbolic_link","srcpath","dstpath","symlink_relpath","read_link","check_if_symbolic","truncate_file","truncate_file_data","ftruncate_file","utimes_file","update_times","futimes_file","setxattr_file","setxattr","fsetxattr_file","getxattr_file","get_xattr","fgetxattr_file","removexattr_file","remove_xattr","fremovexattr_file","validate_flags","validate_file_options","fileMode","mknod","access","mkdtemp","prefix","fstat","link","read","wrapped_cb","bytesRead","fsync","validateInteger","cleanup","fstatResult","write","isBuffer","appendFile","exists","cb","octalReg","isUint32","def","isInteger","parsed","parseInt","chmod_file","update_mode","fchmod_file","chown_file","update_owner","fchown_file","getxattr","fgetxattr","fsetxattr","removexattr","fremovexattr","lseek","whence","update_descriptor_position","toUnixTimestamp","time","getTime","currentTime","futimes","chmod","fchmod","chown","fchown","rename","oldName","newName","oldParentDirectory","oldParentData","newParentDirectory","newParentData","read_new_directory","update_old_parent_directory_data","update_new_parent_directory_data","check_if_new_directory_exists","read_new_parent_directory_data","get_new_parent_directory","unlink_old_file","check_node_type","symlink","readlink","lstat","truncate","ftruncate","ensureRootDirectory","providers","defaultGuidFn","impl","maybeCallback","defaultCallback","console","toPathIfFileURL","fileURLOrPath","protocol","third","codePointAt","decodeURIComponent","toPathIfBuffer","bufferOrPath","validatePath","allowRelative","processPathArg","idx","FileSystem","provider","forceFormatting","readyState","stdin","stdout","stderr","constants","queueOrRun","operation","runQueued","watch","listener","watcher","wrappedGuidFn","guidWithCheck","broadcastChanges","change","wrappedContext","openReadWriteContext","openReadOnlyContext","absPathArgs","relPathArgs","method","shouldPromisify","lastArgIndex","missingCallback","pathArg","fnArgs","default","errorMessage","schema","dataPath","schemaPath","keyword","params","absolutePath","parentSchema","getErrorFor","shouldBeAbsolute","addAbsolutePathKeyword","ajv","addKeyword","compile","passes","isExclamationMarkPresent","isCorrectAbsolutePath","_default","Range","_left","_right","exclusive","logic","getRangeValue","leftExclusive","end","rightExclusive","isFinite","realStart","realEnd","formatLeft","formatRight","formatRange","side","getOperator","startExclusive","endExclusive","values","minMax","Infinity","j","predicate","stringHints","hints","currentSchema","tmpLength","minLength","tmpFormat","formatMinimum","tmpExclusive","formatExclusiveMaximum","maxLength","formatMaximum","formatExclusiveMinimum","pattern","format","numberHints","range","minimum","left","exclusiveMinimum","maximum","right","exclusiveMaximum","rangeFormat","multipleOf","SPECIFICITY","not","oneOf","anyOf","if","enum","const","instanceof","required","patternRequired","uniqueItems","minItems","maxItems","minProperties","maxProperties","dependencies","propertyNames","additionalItems","additionalProperties","filterMax","evaluatedMax","reduce","filter","filterChildren","children","newChildren","findAllChildren","schemaPaths","every","refs","extractRefs","childrenStart","isArray","$ref","s","groupChildrenByFirstChild","child","reverse","indent","str","hasNotInSchema","findFirstTypedSchema","canApplyNot","typedSchema","likeNumber","likeInteger","likeString","likeNull","likeBoolean","isObject","maybeObj","likeArray","likeObject","properties","patternProperties","getArticle","getSchemaNonTypes","formatHints","getHints","ValidationError","configuration","headerNameFromSchema","baseDataPathFromSchema","baseDataPath","splittedTitleFromSchema","match","headerName","postFormatter","header","formatValidationErrors","captureStackTrace","newPath","schemaPart","inner","prevSchemas","newLogic","formatInnerSchema","innerSchema","addSelf","formatSchema","needApplyLogicHere","allOf","ifValue","thenValue","then","elseValue","else","getSchemaPart","hasAdditionalItems","Boolean","allProperties","Set","objectStructure","property","isRequired","dependencyName","dependency","dep","additionalPath","needDot","schemaText","description","errorDataPath","getSchemaPartText","getSchemaPartDescription","comparison","limit","missingPattern","missingProperty","hasProperty","additionalProperty","deps","trim","propertyName","postfix","schemaOutput","lastChild","remainingChildren","formatValidationError","filteredChildren","nestedError","failingKeyword","ErrorInJSON","formattedError","merge","sets","xl","x","subexp","typeOf","o","pop","shift","toLowerCase","toArray","obj","setInterval","source","buildExps","isIRI","ALPHA$$","CR$","DIGIT$$","DQUOTE$$","HEXDIG$$","SP$$","PCT_ENCODED$","SUB_DELIMS$$","RESERVED$$","GEN_DELIMS$$","UCSCHAR$$","SCHEME$","USERINFO$","UNRESERVED$$","DEC_OCTET$","DEC_OCTET_RELAXED$","H16$","LS32$","IPV4ADDRESS$","IPV6ADDRESS1$","IPV6ADDRESS2$","IPV6ADDRESS3$","IPV6ADDRESS4$","IPV6ADDRESS5$","IPV6ADDRESS6$","IPV6ADDRESS7$","IPV6ADDRESS8$","IPV6ADDRESS9$","ZONEID$","IPV6ADDRESS$","IP_LITERAL$","IPV6ADDRZ_RELAXED$","IPVFUTURE$","HOST$","REG_NAME$","PORT$","AUTHORITY$","PCHAR$","SEGMENT$","SEGMENT_NZ$","SEGMENT_NZ_NC$","PATH_ABEMPTY$","PATH_ABSOLUTE$","PATH$","PATH_NOSCHEME$","PATH_ROOTLESS$","PATH_EMPTY$","QUERY$","IPRIVATE$$","FRAGMENT$","HIER_PART$","URI$","RELATIVE_PART$","RELATIVE$","URI_REFERENCE$","ABSOLUTE_URI$","GENERIC_REF$","RELATIVE_REF$","ABSOLUTE_REF$","SAMEDOC_REF$","AUTHORITY_REF$","RegExp","maxInt","base","tMin","tMax","skew","damp","initialBias","initialN","regexPunycode","regexNonASCII","regexSeparators","baseMinusTMin","floor","stringFromCharCode","fromCharCode","RangeError","mapDomain","string","parts","labels","encoded","ucs2decode","output","counter","charCodeAt","extra","ucs2encode","fromCodePoint","basicToDigit","codePoint","digitToBasic","digit","adapt","delta","numPoints","firstTime","k","decode","input","inputLength","bias","basic","lastIndexOf","index","oldi","w","t","baseMinusT","out","encode","basicLength","handledCPCount","m","handledCPCountPlusOne","q","qMinusT","toUnicode","toASCII","punycode","SCHEMES","pctEncChar","chr","pctDecChars","newStr","il","substr","c2","c3","_normalizeComponentEncoding","components","decodeUnreserved","decStr","UNRESERVED","scheme","PCT_ENCODED","NOT_SCHEME","userinfo","NOT_USERINFO","host","NOT_HOST","NOT_PATH","NOT_PATH_NOSCHEME","query","NOT_QUERY","fragment","NOT_FRAGMENT","_stripLeadingZeros","_normalizeIPv4","matches","IPV4ADDRESS","address","_normalizeIPv6","IPV6ADDRESS","zone","first","firstFields","lastFields","isLastFieldIPv4Address","fieldCount","lastFieldsStart","fields","allZeroFields","acc","lastLongest","longestZeroFields","sort","newHost","newFirst","newLast","URI_PARSE","NO_MATCH_IS_UNDEFINED","uriString","iri","IRI_PROTOCOL","URI_PROTOCOL","reference","port","isNaN","schemeHandler","unicodeSupport","domainHost","_recomposeAuthority","uriTokens","_","$1","$2","RDS1","RDS2","RDS3","RDS5","removeDotSegments","im","serialize","authority","charAt","resolveComponents","relative","skipNormalization","tolerant","baseURI","relativeURI","schemelessOptions","uri","equal","uriA","uriB","escapeComponent","ESCAPE","unescapeComponent","handler","http","O","ATEXT$$","QTEXT$$","VCHAR$$","SOME_DELIMS$$","NOT_LOCAL_PART","NOT_HFNAME","NOT_HFVALUE","mailtoComponents","to","unknownHeaders","headers","hfields","hfield","toAddrs","subject","body","addr","toAddr","atIdx","localPart","domain","URN_PARSE","urnComponents","nid","nss","urnScheme","uriComponents","UUID","uuidComponents","uuid","https","mailto","urn","validate","_ValidationError","_absolutePath","_interopRequireDefault","__esModule","Ajv","ajvKeywords","allErrors","verbose","$data","nestedOptions","validateObject","applyPrefix","compiledSchema","valid","filterErrors","newErrors","oldError","validateOptions","processOptions","processors","processedOptions","processor","filerDir","shimsDir","shimFs","shimPath","fsProvider","fsProviderDir","ROOT_DIR_TAG","CWD","utils","PLUGIN_NAME","OPTIONS_SCHEMA","OPTIONS_PROCESSORS","compiler","hooks","normalModuleFactory","tap","factory","resolveData","resolveFsProvider","startsWith","applyFsShim","applyPathShim","Filer","FilerWebpackPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAIA,oBAAoB,GAAC,qCAAzB;;AAAsE,SAASC,SAAT,CAAmBC,CAAnB,EAAqB;AAAC,MAAG,cAAY,OAA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yBL,IAAzB;AACAnC,OAAO,CAACyC,kBAAR,GAA6BN,IAA7B;AACAnC,OAAO,CAAC0C,IAAR,GAAeP,IAAf;AACAnC,OAAO,CAAC2C,eAAR,GAA0BR,IAA1B;AACAnC,OAAO,CAAC4C,mBAAR,GAA8BT,IAA9B;;AAEAnC,OAAO,CAAC6C,SAAR,GAAoB,UAAUC,IAAV,EAAgB;AAAE,SAAO,EAAP;AAAW,CAAjD;;AAEA9C,OAAO,CAAC+C,OAAR,GAAkB,UAAUD,IAAV,EAAgB;AAC9B,QAAM,IAAI3D,KAAJ,CAAU,kCAAV,CAAN;AACH,CAFD;;AAIAa,OAAO,CAACgD,GAAR,GAAc,YAAY;AAAE,SAAO,GAAP;AAAY,CAAxC;;AACAhD,OAAO,CAACiD,KAAR,GAAgB,UAAUC,GAAV,EAAe;AAC3B,QAAM,IAAI/D,KAAJ,CAAU,gCAAV,CAAN;AACH,CAFD;;AAGAa,OAAO,CAACmD,KAAR,GAAgB,YAAW;AAAE,SAAO,CAAP;AAAW,CAAxC;;;ACvLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC9SA;AACA;AACA;AACA;AACAnD,OAAO,CAACgD,GAAR,GAAc;AAAA,SAAM,GAAN;AAAA,CAAd;AAEA;AACA;AACA;AACA;AACA;;;AACA,IAAMI,QAAQ,GAAGC,OAAO,CAAC,MAAD,CAAxB;;AACA,IAAMC,SAAS,GAAGC,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBJ,QAAlB,CAAlB;AAEA;AACA;AACA;;AACAE,SAAS,CAACG,QAAV,GAAqB,UAACC,IAAD,EAAOC,GAAP,EAAe;AAClC,MAAMF,QAAQ,GAAGL,Q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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrFA;AACA;AACA;AACA;AACA;AACA;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7vDA,IAAI1E,gBAAgB,GAAGrB,OAAO,CAAC,iBAAD,CAAP,CAA2BqB,gBAAlD;;AACA,IAAIC,eAAe,GAAGtB,OAAO,CAAC,iBAAD,CA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AAGD,CAZD;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC35BA,eAAkB1H,OAAO,CAAC,eAAD,CAAzB;AAAA,IAAKxE,SAAL,YAAKA,SAAL;;AACA,IAAIkQ,IAAI,GAAG1L,OAAO,CAAC,YAAD,CAAlB;;AACA,IAAI2L,MAAM,GAAG3L,OAAO,CAAC,cAAD,CAApB;;AACA,IAAIwL,WAAW,GAAGxL,OAAO,CAAC,kBAAD,CAAzB;;AACA,IAAImJ,KAAK,GAAGnJ,OAAO,CAAC,oBAAD,CAAnB;;AACA,IAAI4L,SAAS,GAAG5L,OAAO,CAAC,WAAD,CAAvB;;AAEA,SA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AAuBk/B,eAAel/B,KAAf,IAAwB,oBAA/C;;eAGMk/B,cAAP;KAZ0E;eAe/D,mBAAUA,cAAV,EAAyCh6B,OAAzC,EAAb;YACQ05B,gBAAgBM,cAAtB;;sBAEcJ,GAAd,GAAoB,CAACI,eAAeC,IAAf,IAAuB,EAAxB,EAA4B1P,WAA5B,EAApB;eACOmP,aAAP;;CAnBF,CAuBA;;AChCAnH,QAAQ2F,QAAK7E,MAAb,IAAuB6E,OAAvB;AAEA,AACA3F,QAAQ2H,UAAM7G,MAAd,IAAwB6G,SAAxB;AAEA,AACA3H,QAAQ4H,UAAO9G,MAAf,IAAyB8G,SAAzB;AAEA,AACA5H,QAAQ6H,UAAI/G,MAAZ,IAAsB+G,SAAtB;AAEA,AACA7H,QAAQ0H,UAAK5G,MAAb,IAAuB4G,SAAvB,CAEA;;;;;;;;;;;;;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACleA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC1fA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrGA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;;;;;;;;;;;;;;;;AAEA9lC,MAAM,CAAC8L,cAAP,CAAsBnP,OAAtB,EAA+B,YAA/B,EAA6C;AAC3C6K,EAAAA,KAAK,EAAE;AADoC,CAA7C;A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,EAAEL,OAAO,CAAC,WAAD,CALU;AAMvB2L,EAAAA,MAAM,EAAE3L,OAAO,CAAC,aAAD,CANQ;AAOvB6L,EAAAA,KAAK,EAAE7L,OAAO,CAAC,kBAAD,CAPS;;AAQvB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACEkpC,EAAAA,kBAAkB,EAAElpC,OAAO,CAAC,kBAAD;AAjBJ,CAAzB,EAoBA;AACA;;AACAE,MAAM,CAAC8L,cAAP,CAAsBi9B,KAAtB,EAA6B,IAA7B,EAAmC;AACjCh9B,EAAAA,UAAU,EAAE,IADqB;AAEjChF,EAAAA,GAFiC,iBAE3B;AACJ,QAAG,CAAC6E,EAAJ,EAAQ;AACNA,MAAAA,EAAE,GAAG,IAAIm9B,KAAK,CAAChhB,UAAV,EAAL;AACD;;AACD,WAAOnc,EAAP;AACD;AAPgC,CAAnC","file":"filer.js","sourceRoot":"../src","sourcesContent":["var customArgumentsToken=\"__ES6-PROMISIFY--CUSTOM-ARGUMENTS__\";export function promisify(a){if(\"function\"!=typeof a)throw new TypeError(\"Argument to promisify must be a function\");var b=a[customArgumentsToken],c=promisify.Promise||Promise;if(\"function\"!=typeof c)throw new Error(\"No Promise implementation found; do you need a polyfill?\");return function(){for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return new c((c,d)=>{e.push(function(a){if(a)return d(a);for(var e=arguments.length,f=Array(1<e?e-1:0),g=1;g<e;g++)f[g-1]=arguments[g];if(1===f.length||!b)return c(f[0]);var h={};f.forEach((a,c)=>{var d=b[c];d&&(h[d]=a)}),c(h)}),a.apply(this,e)})}}promisify.argumentNames=\"__ES6-PROMISIFY--CUSTOM-ARGUMENTS__\",promisify.Promise=void 0;\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","// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,\n// backported and transplited with Babel, with backwards-compat fixes\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\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\n var isAbsolute = exports.isAbsolute(path),\n trailingSlash = substr(path, -1) === '/';\n\n // Normalize the path\n path = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n\n return (isAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexports.isAbsolute = function(path) {\n return path.charAt(0) === '/';\n};\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n if (typeof p !== 'string') {\n throw new TypeError('Arguments to path.join must be strings');\n }\n return p;\n }).join('/'));\n};\n\n\n// path.relative(from, to)\n// posix version\nexports.relative = function(from, to) {\n from = exports.resolve(from).substr(1);\n to = exports.resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n};\n\nexports.sep = '/';\nexports.delimiter = ':';\n\nexports.dirname = function (path) {\n if (typeof path !== 'string') path = path + '';\n if (path.length === 0) return '.';\n var code = path.charCodeAt(0);\n var hasRoot = code === 47 /*/*/;\n var end = -1;\n var matchedSlash = true;\n for (var i = path.length - 1; i >= 1; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n } else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n\n if (end === -1) return hasRoot ? '/' : '.';\n if (hasRoot && end === 1) {\n // return '//';\n // Backwards-compat fix:\n return '/';\n }\n return path.slice(0, end);\n};\n\nfunction basename(path) {\n if (typeof path !== 'string') path = path + '';\n\n var start = 0;\n var end = -1;\n var matchedSlash = true;\n var i;\n\n for (i = path.length - 1; i >= 0; --i) {\n if (path.charCodeAt(i) === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n\n if (end === -1) return '';\n return path.slice(start, end);\n}\n\n// Uses a mixed approach for backwards-compatibility, as ext behavior changed\n// in new Node.js versions, so only basename() above is backported here\nexports.basename = function (path, ext) {\n var f = basename(path);\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\nexports.extname = function (path) {\n if (typeof path !== 'string') path = path + '';\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n for (var i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1)\n startDot = i;\n else if (preDotState !== 1)\n preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n return '';\n }\n return path.slice(startDot, end);\n};\n\nfunction filter (xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = 'ab'.substr(-1) === 'b'\n ? function (str, start, len) { return str.substr(start, len) }\n : function (str, start, len) {\n if (start < 0) start = str.length + start;\n return str.substr(start, len);\n }\n;\n","/**\n * Patch process to add process.cwd(), always giving the root dir.\n * NOTE: this line needs to happen *before* we require in `path`.\n */\nprocess.cwd = () => '/';\n\n/**\n * https://github.com/browserify/path-browserify via Parcel.\n * We use is as a base for our own Filer.Path, and patch/add\n * a few things we need for the browser environment.\n */\nconst nodePath = require('path');\nconst filerPath = Object.assign({}, nodePath);\n\n/**\n * Patch path.basename() to return / vs. ''\n */\nfilerPath.basename = (path, ext) => {\n const basename = nodePath.basename(path, ext);\n return basename === '' ? '/' : basename;\n};\n\n/**\n * Patch path.normalize() to not add a trailing /\n */\nfilerPath.normalize = (path) => {\n path = nodePath.normalize(path);\n return path === '/' ? path : filerPath.removeTrailing(path);\n};\n\n/**\n * Add new utility method isNull() to path: check for null paths.\n */\nfilerPath.isNull = path => ('' + path).indexOf('\\u0000') !== -1;\n\n/**\n * Add new utility method addTrailing() to add trailing / without doubling to //.\n */\nfilerPath.addTrailing = path => path.replace(/\\/*$/, '/');\n\n/**\n * Add new utility method removeTrailing() to remove trailing /, dealing with multiple\n */\nfilerPath.removeTrailing = path => {\n path = path.replace(/\\/*$/, '');\n return path === '' ? '/' : path;\n};\n\nmodule.exports = filerPath;\n","var O_READ = 'READ';\nvar O_WRITE = 'WRITE';\nvar O_CREATE = 'CREATE';\nvar O_EXCLUSIVE = 'EXCLUSIVE';\nvar O_TRUNCATE = 'TRUNCATE';\nvar O_APPEND = 'APPEND';\nvar XATTR_CREATE = 'CREATE';\nvar XATTR_REPLACE = 'REPLACE';\n\nmodule.exports = {\n FILE_SYSTEM_NAME: 'local',\n\n FILE_STORE_NAME: 'files',\n\n IDB_RO: 'readonly',\n IDB_RW: 'readwrite',\n\n WSQL_VERSION: '1',\n WSQL_SIZE: 5 * 1024 * 1024,\n WSQL_DESC: 'FileSystem Storage',\n\n NODE_TYPE_FILE: 'FILE',\n NODE_TYPE_DIRECTORY: 'DIRECTORY',\n NODE_TYPE_SYMBOLIC_LINK: 'SYMLINK',\n NODE_TYPE_META: 'META',\n\n\n DEFAULT_DIR_PERMISSIONS: 0x1ED, // 755\n DEFAULT_FILE_PERMISSIONS: 0x1A4, // 644\n FULL_READ_WRITE_EXEC_PERMISSIONS: 0x1FF, // 777\n READ_WRITE_PERMISSIONS: 0x1B6, /// 666\n \n SYMLOOP_MAX: 10,\n\n BINARY_MIME_TYPE: 'application/octet-stream',\n JSON_MIME_TYPE: 'application/json',\n\n ROOT_DIRECTORY_NAME: '/', // basename(normalize(path))\n\n // FS Mount Flags\n FS_FORMAT: 'FORMAT',\n FS_NOCTIME: 'NOCTIME',\n FS_NOMTIME: 'NOMTIME',\n FS_NODUPEIDCHECK: 'FS_NODUPEIDCHECK',\n\n // FS File Open Flags\n O_READ: O_READ,\n O_WRITE: O_WRITE,\n O_CREATE: O_CREATE,\n O_EXCLUSIVE: O_EXCLUSIVE,\n O_TRUNCATE: O_TRUNCATE,\n O_APPEND: O_APPEND,\n\n O_FLAGS: {\n 'r': [O_READ],\n 'r+': [O_READ, O_WRITE],\n 'w': [O_WRITE, O_CREATE, O_TRUNCATE],\n 'w+': [O_WRITE, O_READ, O_CREATE, O_TRUNCATE],\n 'wx': [O_WRITE, O_CREATE, O_EXCLUSIVE, O_TRUNCATE],\n 'wx+': [O_WRITE, O_READ, O_CREATE, O_EXCLUSIVE, O_TRUNCATE],\n 'a': [O_WRITE, O_CREATE, O_APPEND],\n 'a+': [O_WRITE, O_READ, O_CREATE, O_APPEND],\n 'ax': [O_WRITE, O_CREATE, O_EXCLUSIVE, O_APPEND],\n 'ax+': [O_WRITE, O_READ, O_CREATE, O_EXCLUSIVE, O_APPEND]\n },\n\n XATTR_CREATE: XATTR_CREATE,\n XATTR_REPLACE: XATTR_REPLACE,\n\n FS_READY: 'READY',\n FS_PENDING: 'PENDING',\n FS_ERROR: 'ERROR',\n\n SUPER_NODE_ID: '00000000-0000-0000-0000-000000000000',\n\n // Reserved File Descriptors for streams\n STDIN: 0,\n STDOUT: 1,\n STDERR: 2,\n FIRST_DESCRIPTOR: 3,\n\n ENVIRONMENT: {\n TMP: '/tmp',\n PATH: ''\n },\n\n // Duplicate Node's fs.constants\n fsConstants: {\n O_RDONLY: 0,\n O_WRONLY: 1,\n O_RDWR: 2,\n S_IFMT: 61440,\n S_IFREG: 32768,\n S_IFDIR: 16384,\n S_IFCHR: 8192,\n S_IFBLK: 24576,\n S_IFIFO: 4096,\n S_IFLNK: 40960,\n S_IFSOCK: 49152,\n O_CREAT: 512,\n O_EXCL: 2048,\n O_NOCTTY: 131072,\n O_TRUNC: 1024,\n O_APPEND: 8,\n O_DIRECTORY: 1048576,\n O_NOFOLLOW: 256,\n O_SYNC: 128,\n O_DSYNC: 4194304,\n O_SYMLINK: 2097152,\n O_NONBLOCK: 4,\n S_IRWXU: 448,\n S_IRUSR: 256,\n S_IWUSR: 128,\n S_IXUSR: 64,\n S_IRWXG: 56,\n S_IRGRP: 32,\n S_IWGRP: 16,\n S_IXGRP: 8,\n S_IRWXO: 7,\n S_IROTH: 4,\n S_IWOTH: 2,\n S_IXOTH: 1,\n F_OK: 0,\n R_OK: 4,\n W_OK: 2,\n X_OK: 1,\n UV_FS_COPYFILE_EXCL: 1,\n COPYFILE_EXCL: 1\n }\n};\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(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\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","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nexports.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","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <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 FILE_SYSTEM_NAME = require('../constants.js').FILE_SYSTEM_NAME;\nvar FILE_STORE_NAME = require('../constants.js').FILE_STORE_NAME;\nvar IDB_RW = require('../constants.js').IDB_RW;\nvar IDB_RO = require('../constants.js').IDB_RO;\n\nfunction IndexedDBContext(db, mode) {\n this.db = db;\n this.mode = mode;\n}\n\nIndexedDBContext.prototype._getObjectStore = function() {\n if(this.objectStore) {\n return this.objectStore;\n }\n\n var transaction = this.db.transaction(FILE_STORE_NAME, this.mode);\n this.objectStore = transaction.objectStore(FILE_STORE_NAME);\n return this.objectStore;\n};\n\nIndexedDBContext.prototype.clear = function(callback) {\n try {\n var objectStore = this._getObjectStore();\n var request = objectStore.clear();\n request.onsuccess = function() {\n callback();\n };\n request.onerror = function(event) {\n event.preventDefault();\n callback(event.error);\n };\n } catch(err) {\n callback(err);\n }\n};\n\nIndexedDBContext.prototype._get = function(key, callback) {\n try {\n var objectStore = this._getObjectStore();\n var request = objectStore.get(key);\n request.onsuccess = function onsuccess(event) {\n var result = event.target.result;\n callback(null, result);\n };\n request.onerror = function(event) {\n event.preventDefault();\n callback(event.error);\n };\n } catch(err) {\n callback(err);\n }\n};\nIndexedDBContext.prototype.getObject = function(key, callback) {\n this._get(key, callback);\n};\nIndexedDBContext.prototype.getBuffer = function(key, callback) {\n this._get(key, function(err, arrayBuffer) {\n if(err) {\n return callback(err);\n }\n callback(null, Buffer.from(arrayBuffer));\n });\n};\n\nIndexedDBContext.prototype._put = function(key, value, callback) {\n try {\n var objectStore = this._getObjectStore();\n var request = objectStore.put(value, key);\n request.onsuccess = function onsuccess(event) {\n var result = event.target.result;\n callback(null, result);\n };\n request.onerror = function(event) {\n event.preventDefault();\n callback(event.error);\n };\n } catch(err) {\n callback(err);\n }\n};\nIndexedDBContext.prototype.putObject = function(key, value, callback) {\n this._put(key, value, callback);\n};\nIndexedDBContext.prototype.putBuffer = function(key, uint8BackedBuffer, callback) {\n var buf = uint8BackedBuffer.buffer;\n this._put(key, buf, callback);\n};\n\nIndexedDBContext.prototype.delete = function(key, callback) {\n try {\n var objectStore = this._getObjectStore();\n var request = objectStore.delete(key);\n request.onsuccess = function onsuccess(event) {\n var result = event.target.result;\n callback(null, result);\n };\n request.onerror = function(event) {\n event.preventDefault();\n callback(event.error);\n };\n } catch(err) {\n callback(err);\n }\n};\n\n\nfunction IndexedDB(name) {\n this.name = name || FILE_SYSTEM_NAME;\n this.db = null;\n}\nIndexedDB.isSupported = function() {\n var indexedDB = global.indexedDB ||\n global.mozIndexedDB ||\n global.webkitIndexedDB ||\n global.msIndexedDB;\n return !!indexedDB;\n};\n\nIndexedDB.prototype.open = function(callback) {\n var that = this;\n\n // Bail if we already have a db open\n if(that.db) {\n return callback();\n }\n\n try {\n var indexedDB = global.indexedDB ||\n global.mozIndexedDB ||\n global.webkitIndexedDB ||\n global.msIndexedDB;\n\n // NOTE: we're not using versioned databases.\n var openRequest = indexedDB.open(that.name);\n\n // If the db doesn't exist, we'll create it\n openRequest.onupgradeneeded = function onupgradeneeded(event) {\n var db = event.target.result;\n\n if(db.objectStoreNames.contains(FILE_STORE_NAME)) {\n db.deleteObjectStore(FILE_STORE_NAME);\n }\n db.createObjectStore(FILE_STORE_NAME);\n };\n\n openRequest.onsuccess = function onsuccess(event) {\n that.db = event.target.result;\n callback();\n };\n openRequest.onerror = function onerror(event) {\n event.preventDefault();\n callback(event.error);\n };\n } catch(err) {\n callback(err);\n }\n};\n\nIndexedDB.prototype.getReadOnlyContext = function() {\n return new IndexedDBContext(this.db, IDB_RO);\n};\nIndexedDB.prototype.getReadWriteContext = function() {\n return new IndexedDBContext(this.db, IDB_RW);\n};\n\nmodule.exports = IndexedDB;\n","/*global setImmediate: false, setTimeout: false, console: false */\n\n/**\n * async.js shim, based on https://raw.github.com/caolan/async/master/lib/async.js Feb 18, 2014\n * Used under MIT - https://github.com/caolan/async/blob/master/LICENSE\n */\n\n(function () {\n\n var async = {};\n\n // async.js functions used in Filer\n\n //// nextTick implementation with browser-compatible fallback ////\n if (typeof process === 'undefined' || !(process.nextTick)) {\n if (typeof setImmediate === 'function') {\n async.nextTick = function (fn) {\n // not a direct alias for IE10 compatibility\n setImmediate(fn);\n };\n async.setImmediate = async.nextTick;\n }\n else {\n async.nextTick = function (fn) {\n setTimeout(fn, 0);\n };\n async.setImmediate = async.nextTick;\n }\n }\n else {\n async.nextTick = process.nextTick;\n if (typeof setImmediate !== 'undefined') {\n async.setImmediate = function (fn) {\n // not a direct alias for IE10 compatibility\n setImmediate(fn);\n };\n }\n else {\n async.setImmediate = async.nextTick;\n }\n }\n\n async.eachSeries = function (arr, iterator, callback) {\n callback = callback || function () {};\n if (!arr.length) {\n return callback();\n }\n var completed = 0;\n var iterate = function () {\n iterator(arr[completed], function (err) {\n if (err) {\n callback(err);\n callback = function () {};\n }\n else {\n completed += 1;\n if (completed >= arr.length) {\n callback();\n }\n else {\n iterate();\n }\n }\n });\n };\n iterate();\n };\n async.forEachSeries = async.eachSeries;\n\n // AMD / RequireJS\n if (typeof define !== 'undefined' && define.amd) {\n define([], function () {\n return async;\n });\n }\n // Node.js\n else if (typeof module !== 'undefined' && module.exports) {\n module.exports = async;\n }\n // included directly via <script> tag\n else {\n root.async = async;\n }\n\n}());\n","var FILE_SYSTEM_NAME = require('../constants.js').FILE_SYSTEM_NAME;\n// NOTE: prefer setImmediate to nextTick for proper recursion yielding.\n// see https://github.com/js-platform/filer/pull/24\nvar asyncCallback = require('../../lib/async.js').setImmediate;\n\n/**\n * Make shared in-memory DBs possible when using the same name.\n */\nvar createDB = (function() {\n var pool = {};\n return function getOrCreate(name) {\n if(!Object.prototype.hasOwnProperty.call(pool, name)) {\n pool[name] = {};\n }\n return pool[name];\n };\n}());\n\nfunction MemoryContext(db, readOnly) {\n this.readOnly = readOnly;\n this.objectStore = db;\n}\n\nMemoryContext.prototype.clear = function(callback) {\n if(this.readOnly) {\n asyncCallback(function() {\n callback('[MemoryContext] Error: write operation on read only context');\n });\n return;\n }\n var objectStore = this.objectStore;\n Object.keys(objectStore).forEach(function(key){\n delete objectStore[key];\n });\n asyncCallback(callback);\n};\n\n// Memory context doesn't care about differences between Object and Buffer\nMemoryContext.prototype.getObject =\nMemoryContext.prototype.getBuffer =\nfunction(key, callback) {\n var that = this;\n asyncCallback(function() {\n callback(null, that.objectStore[key]);\n });\n};\nMemoryContext.prototype.putObject =\nMemoryContext.prototype.putBuffer =\nfunction(key, value, callback) {\n if(this.readOnly) {\n asyncCallback(function() {\n callback('[MemoryContext] Error: write operation on read only context');\n });\n return;\n }\n this.objectStore[key] = value;\n asyncCallback(callback);\n};\n\nMemoryContext.prototype.delete = function(key, callback) {\n if(this.readOnly) {\n asyncCallback(function() {\n callback('[MemoryContext] Error: write operation on read only context');\n });\n return;\n }\n delete this.objectStore[key];\n asyncCallback(callback);\n};\n\n\nfunction Memory(name) {\n this.name = name || FILE_SYSTEM_NAME;\n}\nMemory.isSupported = function() {\n return true;\n};\n\nMemory.prototype.open = function(callback) {\n this.db = createDB(this.name);\n asyncCallback(callback);\n};\nMemory.prototype.getReadOnlyContext = function() {\n return new MemoryContext(this.db, true);\n};\nMemory.prototype.getReadWriteContext = function() {\n return new MemoryContext(this.db, false);\n};\n\nmodule.exports = Memory;\n","const IndexedDB = require('./indexeddb.js');\nconst Memory = require('./memory.js');\n\nmodule.exports = {\n IndexedDB: IndexedDB,\n Default: IndexedDB,\n Memory: Memory\n};\n","var errors = {};\n[\n /**\n * node.js errors - we only use some of these, add as needed.\n */\n //'-1:UNKNOWN:unknown error',\n //'0:OK:success',\n //'1:EOF:end of file',\n //'2:EADDRINFO:getaddrinfo error',\n '3:EACCES:permission denied',\n //'4:EAGAIN:resource temporarily unavailable',\n //'5:EADDRINUSE:address already in use',\n //'6:EADDRNOTAVAIL:address not available',\n //'7:EAFNOSUPPORT:address family not supported',\n //'8:EALREADY:connection already in progress',\n '9:EBADF:bad file descriptor',\n '10:EBUSY:resource busy or locked',\n //'11:ECONNABORTED:software caused connection abort',\n //'12:ECONNREFUSED:connection refused',\n //'13:ECONNRESET:connection reset by peer',\n //'14:EDESTADDRREQ:destination address required',\n //'15:EFAULT:bad address in system call argument',\n //'16:EHOSTUNREACH:host is unreachable',\n //'17:EINTR:interrupted system call',\n '18:EINVAL:invalid argument',\n //'19:EISCONN:socket is already connected',\n //'20:EMFILE:too many open files',\n //'21:EMSGSIZE:message too long',\n //'22:ENETDOWN:network is down',\n //'23:ENETUNREACH:network is unreachable',\n //'24:ENFILE:file table overflow',\n //'25:ENOBUFS:no buffer space available',\n //'26:ENOMEM:not enough memory',\n '27:ENOTDIR:not a directory',\n '28:EISDIR:illegal operation on a directory',\n //'29:ENONET:machine is not on the network',\n // errno 30 skipped, as per https://github.com/rvagg/node-errno/blob/master/errno.js\n //'31:ENOTCONN:socket is not connected',\n //'32:ENOTSOCK:socket operation on non-socket',\n //'33:ENOTSUP:operation not supported on socket',\n '34:ENOENT:no such file or directory',\n //'35:ENOSYS:function not implemented',\n //'36:EPIPE:broken pipe',\n //'37:EPROTO:protocol error',\n //'38:EPROTONOSUPPORT:protocol not supported',\n //'39:EPROTOTYPE:protocol wrong type for socket',\n //'40:ETIMEDOUT:connection timed out',\n //'41:ECHARSET:invalid Unicode character',\n //'42:EAIFAMNOSUPPORT:address family for hostname not supported',\n // errno 43 skipped, as per https://github.com/rvagg/node-errno/blob/master/errno.js\n //'44:EAISERVICE:servname not supported for ai_socktype',\n //'45:EAISOCKTYPE:ai_socktype not supported',\n //'46:ESHUTDOWN:cannot send after transport endpoint shutdown',\n '47:EEXIST:file already exists',\n //'48:ESRCH:no such process',\n //'49:ENAMETOOLONG:name too long',\n '50:EPERM:operation not permitted',\n '51:ELOOP:too many symbolic links encountered',\n //'52:EXDEV:cross-device link not permitted',\n '53:ENOTEMPTY:directory not empty',\n //'54:ENOSPC:no space left on device',\n '55:EIO:i/o error',\n //'56:EROFS:read-only file system',\n //'57:ENODEV:no such device',\n //'58:ESPIPE:invalid seek',\n //'59:ECANCELED:operation canceled',\n\n /**\n * Filer specific errors\n */\n '1000:ENOTMOUNTED:not mounted',\n '1001:EFILESYSTEMERROR:missing super node, use \\'FORMAT\\' flag to format filesystem.',\n '1002:ENOATTR:attribute does not exist'\n\n].forEach(function(e) {\n e = e.split(':');\n var errno = +e[0];\n var errName = e[1];\n var defaultMessage = e[2];\n\n function FilerError(msg, path) {\n Error.call(this);\n\n this.name = errName;\n this.code = errName;\n this.errno = errno;\n this.message = msg || defaultMessage;\n if(path) {\n this.path = path;\n }\n this.stack = (new Error(this.message)).stack;\n }\n FilerError.prototype = Object.create(Error.prototype);\n FilerError.prototype.constructor = FilerError;\n FilerError.prototype.toString = function() {\n var pathInfo = this.path ? (', \\'' + this.path + '\\'') : '';\n return this.name + ': ' + this.message + pathInfo;\n };\n\n // We expose the error as both Errors.EINVAL and Errors[18]\n errors[errName] = errors[errno] = FilerError;\n});\n\nmodule.exports = errors;\n","'use strict'; \nconst defaults = require('../constants.js').ENVIRONMENT;\n\nmodule.exports = function Environment(env) {\n env = env || {};\n env.TMP = env.TMP || defaults.TMP;\n env.PATH = env.PATH || defaults.PATH;\n\n this.get = function(name) {\n return env[name];\n };\n\n this.set = function(name, value) {\n env[name] = value;\n };\n};\n","module.exports = function (xs, fn) {\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n var x = fn(xs[i], i);\n if (isArray(x)) res.push.apply(res, x);\n else res.push(x);\n }\n return res;\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n","'use strict';\nmodule.exports = balanced;\nfunction balanced(a, b, str) {\n if (a instanceof RegExp) a = maybeMatch(a, str);\n if (b instanceof RegExp) b = maybeMatch(b, str);\n\n var r = range(a, b, str);\n\n return r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + a.length, r[1]),\n post: str.slice(r[1] + b.length)\n };\n}\n\nfunction maybeMatch(reg, str) {\n var m = str.match(reg);\n return m ? m[0] : null;\n}\n\nbalanced.range = range;\nfunction range(a, b, str) {\n var begs, beg, left, right, result;\n var ai = str.indexOf(a);\n var bi = str.indexOf(b, ai + 1);\n var i = ai;\n\n if (ai >= 0 && bi > 0) {\n begs = [];\n left = str.length;\n\n while (i >= 0 && !result) {\n if (i == ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n } else if (begs.length == 1) {\n result = [ begs.pop(), bi ];\n } else {\n beg = begs.pop();\n if (beg < left) {\n left = beg;\n right = bi;\n }\n\n bi = str.indexOf(b, i + 1);\n }\n\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n\n if (begs.length) {\n result = [ left, right ];\n }\n }\n\n return result;\n}\n","var concatMap = require('concat-map');\nvar balanced = require('balanced-match');\n\nmodule.exports = expandTop;\n\nvar escSlash = '\\0SLASH'+Math.random()+'\\0';\nvar escOpen = '\\0OPEN'+Math.random()+'\\0';\nvar escClose = '\\0CLOSE'+Math.random()+'\\0';\nvar escComma = '\\0COMMA'+Math.random()+'\\0';\nvar escPeriod = '\\0PERIOD'+Math.random()+'\\0';\n\nfunction numeric(str) {\n return parseInt(str, 10) == str\n ? parseInt(str, 10)\n : str.charCodeAt(0);\n}\n\nfunction escapeBraces(str) {\n return str.split('\\\\\\\\').join(escSlash)\n .split('\\\\{').join(escOpen)\n .split('\\\\}').join(escClose)\n .split('\\\\,').join(escComma)\n .split('\\\\.').join(escPeriod);\n}\n\nfunction unescapeBraces(str) {\n return str.split(escSlash).join('\\\\')\n .split(escOpen).join('{')\n .split(escClose).join('}')\n .split(escComma).join(',')\n .split(escPeriod).join('.');\n}\n\n\n// Basically just str.split(\",\"), but handling cases\n// where we have nested braced sections, which should be\n// treated as individual members, like {a,{b,c},d}\nfunction parseCommaParts(str) {\n if (!str)\n return [''];\n\n var parts = [];\n var m = balanced('{', '}', str);\n\n if (!m)\n return str.split(',');\n\n var pre = m.pre;\n var body = m.body;\n var post = m.post;\n var p = pre.split(',');\n\n p[p.length-1] += '{' + body + '}';\n var postParts = parseCommaParts(post);\n if (post.length) {\n p[p.length-1] += postParts.shift();\n p.push.apply(p, postParts);\n }\n\n parts.push.apply(parts, p);\n\n return parts;\n}\n\nfunction expandTop(str) {\n if (!str)\n return [];\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.substr(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.substr(2);\n }\n\n return expand(escapeBraces(str), true).map(unescapeBraces);\n}\n\nfunction identity(e) {\n return e;\n}\n\nfunction embrace(str) {\n return '{' + str + '}';\n}\nfunction isPadded(el) {\n return /^-?0\\d/.test(el);\n}\n\nfunction lte(i, y) {\n return i <= y;\n}\nfunction gte(i, y) {\n return i >= y;\n}\n\nfunction expand(str, isTop) {\n var expansions = [];\n\n var m = balanced('{', '}', str);\n if (!m || /\\$$/.test(m.pre)) return [str];\n\n var isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body);\n var isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(m.body);\n var isSequence = isNumericSequence || isAlphaSequence;\n var isOptions = m.body.indexOf(',') >= 0;\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,.*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post;\n return expand(str);\n }\n return [str];\n }\n\n var n;\n if (isSequence) {\n n = m.body.split(/\\.\\./);\n } else {\n n = parseCommaParts(m.body);\n if (n.length === 1) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand(n[0], false).map(embrace);\n if (n.length === 1) {\n var post = m.post.length\n ? expand(m.post, false)\n : [''];\n return post.map(function(p) {\n return m.pre + n[0] + p;\n });\n }\n }\n }\n\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n var pre = m.pre;\n var post = m.post.length\n ? expand(m.post, false)\n : [''];\n\n var N;\n\n if (isSequence) {\n var x = numeric(n[0]);\n var y = numeric(n[1]);\n var width = Math.max(n[0].length, n[1].length)\n var incr = n.length == 3\n ? Math.abs(numeric(n[2]))\n : 1;\n var test = lte;\n var reverse = y < x;\n if (reverse) {\n incr *= -1;\n test = gte;\n }\n var pad = n.some(isPadded);\n\n N = [];\n\n for (var i = x; test(i, y); i += incr) {\n var c;\n if (isAlphaSequence) {\n c = String.fromCharCode(i);\n if (c === '\\\\')\n c = '';\n } else {\n c = String(i);\n if (pad) {\n var need = width - c.length;\n if (need > 0) {\n var z = new Array(need + 1).join('0');\n if (i < 0)\n c = '-' + z + c.slice(1);\n else\n c = z + c;\n }\n }\n }\n N.push(c);\n }\n } else {\n N = concatMap(n, function(el) { return expand(el, false) });\n }\n\n for (var j = 0; j < N.length; j++) {\n for (var k = 0; k < post.length; k++) {\n var expansion = pre + N[j] + post[k];\n if (!isTop || isSequence || expansion)\n expansions.push(expansion);\n }\n }\n\n return expansions;\n}\n\n","module.exports = minimatch\nminimatch.Minimatch = Minimatch\n\nvar path = { sep: '/' }\ntry {\n path = require('path')\n} catch (er) {}\n\nvar GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}\nvar expand = require('brace-expansion')\n\nvar plTypes = {\n '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},\n '?': { open: '(?:', close: ')?' },\n '+': { open: '(?:', close: ')+' },\n '*': { open: '(?:', close: ')*' },\n '@': { open: '(?:', close: ')' }\n}\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nvar qmark = '[^/]'\n\n// * => any number of characters\nvar star = qmark + '*?'\n\n// ** when dots are allowed. Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nvar twoStarDot = '(?:(?!(?:\\\\\\/|^)(?:\\\\.{1,2})($|\\\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nvar twoStarNoDot = '(?:(?!(?:\\\\\\/|^)\\\\.).)*?'\n\n// characters that need to be escaped in RegExp.\nvar reSpecials = charSet('().*{}+?[]^$\\\\!')\n\n// \"abc\" -> { a:true, b:true, c:true }\nfunction charSet (s) {\n return s.split('').reduce(function (set, c) {\n set[c] = true\n return set\n }, {})\n}\n\n// normalizes slashes.\nvar slashSplit = /\\/+/\n\nminimatch.filter = filter\nfunction filter (pattern, options) {\n options = options || {}\n return function (p, i, list) {\n return minimatch(p, pattern, options)\n }\n}\n\nfunction ext (a, b) {\n a = a || {}\n b = b || {}\n var t = {}\n Object.keys(b).forEach(function (k) {\n t[k] = b[k]\n })\n Object.keys(a).forEach(function (k) {\n t[k] = a[k]\n })\n return t\n}\n\nminimatch.defaults = function (def) {\n if (!def || !Object.keys(def).length) return minimatch\n\n var orig = minimatch\n\n var m = function minimatch (p, pattern, options) {\n return orig.minimatch(p, pattern, ext(def, options))\n }\n\n m.Minimatch = function Minimatch (pattern, options) {\n return new orig.Minimatch(pattern, ext(def, options))\n }\n\n return m\n}\n\nMinimatch.defaults = function (def) {\n if (!def || !Object.keys(def).length) return Minimatch\n return minimatch.defaults(def).Minimatch\n}\n\nfunction minimatch (p, pattern, options) {\n if (typeof pattern !== 'string') {\n throw new TypeError('glob pattern string required')\n }\n\n if (!options) options = {}\n\n // shortcut: comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n return false\n }\n\n // \"\" only matches \"\"\n if (pattern.trim() === '') return p === ''\n\n return new Minimatch(pattern, options).match(p)\n}\n\nfunction Minimatch (pattern, options) {\n if (!(this instanceof Minimatch)) {\n return new Minimatch(pattern, options)\n }\n\n if (typeof pattern !== 'string') {\n throw new TypeError('glob pattern string required')\n }\n\n if (!options) options = {}\n pattern = pattern.trim()\n\n // windows support: need to use /, not \\\n if (path.sep !== '/') {\n pattern = pattern.split(path.sep).join('/')\n }\n\n this.options = options\n this.set = []\n this.pattern = pattern\n this.regexp = null\n this.negate = false\n this.comment = false\n this.empty = false\n\n // make the set of regexps etc.\n this.make()\n}\n\nMinimatch.prototype.debug = function () {}\n\nMinimatch.prototype.make = make\nfunction make () {\n // don't do it more than once.\n if (this._made) return\n\n var pattern = this.pattern\n var options = this.options\n\n // empty patterns and comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n this.comment = true\n return\n }\n if (!pattern) {\n this.empty = true\n return\n }\n\n // step 1: figure out negation, etc.\n this.parseNegate()\n\n // step 2: expand braces\n var set = this.globSet = this.braceExpand()\n\n if (options.debug) this.debug = console.error\n\n this.debug(this.pattern, set)\n\n // step 3: now we have a set, so turn each one into a series of path-portion\n // matching patterns.\n // These will be regexps, except in the case of \"**\", which is\n // set to the GLOBSTAR object for globstar behavior,\n // and will not contain any / characters\n set = this.globParts = set.map(function (s) {\n return s.split(slashSplit)\n })\n\n this.debug(this.pattern, set)\n\n // glob --> regexps\n set = set.map(function (s, si, set) {\n return s.map(this.parse, this)\n }, this)\n\n this.debug(this.pattern, set)\n\n // filter out everything that didn't compile properly.\n set = set.filter(function (s) {\n return s.indexOf(false) === -1\n })\n\n this.debug(this.pattern, set)\n\n this.set = set\n}\n\nMinimatch.prototype.parseNegate = parseNegate\nfunction parseNegate () {\n var pattern = this.pattern\n var negate = false\n var options = this.options\n var negateOffset = 0\n\n if (options.nonegate) return\n\n for (var i = 0, l = pattern.length\n ; i < l && pattern.charAt(i) === '!'\n ; i++) {\n negate = !negate\n negateOffset++\n }\n\n if (negateOffset) this.pattern = pattern.substr(negateOffset)\n this.negate = negate\n}\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nminimatch.braceExpand = function (pattern, options) {\n return braceExpand(pattern, options)\n}\n\nMinimatch.prototype.braceExpand = braceExpand\n\nfunction braceExpand (pattern, options) {\n if (!options) {\n if (this instanceof Minimatch) {\n options = this.options\n } else {\n options = {}\n }\n }\n\n pattern = typeof pattern === 'undefined'\n ? this.pattern : pattern\n\n if (typeof pattern === 'undefined') {\n throw new TypeError('undefined pattern')\n }\n\n if (options.nobrace ||\n !pattern.match(/\\{.*\\}/)) {\n // shortcut. no need to expand.\n return [pattern]\n }\n\n return expand(pattern)\n}\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion. Otherwise, any series\n// of * is equivalent to a single *. Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\nMinimatch.prototype.parse = parse\nvar SUBPARSE = {}\nfunction parse (pattern, isSub) {\n if (pattern.length > 1024 * 64) {\n throw new TypeError('pattern is too long')\n }\n\n var options = this.options\n\n // shortcuts\n if (!options.noglobstar && pattern === '**') return GLOBSTAR\n if (pattern === '') return ''\n\n var re = ''\n var hasMagic = !!options.nocase\n var escaping = false\n // ? => one single character\n var patternListStack = []\n var negativeLists = []\n var stateChar\n var inClass = false\n var reClassStart = -1\n var classStart = -1\n // . and .. never match anything that doesn't start with .,\n // even when options.dot is set.\n var patternStart = pattern.charAt(0) === '.' ? '' // anything\n // not (start or / followed by . or .. followed by / or end)\n : options.dot ? '(?!(?:^|\\\\\\/)\\\\.{1,2}(?:$|\\\\\\/))'\n : '(?!\\\\.)'\n var self = this\n\n function clearStateChar () {\n if (stateChar) {\n // we had some state-tracking character\n // that wasn't consumed by this pass.\n switch (stateChar) {\n case '*':\n re += star\n hasMagic = true\n break\n case '?':\n re += qmark\n hasMagic = true\n break\n default:\n re += '\\\\' + stateChar\n break\n }\n self.debug('clearStateChar %j %j', stateChar, re)\n stateChar = false\n }\n }\n\n for (var i = 0, len = pattern.length, c\n ; (i < len) && (c = pattern.charAt(i))\n ; i++) {\n this.debug('%s\\t%s %s %j', pattern, i, re, c)\n\n // skip over any that are escaped.\n if (escaping && reSpecials[c]) {\n re += '\\\\' + c\n escaping = false\n continue\n }\n\n switch (c) {\n case '/':\n // completely not allowed, even escaped.\n // Should already be path-split by now.\n return false\n\n case '\\\\':\n clearStateChar()\n escaping = true\n continue\n\n // the various stateChar values\n // for the \"extglob\" stuff.\n case '?':\n case '*':\n case '+':\n case '@':\n case '!':\n this.debug('%s\\t%s %s %j <-- stateChar', pattern, i, re, c)\n\n // all of those are literals inside a class, except that\n // the glob [!a] means [^a] in regexp\n if (inClass) {\n this.debug(' in class')\n if (c === '!' && i === classStart + 1) c = '^'\n re += c\n continue\n }\n\n // if we already have a stateChar, then it means\n // that there was something like ** or +? in there.\n // Handle the stateChar, then proceed with this one.\n self.debug('call clearStateChar %j', stateChar)\n clearStateChar()\n stateChar = c\n // if extglob is disabled, then +(asdf|foo) isn't a thing.\n // just clear the statechar *now*, rather than even diving into\n // the patternList stuff.\n if (options.noext) clearStateChar()\n continue\n\n case '(':\n if (inClass) {\n re += '('\n continue\n }\n\n if (!stateChar) {\n re += '\\\\('\n continue\n }\n\n patternListStack.push({\n type: stateChar,\n start: i - 1,\n reStart: re.length,\n open: plTypes[stateChar].open,\n close: plTypes[stateChar].close\n })\n // negation is (?:(?!js)[^/]*)\n re += stateChar === '!' ? '(?:(?!(?:' : '(?:'\n this.debug('plType %j %j', stateChar, re)\n stateChar = false\n continue\n\n case ')':\n if (inClass || !patternListStack.length) {\n re += '\\\\)'\n continue\n }\n\n clearStateChar()\n hasMagic = true\n var pl = patternListStack.pop()\n // negation is (?:(?!js)[^/]*)\n // The others are (?:<pattern>)<type>\n re += pl.close\n if (pl.type === '!') {\n negativeLists.push(pl)\n }\n pl.reEnd = re.length\n continue\n\n case '|':\n if (inClass || !patternListStack.length || escaping) {\n re += '\\\\|'\n escaping = false\n continue\n }\n\n clearStateChar()\n re += '|'\n continue\n\n // these are mostly the same in regexp and glob\n case '[':\n // swallow any state-tracking char before the [\n clearStateChar()\n\n if (inClass) {\n re += '\\\\' + c\n continue\n }\n\n inClass = true\n classStart = i\n reClassStart = re.length\n re += c\n continue\n\n case ']':\n // a right bracket shall lose its special\n // meaning and represent itself in\n // a bracket expression if it occurs\n // first in the list. -- POSIX.2 2.8.3.2\n if (i === classStart + 1 || !inClass) {\n re += '\\\\' + c\n escaping = false\n continue\n }\n\n // handle the case where we left a class open.\n // \"[z-a]\" is valid, equivalent to \"\\[z-a\\]\"\n if (inClass) {\n // split where the last [ was, make sure we don't have\n // an invalid re. if so, re-walk the contents of the\n // would-be class to re-translate any characters that\n // were passed through as-is\n // TODO: It would probably be faster to determine this\n // without a try/catch and a new RegExp, but it's tricky\n // to do safely. For now, this is safe and works.\n var cs = pattern.substring(classStart + 1, i)\n try {\n RegExp('[' + cs + ']')\n } catch (er) {\n // not a valid class!\n var sp = this.parse(cs, SUBPARSE)\n re = re.substr(0, reClassStart) + '\\\\[' + sp[0] + '\\\\]'\n hasMagic = hasMagic || sp[1]\n inClass = false\n continue\n }\n }\n\n // finish up the class.\n hasMagic = true\n inClass = false\n re += c\n continue\n\n default:\n // swallow any state char that wasn't consumed\n clearStateChar()\n\n if (escaping) {\n // no need\n escaping = false\n } else if (reSpecials[c]\n && !(c === '^' && inClass)) {\n re += '\\\\'\n }\n\n re += c\n\n } // switch\n } // for\n\n // handle the case where we left a class open.\n // \"[abc\" is valid, equivalent to \"\\[abc\"\n if (inClass) {\n // split where the last [ was, and escape it\n // this is a huge pita. We now have to re-walk\n // the contents of the would-be class to re-translate\n // any characters that were passed through as-is\n cs = pattern.substr(classStart + 1)\n sp = this.parse(cs, SUBPARSE)\n re = re.substr(0, reClassStart) + '\\\\[' + sp[0]\n hasMagic = hasMagic || sp[1]\n }\n\n // handle the case where we had a +( thing at the *end*\n // of the pattern.\n // each pattern list stack adds 3 chars, and we need to go through\n // and escape any | chars that were passed through as-is for the regexp.\n // Go through and escape them, taking care not to double-escape any\n // | chars that were already escaped.\n for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {\n var tail = re.slice(pl.reStart + pl.open.length)\n this.debug('setting tail', re, pl)\n // maybe some even number of \\, then maybe 1 \\, followed by a |\n tail = tail.replace(/((?:\\\\{2}){0,64})(\\\\?)\\|/g, function (_, $1, $2) {\n if (!$2) {\n // the | isn't already escaped, so escape it.\n $2 = '\\\\'\n }\n\n // need to escape all those slashes *again*, without escaping the\n // one that we need for escaping the | character. As it works out,\n // escaping an even number of slashes can be done by simply repeating\n // it exactly after itself. That's why this trick works.\n //\n // I am sorry that you have to see this.\n return $1 + $1 + $2 + '|'\n })\n\n this.debug('tail=%j\\n %s', tail, tail, pl, re)\n var t = pl.type === '*' ? star\n : pl.type === '?' ? qmark\n : '\\\\' + pl.type\n\n hasMagic = true\n re = re.slice(0, pl.reStart) + t + '\\\\(' + tail\n }\n\n // handle trailing things that only matter at the very end.\n clearStateChar()\n if (escaping) {\n // trailing \\\\\n re += '\\\\\\\\'\n }\n\n // only need to apply the nodot start if the re starts with\n // something that could conceivably capture a dot\n var addPatternStart = false\n switch (re.charAt(0)) {\n case '.':\n case '[':\n case '(': addPatternStart = true\n }\n\n // Hack to work around lack of negative lookbehind in JS\n // A pattern like: *.!(x).!(y|z) needs to ensure that a name\n // like 'a.xyz.yz' doesn't match. So, the first negative\n // lookahead, has to look ALL the way ahead, to the end of\n // the pattern.\n for (var n = negativeLists.length - 1; n > -1; n--) {\n var nl = negativeLists[n]\n\n var nlBefore = re.slice(0, nl.reStart)\n var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)\n var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)\n var nlAfter = re.slice(nl.reEnd)\n\n nlLast += nlAfter\n\n // Handle nested stuff like *(*.js|!(*.json)), where open parens\n // mean that we should *not* include the ) in the bit that is considered\n // \"after\" the negated section.\n var openParensBefore = nlBefore.split('(').length - 1\n var cleanAfter = nlAfter\n for (i = 0; i < openParensBefore; i++) {\n cleanAfter = cleanAfter.replace(/\\)[+*?]?/, '')\n }\n nlAfter = cleanAfter\n\n var dollar = ''\n if (nlAfter === '' && isSub !== SUBPARSE) {\n dollar = '$'\n }\n var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast\n re = newRe\n }\n\n // if the re is not \"\" at this point, then we need to make sure\n // it doesn't match against an empty path part.\n // Otherwise a/* will match a/, which it should not.\n if (re !== '' && hasMagic) {\n re = '(?=.)' + re\n }\n\n if (addPatternStart) {\n re = patternStart + re\n }\n\n // parsing just a piece of a larger pattern.\n if (isSub === SUBPARSE) {\n return [re, hasMagic]\n }\n\n // skip the regexp for non-magical patterns\n // unescape anything in it, though, so that it'll be\n // an exact match against a file etc.\n if (!hasMagic) {\n return globUnescape(pattern)\n }\n\n var flags = options.nocase ? 'i' : ''\n try {\n var regExp = new RegExp('^' + re + '$', flags)\n } catch (er) {\n // If it was an invalid regular expression, then it can't match\n // anything. This trick looks for a character after the end of\n // the string, which is of course impossible, except in multi-line\n // mode, but it's not a /m regex.\n return new RegExp('$.')\n }\n\n regExp._glob = pattern\n regExp._src = re\n\n return regExp\n}\n\nminimatch.makeRe = function (pattern, options) {\n return new Minimatch(pattern, options || {}).makeRe()\n}\n\nMinimatch.prototype.makeRe = makeRe\nfunction makeRe () {\n if (this.regexp || this.regexp === false) return this.regexp\n\n // at this point, this.set is a 2d array of partial\n // pattern strings, or \"**\".\n //\n // It's better to use .match(). This function shouldn't\n // be used, really, but it's pretty convenient sometimes,\n // when you just want to work with a regex.\n var set = this.set\n\n if (!set.length) {\n this.regexp = false\n return this.regexp\n }\n var options = this.options\n\n var twoStar = options.noglobstar ? star\n : options.dot ? twoStarDot\n : twoStarNoDot\n var flags = options.nocase ? 'i' : ''\n\n var re = set.map(function (pattern) {\n return pattern.map(function (p) {\n return (p === GLOBSTAR) ? twoStar\n : (typeof p === 'string') ? regExpEscape(p)\n : p._src\n }).join('\\\\\\/')\n }).join('|')\n\n // must match entire pattern\n // ending in a * or ** will make it less strict.\n re = '^(?:' + re + ')$'\n\n // can match anything, as long as it's not this.\n if (this.negate) re = '^(?!' + re + ').*$'\n\n try {\n this.regexp = new RegExp(re, flags)\n } catch (ex) {\n this.regexp = false\n }\n return this.regexp\n}\n\nminimatch.match = function (list, pattern, options) {\n options = options || {}\n var mm = new Minimatch(pattern, options)\n list = list.filter(function (f) {\n return mm.match(f)\n })\n if (mm.options.nonull && !list.length) {\n list.push(pattern)\n }\n return list\n}\n\nMinimatch.prototype.match = match\nfunction match (f, partial) {\n this.debug('match', f, this.pattern)\n // short-circuit in the case of busted things.\n // comments, etc.\n if (this.comment) return false\n if (this.empty) return f === ''\n\n if (f === '/' && partial) return true\n\n var options = this.options\n\n // windows: need to use /, not \\\n if (path.sep !== '/') {\n f = f.split(path.sep).join('/')\n }\n\n // treat the test path as a set of pathparts.\n f = f.split(slashSplit)\n this.debug(this.pattern, 'split', f)\n\n // just ONE of the pattern sets in this.set needs to match\n // in order for it to be valid. If negating, then just one\n // match means that we have failed.\n // Either way, return on the first hit.\n\n var set = this.set\n this.debug(this.pattern, 'set', set)\n\n // Find the basename of the path by looking for the last non-empty segment\n var filename\n var i\n for (i = f.length - 1; i >= 0; i--) {\n filename = f[i]\n if (filename) break\n }\n\n for (i = 0; i < set.length; i++) {\n var pattern = set[i]\n var file = f\n if (options.matchBase && pattern.length === 1) {\n file = [filename]\n }\n var hit = this.matchOne(file, pattern, partial)\n if (hit) {\n if (options.flipNegate) return true\n return !this.negate\n }\n }\n\n // didn't get any hits. this is success if it's a negative\n // pattern, failure otherwise.\n if (options.flipNegate) return false\n return this.negate\n}\n\n// set partial to true to test if, for example,\n// \"/a/b\" matches the start of \"/*/b/*/d\"\n// Partial means, if you run out of file before you run\n// out of pattern, then that's fine, as long as all\n// the parts match.\nMinimatch.prototype.matchOne = function (file, pattern, partial) {\n var options = this.options\n\n this.debug('matchOne',\n { 'this': this, file: file, pattern: pattern })\n\n this.debug('matchOne', file.length, pattern.length)\n\n for (var fi = 0,\n pi = 0,\n fl = file.length,\n pl = pattern.length\n ; (fi < fl) && (pi < pl)\n ; fi++, pi++) {\n this.debug('matchOne loop')\n var p = pattern[pi]\n var f = file[fi]\n\n this.debug(pattern, p, f)\n\n // should be impossible.\n // some invalid regexp stuff in the set.\n if (p === false) return false\n\n if (p === GLOBSTAR) {\n this.debug('GLOBSTAR', [pattern, p, f])\n\n // \"**\"\n // a/**/b/**/c would match the following:\n // a/b/x/y/z/c\n // a/x/y/z/b/c\n // a/b/x/b/x/c\n // a/b/c\n // To do this, take the rest of the pattern after\n // the **, and see if it would match the file remainder.\n // If so, return success.\n // If not, the ** \"swallows\" a segment, and try again.\n // This is recursively awful.\n //\n // a/**/b/**/c matching a/b/x/y/z/c\n // - a matches a\n // - doublestar\n // - matchOne(b/x/y/z/c, b/**/c)\n // - b matches b\n // - doublestar\n // - matchOne(x/y/z/c, c) -> no\n // - matchOne(y/z/c, c) -> no\n // - matchOne(z/c, c) -> no\n // - matchOne(c, c) yes, hit\n var fr = fi\n var pr = pi + 1\n if (pr === pl) {\n this.debug('** at the end')\n // a ** at the end will just swallow the rest.\n // We have found a match.\n // however, it will not swallow /.x, unless\n // options.dot is set.\n // . and .. are *never* matched by **, for explosively\n // exponential reasons.\n for (; fi < fl; fi++) {\n if (file[fi] === '.' || file[fi] === '..' ||\n (!options.dot && file[fi].charAt(0) === '.')) return false\n }\n return true\n }\n\n // ok, let's see if we can swallow whatever we can.\n while (fr < fl) {\n var swallowee = file[fr]\n\n this.debug('\\nglobstar while', file, fr, pattern, pr, swallowee)\n\n // XXX remove this slice. Just pass the start index.\n if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {\n this.debug('globstar found match!', fr, fl, swallowee)\n // found a match.\n return true\n } else {\n // can't swallow \".\" or \"..\" ever.\n // can only swallow \".foo\" when explicitly asked.\n if (swallowee === '.' || swallowee === '..' ||\n (!options.dot && swallowee.charAt(0) === '.')) {\n this.debug('dot detected!', file, fr, pattern, pr)\n break\n }\n\n // ** swallows a segment, and continue.\n this.debug('globstar swallow a segment, and continue')\n fr++\n }\n }\n\n // no match was found.\n // However, in partial mode, we can't say this is necessarily over.\n // If there's more *pattern* left, then\n if (partial) {\n // ran out of file\n this.debug('\\n>>> no match, partial?', file, fr, pattern, pr)\n if (fr === fl) return true\n }\n return false\n }\n\n // something other than **\n // non-magic patterns just have to match exactly\n // patterns with magic have been turned into regexps.\n var hit\n if (typeof p === 'string') {\n if (options.nocase) {\n hit = f.toLowerCase() === p.toLowerCase()\n } else {\n hit = f === p\n }\n this.debug('string match', p, f, hit)\n } else {\n hit = f.match(p)\n this.debug('pattern match', p, f, hit)\n }\n\n if (!hit) return false\n }\n\n // Note: ending in / means that we'll get a final \"\"\n // at the end of the pattern. This can only match a\n // corresponding \"\" at the end of the file.\n // If the file ends in /, then it can only match a\n // a pattern that ends in /, unless the pattern just\n // doesn't have any more for it. But, a/b/ should *not*\n // match \"a/b/*\", even though \"\" matches against the\n // [^/]*? pattern, except in partial mode, where it might\n // simply not be reached yet.\n // However, a/b/ should still satisfy a/*\n\n // now either we fell off the end of the pattern, or we're done.\n if (fi === fl && pi === pl) {\n // ran out of pattern and filename at the same time.\n // an exact hit!\n return true\n } else if (fi === fl) {\n // ran out of file, but still had pattern left.\n // this is ok if we're doing the match as part of\n // a glob fs traversal.\n return partial\n } else if (pi === pl) {\n // ran out of pattern, still have file left.\n // this is only acceptable if we're on the very last\n // empty segment of a file with a trailing slash.\n // a/* should match a/b/\n var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')\n return emptyFileEnd\n }\n\n // should be unreachable.\n throw new Error('wtf?')\n}\n\n// replace stuff like \\* with *\nfunction globUnescape (s) {\n return s.replace(/\\\\(.)/g, '$1')\n}\n\nfunction regExpEscape (s) {\n return s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n}\n","var {promisify} = require('es6-promisify');\nvar Path = require('../path.js');\nvar Errors = require('../errors.js');\nvar Environment = require('./environment.js');\nvar async = require('../../lib/async.js');\nvar minimatch = require('minimatch');\n\nfunction Shell(fs, options) {\n options = options || {};\n\n var env = new Environment(options.env);\n var cwd = '/';\n\n /**\n * The bound FileSystem (cannot be changed)\n */\n Object.defineProperty(this, 'fs', {\n get: function() { return fs; },\n enumerable: true\n });\n\n /**\n * The shell's environment (e.g., for things like\n * path, tmp, and other env vars). Use env.get()\n * and env.set() to work with variables.\n */\n Object.defineProperty(this, 'env', {\n get: function() { return env; },\n enumerable: true\n });\n\n /**\n * Change the current working directory. We\n * include `cd` on the `this` vs. proto so that\n * we can access cwd without exposing it externally.\n */\n this.cd = function(path, callback) {\n path = Path.resolve(cwd, path);\n // Make sure the path actually exists, and is a dir\n fs.stat(path, function(err, stats) {\n if(err) {\n callback(new Errors.ENOTDIR(null, path));\n return;\n }\n if(stats.type === 'DIRECTORY') {\n cwd = path;\n callback();\n } else {\n callback(new Errors.ENOTDIR(null, path));\n }\n });\n };\n\n /**\n * Get the current working directory (changed with `cd()`)\n */\n this.pwd = function() {\n return cwd;\n };\n\n this.promises = {};\n /**\n * Public API for Shell converted to Promise based\n */\n [\n 'cd',\n 'exec',\n 'touch',\n 'cat',\n 'ls',\n 'rm',\n 'tempDir',\n 'mkdirp',\n 'find'\n ].forEach((methodName)=>{\n this.promises[methodName] = promisify(this[methodName].bind(this));\n });\n}\n\n/**\n * Execute the .js command located at `path`. Such commands\n * should assume the existence of 3 arguments, which will be\n * defined at runtime:\n *\n * * fs - the current shell's bound filesystem object\n * * args - a list of arguments for the command, or an empty list if none\n * * callback - a callback function(error, result) to call when done.\n *\n * The .js command's contents should be the body of a function\n * that looks like this:\n *\n * function(fs, args, callback) {\n * // .js code here\n * }\n */\nShell.prototype.exec = function(path, args, callback) {\n /* jshint evil:true */\n var sh = this;\n var fs = sh.fs;\n if(typeof args === 'function') {\n callback = args;\n args = [];\n }\n args = args || [];\n callback = callback || function(){};\n path = Path.resolve(sh.pwd(), path);\n\n fs.readFile(path, 'utf8', function(error, data) {\n if(error) {\n callback(error);\n return;\n }\n try {\n var cmd = new Function('fs', 'args', 'callback', data);\n cmd(fs, args, callback);\n } catch(e) {\n callback(e);\n }\n });\n};\n\n/**\n * Create a file if it does not exist, or update access and\n * modified times if it does. Valid options include:\n *\n * * updateOnly - whether to create the file if missing (defaults to false)\n * * date - use the provided Date value instead of current date/time\n */\nShell.prototype.touch = function(path, options, callback) {\n var sh = this;\n var fs = sh.fs;\n if(typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n callback = callback || function(){};\n path = Path.resolve(sh.pwd(), path);\n\n function createFile(path) {\n fs.writeFile(path, '', callback);\n }\n\n function updateTimes(path) {\n var now = Date.now();\n var atime = options.date || now;\n var mtime = options.date || now;\n\n fs.utimes(path, atime, mtime, callback);\n }\n\n fs.stat(path, function(error) {\n if(error) {\n if(options.updateOnly === true) {\n callback();\n } else {\n createFile(path);\n }\n } else {\n updateTimes(path);\n }\n });\n};\n\n/**\n * Concatenate multiple files into a single String, with each\n * file separated by a newline. The `files` argument should\n * be a String (path to single file) or an Array of Strings\n * (multiple file paths).\n */\nShell.prototype.cat = function(files, callback) {\n var sh = this;\n var fs = sh.fs;\n var all = '';\n callback = callback || function(){};\n\n if(!files) {\n callback(new Errors.EINVAL('Missing files argument'));\n return;\n }\n\n files = typeof files === 'string' ? [ files ] : files;\n\n function append(item, callback) {\n var filename = Path.resolve(sh.pwd(), item);\n fs.readFile(filename, 'utf8', function(error, data) {\n if(error) {\n callback(error);\n return;\n }\n all += data + '\\n';\n callback();\n });\n }\n\n async.eachSeries(files, append, function(error) {\n if(error) {\n callback(error);\n } else {\n callback(null, all.replace(/\\n$/, ''));\n }\n });\n};\n\n/**\n * Get the listing of a directory, returning an array of\n * file entries in the following form:\n *\n * {\n * path: <String> the basename of the directory entry\n * links: <Number> the number of links to the entry\n * size: <Number> the size in bytes of the entry\n * modified: <Number> the last modified date/time\n * type: <String> the type of the entry\n * contents: <Array> an optional array of child entries\n * }\n *\n * By default ls() gives a shallow listing. If you want\n * to follow directories as they are encountered, use\n * the `recursive=true` option.\n */\nShell.prototype.ls = function(dir, options, callback) {\n var sh = this;\n var fs = sh.fs;\n if(typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n callback = callback || function(){};\n\n if(!dir) {\n callback(new Errors.EINVAL('Missing dir argument'));\n return;\n }\n\n function list(path, callback) {\n var pathname = Path.resolve(sh.pwd(), path);\n var result = [];\n\n fs.readdir(pathname, function(error, entries) {\n if(error) {\n callback(error);\n return;\n }\n\n function getDirEntry(name, callback) {\n name = Path.join(pathname, name);\n fs.stat(name, function(error, stats) {\n if(error) {\n callback(error);\n return;\n }\n var entry = stats;\n\n if(options.recursive && stats.type === 'DIRECTORY') {\n list(Path.join(pathname, entry.name), function(error, items) {\n if(error) {\n callback(error);\n return;\n }\n entry.contents = items;\n result.push(entry);\n callback();\n });\n } else {\n result.push(entry);\n callback();\n }\n });\n }\n\n async.eachSeries(entries, getDirEntry, function(error) {\n callback(error, result);\n });\n });\n }\n\n list(dir, callback);\n};\n\n/**\n * Removes the file or directory at `path`. If `path` is a file\n * it will be removed. If `path` is a directory, it will be\n * removed if it is empty, otherwise the callback will receive\n * an error. In order to remove non-empty directories, use the\n * `recursive=true` option.\n */\nShell.prototype.rm = function(path, options, callback) {\n var sh = this;\n var fs = sh.fs;\n if(typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n callback = callback || function(){};\n\n if(!path) {\n callback(new Errors.EINVAL('Missing path argument'));\n return;\n }\n\n function remove(pathname, callback) {\n pathname = Path.resolve(sh.pwd(), pathname);\n fs.stat(pathname, function(error, stats) {\n if(error) {\n callback(error);\n return;\n }\n\n // If this is a file, delete it and we're done\n if(stats.type === 'FILE') {\n fs.unlink(pathname, callback);\n return;\n }\n\n // If it's a dir, check if it's empty\n fs.readdir(pathname, function(error, entries) {\n if(error) {\n callback(error);\n return;\n }\n\n // If dir is empty, delete it and we're done\n if(entries.length === 0) {\n fs.rmdir(pathname, callback);\n return;\n }\n\n // If not, see if we're allowed to delete recursively\n if(!options.recursive) {\n callback(new Errors.ENOTEMPTY(null, pathname));\n return;\n }\n\n // Remove each dir entry recursively, then delete the dir.\n entries = entries.map(function(filename) {\n // Root dir entries absolutely\n return Path.join(pathname, filename);\n });\n async.eachSeries(entries, remove, function(error) {\n if(error) {\n callback(error);\n return;\n }\n fs.rmdir(pathname, callback);\n });\n });\n });\n }\n\n remove(path, callback);\n};\n\n/**\n * Gets the path to the temporary directory, creating it if not\n * present. The directory used is the one specified in\n * env.TMP. The callback receives (error, tempDirName).\n */\nShell.prototype.tempDir = function(callback) {\n var sh = this;\n var fs = sh.fs;\n var tmp = sh.env.get('TMP');\n callback = callback || function(){};\n\n // Try and create it, and it will either work or fail\n // but either way it's now there.\n fs.mkdir(tmp, function() {\n callback(null, tmp);\n });\n};\n\n/**\n * Recursively creates the directory at `path`. If the parent\n * of `path` does not exist, it will be created.\n * Based off EnsureDir by Sam X. Xu\n * https://www.npmjs.org/package/ensureDir\n * MIT License\n */\nShell.prototype.mkdirp = function(path, callback) {\n var sh = this;\n var fs = sh.fs;\n callback = callback || function(){};\n\n if(!path) {\n callback(new Errors.EINVAL('Missing path argument'));\n return;\n }\n path = Path.resolve(sh.pwd(), path);\n if (path === '/') {\n callback();\n return;\n }\n function _mkdirp(path, callback) {\n fs.stat(path, function (err, stat) {\n if(stat) {\n if(stat.isDirectory()) {\n callback();\n return;\n }\n else if (stat.isFile()) {\n callback(new Errors.ENOTDIR(null, path));\n return;\n }\n }\n else if (err && err.code !== 'ENOENT') {\n callback(err);\n return;\n }\n else {\n var parent = Path.dirname(path);\n if(parent === '/') {\n fs.mkdir(path, function (err) {\n if (err && err.code !== 'EEXIST') {\n callback(err);\n return;\n }\n callback();\n return;\n });\n }\n else {\n _mkdirp(parent, function (err) {\n if (err) return callback(err);\n fs.mkdir(path, function (err) {\n if (err && err.code !== 'EEXIST') {\n callback(err);\n return;\n }\n callback();\n return;\n });\n });\n }\n }\n });\n }\n\n _mkdirp(path, callback);\n};\n\n/**\n * Recursively walk a directory tree, reporting back all paths\n * that were found along the way. The `path` must be a dir.\n * Valid options include a `regex` for pattern matching paths\n * and an `exec` function of the form `function(path, next)` where\n * `path` is the current path that was found (dir paths have an '/'\n * appended) and `next` is a callback to call when done processing\n * the current path, passing any error object back as the first argument.\n * `find` returns a flat array of absolute paths for all matching/found\n * paths as the final argument to the callback.\n */\nShell.prototype.find = function(path, options, callback) {\n var sh = this;\n var fs = sh.fs;\n if(typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n callback = callback || function(){};\n\n var exec = options.exec || function(path, next) { next(); };\n var found = [];\n\n if(!path) {\n callback(new Errors.EINVAL('Missing path argument'));\n return;\n }\n\n function processPath(path, callback) {\n exec(path, function(err) {\n if(err) {\n callback(err);\n return;\n }\n\n found.push(path);\n callback();\n });\n }\n\n function maybeProcessPath(path, callback) {\n // Test the path against the user's regex, name, path primaries (if any)\n // and remove any trailing slashes added previously.\n var rawPath = Path.removeTrailing(path);\n\n // Check entire path against provided regex, if any\n if(options.regex && !options.regex.test(rawPath)) {\n callback();\n return;\n }\n\n // Check basename for matches against name primary, if any\n if(options.name && !minimatch(Path.basename(rawPath), options.name)) {\n callback();\n return;\n }\n\n // Check dirname for matches against path primary, if any\n if(options.path && !minimatch(Path.dirname(rawPath), options.path)) {\n callback();\n return;\n }\n\n processPath(path, callback);\n }\n\n function walk(path, callback) {\n path = Path.resolve(sh.pwd(), path);\n\n // The path is either a file or dir, and instead of doing\n // a stat() to determine it first, we just try to readdir()\n // and it will either work or not, and we handle the non-dir error.\n fs.readdir(path, function(err, entries) {\n if(err) {\n if(err.code === 'ENOTDIR' /* file case, ignore error */) {\n maybeProcessPath(path, callback);\n } else {\n callback(err);\n }\n return;\n }\n\n // Path is really a dir, add a trailing / and report it found\n maybeProcessPath(Path.addTrailing(path), function(err) {\n if(err) {\n callback(err);\n return;\n }\n\n entries = entries.map(function(entry) {\n return Path.join(path, entry);\n });\n\n async.eachSeries(entries, walk, function(err) {\n callback(err, found);\n });\n });\n });\n }\n\n // Make sure we are starting with a dir path\n fs.stat(path, function(err, stats) {\n if(err) {\n callback(err);\n return;\n }\n if(!stats.isDirectory()) {\n callback(new Errors.ENOTDIR(null, path));\n return;\n }\n\n walk(path, callback);\n });\n};\n\nmodule.exports = Shell;\n","// Based on https://github.com/diy/intercom.js/blob/master/lib/events.js\n// Copyright 2012 DIY Co Apache License, Version 2.0\n// http://www.apache.org/licenses/LICENSE-2.0\n\nfunction removeItem(item, array) {\n for (var i = array.length - 1; i >= 0; i--) {\n if (array[i] === item) {\n array.splice(i, 1);\n }\n }\n return array;\n}\n\nvar EventEmitter = function() {};\n\nEventEmitter.createInterface = function(space) {\n var methods = {};\n\n methods.on = function(name, fn) {\n if (typeof this[space] === 'undefined') {\n this[space] = {};\n }\n if (!this[space].hasOwnProperty(name)) {\n this[space][name] = [];\n }\n this[space][name].push(fn);\n };\n\n methods.off = function(name, fn) {\n if (typeof this[space] === 'undefined') return;\n if (this[space].hasOwnProperty(name)) {\n removeItem(fn, this[space][name]);\n }\n };\n\n methods.trigger = function(name) {\n if (typeof this[space] !== 'undefined' && this[space].hasOwnProperty(name)) {\n var args = Array.prototype.slice.call(arguments, 1);\n for (var i = 0; i < this[space][name].length; i++) {\n this[space][name][i].apply(this[space][name][i], args);\n }\n }\n };\n\n methods.removeAllListeners = function(name) {\n if (typeof this[space] === 'undefined') return;\n var self = this;\n self[space][name].forEach(function(fn) {\n self.off(name, fn);\n });\n };\n\n return methods;\n};\n\nvar pvt = EventEmitter.createInterface('_handlers');\nEventEmitter.prototype._on = pvt.on;\nEventEmitter.prototype._off = pvt.off;\nEventEmitter.prototype._trigger = pvt.trigger;\n\nvar pub = EventEmitter.createInterface('handlers');\nEventEmitter.prototype.on = function() {\n pub.on.apply(this, arguments);\n Array.prototype.unshift.call(arguments, 'on');\n this._trigger.apply(this, arguments);\n};\nEventEmitter.prototype.off = pub.off;\nEventEmitter.prototype.trigger = pub.trigger;\nEventEmitter.prototype.removeAllListeners = pub.removeAllListeners;\n\nmodule.exports = EventEmitter;\n","function generateRandom(template) {\n return template.replace(/[xy]/g, function(c) {\n var r = Math.random()*16|0, v = c === 'x' ? r : (r&0x3|0x8);\n return v.toString(16);\n });\n}\n\nfunction guid() {\n return generateRandom('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx').toUpperCase();\n}\n\n/**\n * Generate a string of n random characters. Defaults to n=6.\n */ \nfunction randomChars(n) {\n n = n || 6;\n var template = 'x'.repeat(n);\n return generateRandom(template);\n}\n\nfunction nop() {}\n\nmodule.exports = {\n guid: guid,\n nop: nop,\n randomChars: randomChars\n};\n","// Based on https://github.com/diy/intercom.js/blob/master/lib/intercom.js\n// Copyright 2012 DIY Co Apache License, Version 2.0\n// http://www.apache.org/licenses/LICENSE-2.0\n\nvar EventEmitter = require('./eventemitter.js');\nvar guid = require('../src/shared.js').guid;\n\nfunction throttle(delay, fn) {\n var last = 0;\n return function() {\n var now = Date.now();\n if (now - last > delay) {\n last = now;\n fn.apply(this, arguments);\n }\n };\n}\n\nfunction extend(a, b) {\n if (typeof a === 'undefined' || !a) { a = {}; }\n if (typeof b === 'object') {\n for (var key in b) {\n if (b.hasOwnProperty(key)) {\n a[key] = b[key];\n }\n }\n }\n return a;\n}\n\nvar localStorage = (function(window) {\n if (typeof window === 'undefined' ||\n typeof window.localStorage === 'undefined') {\n return {\n getItem : function() {},\n setItem : function() {},\n removeItem : function() {}\n };\n }\n return window.localStorage;\n}(global));\n\nfunction Intercom() {\n var self = this;\n var now = Date.now();\n\n this.origin = guid();\n this.lastMessage = now;\n this.receivedIDs = {};\n this.previousValues = {};\n\n var storageHandler = function() {\n self._onStorageEvent.apply(self, arguments);\n };\n\n // If we're in node.js, skip event registration\n if (typeof document === 'undefined') {\n return;\n }\n\n if (document.attachEvent) {\n document.attachEvent('onstorage', storageHandler);\n } else {\n global.addEventListener('storage', storageHandler, false);\n }\n}\n\nIntercom.prototype._transaction = function(fn) {\n var TIMEOUT = 1000;\n var WAIT = 20;\n var self = this;\n var executed = false;\n var listening = false;\n var waitTimer = null;\n\n function lock() {\n if (executed) {\n return;\n }\n\n var now = Date.now();\n var activeLock = localStorage.getItem(INDEX_LOCK)|0;\n if (activeLock && now - activeLock < TIMEOUT) {\n if (!listening) {\n self._on('storage', lock);\n listening = true;\n }\n waitTimer = setTimeout(lock, WAIT);\n return;\n }\n executed = true;\n localStorage.setItem(INDEX_LOCK, now);\n\n fn();\n unlock();\n }\n\n function unlock() {\n if (listening) {\n self._off('storage', lock);\n }\n if (waitTimer) {\n clearTimeout(waitTimer);\n }\n localStorage.removeItem(INDEX_LOCK);\n }\n\n lock();\n};\n\nIntercom.prototype._cleanup_emit = throttle(100, function() {\n var self = this;\n\n self._transaction(function() {\n var now = Date.now();\n var threshold = now - THRESHOLD_TTL_EMIT;\n var changed = 0;\n var messages;\n\n try {\n messages = JSON.parse(localStorage.getItem(INDEX_EMIT) || '[]');\n } catch(e) {\n messages = [];\n }\n for (var i = messages.length - 1; i >= 0; i--) {\n if (messages[i].timestamp < threshold) {\n messages.splice(i, 1);\n changed++;\n }\n }\n if (changed > 0) {\n localStorage.setItem(INDEX_EMIT, JSON.stringify(messages));\n }\n });\n});\n\nIntercom.prototype._cleanup_once = throttle(100, function() {\n var self = this;\n\n self._transaction(function() {\n var timestamp, ttl, key;\n var table;\n var now = Date.now();\n var changed = 0;\n\n try {\n table = JSON.parse(localStorage.getItem(INDEX_ONCE) || '{}');\n } catch(e) {\n table = {};\n }\n for (key in table) {\n if (self._once_expired(key, table)) {\n delete table[key];\n changed++;\n }\n }\n\n if (changed > 0) {\n localStorage.setItem(INDEX_ONCE, JSON.stringify(table));\n }\n });\n});\n\nIntercom.prototype._once_expired = function(key, table) {\n if (!table) {\n return true;\n }\n if (!table.hasOwnProperty(key)) {\n return true;\n }\n if (typeof table[key] !== 'object') {\n return true;\n }\n\n var ttl = table[key].ttl || THRESHOLD_TTL_ONCE;\n var now = Date.now();\n var timestamp = table[key].timestamp;\n return timestamp < now - ttl;\n};\n\nIntercom.prototype._localStorageChanged = function(event, field) {\n if (event && event.key) {\n return event.key === field;\n }\n\n var currentValue = localStorage.getItem(field);\n if (currentValue === this.previousValues[field]) {\n return false;\n }\n this.previousValues[field] = currentValue;\n return true;\n};\n\nIntercom.prototype._onStorageEvent = function(event) {\n event = event || global.event;\n var self = this;\n\n if (this._localStorageChanged(event, INDEX_EMIT)) {\n this._transaction(function() {\n var now = Date.now();\n var data = localStorage.getItem(INDEX_EMIT);\n var messages;\n\n try {\n messages = JSON.parse(data || '[]');\n } catch(e) {\n messages = [];\n }\n for (var i = 0; i < messages.length; i++) {\n if (messages[i].origin === self.origin) continue;\n if (messages[i].timestamp < self.lastMessage) continue;\n if (messages[i].id) {\n if (self.receivedIDs.hasOwnProperty(messages[i].id)) continue;\n self.receivedIDs[messages[i].id] = true;\n }\n self.trigger(messages[i].name, messages[i].payload);\n }\n self.lastMessage = now;\n });\n }\n\n this._trigger('storage', event);\n};\n\nIntercom.prototype._emit = function(name, message, id) {\n id = (typeof id === 'string' || typeof id === 'number') ? String(id) : null;\n if (id && id.length) {\n if (this.receivedIDs.hasOwnProperty(id)) return;\n this.receivedIDs[id] = true;\n }\n\n var packet = {\n id : id,\n name : name,\n origin : this.origin,\n timestamp : Date.now(),\n payload : message\n };\n\n var self = this;\n this._transaction(function() {\n var data = localStorage.getItem(INDEX_EMIT) || '[]';\n var delimiter = (data === '[]') ? '' : ',';\n data = [data.substring(0, data.length - 1), delimiter, JSON.stringify(packet), ']'].join('');\n localStorage.setItem(INDEX_EMIT, data);\n self.trigger(name, message);\n\n setTimeout(function() {\n self._cleanup_emit();\n }, 50);\n });\n};\n\nIntercom.prototype.emit = function(name, message) {\n this._emit.apply(this, arguments);\n this._trigger('emit', name, message);\n};\n\nIntercom.prototype.once = function(key, fn, ttl) {\n if (!Intercom.supported) {\n return;\n }\n\n var self = this;\n this._transaction(function() {\n var data;\n try {\n data = JSON.parse(localStorage.getItem(INDEX_ONCE) || '{}');\n } catch(e) {\n data = {};\n }\n if (!self._once_expired(key, data)) {\n return;\n }\n\n data[key] = {};\n data[key].timestamp = Date.now();\n if (typeof ttl === 'number') {\n data[key].ttl = ttl * 1000;\n }\n\n localStorage.setItem(INDEX_ONCE, JSON.stringify(data));\n fn();\n\n setTimeout(function() {\n self._cleanup_once();\n }, 50);\n });\n};\n\nextend(Intercom.prototype, EventEmitter.prototype);\n\nIntercom.supported = (typeof localStorage !== 'undefined');\n\nvar INDEX_EMIT = 'intercom';\nvar INDEX_ONCE = 'intercom_once';\nvar INDEX_LOCK = 'intercom_lock';\n\nvar THRESHOLD_TTL_EMIT = 50000;\nvar THRESHOLD_TTL_ONCE = 1000 * 3600;\n\nIntercom.destroy = function() {\n localStorage.removeItem(INDEX_LOCK);\n localStorage.removeItem(INDEX_EMIT);\n localStorage.removeItem(INDEX_ONCE);\n};\n\nIntercom.getInstance = (function() {\n var intercom;\n return function() {\n if (!intercom) {\n intercom = new Intercom();\n }\n return intercom;\n };\n})();\n\nmodule.exports = Intercom;\n","'using strict';\n\nconst EventEmitter = require('../lib/eventemitter.js');\nconst Path = require('./path.js');\nconst Intercom = require('../lib/intercom.js');\n\n/**\n * FSWatcher based on node.js' FSWatcher\n * see https://github.com/joyent/node/blob/master/lib/fs.js\n */\nfunction FSWatcher() {\n EventEmitter.call(this);\n const self = this;\n let recursive = false;\n let recursivePathPrefix;\n let filename;\n\n function onchange(path) {\n // Watch for exact filename, or parent path when recursive is true.\n if(filename === path || (recursive && path.indexOf(recursivePathPrefix) === 0)) {\n self.trigger('change', 'change', path);\n }\n }\n\n // We support, but ignore the second arg, which node.js uses.\n self.start = function(filename_, persistent_, recursive_) {\n // Bail if we've already started (and therefore have a filename);\n if(filename) {\n return;\n }\n\n if(Path.isNull(filename_)) {\n throw new Error('Path must be a string without null bytes.');\n }\n\n // TODO: get realpath for symlinks on filename...\n\n // Filer's Path.normalize strips trailing slashes, which we use here.\n // See https://github.com/js-platform/filer/issues/105\n filename = Path.normalize(filename_);\n\n // Whether to watch beneath this path or not\n recursive = recursive_ === true;\n // If recursive, construct a path prefix portion for comparisons later\n // (i.e., '/path' becomes '/path/' so we can search within a filename for the\n // prefix). We also take care to allow for '/' on its own.\n if(recursive) {\n recursivePathPrefix = filename === '/' ? '/' : filename + '/';\n }\n\n const intercom = Intercom.getInstance();\n intercom.on('change', onchange);\n };\n\n self.close = function() {\n const intercom = Intercom.getInstance();\n intercom.off('change', onchange);\n self.removeAllListeners('change');\n };\n}\nFSWatcher.prototype = new EventEmitter();\nFSWatcher.prototype.constructor = FSWatcher;\n\nmodule.exports = FSWatcher;\n","var NODE_TYPE_FILE = require('./constants.js').NODE_TYPE_FILE;\n\nmodule.exports = function DirectoryEntry(id, type) {\n this.id = id;\n this.type = type || NODE_TYPE_FILE;\n};\n","const { FIRST_DESCRIPTOR } = require('./constants');\nconst openFiles = {};\n\n/**\n * Start at FIRST_DESCRIPTOR and go until we find\n * an empty file descriptor, then return it.\n */\nconst getEmptyDescriptor = () => {\n let fd = FIRST_DESCRIPTOR;\n\n while(getOpenFileDescription(fd)) {\n fd++;\n }\n\n return fd;\n};\n\n/**\n * Look up the open file description object for a given\n * file descriptor.\n */\nconst getOpenFileDescription = ofd => openFiles[ofd];\n\n/**\n * Allocate a new file descriptor for the given\n * open file description. \n */\nconst allocDescriptor = openFileDescription => {\n const ofd = getEmptyDescriptor();\n openFiles[ofd] = openFileDescription;\n return ofd;\n};\n\n/**\n * Release the given existing file descriptor created\n * with allocDescriptor(). \n */\nconst releaseDescriptor = ofd => delete openFiles[ofd];\n\nmodule.exports = {\n allocDescriptor,\n releaseDescriptor,\n getOpenFileDescription\n};\n","const {\n NODE_TYPE_FILE,\n NODE_TYPE_DIRECTORY,\n NODE_TYPE_SYMBOLIC_LINK,\n DEFAULT_FILE_PERMISSIONS,\n DEFAULT_DIR_PERMISSIONS\n} = require('./constants');\nconst {\n S_IFREG,\n S_IFDIR,\n S_IFLNK\n} = require('./constants').fsConstants;\n\n/**\n * Make sure the options object has an id on property,\n * either from caller or one we generate using supplied guid fn.\n */\nfunction ensureID(options, prop, callback) {\n if(options[prop]) {\n return callback();\n }\n\n options.guid(function(err, id) {\n if(err) {\n return callback(err);\n }\n options[prop] = id;\n callback();\n });\n}\n\n/**\n * Generate a POSIX mode (integer) for the node type and permissions.\n * Use default permissions if we aren't passed any.\n */\nfunction generateMode(nodeType, modePermissions) {\n switch(nodeType) {\n case NODE_TYPE_DIRECTORY:\n return (modePermissions || DEFAULT_DIR_PERMISSIONS) | S_IFDIR;\n case NODE_TYPE_SYMBOLIC_LINK:\n return (modePermissions || DEFAULT_FILE_PERMISSIONS) | S_IFLNK;\n case NODE_TYPE_FILE:\n // falls through\n default:\n return (modePermissions || DEFAULT_FILE_PERMISSIONS) | S_IFREG;\n }\n}\n\n/**\n * Common properties for the layout of a Node\n */\nclass Node {\n constructor(options) {\n var now = Date.now();\n\n this.id = options.id;\n this.data = options.data; // id for data object\n this.size = options.size || 0; // size (bytes for files, entries for directories)\n this.atime = options.atime || now; // access time (will mirror ctime after creation)\n this.ctime = options.ctime || now; // creation/change time\n this.mtime = options.mtime || now; // modified time\n this.flags = options.flags || []; // file flags\n this.xattrs = options.xattrs || {}; // extended attributes\n this.nlinks = options.nlinks || 0; // links count\n\n // Historically, Filer's node layout has referred to the\n // node type as `mode`, and done so using a String. In\n // a POSIX filesystem, the mode is a number that combines\n // both node type and permission bits. Internal we use `type`,\n // but store it in the database as `mode` for backward\n // compatibility.\n if(typeof options.type === 'string') {\n this.type = options.type;\n } else if(typeof options.mode === 'string') {\n this.type = options.mode;\n } else {\n this.type = NODE_TYPE_FILE;\n }\n\n // Extra mode permissions and ownership info\n this.permissions = options.permissions || generateMode(this.type);\n this.uid = options.uid || 0x0; // owner name\n this.gid = options.gid || 0x0; // group name\n }\n\n /**\n * Serialize a Node to JSON. Everything is as expected except\n * that we use `mode` for `type` to maintain backward compatibility.\n */\n toJSON() {\n return {\n id: this.id,\n data: this.data,\n size: this.size,\n atime: this.atime,\n ctime: this.ctime,\n mtime: this.ctime,\n flags: this.flags,\n xattrs: this.xattrs,\n nlinks: this.nlinks,\n // Use `mode` for `type` to keep backward compatibility\n mode: this.type,\n permissions: this.permissions,\n uid: this.uid,\n gid: this.gid\n };\n }\n\n // Return complete POSIX `mode` for node type + permissions. See:\n // http://man7.org/linux/man-pages/man2/chmod.2.html\n get mode() {\n return generateMode(this.type, this.permissions);\n }\n // When setting the `mode` we assume permissions bits only (not changing type)\n set mode(value) {\n this.permissions = value;\n }\n}\n\nmodule.exports.create = function create(options, callback) {\n // We expect both options.id and options.data to be provided/generated.\n ensureID(options, 'id', function(err) {\n if(err) {\n return callback(err);\n }\n\n ensureID(options, 'data', function(err) {\n if(err) {\n return callback(err);\n }\n\n callback(null, new Node(options));\n });\n });\n};\n","const Errors = require('./errors.js');\nconst Node = require('./node');\n\nfunction OpenFileDescription(path, id, flags, position) {\n this.path = path;\n this.id = id;\n this.flags = flags;\n this.position = position;\n}\n\n// Tries to find the node associated with an ofd's `id`.\n// If not found, an error is returned on the callback.\nOpenFileDescription.prototype.getNode = function(context, callback) {\n var id = this.id;\n var path = this.path;\n\n function check_if_node_exists(error, node) {\n if(error) {\n return callback(error);\n }\n\n if(!node) {\n return callback(new Errors.EBADF('file descriptor refers to unknown node', path));\n }\n\n Node.create(node, callback);\n }\n\n context.getObject(id, check_if_node_exists);\n};\n\nmodule.exports = OpenFileDescription;\n","var Constants = require('./constants.js');\n\nfunction SuperNode(options) {\n var now = Date.now();\n\n this.id = Constants.SUPER_NODE_ID;\n this.type = Constants.NODE_TYPE_META;\n this.atime = options.atime || now;\n this.ctime = options.ctime || now;\n this.mtime = options.mtime || now;\n // root node id (randomly generated)\n this.rnode = options.rnode;\n}\n\nSuperNode.create = function(options, callback) {\n options.guid(function(err, rnode) {\n if(err) {\n callback(err);\n return;\n }\n options.rnode = options.rnode || rnode;\n callback(null, new SuperNode(options));\n });\n};\n\nmodule.exports = SuperNode;\n","'use strict';\n\nconst Constants = require('./constants.js');\nconst Path = require('./path.js');\n\nfunction dateFromMs(ms) {\n return new Date(Number(ms));\n}\n\nfunction Stats(path, fileNode, devName) {\n this.dev = devName;\n this.node = fileNode.id;\n this.type = fileNode.type;\n this.size = fileNode.size;\n this.nlinks = fileNode.nlinks;\n // Date objects\n this.atime = dateFromMs(fileNode.atime);\n this.mtime = dateFromMs(fileNode.mtime);\n this.ctime = dateFromMs(fileNode.ctime);\n // Unix timestamp MS Numbers\n this.atimeMs = fileNode.atime;\n this.mtimeMs = fileNode.mtime;\n this.ctimeMs = fileNode.ctime;\n this.version = fileNode.version;\n this.mode = fileNode.mode;\n this.uid = fileNode.uid;\n this.gid = fileNode.gid;\n this.name = Path.basename(path);\n}\n\nStats.prototype.isFile = function() {\n return this.type === Constants.NODE_TYPE_FILE;\n};\n\nStats.prototype.isDirectory = function() {\n return this.type === Constants.NODE_TYPE_DIRECTORY;\n};\n\nStats.prototype.isSymbolicLink = function() {\n return this.type === Constants.NODE_TYPE_SYMBOLIC_LINK;\n};\n\n// These will always be false in Filer.\nStats.prototype.isSocket =\nStats.prototype.isFIFO =\nStats.prototype.isCharacterDevice =\nStats.prototype.isBlockDevice =\nfunction() {\n return false;\n};\n\nmodule.exports = Stats;\n","'use strict';\n\nconst Stats = require('./stats.js');\n\nfunction Dirent(path, fileNode, devName) {\n this.constructor = Dirent;\n Stats.call(this, path, fileNode, devName);\n}\n\nDirent.prototype = Stats.prototype;\n\nmodule.exports = Dirent;\n","var Path = require('../path.js');\nvar normalize = Path.normalize;\nvar dirname = Path.dirname;\nvar basename = Path.basename;\nvar isAbsolutePath = Path.isAbsolute;\nvar shared = require('../shared.js');\nvar async = require('../../lib/async.js');\n\nvar Constants = require('../constants.js');\nvar NODE_TYPE_FILE = Constants.NODE_TYPE_FILE;\nvar NODE_TYPE_DIRECTORY = Constants.NODE_TYPE_DIRECTORY;\nvar NODE_TYPE_SYMBOLIC_LINK = Constants.NODE_TYPE_SYMBOLIC_LINK;\nvar NODE_TYPE_META = Constants.NODE_TYPE_META;\n\nvar FULL_READ_WRITE_EXEC_PERMISSIONS = Constants.FULL_READ_WRITE_EXEC_PERMISSIONS;\n\nvar ROOT_DIRECTORY_NAME = Constants.ROOT_DIRECTORY_NAME;\nvar SUPER_NODE_ID = Constants.SUPER_NODE_ID;\nvar SYMLOOP_MAX = Constants.SYMLOOP_MAX;\n\nvar O_READ = Constants.O_READ;\nvar O_WRITE = Constants.O_WRITE;\nvar O_CREATE = Constants.O_CREATE;\nvar O_EXCLUSIVE = Constants.O_EXCLUSIVE;\nvar O_APPEND = Constants.O_APPEND;\nvar O_FLAGS = Constants.O_FLAGS;\n\nvar XATTR_CREATE = Constants.XATTR_CREATE;\nvar XATTR_REPLACE = Constants.XATTR_REPLACE;\nvar FS_NOMTIME = Constants.FS_NOMTIME;\nvar FS_NOCTIME = Constants.FS_NOCTIME;\n\nvar Errors = require('../errors.js');\nvar DirectoryEntry = require('../directory-entry.js');\nvar openFiles = require('../open-files.js');\nvar OpenFileDescription = require('../open-file-description.js');\nvar SuperNode = require('../super-node.js');\nvar Node = require('../node.js');\nvar Dirent = require('../dirent.js');\nvar Stats = require('../stats.js');\n\n/**\n * Update node times. Only passed times are modified (undefined times are ignored)\n * and filesystem flags are examined in order to override update logic.\n */\nfunction update_node_times(context, path, node, times, callback) {\n // Honour mount flags for how we update times\n var flags = context.flags;\n if(flags.includes(FS_NOCTIME)) {\n delete times.ctime;\n }\n if(flags.includes(FS_NOMTIME)) {\n delete times.mtime;\n }\n\n // Only do the update if required (i.e., times are still present)\n var update = false;\n if(times.ctime) {\n node.ctime = times.ctime;\n // We don't do atime tracking for perf reasons, but do mirror ctime\n node.atime = times.ctime;\n update = true;\n }\n if(times.atime) {\n // The only time we explicitly pass atime is when utimes(), futimes() is called.\n // Override ctime mirror here if so\n node.atime = times.atime;\n update = true;\n }\n if(times.mtime) {\n node.mtime = times.mtime;\n update = true;\n }\n\n function complete(error) {\n // Queue this change so we can send watch events.\n // Unlike node.js, we send the full path vs. basename/dirname only.\n context.changes.push({ event: 'change', path: path });\n callback(error);\n }\n\n if(update) {\n context.putObject(node.id, node, complete);\n } else {\n complete();\n }\n}\n\n/**\n * make_node()\n */\n// in: file or directory path\n// out: new node representing file/directory\nfunction make_node(context, path, type, callback) {\n if(type !== NODE_TYPE_DIRECTORY && type !== NODE_TYPE_FILE) {\n return callback(new Errors.EINVAL('type must be a directory or file', path));\n }\n\n path = normalize(path);\n\n var name = basename(path);\n var parentPath = dirname(path);\n var parentNode;\n var parentNodeData;\n var node;\n\n // Check if the parent node exists\n function create_node_in_parent(error, parentDirectoryNode) {\n if(error) {\n callback(error);\n } else if(parentDirectoryNode.type !== NODE_TYPE_DIRECTORY) {\n callback(new Errors.ENOTDIR('a component of the path prefix is not a directory', path));\n } else {\n parentNode = parentDirectoryNode;\n find_node(context, path, check_if_node_exists);\n }\n }\n\n // Check if the node to be created already exists\n function check_if_node_exists(error, result) {\n if(!error && result) {\n callback(new Errors.EEXIST('path name already exists', path));\n } else if(error && !(error instanceof Errors.ENOENT)) {\n callback(error);\n } else {\n context.getObject(parentNode.data, create_node);\n }\n }\n\n // Create the new node\n function create_node(error, result) {\n if(error) {\n callback(error);\n } else {\n parentNodeData = result;\n Node.create({\n guid: context.guid,\n type: type\n }, function(error, result) {\n if(error) {\n callback(error);\n return;\n }\n node = result;\n node.nlinks += 1;\n context.putObject(node.id, node, update_parent_node_data);\n });\n }\n }\n\n // Update parent node time\n function update_time(error) {\n if(error) {\n callback(error);\n } else {\n var now = Date.now();\n update_node_times(context, parentPath, node, { mtime: now, ctime: now }, callback);\n }\n }\n\n // Update the parent nodes data\n function update_parent_node_data(error) {\n if(error) {\n callback(error);\n } else {\n parentNodeData[name] = new DirectoryEntry(node.id, type);\n context.putObject(parentNode.data, parentNodeData, update_time);\n }\n }\n\n // Find the parent node\n find_node(context, parentPath, create_node_in_parent);\n}\n\n/**\n * find_node\n */\n// in: file or directory path\n// out: node structure, or error\nfunction find_node(context, path, callback) {\n path = normalize(path);\n if(!path) {\n return callback(new Errors.ENOENT('path is an empty string'));\n }\n var name = basename(path);\n var parentPath = dirname(path);\n var followedCount = 0;\n\n function read_root_directory_node(error, nodeData) {\n if(error) {\n return callback(error);\n }\n\n // Parse existing node as SuperNode\n const superNode = new SuperNode(nodeData);\n\n if(!superNode || superNode.type !== NODE_TYPE_META || !superNode.rnode) {\n callback(new Errors.EFILESYSTEMERROR());\n } else {\n context.getObject(superNode.rnode, check_root_directory_node);\n }\n }\n\n function check_root_directory_node(error, rootDirectoryNode) {\n if(error) {\n callback(error);\n } else if(!rootDirectoryNode) {\n callback(new Errors.ENOENT());\n } else {\n Node.create(rootDirectoryNode, callback);\n }\n }\n\n // in: parent directory node\n // out: parent directory data\n function read_parent_directory_data(error, parentDirectoryNode) {\n if(error) {\n callback(error);\n } else if(parentDirectoryNode.type !== NODE_TYPE_DIRECTORY || !parentDirectoryNode.data) {\n callback(new Errors.ENOTDIR('a component of the path prefix is not a directory', path));\n } else {\n context.getObject(parentDirectoryNode.data, get_node_from_parent_directory_data);\n }\n }\n\n // in: parent directory data\n // out: searched node\n function get_node_from_parent_directory_data(error, parentDirectoryData) {\n if(error) {\n callback(error);\n } else {\n if(!Object.prototype.hasOwnProperty.call(parentDirectoryData, name)) {\n callback(new Errors.ENOENT(null, path));\n } else {\n var nodeId = parentDirectoryData[name].id;\n context.getObject(nodeId, create_node);\n }\n }\n }\n\n function create_node(error, data) {\n if(error) {\n return callback(error);\n }\n Node.create(data, is_symbolic_link);\n }\n\n function is_symbolic_link(error, node) {\n if(error) {\n callback(error);\n } else {\n if(node.type === NODE_TYPE_SYMBOLIC_LINK) {\n followedCount++;\n if(followedCount > SYMLOOP_MAX){\n callback(new Errors.ELOOP(null, path));\n } else {\n follow_symbolic_link(node.data);\n }\n } else {\n callback(null, node);\n }\n }\n }\n\n function follow_symbolic_link(data) {\n data = normalize(data);\n parentPath = dirname(data);\n name = basename(data);\n if(ROOT_DIRECTORY_NAME === name) {\n context.getObject(SUPER_NODE_ID, read_root_directory_node);\n } else {\n find_node(context, parentPath, read_parent_directory_data);\n }\n }\n\n if(ROOT_DIRECTORY_NAME === name) {\n context.getObject(SUPER_NODE_ID, read_root_directory_node);\n } else {\n find_node(context, parentPath, read_parent_directory_data);\n }\n}\n\n\n/**\n * set extended attribute (refactor)\n */\nfunction set_extended_attribute (context, path, node, name, value, flag, callback) {\n function update_time(error) {\n if(error) {\n callback(error);\n } else {\n update_node_times(context, path, node, { ctime: Date.now() }, callback);\n }\n }\n\n var xattrs = node.xattrs;\n\n if (flag === XATTR_CREATE && Object.prototype.hasOwnProperty.call(xattrs, name)) {\n callback(new Errors.EEXIST('attribute already exists', path));\n }\n else if (flag === XATTR_REPLACE && !Object.prototype.hasOwnProperty.call(xattrs, name)) {\n callback(new Errors.ENOATTR(null, path));\n }\n else {\n xattrs[name] = value;\n context.putObject(node.id, node, update_time);\n }\n}\n\n/**\n * ensure_root_directory. Creates a root node if necessary.\n *\n * Note: this should only be invoked when formatting a new file system.\n * Multiple invocations of this by separate instances will still result\n * in only a single super node.\n */\nfunction ensure_root_directory(context, callback) {\n var superNode;\n var directoryNode;\n var directoryData;\n\n function ensure_super_node(error, existingNode) {\n if(!error && existingNode) {\n // Another instance has beat us and already created the super node.\n callback();\n } else if(error && !(error instanceof Errors.ENOENT)) {\n callback(error);\n } else {\n SuperNode.create({guid: context.guid}, function(error, result) {\n if(error) {\n callback(error);\n return;\n }\n superNode = result;\n context.putObject(superNode.id, superNode, write_directory_node);\n });\n }\n }\n\n function write_directory_node(error) {\n if(error) {\n callback(error);\n } else {\n Node.create({\n guid: context.guid,\n id: superNode.rnode,\n type: NODE_TYPE_DIRECTORY\n }, function(error, result) {\n if(error) {\n callback(error);\n return;\n }\n directoryNode = result;\n directoryNode.nlinks += 1;\n context.putObject(directoryNode.id, directoryNode, write_directory_data);\n });\n }\n }\n\n function write_directory_data(error) {\n if(error) {\n callback(error);\n } else {\n directoryData = {};\n context.putObject(directoryNode.data, directoryData, callback);\n }\n }\n\n context.getObject(SUPER_NODE_ID, ensure_super_node);\n}\n\n/**\n * make_directory\n */\nfunction make_directory(context, path, callback) {\n path = normalize(path);\n var name = basename(path);\n var parentPath = dirname(path);\n\n var directoryNode;\n var directoryData;\n var parentDirectoryNode;\n var parentDirectoryData;\n\n function check_if_directory_exists(error, result) {\n if(!error && result) {\n callback(new Errors.EEXIST(null, path));\n } else if(error && !(error instanceof Errors.ENOENT)) {\n callback(error);\n } else {\n find_node(context, parentPath, read_parent_directory_data);\n }\n }\n\n function read_parent_directory_data(error, result) {\n if(error) {\n callback(error);\n } else {\n parentDirectoryNode = result;\n context.getObject(parentDirectoryNode.data, write_directory_node);\n }\n }\n\n function write_directory_node(error, result) {\n if(error) {\n callback(error);\n } else {\n parentDirectoryData = result;\n Node.create({\n guid: context.guid,\n type: NODE_TYPE_DIRECTORY\n }, function(error, result) {\n if(error) {\n callback(error);\n return;\n }\n directoryNode = result;\n directoryNode.nlinks += 1;\n context.putObject(directoryNode.id, directoryNode, write_directory_data);\n });\n }\n }\n\n function write_directory_data(error) {\n if(error) {\n callback(error);\n } else {\n directoryData = {};\n context.putObject(directoryNode.data, directoryData, update_parent_directory_data);\n }\n }\n\n function update_time(error) {\n if(error) {\n callback(error);\n } else {\n var now = Date.now();\n update_node_times(context, parentPath, parentDirectoryNode, { mtime: now, ctime: now }, callback);\n }\n }\n\n function update_parent_directory_data(error) {\n if(error) {\n callback(error);\n } else {\n parentDirectoryData[name] = new DirectoryEntry(directoryNode.id, NODE_TYPE_DIRECTORY);\n context.putObject(parentDirectoryNode.data, parentDirectoryData, update_time);\n }\n }\n\n find_node(context, path, check_if_directory_exists);\n}\n\nfunction access_file(context, path, mode, callback) {\n const { F_OK, R_OK, W_OK, X_OK, S_IXUSR, S_IXGRP, S_IXOTH } = Constants.fsConstants;\n\n path = normalize(path);\n find_node(context, path, function (err, node) {\n if (err) {\n return callback(err);\n }\n\n // If we have a node, F_OK is true.\n if(mode === F_OK) {\n return callback(null);\n }\n\n var st_mode = validateAndMaskMode(node.mode, callback);\n if(!st_mode) return;\n\n // For any other combo of F_OK, R_OK, W_OK, always allow. Filer user is a root user,\n // so existing files are always OK, readable, and writable\n if(mode & (R_OK | W_OK)) {\n return callback(null);\n }\n\n // For the case of X_OK, actually check if this file is executable\n if ((mode & X_OK) && (st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) {\n return callback(null);\n }\n\n // In any other case, the file isn't accessible\n callback(new Errors.EACCES('permission denied',path)) ;\n });\n}\n\n/**\n * remove_directory\n */\nfunction remove_directory(context, path, callback) {\n path = normalize(path);\n var name = basename(path);\n var parentPath = dirname(path);\n\n var directoryNode;\n var directoryData;\n var parentDirectoryNode;\n var parentDirectoryData;\n\n function read_parent_directory_data(error, result) {\n if(error) {\n callback(error);\n } else {\n parentDirectoryNode = result;\n context.getObject(parentDirectoryNode.data, check_if_node_exists);\n }\n }\n\n function check_if_node_exists(error, result) {\n if(error) {\n callback(error);\n } else if(ROOT_DIRECTORY_NAME === name) {\n callback(new Errors.EBUSY(null, path));\n } else if(!Object.prototype.hasOwnProperty.call(result, name)) {\n callback(new Errors.ENOENT(null, path));\n } else {\n parentDirectoryData = result;\n directoryNode = parentDirectoryData[name].id;\n context.getObject(directoryNode, check_if_node_is_directory);\n }\n }\n\n function check_if_node_is_directory(error, result) {\n if(error) {\n callback(error);\n } else if(result.type !== NODE_TYPE_DIRECTORY) {\n callback(new Errors.ENOTDIR(null, path));\n } else {\n directoryNode = result;\n context.getObject(directoryNode.data, check_if_directory_is_empty);\n }\n }\n\n function check_if_directory_is_empty(error, result) {\n if(error) {\n callback(error);\n } else {\n directoryData = result;\n if(Object.keys(directoryData).length > 0) {\n callback(new Errors.ENOTEMPTY(null, path));\n } else {\n remove_directory_entry_from_parent_directory_node();\n }\n }\n }\n\n function update_time(error) {\n if(error) {\n callback(error);\n } else {\n var now = Date.now();\n update_node_times(context, parentPath, parentDirectoryNode, { mtime: now, ctime: now }, remove_directory_node);\n }\n }\n\n function remove_directory_entry_from_parent_directory_node() {\n delete parentDirectoryData[name];\n context.putObject(parentDirectoryNode.data, parentDirectoryData, update_time);\n }\n\n function remove_directory_node(error) {\n if(error) {\n callback(error);\n } else {\n context.delete(directoryNode.id, remove_directory_data);\n }\n }\n\n function remove_directory_data(error) {\n if(error) {\n callback(error);\n } else {\n context.delete(directoryNode.data, callback);\n }\n }\n\n find_node(context, parentPath, read_parent_directory_data);\n}\n\nfunction open_file(context, path, flags, mode, callback) {\n if (typeof mode === 'function'){\n callback = mode;\n mode = null;\n }\n path = normalize(path);\n var name = basename(path);\n var parentPath = dirname(path);\n\n var directoryNode;\n var directoryData;\n var directoryEntry;\n var fileNode;\n var fileData;\n\n var followedCount = 0;\n\n if(ROOT_DIRECTORY_NAME === name) {\n if(flags.includes(O_WRITE)) {\n callback(new Errors.EISDIR('the named file is a directory and O_WRITE is set', path));\n } else {\n find_node(context, path, set_file_node);\n }\n } else {\n find_node(context, parentPath, read_directory_data);\n }\n\n function read_directory_data(error, result) {\n if(error) {\n callback(error);\n } else if(result.type !== NODE_TYPE_DIRECTORY) {\n callback(new Errors.ENOENT(null, path));\n } else {\n directoryNode = result;\n context.getObject(directoryNode.data, check_if_file_exists);\n }\n }\n\n function check_if_file_exists(error, result) {\n if(error) {\n callback(error);\n } else {\n directoryData = result;\n if(Object.prototype.hasOwnProperty.call(directoryData, name)) {\n if(flags.includes(O_EXCLUSIVE)) {\n callback(new Errors.EEXIST('O_CREATE and O_EXCLUSIVE are set, and the named file exists', path));\n } else {\n directoryEntry = directoryData[name];\n if(directoryEntry.type === NODE_TYPE_DIRECTORY && flags.includes(O_WRITE)) {\n callback(new Errors.EISDIR('the named file is a directory and O_WRITE is set', path));\n } else {\n context.getObject(directoryEntry.id, check_if_symbolic_link);\n }\n }\n } else {\n if(!flags.includes(O_CREATE)) {\n callback(new Errors.ENOENT('O_CREATE is not set and the named file does not exist', path));\n } else {\n write_file_node();\n }\n }\n }\n }\n\n function check_if_symbolic_link(error, result) {\n if(error) {\n callback(error);\n } else {\n var node = result;\n if(node.type === NODE_TYPE_SYMBOLIC_LINK) {\n followedCount++;\n if(followedCount > SYMLOOP_MAX){\n callback(new Errors.ELOOP(null, path));\n } else {\n follow_symbolic_link(node.data);\n }\n } else {\n set_file_node(undefined, node);\n }\n }\n }\n\n function follow_symbolic_link(data) {\n data = normalize(data);\n parentPath = dirname(data);\n name = basename(data);\n if(ROOT_DIRECTORY_NAME === name) {\n if(flags.includes(O_WRITE)) {\n callback(new Errors.EISDIR('the named file is a directory and O_WRITE is set', path));\n } else {\n find_node(context, path, set_file_node);\n }\n }\n find_node(context, parentPath, read_directory_data);\n }\n\n function set_file_node(error, result) {\n if(error) {\n callback(error);\n } else {\n fileNode = result;\n callback(null, fileNode);\n }\n }\n\n function write_file_node() {\n Node.create({\n guid: context.guid,\n type: NODE_TYPE_FILE\n }, function(error, result) {\n if(error) {\n callback(error);\n return;\n }\n fileNode = result;\n fileNode.nlinks += 1;\n if(mode){\n fileNode.mode = mode;\n }\n context.putObject(fileNode.id, fileNode, write_file_data);\n });\n }\n\n function write_file_data(error) {\n if(error) {\n callback(error);\n } else {\n fileData = Buffer.alloc(0);\n context.putBuffer(fileNode.data, fileData, update_directory_data);\n }\n }\n\n function update_time(error) {\n if(error) {\n callback(error);\n } else {\n var now = Date.now();\n update_node_times(context, parentPath, directoryNode, { mtime: now, ctime: now }, handle_update_result);\n }\n }\n\n function update_directory_data(error) {\n if(error) {\n callback(error);\n } else {\n directoryData[name] = new DirectoryEntry(fileNode.id, NODE_TYPE_FILE);\n context.putObject(directoryNode.data, directoryData, update_time);\n }\n }\n\n function handle_update_result(error) {\n if(error) {\n callback(error);\n } else {\n callback(null, fileNode);\n }\n }\n}\n\nfunction replace_data(context, ofd, buffer, offset, length, callback) {\n var fileNode;\n\n function return_nbytes(error) {\n if(error) {\n callback(error);\n } else {\n callback(null, length);\n }\n }\n\n function update_time(error) {\n if(error) {\n callback(error);\n } else {\n var now = Date.now();\n update_node_times(context, ofd.path, fileNode, { mtime: now, ctime: now }, return_nbytes);\n }\n }\n\n function update_file_node(error) {\n if(error) {\n callback(error);\n } else {\n context.putObject(fileNode.id, fileNode, update_time);\n }\n }\n\n function write_file_data(error, result) {\n if(error) {\n callback(error);\n } else {\n fileNode = result;\n\n var newData = Buffer.alloc(length);\n buffer.copy(newData, 0, offset, offset + length);\n ofd.position = length;\n\n fileNode.size = length;\n fileNode.version += 1;\n\n context.putBuffer(fileNode.data, newData, update_file_node);\n }\n }\n\n context.getObject(ofd.id, write_file_data);\n}\n\nfunction write_data(context, ofd, buffer, offset, length, position, callback) {\n var fileNode;\n var fileData;\n\n function return_nbytes(error) {\n if(error) {\n callback(error);\n } else {\n callback(null, length);\n }\n }\n\n function update_time(error) {\n if(error) {\n callback(error);\n } else {\n var now = Date.now();\n update_node_times(context, ofd.path, fileNode, { mtime: now, ctime: now }, return_nbytes);\n }\n }\n\n function update_file_node(error) {\n if(error) {\n callback(error);\n } else {\n context.putObject(fileNode.id, fileNode, update_time);\n }\n }\n\n function update_file_data(error, result) {\n if(error) {\n callback(error);\n } else {\n fileData = result;\n if(!fileData) {\n return callback(new Errors.EIO('Expected Buffer'));\n }\n var _position = (!(undefined === position || null === position)) ? position : ofd.position;\n var newSize = Math.max(fileData.length, _position + length);\n var newData = Buffer.alloc(newSize);\n if(fileData) {\n fileData.copy(newData);\n }\n buffer.copy(newData, _position, offset, offset + length);\n if(undefined === position) {\n ofd.position += length;\n }\n\n fileNode.size = newSize;\n fileNode.version += 1;\n\n context.putBuffer(fileNode.data, newData, update_file_node);\n }\n }\n\n function read_file_data(error, result) {\n if(error) {\n callback(error);\n } else {\n fileNode = result;\n context.getBuffer(fileNode.data, update_file_data);\n }\n }\n\n context.getObject(ofd.id, read_file_data);\n}\n\nfunction read_data(context, ofd, buffer, offset, length, position, callback) {\n var fileNode;\n var fileData;\n\n function handle_file_data(error, result) {\n if(error) {\n callback(error);\n } else {\n fileData = result;\n if(!fileData) {\n return callback(new Errors.EIO('Expected Buffer'));\n }\n var _position = (!(undefined === position || null === position)) ? position : ofd.position;\n length = (_position + length > buffer.length) ? length - _position : length;\n fileData.copy(buffer, offset, _position, _position + length);\n if(undefined === position) {\n ofd.position += length;\n }\n callback(null, length);\n }\n }\n\n function read_file_data(error, result) {\n if(error) {\n callback(error);\n } else if(result.type === NODE_TYPE_DIRECTORY) {\n callback(new Errors.EISDIR('the named file is a directory', ofd.path));\n } else {\n fileNode = result;\n context.getBuffer(fileNode.data, handle_file_data);\n }\n }\n\n context.getObject(ofd.id, read_file_data);\n}\n\nfunction stat_file(context, path, callback) {\n path = normalize(path);\n find_node(context, path, callback);\n}\n\nfunction fstat_file(context, ofd, callback) {\n ofd.getNode(context, callback);\n}\n\nfunction lstat_file(context, path, callback) {\n path = normalize(path);\n var name = basename(path);\n var parentPath = dirname(path);\n\n var directoryNode;\n var directoryData;\n\n if(ROOT_DIRECTORY_NAME === name) {\n find_node(context, path, callback);\n } else {\n find_node(context, parentPath, read_directory_data);\n }\n\n function read_directory_data(error, result) {\n if(error) {\n callback(error);\n } else {\n directoryNode = result;\n context.getObject(directoryNode.data, check_if_file_exists);\n }\n }\n\n function create_node(error, data) {\n if(error) {\n return callback(error);\n }\n Node.create(data, callback);\n }\n\n function check_if_file_exists(error, result) {\n if(error) {\n callback(error);\n } else {\n directoryData = result;\n if(!Object.prototype.hasOwnProperty.call(directoryData, name)) {\n callback(new Errors.ENOENT('a component of the path does not name an existing file', path));\n } else {\n context.getObject(directoryData[name].id, create_node);\n }\n }\n }\n}\n\nfunction link_node(context, oldpath, newpath, callback) {\n oldpath = normalize(oldpath);\n var oldname = basename(oldpath);\n var oldParentPath = dirname(oldpath);\n\n newpath = normalize(newpath);\n var newname = basename(newpath);\n var newParentPath = dirname(newpath);\n var ctime = Date.now();\n\n var oldDirectoryNode;\n var oldDirectoryData;\n var newDirectoryNode;\n var newDirectoryData;\n var fileNodeID;\n var fileNode;\n\n function update_time(error) {\n if(error) {\n callback(error);\n } else {\n update_node_times(context, newpath, fileNode, { ctime: ctime }, callback);\n }\n }\n\n function update_file_node(error, result) {\n if(error) {\n callback(error);\n } else {\n fileNode = result;\n fileNode.nlinks += 1;\n context.putObject(fileNode.id, fileNode, update_time);\n }\n }\n\n function read_file_node(error) {\n if(error) {\n callback(error);\n } else {\n context.getObject(fileNodeID, update_file_node);\n }\n }\n\n function check_if_new_file_exists(error, result) {\n if(error) {\n callback(error);\n } else {\n newDirectoryData = result;\n if(Object.prototype.hasOwnProperty.call(newDirectoryData, newname)) {\n callback(new Errors.EEXIST('newpath resolves to an existing file', newname));\n } else {\n newDirectoryData[newname] = oldDirectoryData[oldname];\n fileNodeID = newDirectoryData[newname].id;\n context.putObject(newDirectoryNode.data, newDirectoryData, read_file_node);\n }\n }\n }\n\n function read_new_directory_data(error, result) {\n if(error) {\n callback(error);\n } else {\n newDirectoryNode = result;\n context.getObject(newDirectoryNode.data, check_if_new_file_exists);\n }\n }\n\n function check_if_old_file_exists(error, result) {\n if(error) {\n callback(error);\n } else {\n oldDirectoryData = result;\n if(!Object.prototype.hasOwnProperty.call(oldDirectoryData, oldname)) {\n callback(new Errors.ENOENT('a component of either path prefix does not exist', oldname));\n } else if(oldDirectoryData[oldname].type === NODE_TYPE_DIRECTORY) {\n callback(new Errors.EPERM('oldpath refers to a directory'));\n } else {\n find_node(context, newParentPath, read_new_directory_data);\n }\n }\n }\n\n function read_old_directory_data(error, result) {\n if(error) {\n callback(error);\n } else {\n oldDirectoryNode = result;\n context.getObject(oldDirectoryNode.data, check_if_old_file_exists);\n }\n }\n\n find_node(context, oldParentPath, read_old_directory_data);\n}\n\nfunction unlink_node(context, path, callback) {\n path = normalize(path);\n var name = basename(path);\n var parentPath = dirname(path);\n\n var directoryNode;\n var directoryData;\n var fileNode;\n\n function update_directory_data(error) {\n if(error) {\n callback(error);\n } else {\n delete directoryData[name];\n context.putObject(directoryNode.data, directoryData, function(error) {\n if(error) {\n callback(error);\n } else {\n var now = Date.now();\n update_node_times(context, parentPath, directoryNode, { mtime: now, ctime: now }, callback);\n }\n });\n }\n }\n\n function delete_file_data(error) {\n if(error) {\n callback(error);\n } else {\n context.delete(fileNode.data, update_directory_data);\n }\n }\n\n function update_file_node(error, result) {\n if(error) {\n callback(error);\n } else {\n fileNode = result;\n fileNode.nlinks -= 1;\n if(fileNode.nlinks < 1) {\n context.delete(fileNode.id, delete_file_data);\n } else {\n context.putObject(fileNode.id, fileNode, function(error) {\n if(error) {\n callback(error);\n } else {\n update_node_times(context, path, fileNode, { ctime: Date.now() }, update_directory_data);\n }\n });\n }\n }\n }\n\n function check_if_node_is_directory(error, result) {\n if(error) {\n callback(error);\n } else if(result.type === NODE_TYPE_DIRECTORY) {\n callback(new Errors.EPERM('unlink not permitted on directories', name));\n } else {\n update_file_node(null, result);\n }\n }\n\n function check_if_file_exists(error, result) {\n if(error) {\n callback(error);\n } else {\n directoryData = result;\n if(!Object.prototype.hasOwnProperty.call(directoryData, name)) {\n callback(new Errors.ENOENT('a component of the path does not name an existing file', name));\n } else {\n context.getObject(directoryData[name].id, check_if_node_is_directory);\n }\n }\n }\n\n function read_directory_data(error, result) {\n if(error) {\n callback(error);\n } else {\n directoryNode = result;\n context.getObject(directoryNode.data, check_if_file_exists);\n }\n }\n\n find_node(context, parentPath, read_directory_data);\n}\n\nfunction read_directory(context, path, options, callback) {\n path = normalize(path);\n\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = validate_directory_options(options);\n\n var directoryNode;\n var directoryData;\n\n function handle_directory_data(error, result) {\n if (error) {\n callback(error);\n } else {\n directoryData = result;\n var files = Object.keys(directoryData);\n\n if (options.encoding) {\n var fileBuffers = files.map(function (file) {\n return Buffer.from(file);\n });\n\n if (options.encoding === 'buffer') {\n files = fileBuffers;\n }\n else {\n files = fileBuffers.map(function (fileBuffer) {\n return fileBuffer.toString(options.encoding);\n });\n }\n }\n\n if (options.withFileTypes) {\n var dirEnts = [];\n\n // eslint-disable-next-line no-inner-declarations\n function to_dir_entry(file, callback) {\n const filename = Buffer.from(file, options.encoding).toString();\n const filepath = Path.join(path, filename);\n get_dir_entry(context, filepath, function(error, dirEnt) {\n if (error) {\n callback(error);\n }\n dirEnt.name = file;\n dirEnts.push(dirEnt);\n callback();\n });\n }\n\n async.eachSeries(files, to_dir_entry, function (error) {\n callback(error, dirEnts);\n });\n }\n\n else {\n callback(null, files);\n }\n }\n }\n\n function read_directory_data(error, result) {\n if (error) {\n callback(error);\n } else if (result.type !== NODE_TYPE_DIRECTORY) {\n callback(new Errors.ENOTDIR(null, path));\n } else {\n directoryNode = result;\n context.getObject(directoryNode.data, handle_directory_data);\n }\n }\n\n find_node(context, path, read_directory_data);\n}\n\nfunction get_dir_entry(context, path, callback) {\n function check_result(error, result) {\n if(error) {\n callback(error);\n } else {\n var stats = new Dirent(path, result, context.name);\n callback(null, stats);\n }\n }\n\n lstat_file(context, path, check_result);\n}\n\nfunction validate_directory_options(options, enc) {\n if (!options) {\n options = { encoding: enc };\n } else if (typeof options === 'function') {\n options = { encoding: enc };\n } else if (typeof options === 'string') {\n options = { encoding: options };\n }\n return options;\n}\n\nfunction make_symbolic_link(context, srcpath, dstpath, callback) {\n dstpath = normalize(dstpath);\n var name = basename(dstpath);\n var parentPath = dirname(dstpath);\n\n var directoryNode;\n var directoryData;\n var fileNode;\n\n if(ROOT_DIRECTORY_NAME === name) {\n callback(new Errors.EEXIST(null, name));\n } else {\n find_node(context, parentPath, read_directory_data);\n }\n\n function read_directory_data(error, result) {\n if(error) {\n callback(error);\n } else {\n directoryNode = result;\n context.getObject(directoryNode.data, check_if_file_exists);\n }\n }\n\n function check_if_file_exists(error, result) {\n if(error) {\n callback(error);\n } else {\n directoryData = result;\n if(Object.prototype.hasOwnProperty.call(directoryData, name)) {\n callback(new Errors.EEXIST(null, name));\n } else {\n write_file_node();\n }\n }\n }\n\n function write_file_node() {\n Node.create({\n guid: context.guid,\n type: NODE_TYPE_SYMBOLIC_LINK\n }, function(error, result) {\n if(error) {\n callback(error);\n return;\n }\n fileNode = result;\n fileNode.nlinks += 1;\n\n // If the srcpath isn't absolute, resolve it relative to the dstpath\n // but store both versions, since we'll use the relative one in readlink().\n if(!isAbsolutePath(srcpath)) {\n fileNode.symlink_relpath = srcpath;\n srcpath = Path.resolve(parentPath, srcpath);\n }\n\n fileNode.size = srcpath.length;\n fileNode.data = srcpath;\n\n context.putObject(fileNode.id, fileNode, update_directory_data);\n });\n }\n\n function update_time(error) {\n if(error) {\n callback(error);\n } else {\n var now = Date.now();\n update_node_times(context, parentPath, directoryNode, { mtime: now, ctime: now }, callback);\n }\n }\n\n function update_directory_data(error) {\n if(error) {\n callback(error);\n } else {\n directoryData[name] = new DirectoryEntry(fileNode.id, NODE_TYPE_SYMBOLIC_LINK);\n context.putObject(directoryNode.data, directoryData, update_time);\n }\n }\n}\n\nfunction read_link(context, path, callback) {\n path = normalize(path);\n var name = basename(path);\n var parentPath = dirname(path);\n\n var directoryNode;\n var directoryData;\n\n find_node(context, parentPath, read_directory_data);\n\n function read_directory_data(error, result) {\n if(error) {\n callback(error);\n } else {\n directoryNode = result;\n context.getObject(directoryNode.data, check_if_file_exists);\n }\n }\n\n function check_if_file_exists(error, result) {\n if(error) {\n callback(error);\n } else {\n directoryData = result;\n if(!Object.prototype.hasOwnProperty.call(directoryData, name)) {\n callback(new Errors.ENOENT('a component of the path does not name an existing file', name));\n } else {\n context.getObject(directoryData[name].id, check_if_symbolic);\n }\n }\n }\n\n function check_if_symbolic(error, fileNode) {\n if(error) {\n callback(error);\n } else {\n if(fileNode.type !== NODE_TYPE_SYMBOLIC_LINK) {\n callback(new Errors.EINVAL('path not a symbolic link', path));\n } else {\n // If we were originally given a relative path, return that now vs. the\n // absolute path we've generated and use elsewhere internally.\n var target = fileNode.symlink_relpath ? fileNode.symlink_relpath : fileNode.data;\n callback(null, target);\n }\n }\n }\n}\n\nfunction truncate_file(context, path, length, callback) {\n path = normalize(path);\n\n var fileNode;\n\n function read_file_data (error, node) {\n if (error) {\n callback(error);\n } else if(node.type === NODE_TYPE_DIRECTORY ) {\n callback(new Errors.EISDIR(null, path));\n } else{\n fileNode = node;\n context.getBuffer(fileNode.data, truncate_file_data);\n }\n }\n\n function truncate_file_data(error, fileData) {\n if (error) {\n callback(error);\n } else {\n if(!fileData) {\n return callback(new Errors.EIO('Expected Buffer'));\n }\n var data = Buffer.alloc(length);\n if(fileData) {\n fileData.copy(data);\n }\n context.putBuffer(fileNode.data, data, update_file_node);\n }\n }\n\n function update_time(error) {\n if(error) {\n callback(error);\n } else {\n var now = Date.now();\n update_node_times(context, path, fileNode, { mtime: now, ctime: now }, callback);\n }\n }\n\n function update_file_node (error) {\n if(error) {\n callback(error);\n } else {\n fileNode.size = length;\n fileNode.version += 1;\n context.putObject(fileNode.id, fileNode, update_time);\n }\n }\n\n if(length < 0) {\n callback(new Errors.EINVAL('length cannot be negative'));\n } else {\n find_node(context, path, read_file_data);\n }\n}\n\nfunction ftruncate_file(context, ofd, length, callback) {\n var fileNode;\n\n function read_file_data (error, node) {\n if (error) {\n callback(error);\n } else if(node.type === NODE_TYPE_DIRECTORY ) {\n callback(new Errors.EISDIR());\n } else{\n fileNode = node;\n context.getBuffer(fileNode.data, truncate_file_data);\n }\n }\n\n function truncate_file_data(error, fileData) {\n if (error) {\n callback(error);\n } else {\n var data;\n if(!fileData) {\n return callback(new Errors.EIO('Expected Buffer'));\n }\n if(fileData) {\n data = fileData.slice(0, length);\n } else {\n data = Buffer.alloc(length);\n }\n context.putBuffer(fileNode.data, data, update_file_node);\n }\n }\n\n function update_time(error) {\n if(error) {\n callback(error);\n } else {\n var now = Date.now();\n update_node_times(context, ofd.path, fileNode, { mtime: now, ctime: now }, callback);\n }\n }\n\n function update_file_node (error) {\n if(error) {\n callback(error);\n } else {\n fileNode.size = length;\n fileNode.version += 1;\n context.putObject(fileNode.id, fileNode, update_time);\n }\n }\n\n if(length < 0) {\n callback(new Errors.EINVAL('length cannot be negative'));\n } else {\n ofd.getNode(context, read_file_data);\n }\n}\n\nfunction utimes_file(context, path, atime, mtime, callback) {\n path = normalize(path);\n\n function update_times(error, node) {\n if (error) {\n callback(error);\n } else {\n update_node_times(context, path, node, { atime: atime, ctime: mtime, mtime: mtime }, callback);\n }\n }\n\n if (typeof atime !== 'number' || typeof mtime !== 'number') {\n callback(new Errors.EINVAL('atime and mtime must be number', path));\n }\n else if (atime < 0 || mtime < 0) {\n callback(new Errors.EINVAL('atime and mtime must be positive integers', path));\n }\n else {\n find_node(context, path, update_times);\n }\n}\n\nfunction futimes_file(context, ofd, atime, mtime, callback) {\n\n function update_times (error, node) {\n if (error) {\n callback(error);\n } else {\n update_node_times(context, ofd.path, node, { atime: atime, ctime: mtime, mtime: mtime }, callback);\n }\n }\n\n if (typeof atime !== 'number' || typeof mtime !== 'number') {\n callback(new Errors.EINVAL('atime and mtime must be a number'));\n }\n else if (atime < 0 || mtime < 0) {\n callback(new Errors.EINVAL('atime and mtime must be positive integers'));\n }\n else {\n ofd.getNode(context, update_times);\n }\n}\n\nfunction setxattr_file(context, path, name, value, flag, callback) {\n path = normalize(path);\n\n function setxattr(error, node) {\n if(error) {\n return callback(error);\n }\n set_extended_attribute(context, path, node, name, value, flag, callback);\n }\n\n if (typeof name !== 'string') {\n callback(new Errors.EINVAL('attribute name must be a string', path));\n }\n else if (!name) {\n callback(new Errors.EINVAL('attribute name cannot be an empty string', path));\n }\n else if (flag !== null &&\n flag !== XATTR_CREATE && flag !== XATTR_REPLACE) {\n callback(new Errors.EINVAL('invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE', path));\n }\n else {\n find_node(context, path, setxattr);\n }\n}\n\nfunction fsetxattr_file (context, ofd, name, value, flag, callback) {\n function setxattr(error, node) {\n if(error) {\n return callback(error);\n }\n set_extended_attribute(context, ofd.path, node, name, value, flag, callback);\n }\n\n if (typeof name !== 'string') {\n callback(new Errors.EINVAL('attribute name must be a string'));\n }\n else if (!name) {\n callback(new Errors.EINVAL('attribute name cannot be an empty string'));\n }\n else if (flag !== null &&\n flag !== XATTR_CREATE && flag !== XATTR_REPLACE) {\n callback(new Errors.EINVAL('invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE'));\n }\n else {\n ofd.getNode(context, setxattr);\n }\n}\n\nfunction getxattr_file (context, path, name, callback) {\n path = normalize(path);\n\n function get_xattr(error, node) {\n if(error) {\n return callback(error);\n }\n\n var xattrs = node.xattrs;\n\n if (!Object.prototype.hasOwnProperty.call(xattrs, name)) {\n callback(new Errors.ENOATTR(null, path));\n }\n else {\n callback(null, xattrs[name]);\n }\n }\n\n if (typeof name !== 'string') {\n callback(new Errors.EINVAL('attribute name must be a string', path));\n }\n else if (!name) {\n callback(new Errors.EINVAL('attribute name cannot be an empty string', path));\n }\n else {\n find_node(context, path, get_xattr);\n }\n}\n\nfunction fgetxattr_file (context, ofd, name, callback) {\n\n function get_xattr (error, node) {\n if (error) {\n return callback(error);\n }\n\n var xattrs = node.xattrs;\n\n if (!Object.prototype.hasOwnProperty.call(xattrs, name)) {\n callback(new Errors.ENOATTR());\n }\n else {\n callback(null, xattrs[name]);\n }\n }\n\n if (typeof name !== 'string') {\n callback(new Errors.EINVAL());\n }\n else if (!name) {\n callback(new Errors.EINVAL('attribute name cannot be an empty string'));\n }\n else {\n ofd.getNode(context, get_xattr);\n }\n}\n\nfunction removexattr_file (context, path, name, callback) {\n path = normalize(path);\n\n function remove_xattr (error, node) {\n if (error) {\n return callback(error);\n }\n\n function update_time(error) {\n if(error) {\n callback(error);\n } else {\n update_node_times(context, path, node, { ctime: Date.now() }, callback);\n }\n }\n\n var xattrs = node.xattrs;\n\n if (!Object.prototype.hasOwnProperty.call(xattrs, name)) {\n callback(new Errors.ENOATTR(null, path));\n }\n else {\n delete xattrs[name];\n context.putObject(node.id, node, update_time);\n }\n }\n\n if (typeof name !== 'string') {\n callback(new Errors.EINVAL('attribute name must be a string', path));\n }\n else if (!name) {\n callback(new Errors.EINVAL('attribute name cannot be an empty string', path));\n }\n else {\n find_node(context, path, remove_xattr);\n }\n}\n\nfunction fremovexattr_file (context, ofd, name, callback) {\n\n function remove_xattr (error, node) {\n if (error) {\n return callback(error);\n }\n\n function update_time(error) {\n if(error) {\n callback(error);\n } else {\n update_node_times(context, ofd.path, node, { ctime: Date.now() }, callback);\n }\n }\n\n var xattrs = node.xattrs;\n\n if (!Object.prototype.hasOwnProperty.call(xattrs, name)) {\n callback(new Errors.ENOATTR());\n }\n else {\n delete xattrs[name];\n context.putObject(node.id, node, update_time);\n }\n }\n\n if (typeof name !== 'string') {\n callback(new Errors.EINVAL('attribute name must be a string'));\n }\n else if (!name) {\n callback(new Errors.EINVAL('attribute name cannot be an empty string'));\n }\n else {\n ofd.getNode(context, remove_xattr);\n }\n}\n\nfunction validate_flags(flags) {\n return Object.prototype.hasOwnProperty.call(O_FLAGS, flags) ? O_FLAGS[flags] : null;\n}\n\nfunction validate_file_options(options, enc, fileMode){\n if(!options) {\n options = { encoding: enc, flag: fileMode };\n } else if(typeof options === 'function') {\n options = { encoding: enc, flag: fileMode };\n } else if(typeof options === 'string') {\n options = { encoding: options, flag: fileMode };\n }\n return options;\n}\n\nfunction open(context, path, flags, mode, callback) {\n if (arguments.length < 5 ){\n callback = arguments[arguments.length - 1];\n mode = 0o644;\n }\n else {\n mode = validateAndMaskMode(mode, FULL_READ_WRITE_EXEC_PERMISSIONS, callback);\n }\n\n function check_result(error, fileNode) {\n if(error) {\n callback(error);\n } else {\n var position;\n if(flags.includes(O_APPEND)) {\n position = fileNode.size;\n } else {\n position = 0;\n }\n var openFileDescription = new OpenFileDescription(path, fileNode.id, flags, position);\n var fd = openFiles.allocDescriptor(openFileDescription);\n callback(null, fd);\n }\n }\n\n flags = validate_flags(flags);\n if(!flags) {\n return callback(new Errors.EINVAL('flags is not valid'), path);\n }\n\n open_file(context, path, flags, mode, check_result);\n}\n\nfunction close(context, fd, callback) {\n if(!openFiles.getOpenFileDescription(fd)) {\n callback(new Errors.EBADF());\n } else {\n openFiles.releaseDescriptor(fd);\n callback(null);\n }\n}\n\nfunction mknod(context, path, type, callback) {\n make_node(context, path, type, callback);\n}\n\nfunction mkdir(context, path, mode, callback) {\n if (arguments.length < 4) {\n callback = mode;\n mode = FULL_READ_WRITE_EXEC_PERMISSIONS;\n } else {\n mode = validateAndMaskMode(mode, FULL_READ_WRITE_EXEC_PERMISSIONS, callback);\n if(!mode) return;\n }\n\n make_directory(context, path, callback);\n}\n\nfunction access(context, path, mode, callback) {\n if (typeof mode === 'function') {\n callback = mode;\n mode = Constants.fsConstants.F_OK;\n }\n\n mode = mode | Constants.fsConstants.F_OK;\n access_file(context, path, mode, callback);\n}\n\nfunction mkdtemp(context, prefix, options, callback) {\n callback = arguments[arguments.length - 1];\n if(!prefix) {\n return callback(new Error('filename prefix is required'));\n }\n\n let random = shared.randomChars(6);\n var path = prefix + '-' + random;\n\n make_directory(context, path, function(error) {\n callback(error, path);\n });\n}\n\nfunction rmdir(context, path, callback) {\n remove_directory(context, path, callback);\n}\n\nfunction stat(context, path, callback) {\n function check_result(error, result) {\n if(error) {\n callback(error);\n } else {\n var stats = new Stats(path, result, context.name);\n callback(null, stats);\n }\n }\n\n stat_file(context, path, check_result);\n}\n\nfunction fstat(context, fd, callback) {\n function check_result(error, result) {\n if(error) {\n callback(error);\n } else {\n var stats = new Stats(ofd.path, result, context.name);\n callback(null, stats);\n }\n }\n\n var ofd = openFiles.getOpenFileDescription(fd);\n if(!ofd) {\n callback(new Errors.EBADF());\n } else {\n fstat_file(context, ofd, check_result);\n }\n}\n\nfunction link(context, oldpath, newpath, callback) {\n link_node(context, oldpath, newpath, callback);\n}\n\nfunction unlink(context, path, callback) {\n unlink_node(context, path, callback);\n}\n\nfunction read(context, fd, buffer, offset, length, position, callback) {\n // Follow how node.js does this\n function wrapped_cb(err, bytesRead) {\n // Retain a reference to buffer so that it can't be GC'ed too soon.\n callback(err, bytesRead || 0, buffer);\n }\n\n offset = (undefined === offset) ? 0 : offset;\n length = (undefined === length) ? buffer.length - offset : length;\n callback = arguments[arguments.length - 1];\n\n var ofd = openFiles.getOpenFileDescription(fd);\n if(!ofd) {\n callback(new Errors.EBADF());\n } else if(!ofd.flags.includes(O_READ)) {\n callback(new Errors.EBADF('descriptor does not permit reading'));\n } else {\n read_data(context, ofd, buffer, offset, length, position, wrapped_cb);\n }\n}\n\nfunction fsync(context, fd, callback) {\n if(validateInteger(fd, callback) !== fd) return;\n var ofd = openFiles.getOpenFileDescription(fd);\n if(!ofd) {\n callback(new Errors.EBADF());\n } else {\n callback();\n }\n}\n\nfunction readFile(context, path, options, callback) {\n callback = arguments[arguments.length - 1];\n options = validate_file_options(options, null, 'r');\n\n var flags = validate_flags(options.flag || 'r');\n if(!flags) {\n return callback(new Errors.EINVAL('flags is not valid', path));\n }\n\n open_file(context, path, flags, function(err, fileNode) {\n if(err) {\n return callback(err);\n }\n var ofd = new OpenFileDescription(path, fileNode.id, flags, 0);\n var fd = openFiles.allocDescriptor(ofd);\n\n function cleanup() {\n openFiles.releaseDescriptor(fd);\n }\n\n fstat_file(context, ofd, function(err, fstatResult) {\n if(err) {\n cleanup();\n return callback(err);\n }\n\n var stats = new Stats(ofd.path, fstatResult, context.name);\n\n if(stats.isDirectory()) {\n cleanup();\n return callback(new Errors.EISDIR('illegal operation on directory', path));\n }\n\n var size = stats.size;\n var buffer = Buffer.alloc(size);\n\n read_data(context, ofd, buffer, 0, size, 0, function(err) {\n cleanup();\n\n if(err) {\n return callback(err);\n }\n\n var data;\n if(options.encoding === 'utf8') {\n data = buffer.toString('utf8');\n } else {\n data = buffer;\n }\n callback(null, data);\n });\n });\n });\n}\n\nfunction write(context, fd, buffer, offset, length, position, callback) {\n callback = arguments[arguments.length - 1];\n offset = (undefined === offset) ? 0 : offset;\n length = (undefined === length) ? buffer.length - offset : length;\n\n var ofd = openFiles.getOpenFileDescription(fd);\n if(!ofd) {\n callback(new Errors.EBADF());\n } else if(!ofd.flags.includes(O_WRITE)) {\n callback(new Errors.EBADF('descriptor does not permit writing'));\n } else if(buffer.length - offset < length) {\n callback(new Errors.EIO('input buffer is too small'));\n } else {\n write_data(context, ofd, buffer, offset, length, position, callback);\n }\n}\n\nfunction writeFile(context, path, data, options, callback) {\n callback = arguments[arguments.length - 1];\n options = validate_file_options(options, 'utf8', 'w');\n\n var flags = validate_flags(options.flag || 'w');\n if(!flags) {\n return callback(new Errors.EINVAL('flags is not valid', path));\n }\n\n if(!Buffer.isBuffer(data)) {\n if(typeof data === 'number') {\n data = '' + data;\n }\n data = data || '';\n if(typeof data !== 'string') {\n data = Buffer.from(data.toString());\n }\n else {\n data = Buffer.from(data || '', options.encoding || 'utf8');\n }\n }\n\n open_file(context, path, flags, function(err, fileNode) {\n if(err) {\n return callback(err);\n }\n var ofd = new OpenFileDescription(path, fileNode.id, flags, 0);\n var fd = openFiles.allocDescriptor(ofd);\n\n replace_data(context, ofd, data, 0, data.length, function(err) {\n openFiles.releaseDescriptor(fd);\n\n if(err) {\n return callback(err);\n }\n callback(null);\n });\n });\n}\n\nfunction appendFile(context, path, data, options, callback) {\n callback = arguments[arguments.length - 1];\n options = validate_file_options(options, 'utf8', 'a');\n\n var flags = validate_flags(options.flag || 'a');\n if(!flags) {\n return callback(new Errors.EINVAL('flags is not valid', path));\n }\n\n data = data || '';\n if(typeof data === 'number') {\n data = '' + data;\n }\n if(typeof data === 'string' && options.encoding === 'utf8') {\n data = Buffer.from(data);\n }\n\n open_file(context, path, flags, function(err, fileNode) {\n if(err) {\n return callback(err);\n }\n var ofd = new OpenFileDescription(path, fileNode.id, flags, fileNode.size);\n var fd = openFiles.allocDescriptor(ofd);\n\n write_data(context, ofd, data, 0, data.length, ofd.position, function(err) {\n openFiles.releaseDescriptor(fd);\n\n if(err) {\n return callback(err);\n }\n callback(null);\n });\n });\n}\n\nfunction exists(context, path, callback) {\n function cb(err) {\n callback(err ? false : true);\n }\n stat(context, path, cb);\n}\n\nfunction validateInteger(value, callback) {\n if (typeof value !== 'number') {\n callback(new Errors.EINVAL('Expected integer', value));\n return;\n }\n\n return value;\n}\n\n// Based on https://github.com/nodejs/node/blob/c700cc42da9cf73af9fec2098520a6c0a631d901/lib/internal/validators.js#L21\nvar octalReg = /^[0-7]+$/;\nfunction isUint32(value) {\n return value === (value >>> 0);\n}\n// Validator for mode_t (the S_* constants). Valid numbers or octal strings\n// will be masked with 0o777 to be consistent with the behavior in POSIX APIs.\nfunction validateAndMaskMode(value, def, callback) {\n if(typeof def === 'function') {\n callback = def;\n def = undefined;\n }\n\n if (isUint32(value)) {\n return value & FULL_READ_WRITE_EXEC_PERMISSIONS;\n }\n\n if (typeof value === 'number') {\n if (!Number.isInteger(value)) {\n callback(new Errors.EINVAL('mode not a valid an integer value', value));\n return false;\n } else {\n // 2 ** 32 === 4294967296\n callback(new Errors.EINVAL('mode not a valid an integer value', value));\n return false;\n }\n }\n\n if (typeof value === 'string') {\n if (!octalReg.test(value)) {\n callback(new Errors.EINVAL('mode not a valid octal string', value));\n return false;\n }\n var parsed = parseInt(value, 8);\n return parsed & FULL_READ_WRITE_EXEC_PERMISSIONS;\n }\n\n // TODO(BridgeAR): Only return `def` in case `value === null`\n if (def !== undefined) {\n return def;\n }\n\n callback(new Errors.EINVAL('mode not valid', value));\n return false;\n}\n\nfunction chmod_file(context, path, mode, callback) {\n path = normalize(path);\n\n function update_mode(error, node) {\n if (error) {\n callback(error);\n } else {\n node.mode = mode;\n update_node_times(context, path, node, { mtime: Date.now() }, callback);\n }\n }\n\n if (typeof mode !== 'number') {\n callback(new Errors.EINVAL('mode must be number', path));\n }\n else {\n find_node(context, path, update_mode);\n }\n}\n\nfunction fchmod_file(context, ofd, mode, callback) {\n function update_mode(error, node) {\n if (error) {\n callback(error);\n } else {\n node.mode = mode;\n update_node_times(context, ofd.path, node, { mtime: Date.now() }, callback);\n }\n }\n\n if (typeof mode !== 'number') {\n callback(new Errors.EINVAL('mode must be a number'));\n }\n else {\n ofd.getNode(context, update_mode);\n }\n}\n\nfunction chown_file(context, path, uid, gid, callback) {\n path = normalize(path);\n\n function update_owner(error, node) {\n if (error) {\n callback(error);\n } else {\n node.uid = uid;\n node.gid = gid;\n update_node_times(context, path, node, { mtime: Date.now() }, callback);\n }\n }\n\n find_node(context, path, update_owner);\n}\n\nfunction fchown_file(context, ofd, uid, gid, callback) {\n function update_owner(error, node) {\n if (error) {\n callback(error);\n } else {\n node.uid = uid;\n node.gid = gid;\n update_node_times(context, ofd.path, node, { mtime: Date.now() }, callback);\n }\n }\n\n ofd.getNode(context, update_owner);\n}\n\nfunction getxattr(context, path, name, callback) {\n getxattr_file(context, path, name, callback);\n}\n\nfunction fgetxattr(context, fd, name, callback) {\n var ofd = openFiles.getOpenFileDescription(fd);\n if (!ofd) {\n callback(new Errors.EBADF());\n }\n else {\n fgetxattr_file(context, ofd, name, callback);\n }\n}\n\nfunction setxattr(context, path, name, value, flag, callback) {\n if(typeof flag === 'function') {\n callback = flag;\n flag = null;\n }\n\n setxattr_file(context, path, name, value, flag, callback);\n}\n\nfunction fsetxattr(context, fd, name, value, flag, callback) {\n if(typeof flag === 'function') {\n callback = flag;\n flag = null;\n }\n\n var ofd = openFiles.getOpenFileDescription(fd);\n if (!ofd) {\n callback(new Errors.EBADF());\n }\n else if (!ofd.flags.includes(O_WRITE)) {\n callback(new Errors.EBADF('descriptor does not permit writing'));\n }\n else {\n fsetxattr_file(context, ofd, name, value, flag, callback);\n }\n}\n\nfunction removexattr(context, path, name, callback) {\n removexattr_file(context, path, name, callback);\n}\n\nfunction fremovexattr(context, fd, name, callback) {\n var ofd = openFiles.getOpenFileDescription(fd);\n if (!ofd) {\n callback(new Errors.EBADF());\n }\n else if (!ofd.flags.includes(O_WRITE)) {\n callback(new Errors.EBADF('descriptor does not permit writing'));\n }\n else {\n fremovexattr_file(context, ofd, name, callback);\n }\n}\n\nfunction lseek(context, fd, offset, whence, callback) {\n function update_descriptor_position(error, stats) {\n if(error) {\n callback(error);\n } else {\n if(stats.size + offset < 0) {\n callback(new Errors.EINVAL('resulting file offset would be negative'));\n } else {\n ofd.position = stats.size + offset;\n callback(null, ofd.position);\n }\n }\n }\n\n var ofd = openFiles.getOpenFileDescription(fd);\n if(!ofd) {\n callback(new Errors.EBADF());\n }\n\n if('SET' === whence) {\n if(offset < 0) {\n callback(new Errors.EINVAL('resulting file offset would be negative'));\n } else {\n ofd.position = offset;\n callback(null, ofd.position);\n }\n } else if('CUR' === whence) {\n if(ofd.position + offset < 0) {\n callback(new Errors.EINVAL('resulting file offset would be negative'));\n } else {\n ofd.position += offset;\n callback(null, ofd.position);\n }\n } else if('END' === whence) {\n fstat_file(context, ofd, update_descriptor_position);\n } else {\n callback(new Errors.EINVAL('whence argument is not a proper value'));\n }\n}\n\nfunction readdir(context, path, options, callback) {\n read_directory(context, path, options, callback);\n}\n\nfunction toUnixTimestamp(time) {\n if (typeof time === 'number') {\n return time;\n }\n if (typeof time === 'object' && typeof time.getTime === 'function') {\n return time.getTime();\n }\n}\n\nfunction utimes(context, path, atime, mtime, callback) {\n var currentTime = Date.now();\n atime = (atime) ? toUnixTimestamp(atime) : toUnixTimestamp(currentTime);\n mtime = (mtime) ? toUnixTimestamp(mtime) : toUnixTimestamp(currentTime);\n\n utimes_file(context, path, atime, mtime, callback);\n}\n\nfunction futimes(context, fd, atime, mtime, callback) {\n var currentTime = Date.now();\n atime = (atime) ? toUnixTimestamp(atime) : toUnixTimestamp(currentTime);\n mtime = (mtime) ? toUnixTimestamp(mtime) : toUnixTimestamp(currentTime);\n\n var ofd = openFiles.getOpenFileDescription(fd);\n if(!ofd) {\n callback(new Errors.EBADF());\n } else if(!ofd.flags.includes(O_WRITE)) {\n callback(new Errors.EBADF('descriptor does not permit writing'));\n } else {\n futimes_file(context, ofd, atime, mtime, callback);\n }\n}\n\nfunction chmod(context, path, mode, callback) {\n mode = validateAndMaskMode(mode, callback);\n if(!mode) return;\n\n chmod_file(context, path, mode, callback);\n}\n\nfunction fchmod(context, fd, mode, callback) {\n mode = validateAndMaskMode(mode, callback);\n if(!mode) return;\n\n var ofd = openFiles.getOpenFileDescription(fd);\n if(!ofd) {\n callback(new Errors.EBADF());\n } else if(!ofd.flags.includes(O_WRITE)) {\n callback(new Errors.EBADF('descriptor does not permit writing'));\n } else {\n fchmod_file(context, ofd, mode, callback);\n }\n}\n\nfunction chown(context, path, uid, gid, callback) {\n if(!isUint32(uid)) {\n return callback(new Errors.EINVAL('uid must be a valid integer', uid));\n }\n if(!isUint32(gid)) {\n return callback(new Errors.EINVAL('gid must be a valid integer', gid));\n }\n\n chown_file(context, path, uid, gid, callback);\n}\n\nfunction fchown(context, fd, uid, gid, callback) {\n if(!isUint32(uid)) {\n return callback(new Errors.EINVAL('uid must be a valid integer', uid));\n }\n if(!isUint32(gid)) {\n return callback(new Errors.EINVAL('gid must be a valid integer', gid));\n }\n\n var ofd = openFiles.getOpenFileDescription(fd);\n if(!ofd) {\n callback(new Errors.EBADF());\n } else if(!ofd.flags.includes(O_WRITE)) {\n callback(new Errors.EBADF('descriptor does not permit writing'));\n } else {\n fchown_file(context, ofd, uid, gid, callback);\n }\n}\n\nfunction rename(context, oldpath, newpath, callback) {\n oldpath = normalize(oldpath);\n newpath = normalize(newpath);\n\n var oldParentPath = Path.dirname(oldpath);\n var newParentPath = Path.dirname(newpath);\n var oldName = Path.basename(oldpath);\n var newName = Path.basename(newpath);\n var oldParentDirectory, oldParentData;\n var newParentDirectory, newParentData;\n var ctime = Date.now();\n var fileNode;\n\n function update_times(error, result) {\n if(error) {\n callback(error);\n } else {\n fileNode = result;\n update_node_times(context, newpath, fileNode, { ctime: ctime }, callback);\n }\n }\n\n function read_new_directory(error) {\n if(error) {\n callback(error);\n } else {\n context.getObject(newParentData[newName].id, update_times);\n }\n }\n\n function update_old_parent_directory_data(error) {\n if(error) {\n callback(error);\n } else {\n if(oldParentDirectory.id === newParentDirectory.id) {\n oldParentData = newParentData;\n }\n delete oldParentData[oldName];\n context.putObject(oldParentDirectory.data, oldParentData, read_new_directory);\n }\n }\n\n function update_new_parent_directory_data(error) {\n if(error) {\n callback(error);\n } else {\n newParentData[newName] = oldParentData[oldName];\n context.putObject(newParentDirectory.data, newParentData, update_old_parent_directory_data);\n }\n }\n\n function check_if_new_directory_exists(error, result) {\n if(error) {\n callback(error);\n } else {\n newParentData = result;\n if(Object.prototype.hasOwnProperty.call(newParentData, newName)) {\n remove_directory(context, newpath, update_new_parent_directory_data);\n } else {\n update_new_parent_directory_data();\n }\n }\n }\n\n function read_new_parent_directory_data(error, result) {\n if(error) {\n callback(error);\n } else {\n newParentDirectory = result;\n context.getObject(newParentDirectory.data, check_if_new_directory_exists);\n }\n }\n\n function get_new_parent_directory(error, result) {\n if(error) {\n callback(error);\n } else {\n oldParentData = result;\n find_node(context, newParentPath, read_new_parent_directory_data);\n }\n }\n\n function read_parent_directory_data(error, result) {\n if(error) {\n callback(error);\n } else {\n oldParentDirectory = result;\n context.getObject(result.data, get_new_parent_directory);\n }\n }\n\n function unlink_old_file(error) {\n if(error) {\n callback(error);\n } else {\n unlink_node(context, oldpath, callback);\n }\n }\n\n function check_node_type(error, node) {\n if(error) {\n callback(error);\n } else if(node.type === NODE_TYPE_DIRECTORY) {\n find_node(context, oldParentPath, read_parent_directory_data);\n } else {\n link_node(context, oldpath, newpath, unlink_old_file);\n }\n }\n\n find_node(context, oldpath, check_node_type);\n}\n\nfunction symlink(context, srcpath, dstpath, type, callback) {\n // NOTE: we support passing the `type` arg, but ignore it.\n callback = arguments[arguments.length - 1];\n make_symbolic_link(context, srcpath, dstpath, callback);\n}\n\nfunction readlink(context, path, callback) {\n read_link(context, path, callback);\n}\n\nfunction lstat(context, path, callback) {\n function check_result(error, result) {\n if(error) {\n callback(error);\n } else {\n var stats = new Stats(path, result, context.name);\n callback(null, stats);\n }\n }\n\n lstat_file(context, path, check_result);\n}\n\nfunction truncate(context, path, length, callback) {\n // NOTE: length is optional\n callback = arguments[arguments.length - 1];\n length = length || 0;\n\n if(validateInteger(length, callback) !== length) return;\n\n truncate_file(context, path, length, callback);\n}\n\nfunction ftruncate(context, fd, length, callback) {\n // NOTE: length is optional\n callback = arguments[arguments.length - 1];\n length = length || 0;\n\n var ofd = openFiles.getOpenFileDescription(fd);\n if(!ofd) {\n callback(new Errors.EBADF());\n } else if(!ofd.flags.includes(O_WRITE)) {\n callback(new Errors.EBADF('descriptor does not permit writing'));\n } else {\n if(validateInteger(length, callback) !== length) return;\n ftruncate_file(context, ofd, length, callback);\n }\n}\n\nmodule.exports = {\n appendFile,\n access,\n chown,\n chmod,\n close,\n // copyFile - https://github.com/filerjs/filer/issues/436\n ensureRootDirectory: ensure_root_directory,\n exists,\n fchown,\n fchmod,\n // fdatasync - https://github.com/filerjs/filer/issues/653\n fgetxattr,\n fremovexattr,\n fsetxattr,\n fstat,\n fsync,\n ftruncate,\n futimes,\n getxattr,\n // lchown - https://github.com/filerjs/filer/issues/620\n // lchmod - https://github.com/filerjs/filer/issues/619\n link,\n lseek,\n lstat,\n mkdir,\n mkdtemp,\n mknod,\n open,\n readdir,\n read,\n readFile,\n readlink,\n // realpath - https://github.com/filerjs/filer/issues/85\n removexattr,\n rename,\n rmdir,\n setxattr,\n stat,\n symlink,\n truncate,\n // unwatchFile - implemented in interface.js\n unlink,\n utimes,\n // watch - implemented in interface.js\n // watchFile - implemented in interface.js\n writeFile,\n write\n};\n","'use strict';\n\nconst { promisify } = require('es6-promisify');\n\nconst Path = require('../path.js');\n\nconst providers = require('../providers/index.js');\n\nconst Shell = require('../shell/shell.js');\nconst Intercom = require('../../lib/intercom.js');\nconst FSWatcher = require('../fs-watcher.js');\nconst Errors = require('../errors.js');\nconst {\n nop,\n guid: defaultGuidFn\n} = require('../shared.js');\n\nconst {\n fsConstants,\n FILE_SYSTEM_NAME,\n FS_FORMAT,\n FS_READY,\n FS_PENDING,\n FS_ERROR,\n FS_NODUPEIDCHECK,\n STDIN,\n STDOUT,\n STDERR\n} = require('../constants.js');\n\n// The core fs operations live on impl\nconst impl = require('./implementation.js');\n\n// node.js supports a calling pattern that leaves off a callback.\nfunction maybeCallback(callback) {\n if (typeof callback === 'function') {\n return callback;\n }\n return function (err) {\n if (err) {\n throw err;\n }\n };\n}\n\n// Default callback that logs an error if passed in\nfunction defaultCallback(err) {\n if (err) {\n /* eslint no-console: 0 */\n console.error('Filer error: ', err);\n }\n}\n// Get a path (String) from a file:// URL. Support URL() like objects\n// https://github.com/nodejs/node/blob/968e901aff38a343b1de4addebf79fd8fa991c59/lib/internal/url.js#L1381\nfunction toPathIfFileURL(fileURLOrPath) {\n if (!(fileURLOrPath &&\n fileURLOrPath.protocol &&\n fileURLOrPath.pathname)) {\n return fileURLOrPath;\n }\n\n if (fileURLOrPath.protocol !== 'file:') {\n throw new Errors.EINVAL('only file: URLs are supported for paths', fileURLOrPath);\n }\n\n const pathname = fileURLOrPath.pathname;\n for (let n = 0; n < pathname.length; n++) {\n if (pathname[n] === '%') {\n const third = pathname.codePointAt(n + 2) | 0x20;\n if (pathname[n + 1] === '2' && third === 102) {\n throw new Errors.EINVAL('file: URLs must not include encoded / characters', fileURLOrPath);\n }\n }\n }\n\n return decodeURIComponent(pathname);\n}\n\n// Allow Buffers for paths. Assumes we want UTF8.\nfunction toPathIfBuffer(bufferOrPath) {\n return Buffer.isBuffer(bufferOrPath) ? bufferOrPath.toString() : bufferOrPath;\n}\n\nfunction validatePath(path, allowRelative) {\n if (!path) {\n return new Errors.EINVAL('Path must be a string', path);\n } else if (Path.isNull(path)) {\n return new Errors.EINVAL('Path must be a string without null bytes.', path);\n } else if (!allowRelative && !Path.isAbsolute(path)) {\n return new Errors.EINVAL('Path must be absolute.', path);\n }\n}\n\nfunction processPathArg(args, idx, allowRelative) {\n let path = args[idx];\n path = toPathIfFileURL(path);\n path = toPathIfBuffer(path);\n\n // Some methods specifically allow for rel paths (eg symlink with srcPath)\n let err = validatePath(path, allowRelative);\n if (err) {\n throw err;\n }\n\n // Overwrite path arg with converted and validated path\n args[idx] = path;\n}\n\n/**\n * FileSystem\n *\n * A FileSystem takes an `options` object, which can specify a number of,\n * options. All options are optional, and include:\n *\n * name: the name of the file system, defaults to \"local\"\n *\n * flags: one or more flags to use when creating/opening the file system.\n * For example: \"FORMAT\" will cause the file system to be formatted.\n * No explicit flags are set by default.\n *\n * provider: an explicit storage provider to use for the file\n * system's database context provider. A number of context\n * providers are included (see /src/providers), and users\n * can write one of their own and pass it in to be used.\n * By default an IndexedDB provider is used.\n *\n * guid: a function for generating unique IDs for nodes in the filesystem.\n * Use this to override the built-in UUID generation. (Used mainly for tests).\n *\n * callback: a callback function to be executed when the file system becomes\n * ready for use. Depending on the context provider used, this might\n * be right away, or could take some time. The callback should expect\n * an `error` argument, which will be null if everything worked. Also\n * users should check the file system's `readyState` and `error`\n * properties to make sure it is usable.\n */\nfunction FileSystem(options, callback) {\n options = options || {};\n callback = callback || defaultCallback;\n\n const flags = options.flags || [];\n const guid = options.guid ? options.guid : defaultGuidFn;\n const provider = options.provider || new providers.Default(options.name || FILE_SYSTEM_NAME);\n // If we're given a provider, match its name unless we get an explicit name\n const name = options.name || provider.name;\n const forceFormatting = flags.includes(FS_FORMAT);\n\n const fs = this;\n fs.readyState = FS_PENDING;\n fs.name = name;\n fs.error = null;\n\n fs.stdin = STDIN;\n fs.stdout = STDOUT;\n fs.stderr = STDERR;\n\n // Expose Node's fs.constants to users\n fs.constants = fsConstants;\n // Node also forwards the access mode flags onto fs\n fs.F_OK = fsConstants.F_OK;\n fs.R_OK = fsConstants.R_OK;\n fs.W_OK = fsConstants.W_OK;\n fs.X_OK = fsConstants.X_OK;\n\n // Expose Shell constructor\n this.Shell = Shell.bind(undefined, this);\n\n // Safely expose the operation queue\n let queue = [];\n this.queueOrRun = function (operation) {\n let error;\n\n if (FS_READY === fs.readyState) {\n operation.call(fs);\n } else if (FS_ERROR === fs.readyState) {\n error = new Errors.EFILESYSTEMERROR('unknown error');\n } else {\n queue.push(operation);\n }\n\n return error;\n };\n function runQueued() {\n queue.forEach(function (operation) {\n operation.call(this);\n }.bind(fs));\n queue = null;\n }\n\n // We support the optional `options` arg from node, but ignore it\n this.watch = function (filename, options, listener) {\n if (Path.isNull(filename)) {\n throw new Error('Path must be a string without null bytes.');\n }\n if (typeof options === 'function') {\n listener = options;\n options = {};\n }\n options = options || {};\n listener = listener || nop;\n\n const watcher = new FSWatcher();\n watcher.start(filename, false, options.recursive);\n watcher.on('change', listener);\n\n return watcher;\n };\n\n // Deal with various approaches to node ID creation\n function wrappedGuidFn(context) {\n return function (callback) {\n // Skip the duplicate ID check if asked to\n if (flags.includes(FS_NODUPEIDCHECK)) {\n callback(null, guid());\n return;\n }\n\n // Otherwise (default) make sure this id is unused first\n function guidWithCheck(callback) {\n const id = guid();\n context.getObject(id, function (err, value) {\n if (err) {\n callback(err);\n return;\n }\n\n // If this id is unused, use it, otherwise find another\n if (!value) {\n callback(null, id);\n } else {\n guidWithCheck(callback);\n }\n });\n }\n guidWithCheck(callback);\n };\n }\n\n // Let other instances (in this or other windows) know about\n // any changes to this fs instance.\n function broadcastChanges(changes) {\n if (!changes.length) {\n return;\n }\n const intercom = Intercom.getInstance();\n changes.forEach(function (change) {\n intercom.emit(change.event, change.path);\n });\n }\n\n // Open file system storage provider\n provider.open(function (err) {\n function complete(error) {\n function wrappedContext(methodName) {\n let context = provider[methodName]();\n context.name = name;\n context.flags = flags;\n context.changes = [];\n context.guid = wrappedGuidFn(context);\n\n // When the context is finished, let the fs deal with any change events\n context.close = function () {\n let changes = context.changes;\n broadcastChanges(changes);\n changes.length = 0;\n };\n\n return context;\n }\n\n // Wrap the provider so we can extend the context with fs flags and\n // an array of changes (e.g., watch event 'change' and 'rename' events\n // for paths updated during the lifetime of the context). From this\n // point forward we won't call open again, so it's safe to drop it.\n fs.provider = {\n openReadWriteContext: function () {\n return wrappedContext('getReadWriteContext');\n },\n openReadOnlyContext: function () {\n return wrappedContext('getReadOnlyContext');\n }\n };\n\n if (error) {\n fs.readyState = FS_ERROR;\n } else {\n fs.readyState = FS_READY;\n }\n runQueued();\n callback(error, fs);\n }\n\n if (err) {\n return complete(err);\n }\n\n const context = provider.getReadWriteContext();\n context.guid = wrappedGuidFn(context);\n\n // Mount the filesystem, formatting if necessary\n if (forceFormatting) {\n // Wipe the storage provider, then write root block\n context.clear(function (err) {\n if (err) {\n return complete(err);\n }\n impl.ensureRootDirectory(context, complete);\n });\n } else {\n // Use existing (or create new) root and mount\n impl.ensureRootDirectory(context, complete);\n }\n });\n FileSystem.prototype.promises = {};\n\n /**\n * Public API for FileSystem. All node.js methods that are exposed on fs.promises\n * include `promise: true`. We also include our own extra methods, but skip the\n * fd versions to match node.js, which puts these on a `FileHandle` object.\n * Any method that deals with path argument(s) also includes the position of\n * those args in one of `absPathArgs: [...]` or `relPathArgs: [...]`, so they\n * can be processed and validated before being passed on to the method.\n */\n [\n { name: 'appendFile', promises: true, absPathArgs: [0] },\n { name: 'access', promises: true, absPathArgs: [0] },\n { name: 'chown', promises: true, absPathArgs: [0] },\n { name: 'chmod', promises: true, absPathArgs: [0] },\n { name: 'close' },\n // copyFile - https://github.com/filerjs/filer/issues/436\n { name: 'exists', absPathArgs: [0] },\n { name: 'fchown' },\n { name: 'fchmod' },\n // fdatasync - https://github.com/filerjs/filer/issues/653\n { name: 'fgetxattr' },\n { name: 'fremovexattr' },\n { name: 'fsetxattr' },\n { name: 'fstat' },\n { name: 'fsync' },\n { name: 'ftruncate' },\n { name: 'futimes' },\n { name: 'getxattr', promises: true, absPathArgs: [0] },\n // lchown - https://github.com/filerjs/filer/issues/620\n // lchmod - https://github.com/filerjs/filer/issues/619\n { name: 'link', promises: true, absPathArgs: [0, 1] },\n { name: 'lseek' },\n { name: 'lstat', promises: true },\n { name: 'mkdir', promises: true, absPathArgs: [0] },\n { name: 'mkdtemp', promises: true },\n { name: 'mknod', promises: true, absPathArgs: [0] },\n { name: 'open', promises: true, absPathArgs: [0] },\n { name: 'readdir', promises: true, absPathArgs: [0] },\n { name: 'read' },\n { name: 'readFile', promises: true, absPathArgs: [0] },\n { name: 'readlink', promises: true, absPathArgs: [0] },\n // realpath - https://github.com/filerjs/filer/issues/85\n { name: 'removexattr', promises: true, absPathArgs: [0] },\n { name: 'rename', promises: true, absPathArgs: [0, 1] },\n { name: 'rmdir', promises: true, absPathArgs: [0] },\n { name: 'setxattr', promises: true, absPathArgs: [0] },\n { name: 'stat', promises: true, absPathArgs: [0] },\n { name: 'symlink', promises: true, relPathArgs: [0], absPathArgs: [1] },\n { name: 'truncate', promises: true, absPathArgs: [0] },\n // unwatchFile - https://github.com/filerjs/filer/pull/553\n { name: 'unlink', promises: true, absPathArgs: [0] },\n { name: 'utimes', promises: true, absPathArgs: [0] },\n // watch - implemented above in `this.watch`\n // watchFile - https://github.com/filerjs/filer/issues/654\n { name: 'writeFile', promises: true, absPathArgs: [0] },\n { name: 'write' }\n ].forEach(function (method) {\n const methodName = method.name;\n const shouldPromisify = method.promises === true;\n\n FileSystem.prototype[methodName] = function () {\n const fs = this;\n const args = Array.prototype.slice.call(arguments, 0);\n const lastArgIndex = args.length - 1;\n\n // We may or may not get a callback, and since node.js supports\n // fire-and-forget style fs operations, we have to dance a bit here.\n const missingCallback = typeof args[lastArgIndex] !== 'function';\n const callback = maybeCallback(args[lastArgIndex]);\n\n // Deal with path arguments, validating and normalizing Buffer and file:// URLs\n if (method.absPathArgs) {\n method.absPathArgs.forEach(pathArg => processPathArg(args, pathArg, false));\n }\n if (method.relPathArgs) {\n method.relPathArgs.forEach(pathArg => processPathArg(args, pathArg, true));\n }\n\n const error = fs.queueOrRun(function () {\n const context = fs.provider.openReadWriteContext();\n\n // Fail early if the filesystem is in an error state (e.g.,\n // provider failed to open.\n if (FS_ERROR === fs.readyState) {\n const err = new Errors.EFILESYSTEMERROR('filesystem unavailable, operation canceled');\n return callback.call(fs, err);\n }\n\n // Wrap the callback so we can explicitly close the context\n function complete() {\n context.close();\n callback.apply(fs, arguments);\n }\n\n // Either add or replace the callback with our wrapper complete()\n if (missingCallback) {\n args.push(complete);\n } else {\n args[lastArgIndex] = complete;\n }\n\n // Forward this call to the impl's version, using the following\n // call signature, with complete() as the callback/last-arg now:\n // fn(fs, context, arg0, arg1, ... , complete);\n const fnArgs = [context].concat(args);\n impl[methodName].apply(null, fnArgs);\n });\n if (error) {\n callback(error);\n }\n };\n\n // Add to fs.promises if appropriate\n if (shouldPromisify) {\n FileSystem.prototype.promises[methodName] = promisify(FileSystem.prototype[methodName].bind(fs));\n }\n });\n\n}\n\n// Expose storage providers on FileSystem constructor\nFileSystem.providers = providers;\n\nmodule.exports = FileSystem;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\n/** @typedef {import(\"ajv\").Ajv} Ajv */\n\n/** @typedef {import(\"ajv\").ValidateFunction} ValidateFunction */\n\n/** @typedef {import(\"../validate\").SchemaUtilErrorObject} SchemaUtilErrorObject */\n\n/**\n * @param {string} message\n * @param {object} schema\n * @param {string} data\n * @returns {SchemaUtilErrorObject}\n */\nfunction errorMessage(message, schema, data) {\n return {\n // @ts-ignore\n // eslint-disable-next-line no-undefined\n dataPath: undefined,\n // @ts-ignore\n // eslint-disable-next-line no-undefined\n schemaPath: undefined,\n keyword: \"absolutePath\",\n params: {\n absolutePath: data\n },\n message,\n parentSchema: schema\n };\n}\n/**\n * @param {boolean} shouldBeAbsolute\n * @param {object} schema\n * @param {string} data\n * @returns {SchemaUtilErrorObject}\n */\n\n\nfunction getErrorFor(shouldBeAbsolute, schema, data) {\n const message = shouldBeAbsolute ? `The provided value ${JSON.stringify(data)} is not an absolute path!` : `A relative path is expected. However, the provided value ${JSON.stringify(data)} is an absolute path!`;\n return errorMessage(message, schema, data);\n}\n/**\n *\n * @param {Ajv} ajv\n * @returns {Ajv}\n */\n\n\nfunction addAbsolutePathKeyword(ajv) {\n ajv.addKeyword(\"absolutePath\", {\n errors: true,\n type: \"string\",\n\n compile(schema, parentSchema) {\n /** @type {ValidateFunction} */\n const callback = data => {\n let passes = true;\n const isExclamationMarkPresent = data.includes(\"!\");\n\n if (isExclamationMarkPresent) {\n callback.errors = [errorMessage(`The provided value ${JSON.stringify(data)} contains exclamation mark (!) which is not allowed because it's reserved for loader syntax.`, parentSchema, data)];\n passes = false;\n } // ?:[A-Za-z]:\\\\ - Windows absolute path\n // \\\\\\\\ - Windows network absolute path\n // \\/ - Unix-like OS absolute path\n\n\n const isCorrectAbsolutePath = schema === /^(?:[A-Za-z]:(\\\\|\\/)|\\\\\\\\|\\/)/.test(data);\n\n if (!isCorrectAbsolutePath) {\n callback.errors = [getErrorFor(schema, parentSchema, data)];\n passes = false;\n }\n\n return passes;\n };\n\n callback.errors = [];\n return callback;\n }\n\n });\n return ajv;\n}\n\nvar _default = addAbsolutePathKeyword;\nexports.default = _default;","\"use strict\";\n\n/**\n * @typedef {[number, boolean]} RangeValue\n */\n\n/**\n * @callback RangeValueCallback\n * @param {RangeValue} rangeValue\n * @returns {boolean}\n */\nclass Range {\n /**\n * @param {\"left\" | \"right\"} side\n * @param {boolean} exclusive\n * @returns {\">\" | \">=\" | \"<\" | \"<=\"}\n */\n static getOperator(side, exclusive) {\n if (side === \"left\") {\n return exclusive ? \">\" : \">=\";\n }\n\n return exclusive ? \"<\" : \"<=\";\n }\n /**\n * @param {number} value\n * @param {boolean} logic is not logic applied\n * @param {boolean} exclusive is range exclusive\n * @returns {string}\n */\n\n\n static formatRight(value, logic, exclusive) {\n if (logic === false) {\n return Range.formatLeft(value, !logic, !exclusive);\n }\n\n return `should be ${Range.getOperator(\"right\", exclusive)} ${value}`;\n }\n /**\n * @param {number} value\n * @param {boolean} logic is not logic applied\n * @param {boolean} exclusive is range exclusive\n * @returns {string}\n */\n\n\n static formatLeft(value, logic, exclusive) {\n if (logic === false) {\n return Range.formatRight(value, !logic, !exclusive);\n }\n\n return `should be ${Range.getOperator(\"left\", exclusive)} ${value}`;\n }\n /**\n * @param {number} start left side value\n * @param {number} end right side value\n * @param {boolean} startExclusive is range exclusive from left side\n * @param {boolean} endExclusive is range exclusive from right side\n * @param {boolean} logic is not logic applied\n * @returns {string}\n */\n\n\n static formatRange(start, end, startExclusive, endExclusive, logic) {\n let result = \"should be\";\n result += ` ${Range.getOperator(logic ? \"left\" : \"right\", logic ? startExclusive : !startExclusive)} ${start} `;\n result += logic ? \"and\" : \"or\";\n result += ` ${Range.getOperator(logic ? \"right\" : \"left\", logic ? endExclusive : !endExclusive)} ${end}`;\n return result;\n }\n /**\n * @param {Array<RangeValue>} values\n * @param {boolean} logic is not logic applied\n * @return {RangeValue} computed value and it's exclusive flag\n */\n\n\n static getRangeValue(values, logic) {\n let minMax = logic ? Infinity : -Infinity;\n let j = -1;\n const predicate = logic ?\n /** @type {RangeValueCallback} */\n ([value]) => value <= minMax :\n /** @type {RangeValueCallback} */\n ([value]) => value >= minMax;\n\n for (let i = 0; i < values.length; i++) {\n if (predicate(values[i])) {\n [minMax] = values[i];\n j = i;\n }\n }\n\n if (j > -1) {\n return values[j];\n }\n\n return [Infinity, true];\n }\n\n constructor() {\n /** @type {Array<RangeValue>} */\n this._left = [];\n /** @type {Array<RangeValue>} */\n\n this._right = [];\n }\n /**\n * @param {number} value\n * @param {boolean=} exclusive\n */\n\n\n left(value, exclusive = false) {\n this._left.push([value, exclusive]);\n }\n /**\n * @param {number} value\n * @param {boolean=} exclusive\n */\n\n\n right(value, exclusive = false) {\n this._right.push([value, exclusive]);\n }\n /**\n * @param {boolean} logic is not logic applied\n * @return {string} \"smart\" range string representation\n */\n\n\n format(logic = true) {\n const [start, leftExclusive] = Range.getRangeValue(this._left, logic);\n const [end, rightExclusive] = Range.getRangeValue(this._right, !logic);\n\n if (!Number.isFinite(start) && !Number.isFinite(end)) {\n return \"\";\n }\n\n const realStart = leftExclusive ? start + 1 : start;\n const realEnd = rightExclusive ? end - 1 : end; // e.g. 5 < x < 7, 5 < x <= 6, 6 <= x <= 6\n\n if (realStart === realEnd) {\n return `should be ${logic ? \"\" : \"!\"}= ${realStart}`;\n } // e.g. 4 < x < ∞\n\n\n if (Number.isFinite(start) && !Number.isFinite(end)) {\n return Range.formatLeft(start, logic, leftExclusive);\n } // e.g. ∞ < x < 4\n\n\n if (!Number.isFinite(start) && Number.isFinite(end)) {\n return Range.formatRight(end, logic, rightExclusive);\n }\n\n return Range.formatRange(start, end, leftExclusive, rightExclusive, logic);\n }\n\n}\n\nmodule.exports = Range;","\"use strict\";\n\nconst Range = require(\"./Range\");\n/** @typedef {import(\"../validate\").Schema} Schema */\n\n/**\n * @param {Schema} schema\n * @param {boolean} logic\n * @return {string[]}\n */\n\n\nmodule.exports.stringHints = function stringHints(schema, logic) {\n const hints = [];\n let type = \"string\";\n const currentSchema = { ...schema\n };\n\n if (!logic) {\n const tmpLength = currentSchema.minLength;\n const tmpFormat = currentSchema.formatMinimum;\n const tmpExclusive = currentSchema.formatExclusiveMaximum;\n currentSchema.minLength = currentSchema.maxLength;\n currentSchema.maxLength = tmpLength;\n currentSchema.formatMinimum = currentSchema.formatMaximum;\n currentSchema.formatMaximum = tmpFormat;\n currentSchema.formatExclusiveMaximum = !currentSchema.formatExclusiveMinimum;\n currentSchema.formatExclusiveMinimum = !tmpExclusive;\n }\n\n if (typeof currentSchema.minLength === \"number\") {\n if (currentSchema.minLength === 1) {\n type = \"non-empty string\";\n } else {\n const length = Math.max(currentSchema.minLength - 1, 0);\n hints.push(`should be longer than ${length} character${length > 1 ? \"s\" : \"\"}`);\n }\n }\n\n if (typeof currentSchema.maxLength === \"number\") {\n if (currentSchema.maxLength === 0) {\n type = \"empty string\";\n } else {\n const length = currentSchema.maxLength + 1;\n hints.push(`should be shorter than ${length} character${length > 1 ? \"s\" : \"\"}`);\n }\n }\n\n if (currentSchema.pattern) {\n hints.push(`should${logic ? \"\" : \" not\"} match pattern ${JSON.stringify(currentSchema.pattern)}`);\n }\n\n if (currentSchema.format) {\n hints.push(`should${logic ? \"\" : \" not\"} match format ${JSON.stringify(currentSchema.format)}`);\n }\n\n if (currentSchema.formatMinimum) {\n hints.push(`should be ${currentSchema.formatExclusiveMinimum ? \">\" : \">=\"} ${JSON.stringify(currentSchema.formatMinimum)}`);\n }\n\n if (currentSchema.formatMaximum) {\n hints.push(`should be ${currentSchema.formatExclusiveMaximum ? \"<\" : \"<=\"} ${JSON.stringify(currentSchema.formatMaximum)}`);\n }\n\n return [type].concat(hints);\n};\n/**\n * @param {Schema} schema\n * @param {boolean} logic\n * @return {string[]}\n */\n\n\nmodule.exports.numberHints = function numberHints(schema, logic) {\n const hints = [schema.type === \"integer\" ? \"integer\" : \"number\"];\n const range = new Range();\n\n if (typeof schema.minimum === \"number\") {\n range.left(schema.minimum);\n }\n\n if (typeof schema.exclusiveMinimum === \"number\") {\n range.left(schema.exclusiveMinimum, true);\n }\n\n if (typeof schema.maximum === \"number\") {\n range.right(schema.maximum);\n }\n\n if (typeof schema.exclusiveMaximum === \"number\") {\n range.right(schema.exclusiveMaximum, true);\n }\n\n const rangeFormat = range.format(logic);\n\n if (rangeFormat) {\n hints.push(rangeFormat);\n }\n\n if (typeof schema.multipleOf === \"number\") {\n hints.push(`should${logic ? \"\" : \" not\"} be multiple of ${schema.multipleOf}`);\n }\n\n return hints;\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nconst {\n stringHints,\n numberHints\n} = require(\"./util/hints\");\n/** @typedef {import(\"json-schema\").JSONSchema6} JSONSchema6 */\n\n/** @typedef {import(\"json-schema\").JSONSchema7} JSONSchema7 */\n\n/** @typedef {import(\"./validate\").Schema} Schema */\n\n/** @typedef {import(\"./validate\").ValidationErrorConfiguration} ValidationErrorConfiguration */\n\n/** @typedef {import(\"./validate\").PostFormatter} PostFormatter */\n\n/** @typedef {import(\"./validate\").SchemaUtilErrorObject} SchemaUtilErrorObject */\n\n/** @enum {number} */\n\n\nconst SPECIFICITY = {\n type: 1,\n not: 1,\n oneOf: 1,\n anyOf: 1,\n if: 1,\n enum: 1,\n const: 1,\n instanceof: 1,\n required: 2,\n pattern: 2,\n patternRequired: 2,\n format: 2,\n formatMinimum: 2,\n formatMaximum: 2,\n minimum: 2,\n exclusiveMinimum: 2,\n maximum: 2,\n exclusiveMaximum: 2,\n multipleOf: 2,\n uniqueItems: 2,\n contains: 2,\n minLength: 2,\n maxLength: 2,\n minItems: 2,\n maxItems: 2,\n minProperties: 2,\n maxProperties: 2,\n dependencies: 2,\n propertyNames: 2,\n additionalItems: 2,\n additionalProperties: 2,\n absolutePath: 2\n};\n/**\n *\n * @param {Array<SchemaUtilErrorObject>} array\n * @param {(item: SchemaUtilErrorObject) => number} fn\n * @returns {Array<SchemaUtilErrorObject>}\n */\n\nfunction filterMax(array, fn) {\n const evaluatedMax = array.reduce((max, item) => Math.max(max, fn(item)), 0);\n return array.filter(item => fn(item) === evaluatedMax);\n}\n/**\n *\n * @param {Array<SchemaUtilErrorObject>} children\n * @returns {Array<SchemaUtilErrorObject>}\n */\n\n\nfunction filterChildren(children) {\n let newChildren = children;\n newChildren = filterMax(newChildren,\n /**\n *\n * @param {SchemaUtilErrorObject} error\n * @returns {number}\n */\n error => error.dataPath ? error.dataPath.length : 0);\n newChildren = filterMax(newChildren,\n /**\n * @param {SchemaUtilErrorObject} error\n * @returns {number}\n */\n error => SPECIFICITY[\n /** @type {keyof typeof SPECIFICITY} */\n error.keyword] || 2);\n return newChildren;\n}\n/**\n * Find all children errors\n * @param {Array<SchemaUtilErrorObject>} children\n * @param {Array<string>} schemaPaths\n * @return {number} returns index of first child\n */\n\n\nfunction findAllChildren(children, schemaPaths) {\n let i = children.length - 1;\n\n const predicate =\n /**\n * @param {string} schemaPath\n * @returns {boolean}\n */\n schemaPath => children[i].schemaPath.indexOf(schemaPath) !== 0;\n\n while (i > -1 && !schemaPaths.every(predicate)) {\n if (children[i].keyword === \"anyOf\" || children[i].keyword === \"oneOf\") {\n const refs = extractRefs(children[i]);\n const childrenStart = findAllChildren(children.slice(0, i), refs.concat(children[i].schemaPath));\n i = childrenStart - 1;\n } else {\n i -= 1;\n }\n }\n\n return i + 1;\n}\n/**\n * Extracts all refs from schema\n * @param {SchemaUtilErrorObject} error\n * @return {Array<string>}\n */\n\n\nfunction extractRefs(error) {\n const {\n schema\n } = error;\n\n if (!Array.isArray(schema)) {\n return [];\n }\n\n return schema.map(({\n $ref\n }) => $ref).filter(s => s);\n}\n/**\n * Groups children by their first level parent (assuming that error is root)\n * @param {Array<SchemaUtilErrorObject>} children\n * @return {Array<SchemaUtilErrorObject>}\n */\n\n\nfunction groupChildrenByFirstChild(children) {\n const result = [];\n let i = children.length - 1;\n\n while (i > 0) {\n const child = children[i];\n\n if (child.keyword === \"anyOf\" || child.keyword === \"oneOf\") {\n const refs = extractRefs(child);\n const childrenStart = findAllChildren(children.slice(0, i), refs.concat(child.schemaPath));\n\n if (childrenStart !== i) {\n result.push(Object.assign({}, child, {\n children: children.slice(childrenStart, i)\n }));\n i = childrenStart;\n } else {\n result.push(child);\n }\n } else {\n result.push(child);\n }\n\n i -= 1;\n }\n\n if (i === 0) {\n result.push(children[i]);\n }\n\n return result.reverse();\n}\n/**\n * @param {string} str\n * @param {string} prefix\n * @returns {string}\n */\n\n\nfunction indent(str, prefix) {\n return str.replace(/\\n(?!$)/g, `\\n${prefix}`);\n}\n/**\n * @param {Schema} schema\n * @returns {schema is (Schema & {not: Schema})}\n */\n\n\nfunction hasNotInSchema(schema) {\n return !!schema.not;\n}\n/**\n * @param {Schema} schema\n * @return {Schema}\n */\n\n\nfunction findFirstTypedSchema(schema) {\n if (hasNotInSchema(schema)) {\n return findFirstTypedSchema(schema.not);\n }\n\n return schema;\n}\n/**\n * @param {Schema} schema\n * @return {boolean}\n */\n\n\nfunction canApplyNot(schema) {\n const typedSchema = findFirstTypedSchema(schema);\n return likeNumber(typedSchema) || likeInteger(typedSchema) || likeString(typedSchema) || likeNull(typedSchema) || likeBoolean(typedSchema);\n}\n/**\n * @param {any} maybeObj\n * @returns {boolean}\n */\n\n\nfunction isObject(maybeObj) {\n return typeof maybeObj === \"object\" && maybeObj !== null;\n}\n/**\n * @param {Schema} schema\n * @returns {boolean}\n */\n\n\nfunction likeNumber(schema) {\n return schema.type === \"number\" || typeof schema.minimum !== \"undefined\" || typeof schema.exclusiveMinimum !== \"undefined\" || typeof schema.maximum !== \"undefined\" || typeof schema.exclusiveMaximum !== \"undefined\" || typeof schema.multipleOf !== \"undefined\";\n}\n/**\n * @param {Schema} schema\n * @returns {boolean}\n */\n\n\nfunction likeInteger(schema) {\n return schema.type === \"integer\" || typeof schema.minimum !== \"undefined\" || typeof schema.exclusiveMinimum !== \"undefined\" || typeof schema.maximum !== \"undefined\" || typeof schema.exclusiveMaximum !== \"undefined\" || typeof schema.multipleOf !== \"undefined\";\n}\n/**\n * @param {Schema} schema\n * @returns {boolean}\n */\n\n\nfunction likeString(schema) {\n return schema.type === \"string\" || typeof schema.minLength !== \"undefined\" || typeof schema.maxLength !== \"undefined\" || typeof schema.pattern !== \"undefined\" || typeof schema.format !== \"undefined\" || typeof schema.formatMinimum !== \"undefined\" || typeof schema.formatMaximum !== \"undefined\";\n}\n/**\n * @param {Schema} schema\n * @returns {boolean}\n */\n\n\nfunction likeBoolean(schema) {\n return schema.type === \"boolean\";\n}\n/**\n * @param {Schema} schema\n * @returns {boolean}\n */\n\n\nfunction likeArray(schema) {\n return schema.type === \"array\" || typeof schema.minItems === \"number\" || typeof schema.maxItems === \"number\" || typeof schema.uniqueItems !== \"undefined\" || typeof schema.items !== \"undefined\" || typeof schema.additionalItems !== \"undefined\" || typeof schema.contains !== \"undefined\";\n}\n/**\n * @param {Schema & {patternRequired?: Array<string>}} schema\n * @returns {boolean}\n */\n\n\nfunction likeObject(schema) {\n return schema.type === \"object\" || typeof schema.minProperties !== \"undefined\" || typeof schema.maxProperties !== \"undefined\" || typeof schema.required !== \"undefined\" || typeof schema.properties !== \"undefined\" || typeof schema.patternProperties !== \"undefined\" || typeof schema.additionalProperties !== \"undefined\" || typeof schema.dependencies !== \"undefined\" || typeof schema.propertyNames !== \"undefined\" || typeof schema.patternRequired !== \"undefined\";\n}\n/**\n * @param {Schema} schema\n * @returns {boolean}\n */\n\n\nfunction likeNull(schema) {\n return schema.type === \"null\";\n}\n/**\n * @param {string} type\n * @returns {string}\n */\n\n\nfunction getArticle(type) {\n if (/^[aeiou]/i.test(type)) {\n return \"an\";\n }\n\n return \"a\";\n}\n/**\n * @param {Schema=} schema\n * @returns {string}\n */\n\n\nfunction getSchemaNonTypes(schema) {\n if (!schema) {\n return \"\";\n }\n\n if (!schema.type) {\n if (likeNumber(schema) || likeInteger(schema)) {\n return \" | should be any non-number\";\n }\n\n if (likeString(schema)) {\n return \" | should be any non-string\";\n }\n\n if (likeArray(schema)) {\n return \" | should be any non-array\";\n }\n\n if (likeObject(schema)) {\n return \" | should be any non-object\";\n }\n }\n\n return \"\";\n}\n/**\n * @param {Array<string>} hints\n * @returns {string}\n */\n\n\nfunction formatHints(hints) {\n return hints.length > 0 ? `(${hints.join(\", \")})` : \"\";\n}\n/**\n * @param {Schema} schema\n * @param {boolean} logic\n * @returns {string[]}\n */\n\n\nfunction getHints(schema, logic) {\n if (likeNumber(schema) || likeInteger(schema)) {\n return numberHints(schema, logic);\n } else if (likeString(schema)) {\n return stringHints(schema, logic);\n }\n\n return [];\n}\n\nclass ValidationError extends Error {\n /**\n * @param {Array<SchemaUtilErrorObject>} errors\n * @param {Schema} schema\n * @param {ValidationErrorConfiguration} configuration\n */\n constructor(errors, schema, configuration = {}) {\n super();\n /** @type {string} */\n\n this.name = \"ValidationError\";\n /** @type {Array<SchemaUtilErrorObject>} */\n\n this.errors = errors;\n /** @type {Schema} */\n\n this.schema = schema;\n let headerNameFromSchema;\n let baseDataPathFromSchema;\n\n if (schema.title && (!configuration.name || !configuration.baseDataPath)) {\n const splittedTitleFromSchema = schema.title.match(/^(.+) (.+)$/);\n\n if (splittedTitleFromSchema) {\n if (!configuration.name) {\n [, headerNameFromSchema] = splittedTitleFromSchema;\n }\n\n if (!configuration.baseDataPath) {\n [,, baseDataPathFromSchema] = splittedTitleFromSchema;\n }\n }\n }\n /** @type {string} */\n\n\n this.headerName = configuration.name || headerNameFromSchema || \"Object\";\n /** @type {string} */\n\n this.baseDataPath = configuration.baseDataPath || baseDataPathFromSchema || \"configuration\";\n /** @type {PostFormatter | null} */\n\n this.postFormatter = configuration.postFormatter || null;\n const header = `Invalid ${this.baseDataPath} object. ${this.headerName} has been initialized using ${getArticle(this.baseDataPath)} ${this.baseDataPath} object that does not match the API schema.\\n`;\n /** @type {string} */\n\n this.message = `${header}${this.formatValidationErrors(errors)}`;\n Error.captureStackTrace(this, this.constructor);\n }\n /**\n * @param {string} path\n * @returns {Schema}\n */\n\n\n getSchemaPart(path) {\n const newPath = path.split(\"/\");\n let schemaPart = this.schema;\n\n for (let i = 1; i < newPath.length; i++) {\n const inner = schemaPart[\n /** @type {keyof Schema} */\n newPath[i]];\n\n if (!inner) {\n break;\n }\n\n schemaPart = inner;\n }\n\n return schemaPart;\n }\n /**\n * @param {Schema} schema\n * @param {boolean} logic\n * @param {Array<Object>} prevSchemas\n * @returns {string}\n */\n\n\n formatSchema(schema, logic = true, prevSchemas = []) {\n let newLogic = logic;\n\n const formatInnerSchema =\n /**\n *\n * @param {Object} innerSchema\n * @param {boolean=} addSelf\n * @returns {string}\n */\n (innerSchema, addSelf) => {\n if (!addSelf) {\n return this.formatSchema(innerSchema, newLogic, prevSchemas);\n }\n\n if (prevSchemas.includes(innerSchema)) {\n return \"(recursive)\";\n }\n\n return this.formatSchema(innerSchema, newLogic, prevSchemas.concat(schema));\n };\n\n if (hasNotInSchema(schema) && !likeObject(schema)) {\n if (canApplyNot(schema.not)) {\n newLogic = !logic;\n return formatInnerSchema(schema.not);\n }\n\n const needApplyLogicHere = !schema.not.not;\n const prefix = logic ? \"\" : \"non \";\n newLogic = !logic;\n return needApplyLogicHere ? prefix + formatInnerSchema(schema.not) : formatInnerSchema(schema.not);\n }\n\n if (\n /** @type {Schema & {instanceof: string | Array<string>}} */\n schema.instanceof) {\n const {\n instanceof: value\n } =\n /** @type {Schema & {instanceof: string | Array<string>}} */\n schema;\n const values = !Array.isArray(value) ? [value] : value;\n return values.map(\n /**\n * @param {string} item\n * @returns {string}\n */\n item => item === \"Function\" ? \"function\" : item).join(\" | \");\n }\n\n if (schema.enum) {\n return (\n /** @type {Array<any>} */\n schema.enum.map(item => JSON.stringify(item)).join(\" | \")\n );\n }\n\n if (typeof schema.const !== \"undefined\") {\n return JSON.stringify(schema.const);\n }\n\n if (schema.oneOf) {\n return (\n /** @type {Array<Schema>} */\n schema.oneOf.map(item => formatInnerSchema(item, true)).join(\" | \")\n );\n }\n\n if (schema.anyOf) {\n return (\n /** @type {Array<Schema>} */\n schema.anyOf.map(item => formatInnerSchema(item, true)).join(\" | \")\n );\n }\n\n if (schema.allOf) {\n return (\n /** @type {Array<Schema>} */\n schema.allOf.map(item => formatInnerSchema(item, true)).join(\" & \")\n );\n }\n\n if (\n /** @type {JSONSchema7} */\n schema.if) {\n const {\n if: ifValue,\n then: thenValue,\n else: elseValue\n } =\n /** @type {JSONSchema7} */\n schema;\n return `${ifValue ? `if ${formatInnerSchema(ifValue)}` : \"\"}${thenValue ? ` then ${formatInnerSchema(thenValue)}` : \"\"}${elseValue ? ` else ${formatInnerSchema(elseValue)}` : \"\"}`;\n }\n\n if (schema.$ref) {\n return formatInnerSchema(this.getSchemaPart(schema.$ref), true);\n }\n\n if (likeNumber(schema) || likeInteger(schema)) {\n const [type, ...hints] = getHints(schema, logic);\n const str = `${type}${hints.length > 0 ? ` ${formatHints(hints)}` : \"\"}`;\n return logic ? str : hints.length > 0 ? `non-${type} | ${str}` : `non-${type}`;\n }\n\n if (likeString(schema)) {\n const [type, ...hints] = getHints(schema, logic);\n const str = `${type}${hints.length > 0 ? ` ${formatHints(hints)}` : \"\"}`;\n return logic ? str : str === \"string\" ? \"non-string\" : `non-string | ${str}`;\n }\n\n if (likeBoolean(schema)) {\n return `${logic ? \"\" : \"non-\"}boolean`;\n }\n\n if (likeArray(schema)) {\n // not logic already applied in formatValidationError\n newLogic = true;\n const hints = [];\n\n if (typeof schema.minItems === \"number\") {\n hints.push(`should not have fewer than ${schema.minItems} item${schema.minItems > 1 ? \"s\" : \"\"}`);\n }\n\n if (typeof schema.maxItems === \"number\") {\n hints.push(`should not have more than ${schema.maxItems} item${schema.maxItems > 1 ? \"s\" : \"\"}`);\n }\n\n if (schema.uniqueItems) {\n hints.push(\"should not have duplicate items\");\n }\n\n const hasAdditionalItems = typeof schema.additionalItems === \"undefined\" || Boolean(schema.additionalItems);\n let items = \"\";\n\n if (schema.items) {\n if (Array.isArray(schema.items) && schema.items.length > 0) {\n items = `${\n /** @type {Array<Schema>} */\n schema.items.map(item => formatInnerSchema(item)).join(\", \")}`;\n\n if (hasAdditionalItems) {\n if (schema.additionalItems && isObject(schema.additionalItems) && Object.keys(schema.additionalItems).length > 0) {\n hints.push(`additional items should be ${formatInnerSchema(schema.additionalItems)}`);\n }\n }\n } else if (schema.items && Object.keys(schema.items).length > 0) {\n // \"additionalItems\" is ignored\n items = `${formatInnerSchema(schema.items)}`;\n } else {\n // Fallback for empty `items` value\n items = \"any\";\n }\n } else {\n // \"additionalItems\" is ignored\n items = \"any\";\n }\n\n if (schema.contains && Object.keys(schema.contains).length > 0) {\n hints.push(`should contains at least one ${this.formatSchema(schema.contains)} item`);\n }\n\n return `[${items}${hasAdditionalItems ? \", ...\" : \"\"}]${hints.length > 0 ? ` (${hints.join(\", \")})` : \"\"}`;\n }\n\n if (likeObject(schema)) {\n // not logic already applied in formatValidationError\n newLogic = true;\n const hints = [];\n\n if (typeof schema.minProperties === \"number\") {\n hints.push(`should not have fewer than ${schema.minProperties} ${schema.minProperties > 1 ? \"properties\" : \"property\"}`);\n }\n\n if (typeof schema.maxProperties === \"number\") {\n hints.push(`should not have more than ${schema.maxProperties} ${schema.minProperties && schema.minProperties > 1 ? \"properties\" : \"property\"}`);\n }\n\n if (schema.patternProperties && Object.keys(schema.patternProperties).length > 0) {\n const patternProperties = Object.keys(schema.patternProperties);\n hints.push(`additional property names should match pattern${patternProperties.length > 1 ? \"s\" : \"\"} ${patternProperties.map(pattern => JSON.stringify(pattern)).join(\" | \")}`);\n }\n\n const properties = schema.properties ? Object.keys(schema.properties) : [];\n const required = schema.required ? schema.required : [];\n const allProperties = [...new Set(\n /** @type {Array<string>} */\n [].concat(required).concat(properties))];\n const objectStructure = allProperties.map(property => {\n const isRequired = required.includes(property); // Some properties need quotes, maybe we should add check\n // Maybe we should output type of property (`foo: string`), but it is looks very unreadable\n\n return `${property}${isRequired ? \"\" : \"?\"}`;\n }).concat(typeof schema.additionalProperties === \"undefined\" || Boolean(schema.additionalProperties) ? schema.additionalProperties && isObject(schema.additionalProperties) ? [`<key>: ${formatInnerSchema(schema.additionalProperties)}`] : [\"…\"] : []).join(\", \");\n const {\n dependencies,\n propertyNames,\n patternRequired\n } =\n /** @type {Schema & {patternRequired?: Array<string>;}} */\n schema;\n\n if (dependencies) {\n Object.keys(dependencies).forEach(dependencyName => {\n const dependency = dependencies[dependencyName];\n\n if (Array.isArray(dependency)) {\n hints.push(`should have ${dependency.length > 1 ? \"properties\" : \"property\"} ${dependency.map(dep => `'${dep}'`).join(\", \")} when property '${dependencyName}' is present`);\n } else {\n hints.push(`should be valid according to the schema ${formatInnerSchema(dependency)} when property '${dependencyName}' is present`);\n }\n });\n }\n\n if (propertyNames && Object.keys(propertyNames).length > 0) {\n hints.push(`each property name should match format ${JSON.stringify(schema.propertyNames.format)}`);\n }\n\n if (patternRequired && patternRequired.length > 0) {\n hints.push(`should have property matching pattern ${patternRequired.map(\n /**\n * @param {string} item\n * @returns {string}\n */\n item => JSON.stringify(item))}`);\n }\n\n return `object {${objectStructure ? ` ${objectStructure} ` : \"\"}}${hints.length > 0 ? ` (${hints.join(\", \")})` : \"\"}`;\n }\n\n if (likeNull(schema)) {\n return `${logic ? \"\" : \"non-\"}null`;\n }\n\n if (Array.isArray(schema.type)) {\n // not logic already applied in formatValidationError\n return `${schema.type.join(\" | \")}`;\n } // Fallback for unknown keywords\n // not logic already applied in formatValidationError\n\n /* istanbul ignore next */\n\n\n return JSON.stringify(schema, null, 2);\n }\n /**\n * @param {Schema=} schemaPart\n * @param {(boolean | Array<string>)=} additionalPath\n * @param {boolean=} needDot\n * @param {boolean=} logic\n * @returns {string}\n */\n\n\n getSchemaPartText(schemaPart, additionalPath, needDot = false, logic = true) {\n if (!schemaPart) {\n return \"\";\n }\n\n if (Array.isArray(additionalPath)) {\n for (let i = 0; i < additionalPath.length; i++) {\n /** @type {Schema | undefined} */\n const inner = schemaPart[\n /** @type {keyof Schema} */\n additionalPath[i]];\n\n if (inner) {\n // eslint-disable-next-line no-param-reassign\n schemaPart = inner;\n } else {\n break;\n }\n }\n }\n\n while (schemaPart.$ref) {\n // eslint-disable-next-line no-param-reassign\n schemaPart = this.getSchemaPart(schemaPart.$ref);\n }\n\n let schemaText = `${this.formatSchema(schemaPart, logic)}${needDot ? \".\" : \"\"}`;\n\n if (schemaPart.description) {\n schemaText += `\\n-> ${schemaPart.description}`;\n }\n\n if (schemaPart.link) {\n schemaText += `\\n-> Read more at ${schemaPart.link}`;\n }\n\n return schemaText;\n }\n /**\n * @param {Schema=} schemaPart\n * @returns {string}\n */\n\n\n getSchemaPartDescription(schemaPart) {\n if (!schemaPart) {\n return \"\";\n }\n\n while (schemaPart.$ref) {\n // eslint-disable-next-line no-param-reassign\n schemaPart = this.getSchemaPart(schemaPart.$ref);\n }\n\n let schemaText = \"\";\n\n if (schemaPart.description) {\n schemaText += `\\n-> ${schemaPart.description}`;\n }\n\n if (schemaPart.link) {\n schemaText += `\\n-> Read more at ${schemaPart.link}`;\n }\n\n return schemaText;\n }\n /**\n * @param {SchemaUtilErrorObject} error\n * @returns {string}\n */\n\n\n formatValidationError(error) {\n const {\n keyword,\n dataPath: errorDataPath\n } = error;\n const dataPath = `${this.baseDataPath}${errorDataPath}`;\n\n switch (keyword) {\n case \"type\":\n {\n const {\n parentSchema,\n params\n } = error; // eslint-disable-next-line default-case\n\n switch (\n /** @type {import(\"ajv\").TypeParams} */\n params.type) {\n case \"number\":\n return `${dataPath} should be a ${this.getSchemaPartText(parentSchema, false, true)}`;\n\n case \"integer\":\n return `${dataPath} should be an ${this.getSchemaPartText(parentSchema, false, true)}`;\n\n case \"string\":\n return `${dataPath} should be a ${this.getSchemaPartText(parentSchema, false, true)}`;\n\n case \"boolean\":\n return `${dataPath} should be a ${this.getSchemaPartText(parentSchema, false, true)}`;\n\n case \"array\":\n return `${dataPath} should be an array:\\n${this.getSchemaPartText(parentSchema)}`;\n\n case \"object\":\n return `${dataPath} should be an object:\\n${this.getSchemaPartText(parentSchema)}`;\n\n case \"null\":\n return `${dataPath} should be a ${this.getSchemaPartText(parentSchema, false, true)}`;\n\n default:\n return `${dataPath} should be:\\n${this.getSchemaPartText(parentSchema)}`;\n }\n }\n\n case \"instanceof\":\n {\n const {\n parentSchema\n } = error;\n return `${dataPath} should be an instance of ${this.getSchemaPartText(parentSchema, false, true)}`;\n }\n\n case \"pattern\":\n {\n const {\n params,\n parentSchema\n } = error;\n const {\n pattern\n } =\n /** @type {import(\"ajv\").PatternParams} */\n params;\n return `${dataPath} should match pattern ${JSON.stringify(pattern)}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`;\n }\n\n case \"format\":\n {\n const {\n params,\n parentSchema\n } = error;\n const {\n format\n } =\n /** @type {import(\"ajv\").FormatParams} */\n params;\n return `${dataPath} should match format ${JSON.stringify(format)}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`;\n }\n\n case \"formatMinimum\":\n case \"formatMaximum\":\n {\n const {\n params,\n parentSchema\n } = error;\n const {\n comparison,\n limit\n } =\n /** @type {import(\"ajv\").ComparisonParams} */\n params;\n return `${dataPath} should be ${comparison} ${JSON.stringify(limit)}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`;\n }\n\n case \"minimum\":\n case \"maximum\":\n case \"exclusiveMinimum\":\n case \"exclusiveMaximum\":\n {\n const {\n parentSchema,\n params\n } = error;\n const {\n comparison,\n limit\n } =\n /** @type {import(\"ajv\").ComparisonParams} */\n params;\n const [, ...hints] = getHints(\n /** @type {Schema} */\n parentSchema, true);\n\n if (hints.length === 0) {\n hints.push(`should be ${comparison} ${limit}`);\n }\n\n return `${dataPath} ${hints.join(\" \")}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`;\n }\n\n case \"multipleOf\":\n {\n const {\n params,\n parentSchema\n } = error;\n const {\n multipleOf\n } =\n /** @type {import(\"ajv\").MultipleOfParams} */\n params;\n return `${dataPath} should be multiple of ${multipleOf}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`;\n }\n\n case \"patternRequired\":\n {\n const {\n params,\n parentSchema\n } = error;\n const {\n missingPattern\n } =\n /** @type {import(\"ajv\").PatternRequiredParams} */\n params;\n return `${dataPath} should have property matching pattern ${JSON.stringify(missingPattern)}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`;\n }\n\n case \"minLength\":\n {\n const {\n params,\n parentSchema\n } = error;\n const {\n limit\n } =\n /** @type {import(\"ajv\").LimitParams} */\n params;\n\n if (limit === 1) {\n return `${dataPath} should be a non-empty string${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`;\n }\n\n const length = limit - 1;\n return `${dataPath} should be longer than ${length} character${length > 1 ? \"s\" : \"\"}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`;\n }\n\n case \"minItems\":\n {\n const {\n params,\n parentSchema\n } = error;\n const {\n limit\n } =\n /** @type {import(\"ajv\").LimitParams} */\n params;\n\n if (limit === 1) {\n return `${dataPath} should be a non-empty array${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`;\n }\n\n return `${dataPath} should not have fewer than ${limit} items${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`;\n }\n\n case \"minProperties\":\n {\n const {\n params,\n parentSchema\n } = error;\n const {\n limit\n } =\n /** @type {import(\"ajv\").LimitParams} */\n params;\n\n if (limit === 1) {\n return `${dataPath} should be a non-empty object${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`;\n }\n\n return `${dataPath} should not have fewer than ${limit} properties${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`;\n }\n\n case \"maxLength\":\n {\n const {\n params,\n parentSchema\n } = error;\n const {\n limit\n } =\n /** @type {import(\"ajv\").LimitParams} */\n params;\n const max = limit + 1;\n return `${dataPath} should be shorter than ${max} character${max > 1 ? \"s\" : \"\"}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`;\n }\n\n case \"maxItems\":\n {\n const {\n params,\n parentSchema\n } = error;\n const {\n limit\n } =\n /** @type {import(\"ajv\").LimitParams} */\n params;\n return `${dataPath} should not have more than ${limit} items${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`;\n }\n\n case \"maxProperties\":\n {\n const {\n params,\n parentSchema\n } = error;\n const {\n limit\n } =\n /** @type {import(\"ajv\").LimitParams} */\n params;\n return `${dataPath} should not have more than ${limit} properties${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`;\n }\n\n case \"uniqueItems\":\n {\n const {\n params,\n parentSchema\n } = error;\n const {\n i\n } =\n /** @type {import(\"ajv\").UniqueItemsParams} */\n params;\n return `${dataPath} should not contain the item '${error.data[i]}' twice${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`;\n }\n\n case \"additionalItems\":\n {\n const {\n params,\n parentSchema\n } = error;\n const {\n limit\n } =\n /** @type {import(\"ajv\").LimitParams} */\n params;\n return `${dataPath} should not have more than ${limit} items${getSchemaNonTypes(parentSchema)}. These items are valid:\\n${this.getSchemaPartText(parentSchema)}`;\n }\n\n case \"contains\":\n {\n const {\n parentSchema\n } = error;\n return `${dataPath} should contains at least one ${this.getSchemaPartText(parentSchema, [\"contains\"])} item${getSchemaNonTypes(parentSchema)}.`;\n }\n\n case \"required\":\n {\n const {\n parentSchema,\n params\n } = error;\n const missingProperty =\n /** @type {import(\"ajv\").DependenciesParams} */\n params.missingProperty.replace(/^\\./, \"\");\n const hasProperty = parentSchema && Boolean(\n /** @type {Schema} */\n parentSchema.properties &&\n /** @type {Schema} */\n parentSchema.properties[missingProperty]);\n return `${dataPath} misses the property '${missingProperty}'${getSchemaNonTypes(parentSchema)}.${hasProperty ? ` Should be:\\n${this.getSchemaPartText(parentSchema, [\"properties\", missingProperty])}` : this.getSchemaPartDescription(parentSchema)}`;\n }\n\n case \"additionalProperties\":\n {\n const {\n params,\n parentSchema\n } = error;\n const {\n additionalProperty\n } =\n /** @type {import(\"ajv\").AdditionalPropertiesParams} */\n params;\n return `${dataPath} has an unknown property '${additionalProperty}'${getSchemaNonTypes(parentSchema)}. These properties are valid:\\n${this.getSchemaPartText(parentSchema)}`;\n }\n\n case \"dependencies\":\n {\n const {\n params,\n parentSchema\n } = error;\n const {\n property,\n deps\n } =\n /** @type {import(\"ajv\").DependenciesParams} */\n params;\n const dependencies = deps.split(\",\").map(\n /**\n * @param {string} dep\n * @returns {string}\n */\n dep => `'${dep.trim()}'`).join(\", \");\n return `${dataPath} should have properties ${dependencies} when property '${property}' is present${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`;\n }\n\n case \"propertyNames\":\n {\n const {\n params,\n parentSchema,\n schema\n } = error;\n const {\n propertyName\n } =\n /** @type {import(\"ajv\").PropertyNamesParams} */\n params;\n return `${dataPath} property name '${propertyName}' is invalid${getSchemaNonTypes(parentSchema)}. Property names should be match format ${JSON.stringify(schema.format)}.${this.getSchemaPartDescription(parentSchema)}`;\n }\n\n case \"enum\":\n {\n const {\n parentSchema\n } = error;\n\n if (parentSchema &&\n /** @type {Schema} */\n parentSchema.enum &&\n /** @type {Schema} */\n parentSchema.enum.length === 1) {\n return `${dataPath} should be ${this.getSchemaPartText(parentSchema, false, true)}`;\n }\n\n return `${dataPath} should be one of these:\\n${this.getSchemaPartText(parentSchema)}`;\n }\n\n case \"const\":\n {\n const {\n parentSchema\n } = error;\n return `${dataPath} should be equal to constant ${this.getSchemaPartText(parentSchema, false, true)}`;\n }\n\n case \"not\":\n {\n const postfix = likeObject(\n /** @type {Schema} */\n error.parentSchema) ? `\\n${this.getSchemaPartText(error.parentSchema)}` : \"\";\n const schemaOutput = this.getSchemaPartText(error.schema, false, false, false);\n\n if (canApplyNot(error.schema)) {\n return `${dataPath} should be any ${schemaOutput}${postfix}.`;\n }\n\n const {\n schema,\n parentSchema\n } = error;\n return `${dataPath} should not be ${this.getSchemaPartText(schema, false, true)}${parentSchema && likeObject(parentSchema) ? `\\n${this.getSchemaPartText(parentSchema)}` : \"\"}`;\n }\n\n case \"oneOf\":\n case \"anyOf\":\n {\n const {\n parentSchema,\n children\n } = error;\n\n if (children && children.length > 0) {\n if (error.schema.length === 1) {\n const lastChild = children[children.length - 1];\n const remainingChildren = children.slice(0, children.length - 1);\n return this.formatValidationError(Object.assign({}, lastChild, {\n children: remainingChildren,\n parentSchema: Object.assign({}, parentSchema, lastChild.parentSchema)\n }));\n }\n\n let filteredChildren = filterChildren(children);\n\n if (filteredChildren.length === 1) {\n return this.formatValidationError(filteredChildren[0]);\n }\n\n filteredChildren = groupChildrenByFirstChild(filteredChildren);\n return `${dataPath} should be one of these:\\n${this.getSchemaPartText(parentSchema)}\\nDetails:\\n${filteredChildren.map(\n /**\n * @param {SchemaUtilErrorObject} nestedError\n * @returns {string}\n */\n nestedError => ` * ${indent(this.formatValidationError(nestedError), \" \")}`).join(\"\\n\")}`;\n }\n\n return `${dataPath} should be one of these:\\n${this.getSchemaPartText(parentSchema)}`;\n }\n\n case \"if\":\n {\n const {\n params,\n parentSchema\n } = error;\n const {\n failingKeyword\n } =\n /** @type {import(\"ajv\").IfParams} */\n params;\n return `${dataPath} should match \"${failingKeyword}\" schema:\\n${this.getSchemaPartText(parentSchema, [failingKeyword])}`;\n }\n\n case \"absolutePath\":\n {\n const {\n message,\n parentSchema\n } = error;\n return `${dataPath}: ${message}${this.getSchemaPartDescription(parentSchema)}`;\n }\n\n /* istanbul ignore next */\n\n default:\n {\n const {\n message,\n parentSchema\n } = error;\n const ErrorInJSON = JSON.stringify(error, null, 2); // For `custom`, `false schema`, `$ref` keywords\n // Fallback for unknown keywords\n\n return `${dataPath} ${message} (${ErrorInJSON}).\\n${this.getSchemaPartText(parentSchema, false)}`;\n }\n }\n }\n /**\n * @param {Array<SchemaUtilErrorObject>} errors\n * @returns {string}\n */\n\n\n formatValidationErrors(errors) {\n return errors.map(error => {\n let formattedError = this.formatValidationError(error);\n\n if (this.postFormatter) {\n formattedError = this.postFormatter(formattedError, error);\n }\n\n return ` - ${indent(formattedError, \" \")}`;\n }).join(\"\\n\");\n }\n\n}\n\nvar _default = ValidationError;\nexports.default = _default;","export function merge(...sets:Array<string>):string {\n\tif (sets.length > 1) {\n\t\tsets[0] = sets[0].slice(0, -1);\n\t\tconst xl = sets.length - 1;\n\t\tfor (let x = 1; x < xl; ++x) {\n\t\t\tsets[x] = sets[x].slice(1, -1);\n\t\t}\n\t\tsets[xl] = sets[xl].slice(1);\n\t\treturn sets.join('');\n\t} else {\n\t\treturn sets[0];\n\t}\n}\n\nexport function subexp(str:string):string {\n\treturn \"(?:\" + str + \")\";\n}\n\nexport function typeOf(o:any):string {\n\treturn o === undefined ? \"undefined\" : (o === null ? \"null\" : Object.prototype.toString.call(o).split(\" \").pop().split(\"]\").shift().toLowerCase());\n}\n\nexport function toUpperCase(str:string):string {\n\treturn str.toUpperCase();\n}\n\nexport function toArray(obj:any):Array<any> {\n\treturn obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== \"number\" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : [];\n}\n\n\nexport function assign(target: object, source: any): any {\n\tconst obj = target as any;\n\tif (source) {\n\t\tfor (const key in source) {\n\t\t\tobj[key] = source[key];\n\t\t}\n\t}\n\treturn obj;\n}","import { URIRegExps } from \"./uri\";\nimport { merge, subexp } from \"./util\";\n\nexport function buildExps(isIRI:boolean):URIRegExps {\n\tconst\n\t\tALPHA$$ = \"[A-Za-z]\",\n\t\tCR$ = \"[\\\\x0D]\",\n\t\tDIGIT$$ = \"[0-9]\",\n\t\tDQUOTE$$ = \"[\\\\x22]\",\n\t\tHEXDIG$$ = merge(DIGIT$$, \"[A-Fa-f]\"), //case-insensitive\n\t\tLF$$ = \"[\\\\x0A]\",\n\t\tSP$$ = \"[\\\\x20]\",\n\t\tPCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)), //expanded\n\t\tGEN_DELIMS$$ = \"[\\\\:\\\\/\\\\?\\\\#\\\\[\\\\]\\\\@]\",\n\t\tSUB_DELIMS$$ = \"[\\\\!\\\\$\\\\&\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\=]\",\n\t\tRESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),\n\t\tUCSCHAR$$ = isIRI ? \"[\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]\" : \"[]\", //subset, excludes bidi control characters\n\t\tIPRIVATE$$ = isIRI ? \"[\\\\uE000-\\\\uF8FF]\" : \"[]\", //subset\n\t\tUNRESERVED$$ = merge(ALPHA$$, DIGIT$$, \"[\\\\-\\\\.\\\\_\\\\~]\", UCSCHAR$$),\n\t\tSCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\") + \"*\"),\n\t\tUSERINFO$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\")) + \"*\"),\n\t\tDEC_OCTET$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"[1-9]\" + DIGIT$$) + \"|\" + DIGIT$$),\n\t\tDEC_OCTET_RELAXED$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"0?[1-9]\" + DIGIT$$) + \"|0?0?\" + DIGIT$$), //relaxed parsing rules\n\t\tIPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$),\n\t\tH16$ = subexp(HEXDIG$$ + \"{1,4}\"),\n\t\tLS32$ = subexp(subexp(H16$ + \"\\\\:\" + H16$) + \"|\" + IPV4ADDRESS$),\n\t\tIPV6ADDRESS1$ = subexp( subexp(H16$ + \"\\\\:\") + \"{6}\" + LS32$), // 6( h16 \":\" ) ls32\n\t\tIPV6ADDRESS2$ = subexp( \"\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{5}\" + LS32$), // \"::\" 5( h16 \":\" ) ls32\n\t\tIPV6ADDRESS3$ = subexp(subexp( H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{4}\" + LS32$), //[ h16 ] \"::\" 4( h16 \":\" ) ls32\n\t\tIPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,1}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{3}\" + LS32$), //[ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n\t\tIPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,2}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{2}\" + LS32$), //[ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n\t\tIPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,3}\" + H16$) + \"?\\\\:\\\\:\" + H16$ + \"\\\\:\" + LS32$), //[ *3( h16 \":\" ) h16 ] \"::\" h16 \":\" ls32\n\t\tIPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,4}\" + H16$) + \"?\\\\:\\\\:\" + LS32$), //[ *4( h16 \":\" ) h16 ] \"::\" ls32\n\t\tIPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,5}\" + H16$) + \"?\\\\:\\\\:\" + H16$ ), //[ *5( h16 \":\" ) h16 ] \"::\" h16\n\t\tIPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,6}\" + H16$) + \"?\\\\:\\\\:\" ), //[ *6( h16 \":\" ) h16 ] \"::\"\n\t\tIPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join(\"|\")),\n\t\tZONEID$ = subexp(subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$) + \"+\"), //RFC 6874\n\t\tIPV6ADDRZ$ = subexp(IPV6ADDRESS$ + \"\\\\%25\" + ZONEID$), //RFC 6874\n\t\tIPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + ZONEID$), //RFC 6874, with relaxed parsing rules\n\t\tIPVFUTURE$ = subexp(\"[vV]\" + HEXDIG$$ + \"+\\\\.\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\") + \"+\"),\n\t\tIP_LITERAL$ = subexp(\"\\\\[\" + subexp(IPV6ADDRZ_RELAXED$ + \"|\" + IPV6ADDRESS$ + \"|\" + IPVFUTURE$) + \"\\\\]\"), //RFC 6874\n\t\tREG_NAME$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$)) + \"*\"),\n\t\tHOST$ = subexp(IP_LITERAL$ + \"|\" + IPV4ADDRESS$ + \"(?!\" + REG_NAME$ + \")\" + \"|\" + REG_NAME$),\n\t\tPORT$ = subexp(DIGIT$$ + \"*\"),\n\t\tAUTHORITY$ = subexp(subexp(USERINFO$ + \"@\") + \"?\" + HOST$ + subexp(\"\\\\:\" + PORT$) + \"?\"),\n\t\tPCHAR$ = subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@]\")),\n\t\tSEGMENT$ = subexp(PCHAR$ + \"*\"),\n\t\tSEGMENT_NZ$ = subexp(PCHAR$ + \"+\"),\n\t\tSEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\@]\")) + \"+\"),\n\t\tPATH_ABEMPTY$ = subexp(subexp(\"\\\\/\" + SEGMENT$) + \"*\"),\n\t\tPATH_ABSOLUTE$ = subexp(\"\\\\/\" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + \"?\"), //simplified\n\t\tPATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_EMPTY$ = \"(?!\" + PCHAR$ + \")\",\n\t\tPATH$ = subexp(PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tQUERY$ = subexp(subexp(PCHAR$ + \"|\" + merge(\"[\\\\/\\\\?]\", IPRIVATE$$)) + \"*\"),\n\t\tFRAGMENT$ = subexp(subexp(PCHAR$ + \"|[\\\\/\\\\?]\") + \"*\"),\n\t\tHIER_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tURI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tRELATIVE_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$),\n\t\tRELATIVE$ = subexp(RELATIVE_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tURI_REFERENCE$ = subexp(URI$ + \"|\" + RELATIVE$),\n\t\tABSOLUTE_URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\"),\n\n\t\tGENERIC_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tRELATIVE_REF$ = \"^(){0}\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tABSOLUTE_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?$\",\n\t\tSAMEDOC_REF$ = \"^\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tAUTHORITY_REF$ = \"^\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?$\"\n\t;\n\n\treturn {\n\t\tNOT_SCHEME : new RegExp(merge(\"[^]\", ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\"), \"g\"),\n\t\tNOT_USERINFO : new RegExp(merge(\"[^\\\\%\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_HOST : new RegExp(merge(\"[^\\\\%\\\\[\\\\]\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH : new RegExp(merge(\"[^\\\\%\\\\/\\\\:\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH_NOSCHEME : new RegExp(merge(\"[^\\\\%\\\\/\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_QUERY : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\", IPRIVATE$$), \"g\"),\n\t\tNOT_FRAGMENT : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\"), \"g\"),\n\t\tESCAPE : new RegExp(merge(\"[^]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tUNRESERVED : new RegExp(UNRESERVED$$, \"g\"),\n\t\tOTHER_CHARS : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, RESERVED$$), \"g\"),\n\t\tPCT_ENCODED : new RegExp(PCT_ENCODED$, \"g\"),\n\t\tIPV4ADDRESS : new RegExp(\"^(\" + IPV4ADDRESS$ + \")$\"),\n\t\tIPV6ADDRESS : new RegExp(\"^\\\\[?(\" + IPV6ADDRESS$ + \")\" + subexp(subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + \"(\" + ZONEID$ + \")\") + \"?\\\\]?$\") //RFC 6874, with relaxed parsing rules\n\t};\n}\n\nexport default buildExps(false);\n","import { URIRegExps } from \"./uri\";\nimport { buildExps } from \"./regexps-uri\";\n\nexport default buildExps(true);\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tconst parts = string.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tconst labels = string.split('.');\n\tconst encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see <https://mathiasbynens.be/notes/javascript-encoding>\n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = array => String.fromCodePoint(...array);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tlet oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tlet inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tlet basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue == n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.1.0',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport default punycode;\n","/**\n * URI.js\n *\n * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.\n * @author <a href=\"mailto:gary.court@gmail.com\">Gary Court</a>\n * @see http://github.com/garycourt/uri-js\n */\n\n/**\n * Copyright 2011 Gary Court. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are those of the\n * authors and should not be interpreted as representing official policies, either expressed\n * or implied, of Gary Court.\n */\n\nimport URI_PROTOCOL from \"./regexps-uri\";\nimport IRI_PROTOCOL from \"./regexps-iri\";\nimport punycode from \"punycode\";\nimport { toUpperCase, typeOf, assign } from \"./util\";\n\nexport interface URIComponents {\n\tscheme?:string;\n\tuserinfo?:string;\n\thost?:string;\n\tport?:number|string;\n\tpath?:string;\n\tquery?:string;\n\tfragment?:string;\n\treference?:string;\n\terror?:string;\n}\n\nexport interface URIOptions {\n\tscheme?:string;\n\treference?:string;\n\ttolerant?:boolean;\n\tabsolutePath?:boolean;\n\tiri?:boolean;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n}\n\nexport interface URISchemeHandler<Components extends URIComponents = URIComponents, Options extends URIOptions = URIOptions, ParentComponents extends URIComponents = URIComponents> {\n\tscheme:string;\n\tparse(components:ParentComponents, options:Options):Components;\n\tserialize(components:Components, options:Options):ParentComponents;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n\tabsolutePath?:boolean;\n}\n\nexport interface URIRegExps {\n\tNOT_SCHEME : RegExp,\n\tNOT_USERINFO : RegExp,\n\tNOT_HOST : RegExp,\n\tNOT_PATH : RegExp,\n\tNOT_PATH_NOSCHEME : RegExp,\n\tNOT_QUERY : RegExp,\n\tNOT_FRAGMENT : RegExp,\n\tESCAPE : RegExp,\n\tUNRESERVED : RegExp,\n\tOTHER_CHARS : RegExp,\n\tPCT_ENCODED : RegExp,\n\tIPV4ADDRESS : RegExp,\n\tIPV6ADDRESS : RegExp,\n}\n\nexport const SCHEMES:{[scheme:string]:URISchemeHandler} = {};\n\nexport function pctEncChar(chr:string):string {\n\tconst c = chr.charCodeAt(0);\n\tlet e:string;\n\n\tif (c < 16) e = \"%0\" + c.toString(16).toUpperCase();\n\telse if (c < 128) e = \"%\" + c.toString(16).toUpperCase();\n\telse if (c < 2048) e = \"%\" + ((c >> 6) | 192).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\telse e = \"%\" + ((c >> 12) | 224).toString(16).toUpperCase() + \"%\" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\n\treturn e;\n}\n\nexport function pctDecChars(str:string):string {\n\tlet newStr = \"\";\n\tlet i = 0;\n\tconst il = str.length;\n\n\twhile (i < il) {\n\t\tconst c = parseInt(str.substr(i + 1, 2), 16);\n\n\t\tif (c < 128) {\n\t\t\tnewStr += String.fromCharCode(c);\n\t\t\ti += 3;\n\t\t}\n\t\telse if (c >= 194 && c < 224) {\n\t\t\tif ((il - i) >= 6) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 6);\n\t\t\t}\n\t\t\ti += 6;\n\t\t}\n\t\telse if (c >= 224) {\n\t\t\tif ((il - i) >= 9) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tconst c3 = parseInt(str.substr(i + 7, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 9);\n\t\t\t}\n\t\t\ti += 9;\n\t\t}\n\t\telse {\n\t\t\tnewStr += str.substr(i, 3);\n\t\t\ti += 3;\n\t\t}\n\t}\n\n\treturn newStr;\n}\n\nfunction _normalizeComponentEncoding(components:URIComponents, protocol:URIRegExps) {\n\tfunction decodeUnreserved(str:string):string {\n\t\tconst decStr = pctDecChars(str);\n\t\treturn (!decStr.match(protocol.UNRESERVED) ? str : decStr);\n\t}\n\n\tif (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, \"\");\n\tif (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\n\treturn components;\n};\n\nfunction _stripLeadingZeros(str:string):string {\n\treturn str.replace(/^0*(.*)/, \"$1\") || \"0\";\n}\n\nfunction _normalizeIPv4(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV4ADDRESS) || [];\n\tconst [, address] = matches;\n\t\n\tif (address) {\n\t\treturn address.split(\".\").map(_stripLeadingZeros).join(\".\");\n\t} else {\n\t\treturn host;\n\t}\n}\n\nfunction _normalizeIPv6(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV6ADDRESS) || [];\n\tconst [, address, zone] = matches;\n\n\tif (address) {\n\t\tconst [last, first] = address.toLowerCase().split('::').reverse();\n\t\tconst firstFields = first ? first.split(\":\").map(_stripLeadingZeros) : [];\n\t\tconst lastFields = last.split(\":\").map(_stripLeadingZeros);\n\t\tconst isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);\n\t\tconst fieldCount = isLastFieldIPv4Address ? 7 : 8;\n\t\tconst lastFieldsStart = lastFields.length - fieldCount;\n\t\tconst fields = Array<string>(fieldCount);\n\n\t\tfor (let x = 0; x < fieldCount; ++x) {\n\t\t\tfields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';\n\t\t}\n\n\t\tif (isLastFieldIPv4Address) {\n\t\t\tfields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);\n\t\t}\n\n\t\tconst allZeroFields = fields.reduce<Array<{index:number,length:number}>>((acc, field, index) => {\n\t\t\tif (!field || field === \"0\") {\n\t\t\t\tconst lastLongest = acc[acc.length - 1];\n\t\t\t\tif (lastLongest && lastLongest.index + lastLongest.length === index) {\n\t\t\t\t\tlastLongest.length++;\n\t\t\t\t} else {\n\t\t\t\t\tacc.push({ index, length : 1 });\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, []);\n\n\t\tconst longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0];\n\n\t\tlet newHost:string;\n\t\tif (longestZeroFields && longestZeroFields.length > 1) {\n\t\t\tconst newFirst = fields.slice(0, longestZeroFields.index) ;\n\t\t\tconst newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);\n\t\t\tnewHost = newFirst.join(\":\") + \"::\" + newLast.join(\":\");\n\t\t} else {\n\t\t\tnewHost = fields.join(\":\");\n\t\t}\n\n\t\tif (zone) {\n\t\t\tnewHost += \"%\" + zone;\n\t\t}\n\n\t\treturn newHost;\n\t} else {\n\t\treturn host;\n\t}\n}\n\nconst URI_PARSE = /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:([^\\/?#@]*)@)?(\\[[^\\/?#\\]]+\\]|[^\\/?#:]*)(?:\\:(\\d*))?))?([^?#]*)(?:\\?([^#]*))?(?:#((?:.|\\n|\\r)*))?/i;\nconst NO_MATCH_IS_UNDEFINED = (<RegExpMatchArray>(\"\").match(/(){0}/))[1] === undefined;\n\nexport function parse(uriString:string, options:URIOptions = {}):URIComponents {\n\tconst components:URIComponents = {};\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\n\tif (options.reference === \"suffix\") uriString = (options.scheme ? options.scheme + \":\" : \"\") + \"//\" + uriString;\n\n\tconst matches = uriString.match(URI_PARSE);\n\n\tif (matches) {\n\t\tif (NO_MATCH_IS_UNDEFINED) {\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1];\n\t\t\tcomponents.userinfo = matches[3];\n\t\t\tcomponents.host = matches[4];\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = matches[7];\n\t\t\tcomponents.fragment = matches[8];\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = matches[5];\n\t\t\t}\n\t\t} else { //IE FIX for improper RegExp matching\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1] || undefined;\n\t\t\tcomponents.userinfo = (uriString.indexOf(\"@\") !== -1 ? matches[3] : undefined);\n\t\t\tcomponents.host = (uriString.indexOf(\"//\") !== -1 ? matches[4] : undefined);\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = (uriString.indexOf(\"?\") !== -1 ? matches[7] : undefined);\n\t\t\tcomponents.fragment = (uriString.indexOf(\"#\") !== -1 ? matches[8] : undefined);\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = (uriString.match(/\\/\\/(?:.|\\n)*\\:(?:\\/|\\?|\\#|$)/) ? matches[4] : undefined);\n\t\t\t}\n\t\t}\n\n\t\tif (components.host) {\n\t\t\t//normalize IP hosts\n\t\t\tcomponents.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);\n\t\t}\n\n\t\t//determine reference type\n\t\tif (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {\n\t\t\tcomponents.reference = \"same-document\";\n\t\t} else if (components.scheme === undefined) {\n\t\t\tcomponents.reference = \"relative\";\n\t\t} else if (components.fragment === undefined) {\n\t\t\tcomponents.reference = \"absolute\";\n\t\t} else {\n\t\t\tcomponents.reference = \"uri\";\n\t\t}\n\n\t\t//check for reference errors\n\t\tif (options.reference && options.reference !== \"suffix\" && options.reference !== components.reference) {\n\t\t\tcomponents.error = components.error || \"URI is not a \" + options.reference + \" reference.\";\n\t\t}\n\n\t\t//find scheme handler\n\t\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t\t//check if scheme can't handle IRIs\n\t\tif (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n\t\t\t//if host component is a domain name\n\t\t\tif (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\tcomponents.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//convert IRI -> URI\n\t\t\t_normalizeComponentEncoding(components, URI_PROTOCOL);\n\t\t} else {\n\t\t\t//normalize encodings\n\t\t\t_normalizeComponentEncoding(components, protocol);\n\t\t}\n\n\t\t//perform scheme specific parsing\n\t\tif (schemeHandler && schemeHandler.parse) {\n\t\t\tschemeHandler.parse(components, options);\n\t\t}\n\t} else {\n\t\tcomponents.error = components.error || \"URI can not be parsed.\";\n\t}\n\n\treturn components;\n};\n\nfunction _recomposeAuthority(components:URIComponents, options:URIOptions):string|undefined {\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array<string> = [];\n\n\tif (components.userinfo !== undefined) {\n\t\turiTokens.push(components.userinfo);\n\t\turiTokens.push(\"@\");\n\t}\n\n\tif (components.host !== undefined) {\n\t\t//normalize IP hosts, add brackets and escape zone separator for IPv6\n\t\turiTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => \"[\" + $1 + ($2 ? \"%25\" + $2 : \"\") + \"]\"));\n\t}\n\n\tif (typeof components.port === \"number\") {\n\t\turiTokens.push(\":\");\n\t\turiTokens.push(components.port.toString(10));\n\t}\n\n\treturn uriTokens.length ? uriTokens.join(\"\") : undefined;\n};\n\nconst RDS1 = /^\\.\\.?\\//;\nconst RDS2 = /^\\/\\.(\\/|$)/;\nconst RDS3 = /^\\/\\.\\.(\\/|$)/;\nconst RDS4 = /^\\.\\.?$/;\nconst RDS5 = /^\\/?(?:.|\\n)*?(?=\\/|$)/;\n\nexport function removeDotSegments(input:string):string {\n\tconst output:Array<string> = [];\n\n\twhile (input.length) {\n\t\tif (input.match(RDS1)) {\n\t\t\tinput = input.replace(RDS1, \"\");\n\t\t} else if (input.match(RDS2)) {\n\t\t\tinput = input.replace(RDS2, \"/\");\n\t\t} else if (input.match(RDS3)) {\n\t\t\tinput = input.replace(RDS3, \"/\");\n\t\t\toutput.pop();\n\t\t} else if (input === \".\" || input === \"..\") {\n\t\t\tinput = \"\";\n\t\t} else {\n\t\t\tconst im = input.match(RDS5);\n\t\t\tif (im) {\n\t\t\t\tconst s = im[0];\n\t\t\t\tinput = input.slice(s.length);\n\t\t\t\toutput.push(s);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Unexpected dot segment condition\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn output.join(\"\");\n};\n\nexport function serialize(components:URIComponents, options:URIOptions = {}):string {\n\tconst protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array<string> = [];\n\n\t//find scheme handler\n\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t//perform scheme specific serialization\n\tif (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);\n\n\tif (components.host) {\n\t\t//if host component is an IPv6 address\n\t\tif (protocol.IPV6ADDRESS.test(components.host)) {\n\t\t\t//TODO: normalize IPv6 address as per RFC 5952\n\t\t}\n\n\t\t//if host component is a domain name\n\t\telse if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) {\n\t\t\t//convert IDN via punycode\n\t\t\ttry {\n\t\t\t\tcomponents.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host));\n\t\t\t} catch (e) {\n\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t}\n\t\t}\n\t}\n\n\t//normalize encoding\n\t_normalizeComponentEncoding(components, protocol);\n\n\tif (options.reference !== \"suffix\" && components.scheme) {\n\t\turiTokens.push(components.scheme);\n\t\turiTokens.push(\":\");\n\t}\n\n\tconst authority = _recomposeAuthority(components, options);\n\tif (authority !== undefined) {\n\t\tif (options.reference !== \"suffix\") {\n\t\t\turiTokens.push(\"//\");\n\t\t}\n\n\t\turiTokens.push(authority);\n\n\t\tif (components.path && components.path.charAt(0) !== \"/\") {\n\t\t\turiTokens.push(\"/\");\n\t\t}\n\t}\n\n\tif (components.path !== undefined) {\n\t\tlet s = components.path;\n\n\t\tif (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n\t\t\ts = removeDotSegments(s);\n\t\t}\n\n\t\tif (authority === undefined) {\n\t\t\ts = s.replace(/^\\/\\//, \"/%2F\"); //don't allow the path to start with \"//\"\n\t\t}\n\n\t\turiTokens.push(s);\n\t}\n\n\tif (components.query !== undefined) {\n\t\turiTokens.push(\"?\");\n\t\turiTokens.push(components.query);\n\t}\n\n\tif (components.fragment !== undefined) {\n\t\turiTokens.push(\"#\");\n\t\turiTokens.push(components.fragment);\n\t}\n\n\treturn uriTokens.join(\"\"); //merge tokens into a string\n};\n\nexport function resolveComponents(base:URIComponents, relative:URIComponents, options:URIOptions = {}, skipNormalization?:boolean):URIComponents {\n\tconst target:URIComponents = {};\n\n\tif (!skipNormalization) {\n\t\tbase = parse(serialize(base, options), options); //normalize base components\n\t\trelative = parse(serialize(relative, options), options); //normalize relative components\n\t}\n\toptions = options || {};\n\n\tif (!options.tolerant && relative.scheme) {\n\t\ttarget.scheme = relative.scheme;\n\t\t//target.authority = relative.authority;\n\t\ttarget.userinfo = relative.userinfo;\n\t\ttarget.host = relative.host;\n\t\ttarget.port = relative.port;\n\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\ttarget.query = relative.query;\n\t} else {\n\t\tif (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n\t\t\t//target.authority = relative.authority;\n\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\ttarget.host = relative.host;\n\t\t\ttarget.port = relative.port;\n\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\ttarget.query = relative.query;\n\t\t} else {\n\t\t\tif (!relative.path) {\n\t\t\t\ttarget.path = base.path;\n\t\t\t\tif (relative.query !== undefined) {\n\t\t\t\t\ttarget.query = relative.query;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.query = base.query;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (relative.path.charAt(0) === \"/\") {\n\t\t\t\t\ttarget.path = removeDotSegments(relative.path);\n\t\t\t\t} else {\n\t\t\t\t\tif ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n\t\t\t\t\t\ttarget.path = \"/\" + relative.path;\n\t\t\t\t\t} else if (!base.path) {\n\t\t\t\t\t\ttarget.path = relative.path;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n\t\t\t\t\t}\n\t\t\t\t\ttarget.path = removeDotSegments(target.path);\n\t\t\t\t}\n\t\t\t\ttarget.query = relative.query;\n\t\t\t}\n\t\t\t//target.authority = base.authority;\n\t\t\ttarget.userinfo = base.userinfo;\n\t\t\ttarget.host = base.host;\n\t\t\ttarget.port = base.port;\n\t\t}\n\t\ttarget.scheme = base.scheme;\n\t}\n\n\ttarget.fragment = relative.fragment;\n\n\treturn target;\n};\n\nexport function resolve(baseURI:string, relativeURI:string, options?:URIOptions):string {\n\tconst schemelessOptions = assign({ scheme : 'null' }, options);\n\treturn serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);\n};\n\nexport function normalize(uri:string, options?:URIOptions):string;\nexport function normalize(uri:URIComponents, options?:URIOptions):URIComponents;\nexport function normalize(uri:any, options?:URIOptions):any {\n\tif (typeof uri === \"string\") {\n\t\turi = serialize(parse(uri, options), options);\n\t} else if (typeOf(uri) === \"object\") {\n\t\turi = parse(serialize(<URIComponents>uri, options), options);\n\t}\n\n\treturn uri;\n};\n\nexport function equal(uriA:string, uriB:string, options?: URIOptions):boolean;\nexport function equal(uriA:URIComponents, uriB:URIComponents, options?:URIOptions):boolean;\nexport function equal(uriA:any, uriB:any, options?:URIOptions):boolean {\n\tif (typeof uriA === \"string\") {\n\t\turiA = serialize(parse(uriA, options), options);\n\t} else if (typeOf(uriA) === \"object\") {\n\t\turiA = serialize(<URIComponents>uriA, options);\n\t}\n\n\tif (typeof uriB === \"string\") {\n\t\turiB = serialize(parse(uriB, options), options);\n\t} else if (typeOf(uriB) === \"object\") {\n\t\turiB = serialize(<URIComponents>uriB, options);\n\t}\n\n\treturn uriA === uriB;\n};\n\nexport function escapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar);\n};\n\nexport function unescapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars);\n};\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"http\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\t//report missing host\n\t\tif (!components.host) {\n\t\t\tcomponents.error = components.error || \"HTTP URIs must have a host.\";\n\t\t}\n\n\t\treturn components;\n\t},\n\n\tserialize : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\t//normalize the default port\n\t\tif (components.port === (String(components.scheme).toLowerCase() !== \"https\" ? 80 : 443) || components.port === \"\") {\n\t\t\tcomponents.port = undefined;\n\t\t}\n\t\t\n\t\t//normalize the empty path\n\t\tif (!components.path) {\n\t\t\tcomponents.path = \"/\";\n\t\t}\n\n\t\t//NOTE: We do not parse query strings for HTTP URIs\n\t\t//as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n\t\t//and not the HTTP spec.\n\n\t\treturn components;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport http from \"./http\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"https\",\n\tdomainHost : http.domainHost,\n\tparse : http.parse,\n\tserialize : http.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, pctDecChars, unescapeComponent } from \"../uri\";\nimport punycode from \"punycode\";\nimport { merge, subexp, toUpperCase, toArray } from \"../util\";\n\nexport interface MailtoHeaders {\n\t[hfname:string]:string\n}\n\nexport interface MailtoComponents extends URIComponents {\n\tto:Array<string>,\n\theaders?:MailtoHeaders,\n\tsubject?:string,\n\tbody?:string\n}\n\nconst O:MailtoHeaders = {};\nconst isIRI = true;\n\n//RFC 3986\nconst UNRESERVED$$ = \"[A-Za-z0-9\\\\-\\\\.\\\\_\\\\~\" + (isIRI ? \"\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF\" : \"\") + \"]\";\nconst HEXDIG$$ = \"[0-9A-Fa-f]\"; //case-insensitive\nconst PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)); //expanded\n\n//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =\n//const ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\#\\\\$\\\\%\\\\&\\\\'\\\\*\\\\+\\\\-\\\\/\\\\=\\\\?\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QTEXT$$ = \"[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x7F]\"; //(%d1-8 / %d11-12 / %d14-31 / %d127)\n//const QTEXT$$ = merge(\"[\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]\", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext\n//const VCHAR$$ = \"[\\\\x21-\\\\x7E]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QP$ = subexp(\"\\\\\\\\\" + merge(\"[\\\\x00\\\\x0D\\\\x0A]\", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext\n//const FWS$ = subexp(subexp(WSP$$ + \"*\" + \"\\\\x0D\\\\x0A\") + \"?\" + WSP$$ + \"+\");\n//const QUOTED_PAIR$ = subexp(subexp(\"\\\\\\\\\" + subexp(VCHAR$$ + \"|\" + WSP$$)) + \"|\" + OBS_QP$);\n//const QUOTED_STRING$ = subexp('\\\\\"' + subexp(FWS$ + \"?\" + QCONTENT$) + \"*\" + FWS$ + \"?\" + '\\\\\"');\nconst ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\$\\\\%\\\\'\\\\*\\\\+\\\\-\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\nconst QTEXT$$ = \"[\\\\!\\\\$\\\\%\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\-\\\\.0-9\\\\<\\\\>A-Z\\\\x5E-\\\\x7E]\";\nconst VCHAR$$ = merge(QTEXT$$, \"[\\\\\\\"\\\\\\\\]\");\nconst DOT_ATOM_TEXT$ = subexp(ATEXT$$ + \"+\" + subexp(\"\\\\.\" + ATEXT$$ + \"+\") + \"*\");\nconst QUOTED_PAIR$ = subexp(\"\\\\\\\\\" + VCHAR$$);\nconst QCONTENT$ = subexp(QTEXT$$ + \"|\" + QUOTED_PAIR$);\nconst QUOTED_STRING$ = subexp('\\\\\"' + QCONTENT$ + \"*\" + '\\\\\"');\n\n//RFC 6068\nconst DTEXT_NO_OBS$$ = \"[\\\\x21-\\\\x5A\\\\x5E-\\\\x7E]\"; //%d33-90 / %d94-126\nconst SOME_DELIMS$$ = \"[\\\\!\\\\$\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\:\\\\@]\";\nconst QCHAR$ = subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$ + \"|\" + SOME_DELIMS$$);\nconst DOMAIN$ = subexp(DOT_ATOM_TEXT$ + \"|\" + \"\\\\[\" + DTEXT_NO_OBS$$ + \"*\" + \"\\\\]\");\nconst LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + \"|\" + QUOTED_STRING$);\nconst ADDR_SPEC$ = subexp(LOCAL_PART$ + \"\\\\@\" + DOMAIN$);\nconst TO$ = subexp(ADDR_SPEC$ + subexp(\"\\\\,\" + ADDR_SPEC$) + \"*\");\nconst HFNAME$ = subexp(QCHAR$ + \"*\");\nconst HFVALUE$ = HFNAME$;\nconst HFIELD$ = subexp(HFNAME$ + \"\\\\=\" + HFVALUE$);\nconst HFIELDS2$ = subexp(HFIELD$ + subexp(\"\\\\&\" + HFIELD$) + \"*\");\nconst HFIELDS$ = subexp(\"\\\\?\" + HFIELDS2$);\nconst MAILTO_URI = new RegExp(\"^mailto\\\\:\" + TO$ + \"?\" + HFIELDS$ + \"?$\");\n\nconst UNRESERVED = new RegExp(UNRESERVED$$, \"g\");\nconst PCT_ENCODED = new RegExp(PCT_ENCODED$, \"g\");\nconst NOT_LOCAL_PART = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", '[\\\\\"]', VCHAR$$), \"g\");\nconst NOT_DOMAIN = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", \"[\\\\[]\", DTEXT_NO_OBS$$, \"[\\\\]]\"), \"g\");\nconst NOT_HFNAME = new RegExp(merge(\"[^]\", UNRESERVED$$, SOME_DELIMS$$), \"g\");\nconst NOT_HFVALUE = NOT_HFNAME;\nconst TO = new RegExp(\"^\" + TO$ + \"$\");\nconst HFIELDS = new RegExp(\"^\" + HFIELDS2$ + \"$\");\n\nfunction decodeUnreserved(str:string):string {\n\tconst decStr = pctDecChars(str);\n\treturn (!decStr.match(UNRESERVED) ? str : decStr);\n}\n\nconst handler:URISchemeHandler<MailtoComponents> = {\n\tscheme : \"mailto\",\n\n\tparse : function (components:URIComponents, options:URIOptions):MailtoComponents {\n\t\tconst mailtoComponents = components as MailtoComponents;\n\t\tconst to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(\",\") : []);\n\t\tmailtoComponents.path = undefined;\n\n\t\tif (mailtoComponents.query) {\n\t\t\tlet unknownHeaders = false\n\t\t\tconst headers:MailtoHeaders = {};\n\t\t\tconst hfields = mailtoComponents.query.split(\"&\");\n\n\t\t\tfor (let x = 0, xl = hfields.length; x < xl; ++x) {\n\t\t\t\tconst hfield = hfields[x].split(\"=\");\n\n\t\t\t\tswitch (hfield[0]) {\n\t\t\t\t\tcase \"to\":\n\t\t\t\t\t\tconst toAddrs = hfield[1].split(\",\");\n\t\t\t\t\t\tfor (let x = 0, xl = toAddrs.length; x < xl; ++x) {\n\t\t\t\t\t\t\tto.push(toAddrs[x]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"subject\":\n\t\t\t\t\t\tmailtoComponents.subject = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"body\":\n\t\t\t\t\t\tmailtoComponents.body = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tunknownHeaders = true;\n\t\t\t\t\t\theaders[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (unknownHeaders) mailtoComponents.headers = headers;\n\t\t}\n\n\t\tmailtoComponents.query = undefined;\n\n\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\tconst addr = to[x].split(\"@\");\n\n\t\t\taddr[0] = unescapeComponent(addr[0]);\n\n\t\t\tif (!options.unicodeSupport) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\taddr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tmailtoComponents.error = mailtoComponents.error || \"Email address's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddr[1] = unescapeComponent(addr[1], options).toLowerCase();\n\t\t\t}\n\n\t\t\tto[x] = addr.join(\"@\");\n\t\t}\n\n\t\treturn mailtoComponents;\n\t},\n\n\tserialize : function (mailtoComponents:MailtoComponents, options:URIOptions):URIComponents {\n\t\tconst components = mailtoComponents as URIComponents;\n\t\tconst to = toArray(mailtoComponents.to);\n\t\tif (to) {\n\t\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\t\tconst toAddr = String(to[x]);\n\t\t\t\tconst atIdx = toAddr.lastIndexOf(\"@\");\n\t\t\t\tconst localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);\n\t\t\t\tlet domain = toAddr.slice(atIdx + 1);\n\n\t\t\t\t//convert IDN via punycode\n\t\t\t\ttry {\n\t\t\t\t\tdomain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Email address's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t\t}\n\n\t\t\t\tto[x] = localPart + \"@\" + domain;\n\t\t\t}\n\n\t\t\tcomponents.path = to.join(\",\");\n\t\t}\n\n\t\tconst headers = mailtoComponents.headers = mailtoComponents.headers || {};\n\n\t\tif (mailtoComponents.subject) headers[\"subject\"] = mailtoComponents.subject;\n\t\tif (mailtoComponents.body) headers[\"body\"] = mailtoComponents.body;\n\n\t\tconst fields = [];\n\t\tfor (const name in headers) {\n\t\t\tif (headers[name] !== O[name]) {\n\t\t\t\tfields.push(\n\t\t\t\t\tname.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) +\n\t\t\t\t\t\"=\" +\n\t\t\t\t\theaders[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (fields.length) {\n\t\t\tcomponents.query = fields.join(\"&\");\n\t\t}\n\n\t\treturn components;\n\t}\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, SCHEMES } from \"../uri\";\n\nexport interface URNComponents extends URIComponents {\n\tnid?:string;\n\tnss?:string;\n}\n\nexport interface URNOptions extends URIOptions {\n\tnid?:string;\n}\n\nconst NID$ = \"(?:[0-9A-Za-z][0-9A-Za-z\\\\-]{1,31})\";\nconst PCT_ENCODED$ = \"(?:\\\\%[0-9A-Fa-f]{2})\";\nconst TRANS$$ = \"[0-9A-Za-z\\\\(\\\\)\\\\+\\\\,\\\\-\\\\.\\\\:\\\\=\\\\@\\\\;\\\\$\\\\_\\\\!\\\\*\\\\'\\\\/\\\\?\\\\#]\";\nconst NSS$ = \"(?:(?:\" + PCT_ENCODED$ + \"|\" + TRANS$$ + \")+)\";\nconst URN_SCHEME = new RegExp(\"^urn\\\\:(\" + NID$ + \")$\");\nconst URN_PATH = new RegExp(\"^(\" + NID$ + \")\\\\:(\" + NSS$ + \")$\");\nconst URN_PARSE = /^([^\\:]+)\\:(.*)/;\nconst URN_EXCLUDED = /[\\x00-\\x20\\\\\\\"\\&\\<\\>\\[\\]\\^\\`\\{\\|\\}\\~\\x7F-\\xFF]/g;\n\n//RFC 2141\nconst handler:URISchemeHandler<URNComponents,URNOptions> = {\n\tscheme : \"urn\",\n\n\tparse : function (components:URIComponents, options:URNOptions):URNComponents {\n\t\tconst matches = components.path && components.path.match(URN_PARSE);\n\t\tlet urnComponents = components as URNComponents;\n\n\t\tif (matches) {\n\t\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\t\tconst nid = matches[1].toLowerCase();\n\t\t\tconst nss = matches[2];\n\t\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\t\turnComponents.nid = nid;\n\t\t\turnComponents.nss = nss;\n\t\t\turnComponents.path = undefined;\n\n\t\t\tif (schemeHandler) {\n\t\t\t\turnComponents = schemeHandler.parse(urnComponents, options) as URNComponents;\n\t\t\t}\n\t\t} else {\n\t\t\turnComponents.error = urnComponents.error || \"URN can not be parsed.\";\n\t\t}\n\n\t\treturn urnComponents;\n\t},\n\n\tserialize : function (urnComponents:URNComponents, options:URNOptions):URIComponents {\n\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\tconst nid = urnComponents.nid;\n\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\tif (schemeHandler) {\n\t\t\turnComponents = schemeHandler.serialize(urnComponents, options) as URNComponents;\n\t\t}\n\n\t\tconst uriComponents = urnComponents as URIComponents;\n\t\tconst nss = urnComponents.nss;\n\t\turiComponents.path = `${nid || options.nid}:${nss}`;\n\n\t\treturn uriComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { URNComponents } from \"./urn\";\nimport { SCHEMES } from \"../uri\";\n\nexport interface UUIDComponents extends URNComponents {\n\tuuid?: string;\n}\n\nconst UUID = /^[0-9A-Fa-f]{8}(?:\\-[0-9A-Fa-f]{4}){3}\\-[0-9A-Fa-f]{12}$/;\nconst UUID_PARSE = /^[0-9A-Fa-f\\-]{36}/;\n\n//RFC 4122\nconst handler:URISchemeHandler<UUIDComponents, URIOptions, URNComponents> = {\n\tscheme : \"urn:uuid\",\n\n\tparse : function (urnComponents:URNComponents, options:URIOptions):UUIDComponents {\n\t\tconst uuidComponents = urnComponents as UUIDComponents;\n\t\tuuidComponents.uuid = uuidComponents.nss;\n\t\tuuidComponents.nss = undefined;\n\n\t\tif (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\n\t\t\tuuidComponents.error = uuidComponents.error || \"UUID is not valid.\";\n\t\t}\n\n\t\treturn uuidComponents;\n\t},\n\n\tserialize : function (uuidComponents:UUIDComponents, options:URIOptions):URNComponents {\n\t\tconst urnComponents = uuidComponents as URNComponents;\n\t\t//normalize UUID\n\t\turnComponents.nss = (uuidComponents.uuid || \"\").toLowerCase();\n\t\treturn urnComponents;\n\t},\n};\n\nexport default handler;","import { SCHEMES } from \"./uri\";\n\nimport http from \"./schemes/http\";\nSCHEMES[http.scheme] = http;\n\nimport https from \"./schemes/https\";\nSCHEMES[https.scheme] = https;\n\nimport mailto from \"./schemes/mailto\";\nSCHEMES[mailto.scheme] = mailto;\n\nimport urn from \"./schemes/urn\";\nSCHEMES[urn.scheme] = urn;\n\nimport uuid from \"./schemes/urn-uuid\";\nSCHEMES[uuid.scheme] = uuid;\n\nexport * from \"./uri\";\n","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","'use strict';\n\n// https://mathiasbynens.be/notes/javascript-encoding\n// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode\nmodule.exports = function ucs2length(str) {\n var length = 0\n , len = str.length\n , pos = 0\n , value;\n while (pos < len) {\n length++;\n value = str.charCodeAt(pos++);\n if (value >= 0xD800 && value <= 0xDBFF && pos < len) {\n // high surrogate, and there is a next character\n value = str.charCodeAt(pos);\n if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate\n }\n }\n return length;\n};\n","'use strict';\n\n\nmodule.exports = {\n copy: copy,\n checkDataType: checkDataType,\n checkDataTypes: checkDataTypes,\n coerceToTypes: coerceToTypes,\n toHash: toHash,\n getProperty: getProperty,\n escapeQuotes: escapeQuotes,\n equal: require('fast-deep-equal'),\n ucs2length: require('./ucs2length'),\n varOccurences: varOccurences,\n varReplace: varReplace,\n schemaHasRules: schemaHasRules,\n schemaHasRulesExcept: schemaHasRulesExcept,\n schemaUnknownRules: schemaUnknownRules,\n toQuotedString: toQuotedString,\n getPathExpr: getPathExpr,\n getPath: getPath,\n getData: getData,\n unescapeFragment: unescapeFragment,\n unescapeJsonPointer: unescapeJsonPointer,\n escapeFragment: escapeFragment,\n escapeJsonPointer: escapeJsonPointer\n};\n\n\nfunction copy(o, to) {\n to = to || {};\n for (var key in o) to[key] = o[key];\n return to;\n}\n\n\nfunction checkDataType(dataType, data, strictNumbers, negate) {\n var EQUAL = negate ? ' !== ' : ' === '\n , AND = negate ? ' || ' : ' && '\n , OK = negate ? '!' : ''\n , NOT = negate ? '' : '!';\n switch (dataType) {\n case 'null': return data + EQUAL + 'null';\n case 'array': return OK + 'Array.isArray(' + data + ')';\n case 'object': return '(' + OK + data + AND +\n 'typeof ' + data + EQUAL + '\"object\"' + AND +\n NOT + 'Array.isArray(' + data + '))';\n case 'integer': return '(typeof ' + data + EQUAL + '\"number\"' + AND +\n NOT + '(' + data + ' % 1)' +\n AND + data + EQUAL + data +\n (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')';\n case 'number': return '(typeof ' + data + EQUAL + '\"' + dataType + '\"' +\n (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')';\n default: return 'typeof ' + data + EQUAL + '\"' + dataType + '\"';\n }\n}\n\n\nfunction checkDataTypes(dataTypes, data, strictNumbers) {\n switch (dataTypes.length) {\n case 1: return checkDataType(dataTypes[0], data, strictNumbers, true);\n default:\n var code = '';\n var types = toHash(dataTypes);\n if (types.array && types.object) {\n code = types.null ? '(': '(!' + data + ' || ';\n code += 'typeof ' + data + ' !== \"object\")';\n delete types.null;\n delete types.array;\n delete types.object;\n }\n if (types.number) delete types.integer;\n for (var t in types)\n code += (code ? ' && ' : '' ) + checkDataType(t, data, strictNumbers, true);\n\n return code;\n }\n}\n\n\nvar COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]);\nfunction coerceToTypes(optionCoerceTypes, dataTypes) {\n if (Array.isArray(dataTypes)) {\n var types = [];\n for (var i=0; i<dataTypes.length; i++) {\n var t = dataTypes[i];\n if (COERCE_TO_TYPES[t]) types[types.length] = t;\n else if (optionCoerceTypes === 'array' && t === 'array') types[types.length] = t;\n }\n if (types.length) return types;\n } else if (COERCE_TO_TYPES[dataTypes]) {\n return [dataTypes];\n } else if (optionCoerceTypes === 'array' && dataTypes === 'array') {\n return ['array'];\n }\n}\n\n\nfunction toHash(arr) {\n var hash = {};\n for (var i=0; i<arr.length; i++) hash[arr[i]] = true;\n return hash;\n}\n\n\nvar IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;\nvar SINGLE_QUOTE = /'|\\\\/g;\nfunction getProperty(key) {\n return typeof key == 'number'\n ? '[' + key + ']'\n : IDENTIFIER.test(key)\n ? '.' + key\n : \"['\" + escapeQuotes(key) + \"']\";\n}\n\n\nfunction escapeQuotes(str) {\n return str.replace(SINGLE_QUOTE, '\\\\$&')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/\\f/g, '\\\\f')\n .replace(/\\t/g, '\\\\t');\n}\n\n\nfunction varOccurences(str, dataVar) {\n dataVar += '[^0-9]';\n var matches = str.match(new RegExp(dataVar, 'g'));\n return matches ? matches.length : 0;\n}\n\n\nfunction varReplace(str, dataVar, expr) {\n dataVar += '([^0-9])';\n expr = expr.replace(/\\$/g, '$$$$');\n return str.replace(new RegExp(dataVar, 'g'), expr + '$1');\n}\n\n\nfunction schemaHasRules(schema, rules) {\n if (typeof schema == 'boolean') return !schema;\n for (var key in schema) if (rules[key]) return true;\n}\n\n\nfunction schemaHasRulesExcept(schema, rules, exceptKeyword) {\n if (typeof schema == 'boolean') return !schema && exceptKeyword != 'not';\n for (var key in schema) if (key != exceptKeyword && rules[key]) return true;\n}\n\n\nfunction schemaUnknownRules(schema, rules) {\n if (typeof schema == 'boolean') return;\n for (var key in schema) if (!rules[key]) return key;\n}\n\n\nfunction toQuotedString(str) {\n return '\\'' + escapeQuotes(str) + '\\'';\n}\n\n\nfunction getPathExpr(currentPath, expr, jsonPointers, isNumber) {\n var path = jsonPointers // false by default\n ? '\\'/\\' + ' + expr + (isNumber ? '' : '.replace(/~/g, \\'~0\\').replace(/\\\\//g, \\'~1\\')')\n : (isNumber ? '\\'[\\' + ' + expr + ' + \\']\\'' : '\\'[\\\\\\'\\' + ' + expr + ' + \\'\\\\\\']\\'');\n return joinPaths(currentPath, path);\n}\n\n\nfunction getPath(currentPath, prop, jsonPointers) {\n var path = jsonPointers // false by default\n ? toQuotedString('/' + escapeJsonPointer(prop))\n : toQuotedString(getProperty(prop));\n return joinPaths(currentPath, path);\n}\n\n\nvar JSON_POINTER = /^\\/(?:[^~]|~0|~1)*$/;\nvar RELATIVE_JSON_POINTER = /^([0-9]+)(#|\\/(?:[^~]|~0|~1)*)?$/;\nfunction getData($data, lvl, paths) {\n var up, jsonPointer, data, matches;\n if ($data === '') return 'rootData';\n if ($data[0] == '/') {\n if (!JSON_POINTER.test($data)) throw new Error('Invalid JSON-pointer: ' + $data);\n jsonPointer = $data;\n data = 'rootData';\n } else {\n matches = $data.match(RELATIVE_JSON_POINTER);\n if (!matches) throw new Error('Invalid JSON-pointer: ' + $data);\n up = +matches[1];\n jsonPointer = matches[2];\n if (jsonPointer == '#') {\n if (up >= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl);\n return paths[lvl - up];\n }\n\n if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl);\n data = 'data' + ((lvl - up) || '');\n if (!jsonPointer) return data;\n }\n\n var expr = data;\n var segments = jsonPointer.split('/');\n for (var i=0; i<segments.length; i++) {\n var segment = segments[i];\n if (segment) {\n data += getProperty(unescapeJsonPointer(segment));\n expr += ' && ' + data;\n }\n }\n return expr;\n}\n\n\nfunction joinPaths (a, b) {\n if (a == '\"\"') return b;\n return (a + ' + ' + b).replace(/([^\\\\])' \\+ '/g, '$1');\n}\n\n\nfunction unescapeFragment(str) {\n return unescapeJsonPointer(decodeURIComponent(str));\n}\n\n\nfunction escapeFragment(str) {\n return encodeURIComponent(escapeJsonPointer(str));\n}\n\n\nfunction escapeJsonPointer(str) {\n return str.replace(/~/g, '~0').replace(/\\//g, '~1');\n}\n\n\nfunction unescapeJsonPointer(str) {\n return str.replace(/~1/g, '/').replace(/~0/g, '~');\n}\n","'use strict';\n\nvar util = require('./util');\n\nmodule.exports = SchemaObject;\n\nfunction SchemaObject(obj) {\n util.copy(obj, this);\n}\n","'use strict';\n\nvar traverse = module.exports = function (schema, opts, cb) {\n // Legacy support for v0.3.1 and earlier.\n if (typeof opts == 'function') {\n cb = opts;\n opts = {};\n }\n\n cb = opts.cb || cb;\n var pre = (typeof cb == 'function') ? cb : cb.pre || function() {};\n var post = cb.post || function() {};\n\n _traverse(opts, pre, post, schema, '', schema);\n};\n\n\ntraverse.keywords = {\n additionalItems: true,\n items: true,\n contains: true,\n additionalProperties: true,\n propertyNames: true,\n not: true\n};\n\ntraverse.arrayKeywords = {\n items: true,\n allOf: true,\n anyOf: true,\n oneOf: true\n};\n\ntraverse.propsKeywords = {\n definitions: true,\n properties: true,\n patternProperties: true,\n dependencies: true\n};\n\ntraverse.skipKeywords = {\n default: true,\n enum: true,\n const: true,\n required: true,\n maximum: true,\n minimum: true,\n exclusiveMaximum: true,\n exclusiveMinimum: true,\n multipleOf: true,\n maxLength: true,\n minLength: true,\n pattern: true,\n format: true,\n maxItems: true,\n minItems: true,\n uniqueItems: true,\n maxProperties: true,\n minProperties: true\n};\n\n\nfunction _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {\n if (schema && typeof schema == 'object' && !Array.isArray(schema)) {\n pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n for (var key in schema) {\n var sch = schema[key];\n if (Array.isArray(sch)) {\n if (key in traverse.arrayKeywords) {\n for (var i=0; i<sch.length; i++)\n _traverse(opts, pre, post, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i);\n }\n } else if (key in traverse.propsKeywords) {\n if (sch && typeof sch == 'object') {\n for (var prop in sch)\n _traverse(opts, pre, post, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);\n }\n } else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) {\n _traverse(opts, pre, post, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema);\n }\n }\n post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n }\n}\n\n\nfunction escapeJsonPtr(str) {\n return str.replace(/~/g, '~0').replace(/\\//g, '~1');\n}\n","'use strict';\n\nvar URI = require('uri-js')\n , equal = require('fast-deep-equal')\n , util = require('./util')\n , SchemaObject = require('./schema_obj')\n , traverse = require('json-schema-traverse');\n\nmodule.exports = resolve;\n\nresolve.normalizeId = normalizeId;\nresolve.fullPath = getFullPath;\nresolve.url = resolveUrl;\nresolve.ids = resolveIds;\nresolve.inlineRef = inlineRef;\nresolve.schema = resolveSchema;\n\n/**\n * [resolve and compile the references ($ref)]\n * @this Ajv\n * @param {Function} compile reference to schema compilation funciton (localCompile)\n * @param {Object} root object with information about the root schema for the current schema\n * @param {String} ref reference to resolve\n * @return {Object|Function} schema object (if the schema can be inlined) or validation function\n */\nfunction resolve(compile, root, ref) {\n /* jshint validthis: true */\n var refVal = this._refs[ref];\n if (typeof refVal == 'string') {\n if (this._refs[refVal]) refVal = this._refs[refVal];\n else return resolve.call(this, compile, root, refVal);\n }\n\n refVal = refVal || this._schemas[ref];\n if (refVal instanceof SchemaObject) {\n return inlineRef(refVal.schema, this._opts.inlineRefs)\n ? refVal.schema\n : refVal.validate || this._compile(refVal);\n }\n\n var res = resolveSchema.call(this, root, ref);\n var schema, v, baseId;\n if (res) {\n schema = res.schema;\n root = res.root;\n baseId = res.baseId;\n }\n\n if (schema instanceof SchemaObject) {\n v = schema.validate || compile.call(this, schema.schema, root, undefined, baseId);\n } else if (schema !== undefined) {\n v = inlineRef(schema, this._opts.inlineRefs)\n ? schema\n : compile.call(this, schema, root, undefined, baseId);\n }\n\n return v;\n}\n\n\n/**\n * Resolve schema, its root and baseId\n * @this Ajv\n * @param {Object} root root object with properties schema, refVal, refs\n * @param {String} ref reference to resolve\n * @return {Object} object with properties schema, root, baseId\n */\nfunction resolveSchema(root, ref) {\n /* jshint validthis: true */\n var p = URI.parse(ref)\n , refPath = _getFullPath(p)\n , baseId = getFullPath(this._getId(root.schema));\n if (Object.keys(root.schema).length === 0 || refPath !== baseId) {\n var id = normalizeId(refPath);\n var refVal = this._refs[id];\n if (typeof refVal == 'string') {\n return resolveRecursive.call(this, root, refVal, p);\n } else if (refVal instanceof SchemaObject) {\n if (!refVal.validate) this._compile(refVal);\n root = refVal;\n } else {\n refVal = this._schemas[id];\n if (refVal instanceof SchemaObject) {\n if (!refVal.validate) this._compile(refVal);\n if (id == normalizeId(ref))\n return { schema: refVal, root: root, baseId: baseId };\n root = refVal;\n } else {\n return;\n }\n }\n if (!root.schema) return;\n baseId = getFullPath(this._getId(root.schema));\n }\n return getJsonPointer.call(this, p, baseId, root.schema, root);\n}\n\n\n/* @this Ajv */\nfunction resolveRecursive(root, ref, parsedRef) {\n /* jshint validthis: true */\n var res = resolveSchema.call(this, root, ref);\n if (res) {\n var schema = res.schema;\n var baseId = res.baseId;\n root = res.root;\n var id = this._getId(schema);\n if (id) baseId = resolveUrl(baseId, id);\n return getJsonPointer.call(this, parsedRef, baseId, schema, root);\n }\n}\n\n\nvar PREVENT_SCOPE_CHANGE = util.toHash(['properties', 'patternProperties', 'enum', 'dependencies', 'definitions']);\n/* @this Ajv */\nfunction getJsonPointer(parsedRef, baseId, schema, root) {\n /* jshint validthis: true */\n parsedRef.fragment = parsedRef.fragment || '';\n if (parsedRef.fragment.slice(0,1) != '/') return;\n var parts = parsedRef.fragment.split('/');\n\n for (var i = 1; i < parts.length; i++) {\n var part = parts[i];\n if (part) {\n part = util.unescapeFragment(part);\n schema = schema[part];\n if (schema === undefined) break;\n var id;\n if (!PREVENT_SCOPE_CHANGE[part]) {\n id = this._getId(schema);\n if (id) baseId = resolveUrl(baseId, id);\n if (schema.$ref) {\n var $ref = resolveUrl(baseId, schema.$ref);\n var res = resolveSchema.call(this, root, $ref);\n if (res) {\n schema = res.schema;\n root = res.root;\n baseId = res.baseId;\n }\n }\n }\n }\n }\n if (schema !== undefined && schema !== root.schema)\n return { schema: schema, root: root, baseId: baseId };\n}\n\n\nvar SIMPLE_INLINED = util.toHash([\n 'type', 'format', 'pattern',\n 'maxLength', 'minLength',\n 'maxProperties', 'minProperties',\n 'maxItems', 'minItems',\n 'maximum', 'minimum',\n 'uniqueItems', 'multipleOf',\n 'required', 'enum'\n]);\nfunction inlineRef(schema, limit) {\n if (limit === false) return false;\n if (limit === undefined || limit === true) return checkNoRef(schema);\n else if (limit) return countKeys(schema) <= limit;\n}\n\n\nfunction checkNoRef(schema) {\n var item;\n if (Array.isArray(schema)) {\n for (var i=0; i<schema.length; i++) {\n item = schema[i];\n if (typeof item == 'object' && !checkNoRef(item)) return false;\n }\n } else {\n for (var key in schema) {\n if (key == '$ref') return false;\n item = schema[key];\n if (typeof item == 'object' && !checkNoRef(item)) return false;\n }\n }\n return true;\n}\n\n\nfunction countKeys(schema) {\n var count = 0, item;\n if (Array.isArray(schema)) {\n for (var i=0; i<schema.length; i++) {\n item = schema[i];\n if (typeof item == 'object') count += countKeys(item);\n if (count == Infinity) return Infinity;\n }\n } else {\n for (var key in schema) {\n if (key == '$ref') return Infinity;\n if (SIMPLE_INLINED[key]) {\n count++;\n } else {\n item = schema[key];\n if (typeof item == 'object') count += countKeys(item) + 1;\n if (count == Infinity) return Infinity;\n }\n }\n }\n return count;\n}\n\n\nfunction getFullPath(id, normalize) {\n if (normalize !== false) id = normalizeId(id);\n var p = URI.parse(id);\n return _getFullPath(p);\n}\n\n\nfunction _getFullPath(p) {\n return URI.serialize(p).split('#')[0] + '#';\n}\n\n\nvar TRAILING_SLASH_HASH = /#\\/?$/;\nfunction normalizeId(id) {\n return id ? id.replace(TRAILING_SLASH_HASH, '') : '';\n}\n\n\nfunction resolveUrl(baseId, id) {\n id = normalizeId(id);\n return URI.resolve(baseId, id);\n}\n\n\n/* @this Ajv */\nfunction resolveIds(schema) {\n var schemaId = normalizeId(this._getId(schema));\n var baseIds = {'': schemaId};\n var fullPaths = {'': getFullPath(schemaId, false)};\n var localRefs = {};\n var self = this;\n\n traverse(schema, {allKeys: true}, function(sch, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {\n if (jsonPtr === '') return;\n var id = self._getId(sch);\n var baseId = baseIds[parentJsonPtr];\n var fullPath = fullPaths[parentJsonPtr] + '/' + parentKeyword;\n if (keyIndex !== undefined)\n fullPath += '/' + (typeof keyIndex == 'number' ? keyIndex : util.escapeFragment(keyIndex));\n\n if (typeof id == 'string') {\n id = baseId = normalizeId(baseId ? URI.resolve(baseId, id) : id);\n\n var refVal = self._refs[id];\n if (typeof refVal == 'string') refVal = self._refs[refVal];\n if (refVal && refVal.schema) {\n if (!equal(sch, refVal.schema))\n throw new Error('id \"' + id + '\" resolves to more than one schema');\n } else if (id != normalizeId(fullPath)) {\n if (id[0] == '#') {\n if (localRefs[id] && !equal(sch, localRefs[id]))\n throw new Error('id \"' + id + '\" resolves to more than one schema');\n localRefs[id] = sch;\n } else {\n self._refs[id] = fullPath;\n }\n }\n }\n baseIds[jsonPtr] = baseId;\n fullPaths[jsonPtr] = fullPath;\n });\n\n return localRefs;\n}\n","'use strict';\n\nvar resolve = require('./resolve');\n\nmodule.exports = {\n Validation: errorSubclass(ValidationError),\n MissingRef: errorSubclass(MissingRefError)\n};\n\n\nfunction ValidationError(errors) {\n this.message = 'validation failed';\n this.errors = errors;\n this.ajv = this.validation = true;\n}\n\n\nMissingRefError.message = function (baseId, ref) {\n return 'can\\'t resolve reference ' + ref + ' from id ' + baseId;\n};\n\n\nfunction MissingRefError(baseId, ref, message) {\n this.message = message || MissingRefError.message(baseId, ref);\n this.missingRef = resolve.url(baseId, ref);\n this.missingSchema = resolve.normalizeId(resolve.fullPath(this.missingRef));\n}\n\n\nfunction errorSubclass(Subclass) {\n Subclass.prototype = Object.create(Error.prototype);\n Subclass.prototype.constructor = Subclass;\n return Subclass;\n}\n","'use strict';\n\nmodule.exports = function (data, opts) {\n if (!opts) opts = {};\n if (typeof opts === 'function') opts = { cmp: opts };\n var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;\n\n var cmp = opts.cmp && (function (f) {\n return function (node) {\n return function (a, b) {\n var aobj = { key: a, value: node[a] };\n var bobj = { key: b, value: node[b] };\n return f(aobj, bobj);\n };\n };\n })(opts.cmp);\n\n var seen = [];\n return (function stringify (node) {\n if (node && node.toJSON && typeof node.toJSON === 'function') {\n node = node.toJSON();\n }\n\n if (node === undefined) return;\n if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';\n if (typeof node !== 'object') return JSON.stringify(node);\n\n var i, out;\n if (Array.isArray(node)) {\n out = '[';\n for (i = 0; i < node.length; i++) {\n if (i) out += ',';\n out += stringify(node[i]) || 'null';\n }\n return out + ']';\n }\n\n if (node === null) return 'null';\n\n if (seen.indexOf(node) !== -1) {\n if (cycles) return JSON.stringify('__cycle__');\n throw new TypeError('Converting circular structure to JSON');\n }\n\n var seenIndex = seen.push(node) - 1;\n var keys = Object.keys(node).sort(cmp && cmp(node));\n out = '';\n for (i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = stringify(node[key]);\n\n if (!value) continue;\n if (out) out += ',';\n out += JSON.stringify(key) + ':' + value;\n }\n seen.splice(seenIndex, 1);\n return '{' + out + '}';\n })(data);\n};\n","'use strict';\nmodule.exports = function generate_validate(it, $keyword, $ruleType) {\n var out = '';\n var $async = it.schema.$async === true,\n $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'),\n $id = it.self._getId(it.schema);\n if (it.opts.strictKeywords) {\n var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords);\n if ($unknownKwd) {\n var $keywordsMsg = 'unknown keyword: ' + $unknownKwd;\n if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg);\n else throw new Error($keywordsMsg);\n }\n }\n if (it.isTop) {\n out += ' var validate = ';\n if ($async) {\n it.async = true;\n out += 'async ';\n }\n out += 'function(data, dataPath, parentData, parentDataProperty, rootData) { \\'use strict\\'; ';\n if ($id && (it.opts.sourceCode || it.opts.processCode)) {\n out += ' ' + ('/\\*# sourceURL=' + $id + ' */') + ' ';\n }\n }\n if (typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref)) {\n var $keyword = 'false schema';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n if (it.schema === false) {\n if (it.isTop) {\n $breakOnError = true;\n } else {\n out += ' var ' + ($valid) + ' = false; ';\n }\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || 'false schema') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'boolean schema is false\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n } else {\n if (it.isTop) {\n if ($async) {\n out += ' return data; ';\n } else {\n out += ' validate.errors = null; return true; ';\n }\n } else {\n out += ' var ' + ($valid) + ' = true; ';\n }\n }\n if (it.isTop) {\n out += ' }; return validate; ';\n }\n return out;\n }\n if (it.isTop) {\n var $top = it.isTop,\n $lvl = it.level = 0,\n $dataLvl = it.dataLevel = 0,\n $data = 'data';\n it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema));\n it.baseId = it.baseId || it.rootId;\n delete it.isTop;\n it.dataPathArr = [\"\"];\n if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) {\n var $defaultMsg = 'default is ignored in the schema root';\n if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);\n else throw new Error($defaultMsg);\n }\n out += ' var vErrors = null; ';\n out += ' var errors = 0; ';\n out += ' if (rootData === undefined) rootData = data; ';\n } else {\n var $lvl = it.level,\n $dataLvl = it.dataLevel,\n $data = 'data' + ($dataLvl || '');\n if ($id) it.baseId = it.resolve.url(it.baseId, $id);\n if ($async && !it.async) throw new Error('async schema in sync schema');\n out += ' var errs_' + ($lvl) + ' = errors;';\n }\n var $valid = 'valid' + $lvl,\n $breakOnError = !it.opts.allErrors,\n $closingBraces1 = '',\n $closingBraces2 = '';\n var $errorKeyword;\n var $typeSchema = it.schema.type,\n $typeIsArray = Array.isArray($typeSchema);\n if ($typeSchema && it.opts.nullable && it.schema.nullable === true) {\n if ($typeIsArray) {\n if ($typeSchema.indexOf('null') == -1) $typeSchema = $typeSchema.concat('null');\n } else if ($typeSchema != 'null') {\n $typeSchema = [$typeSchema, 'null'];\n $typeIsArray = true;\n }\n }\n if ($typeIsArray && $typeSchema.length == 1) {\n $typeSchema = $typeSchema[0];\n $typeIsArray = false;\n }\n if (it.schema.$ref && $refKeywords) {\n if (it.opts.extendRefs == 'fail') {\n throw new Error('$ref: validation keywords used in schema at path \"' + it.errSchemaPath + '\" (see option extendRefs)');\n } else if (it.opts.extendRefs !== true) {\n $refKeywords = false;\n it.logger.warn('$ref: keywords ignored in schema at path \"' + it.errSchemaPath + '\"');\n }\n }\n if (it.schema.$comment && it.opts.$comment) {\n out += ' ' + (it.RULES.all.$comment.code(it, '$comment'));\n }\n if ($typeSchema) {\n if (it.opts.coerceTypes) {\n var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema);\n }\n var $rulesGroup = it.RULES.types[$typeSchema];\n if ($coerceToTypes || $typeIsArray || $rulesGroup === true || ($rulesGroup && !$shouldUseGroup($rulesGroup))) {\n var $schemaPath = it.schemaPath + '.type',\n $errSchemaPath = it.errSchemaPath + '/type';\n var $schemaPath = it.schemaPath + '.type',\n $errSchemaPath = it.errSchemaPath + '/type',\n $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType';\n out += ' if (' + (it.util[$method]($typeSchema, $data, it.opts.strictNumbers, true)) + ') { ';\n if ($coerceToTypes) {\n var $dataType = 'dataType' + $lvl,\n $coerced = 'coerced' + $lvl;\n out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; var ' + ($coerced) + ' = undefined; ';\n if (it.opts.coerceTypes == 'array') {\n out += ' if (' + ($dataType) + ' == \\'object\\' && Array.isArray(' + ($data) + ') && ' + ($data) + '.length == 1) { ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; if (' + (it.util.checkDataType(it.schema.type, $data, it.opts.strictNumbers)) + ') ' + ($coerced) + ' = ' + ($data) + '; } ';\n }\n out += ' if (' + ($coerced) + ' !== undefined) ; ';\n var arr1 = $coerceToTypes;\n if (arr1) {\n var $type, $i = -1,\n l1 = arr1.length - 1;\n while ($i < l1) {\n $type = arr1[$i += 1];\n if ($type == 'string') {\n out += ' else if (' + ($dataType) + ' == \\'number\\' || ' + ($dataType) + ' == \\'boolean\\') ' + ($coerced) + ' = \\'\\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \\'\\'; ';\n } else if ($type == 'number' || $type == 'integer') {\n out += ' else if (' + ($dataType) + ' == \\'boolean\\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \\'string\\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' ';\n if ($type == 'integer') {\n out += ' && !(' + ($data) + ' % 1)';\n }\n out += ')) ' + ($coerced) + ' = +' + ($data) + '; ';\n } else if ($type == 'boolean') {\n out += ' else if (' + ($data) + ' === \\'false\\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \\'true\\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; ';\n } else if ($type == 'null') {\n out += ' else if (' + ($data) + ' === \\'\\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; ';\n } else if (it.opts.coerceTypes == 'array' && $type == 'array') {\n out += ' else if (' + ($dataType) + ' == \\'string\\' || ' + ($dataType) + ' == \\'number\\' || ' + ($dataType) + ' == \\'boolean\\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; ';\n }\n }\n }\n out += ' else { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || 'type') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \\'';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be ';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } if (' + ($coerced) + ' !== undefined) { ';\n var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',\n $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';\n out += ' ' + ($data) + ' = ' + ($coerced) + '; ';\n if (!$dataLvl) {\n out += 'if (' + ($parentData) + ' !== undefined)';\n }\n out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } ';\n } else {\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || 'type') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \\'';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be ';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n }\n out += ' } ';\n }\n }\n if (it.schema.$ref && !$refKeywords) {\n out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' ';\n if ($breakOnError) {\n out += ' } if (errors === ';\n if ($top) {\n out += '0';\n } else {\n out += 'errs_' + ($lvl);\n }\n out += ') { ';\n $closingBraces2 += '}';\n }\n } else {\n var arr2 = it.RULES;\n if (arr2) {\n var $rulesGroup, i2 = -1,\n l2 = arr2.length - 1;\n while (i2 < l2) {\n $rulesGroup = arr2[i2 += 1];\n if ($shouldUseGroup($rulesGroup)) {\n if ($rulesGroup.type) {\n out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data, it.opts.strictNumbers)) + ') { ';\n }\n if (it.opts.useDefaults) {\n if ($rulesGroup.type == 'object' && it.schema.properties) {\n var $schema = it.schema.properties,\n $schemaKeys = Object.keys($schema);\n var arr3 = $schemaKeys;\n if (arr3) {\n var $propertyKey, i3 = -1,\n l3 = arr3.length - 1;\n while (i3 < l3) {\n $propertyKey = arr3[i3 += 1];\n var $sch = $schema[$propertyKey];\n if ($sch.default !== undefined) {\n var $passData = $data + it.util.getProperty($propertyKey);\n if (it.compositeRule) {\n if (it.opts.strictDefaults) {\n var $defaultMsg = 'default is ignored for: ' + $passData;\n if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);\n else throw new Error($defaultMsg);\n }\n } else {\n out += ' if (' + ($passData) + ' === undefined ';\n if (it.opts.useDefaults == 'empty') {\n out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \\'\\' ';\n }\n out += ' ) ' + ($passData) + ' = ';\n if (it.opts.useDefaults == 'shared') {\n out += ' ' + (it.useDefault($sch.default)) + ' ';\n } else {\n out += ' ' + (JSON.stringify($sch.default)) + ' ';\n }\n out += '; ';\n }\n }\n }\n }\n } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) {\n var arr4 = it.schema.items;\n if (arr4) {\n var $sch, $i = -1,\n l4 = arr4.length - 1;\n while ($i < l4) {\n $sch = arr4[$i += 1];\n if ($sch.default !== undefined) {\n var $passData = $data + '[' + $i + ']';\n if (it.compositeRule) {\n if (it.opts.strictDefaults) {\n var $defaultMsg = 'default is ignored for: ' + $passData;\n if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);\n else throw new Error($defaultMsg);\n }\n } else {\n out += ' if (' + ($passData) + ' === undefined ';\n if (it.opts.useDefaults == 'empty') {\n out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \\'\\' ';\n }\n out += ' ) ' + ($passData) + ' = ';\n if (it.opts.useDefaults == 'shared') {\n out += ' ' + (it.useDefault($sch.default)) + ' ';\n } else {\n out += ' ' + (JSON.stringify($sch.default)) + ' ';\n }\n out += '; ';\n }\n }\n }\n }\n }\n }\n var arr5 = $rulesGroup.rules;\n if (arr5) {\n var $rule, i5 = -1,\n l5 = arr5.length - 1;\n while (i5 < l5) {\n $rule = arr5[i5 += 1];\n if ($shouldUseRule($rule)) {\n var $code = $rule.code(it, $rule.keyword, $rulesGroup.type);\n if ($code) {\n out += ' ' + ($code) + ' ';\n if ($breakOnError) {\n $closingBraces1 += '}';\n }\n }\n }\n }\n }\n if ($breakOnError) {\n out += ' ' + ($closingBraces1) + ' ';\n $closingBraces1 = '';\n }\n if ($rulesGroup.type) {\n out += ' } ';\n if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) {\n out += ' else { ';\n var $schemaPath = it.schemaPath + '.type',\n $errSchemaPath = it.errSchemaPath + '/type';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || 'type') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \\'';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be ';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } ';\n }\n }\n if ($breakOnError) {\n out += ' if (errors === ';\n if ($top) {\n out += '0';\n } else {\n out += 'errs_' + ($lvl);\n }\n out += ') { ';\n $closingBraces2 += '}';\n }\n }\n }\n }\n }\n if ($breakOnError) {\n out += ' ' + ($closingBraces2) + ' ';\n }\n if ($top) {\n if ($async) {\n out += ' if (errors === 0) return data; ';\n out += ' else throw new ValidationError(vErrors); ';\n } else {\n out += ' validate.errors = vErrors; ';\n out += ' return errors === 0; ';\n }\n out += ' }; return validate;';\n } else {\n out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';';\n }\n\n function $shouldUseGroup($rulesGroup) {\n var rules = $rulesGroup.rules;\n for (var i = 0; i < rules.length; i++)\n if ($shouldUseRule(rules[i])) return true;\n }\n\n function $shouldUseRule($rule) {\n return it.schema[$rule.keyword] !== undefined || ($rule.implements && $ruleImplementsSomeKeyword($rule));\n }\n\n function $ruleImplementsSomeKeyword($rule) {\n var impl = $rule.implements;\n for (var i = 0; i < impl.length; i++)\n if (it.schema[impl[i]] !== undefined) return true;\n }\n return out;\n}\n","'use strict';\n\nvar resolve = require('./resolve')\n , util = require('./util')\n , errorClasses = require('./error_classes')\n , stableStringify = require('fast-json-stable-stringify');\n\nvar validateGenerator = require('../dotjs/validate');\n\n/**\n * Functions below are used inside compiled validations function\n */\n\nvar ucs2length = util.ucs2length;\nvar equal = require('fast-deep-equal');\n\n// this error is thrown by async schemas to return validation errors via exception\nvar ValidationError = errorClasses.Validation;\n\nmodule.exports = compile;\n\n\n/**\n * Compiles schema to validation function\n * @this Ajv\n * @param {Object} schema schema object\n * @param {Object} root object with information about the root schema for this schema\n * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution\n * @param {String} baseId base ID for IDs in the schema\n * @return {Function} validation function\n */\nfunction compile(schema, root, localRefs, baseId) {\n /* jshint validthis: true, evil: true */\n /* eslint no-shadow: 0 */\n var self = this\n , opts = this._opts\n , refVal = [ undefined ]\n , refs = {}\n , patterns = []\n , patternsHash = {}\n , defaults = []\n , defaultsHash = {}\n , customRules = [];\n\n root = root || { schema: schema, refVal: refVal, refs: refs };\n\n var c = checkCompiling.call(this, schema, root, baseId);\n var compilation = this._compilations[c.index];\n if (c.compiling) return (compilation.callValidate = callValidate);\n\n var formats = this._formats;\n var RULES = this.RULES;\n\n try {\n var v = localCompile(schema, root, localRefs, baseId);\n compilation.validate = v;\n var cv = compilation.callValidate;\n if (cv) {\n cv.schema = v.schema;\n cv.errors = null;\n cv.refs = v.refs;\n cv.refVal = v.refVal;\n cv.root = v.root;\n cv.$async = v.$async;\n if (opts.sourceCode) cv.source = v.source;\n }\n return v;\n } finally {\n endCompiling.call(this, schema, root, baseId);\n }\n\n /* @this {*} - custom context, see passContext option */\n function callValidate() {\n /* jshint validthis: true */\n var validate = compilation.validate;\n var result = validate.apply(this, arguments);\n callValidate.errors = validate.errors;\n return result;\n }\n\n function localCompile(_schema, _root, localRefs, baseId) {\n var isRoot = !_root || (_root && _root.schema == _schema);\n if (_root.schema != root.schema)\n return compile.call(self, _schema, _root, localRefs, baseId);\n\n var $async = _schema.$async === true;\n\n var sourceCode = validateGenerator({\n isTop: true,\n schema: _schema,\n isRoot: isRoot,\n baseId: baseId,\n root: _root,\n schemaPath: '',\n errSchemaPath: '#',\n errorPath: '\"\"',\n MissingRefError: errorClasses.MissingRef,\n RULES: RULES,\n validate: validateGenerator,\n util: util,\n resolve: resolve,\n resolveRef: resolveRef,\n usePattern: usePattern,\n useDefault: useDefault,\n useCustomRule: useCustomRule,\n opts: opts,\n formats: formats,\n logger: self.logger,\n self: self\n });\n\n sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode)\n + vars(defaults, defaultCode) + vars(customRules, customRuleCode)\n + sourceCode;\n\n if (opts.processCode) sourceCode = opts.processCode(sourceCode, _schema);\n // console.log('\\n\\n\\n *** \\n', JSON.stringify(sourceCode));\n var validate;\n try {\n var makeValidate = new Function(\n 'self',\n 'RULES',\n 'formats',\n 'root',\n 'refVal',\n 'defaults',\n 'customRules',\n 'equal',\n 'ucs2length',\n 'ValidationError',\n sourceCode\n );\n\n validate = makeValidate(\n self,\n RULES,\n formats,\n root,\n refVal,\n defaults,\n customRules,\n equal,\n ucs2length,\n ValidationError\n );\n\n refVal[0] = validate;\n } catch(e) {\n self.logger.error('Error compiling schema, function code:', sourceCode);\n throw e;\n }\n\n validate.schema = _schema;\n validate.errors = null;\n validate.refs = refs;\n validate.refVal = refVal;\n validate.root = isRoot ? validate : _root;\n if ($async) validate.$async = true;\n if (opts.sourceCode === true) {\n validate.source = {\n code: sourceCode,\n patterns: patterns,\n defaults: defaults\n };\n }\n\n return validate;\n }\n\n function resolveRef(baseId, ref, isRoot) {\n ref = resolve.url(baseId, ref);\n var refIndex = refs[ref];\n var _refVal, refCode;\n if (refIndex !== undefined) {\n _refVal = refVal[refIndex];\n refCode = 'refVal[' + refIndex + ']';\n return resolvedRef(_refVal, refCode);\n }\n if (!isRoot && root.refs) {\n var rootRefId = root.refs[ref];\n if (rootRefId !== undefined) {\n _refVal = root.refVal[rootRefId];\n refCode = addLocalRef(ref, _refVal);\n return resolvedRef(_refVal, refCode);\n }\n }\n\n refCode = addLocalRef(ref);\n var v = resolve.call(self, localCompile, root, ref);\n if (v === undefined) {\n var localSchema = localRefs && localRefs[ref];\n if (localSchema) {\n v = resolve.inlineRef(localSchema, opts.inlineRefs)\n ? localSchema\n : compile.call(self, localSchema, root, localRefs, baseId);\n }\n }\n\n if (v === undefined) {\n removeLocalRef(ref);\n } else {\n replaceLocalRef(ref, v);\n return resolvedRef(v, refCode);\n }\n }\n\n function addLocalRef(ref, v) {\n var refId = refVal.length;\n refVal[refId] = v;\n refs[ref] = refId;\n return 'refVal' + refId;\n }\n\n function removeLocalRef(ref) {\n delete refs[ref];\n }\n\n function replaceLocalRef(ref, v) {\n var refId = refs[ref];\n refVal[refId] = v;\n }\n\n function resolvedRef(refVal, code) {\n return typeof refVal == 'object' || typeof refVal == 'boolean'\n ? { code: code, schema: refVal, inline: true }\n : { code: code, $async: refVal && !!refVal.$async };\n }\n\n function usePattern(regexStr) {\n var index = patternsHash[regexStr];\n if (index === undefined) {\n index = patternsHash[regexStr] = patterns.length;\n patterns[index] = regexStr;\n }\n return 'pattern' + index;\n }\n\n function useDefault(value) {\n switch (typeof value) {\n case 'boolean':\n case 'number':\n return '' + value;\n case 'string':\n return util.toQuotedString(value);\n case 'object':\n if (value === null) return 'null';\n var valueStr = stableStringify(value);\n var index = defaultsHash[valueStr];\n if (index === undefined) {\n index = defaultsHash[valueStr] = defaults.length;\n defaults[index] = value;\n }\n return 'default' + index;\n }\n }\n\n function useCustomRule(rule, schema, parentSchema, it) {\n if (self._opts.validateSchema !== false) {\n var deps = rule.definition.dependencies;\n if (deps && !deps.every(function(keyword) {\n return Object.prototype.hasOwnProperty.call(parentSchema, keyword);\n }))\n throw new Error('parent schema must have all required keywords: ' + deps.join(','));\n\n var validateSchema = rule.definition.validateSchema;\n if (validateSchema) {\n var valid = validateSchema(schema);\n if (!valid) {\n var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors);\n if (self._opts.validateSchema == 'log') self.logger.error(message);\n else throw new Error(message);\n }\n }\n }\n\n var compile = rule.definition.compile\n , inline = rule.definition.inline\n , macro = rule.definition.macro;\n\n var validate;\n if (compile) {\n validate = compile.call(self, schema, parentSchema, it);\n } else if (macro) {\n validate = macro.call(self, schema, parentSchema, it);\n if (opts.validateSchema !== false) self.validateSchema(validate, true);\n } else if (inline) {\n validate = inline.call(self, it, rule.keyword, schema, parentSchema);\n } else {\n validate = rule.definition.validate;\n if (!validate) return;\n }\n\n if (validate === undefined)\n throw new Error('custom keyword \"' + rule.keyword + '\"failed to compile');\n\n var index = customRules.length;\n customRules[index] = validate;\n\n return {\n code: 'customRule' + index,\n validate: validate\n };\n }\n}\n\n\n/**\n * Checks if the schema is currently compiled\n * @this Ajv\n * @param {Object} schema schema to compile\n * @param {Object} root root object\n * @param {String} baseId base schema ID\n * @return {Object} object with properties \"index\" (compilation index) and \"compiling\" (boolean)\n */\nfunction checkCompiling(schema, root, baseId) {\n /* jshint validthis: true */\n var index = compIndex.call(this, schema, root, baseId);\n if (index >= 0) return { index: index, compiling: true };\n index = this._compilations.length;\n this._compilations[index] = {\n schema: schema,\n root: root,\n baseId: baseId\n };\n return { index: index, compiling: false };\n}\n\n\n/**\n * Removes the schema from the currently compiled list\n * @this Ajv\n * @param {Object} schema schema to compile\n * @param {Object} root root object\n * @param {String} baseId base schema ID\n */\nfunction endCompiling(schema, root, baseId) {\n /* jshint validthis: true */\n var i = compIndex.call(this, schema, root, baseId);\n if (i >= 0) this._compilations.splice(i, 1);\n}\n\n\n/**\n * Index of schema compilation in the currently compiled list\n * @this Ajv\n * @param {Object} schema schema to compile\n * @param {Object} root root object\n * @param {String} baseId base schema ID\n * @return {Integer} compilation index\n */\nfunction compIndex(schema, root, baseId) {\n /* jshint validthis: true */\n for (var i=0; i<this._compilations.length; i++) {\n var c = this._compilations[i];\n if (c.schema == schema && c.root == root && c.baseId == baseId) return i;\n }\n return -1;\n}\n\n\nfunction patternCode(i, patterns) {\n return 'var pattern' + i + ' = new RegExp(' + util.toQuotedString(patterns[i]) + ');';\n}\n\n\nfunction defaultCode(i) {\n return 'var default' + i + ' = defaults[' + i + '];';\n}\n\n\nfunction refValCode(i, refVal) {\n return refVal[i] === undefined ? '' : 'var refVal' + i + ' = refVal[' + i + '];';\n}\n\n\nfunction customRuleCode(i) {\n return 'var customRule' + i + ' = customRules[' + i + '];';\n}\n\n\nfunction vars(arr, statement) {\n if (!arr.length) return '';\n var code = '';\n for (var i=0; i<arr.length; i++)\n code += statement(i, arr);\n return code;\n}\n","'use strict';\n\n\nvar Cache = module.exports = function Cache() {\n this._cache = {};\n};\n\n\nCache.prototype.put = function Cache_put(key, value) {\n this._cache[key] = value;\n};\n\n\nCache.prototype.get = function Cache_get(key) {\n return this._cache[key];\n};\n\n\nCache.prototype.del = function Cache_del(key) {\n delete this._cache[key];\n};\n\n\nCache.prototype.clear = function Cache_clear() {\n this._cache = {};\n};\n","'use strict';\n\nvar util = require('./util');\n\nvar DATE = /^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)$/;\nvar DAYS = [0,31,28,31,30,31,30,31,31,30,31,30,31];\nvar TIME = /^(\\d\\d):(\\d\\d):(\\d\\d)(\\.\\d+)?(z|[+-]\\d\\d(?::?\\d\\d)?)?$/i;\nvar HOSTNAME = /^(?=.{1,253}\\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\\.?$/i;\nvar URI = /^(?:[a-z][a-z0-9+\\-.]*:)(?:\\/?\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0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?:[^\\x00-\\x20\"'<>%\\\\^`{|}]|%[0-9a-f]{2})|\\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?)*\\})*$/i;\n// For the source: https://gist.github.com/dperini/729294\n// For test cases: https://mathiasbynens.be/demo/url-regex\n// @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983.\n// var URL = /^(?:(?:https?|ftp):\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!10(?:\\.\\d{1,3}){3})(?!127(?:\\.\\d{1,3}){3})(?!169\\.254(?:\\.\\d{1,3}){2})(?!192\\.168(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u{00a1}-\\u{ffff}0-9]+-)*[a-z\\u{00a1}-\\u{ffff}0-9]+)(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}0-9]+-)*[a-z\\u{00a1}-\\u{ffff}0-9]+)*(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}]{2,})))(?::\\d{2,5})?(?:\\/[^\\s]*)?$/iu;\nvar URL = /^(?:(?:http[s\\u017F]?|ftp):\\/\\/)(?:(?:[\\0-\\x08\\x0E-\\x1F!-\\x9F\\xA1-\\u167F\\u1681-\\u1FFF\\u200B-\\u2027\\u202A-\\u202E\\u2030-\\u205E\\u2060-\\u2FFF\\u3001-\\uD7FF\\uE000-\\uFEFE\\uFF00-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+(?::(?:[\\0-\\x08\\x0E-\\x1F!-\\x9F\\xA1-\\u167F\\u1681-\\u1FFF\\u200B-\\u2027\\u202A-\\u202E\\u2030-\\u205E\\u2060-\\u2FFF\\u3001-\\uD7FF\\uE000-\\uFEFE\\uFF00-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])*)?@)?(?:(?!10(?:\\.[0-9]{1,3}){3})(?!127(?:\\.[0-9]{1,3}){3})(?!169\\.254(?:\\.[0-9]{1,3}){2})(?!192\\.168(?:\\.[0-9]{1,3}){2})(?!172\\.(?:1[6-9]|2[0-9]|3[01])(?:\\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+-)*(?:[0-9a-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+)(?:\\.(?:(?:[0-9a-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+-)*(?:[0-9a-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+)*(?:\\.(?:(?:[a-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\\/(?:[\\0-\\x08\\x0E-\\x1F!-\\x9F\\xA1-\\u167F\\u1681-\\u1FFF\\u200B-\\u2027\\u202A-\\u202E\\u2030-\\u205E\\u2060-\\u2FFF\\u3001-\\uD7FF\\uE000-\\uFEFE\\uFF00-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])*)?$/i;\nvar UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;\nvar JSON_POINTER = /^(?:\\/(?:[^~/]|~0|~1)*)*$/;\nvar JSON_POINTER_URI_FRAGMENT = /^#(?:\\/(?:[a-z0-9_\\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;\nvar RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\\/(?:[^~/]|~0|~1)*)*)$/;\n\n\nmodule.exports = formats;\n\nfunction formats(mode) {\n mode = mode == 'full' ? 'full' : 'fast';\n return util.copy(formats[mode]);\n}\n\n\nformats.fast = {\n // date: http://tools.ietf.org/html/rfc3339#section-5.6\n date: /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/,\n // date-time: http://tools.ietf.org/html/rfc3339#section-5.6\n time: /^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)?$/i,\n 'date-time': /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d[t\\s](?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i,\n // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js\n uri: /^(?:[a-z][a-z0-9+\\-.]*:)(?:\\/?\\/)?[^\\s]*$/i,\n 'uri-reference': /^(?:(?:[a-z][a-z0-9+\\-.]*:)?\\/?\\/)?(?:[^\\\\\\s#][^\\s#]*)?(?:#[^\\\\\\s]*)?$/i,\n 'uri-template': URITEMPLATE,\n url: URL,\n // email (sources from jsen validator):\n // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363\n // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')\n email: /^[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,\n hostname: HOSTNAME,\n // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html\n ipv4: /^(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$/,\n // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses\n ipv6: /^\\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,\n regex: regex,\n // uuid: http://tools.ietf.org/html/rfc4122\n uuid: UUID,\n // JSON-pointer: https://tools.ietf.org/html/rfc6901\n // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A\n 'json-pointer': JSON_POINTER,\n 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT,\n // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00\n 'relative-json-pointer': RELATIVE_JSON_POINTER\n};\n\n\nformats.full = {\n date: date,\n time: time,\n 'date-time': date_time,\n uri: uri,\n 'uri-reference': URIREF,\n 'uri-template': URITEMPLATE,\n url: URL,\n email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,\n hostname: HOSTNAME,\n ipv4: /^(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$/,\n ipv6: /^\\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,\n regex: regex,\n uuid: UUID,\n 'json-pointer': JSON_POINTER,\n 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT,\n 'relative-json-pointer': RELATIVE_JSON_POINTER\n};\n\n\nfunction isLeapYear(year) {\n // https://tools.ietf.org/html/rfc3339#appendix-C\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\n\nfunction date(str) {\n // full-date from http://tools.ietf.org/html/rfc3339#section-5.6\n var matches = str.match(DATE);\n if (!matches) return false;\n\n var year = +matches[1];\n var month = +matches[2];\n var day = +matches[3];\n\n return month >= 1 && month <= 12 && day >= 1 &&\n day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]);\n}\n\n\nfunction time(str, full) {\n var matches = str.match(TIME);\n if (!matches) return false;\n\n var hour = matches[1];\n var minute = matches[2];\n var second = matches[3];\n var timeZone = matches[5];\n return ((hour <= 23 && minute <= 59 && second <= 59) ||\n (hour == 23 && minute == 59 && second == 60)) &&\n (!full || timeZone);\n}\n\n\nvar DATE_TIME_SEPARATOR = /t|\\s/i;\nfunction date_time(str) {\n // http://tools.ietf.org/html/rfc3339#section-5.6\n var dateTime = str.split(DATE_TIME_SEPARATOR);\n return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true);\n}\n\n\nvar NOT_URI_FRAGMENT = /\\/|:/;\nfunction uri(str) {\n // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required \".\"\n return NOT_URI_FRAGMENT.test(str) && URI.test(str);\n}\n\n\nvar Z_ANCHOR = /[^\\\\]\\\\Z/;\nfunction regex(str) {\n if (Z_ANCHOR.test(str)) return false;\n try {\n new RegExp(str);\n return true;\n } catch(e) {\n return false;\n }\n}\n","'use strict';\nmodule.exports = function generate_ref(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $async, $refCode;\n if ($schema == '#' || $schema == '#/') {\n if (it.isRoot) {\n $async = it.async;\n $refCode = 'validate';\n } else {\n $async = it.root.schema.$async === true;\n $refCode = 'root.refVal[0]';\n }\n } else {\n var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot);\n if ($refVal === undefined) {\n var $message = it.MissingRefError.message(it.baseId, $schema);\n if (it.opts.missingRefs == 'fail') {\n it.logger.error($message);\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('$ref') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { ref: \\'' + (it.util.escapeQuotes($schema)) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'can\\\\\\'t resolve reference ' + (it.util.escapeQuotes($schema)) + '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ' + (it.util.toQuotedString($schema)) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n if ($breakOnError) {\n out += ' if (false) { ';\n }\n } else if (it.opts.missingRefs == 'ignore') {\n it.logger.warn($message);\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n } else {\n throw new it.MissingRefError(it.baseId, $schema, $message);\n }\n } else if ($refVal.inline) {\n var $it = it.util.copy(it);\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n $it.schema = $refVal.schema;\n $it.schemaPath = '';\n $it.errSchemaPath = $schema;\n var $code = it.validate($it).replace(/validate\\.schema/g, $refVal.code);\n out += ' ' + ($code) + ' ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n }\n } else {\n $async = $refVal.$async === true || (it.async && $refVal.$async !== false);\n $refCode = $refVal.code;\n }\n }\n if ($refCode) {\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = '';\n if (it.opts.passContext) {\n out += ' ' + ($refCode) + '.call(this, ';\n } else {\n out += ' ' + ($refCode) + '( ';\n }\n out += ' ' + ($data) + ', (dataPath || \\'\\')';\n if (it.errorPath != '\"\"') {\n out += ' + ' + (it.errorPath);\n }\n var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',\n $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';\n out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ', rootData) ';\n var __callValidate = out;\n out = $$outStack.pop();\n if ($async) {\n if (!it.async) throw new Error('async schema referenced by sync schema');\n if ($breakOnError) {\n out += ' var ' + ($valid) + '; ';\n }\n out += ' try { await ' + (__callValidate) + '; ';\n if ($breakOnError) {\n out += ' ' + ($valid) + ' = true; ';\n }\n out += ' } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ';\n if ($breakOnError) {\n out += ' ' + ($valid) + ' = false; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' if (' + ($valid) + ') { ';\n }\n } else {\n out += ' if (!' + (__callValidate) + ') { if (vErrors === null) vErrors = ' + ($refCode) + '.errors; else vErrors = vErrors.concat(' + ($refCode) + '.errors); errors = vErrors.length; } ';\n if ($breakOnError) {\n out += ' else { ';\n }\n }\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_allOf(it, $keyword, $ruleType) {\n var out = ' ';\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $currentBaseId = $it.baseId,\n $allSchemasEmpty = true;\n var arr1 = $schema;\n if (arr1) {\n var $sch, $i = -1,\n l1 = arr1.length - 1;\n while ($i < l1) {\n $sch = arr1[$i += 1];\n if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {\n $allSchemasEmpty = false;\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + '[' + $i + ']';\n $it.errSchemaPath = $errSchemaPath + '/' + $i;\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n }\n }\n if ($breakOnError) {\n if ($allSchemasEmpty) {\n out += ' if (true) { ';\n } else {\n out += ' ' + ($closingBraces.slice(0, -1)) + ' ';\n }\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_anyOf(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $noEmptySchema = $schema.every(function($sch) {\n return (it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all));\n });\n if ($noEmptySchema) {\n var $currentBaseId = $it.baseId;\n out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; ';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n var arr1 = $schema;\n if (arr1) {\n var $sch, $i = -1,\n l1 = arr1.length - 1;\n while ($i < l1) {\n $sch = arr1[$i += 1];\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + '[' + $i + ']';\n $it.errSchemaPath = $errSchemaPath + '/' + $i;\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { ';\n $closingBraces += '}';\n }\n }\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('anyOf') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should match some schema in anyOf\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError(vErrors); ';\n } else {\n out += ' validate.errors = vErrors; return false; ';\n }\n }\n out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';\n if (it.opts.allErrors) {\n out += ' } ';\n }\n } else {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_comment(it, $keyword, $ruleType) {\n var out = ' ';\n var $schema = it.schema[$keyword];\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $comment = it.util.toQuotedString($schema);\n if (it.opts.$comment === true) {\n out += ' console.log(' + ($comment) + ');';\n } else if (typeof it.opts.$comment == 'function') {\n out += ' self._opts.$comment(' + ($comment) + ', ' + (it.util.toQuotedString($errSchemaPath)) + ', validate.root.schema);';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_const(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n if (!$isData) {\n out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';';\n }\n out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('const') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValue: schema' + ($lvl) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be equal to constant\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' }';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_contains(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $idx = 'i' + $lvl,\n $dataNxt = $it.dataLevel = it.dataLevel + 1,\n $nextData = 'data' + $dataNxt,\n $currentBaseId = it.baseId,\n $nonEmptySchema = (it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all));\n out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';\n if ($nonEmptySchema) {\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n $it.schema = $schema;\n $it.schemaPath = $schemaPath;\n $it.errSchemaPath = $errSchemaPath;\n out += ' var ' + ($nextValid) + ' = false; for (var ' + ($idx) + ' = 0; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';\n $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);\n var $passData = $data + '[' + $idx + ']';\n $it.dataPathArr[$dataNxt] = $idx;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n out += ' if (' + ($nextValid) + ') break; } ';\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += ' ' + ($closingBraces) + ' if (!' + ($nextValid) + ') {';\n } else {\n out += ' if (' + ($data) + '.length == 0) {';\n }\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('contains') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should contain a valid item\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else { ';\n if ($nonEmptySchema) {\n out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';\n }\n if (it.opts.allErrors) {\n out += ' } ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_dependencies(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $schemaDeps = {},\n $propertyDeps = {},\n $ownProperties = it.opts.ownProperties;\n for ($property in $schema) {\n if ($property == '__proto__') continue;\n var $sch = $schema[$property];\n var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps;\n $deps[$property] = $sch;\n }\n out += 'var ' + ($errs) + ' = errors;';\n var $currentErrorPath = it.errorPath;\n out += 'var missing' + ($lvl) + ';';\n for (var $property in $propertyDeps) {\n $deps = $propertyDeps[$property];\n if ($deps.length) {\n out += ' if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined ';\n if ($ownProperties) {\n out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($property)) + '\\') ';\n }\n if ($breakOnError) {\n out += ' && ( ';\n var arr1 = $deps;\n if (arr1) {\n var $propertyKey, $i = -1,\n l1 = arr1.length - 1;\n while ($i < l1) {\n $propertyKey = arr1[$i += 1];\n if ($i) {\n out += ' || ';\n }\n var $prop = it.util.getProperty($propertyKey),\n $useData = $data + $prop;\n out += ' ( ( ' + ($useData) + ' === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) ';\n }\n }\n out += ')) { ';\n var $propertyPath = 'missing' + $lvl,\n $missingProperty = '\\' + ' + $propertyPath + ' + \\'';\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath;\n }\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('dependencies') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \\'' + (it.util.escapeQuotes($property)) + '\\', missingProperty: \\'' + ($missingProperty) + '\\', depsCount: ' + ($deps.length) + ', deps: \\'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(\", \"))) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should have ';\n if ($deps.length == 1) {\n out += 'property ' + (it.util.escapeQuotes($deps[0]));\n } else {\n out += 'properties ' + (it.util.escapeQuotes($deps.join(\", \")));\n }\n out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n } else {\n out += ' ) { ';\n var arr2 = $deps;\n if (arr2) {\n var $propertyKey, i2 = -1,\n l2 = arr2.length - 1;\n while (i2 < l2) {\n $propertyKey = arr2[i2 += 1];\n var $prop = it.util.getProperty($propertyKey),\n $missingProperty = it.util.escapeQuotes($propertyKey),\n $useData = $data + $prop;\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);\n }\n out += ' if ( ' + ($useData) + ' === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('dependencies') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \\'' + (it.util.escapeQuotes($property)) + '\\', missingProperty: \\'' + ($missingProperty) + '\\', depsCount: ' + ($deps.length) + ', deps: \\'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(\", \"))) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should have ';\n if ($deps.length == 1) {\n out += 'property ' + (it.util.escapeQuotes($deps[0]));\n } else {\n out += 'properties ' + (it.util.escapeQuotes($deps.join(\", \")));\n }\n out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ';\n }\n }\n }\n out += ' } ';\n if ($breakOnError) {\n $closingBraces += '}';\n out += ' else { ';\n }\n }\n }\n it.errorPath = $currentErrorPath;\n var $currentBaseId = $it.baseId;\n for (var $property in $schemaDeps) {\n var $sch = $schemaDeps[$property];\n if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {\n out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined ';\n if ($ownProperties) {\n out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($property)) + '\\') ';\n }\n out += ') { ';\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + it.util.getProperty($property);\n $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property);\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n out += ' } ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n }\n if ($breakOnError) {\n out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_enum(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $i = 'i' + $lvl,\n $vSchema = 'schema' + $lvl;\n if (!$isData) {\n out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + ';';\n }\n out += 'var ' + ($valid) + ';';\n if ($isData) {\n out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {';\n }\n out += '' + ($valid) + ' = false;for (var ' + ($i) + '=0; ' + ($i) + '<' + ($vSchema) + '.length; ' + ($i) + '++) if (equal(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + '])) { ' + ($valid) + ' = true; break; }';\n if ($isData) {\n out += ' } ';\n }\n out += ' if (!' + ($valid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('enum') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValues: schema' + ($lvl) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be equal to one of the allowed values\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' }';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_format(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n if (it.opts.format === false) {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n return out;\n }\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $unknownFormats = it.opts.unknownFormats,\n $allowUnknown = Array.isArray($unknownFormats);\n if ($isData) {\n var $format = 'format' + $lvl,\n $isObject = 'isObject' + $lvl,\n $formatType = 'formatType' + $lvl;\n out += ' var ' + ($format) + ' = formats[' + ($schemaValue) + ']; var ' + ($isObject) + ' = typeof ' + ($format) + ' == \\'object\\' && !(' + ($format) + ' instanceof RegExp) && ' + ($format) + '.validate; var ' + ($formatType) + ' = ' + ($isObject) + ' && ' + ($format) + '.type || \\'string\\'; if (' + ($isObject) + ') { ';\n if (it.async) {\n out += ' var async' + ($lvl) + ' = ' + ($format) + '.async; ';\n }\n out += ' ' + ($format) + ' = ' + ($format) + '.validate; } if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'string\\') || ';\n }\n out += ' (';\n if ($unknownFormats != 'ignore') {\n out += ' (' + ($schemaValue) + ' && !' + ($format) + ' ';\n if ($allowUnknown) {\n out += ' && self._opts.unknownFormats.indexOf(' + ($schemaValue) + ') == -1 ';\n }\n out += ') || ';\n }\n out += ' (' + ($format) + ' && ' + ($formatType) + ' == \\'' + ($ruleType) + '\\' && !(typeof ' + ($format) + ' == \\'function\\' ? ';\n if (it.async) {\n out += ' (async' + ($lvl) + ' ? await ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) ';\n } else {\n out += ' ' + ($format) + '(' + ($data) + ') ';\n }\n out += ' : ' + ($format) + '.test(' + ($data) + '))))) {';\n } else {\n var $format = it.formats[$schema];\n if (!$format) {\n if ($unknownFormats == 'ignore') {\n it.logger.warn('unknown format \"' + $schema + '\" ignored in schema at path \"' + it.errSchemaPath + '\"');\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n return out;\n } else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n return out;\n } else {\n throw new Error('unknown format \"' + $schema + '\" is used in schema at path \"' + it.errSchemaPath + '\"');\n }\n }\n var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate;\n var $formatType = $isObject && $format.type || 'string';\n if ($isObject) {\n var $async = $format.async === true;\n $format = $format.validate;\n }\n if ($formatType != $ruleType) {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n return out;\n }\n if ($async) {\n if (!it.async) throw new Error('async format in sync schema');\n var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate';\n out += ' if (!(await ' + ($formatRef) + '(' + ($data) + '))) { ';\n } else {\n out += ' if (! ';\n var $formatRef = 'formats' + it.util.getProperty($schema);\n if ($isObject) $formatRef += '.validate';\n if (typeof $format == 'function') {\n out += ' ' + ($formatRef) + '(' + ($data) + ') ';\n } else {\n out += ' ' + ($formatRef) + '.test(' + ($data) + ') ';\n }\n out += ') { ';\n }\n }\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('format') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format: ';\n if ($isData) {\n out += '' + ($schemaValue);\n } else {\n out += '' + (it.util.toQuotedString($schema));\n }\n out += ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should match format \"';\n if ($isData) {\n out += '\\' + ' + ($schemaValue) + ' + \\'';\n } else {\n out += '' + (it.util.escapeQuotes($schema));\n }\n out += '\"\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + (it.util.toQuotedString($schema));\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_if(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $thenSch = it.schema['then'],\n $elseSch = it.schema['else'],\n $thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? (typeof $thenSch == 'object' && Object.keys($thenSch).length > 0) || $thenSch === false : it.util.schemaHasRules($thenSch, it.RULES.all)),\n $elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? (typeof $elseSch == 'object' && Object.keys($elseSch).length > 0) || $elseSch === false : it.util.schemaHasRules($elseSch, it.RULES.all)),\n $currentBaseId = $it.baseId;\n if ($thenPresent || $elsePresent) {\n var $ifClause;\n $it.createErrors = false;\n $it.schema = $schema;\n $it.schemaPath = $schemaPath;\n $it.errSchemaPath = $errSchemaPath;\n out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = true; ';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n $it.createErrors = true;\n out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';\n it.compositeRule = $it.compositeRule = $wasComposite;\n if ($thenPresent) {\n out += ' if (' + ($nextValid) + ') { ';\n $it.schema = it.schema['then'];\n $it.schemaPath = it.schemaPath + '.then';\n $it.errSchemaPath = it.errSchemaPath + '/then';\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n out += ' ' + ($valid) + ' = ' + ($nextValid) + '; ';\n if ($thenPresent && $elsePresent) {\n $ifClause = 'ifClause' + $lvl;\n out += ' var ' + ($ifClause) + ' = \\'then\\'; ';\n } else {\n $ifClause = '\\'then\\'';\n }\n out += ' } ';\n if ($elsePresent) {\n out += ' else { ';\n }\n } else {\n out += ' if (!' + ($nextValid) + ') { ';\n }\n if ($elsePresent) {\n $it.schema = it.schema['else'];\n $it.schemaPath = it.schemaPath + '.else';\n $it.errSchemaPath = it.errSchemaPath + '/else';\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n out += ' ' + ($valid) + ' = ' + ($nextValid) + '; ';\n if ($thenPresent && $elsePresent) {\n $ifClause = 'ifClause' + $lvl;\n out += ' var ' + ($ifClause) + ' = \\'else\\'; ';\n } else {\n $ifClause = '\\'else\\'';\n }\n out += ' } ';\n }\n out += ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('if') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { failingKeyword: ' + ($ifClause) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should match \"\\' + ' + ($ifClause) + ' + \\'\" schema\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError(vErrors); ';\n } else {\n out += ' validate.errors = vErrors; return false; ';\n }\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else { ';\n }\n } else {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_items(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $idx = 'i' + $lvl,\n $dataNxt = $it.dataLevel = it.dataLevel + 1,\n $nextData = 'data' + $dataNxt,\n $currentBaseId = it.baseId;\n out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';\n if (Array.isArray($schema)) {\n var $additionalItems = it.schema.additionalItems;\n if ($additionalItems === false) {\n out += ' ' + ($valid) + ' = ' + ($data) + '.length <= ' + ($schema.length) + '; ';\n var $currErrSchemaPath = $errSchemaPath;\n $errSchemaPath = it.errSchemaPath + '/additionalItems';\n out += ' if (!' + ($valid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('additionalItems') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schema.length) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT have more than ' + ($schema.length) + ' items\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } ';\n $errSchemaPath = $currErrSchemaPath;\n if ($breakOnError) {\n $closingBraces += '}';\n out += ' else { ';\n }\n }\n var arr1 = $schema;\n if (arr1) {\n var $sch, $i = -1,\n l1 = arr1.length - 1;\n while ($i < l1) {\n $sch = arr1[$i += 1];\n if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {\n out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { ';\n var $passData = $data + '[' + $i + ']';\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + '[' + $i + ']';\n $it.errSchemaPath = $errSchemaPath + '/' + $i;\n $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true);\n $it.dataPathArr[$dataNxt] = $i;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n }\n }\n if (typeof $additionalItems == 'object' && (it.opts.strictKeywords ? (typeof $additionalItems == 'object' && Object.keys($additionalItems).length > 0) || $additionalItems === false : it.util.schemaHasRules($additionalItems, it.RULES.all))) {\n $it.schema = $additionalItems;\n $it.schemaPath = it.schemaPath + '.additionalItems';\n $it.errSchemaPath = it.errSchemaPath + '/additionalItems';\n out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';\n $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);\n var $passData = $data + '[' + $idx + ']';\n $it.dataPathArr[$dataNxt] = $idx;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n if ($breakOnError) {\n out += ' if (!' + ($nextValid) + ') break; ';\n }\n out += ' } } ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n } else if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {\n $it.schema = $schema;\n $it.schemaPath = $schemaPath;\n $it.errSchemaPath = $errSchemaPath;\n out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';\n $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);\n var $passData = $data + '[' + $idx + ']';\n $it.dataPathArr[$dataNxt] = $idx;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n if ($breakOnError) {\n out += ' if (!' + ($nextValid) + ') break; ';\n }\n out += ' }';\n }\n if ($breakOnError) {\n out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate__limit(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $isMax = $keyword == 'maximum',\n $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum',\n $schemaExcl = it.schema[$exclusiveKeyword],\n $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data,\n $op = $isMax ? '<' : '>',\n $notOp = $isMax ? '>' : '<',\n $errorKeyword = undefined;\n if (!($isData || typeof $schema == 'number' || $schema === undefined)) {\n throw new Error($keyword + ' must be number');\n }\n if (!($isDataExcl || $schemaExcl === undefined || typeof $schemaExcl == 'number' || typeof $schemaExcl == 'boolean')) {\n throw new Error($exclusiveKeyword + ' must be number or boolean');\n }\n if ($isDataExcl) {\n var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr),\n $exclusive = 'exclusive' + $lvl,\n $exclType = 'exclType' + $lvl,\n $exclIsNumber = 'exclIsNumber' + $lvl,\n $opExpr = 'op' + $lvl,\n $opStr = '\\' + ' + $opExpr + ' + \\'';\n out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; ';\n $schemaValueExcl = 'schemaExcl' + $lvl;\n out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \\'boolean\\' && ' + ($exclType) + ' != \\'undefined\\' && ' + ($exclType) + ' != \\'number\\') { ';\n var $errorKeyword = $exclusiveKeyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || '_exclusiveLimit') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'' + ($exclusiveKeyword) + ' should be boolean\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n out += ' ' + ($exclType) + ' == \\'number\\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \\'' + ($op) + '\\' : \\'' + ($op) + '=\\'; ';\n if ($schema === undefined) {\n $errorKeyword = $exclusiveKeyword;\n $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;\n $schemaValue = $schemaValueExcl;\n $isData = $isDataExcl;\n }\n } else {\n var $exclIsNumber = typeof $schemaExcl == 'number',\n $opStr = $op;\n if ($exclIsNumber && $isData) {\n var $opExpr = '\\'' + $opStr + '\\'';\n out += ' if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { ';\n } else {\n if ($exclIsNumber && $schema === undefined) {\n $exclusive = true;\n $errorKeyword = $exclusiveKeyword;\n $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;\n $schemaValue = $schemaExcl;\n $notOp += '=';\n } else {\n if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema);\n if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) {\n $exclusive = true;\n $errorKeyword = $exclusiveKeyword;\n $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;\n $notOp += '=';\n } else {\n $exclusive = false;\n $opStr += '=';\n }\n }\n var $opExpr = '\\'' + $opStr + '\\'';\n out += ' if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { ';\n }\n }\n $errorKeyword = $errorKeyword || $keyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || '_limit') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be ' + ($opStr) + ' ';\n if ($isData) {\n out += '\\' + ' + ($schemaValue);\n } else {\n out += '' + ($schemaValue) + '\\'';\n }\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate__limitItems(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n if (!($isData || typeof $schema == 'number')) {\n throw new Error($keyword + ' must be number');\n }\n var $op = $keyword == 'maxItems' ? '>' : '<';\n out += 'if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { ';\n var $errorKeyword = $keyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || '_limitItems') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT have ';\n if ($keyword == 'maxItems') {\n out += 'more';\n } else {\n out += 'fewer';\n }\n out += ' than ';\n if ($isData) {\n out += '\\' + ' + ($schemaValue) + ' + \\'';\n } else {\n out += '' + ($schema);\n }\n out += ' items\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += '} ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate__limitLength(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n if (!($isData || typeof $schema == 'number')) {\n throw new Error($keyword + ' must be number');\n }\n var $op = $keyword == 'maxLength' ? '>' : '<';\n out += 'if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n if (it.opts.unicode === false) {\n out += ' ' + ($data) + '.length ';\n } else {\n out += ' ucs2length(' + ($data) + ') ';\n }\n out += ' ' + ($op) + ' ' + ($schemaValue) + ') { ';\n var $errorKeyword = $keyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || '_limitLength') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT be ';\n if ($keyword == 'maxLength') {\n out += 'longer';\n } else {\n out += 'shorter';\n }\n out += ' than ';\n if ($isData) {\n out += '\\' + ' + ($schemaValue) + ' + \\'';\n } else {\n out += '' + ($schema);\n }\n out += ' characters\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += '} ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate__limitProperties(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n if (!($isData || typeof $schema == 'number')) {\n throw new Error($keyword + ' must be number');\n }\n var $op = $keyword == 'maxProperties' ? '>' : '<';\n out += 'if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { ';\n var $errorKeyword = $keyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || '_limitProperties') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT have ';\n if ($keyword == 'maxProperties') {\n out += 'more';\n } else {\n out += 'fewer';\n }\n out += ' than ';\n if ($isData) {\n out += '\\' + ' + ($schemaValue) + ' + \\'';\n } else {\n out += '' + ($schema);\n }\n out += ' properties\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += '} ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_multipleOf(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n if (!($isData || typeof $schema == 'number')) {\n throw new Error($keyword + ' must be number');\n }\n out += 'var division' + ($lvl) + ';if (';\n if ($isData) {\n out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \\'number\\' || ';\n }\n out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', ';\n if (it.opts.multipleOfPrecision) {\n out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' ';\n } else {\n out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') ';\n }\n out += ' ) ';\n if ($isData) {\n out += ' ) ';\n }\n out += ' ) { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('multipleOf') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be multiple of ';\n if ($isData) {\n out += '\\' + ' + ($schemaValue);\n } else {\n out += '' + ($schemaValue) + '\\'';\n }\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += '} ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_not(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {\n $it.schema = $schema;\n $it.schemaPath = $schemaPath;\n $it.errSchemaPath = $errSchemaPath;\n out += ' var ' + ($errs) + ' = errors; ';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n $it.createErrors = false;\n var $allErrorsOption;\n if ($it.opts.allErrors) {\n $allErrorsOption = $it.opts.allErrors;\n $it.opts.allErrors = false;\n }\n out += ' ' + (it.validate($it)) + ' ';\n $it.createErrors = true;\n if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption;\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += ' if (' + ($nextValid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('not') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT be valid\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';\n if (it.opts.allErrors) {\n out += ' } ';\n }\n } else {\n out += ' var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('not') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT be valid\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n if ($breakOnError) {\n out += ' if (false) { ';\n }\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_oneOf(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $currentBaseId = $it.baseId,\n $prevValid = 'prevValid' + $lvl,\n $passingSchemas = 'passingSchemas' + $lvl;\n out += 'var ' + ($errs) + ' = errors , ' + ($prevValid) + ' = false , ' + ($valid) + ' = false , ' + ($passingSchemas) + ' = null; ';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n var arr1 = $schema;\n if (arr1) {\n var $sch, $i = -1,\n l1 = arr1.length - 1;\n while ($i < l1) {\n $sch = arr1[$i += 1];\n if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + '[' + $i + ']';\n $it.errSchemaPath = $errSchemaPath + '/' + $i;\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n } else {\n out += ' var ' + ($nextValid) + ' = true; ';\n }\n if ($i) {\n out += ' if (' + ($nextValid) + ' && ' + ($prevValid) + ') { ' + ($valid) + ' = false; ' + ($passingSchemas) + ' = [' + ($passingSchemas) + ', ' + ($i) + ']; } else { ';\n $closingBraces += '}';\n }\n out += ' if (' + ($nextValid) + ') { ' + ($valid) + ' = ' + ($prevValid) + ' = true; ' + ($passingSchemas) + ' = ' + ($i) + '; }';\n }\n }\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('oneOf') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { passingSchemas: ' + ($passingSchemas) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should match exactly one schema in oneOf\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError(vErrors); ';\n } else {\n out += ' validate.errors = vErrors; return false; ';\n }\n }\n out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }';\n if (it.opts.allErrors) {\n out += ' } ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_pattern(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema);\n out += 'if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'string\\') || ';\n }\n out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('pattern') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: ';\n if ($isData) {\n out += '' + ($schemaValue);\n } else {\n out += '' + (it.util.toQuotedString($schema));\n }\n out += ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should match pattern \"';\n if ($isData) {\n out += '\\' + ' + ($schemaValue) + ' + \\'';\n } else {\n out += '' + (it.util.escapeQuotes($schema));\n }\n out += '\"\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + (it.util.toQuotedString($schema));\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += '} ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_properties(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $key = 'key' + $lvl,\n $idx = 'idx' + $lvl,\n $dataNxt = $it.dataLevel = it.dataLevel + 1,\n $nextData = 'data' + $dataNxt,\n $dataProperties = 'dataProperties' + $lvl;\n var $schemaKeys = Object.keys($schema || {}).filter(notProto),\n $pProperties = it.schema.patternProperties || {},\n $pPropertyKeys = Object.keys($pProperties).filter(notProto),\n $aProperties = it.schema.additionalProperties,\n $someProperties = $schemaKeys.length || $pPropertyKeys.length,\n $noAdditional = $aProperties === false,\n $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length,\n $removeAdditional = it.opts.removeAdditional,\n $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional,\n $ownProperties = it.opts.ownProperties,\n $currentBaseId = it.baseId;\n var $required = it.schema.required;\n if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) {\n var $requiredHash = it.util.toHash($required);\n }\n\n function notProto(p) {\n return p !== '__proto__';\n }\n out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;';\n if ($ownProperties) {\n out += ' var ' + ($dataProperties) + ' = undefined;';\n }\n if ($checkAdditional) {\n if ($ownProperties) {\n out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';\n } else {\n out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';\n }\n if ($someProperties) {\n out += ' var isAdditional' + ($lvl) + ' = !(false ';\n if ($schemaKeys.length) {\n if ($schemaKeys.length > 8) {\n out += ' || validate.schema' + ($schemaPath) + '.hasOwnProperty(' + ($key) + ') ';\n } else {\n var arr1 = $schemaKeys;\n if (arr1) {\n var $propertyKey, i1 = -1,\n l1 = arr1.length - 1;\n while (i1 < l1) {\n $propertyKey = arr1[i1 += 1];\n out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' ';\n }\n }\n }\n }\n if ($pPropertyKeys.length) {\n var arr2 = $pPropertyKeys;\n if (arr2) {\n var $pProperty, $i = -1,\n l2 = arr2.length - 1;\n while ($i < l2) {\n $pProperty = arr2[$i += 1];\n out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') ';\n }\n }\n }\n out += ' ); if (isAdditional' + ($lvl) + ') { ';\n }\n if ($removeAdditional == 'all') {\n out += ' delete ' + ($data) + '[' + ($key) + ']; ';\n } else {\n var $currentErrorPath = it.errorPath;\n var $additionalProperty = '\\' + ' + $key + ' + \\'';\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);\n }\n if ($noAdditional) {\n if ($removeAdditional) {\n out += ' delete ' + ($data) + '[' + ($key) + ']; ';\n } else {\n out += ' ' + ($nextValid) + ' = false; ';\n var $currErrSchemaPath = $errSchemaPath;\n $errSchemaPath = it.errSchemaPath + '/additionalProperties';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('additionalProperties') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \\'' + ($additionalProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is an invalid additional property';\n } else {\n out += 'should NOT have additional properties';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n $errSchemaPath = $currErrSchemaPath;\n if ($breakOnError) {\n out += ' break; ';\n }\n }\n } else if ($additionalIsSchema) {\n if ($removeAdditional == 'failing') {\n out += ' var ' + ($errs) + ' = errors; ';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n $it.schema = $aProperties;\n $it.schemaPath = it.schemaPath + '.additionalProperties';\n $it.errSchemaPath = it.errSchemaPath + '/additionalProperties';\n $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);\n var $passData = $data + '[' + $key + ']';\n $it.dataPathArr[$dataNxt] = $key;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } ';\n it.compositeRule = $it.compositeRule = $wasComposite;\n } else {\n $it.schema = $aProperties;\n $it.schemaPath = it.schemaPath + '.additionalProperties';\n $it.errSchemaPath = it.errSchemaPath + '/additionalProperties';\n $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);\n var $passData = $data + '[' + $key + ']';\n $it.dataPathArr[$dataNxt] = $key;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n if ($breakOnError) {\n out += ' if (!' + ($nextValid) + ') break; ';\n }\n }\n }\n it.errorPath = $currentErrorPath;\n }\n if ($someProperties) {\n out += ' } ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n var $useDefaults = it.opts.useDefaults && !it.compositeRule;\n if ($schemaKeys.length) {\n var arr3 = $schemaKeys;\n if (arr3) {\n var $propertyKey, i3 = -1,\n l3 = arr3.length - 1;\n while (i3 < l3) {\n $propertyKey = arr3[i3 += 1];\n var $sch = $schema[$propertyKey];\n if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {\n var $prop = it.util.getProperty($propertyKey),\n $passData = $data + $prop,\n $hasDefault = $useDefaults && $sch.default !== undefined;\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + $prop;\n $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey);\n $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers);\n $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey);\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n $code = it.util.varReplace($code, $nextData, $passData);\n var $useData = $passData;\n } else {\n var $useData = $nextData;\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ';\n }\n if ($hasDefault) {\n out += ' ' + ($code) + ' ';\n } else {\n if ($requiredHash && $requiredHash[$propertyKey]) {\n out += ' if ( ' + ($useData) + ' === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ') { ' + ($nextValid) + ' = false; ';\n var $currentErrorPath = it.errorPath,\n $currErrSchemaPath = $errSchemaPath,\n $missingProperty = it.util.escapeQuotes($propertyKey);\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);\n }\n $errSchemaPath = it.errSchemaPath + '/required';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n $errSchemaPath = $currErrSchemaPath;\n it.errorPath = $currentErrorPath;\n out += ' } else { ';\n } else {\n if ($breakOnError) {\n out += ' if ( ' + ($useData) + ' === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ') { ' + ($nextValid) + ' = true; } else { ';\n } else {\n out += ' if (' + ($useData) + ' !== undefined ';\n if ($ownProperties) {\n out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ' ) { ';\n }\n }\n out += ' ' + ($code) + ' } ';\n }\n }\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n }\n }\n if ($pPropertyKeys.length) {\n var arr4 = $pPropertyKeys;\n if (arr4) {\n var $pProperty, i4 = -1,\n l4 = arr4.length - 1;\n while (i4 < l4) {\n $pProperty = arr4[i4 += 1];\n var $sch = $pProperties[$pProperty];\n if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {\n $it.schema = $sch;\n $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty);\n $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty);\n if ($ownProperties) {\n out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';\n } else {\n out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';\n }\n out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { ';\n $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);\n var $passData = $data + '[' + $key + ']';\n $it.dataPathArr[$dataNxt] = $key;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n if ($breakOnError) {\n out += ' if (!' + ($nextValid) + ') break; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else ' + ($nextValid) + ' = true; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n }\n }\n }\n if ($breakOnError) {\n out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_propertyNames(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n out += 'var ' + ($errs) + ' = errors;';\n if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {\n $it.schema = $schema;\n $it.schemaPath = $schemaPath;\n $it.errSchemaPath = $errSchemaPath;\n var $key = 'key' + $lvl,\n $idx = 'idx' + $lvl,\n $i = 'i' + $lvl,\n $invalidName = '\\' + ' + $key + ' + \\'',\n $dataNxt = $it.dataLevel = it.dataLevel + 1,\n $nextData = 'data' + $dataNxt,\n $dataProperties = 'dataProperties' + $lvl,\n $ownProperties = it.opts.ownProperties,\n $currentBaseId = it.baseId;\n if ($ownProperties) {\n out += ' var ' + ($dataProperties) + ' = undefined; ';\n }\n if ($ownProperties) {\n out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';\n } else {\n out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';\n }\n out += ' var startErrs' + ($lvl) + ' = errors; ';\n var $passData = $key;\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += ' if (!' + ($nextValid) + ') { for (var ' + ($i) + '=startErrs' + ($lvl) + '; ' + ($i) + '<errors; ' + ($i) + '++) { vErrors[' + ($i) + '].propertyName = ' + ($key) + '; } var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('propertyNames') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { propertyName: \\'' + ($invalidName) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'property name \\\\\\'' + ($invalidName) + '\\\\\\' is invalid\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError(vErrors); ';\n } else {\n out += ' validate.errors = vErrors; return false; ';\n }\n }\n if ($breakOnError) {\n out += ' break; ';\n }\n out += ' } }';\n }\n if ($breakOnError) {\n out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_required(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $vSchema = 'schema' + $lvl;\n if (!$isData) {\n if ($schema.length < it.opts.loopRequired && it.schema.properties && Object.keys(it.schema.properties).length) {\n var $required = [];\n var arr1 = $schema;\n if (arr1) {\n var $property, i1 = -1,\n l1 = arr1.length - 1;\n while (i1 < l1) {\n $property = arr1[i1 += 1];\n var $propertySch = it.schema.properties[$property];\n if (!($propertySch && (it.opts.strictKeywords ? (typeof $propertySch == 'object' && Object.keys($propertySch).length > 0) || $propertySch === false : it.util.schemaHasRules($propertySch, it.RULES.all)))) {\n $required[$required.length] = $property;\n }\n }\n }\n } else {\n var $required = $schema;\n }\n }\n if ($isData || $required.length) {\n var $currentErrorPath = it.errorPath,\n $loopRequired = $isData || $required.length >= it.opts.loopRequired,\n $ownProperties = it.opts.ownProperties;\n if ($breakOnError) {\n out += ' var missing' + ($lvl) + '; ';\n if ($loopRequired) {\n if (!$isData) {\n out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';\n }\n var $i = 'i' + $lvl,\n $propertyPath = 'schema' + $lvl + '[' + $i + ']',\n $missingProperty = '\\' + ' + $propertyPath + ' + \\'';\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);\n }\n out += ' var ' + ($valid) + ' = true; ';\n if ($isData) {\n out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {';\n }\n out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined ';\n if ($ownProperties) {\n out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';\n }\n out += '; if (!' + ($valid) + ') break; } ';\n if ($isData) {\n out += ' } ';\n }\n out += ' if (!' + ($valid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else { ';\n } else {\n out += ' if ( ';\n var arr2 = $required;\n if (arr2) {\n var $propertyKey, $i = -1,\n l2 = arr2.length - 1;\n while ($i < l2) {\n $propertyKey = arr2[$i += 1];\n if ($i) {\n out += ' || ';\n }\n var $prop = it.util.getProperty($propertyKey),\n $useData = $data + $prop;\n out += ' ( ( ' + ($useData) + ' === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) ';\n }\n }\n out += ') { ';\n var $propertyPath = 'missing' + $lvl,\n $missingProperty = '\\' + ' + $propertyPath + ' + \\'';\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath;\n }\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else { ';\n }\n } else {\n if ($loopRequired) {\n if (!$isData) {\n out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';\n }\n var $i = 'i' + $lvl,\n $propertyPath = 'schema' + $lvl + '[' + $i + ']',\n $missingProperty = '\\' + ' + $propertyPath + ' + \\'';\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);\n }\n if ($isData) {\n out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { ';\n }\n out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';\n }\n out += ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ';\n if ($isData) {\n out += ' } ';\n }\n } else {\n var arr3 = $required;\n if (arr3) {\n var $propertyKey, i3 = -1,\n l3 = arr3.length - 1;\n while (i3 < l3) {\n $propertyKey = arr3[i3 += 1];\n var $prop = it.util.getProperty($propertyKey),\n $missingProperty = it.util.escapeQuotes($propertyKey),\n $useData = $data + $prop;\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);\n }\n out += ' if ( ' + ($useData) + ' === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ';\n }\n }\n }\n }\n it.errorPath = $currentErrorPath;\n } else if ($breakOnError) {\n out += ' if (true) {';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_uniqueItems(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n if (($schema || $isData) && it.opts.uniqueItems !== false) {\n if ($isData) {\n out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \\'boolean\\') ' + ($valid) + ' = false; else { ';\n }\n out += ' var i = ' + ($data) + '.length , ' + ($valid) + ' = true , j; if (i > 1) { ';\n var $itemType = it.schema.items && it.schema.items.type,\n $typeIsArray = Array.isArray($itemType);\n if (!$itemType || $itemType == 'object' || $itemType == 'array' || ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0))) {\n out += ' outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } ';\n } else {\n out += ' var itemIndices = {}, item; for (;i--;) { var item = ' + ($data) + '[i]; ';\n var $method = 'checkDataType' + ($typeIsArray ? 's' : '');\n out += ' if (' + (it.util[$method]($itemType, 'item', it.opts.strictNumbers, true)) + ') continue; ';\n if ($typeIsArray) {\n out += ' if (typeof item == \\'string\\') item = \\'\"\\' + item; ';\n }\n out += ' if (typeof itemIndices[item] == \\'number\\') { ' + ($valid) + ' = false; j = itemIndices[item]; break; } itemIndices[item] = i; } ';\n }\n out += ' } ';\n if ($isData) {\n out += ' } ';\n }\n out += ' if (!' + ($valid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('uniqueItems') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT have duplicate items (items ## \\' + j + \\' and \\' + i + \\' are identical)\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else { ';\n }\n } else {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n }\n return out;\n}\n","'use strict';\n\n//all requires must be explicit because browserify won't work with dynamic requires\nmodule.exports = {\n '$ref': require('./ref'),\n allOf: require('./allOf'),\n anyOf: require('./anyOf'),\n '$comment': require('./comment'),\n const: require('./const'),\n contains: require('./contains'),\n dependencies: require('./dependencies'),\n 'enum': require('./enum'),\n format: require('./format'),\n 'if': require('./if'),\n items: require('./items'),\n maximum: require('./_limit'),\n minimum: require('./_limit'),\n maxItems: require('./_limitItems'),\n minItems: require('./_limitItems'),\n maxLength: require('./_limitLength'),\n minLength: require('./_limitLength'),\n maxProperties: require('./_limitProperties'),\n minProperties: require('./_limitProperties'),\n multipleOf: require('./multipleOf'),\n not: require('./not'),\n oneOf: require('./oneOf'),\n pattern: require('./pattern'),\n properties: require('./properties'),\n propertyNames: require('./propertyNames'),\n required: require('./required'),\n uniqueItems: require('./uniqueItems'),\n validate: require('./validate')\n};\n","'use strict';\n\nvar ruleModules = require('../dotjs')\n , toHash = require('./util').toHash;\n\nmodule.exports = function rules() {\n var RULES = [\n { type: 'number',\n rules: [ { 'maximum': ['exclusiveMaximum'] },\n { 'minimum': ['exclusiveMinimum'] }, 'multipleOf', 'format'] },\n { type: 'string',\n rules: [ 'maxLength', 'minLength', 'pattern', 'format' ] },\n { type: 'array',\n rules: [ 'maxItems', 'minItems', 'items', 'contains', 'uniqueItems' ] },\n { type: 'object',\n rules: [ 'maxProperties', 'minProperties', 'required', 'dependencies', 'propertyNames',\n { 'properties': ['additionalProperties', 'patternProperties'] } ] },\n { rules: [ '$ref', 'const', 'enum', 'not', 'anyOf', 'oneOf', 'allOf', 'if' ] }\n ];\n\n var ALL = [ 'type', '$comment' ];\n var KEYWORDS = [\n '$schema', '$id', 'id', '$data', '$async', 'title',\n 'description', 'default', 'definitions',\n 'examples', 'readOnly', 'writeOnly',\n 'contentMediaType', 'contentEncoding',\n 'additionalItems', 'then', 'else'\n ];\n var TYPES = [ 'number', 'integer', 'string', 'array', 'object', 'boolean', 'null' ];\n RULES.all = toHash(ALL);\n RULES.types = toHash(TYPES);\n\n RULES.forEach(function (group) {\n group.rules = group.rules.map(function (keyword) {\n var implKeywords;\n if (typeof keyword == 'object') {\n var key = Object.keys(keyword)[0];\n implKeywords = keyword[key];\n keyword = key;\n implKeywords.forEach(function (k) {\n ALL.push(k);\n RULES.all[k] = true;\n });\n }\n ALL.push(keyword);\n var rule = RULES.all[keyword] = {\n keyword: keyword,\n code: ruleModules[keyword],\n implements: implKeywords\n };\n return rule;\n });\n\n RULES.all.$comment = {\n keyword: '$comment',\n code: ruleModules.$comment\n };\n\n if (group.type) RULES.types[group.type] = group;\n });\n\n RULES.keywords = toHash(ALL.concat(KEYWORDS));\n RULES.custom = {};\n\n return RULES;\n};\n","'use strict';\n\nvar KEYWORDS = [\n 'multipleOf',\n 'maximum',\n 'exclusiveMaximum',\n 'minimum',\n 'exclusiveMinimum',\n 'maxLength',\n 'minLength',\n 'pattern',\n 'additionalItems',\n 'maxItems',\n 'minItems',\n 'uniqueItems',\n 'maxProperties',\n 'minProperties',\n 'required',\n 'additionalProperties',\n 'enum',\n 'format',\n 'const'\n];\n\nmodule.exports = function (metaSchema, keywordsJsonPointers) {\n for (var i=0; i<keywordsJsonPointers.length; i++) {\n metaSchema = JSON.parse(JSON.stringify(metaSchema));\n var segments = keywordsJsonPointers[i].split('/');\n var keywords = metaSchema;\n var j;\n for (j=1; j<segments.length; j++)\n keywords = keywords[segments[j]];\n\n for (j=0; j<KEYWORDS.length; j++) {\n var key = KEYWORDS[j];\n var schema = keywords[key];\n if (schema) {\n keywords[key] = {\n anyOf: [\n schema,\n { $ref: 'https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#' }\n ]\n };\n }\n }\n }\n\n return metaSchema;\n};\n","'use strict';\n\nvar MissingRefError = require('./error_classes').MissingRef;\n\nmodule.exports = compileAsync;\n\n\n/**\n * Creates validating function for passed schema with asynchronous loading of missing schemas.\n * `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema.\n * @this Ajv\n * @param {Object} schema schema object\n * @param {Boolean} meta optional true to compile meta-schema; this parameter can be skipped\n * @param {Function} callback an optional node-style callback, it is called with 2 parameters: error (or null) and validating function.\n * @return {Promise} promise that resolves with a validating function.\n */\nfunction compileAsync(schema, meta, callback) {\n /* eslint no-shadow: 0 */\n /* global Promise */\n /* jshint validthis: true */\n var self = this;\n if (typeof this._opts.loadSchema != 'function')\n throw new Error('options.loadSchema should be a function');\n\n if (typeof meta == 'function') {\n callback = meta;\n meta = undefined;\n }\n\n var p = loadMetaSchemaOf(schema).then(function () {\n var schemaObj = self._addSchema(schema, undefined, meta);\n return schemaObj.validate || _compileAsync(schemaObj);\n });\n\n if (callback) {\n p.then(\n function(v) { callback(null, v); },\n callback\n );\n }\n\n return p;\n\n\n function loadMetaSchemaOf(sch) {\n var $schema = sch.$schema;\n return $schema && !self.getSchema($schema)\n ? compileAsync.call(self, { $ref: $schema }, true)\n : Promise.resolve();\n }\n\n\n function _compileAsync(schemaObj) {\n try { return self._compile(schemaObj); }\n catch(e) {\n if (e instanceof MissingRefError) return loadMissingSchema(e);\n throw e;\n }\n\n\n function loadMissingSchema(e) {\n var ref = e.missingSchema;\n if (added(ref)) throw new Error('Schema ' + ref + ' is loaded but ' + e.missingRef + ' cannot be resolved');\n\n var schemaPromise = self._loadingSchemas[ref];\n if (!schemaPromise) {\n schemaPromise = self._loadingSchemas[ref] = self._opts.loadSchema(ref);\n schemaPromise.then(removePromise, removePromise);\n }\n\n return schemaPromise.then(function (sch) {\n if (!added(ref)) {\n return loadMetaSchemaOf(sch).then(function () {\n if (!added(ref)) self.addSchema(sch, ref, undefined, meta);\n });\n }\n }).then(function() {\n return _compileAsync(schemaObj);\n });\n\n function removePromise() {\n delete self._loadingSchemas[ref];\n }\n\n function added(ref) {\n return self._refs[ref] || self._schemas[ref];\n }\n }\n }\n}\n","'use strict';\nmodule.exports = function generate_custom(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $rule = this,\n $definition = 'definition' + $lvl,\n $rDef = $rule.definition,\n $closingBraces = '';\n var $compile, $inline, $macro, $ruleValidate, $validateCode;\n if ($isData && $rDef.$data) {\n $validateCode = 'keywordValidate' + $lvl;\n var $validateSchema = $rDef.validateSchema;\n out += ' var ' + ($definition) + ' = RULES.custom[\\'' + ($keyword) + '\\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;';\n } else {\n $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it);\n if (!$ruleValidate) return;\n $schemaValue = 'validate.schema' + $schemaPath;\n $validateCode = $ruleValidate.code;\n $compile = $rDef.compile;\n $inline = $rDef.inline;\n $macro = $rDef.macro;\n }\n var $ruleErrs = $validateCode + '.errors',\n $i = 'i' + $lvl,\n $ruleErr = 'ruleErr' + $lvl,\n $asyncKeyword = $rDef.async;\n if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema');\n if (!($inline || $macro)) {\n out += '' + ($ruleErrs) + ' = null;';\n }\n out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';\n if ($isData && $rDef.$data) {\n $closingBraces += '}';\n out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { ';\n if ($validateSchema) {\n $closingBraces += '}';\n out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { ';\n }\n }\n if ($inline) {\n if ($rDef.statements) {\n out += ' ' + ($ruleValidate.validate) + ' ';\n } else {\n out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; ';\n }\n } else if ($macro) {\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n $it.schema = $ruleValidate.validate;\n $it.schemaPath = '';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n var $code = it.validate($it).replace(/validate\\.schema/g, $validateCode);\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += ' ' + ($code);\n } else {\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = '';\n out += ' ' + ($validateCode) + '.call( ';\n if (it.opts.passContext) {\n out += 'this';\n } else {\n out += 'self';\n }\n if ($compile || $rDef.schema === false) {\n out += ' , ' + ($data) + ' ';\n } else {\n out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' ';\n }\n out += ' , (dataPath || \\'\\')';\n if (it.errorPath != '\"\"') {\n out += ' + ' + (it.errorPath);\n }\n var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',\n $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';\n out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) ';\n var def_callRuleValidate = out;\n out = $$outStack.pop();\n if ($rDef.errors === false) {\n out += ' ' + ($valid) + ' = ';\n if ($asyncKeyword) {\n out += 'await ';\n }\n out += '' + (def_callRuleValidate) + '; ';\n } else {\n if ($asyncKeyword) {\n $ruleErrs = 'customErrors' + $lvl;\n out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = await ' + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } ';\n } else {\n out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; ';\n }\n }\n }\n if ($rDef.modifying) {\n out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];';\n }\n out += '' + ($closingBraces);\n if ($rDef.valid) {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n } else {\n out += ' if ( ';\n if ($rDef.valid === undefined) {\n out += ' !';\n if ($macro) {\n out += '' + ($nextValid);\n } else {\n out += '' + ($valid);\n }\n } else {\n out += ' ' + (!$rDef.valid) + ' ';\n }\n out += ') { ';\n $errorKeyword = $rule.keyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = '';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || 'custom') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \\'' + ($rule.keyword) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should pass \"' + ($rule.keyword) + '\" keyword validation\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n var def_customError = out;\n out = $$outStack.pop();\n if ($inline) {\n if ($rDef.errors) {\n if ($rDef.errors != 'full') {\n out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \\'\\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = \"' + ($errSchemaPath) + '\"; } ';\n if (it.opts.verbose) {\n out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';\n }\n out += ' } ';\n }\n } else {\n if ($rDef.errors === false) {\n out += ' ' + (def_customError) + ' ';\n } else {\n out += ' if (' + ($errs) + ' == errors) { ' + (def_customError) + ' } else { for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \\'\\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = \"' + ($errSchemaPath) + '\"; } ';\n if (it.opts.verbose) {\n out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';\n }\n out += ' } } ';\n }\n }\n } else if ($macro) {\n out += ' var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || 'custom') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \\'' + ($rule.keyword) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should pass \"' + ($rule.keyword) + '\" keyword validation\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError(vErrors); ';\n } else {\n out += ' validate.errors = vErrors; return false; ';\n }\n }\n } else {\n if ($rDef.errors === false) {\n out += ' ' + (def_customError) + ' ';\n } else {\n out += ' if (Array.isArray(' + ($ruleErrs) + ')) { if (vErrors === null) vErrors = ' + ($ruleErrs) + '; else vErrors = vErrors.concat(' + ($ruleErrs) + '); errors = vErrors.length; for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \\'\\') + ' + (it.errorPath) + '; ' + ($ruleErr) + '.schemaPath = \"' + ($errSchemaPath) + '\"; ';\n if (it.opts.verbose) {\n out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';\n }\n out += ' } } else { ' + (def_customError) + ' } ';\n }\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else { ';\n }\n }\n return out;\n}\n","module.exports = {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"http://json-schema.org/draft-07/schema#\",\n \"title\": \"Core schema meta-schema\",\n \"definitions\": {\n \"schemaArray\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": { \"$ref\": \"#\" }\n },\n \"nonNegativeInteger\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"nonNegativeIntegerDefault0\": {\n \"allOf\": [\n { \"$ref\": \"#/definitions/nonNegativeInteger\" },\n { \"default\": 0 }\n ]\n },\n \"simpleTypes\": {\n \"enum\": [\n \"array\",\n \"boolean\",\n \"integer\",\n \"null\",\n \"number\",\n \"object\",\n \"string\"\n ]\n },\n \"stringArray\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"uniqueItems\": true,\n \"default\": []\n }\n },\n \"type\": [\"object\", \"boolean\"],\n \"properties\": {\n \"$id\": {\n \"type\": \"string\",\n \"format\": \"uri-reference\"\n },\n \"$schema\": {\n \"type\": \"string\",\n \"format\": \"uri\"\n },\n \"$ref\": {\n \"type\": \"string\",\n \"format\": \"uri-reference\"\n },\n \"$comment\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"default\": true,\n \"readOnly\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"examples\": {\n \"type\": \"array\",\n \"items\": true\n },\n \"multipleOf\": {\n \"type\": \"number\",\n \"exclusiveMinimum\": 0\n },\n \"maximum\": {\n \"type\": \"number\"\n },\n \"exclusiveMaximum\": {\n \"type\": \"number\"\n },\n \"minimum\": {\n \"type\": \"number\"\n },\n \"exclusiveMinimum\": {\n \"type\": \"number\"\n },\n \"maxLength\": { \"$ref\": \"#/definitions/nonNegativeInteger\" },\n \"minLength\": { \"$ref\": \"#/definitions/nonNegativeIntegerDefault0\" },\n \"pattern\": {\n \"type\": \"string\",\n \"format\": \"regex\"\n },\n \"additionalItems\": { \"$ref\": \"#\" },\n \"items\": {\n \"anyOf\": [\n { \"$ref\": \"#\" },\n { \"$ref\": \"#/definitions/schemaArray\" }\n ],\n \"default\": true\n },\n \"maxItems\": { \"$ref\": \"#/definitions/nonNegativeInteger\" },\n \"minItems\": { \"$ref\": \"#/definitions/nonNegativeIntegerDefault0\" },\n \"uniqueItems\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"contains\": { \"$ref\": \"#\" },\n \"maxProperties\": { \"$ref\": \"#/definitions/nonNegativeInteger\" },\n \"minProperties\": { \"$ref\": \"#/definitions/nonNegativeIntegerDefault0\" },\n \"required\": { \"$ref\": \"#/definitions/stringArray\" },\n \"additionalProperties\": { \"$ref\": \"#\" },\n \"definitions\": {\n \"type\": \"object\",\n \"additionalProperties\": { \"$ref\": \"#\" },\n \"default\": {}\n },\n \"properties\": {\n \"type\": \"object\",\n \"additionalProperties\": { \"$ref\": \"#\" },\n \"default\": {}\n },\n \"patternProperties\": {\n \"type\": \"object\",\n \"additionalProperties\": { \"$ref\": \"#\" },\n \"propertyNames\": { \"format\": \"regex\" },\n \"default\": {}\n },\n \"dependencies\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"anyOf\": [\n { \"$ref\": \"#\" },\n { \"$ref\": \"#/definitions/stringArray\" }\n ]\n }\n },\n \"propertyNames\": { \"$ref\": \"#\" },\n \"const\": true,\n \"enum\": {\n \"type\": \"array\",\n \"items\": true,\n \"minItems\": 1,\n \"uniqueItems\": true\n },\n \"type\": {\n \"anyOf\": [\n { \"$ref\": \"#/definitions/simpleTypes\" },\n {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/definitions/simpleTypes\" },\n \"minItems\": 1,\n \"uniqueItems\": true\n }\n ]\n },\n \"format\": { \"type\": \"string\" },\n \"contentMediaType\": { \"type\": \"string\" },\n \"contentEncoding\": { \"type\": \"string\" },\n \"if\": {\"$ref\": \"#\"},\n \"then\": {\"$ref\": \"#\"},\n \"else\": {\"$ref\": \"#\"},\n \"allOf\": { \"$ref\": \"#/definitions/schemaArray\" },\n \"anyOf\": { \"$ref\": \"#/definitions/schemaArray\" },\n \"oneOf\": { \"$ref\": \"#/definitions/schemaArray\" },\n \"not\": { \"$ref\": \"#\" }\n },\n \"default\": true\n}\n;","'use strict';\n\nvar metaSchema = require('./refs/json-schema-draft-07.json');\n\nmodule.exports = {\n $id: 'https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js',\n definitions: {\n simpleTypes: metaSchema.definitions.simpleTypes\n },\n type: 'object',\n dependencies: {\n schema: ['validate'],\n $data: ['validate'],\n statements: ['inline'],\n valid: {not: {required: ['macro']}}\n },\n properties: {\n type: metaSchema.properties.type,\n schema: {type: 'boolean'},\n statements: {type: 'boolean'},\n dependencies: {\n type: 'array',\n items: {type: 'string'}\n },\n metaSchema: {type: 'object'},\n modifying: {type: 'boolean'},\n valid: {type: 'boolean'},\n $data: {type: 'boolean'},\n async: {type: 'boolean'},\n errors: {\n anyOf: [\n {type: 'boolean'},\n {const: 'full'}\n ]\n }\n }\n};\n","'use strict';\n\nvar IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i;\nvar customRuleCode = require('./dotjs/custom');\nvar definitionSchema = require('./definition_schema');\n\nmodule.exports = {\n add: addKeyword,\n get: getKeyword,\n remove: removeKeyword,\n validate: validateKeyword\n};\n\n\n/**\n * Define custom keyword\n * @this Ajv\n * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords).\n * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`.\n * @return {Ajv} this for method chaining\n */\nfunction addKeyword(keyword, definition) {\n /* jshint validthis: true */\n /* eslint no-shadow: 0 */\n var RULES = this.RULES;\n if (RULES.keywords[keyword])\n throw new Error('Keyword ' + keyword + ' is already defined');\n\n if (!IDENTIFIER.test(keyword))\n throw new Error('Keyword ' + keyword + ' is not a valid identifier');\n\n if (definition) {\n this.validateKeyword(definition, true);\n\n var dataType = definition.type;\n if (Array.isArray(dataType)) {\n for (var i=0; i<dataType.length; i++)\n _addRule(keyword, dataType[i], definition);\n } else {\n _addRule(keyword, dataType, definition);\n }\n\n var metaSchema = definition.metaSchema;\n if (metaSchema) {\n if (definition.$data && this._opts.$data) {\n metaSchema = {\n anyOf: [\n metaSchema,\n { '$ref': 'https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#' }\n ]\n };\n }\n definition.validateSchema = this.compile(metaSchema, true);\n }\n }\n\n RULES.keywords[keyword] = RULES.all[keyword] = true;\n\n\n function _addRule(keyword, dataType, definition) {\n var ruleGroup;\n for (var i=0; i<RULES.length; i++) {\n var rg = RULES[i];\n if (rg.type == dataType) {\n ruleGroup = rg;\n break;\n }\n }\n\n if (!ruleGroup) {\n ruleGroup = { type: dataType, rules: [] };\n RULES.push(ruleGroup);\n }\n\n var rule = {\n keyword: keyword,\n definition: definition,\n custom: true,\n code: customRuleCode,\n implements: definition.implements\n };\n ruleGroup.rules.push(rule);\n RULES.custom[keyword] = rule;\n }\n\n return this;\n}\n\n\n/**\n * Get keyword\n * @this Ajv\n * @param {String} keyword pre-defined or custom keyword.\n * @return {Object|Boolean} custom keyword definition, `true` if it is a predefined keyword, `false` otherwise.\n */\nfunction getKeyword(keyword) {\n /* jshint validthis: true */\n var rule = this.RULES.custom[keyword];\n return rule ? rule.definition : this.RULES.keywords[keyword] || false;\n}\n\n\n/**\n * Remove keyword\n * @this Ajv\n * @param {String} keyword pre-defined or custom keyword.\n * @return {Ajv} this for method chaining\n */\nfunction removeKeyword(keyword) {\n /* jshint validthis: true */\n var RULES = this.RULES;\n delete RULES.keywords[keyword];\n delete RULES.all[keyword];\n delete RULES.custom[keyword];\n for (var i=0; i<RULES.length; i++) {\n var rules = RULES[i].rules;\n for (var j=0; j<rules.length; j++) {\n if (rules[j].keyword == keyword) {\n rules.splice(j, 1);\n break;\n }\n }\n }\n return this;\n}\n\n\n/**\n * Validate keyword definition\n * @this Ajv\n * @param {Object} definition keyword definition object.\n * @param {Boolean} throwError true to throw exception if definition is invalid\n * @return {boolean} validation result\n */\nfunction validateKeyword(definition, throwError) {\n validateKeyword.errors = null;\n var v = this._validateKeyword = this._validateKeyword\n || this.compile(definitionSchema, true);\n\n if (v(definition)) return true;\n validateKeyword.errors = v.errors;\n if (throwError)\n throw new Error('custom keyword definition is invalid: ' + this.errorsText(v.errors));\n else\n return false;\n}\n","module.exports = {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#\",\n \"description\": \"Meta-schema for $data reference (JSON Schema extension proposal)\",\n \"type\": \"object\",\n \"required\": [ \"$data\" ],\n \"properties\": {\n \"$data\": {\n \"type\": \"string\",\n \"anyOf\": [\n { \"format\": \"relative-json-pointer\" }, \n { \"format\": \"json-pointer\" }\n ]\n }\n },\n \"additionalProperties\": false\n}\n;","'use strict';\n\nvar compileSchema = require('./compile')\n , resolve = require('./compile/resolve')\n , Cache = require('./cache')\n , SchemaObject = require('./compile/schema_obj')\n , stableStringify = require('fast-json-stable-stringify')\n , formats = require('./compile/formats')\n , rules = require('./compile/rules')\n , $dataMetaSchema = require('./data')\n , util = require('./compile/util');\n\nmodule.exports = Ajv;\n\nAjv.prototype.validate = validate;\nAjv.prototype.compile = compile;\nAjv.prototype.addSchema = addSchema;\nAjv.prototype.addMetaSchema = addMetaSchema;\nAjv.prototype.validateSchema = validateSchema;\nAjv.prototype.getSchema = getSchema;\nAjv.prototype.removeSchema = removeSchema;\nAjv.prototype.addFormat = addFormat;\nAjv.prototype.errorsText = errorsText;\n\nAjv.prototype._addSchema = _addSchema;\nAjv.prototype._compile = _compile;\n\nAjv.prototype.compileAsync = require('./compile/async');\nvar customKeyword = require('./keyword');\nAjv.prototype.addKeyword = customKeyword.add;\nAjv.prototype.getKeyword = customKeyword.get;\nAjv.prototype.removeKeyword = customKeyword.remove;\nAjv.prototype.validateKeyword = customKeyword.validate;\n\nvar errorClasses = require('./compile/error_classes');\nAjv.ValidationError = errorClasses.Validation;\nAjv.MissingRefError = errorClasses.MissingRef;\nAjv.$dataMetaSchema = $dataMetaSchema;\n\nvar META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema';\n\nvar META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes', 'strictDefaults' ];\nvar META_SUPPORT_DATA = ['/properties'];\n\n/**\n * Creates validator instance.\n * Usage: `Ajv(opts)`\n * @param {Object} opts optional options\n * @return {Object} ajv instance\n */\nfunction Ajv(opts) {\n if (!(this instanceof Ajv)) return new Ajv(opts);\n opts = this._opts = util.copy(opts) || {};\n setLogger(this);\n this._schemas = {};\n this._refs = {};\n this._fragments = {};\n this._formats = formats(opts.format);\n\n this._cache = opts.cache || new Cache;\n this._loadingSchemas = {};\n this._compilations = [];\n this.RULES = rules();\n this._getId = chooseGetId(opts);\n\n opts.loopRequired = opts.loopRequired || Infinity;\n if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true;\n if (opts.serialize === undefined) opts.serialize = stableStringify;\n this._metaOpts = getMetaSchemaOptions(this);\n\n if (opts.formats) addInitialFormats(this);\n if (opts.keywords) addInitialKeywords(this);\n addDefaultMetaSchema(this);\n if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta);\n if (opts.nullable) this.addKeyword('nullable', {metaSchema: {type: 'boolean'}});\n addInitialSchemas(this);\n}\n\n\n\n/**\n * Validate data using schema\n * Schema will be compiled and cached (using serialized JSON as key. [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize.\n * @this Ajv\n * @param {String|Object} schemaKeyRef key, ref or schema object\n * @param {Any} data to be validated\n * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`).\n */\nfunction validate(schemaKeyRef, data) {\n var v;\n if (typeof schemaKeyRef == 'string') {\n v = this.getSchema(schemaKeyRef);\n if (!v) throw new Error('no schema with key or ref \"' + schemaKeyRef + '\"');\n } else {\n var schemaObj = this._addSchema(schemaKeyRef);\n v = schemaObj.validate || this._compile(schemaObj);\n }\n\n var valid = v(data);\n if (v.$async !== true) this.errors = v.errors;\n return valid;\n}\n\n\n/**\n * Create validating function for passed schema.\n * @this Ajv\n * @param {Object} schema schema object\n * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords.\n * @return {Function} validating function\n */\nfunction compile(schema, _meta) {\n var schemaObj = this._addSchema(schema, undefined, _meta);\n return schemaObj.validate || this._compile(schemaObj);\n}\n\n\n/**\n * Adds schema to the instance.\n * @this Ajv\n * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored.\n * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.\n * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead.\n * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.\n * @return {Ajv} this for method chaining\n */\nfunction addSchema(schema, key, _skipValidation, _meta) {\n if (Array.isArray(schema)){\n for (var i=0; i<schema.length; i++) this.addSchema(schema[i], undefined, _skipValidation, _meta);\n return this;\n }\n var id = this._getId(schema);\n if (id !== undefined && typeof id != 'string')\n throw new Error('schema id must be string');\n key = resolve.normalizeId(key || id);\n checkUnique(this, key);\n this._schemas[key] = this._addSchema(schema, _skipValidation, _meta, true);\n return this;\n}\n\n\n/**\n * Add schema that will be used to validate other schemas\n * options in META_IGNORE_OPTIONS are alway set to false\n * @this Ajv\n * @param {Object} schema schema object\n * @param {String} key optional schema key\n * @param {Boolean} skipValidation true to skip schema validation, can be used to override validateSchema option for meta-schema\n * @return {Ajv} this for method chaining\n */\nfunction addMetaSchema(schema, key, skipValidation) {\n this.addSchema(schema, key, skipValidation, true);\n return this;\n}\n\n\n/**\n * Validate schema\n * @this Ajv\n * @param {Object} schema schema to validate\n * @param {Boolean} throwOrLogError pass true to throw (or log) an error if invalid\n * @return {Boolean} true if schema is valid\n */\nfunction validateSchema(schema, throwOrLogError) {\n var $schema = schema.$schema;\n if ($schema !== undefined && typeof $schema != 'string')\n throw new Error('$schema must be a string');\n $schema = $schema || this._opts.defaultMeta || defaultMeta(this);\n if (!$schema) {\n this.logger.warn('meta-schema not available');\n this.errors = null;\n return true;\n }\n var valid = this.validate($schema, schema);\n if (!valid && throwOrLogError) {\n var message = 'schema is invalid: ' + this.errorsText();\n if (this._opts.validateSchema == 'log') this.logger.error(message);\n else throw new Error(message);\n }\n return valid;\n}\n\n\nfunction defaultMeta(self) {\n var meta = self._opts.meta;\n self._opts.defaultMeta = typeof meta == 'object'\n ? self._getId(meta) || meta\n : self.getSchema(META_SCHEMA_ID)\n ? META_SCHEMA_ID\n : undefined;\n return self._opts.defaultMeta;\n}\n\n\n/**\n * Get compiled schema from the instance by `key` or `ref`.\n * @this Ajv\n * @param {String} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id).\n * @return {Function} schema validating function (with property `schema`).\n */\nfunction getSchema(keyRef) {\n var schemaObj = _getSchemaObj(this, keyRef);\n switch (typeof schemaObj) {\n case 'object': return schemaObj.validate || this._compile(schemaObj);\n case 'string': return this.getSchema(schemaObj);\n case 'undefined': return _getSchemaFragment(this, keyRef);\n }\n}\n\n\nfunction _getSchemaFragment(self, ref) {\n var res = resolve.schema.call(self, { schema: {} }, ref);\n if (res) {\n var schema = res.schema\n , root = res.root\n , baseId = res.baseId;\n var v = compileSchema.call(self, schema, root, undefined, baseId);\n self._fragments[ref] = new SchemaObject({\n ref: ref,\n fragment: true,\n schema: schema,\n root: root,\n baseId: baseId,\n validate: v\n });\n return v;\n }\n}\n\n\nfunction _getSchemaObj(self, keyRef) {\n keyRef = resolve.normalizeId(keyRef);\n return self._schemas[keyRef] || self._refs[keyRef] || self._fragments[keyRef];\n}\n\n\n/**\n * Remove cached schema(s).\n * If no parameter is passed all schemas but meta-schemas are removed.\n * If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.\n * Even if schema is referenced by other schemas it still can be removed as other schemas have local references.\n * @this Ajv\n * @param {String|Object|RegExp} schemaKeyRef key, ref, pattern to match key/ref or schema object\n * @return {Ajv} this for method chaining\n */\nfunction removeSchema(schemaKeyRef) {\n if (schemaKeyRef instanceof RegExp) {\n _removeAllSchemas(this, this._schemas, schemaKeyRef);\n _removeAllSchemas(this, this._refs, schemaKeyRef);\n return this;\n }\n switch (typeof schemaKeyRef) {\n case 'undefined':\n _removeAllSchemas(this, this._schemas);\n _removeAllSchemas(this, this._refs);\n this._cache.clear();\n return this;\n case 'string':\n var schemaObj = _getSchemaObj(this, schemaKeyRef);\n if (schemaObj) this._cache.del(schemaObj.cacheKey);\n delete this._schemas[schemaKeyRef];\n delete this._refs[schemaKeyRef];\n return this;\n case 'object':\n var serialize = this._opts.serialize;\n var cacheKey = serialize ? serialize(schemaKeyRef) : schemaKeyRef;\n this._cache.del(cacheKey);\n var id = this._getId(schemaKeyRef);\n if (id) {\n id = resolve.normalizeId(id);\n delete this._schemas[id];\n delete this._refs[id];\n }\n }\n return this;\n}\n\n\nfunction _removeAllSchemas(self, schemas, regex) {\n for (var keyRef in schemas) {\n var schemaObj = schemas[keyRef];\n if (!schemaObj.meta && (!regex || regex.test(keyRef))) {\n self._cache.del(schemaObj.cacheKey);\n delete schemas[keyRef];\n }\n }\n}\n\n\n/* @this Ajv */\nfunction _addSchema(schema, skipValidation, meta, shouldAddSchema) {\n if (typeof schema != 'object' && typeof schema != 'boolean')\n throw new Error('schema should be object or boolean');\n var serialize = this._opts.serialize;\n var cacheKey = serialize ? serialize(schema) : schema;\n var cached = this._cache.get(cacheKey);\n if (cached) return cached;\n\n shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false;\n\n var id = resolve.normalizeId(this._getId(schema));\n if (id && shouldAddSchema) checkUnique(this, id);\n\n var willValidate = this._opts.validateSchema !== false && !skipValidation;\n var recursiveMeta;\n if (willValidate && !(recursiveMeta = id && id == resolve.normalizeId(schema.$schema)))\n this.validateSchema(schema, true);\n\n var localRefs = resolve.ids.call(this, schema);\n\n var schemaObj = new SchemaObject({\n id: id,\n schema: schema,\n localRefs: localRefs,\n cacheKey: cacheKey,\n meta: meta\n });\n\n if (id[0] != '#' && shouldAddSchema) this._refs[id] = schemaObj;\n this._cache.put(cacheKey, schemaObj);\n\n if (willValidate && recursiveMeta) this.validateSchema(schema, true);\n\n return schemaObj;\n}\n\n\n/* @this Ajv */\nfunction _compile(schemaObj, root) {\n if (schemaObj.compiling) {\n schemaObj.validate = callValidate;\n callValidate.schema = schemaObj.schema;\n callValidate.errors = null;\n callValidate.root = root ? root : callValidate;\n if (schemaObj.schema.$async === true)\n callValidate.$async = true;\n return callValidate;\n }\n schemaObj.compiling = true;\n\n var currentOpts;\n if (schemaObj.meta) {\n currentOpts = this._opts;\n this._opts = this._metaOpts;\n }\n\n var v;\n try { v = compileSchema.call(this, schemaObj.schema, root, schemaObj.localRefs); }\n catch(e) {\n delete schemaObj.validate;\n throw e;\n }\n finally {\n schemaObj.compiling = false;\n if (schemaObj.meta) this._opts = currentOpts;\n }\n\n schemaObj.validate = v;\n schemaObj.refs = v.refs;\n schemaObj.refVal = v.refVal;\n schemaObj.root = v.root;\n return v;\n\n\n /* @this {*} - custom context, see passContext option */\n function callValidate() {\n /* jshint validthis: true */\n var _validate = schemaObj.validate;\n var result = _validate.apply(this, arguments);\n callValidate.errors = _validate.errors;\n return result;\n }\n}\n\n\nfunction chooseGetId(opts) {\n switch (opts.schemaId) {\n case 'auto': return _get$IdOrId;\n case 'id': return _getId;\n default: return _get$Id;\n }\n}\n\n/* @this Ajv */\nfunction _getId(schema) {\n if (schema.$id) this.logger.warn('schema $id ignored', schema.$id);\n return schema.id;\n}\n\n/* @this Ajv */\nfunction _get$Id(schema) {\n if (schema.id) this.logger.warn('schema id ignored', schema.id);\n return schema.$id;\n}\n\n\nfunction _get$IdOrId(schema) {\n if (schema.$id && schema.id && schema.$id != schema.id)\n throw new Error('schema $id is different from id');\n return schema.$id || schema.id;\n}\n\n\n/**\n * Convert array of error message objects to string\n * @this Ajv\n * @param {Array<Object>} errors optional array of validation errors, if not passed errors from the instance are used.\n * @param {Object} options optional options with properties `separator` and `dataVar`.\n * @return {String} human readable string with all errors descriptions\n */\nfunction errorsText(errors, options) {\n errors = errors || this.errors;\n if (!errors) return 'No errors';\n options = options || {};\n var separator = options.separator === undefined ? ', ' : options.separator;\n var dataVar = options.dataVar === undefined ? 'data' : options.dataVar;\n\n var text = '';\n for (var i=0; i<errors.length; i++) {\n var e = errors[i];\n if (e) text += dataVar + e.dataPath + ' ' + e.message + separator;\n }\n return text.slice(0, -separator.length);\n}\n\n\n/**\n * Add custom format\n * @this Ajv\n * @param {String} name format name\n * @param {String|RegExp|Function} format string is converted to RegExp; function should return boolean (true when valid)\n * @return {Ajv} this for method chaining\n */\nfunction addFormat(name, format) {\n if (typeof format == 'string') format = new RegExp(format);\n this._formats[name] = format;\n return this;\n}\n\n\nfunction addDefaultMetaSchema(self) {\n var $dataSchema;\n if (self._opts.$data) {\n $dataSchema = require('./refs/data.json');\n self.addMetaSchema($dataSchema, $dataSchema.$id, true);\n }\n if (self._opts.meta === false) return;\n var metaSchema = require('./refs/json-schema-draft-07.json');\n if (self._opts.$data) metaSchema = $dataMetaSchema(metaSchema, META_SUPPORT_DATA);\n self.addMetaSchema(metaSchema, META_SCHEMA_ID, true);\n self._refs['http://json-schema.org/schema'] = META_SCHEMA_ID;\n}\n\n\nfunction addInitialSchemas(self) {\n var optsSchemas = self._opts.schemas;\n if (!optsSchemas) return;\n if (Array.isArray(optsSchemas)) self.addSchema(optsSchemas);\n else for (var key in optsSchemas) self.addSchema(optsSchemas[key], key);\n}\n\n\nfunction addInitialFormats(self) {\n for (var name in self._opts.formats) {\n var format = self._opts.formats[name];\n self.addFormat(name, format);\n }\n}\n\n\nfunction addInitialKeywords(self) {\n for (var name in self._opts.keywords) {\n var keyword = self._opts.keywords[name];\n self.addKeyword(name, keyword);\n }\n}\n\n\nfunction checkUnique(self, id) {\n if (self._schemas[id] || self._refs[id])\n throw new Error('schema with key or id \"' + id + '\" already exists');\n}\n\n\nfunction getMetaSchemaOptions(self) {\n var metaOpts = util.copy(self._opts);\n for (var i=0; i<META_IGNORE_OPTIONS.length; i++)\n delete metaOpts[META_IGNORE_OPTIONS[i]];\n return metaOpts;\n}\n\n\nfunction setLogger(self) {\n var logger = self._opts.logger;\n if (logger === false) {\n self.logger = {log: noop, warn: noop, error: noop};\n } else {\n if (logger === undefined) logger = console;\n if (!(typeof logger == 'object' && logger.log && logger.warn && logger.error))\n throw new Error('logger must implement log, warn and error methods');\n self.logger = logger;\n }\n}\n\n\nfunction noop() {}\n","'use strict';\n\nvar CONSTRUCTORS = {\n Object: Object,\n Array: Array,\n Function: Function,\n Number: Number,\n String: String,\n Date: Date,\n RegExp: RegExp\n};\n\nmodule.exports = function defFunc(ajv) {\n /* istanbul ignore else */\n if (typeof Buffer != 'undefined')\n CONSTRUCTORS.Buffer = Buffer;\n\n /* istanbul ignore else */\n if (typeof Promise != 'undefined')\n CONSTRUCTORS.Promise = Promise;\n\n defFunc.definition = {\n compile: function (schema) {\n if (typeof schema == 'string') {\n var Constructor = getConstructor(schema);\n return function (data) {\n return data instanceof Constructor;\n };\n }\n\n var constructors = schema.map(getConstructor);\n return function (data) {\n for (var i=0; i<constructors.length; i++)\n if (data instanceof constructors[i]) return true;\n return false;\n };\n },\n CONSTRUCTORS: CONSTRUCTORS,\n metaSchema: {\n anyOf: [\n { type: 'string' },\n {\n type: 'array',\n items: { type: 'string' }\n }\n ]\n }\n };\n\n ajv.addKeyword('instanceof', defFunc.definition);\n return ajv;\n\n function getConstructor(c) {\n var Constructor = CONSTRUCTORS[c];\n if (Constructor) return Constructor;\n throw new Error('invalid \"instanceof\" keyword value ' + c);\n }\n};\n","'use strict';\n\nmodule.exports = function defFunc(ajv) {\n defFunc.definition = {\n type: 'number',\n macro: function (schema, parentSchema) {\n var min = schema[0]\n , max = schema[1]\n , exclusive = parentSchema.exclusiveRange;\n\n validateRangeSchema(min, max, exclusive);\n\n return exclusive === true\n ? {exclusiveMinimum: min, exclusiveMaximum: max}\n : {minimum: min, maximum: max};\n },\n metaSchema: {\n type: 'array',\n minItems: 2,\n maxItems: 2,\n items: { type: 'number' }\n }\n };\n\n ajv.addKeyword('range', defFunc.definition);\n ajv.addKeyword('exclusiveRange');\n return ajv;\n\n function validateRangeSchema(min, max, exclusive) {\n if (exclusive !== undefined && typeof exclusive != 'boolean')\n throw new Error('Invalid schema for exclusiveRange keyword, should be boolean');\n\n if (min > max || (exclusive && min == max))\n throw new Error('There are no numbers in range');\n }\n};\n","'use strict';\n\nmodule.exports = function defFunc(ajv) {\n defFunc.definition = {\n type: 'string',\n inline: function (it, keyword, schema) {\n return getRegExp() + '.test(data' + (it.dataLevel || '') + ')';\n\n function getRegExp() {\n try {\n if (typeof schema == 'object')\n return new RegExp(schema.pattern, schema.flags);\n\n var rx = schema.match(/^\\/(.*)\\/([gimuy]*)$/);\n if (rx) return new RegExp(rx[1], rx[2]);\n throw new Error('cannot parse string into RegExp');\n } catch(e) {\n console.error('regular expression', schema, 'is invalid');\n throw e;\n }\n }\n },\n metaSchema: {\n type: ['string', 'object'],\n properties: {\n pattern: { type: 'string' },\n flags: { type: 'string' }\n },\n required: ['pattern'],\n additionalProperties: false\n }\n };\n\n ajv.addKeyword('regexp', defFunc.definition);\n return ajv;\n};\n","'use strict';\n\nvar KNOWN_TYPES = ['undefined', 'string', 'number', 'object', 'function', 'boolean', 'symbol'];\n\nmodule.exports = function defFunc(ajv) {\n defFunc.definition = {\n inline: function (it, keyword, schema) {\n var data = 'data' + (it.dataLevel || '');\n if (typeof schema == 'string') return 'typeof ' + data + ' == \"' + schema + '\"';\n schema = 'validate.schema' + it.schemaPath + '.' + keyword;\n return schema + '.indexOf(typeof ' + data + ') >= 0';\n },\n metaSchema: {\n anyOf: [\n {\n type: 'string',\n enum: KNOWN_TYPES\n },\n {\n type: 'array',\n items: {\n type: 'string',\n enum: KNOWN_TYPES\n }\n }\n ]\n }\n };\n\n ajv.addKeyword('typeof', defFunc.definition);\n return ajv;\n};\n","'use strict';\n\nvar sequences = {};\n\nvar DEFAULTS = {\n timestamp: function() { return Date.now(); },\n datetime: function() { return (new Date).toISOString(); },\n date: function() { return (new Date).toISOString().slice(0, 10); },\n time: function() { return (new Date).toISOString().slice(11); },\n random: function() { return Math.random(); },\n randomint: function (args) {\n var limit = args && args.max || 2;\n return function() { return Math.floor(Math.random() * limit); };\n },\n seq: function (args) {\n var name = args && args.name || '';\n sequences[name] = sequences[name] || 0;\n return function() { return sequences[name]++; };\n }\n};\n\nmodule.exports = function defFunc(ajv) {\n defFunc.definition = {\n compile: function (schema, parentSchema, it) {\n var funcs = {};\n\n for (var key in schema) {\n var d = schema[key];\n var func = getDefault(typeof d == 'string' ? d : d.func);\n funcs[key] = func.length ? func(d.args) : func;\n }\n\n return it.opts.useDefaults && !it.compositeRule\n ? assignDefaults\n : noop;\n\n function assignDefaults(data) {\n for (var prop in schema){\n if (data[prop] === undefined\n || (it.opts.useDefaults == 'empty'\n && (data[prop] === null || data[prop] === '')))\n data[prop] = funcs[prop]();\n }\n return true;\n }\n\n function noop() { return true; }\n },\n DEFAULTS: DEFAULTS,\n metaSchema: {\n type: 'object',\n additionalProperties: {\n type: ['string', 'object'],\n additionalProperties: false,\n required: ['func', 'args'],\n properties: {\n func: { type: 'string' },\n args: { type: 'object' }\n }\n }\n }\n };\n\n ajv.addKeyword('dynamicDefaults', defFunc.definition);\n return ajv;\n\n function getDefault(d) {\n var def = DEFAULTS[d];\n if (def) return def;\n throw new Error('invalid \"dynamicDefaults\" keyword property value: ' + d);\n }\n};\n","'use strict';\n\nmodule.exports = function defFunc(ajv) {\n defFunc.definition = {\n type: 'object',\n macro: function (schema, parentSchema) {\n if (!schema) return true;\n var properties = Object.keys(parentSchema.properties);\n if (properties.length == 0) return true;\n return {required: properties};\n },\n metaSchema: {type: 'boolean'},\n dependencies: ['properties']\n };\n\n ajv.addKeyword('allRequired', defFunc.definition);\n return ajv;\n};\n","'use strict';\n\nmodule.exports = function defFunc(ajv) {\n defFunc.definition = {\n type: 'object',\n macro: function (schema) {\n if (schema.length == 0) return true;\n if (schema.length == 1) return {required: schema};\n var schemas = schema.map(function (prop) {\n return {required: [prop]};\n });\n return {anyOf: schemas};\n },\n metaSchema: {\n type: 'array',\n items: {\n type: 'string'\n }\n }\n };\n\n ajv.addKeyword('anyRequired', defFunc.definition);\n return ajv;\n};\n","'use strict';\n\nmodule.exports = function defFunc(ajv) {\n defFunc.definition = {\n type: 'object',\n macro: function (schema) {\n if (schema.length == 0) return true;\n if (schema.length == 1) return {required: schema};\n var schemas = schema.map(function (prop) {\n return {required: [prop]};\n });\n return {oneOf: schemas};\n },\n metaSchema: {\n type: 'array',\n items: {\n type: 'string'\n }\n }\n };\n\n ajv.addKeyword('oneRequired', defFunc.definition);\n return ajv;\n};\n","'use strict';\n\nmodule.exports = function defFunc(ajv) {\n defFunc.definition = {\n type: 'object',\n macro: function (schema) {\n if (schema.length == 0) return true;\n if (schema.length == 1) return {not: {required: schema}};\n var schemas = schema.map(function (prop) {\n return {required: [prop]};\n });\n return {not: {anyOf: schemas}};\n },\n metaSchema: {\n type: 'array',\n items: {\n type: 'string'\n }\n }\n };\n\n ajv.addKeyword('prohibited', defFunc.definition);\n return ajv;\n};\n","'use strict';\n\nvar SCALAR_TYPES = ['number', 'integer', 'string', 'boolean', 'null'];\n\nmodule.exports = function defFunc(ajv) {\n defFunc.definition = {\n type: 'array',\n compile: function(keys, parentSchema, it) {\n var equal = it.util.equal;\n var scalar = getScalarKeys(keys, parentSchema);\n\n return function(data) {\n if (data.length > 1) {\n for (var k=0; k < keys.length; k++) {\n var i, key = keys[k];\n if (scalar[k]) {\n var hash = {};\n for (i = data.length; i--;) {\n if (!data[i] || typeof data[i] != 'object') continue;\n var prop = data[i][key];\n if (prop && typeof prop == 'object') continue;\n if (typeof prop == 'string') prop = '\"' + prop;\n if (hash[prop]) return false;\n hash[prop] = true;\n }\n } else {\n for (i = data.length; i--;) {\n if (!data[i] || typeof data[i] != 'object') continue;\n for (var j = i; j--;) {\n if (data[j] && typeof data[j] == 'object' && equal(data[i][key], data[j][key]))\n return false;\n }\n }\n }\n }\n }\n return true;\n };\n },\n metaSchema: {\n type: 'array',\n items: {type: 'string'}\n }\n };\n\n ajv.addKeyword('uniqueItemProperties', defFunc.definition);\n return ajv;\n};\n\n\nfunction getScalarKeys(keys, schema) {\n return keys.map(function(key) {\n var properties = schema.items && schema.items.properties;\n var propType = properties && properties[key] && properties[key].type;\n return Array.isArray(propType)\n ? propType.indexOf('object') < 0 && propType.indexOf('array') < 0\n : SCALAR_TYPES.indexOf(propType) >= 0;\n });\n}\n","'use strict';\n\nmodule.exports = {\n metaSchemaRef: metaSchemaRef\n};\n\nvar META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema';\n\nfunction metaSchemaRef(ajv) {\n var defaultMeta = ajv._opts.defaultMeta;\n if (typeof defaultMeta == 'string') return { $ref: defaultMeta };\n if (ajv.getSchema(META_SCHEMA_ID)) return { $ref: META_SCHEMA_ID };\n console.warn('meta schema not defined');\n return {};\n}\n","'use strict';\n\nvar util = require('./_util');\n\nmodule.exports = function defFunc(ajv) {\n defFunc.definition = {\n type: 'object',\n macro: function (schema) {\n var schemas = [];\n for (var pointer in schema)\n schemas.push(getSchema(pointer, schema[pointer]));\n return {'allOf': schemas};\n },\n metaSchema: {\n type: 'object',\n propertyNames: {\n type: 'string',\n format: 'json-pointer'\n },\n additionalProperties: util.metaSchemaRef(ajv)\n }\n };\n\n ajv.addKeyword('deepProperties', defFunc.definition);\n return ajv;\n};\n\n\nfunction getSchema(jsonPointer, schema) {\n var segments = jsonPointer.split('/');\n var rootSchema = {};\n var pointerSchema = rootSchema;\n for (var i=1; i<segments.length; i++) {\n var segment = segments[i];\n var isLast = i == segments.length - 1;\n segment = unescapeJsonPointer(segment);\n var properties = pointerSchema.properties = {};\n var items = undefined;\n if (/[0-9]+/.test(segment)) {\n var count = +segment;\n items = pointerSchema.items = [];\n while (count--) items.push({});\n }\n pointerSchema = isLast ? schema : {};\n properties[segment] = pointerSchema;\n if (items) items.push(pointerSchema);\n }\n return rootSchema;\n}\n\n\nfunction unescapeJsonPointer(str) {\n return str.replace(/~1/g, '/').replace(/~0/g, '~');\n}\n","'use strict';\n\nmodule.exports = function defFunc(ajv) {\n defFunc.definition = {\n type: 'object',\n inline: function (it, keyword, schema) {\n var expr = '';\n for (var i=0; i<schema.length; i++) {\n if (i) expr += ' && ';\n expr += '(' + getData(schema[i], it.dataLevel) + ' !== undefined)';\n }\n return expr;\n },\n metaSchema: {\n type: 'array',\n items: {\n type: 'string',\n format: 'json-pointer'\n }\n }\n };\n\n ajv.addKeyword('deepRequired', defFunc.definition);\n return ajv;\n};\n\n\nfunction getData(jsonPointer, lvl) {\n var data = 'data' + (lvl || '');\n if (!jsonPointer) return data;\n\n var expr = data;\n var segments = jsonPointer.split('/');\n for (var i=1; i<segments.length; i++) {\n var segment = segments[i];\n data += getProperty(unescapeJsonPointer(segment));\n expr += ' && ' + data;\n }\n return expr;\n}\n\n\nvar IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;\nvar INTEGER = /^[0-9]+$/;\nvar SINGLE_QUOTE = /'|\\\\/g;\nfunction getProperty(key) {\n return INTEGER.test(key)\n ? '[' + key + ']'\n : IDENTIFIER.test(key)\n ? '.' + key\n : \"['\" + key.replace(SINGLE_QUOTE, '\\\\$&') + \"']\";\n}\n\n\nfunction unescapeJsonPointer(str) {\n return str.replace(/~1/g, '/').replace(/~0/g, '~');\n}\n","'use strict';\nmodule.exports = function generate__formatLimit(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n out += 'var ' + ($valid) + ' = undefined;';\n if (it.opts.format === false) {\n out += ' ' + ($valid) + ' = true; ';\n return out;\n }\n var $schemaFormat = it.schema.format,\n $isDataFormat = it.opts.$data && $schemaFormat.$data,\n $closingBraces = '';\n if ($isDataFormat) {\n var $schemaValueFormat = it.util.getData($schemaFormat.$data, $dataLvl, it.dataPathArr),\n $format = 'format' + $lvl,\n $compare = 'compare' + $lvl;\n out += ' var ' + ($format) + ' = formats[' + ($schemaValueFormat) + '] , ' + ($compare) + ' = ' + ($format) + ' && ' + ($format) + '.compare;';\n } else {\n var $format = it.formats[$schemaFormat];\n if (!($format && $format.compare)) {\n out += ' ' + ($valid) + ' = true; ';\n return out;\n }\n var $compare = 'formats' + it.util.getProperty($schemaFormat) + '.compare';\n }\n var $isMax = $keyword == 'formatMaximum',\n $exclusiveKeyword = 'formatExclusive' + ($isMax ? 'Maximum' : 'Minimum'),\n $schemaExcl = it.schema[$exclusiveKeyword],\n $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data,\n $op = $isMax ? '<' : '>',\n $result = 'result' + $lvl;\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n if ($isDataExcl) {\n var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr),\n $exclusive = 'exclusive' + $lvl,\n $opExpr = 'op' + $lvl,\n $opStr = '\\' + ' + $opExpr + ' + \\'';\n out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; ';\n $schemaValueExcl = 'schemaExcl' + $lvl;\n out += ' if (typeof ' + ($schemaValueExcl) + ' != \\'boolean\\' && ' + ($schemaValueExcl) + ' !== undefined) { ' + ($valid) + ' = false; ';\n var $errorKeyword = $exclusiveKeyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || '_formatExclusiveLimit') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'' + ($exclusiveKeyword) + ' should be boolean\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } ';\n if ($breakOnError) {\n $closingBraces += '}';\n out += ' else { ';\n }\n if ($isData) {\n out += ' if (' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \\'string\\') ' + ($valid) + ' = false; else { ';\n $closingBraces += '}';\n }\n if ($isDataFormat) {\n out += ' if (!' + ($compare) + ') ' + ($valid) + ' = true; else { ';\n $closingBraces += '}';\n }\n out += ' var ' + ($result) + ' = ' + ($compare) + '(' + ($data) + ', ';\n if ($isData) {\n out += '' + ($schemaValue);\n } else {\n out += '' + (it.util.toQuotedString($schema));\n }\n out += ' ); if (' + ($result) + ' === undefined) ' + ($valid) + ' = false; var ' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true; if (' + ($valid) + ' === undefined) { ' + ($valid) + ' = ' + ($exclusive) + ' ? ' + ($result) + ' ' + ($op) + ' 0 : ' + ($result) + ' ' + ($op) + '= 0; } if (!' + ($valid) + ') var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \\'' + ($op) + '\\' : \\'' + ($op) + '=\\';';\n } else {\n var $exclusive = $schemaExcl === true,\n $opStr = $op;\n if (!$exclusive) $opStr += '=';\n var $opExpr = '\\'' + $opStr + '\\'';\n if ($isData) {\n out += ' if (' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \\'string\\') ' + ($valid) + ' = false; else { ';\n $closingBraces += '}';\n }\n if ($isDataFormat) {\n out += ' if (!' + ($compare) + ') ' + ($valid) + ' = true; else { ';\n $closingBraces += '}';\n }\n out += ' var ' + ($result) + ' = ' + ($compare) + '(' + ($data) + ', ';\n if ($isData) {\n out += '' + ($schemaValue);\n } else {\n out += '' + (it.util.toQuotedString($schema));\n }\n out += ' ); if (' + ($result) + ' === undefined) ' + ($valid) + ' = false; if (' + ($valid) + ' === undefined) ' + ($valid) + ' = ' + ($result) + ' ' + ($op);\n if (!$exclusive) {\n out += '=';\n }\n out += ' 0;';\n }\n out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { ';\n var $errorKeyword = $keyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || '_formatLimit') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ';\n if ($isData) {\n out += '' + ($schemaValue);\n } else {\n out += '' + (it.util.toQuotedString($schema));\n }\n out += ' , exclusive: ' + ($exclusive) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be ' + ($opStr) + ' \"';\n if ($isData) {\n out += '\\' + ' + ($schemaValue) + ' + \\'';\n } else {\n out += '' + (it.util.escapeQuotes($schema));\n }\n out += '\"\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + (it.util.toQuotedString($schema));\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += '}';\n return out;\n}\n","'use strict';\n\nvar TIME = /^(\\d\\d):(\\d\\d):(\\d\\d)(\\.\\d+)?(z|[+-]\\d\\d:\\d\\d)?$/i;\nvar DATE_TIME_SEPARATOR = /t|\\s/i;\n\nvar COMPARE_FORMATS = {\n date: compareDate,\n time: compareTime,\n 'date-time': compareDateTime\n};\n\nvar $dataMetaSchema = {\n type: 'object',\n required: [ '$data' ],\n properties: {\n $data: {\n type: 'string',\n anyOf: [\n { format: 'relative-json-pointer' },\n { format: 'json-pointer' }\n ]\n }\n },\n additionalProperties: false\n};\n\nmodule.exports = function (minMax) {\n var keyword = 'format' + minMax;\n return function defFunc(ajv) {\n defFunc.definition = {\n type: 'string',\n inline: require('./dotjs/_formatLimit'),\n statements: true,\n errors: 'full',\n dependencies: ['format'],\n metaSchema: {\n anyOf: [\n {type: 'string'},\n $dataMetaSchema\n ]\n }\n };\n\n ajv.addKeyword(keyword, defFunc.definition);\n ajv.addKeyword('formatExclusive' + minMax, {\n dependencies: ['format' + minMax],\n metaSchema: {\n anyOf: [\n {type: 'boolean'},\n $dataMetaSchema\n ]\n }\n });\n extendFormats(ajv);\n return ajv;\n };\n};\n\n\nfunction extendFormats(ajv) {\n var formats = ajv._formats;\n for (var name in COMPARE_FORMATS) {\n var format = formats[name];\n // the last condition is needed if it's RegExp from another window\n if (typeof format != 'object' || format instanceof RegExp || !format.validate)\n format = formats[name] = { validate: format };\n if (!format.compare)\n format.compare = COMPARE_FORMATS[name];\n }\n}\n\n\nfunction compareDate(d1, d2) {\n if (!(d1 && d2)) return;\n if (d1 > d2) return 1;\n if (d1 < d2) return -1;\n if (d1 === d2) return 0;\n}\n\n\nfunction compareTime(t1, t2) {\n if (!(t1 && t2)) return;\n t1 = t1.match(TIME);\n t2 = t2.match(TIME);\n if (!(t1 && t2)) return;\n t1 = t1[1] + t1[2] + t1[3] + (t1[4]||'');\n t2 = t2[1] + t2[2] + t2[3] + (t2[4]||'');\n if (t1 > t2) return 1;\n if (t1 < t2) return -1;\n if (t1 === t2) return 0;\n}\n\n\nfunction compareDateTime(dt1, dt2) {\n if (!(dt1 && dt2)) return;\n dt1 = dt1.split(DATE_TIME_SEPARATOR);\n dt2 = dt2.split(DATE_TIME_SEPARATOR);\n var res = compareDate(dt1[0], dt2[0]);\n if (res === undefined) return;\n return res || compareTime(dt1[1], dt2[1]);\n}\n","'use strict';\n\nmodule.exports = require('./_formatLimit')('Minimum');\n","'use strict';\n\nmodule.exports = require('./_formatLimit')('Maximum');\n","'use strict';\nmodule.exports = function generate_patternRequired(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $key = 'key' + $lvl,\n $idx = 'idx' + $lvl,\n $matched = 'patternMatched' + $lvl,\n $dataProperties = 'dataProperties' + $lvl,\n $closingBraces = '',\n $ownProperties = it.opts.ownProperties;\n out += 'var ' + ($valid) + ' = true;';\n if ($ownProperties) {\n out += ' var ' + ($dataProperties) + ' = undefined;';\n }\n var arr1 = $schema;\n if (arr1) {\n var $pProperty, i1 = -1,\n l1 = arr1.length - 1;\n while (i1 < l1) {\n $pProperty = arr1[i1 += 1];\n out += ' var ' + ($matched) + ' = false; ';\n if ($ownProperties) {\n out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';\n } else {\n out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';\n }\n out += ' ' + ($matched) + ' = ' + (it.usePattern($pProperty)) + '.test(' + ($key) + '); if (' + ($matched) + ') break; } ';\n var $missingPattern = it.util.escapeQuotes($pProperty);\n out += ' if (!' + ($matched) + ') { ' + ($valid) + ' = false; var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('patternRequired') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingPattern: \\'' + ($missingPattern) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should have property matching pattern \\\\\\'' + ($missingPattern) + '\\\\\\'\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ';\n if ($breakOnError) {\n $closingBraces += '}';\n out += ' else { ';\n }\n }\n }\n out += '' + ($closingBraces);\n return out;\n}\n","'use strict';\n\nmodule.exports = function defFunc(ajv) {\n defFunc.definition = {\n type: 'object',\n inline: require('./dotjs/patternRequired'),\n statements: true,\n errors: 'full',\n metaSchema: {\n type: 'array',\n items: {\n type: 'string',\n format: 'regex'\n },\n uniqueItems: true\n }\n };\n\n ajv.addKeyword('patternRequired', defFunc.definition);\n return ajv;\n};\n","'use strict';\nmodule.exports = function generate_switch(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $ifPassed = 'ifPassed' + it.level,\n $currentBaseId = $it.baseId,\n $shouldContinue;\n out += 'var ' + ($ifPassed) + ';';\n var arr1 = $schema;\n if (arr1) {\n var $sch, $caseIndex = -1,\n l1 = arr1.length - 1;\n while ($caseIndex < l1) {\n $sch = arr1[$caseIndex += 1];\n if ($caseIndex && !$shouldContinue) {\n out += ' if (!' + ($ifPassed) + ') { ';\n $closingBraces += '}';\n }\n if ($sch.if && (it.opts.strictKeywords ? typeof $sch.if == 'object' && Object.keys($sch.if).length > 0 : it.util.schemaHasRules($sch.if, it.RULES.all))) {\n out += ' var ' + ($errs) + ' = errors; ';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n $it.createErrors = false;\n $it.schema = $sch.if;\n $it.schemaPath = $schemaPath + '[' + $caseIndex + '].if';\n $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/if';\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n $it.createErrors = true;\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += ' ' + ($ifPassed) + ' = ' + ($nextValid) + '; if (' + ($ifPassed) + ') { ';\n if (typeof $sch.then == 'boolean') {\n if ($sch.then === false) {\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('switch') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { caseIndex: ' + ($caseIndex) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should pass \"switch\" keyword validation\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n }\n out += ' var ' + ($nextValid) + ' = ' + ($sch.then) + '; ';\n } else {\n $it.schema = $sch.then;\n $it.schemaPath = $schemaPath + '[' + $caseIndex + '].then';\n $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/then';\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n }\n out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } } ';\n } else {\n out += ' ' + ($ifPassed) + ' = true; ';\n if (typeof $sch.then == 'boolean') {\n if ($sch.then === false) {\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('switch') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { caseIndex: ' + ($caseIndex) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should pass \"switch\" keyword validation\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n }\n out += ' var ' + ($nextValid) + ' = ' + ($sch.then) + '; ';\n } else {\n $it.schema = $sch.then;\n $it.schemaPath = $schemaPath + '[' + $caseIndex + '].then';\n $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/then';\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n }\n }\n $shouldContinue = $sch.continue\n }\n }\n out += '' + ($closingBraces) + 'var ' + ($valid) + ' = ' + ($nextValid) + ';';\n return out;\n}\n","'use strict';\n\nvar util = require('./_util');\n\nmodule.exports = function defFunc(ajv) {\n if (ajv.RULES.keywords.switch && ajv.RULES.keywords.if) return;\n\n var metaSchemaRef = util.metaSchemaRef(ajv);\n\n defFunc.definition = {\n inline: require('./dotjs/switch'),\n statements: true,\n errors: 'full',\n metaSchema: {\n type: 'array',\n items: {\n required: [ 'then' ],\n properties: {\n 'if': metaSchemaRef,\n 'then': {\n anyOf: [\n { type: 'boolean' },\n metaSchemaRef\n ]\n },\n 'continue': { type: 'boolean' }\n },\n additionalProperties: false,\n dependencies: {\n 'continue': [ 'if' ]\n }\n }\n }\n };\n\n ajv.addKeyword('switch', defFunc.definition);\n return ajv;\n};\n","'use strict';\n\nvar util = require('./_util');\n\nmodule.exports = function defFunc(ajv) {\n if (!ajv._opts.$data) {\n console.warn('keyword select requires $data option');\n return ajv;\n }\n var metaSchemaRef = util.metaSchemaRef(ajv);\n var compiledCaseSchemas = [];\n\n defFunc.definition = {\n validate: function v(schema, data, parentSchema) {\n if (parentSchema.selectCases === undefined)\n throw new Error('keyword \"selectCases\" is absent');\n var compiled = getCompiledSchemas(parentSchema, false);\n var validate = compiled.cases[schema];\n if (validate === undefined) validate = compiled.default;\n if (typeof validate == 'boolean') return validate;\n var valid = validate(data);\n if (!valid) v.errors = validate.errors;\n return valid;\n },\n $data: true,\n metaSchema: { type: ['string', 'number', 'boolean', 'null'] }\n };\n\n ajv.addKeyword('select', defFunc.definition);\n ajv.addKeyword('selectCases', {\n compile: function (schemas, parentSchema) {\n var compiled = getCompiledSchemas(parentSchema);\n for (var value in schemas)\n compiled.cases[value] = compileOrBoolean(schemas[value]);\n return function() { return true; };\n },\n valid: true,\n metaSchema: {\n type: 'object',\n additionalProperties: metaSchemaRef\n }\n });\n ajv.addKeyword('selectDefault', {\n compile: function (schema, parentSchema) {\n var compiled = getCompiledSchemas(parentSchema);\n compiled.default = compileOrBoolean(schema);\n return function() { return true; };\n },\n valid: true,\n metaSchema: metaSchemaRef\n });\n return ajv;\n\n\n function getCompiledSchemas(parentSchema, create) {\n var compiled;\n compiledCaseSchemas.some(function (c) {\n if (c.parentSchema === parentSchema) {\n compiled = c;\n return true;\n }\n });\n if (!compiled && create !== false) {\n compiled = {\n parentSchema: parentSchema,\n cases: {},\n default: true\n };\n compiledCaseSchemas.push(compiled);\n }\n return compiled;\n }\n\n function compileOrBoolean(schema) {\n return typeof schema == 'boolean'\n ? schema\n : ajv.compile(schema);\n }\n};\n","'use strict';\n\nmodule.exports = function defFunc (ajv) {\n var transform = {\n trimLeft: function (value) {\n return value.replace(/^[\\s]+/, '');\n },\n trimRight: function (value) {\n return value.replace(/[\\s]+$/, '');\n },\n trim: function (value) {\n return value.trim();\n },\n toLowerCase: function (value) {\n return value.toLowerCase();\n },\n toUpperCase: function (value) {\n return value.toUpperCase();\n },\n toEnumCase: function (value, cfg) {\n return cfg.hash[makeHashTableKey(value)] || value;\n }\n };\n\n defFunc.definition = {\n type: 'string',\n errors: false,\n modifying: true,\n valid: true,\n compile: function (schema, parentSchema) {\n var cfg;\n\n if (schema.indexOf('toEnumCase') !== -1) {\n // build hash table to enum values\n cfg = {hash: {}};\n\n // requires `enum` in schema\n if (!parentSchema.enum)\n throw new Error('Missing enum. To use `transform:[\"toEnumCase\"]`, `enum:[...]` is required.');\n for (var i = parentSchema.enum.length; i--; i) {\n var v = parentSchema.enum[i];\n if (typeof v !== 'string') continue;\n var k = makeHashTableKey(v);\n // requires all `enum` values have unique keys\n if (cfg.hash[k])\n throw new Error('Invalid enum uniqueness. To use `transform:[\"toEnumCase\"]`, all values must be unique when case insensitive.');\n cfg.hash[k] = v;\n }\n }\n\n return function (data, dataPath, object, key) {\n // skip if value only\n if (!object) return;\n\n // apply transform in order provided\n for (var j = 0, l = schema.length; j < l; j++)\n data = transform[schema[j]](data, cfg);\n\n object[key] = data;\n };\n },\n metaSchema: {\n type: 'array',\n items: {\n type: 'string',\n enum: [\n 'trimLeft', 'trimRight', 'trim',\n 'toLowerCase', 'toUpperCase', 'toEnumCase'\n ]\n }\n }\n };\n\n ajv.addKeyword('transform', defFunc.definition);\n return ajv;\n\n function makeHashTableKey (value) {\n return value.toLowerCase();\n }\n};\n","'use strict';\n\nmodule.exports = {\n 'instanceof': require('./instanceof'),\n range: require('./range'),\n regexp: require('./regexp'),\n 'typeof': require('./typeof'),\n dynamicDefaults: require('./dynamicDefaults'),\n allRequired: require('./allRequired'),\n anyRequired: require('./anyRequired'),\n oneRequired: require('./oneRequired'),\n prohibited: require('./prohibited'),\n uniqueItemProperties: require('./uniqueItemProperties'),\n deepProperties: require('./deepProperties'),\n deepRequired: require('./deepRequired'),\n formatMinimum: require('./formatMinimum'),\n formatMaximum: require('./formatMaximum'),\n patternRequired: require('./patternRequired'),\n 'switch': require('./switch'),\n select: require('./select'),\n transform: require('./transform')\n};\n","'use strict';\n\nvar KEYWORDS = require('./keywords');\n\nmodule.exports = defineKeywords;\n\n\n/**\n * Defines one or several keywords in ajv instance\n * @param {Ajv} ajv validator instance\n * @param {String|Array<String>|undefined} keyword keyword(s) to define\n * @return {Ajv} ajv instance (for chaining)\n */\nfunction defineKeywords(ajv, keyword) {\n if (Array.isArray(keyword)) {\n for (var i=0; i<keyword.length; i++)\n get(keyword[i])(ajv);\n return ajv;\n }\n if (keyword) {\n get(keyword)(ajv);\n return ajv;\n }\n for (keyword in KEYWORDS) get(keyword)(ajv);\n return ajv;\n}\n\n\ndefineKeywords.get = get;\n\nfunction get(keyword) {\n var defFunc = KEYWORDS[keyword];\n if (!defFunc) throw new Error('Unknown keyword ' + keyword);\n return defFunc;\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.validate = validate;\nObject.defineProperty(exports, \"ValidationError\", {\n enumerable: true,\n get: function () {\n return _ValidationError.default;\n }\n});\n\nvar _absolutePath = _interopRequireDefault(require(\"./keywords/absolutePath\"));\n\nvar _ValidationError = _interopRequireDefault(require(\"./ValidationError\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Use CommonJS require for ajv libs so TypeScript consumers aren't locked into esModuleInterop (see #110).\nconst Ajv = require(\"ajv\");\n\nconst ajvKeywords = require(\"ajv-keywords\");\n/** @typedef {import(\"json-schema\").JSONSchema4} JSONSchema4 */\n\n/** @typedef {import(\"json-schema\").JSONSchema6} JSONSchema6 */\n\n/** @typedef {import(\"json-schema\").JSONSchema7} JSONSchema7 */\n\n/** @typedef {import(\"ajv\").ErrorObject} ErrorObject */\n\n/**\n * @typedef {Object} Extend\n * @property {number=} formatMinimum\n * @property {number=} formatMaximum\n * @property {boolean=} formatExclusiveMinimum\n * @property {boolean=} formatExclusiveMaximum\n * @property {string=} link\n */\n\n/** @typedef {(JSONSchema4 | JSONSchema6 | JSONSchema7) & Extend} Schema */\n\n/** @typedef {ErrorObject & { children?: Array<ErrorObject>}} SchemaUtilErrorObject */\n\n/**\n * @callback PostFormatter\n * @param {string} formattedError\n * @param {SchemaUtilErrorObject} error\n * @returns {string}\n */\n\n/**\n * @typedef {Object} ValidationErrorConfiguration\n * @property {string=} name\n * @property {string=} baseDataPath\n * @property {PostFormatter=} postFormatter\n */\n\n\nconst ajv = new Ajv({\n allErrors: true,\n verbose: true,\n $data: true\n});\najvKeywords(ajv, [\"instanceof\", \"formatMinimum\", \"formatMaximum\", \"patternRequired\"]); // Custom keywords\n\n(0, _absolutePath.default)(ajv);\n/**\n * @param {Schema} schema\n * @param {Array<object> | object} options\n * @param {ValidationErrorConfiguration=} configuration\n * @returns {void}\n */\n\nfunction validate(schema, options, configuration) {\n let errors = [];\n\n if (Array.isArray(options)) {\n errors = Array.from(options, nestedOptions => validateObject(schema, nestedOptions));\n errors.forEach((list, idx) => {\n const applyPrefix =\n /**\n * @param {SchemaUtilErrorObject} error\n */\n error => {\n // eslint-disable-next-line no-param-reassign\n error.dataPath = `[${idx}]${error.dataPath}`;\n\n if (error.children) {\n error.children.forEach(applyPrefix);\n }\n };\n\n list.forEach(applyPrefix);\n });\n errors = errors.reduce((arr, items) => {\n arr.push(...items);\n return arr;\n }, []);\n } else {\n errors = validateObject(schema, options);\n }\n\n if (errors.length > 0) {\n throw new _ValidationError.default(errors, schema, configuration);\n }\n}\n/**\n * @param {Schema} schema\n * @param {Array<object> | object} options\n * @returns {Array<SchemaUtilErrorObject>}\n */\n\n\nfunction validateObject(schema, options) {\n const compiledSchema = ajv.compile(schema);\n const valid = compiledSchema(options);\n if (valid) return [];\n return compiledSchema.errors ? filterErrors(compiledSchema.errors) : [];\n}\n/**\n * @param {Array<ErrorObject>} errors\n * @returns {Array<SchemaUtilErrorObject>}\n */\n\n\nfunction filterErrors(errors) {\n /** @type {Array<SchemaUtilErrorObject>} */\n let newErrors = [];\n\n for (const error of\n /** @type {Array<SchemaUtilErrorObject>} */\n errors) {\n const {\n dataPath\n } = error;\n /** @type {Array<SchemaUtilErrorObject>} */\n\n let children = [];\n newErrors = newErrors.filter(oldError => {\n if (oldError.dataPath.includes(dataPath)) {\n if (oldError.children) {\n children = children.concat(oldError.children.slice(0));\n } // eslint-disable-next-line no-undefined, no-param-reassign\n\n\n oldError.children = undefined;\n children.push(oldError);\n return false;\n }\n\n return true;\n });\n\n if (children.length) {\n error.children = children;\n }\n\n newErrors.push(error);\n }\n\n return newErrors;\n}","\"use strict\";\n\nconst {\n validate,\n ValidationError\n} = require(\"./validate\");\n\nmodule.exports = {\n validate,\n ValidationError\n};","var { validate } = require('schema-utils');\n\nfunction validateOptions(options, schema) {\n validate(schema, options);\n}\n\nfunction processOptions(options, processors) {\n const processedOptions = {};\n \n for (const [property, processor] of Object.entries(processors)) {\n processedOptions[property] = options[property];\n if (processedOptions[property] === undefined) {\n processedOptions[property] = processor.default;\n }\n if (processor.process) {\n processedOptions[property] = processor.process(processedOptions[property]);\n }\n }\n\n return processedOptions;\n}\n\nmodule.exports = {\n validateOptions,\n processOptions,\n};\n","module.exports = {\n type: 'object',\n properties: {\n filerDir: {\n type: 'string',\n },\n shimsDir: {\n type: 'string',\n },\n shimFs: {\n type: 'boolean',\n },\n shimPath: {\n type: 'boolean',\n },\n fsProvider: {\n type: 'string',\n },\n fsProviderDir: {\n type: 'string',\n },\n }\n};\n","var path = require('path');\n\nconst ROOT_DIR_TAG = '<rootDir>';\nconst CWD = process.cwd();\n\nmodule.exports = {\n filerDir: {\n process: function(value) {\n if (!value) {\n return path.join(CWD, 'node_modules', 'filer');\n }\n return path.resolve(value.replace(ROOT_DIR_TAG, CWD));\n },\n },\n shimsDir: {\n process: function(value) {\n if (!value) {\n return path.join(CWD, 'node_modules', 'filer', 'shims');\n }\n return path.resolve(value.replace(ROOT_DIR_TAG, CWD));\n }\n },\n fsProviderDir: {\n process: function(value) {\n if (!value) {\n return path.join(CWD, 'node_modules', 'filer', 'shims', 'providers');\n }\n return path.resolve(value.replace(ROOT_DIR_TAG, CWD));\n },\n },\n shimFs: { default: true },\n shimPath: { default: true},\n fsProvider: { default: 'default'},\n};\n","var path = require('path');\nvar utils = require('./utils');\n\nconst PLUGIN_NAME = 'filer-webpack-plugin';\n\nconst OPTIONS_SCHEMA = require('./schema');\nconst OPTIONS_PROCESSORS = require('./processors');\n\nmodule.exports = class FilerWebpackPlugin {\n\n constructor(options = {}) {\n utils.validateOptions(options, OPTIONS_SCHEMA);\n this.options = utils.processOptions(options, OPTIONS_PROCESSORS);\n }\n\n apply(compiler) {\n compiler.hooks.normalModuleFactory.tap(\n PLUGIN_NAME,\n (factory) => {\n factory.hooks.resolve.tap(\n PLUGIN_NAME,\n (resolveData) => {\n // Resolve fsProvider if required\n if (\n resolveData.request === 'fsProvider'\n && resolveData.context === this.options.shimsDir\n ) {\n return this.resolveFsProvider(resolveData);\n }\n\n // Ignore filer files (these should resolve modules normally)\n if (resolveData.context.startsWith(this.options.filerDir)) return;\n\n // Apply fs, path and buffer shims if required\n switch (resolveData.request) {\n case 'fs':\n if (!this.options.shimFs) return;\n return this.applyFsShim(resolveData);\n case 'path':\n if (!this.options.shimPath) return;\n return this.applyPathShim(resolveData);\n default:\n return;\n }\n }\n );\n },\n );\n }\n\n resolveFsProvider(resolveData) {\n switch (this.options.fsProvider) {\n case 'default':\n resolveData.request = path.join(this.options.fsProviderDir, 'default.js');\n break;\n case 'indexeddb':\n resolveData.request = path.join(this.options.fsProviderDir, 'indexeddb.js');\n break;\n case 'memory':\n resolveData.request = path.join(this.options.fsProviderDir, 'memory.js');\n break;\n case 'custom':\n resolveData.request = path.join(this.options.fsProviderDir, 'custom.js');\n break;\n default:\n throw new Error([\n 'Invalid option for fsProvider.',\n 'fsProvider must be one of \\'default\\', \\'indexeddb\\', \\'memory\\' or \\'custom\\'.',\n 'If using a custom fsProvider, you must also provide the fsProviderDir option.'\n ].join(' '));\n }\n }\n\n applyFsShim(resolveData) {\n resolveData.request = path.join(this.options.shimsDir, 'fs.js');\n }\n \n applyPathShim(resolveData) {\n resolveData.request = path.join(this.options.shimsDir, 'path.js');\n }\n};\n","let fs = null;\nlet Filer = null;\n\nmodule.exports = Filer = {\n FileSystem: require('./filesystem/interface.js'),\n Buffer: Buffer,\n // We previously called this Path, but node calls it path. Do both\n Path: require('./path.js'),\n path: require('./path.js'),\n Errors: require('./errors.js'),\n Shell: require('./shell/shell.js'),\n /**\n * @deprecated Importing filer from your webpack config is not recommended.\n * \n * The filer `FilerWebpackPlugin` class is exposed directly. \n * \n * ```\n * const { FilerWebpackPlugin } = require('filer/webpack');\n * ```\n */\n FilerWebpackPlugin: require('./webpack-plugin'),\n};\n\n// Add a getter for the `fs` instance, which returns\n// a Filer FileSystem instance, using the default provider/flags.\nObject.defineProperty(Filer, 'fs', {\n enumerable: true,\n get() {\n if(!fs) {\n fs = new Filer.FileSystem();\n }\n return fs;\n }\n});\n"]}