1 line
905 KiB
Plaintext
1 line
905 KiB
Plaintext
{"version":3,"sources":["../node_modules/es6-promisify/dist/promisify.js","../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":["process","module","exports","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","Error","defaultClearTimeout","setTimeout","e","clearTimeout","runTimeout","fun","call","runClearTimeout","marker","queue","draining","currentQueue","queueIndex","cleanUpNextTick","length","concat","drainQueue","timeout","len","run","nextTick","args","Array","arguments","i","push","Item","array","prototype","apply","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","forEach","Memory","Default","errors","split","errno","errName","defaultMessage","FilerError","msg","code","message","stack","create","constructor","toString","pathInfo","defaults","Environment","set","promisify","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","c","r","Math","random","v","guid","toUpperCase","randomChars","n","repeat","nop","throttle","delay","last","extend","a","b","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","side","exclusive","logic","formatLeft","getOperator","formatRight","end","startExclusive","endExclusive","values","minMax","Infinity","j","predicate","_left","_right","getRangeValue","leftExclusive","rightExclusive","isFinite","realStart","realEnd","formatRange","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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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oD,SAAR,GAAoB,UAAUC,IAAV,EAAgB;AAAE,SAAO,EAAP;AAAW,CAAjD;;AAEArD,OAAO,CAACsD,OAAR,GAAkB,UAAUD,IAAV,EAAgB;AAC9B,QAAM,IAAI/C,KAAJ,CAAU,kCAAV,CAAN;AACH,CAFD;;AAIAN,OAAO,CAACuD,GAAR,GAAc,YAAY;AAAE,SAAO,GAAP;AAAY,CAAxC;;AACAvD,OAAO,CAACwD,KAAR,GAAgB,UAAUC,GAAV,EAAe;AAC3B,QAAM,IAAInD,KAAJ,CAAU,gCAAV,CAAN;AACH,CAFD;;AAGAN,OAAO,CAAC0D,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;;;;AAIA1D,OAAO,CAACuD,GAAR,GAAc;AAAA,SAAM,GAAN;AAAA,CAAd;AAEA;;;;;;;AAKA,IAAMI,QAAQ,GAAGC,OAAO,CAAC,MAAD,CAAxB;;AACA,IAAMC,SAAS,GAAGC,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBJ,QAAlB,CAAlB;AAEA;;;;AAGAE,SAAS,CAACG,QAAV,GAAqB,UAACC,IAAD,EAAOC,GAAP,EAAe;AAClC,MAAMF,QAAQ,GAAGL,QAAQ,CAACK,QAAT,CAAkBC,IAAlB,EAAwBC,GAAxB,CAAjB;AACA,SAAOF,QAAQ,KAAK,EAAb,GAAkB,GAAlB,GAAwBA,QAA/B;AACD,CAHD;AAKA;;;;;AAGAH,SAAS,CAACM,SAAV,GAAsB,UAACF,IAAD,EAAU;AAC9BA,EAAAA,IAAI,GAAGN,QAAQ,CAACQ,SA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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;;ACxJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;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,CAAP,CAA2BsB,eAAjD;;AACA,IAAIE,MAAM,GAAGxB,OAAO,CAAC,iBAAD,CAAP,CAA2BwB,MAAxC;;AACA,IAAID,MAAM,GAAGvB,OAAO,CAAC,iBAAD,CAAP,CAA2BuB,MAAxC;;AAEA,SAASyE,gBAAT,CAA0BC,EAA1B,EAA8BC,IAA9B,EAAoC;AAClC,OAAKD,EAAL,GAAUA,EAAV;AACA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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;;eC35BkB1H,OAAO,CAAC,eAAD;IAApB2L,qBAAAA;;AACL,IAAIC,IAAI,GAAG5L,OAAO,CAAC,YAAD,CAAlB;;AACA,IAAI6L,MAAM,GAAG7L,OAAO,CAAC,cAAD,CAApB;;AACA,IAAIyL,WAAW,GAAGzL,OAAO,CAAC,kBAAD,CAAzB;;AACA,IAAImJ,KAAK,GAAGnJ,OAAO,CAAC,oBAAD,CAAnB;;AACA,IAAI8L,SAAS,GAAG9L,OAAO,CAAC,WAAD,CAAvB;;AAEA,SAAS+L,KAAT,CAAeC,EAAf,EAAmBC,OAAnB,EAA4B;AAAA;;AAC1BA,EAAAA,OAAO,GAAGA,OAAO,IAAI,EAArB;AAEA,MAAIvN,GAAG,GAAG,IAAI+M,WAAJ,CAAgBQ,OAAO,CAACvN,GAAxB,CAAV;AACA,MAAIiB,GAAG,GAAG,GAAV;AAEA;;;;AAGAO,EAAAA,MAAM,CAACgM,cAAP,CAAsB,IAAtB,EAA4B,IAA5B,EAAkC;AAChCjF,IAAAA,GAAG,E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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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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vBK,EAAAA,IAAI,EAAEL,OAAO,CAAC,WAAD,CALU;AAMvB6L,EAAAA,MAAM,EAAE7L,OAAO,CAAC,aAAD,CANQ;AAOvB+L,EAAAA,KAAK,EAAE/L,OAAO,CAAC,kBAAD,CAPS;AAQvBupC,EAAAA,kBAAkB,EAAEvpC,OAAO,CAAC,kBAAD;AARJ,CAAzB,EAWA;AACA;;AACAE,MAAM,CAACgM,cAAP,CAAsBo9B,KAAtB,EAA6B,IAA7B,EAAmC;AACjCn9B,EAAAA,UAAU,EAAE,IADqB;AAEjClF,EAAAA,GAFiC,iBAE3B;AACJ,QAAG,CAAC+E,EAAJ,EAAQ;AACNA,MAAAA,EAAE,GAAG,IAAIs9B,KAAK,CAAChhB,UAAV,EAAL;AACD;;AACD,WAAOtc,EAAP;AACD;AAPgC,CAAnC","file":"filer.js","sourceRoot":"../src","sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.promisify = promisify;\n// Symbols is a better way to do this, but not all browsers have good support,\n// so instead we'll just make do with a very unlikely string.\nvar customArgumentsToken = \"__ES6-PROMISIFY--CUSTOM-ARGUMENTS__\";\n/**\n * promisify()\n * Transforms callback-based function -- func(arg1, arg2 .. argN, callback) --\n * into an ES6-compatible Promise. Promisify provides a default callback of the\n * form (error, result) and rejects when `error` is truthy.\n *\n * @param {function} original - The function to promisify\n * @return {function} A promisified version of `original`\n */\n\nfunction promisify(original) {\n // Ensure the argument is a function\n if (typeof original !== \"function\") {\n throw new TypeError(\"Argument to promisify must be a function\");\n } // If the user has asked us to decode argument names for them, honour that\n\n\n var argumentNames = original[customArgumentsToken]; // If the user has supplied a custom Promise implementation, use it.\n // Otherwise fall back to whatever we can find on the global object.\n\n var ES6Promise = promisify.Promise || Promise; // If we can find no Promise implemention, then fail now.\n\n if (typeof ES6Promise !== \"function\") {\n throw new Error(\"No Promise implementation found; do you need a polyfill?\");\n }\n\n return function () {\n var _this = this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return new ES6Promise(function (resolve, reject) {\n // Append the callback bound to the context\n args.push(function callback(err) {\n if (err) {\n return reject(err);\n }\n\n for (var _len2 = arguments.length, values = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n values[_key2 - 1] = arguments[_key2];\n }\n\n if (values.length === 1 || !argumentNames) {\n return resolve(values[0]);\n }\n\n var o = {};\n values.forEach(function (value, index) {\n var name = argumentNames[index];\n\n if (name) {\n o[name] = value;\n }\n });\n resolve(o);\n }); // Call the function.\n\n original.apply(_this, args);\n });\n };\n} // Attach this symbol to the exported function, so users can use it\n\n\npromisify.argumentNames = customArgumentsToken;\npromisify.Promise = undefined; // Export the public API","// 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(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","/*!\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 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 if (schemaPart.description) {\n return `\\n-> ${schemaPart.description}`;\n }\n\n return '';\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 a ${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 an 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 an 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 an 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}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._~!$&'\"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;\n// uri-template: https://tools.ietf.org/html/rfc6570\nvar URITEMPLATE = /^(?:(?:[^\\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 */\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 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"]} |