From 2b7a8cf015e790ab114a1d255d99cdc26ef16ddc Mon Sep 17 00:00:00 2001 From: vulhot Date: Thu, 17 Feb 2022 00:59:49 +0800 Subject: [PATCH] v0.0.5 --- build/firefox/manifest.json | 3 +- build/firefox/popup.html | 1 + build/firefox/scripts/background.js | 71 +- build/firefox/scripts/contentscript.js | 95 +- build/firefox/scripts/livereload.js | 79 +- build/firefox/scripts/options.js | 105 +- build/firefox/scripts/popup.js | 22638 ++++++++++++++++++++++- build/firefox/styles/popup.css | 4 +- build/opera/manifest.json | 81 +- build/opera/scripts/background.js | 71 +- build/opera/scripts/contentscript.js | 95 +- build/opera/scripts/livereload.js | 79 +- build/opera/scripts/options.js | 105 +- 13 files changed, 23357 insertions(+), 70 deletions(-) mode change 100755 => 100644 build/opera/manifest.json diff --git a/build/firefox/manifest.json b/build/firefox/manifest.json index 57e3fe4..849fe24 100644 --- a/build/firefox/manifest.json +++ b/build/firefox/manifest.json @@ -1,6 +1,6 @@ { "name": "FOFA Pro View", - "version": "0.0.3", + "version": "0.0.4", "manifest_version": 2, "description": "FOFA Pro view ", "icons": { @@ -10,6 +10,7 @@ "default_locale": "en", "background": { "scripts": [ + "scripts/livereload.js", "scripts/background.js" ] }, diff --git a/build/firefox/popup.html b/build/firefox/popup.html index 782cb6c..814b7c9 100644 --- a/build/firefox/popup.html +++ b/build/firefox/popup.html @@ -56,6 +56,7 @@

协议 端口 HOST + 蜜罐 查看 diff --git a/build/firefox/scripts/background.js b/build/firefox/scripts/background.js index e841b3d..aa44a8a 100644 --- a/build/firefox/scripts/background.js +++ b/build/firefox/scripts/background.js @@ -1 +1,70 @@ -!function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i=200&&status<300}};defaults.headers={common:{Accept:"application/json, text/plain, */*"}},utils.forEach(["delete","get","head"],function(method){defaults.headers[method]={}}),utils.forEach(["post","put","patch"],function(method){defaults.headers[method]=utils.merge(DEFAULT_CONTENT_TYPE)}),module.exports=defaults}).call(this,require("_process"))},{"./adapters/http":2,"./adapters/xhr":2,"./helpers/normalizeHeaderName":23,"./utils":26,_process:333}],17:[function(require,module,exports){"use strict";module.exports=function(fn,thisArg){return function(){for(var args=new Array(arguments.length),i=0;i=0)return;"set-cookie"===key?parsed[key]=(parsed[key]?parsed[key]:[]).concat([val]):parsed[key]=parsed[key]?parsed[key]+", "+val:val}}),parsed):parsed}},{"./../utils":26}],25:[function(require,module,exports){"use strict";module.exports=function(callback){return function(arr){return callback.apply(null,arr)}}},{}],26:[function(require,module,exports){"use strict";function isArray(val){return"[object Array]"===toString.call(val)}function isUndefined(val){return"undefined"==typeof val}function isBuffer(val){return null!==val&&!isUndefined(val)&&null!==val.constructor&&!isUndefined(val.constructor)&&"function"==typeof val.constructor.isBuffer&&val.constructor.isBuffer(val)}function isArrayBuffer(val){return"[object ArrayBuffer]"===toString.call(val)}function isFormData(val){return"undefined"!=typeof FormData&&val instanceof FormData}function isArrayBufferView(val){var result;return result="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(val):val&&val.buffer&&val.buffer instanceof ArrayBuffer}function isString(val){return"string"==typeof val}function isNumber(val){return"number"==typeof val}function isObject(val){return null!==val&&"object"==typeof val}function isDate(val){return"[object Date]"===toString.call(val)}function isFile(val){return"[object File]"===toString.call(val)}function isBlob(val){return"[object Blob]"===toString.call(val)}function isFunction(val){return"[object Function]"===toString.call(val)}function isStream(val){return isObject(val)&&isFunction(val.pipe)}function isURLSearchParams(val){return"undefined"!=typeof URLSearchParams&&val instanceof URLSearchParams}function trim(str){return str.replace(/^\s*/,"").replace(/\s*$/,"")}function isStandardBrowserEnv(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function forEach(obj,fn){if(null!==obj&&"undefined"!=typeof obj)if("object"!=typeof obj&&(obj=[obj]),isArray(obj))for(var i=0,l=obj.length;i0)throw new Error("Invalid string. Length must be a multiple of 4");var validLen=b64.indexOf("=");validLen===-1&&(validLen=len);var placeHoldersLen=validLen===len?0:4-validLen%4;return[validLen,placeHoldersLen]}function byteLength(b64){var lens=getLens(b64),validLen=lens[0],placeHoldersLen=lens[1];return 3*(validLen+placeHoldersLen)/4-placeHoldersLen}function _byteLength(b64,validLen,placeHoldersLen){return 3*(validLen+placeHoldersLen)/4-placeHoldersLen}function toByteArray(b64){var tmp,i,lens=getLens(b64),validLen=lens[0],placeHoldersLen=lens[1],arr=new Arr(_byteLength(b64,validLen,placeHoldersLen)),curByte=0,len=placeHoldersLen>0?validLen-4:validLen;for(i=0;i>16&255,arr[curByte++]=tmp>>8&255,arr[curByte++]=255&tmp;return 2===placeHoldersLen&&(tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4,arr[curByte++]=255&tmp),1===placeHoldersLen&&(tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2,arr[curByte++]=tmp>>8&255,arr[curByte++]=255&tmp),arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[63&num]}function encodeChunk(uint8,start,end){for(var tmp,output=[],i=start;ilen2?len2:i+maxChunkLength));return 1===extraBytes?(tmp=uint8[len-1],parts.push(lookup[tmp>>2]+lookup[tmp<<4&63]+"==")):2===extraBytes&&(tmp=(uint8[len-2]<<8)+uint8[len-1],parts.push(lookup[tmp>>10]+lookup[tmp>>4&63]+lookup[tmp<<2&63]+"=")),parts.join("")}exports.byteLength=byteLength,exports.toByteArray=toByteArray,exports.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i>5===6?2:byte>>4===14?3:byte>>3===30?4:-1}function utf8CheckIncomplete(self,buf,i){var j=buf.length-1;if(j=0?(nb>0&&(self.lastNeed=nb-1),nb):--j=0?(nb>0&&(self.lastNeed=nb-2),nb):--j=0?(nb>0&&(2===nb?nb=0:self.lastNeed=nb-3),nb):0))}function utf8CheckExtraBytes(self,buf,p){if(128!==(192&buf[0]))return self.lastNeed=0,"\ufffd".repeat(p);if(self.lastNeed>1&&buf.length>1){if(128!==(192&buf[1]))return self.lastNeed=1,"\ufffd".repeat(p+1);if(self.lastNeed>2&&buf.length>2&&128!==(192&buf[2]))return self.lastNeed=2,"\ufffd".repeat(p+2)}}function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed,r=utf8CheckExtraBytes(this,buf,p);return void 0!==r?r:this.lastNeed<=buf.length?(buf.copy(this.lastChar,p,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(buf.copy(this.lastChar,p,0,buf.length),void(this.lastNeed-=buf.length))}function utf8Text(buf,i){var total=utf8CheckIncomplete(this,buf,i);if(!this.lastNeed)return buf.toString("utf8",i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);return buf.copy(this.lastChar,0,end),buf.toString("utf8",i,end)}function utf8End(buf){var r=buf&&buf.length?this.write(buf):"";return this.lastNeed?r+"\ufffd".repeat(this.lastTotal-this.lastNeed):r}function utf16Text(buf,i){if((buf.length-i)%2===0){var r=buf.toString("utf16le",i);if(r){var c=r.charCodeAt(r.length-1);if(c>=55296&&c<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=buf[buf.length-1],buf.toString("utf16le",i,buf.length-1)}function utf16End(buf){var r=buf&&buf.length?this.write(buf):"";if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r+this.lastChar.toString("utf16le",0,end)}return r}function base64Text(buf,i){var n=(buf.length-i)%3;return 0===n?buf.toString("base64",i):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=buf[buf.length-1]:(this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1]),buf.toString("base64",i,buf.length-n))}function base64End(buf){var r=buf&&buf.length?this.write(buf):"";return this.lastNeed?r+this.lastChar.toString("base64",0,3-this.lastNeed):r}function simpleWrite(buf){return buf.toString(this.encoding)}function simpleEnd(buf){return buf&&buf.length?this.write(buf):""}var Buffer=require("safe-buffer").Buffer,isEncoding=Buffer.isEncoding||function(encoding){switch(encoding=""+encoding,encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};exports.StringDecoder=StringDecoder,StringDecoder.prototype.write=function(buf){if(0===buf.length)return"";var r,i;if(this.lastNeed){if(r=this.fillLast(buf),void 0===r)return"";i=this.lastNeed,this.lastNeed=0}else i=0;return iK_MAX_LENGTH)throw new RangeError('The value "'+length+'" is invalid for option "size"');var buf=new Uint8Array(length);return Object.setPrototypeOf(buf,Buffer.prototype),buf}function Buffer(arg,encodingOrOffset,length){if("number"==typeof arg){if("string"==typeof encodingOrOffset)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(arg)}return from(arg,encodingOrOffset,length)}function from(value,encodingOrOffset,length){if("string"==typeof value)return fromString(value,encodingOrOffset);if(ArrayBuffer.isView(value))return fromArrayLike(value);if(null==value)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof value);if(isInstance(value,ArrayBuffer)||value&&isInstance(value.buffer,ArrayBuffer))return fromArrayBuffer(value,encodingOrOffset,length); -if("undefined"!=typeof SharedArrayBuffer&&(isInstance(value,SharedArrayBuffer)||value&&isInstance(value.buffer,SharedArrayBuffer)))return fromArrayBuffer(value,encodingOrOffset,length);if("number"==typeof value)throw new TypeError('The "value" argument must not be of type number. Received type number');var valueOf=value.valueOf&&value.valueOf();if(null!=valueOf&&valueOf!==value)return Buffer.from(valueOf,encodingOrOffset,length);var b=fromObject(value);if(b)return b;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof value[Symbol.toPrimitive])return Buffer.from(value[Symbol.toPrimitive]("string"),encodingOrOffset,length);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof value)}function assertSize(size){if("number"!=typeof size)throw new TypeError('"size" argument must be of type number');if(size<0)throw new RangeError('The value "'+size+'" is invalid for option "size"')}function alloc(size,fill,encoding){return assertSize(size),size<=0?createBuffer(size):void 0!==fill?"string"==typeof encoding?createBuffer(size).fill(fill,encoding):createBuffer(size).fill(fill):createBuffer(size)}function allocUnsafe(size){return assertSize(size),createBuffer(size<0?0:0|checked(size))}function fromString(string,encoding){if("string"==typeof encoding&&""!==encoding||(encoding="utf8"),!Buffer.isEncoding(encoding))throw new TypeError("Unknown encoding: "+encoding);var length=0|byteLength(string,encoding),buf=createBuffer(length),actual=buf.write(string,encoding);return actual!==length&&(buf=buf.slice(0,actual)),buf}function fromArrayLike(array){for(var length=array.length<0?0:0|checked(array.length),buf=createBuffer(length),i=0;i=K_MAX_LENGTH)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K_MAX_LENGTH.toString(16)+" bytes");return 0|length}function SlowBuffer(length){return+length!=length&&(length=0),Buffer.alloc(+length)}function byteLength(string,encoding){if(Buffer.isBuffer(string))return string.length;if(ArrayBuffer.isView(string)||isInstance(string,ArrayBuffer))return string.byteLength;if("string"!=typeof string)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof string);var len=string.length,mustMatch=arguments.length>2&&arguments[2]===!0;if(!mustMatch&&0===len)return 0;for(var loweredCase=!1;;)switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*len;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase)return mustMatch?-1:utf8ToBytes(string).length;encoding=(""+encoding).toLowerCase(),loweredCase=!0}}function slowToString(encoding,start,end){var loweredCase=!1;if((void 0===start||start<0)&&(start=0),start>this.length)return"";if((void 0===end||end>this.length)&&(end=this.length),end<=0)return"";if(end>>>=0,start>>>=0,end<=start)return"";for(encoding||(encoding="utf8");;)switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase(),loweredCase=!0}}function swap(b,n,m){var i=b[n];b[n]=b[m],b[m]=i}function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(0===buffer.length)return-1;if("string"==typeof byteOffset?(encoding=byteOffset,byteOffset=0):byteOffset>2147483647?byteOffset=2147483647:byteOffset<-2147483648&&(byteOffset=-2147483648),byteOffset=+byteOffset,numberIsNaN(byteOffset)&&(byteOffset=dir?0:buffer.length-1),byteOffset<0&&(byteOffset=buffer.length+byteOffset),byteOffset>=buffer.length){if(dir)return-1;byteOffset=buffer.length-1}else if(byteOffset<0){if(!dir)return-1;byteOffset=0}if("string"==typeof val&&(val=Buffer.from(val,encoding)),Buffer.isBuffer(val))return 0===val.length?-1:arrayIndexOf(buffer,val,byteOffset,encoding,dir);if("number"==typeof val)return val=255&val,"function"==typeof Uint8Array.prototype.indexOf?dir?Uint8Array.prototype.indexOf.call(buffer,val,byteOffset):Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset):arrayIndexOf(buffer,[val],byteOffset,encoding,dir);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){function read(buf,i){return 1===indexSize?buf[i]:buf.readUInt16BE(i*indexSize)}var indexSize=1,arrLength=arr.length,valLength=val.length;if(void 0!==encoding&&(encoding=String(encoding).toLowerCase(),"ucs2"===encoding||"ucs-2"===encoding||"utf16le"===encoding||"utf-16le"===encoding)){if(arr.length<2||val.length<2)return-1;indexSize=2,arrLength/=2,valLength/=2,byteOffset/=2}var i;if(dir){var foundIndex=-1;for(i=byteOffset;iarrLength&&(byteOffset=arrLength-valLength),i=byteOffset;i>=0;i--){for(var found=!0,j=0;jremaining&&(length=remaining)):length=remaining;var strLen=string.length;length>strLen/2&&(length=strLen/2);for(var i=0;i239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:firstByte<128&&(codePoint=firstByte);break;case 2:secondByte=buf[i+1],128===(192&secondByte)&&(tempCodePoint=(31&firstByte)<<6|63&secondByte,tempCodePoint>127&&(codePoint=tempCodePoint));break;case 3:secondByte=buf[i+1],thirdByte=buf[i+2],128===(192&secondByte)&&128===(192&thirdByte)&&(tempCodePoint=(15&firstByte)<<12|(63&secondByte)<<6|63&thirdByte,tempCodePoint>2047&&(tempCodePoint<55296||tempCodePoint>57343)&&(codePoint=tempCodePoint));break;case 4:secondByte=buf[i+1],thirdByte=buf[i+2],fourthByte=buf[i+3],128===(192&secondByte)&&128===(192&thirdByte)&&128===(192&fourthByte)&&(tempCodePoint=(15&firstByte)<<18|(63&secondByte)<<12|(63&thirdByte)<<6|63&fourthByte,tempCodePoint>65535&&tempCodePoint<1114112&&(codePoint=tempCodePoint))}}null===codePoint?(codePoint=65533,bytesPerSequence=1):codePoint>65535&&(codePoint-=65536,res.push(codePoint>>>10&1023|55296),codePoint=56320|1023&codePoint),res.push(codePoint),i+=bytesPerSequence}return decodeCodePointsArray(res)}function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,codePoints);for(var res="",i=0;ilen)&&(end=len);for(var out="",i=start;ilength)throw new RangeError("Trying to access beyond buffer length")}function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||valuebuf.length)throw new RangeError("Index out of range")}function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){return value=+value,offset>>>=0,noAssert||checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38),ieee754.write(buf,value,offset,littleEndian,23,4),offset+4}function writeDouble(buf,value,offset,littleEndian,noAssert){return value=+value,offset>>>=0,noAssert||checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308),ieee754.write(buf,value,offset,littleEndian,52,8),offset+8}function base64clean(str){if(str=str.split("=")[0],str=str.trim().replace(INVALID_BASE64_RE,""),str.length<2)return"";for(;str.length%4!==0;)str+="=";return str}function utf8ToBytes(string,units){units=units||1/0;for(var codePoint,length=string.length,leadSurrogate=null,bytes=[],i=0;i55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){(units-=3)>-1&&bytes.push(239,191,189);continue}if(i+1===length){(units-=3)>-1&&bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){(units-=3)>-1&&bytes.push(239,191,189),leadSurrogate=codePoint;continue}codePoint=(leadSurrogate-55296<<10|codePoint-56320)+65536}else leadSurrogate&&(units-=3)>-1&&bytes.push(239,191,189);if(leadSurrogate=null,codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,63&codePoint|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,63&codePoint|128)}else{if(!(codePoint<1114112))throw new Error("Invalid code point");if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,63&codePoint|128)}}return bytes}function asciiToBytes(str){for(var byteArray=[],i=0;i>8,lo=c%256,byteArray.push(lo),byteArray.push(hi);return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i=dst.length||i>=src.length);++i)dst[i+offset]=src[i];return i}function isInstance(obj,type){return obj instanceof type||null!=obj&&null!=obj.constructor&&null!=obj.constructor.name&&obj.constructor.name===type.name}function numberIsNaN(obj){return obj!==obj}var base64=require("base64-js"),ieee754=require("ieee754"),customInspectSymbol="function"==typeof Symbol&&"function"==typeof Symbol["for"]?Symbol["for"]("nodejs.util.inspect.custom"):null;exports.Buffer=Buffer,exports.SlowBuffer=SlowBuffer,exports.INSPECT_MAX_BYTES=50;var K_MAX_LENGTH=2147483647;exports.kMaxLength=K_MAX_LENGTH,Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport(),Buffer.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(Buffer.prototype,"parent",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.buffer}}),Object.defineProperty(Buffer.prototype,"offset",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.byteOffset}}),Buffer.poolSize=8192,Buffer.from=function(value,encodingOrOffset,length){return from(value,encodingOrOffset,length)},Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype),Object.setPrototypeOf(Buffer,Uint8Array),Buffer.alloc=function(size,fill,encoding){return alloc(size,fill,encoding)},Buffer.allocUnsafe=function(size){return allocUnsafe(size)},Buffer.allocUnsafeSlow=function(size){return allocUnsafe(size)},Buffer.isBuffer=function(b){return null!=b&&b._isBuffer===!0&&b!==Buffer.prototype},Buffer.compare=function(a,b){if(isInstance(a,Uint8Array)&&(a=Buffer.from(a,a.offset,a.byteLength)),isInstance(b,Uint8Array)&&(b=Buffer.from(b,b.offset,b.byteLength)),!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);imax&&(str+=" ... "),""},customInspectSymbol&&(Buffer.prototype[customInspectSymbol]=Buffer.prototype.inspect),Buffer.prototype.compare=function(target,start,end,thisStart,thisEnd){if(isInstance(target,Uint8Array)&&(target=Buffer.from(target,target.offset,target.byteLength)),!Buffer.isBuffer(target))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof target);if(void 0===start&&(start=0),void 0===end&&(end=target?target.length:0),void 0===thisStart&&(thisStart=0),void 0===thisEnd&&(thisEnd=this.length),start<0||end>target.length||thisStart<0||thisEnd>this.length)throw new RangeError("out of range index");if(thisStart>=thisEnd&&start>=end)return 0;if(thisStart>=thisEnd)return-1;if(start>=end)return 1;if(start>>>=0,end>>>=0,thisStart>>>=0,thisEnd>>>=0,this===target)return 0;for(var x=thisEnd-thisStart,y=end-start,len=Math.min(x,y),thisCopy=this.slice(thisStart,thisEnd),targetCopy=target.slice(start,end),i=0;i>>=0,isFinite(length)?(length>>>=0,void 0===encoding&&(encoding="utf8")):(encoding=length,length=void 0)}var remaining=this.length-offset;if((void 0===length||length>remaining)&&(length=remaining),string.length>0&&(length<0||offset<0)||offset>this.length)throw new RangeError("Attempt to write outside buffer bounds");encoding||(encoding="utf8");for(var loweredCase=!1;;)switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase(),loweredCase=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;Buffer.prototype.slice=function(start,end){var len=this.length;start=~~start,end=void 0===end?len:~~end,start<0?(start+=len,start<0&&(start=0)):start>len&&(start=len),end<0?(end+=len,end<0&&(end=0)):end>len&&(end=len),end>>=0,byteLength>>>=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset],mul=1,i=0;++i>>=0,byteLength>>>=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset+--byteLength],mul=1;byteLength>0&&(mul*=256);)val+=this[offset+--byteLength]*mul;return val},Buffer.prototype.readUInt8=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,1,this.length),this[offset]},Buffer.prototype.readUInt16LE=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,2,this.length),this[offset]|this[offset+1]<<8},Buffer.prototype.readUInt16BE=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,2,this.length),this[offset]<<8|this[offset+1]},Buffer.prototype.readUInt32LE=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,4,this.length),(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+16777216*this[offset+3]},Buffer.prototype.readUInt32BE=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,4,this.length),16777216*this[offset]+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])},Buffer.prototype.readIntLE=function(offset,byteLength,noAssert){offset>>>=0,byteLength>>>=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset],mul=1,i=0;++i=mul&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readIntBE=function(offset,byteLength,noAssert){offset>>>=0,byteLength>>>=0,noAssert||checkOffset(offset,byteLength,this.length);for(var i=byteLength,mul=1,val=this[offset+--i];i>0&&(mul*=256);)val+=this[offset+--i]*mul;return mul*=128,val>=mul&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readInt8=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,1,this.length),128&this[offset]?(255-this[offset]+1)*-1:this[offset]},Buffer.prototype.readInt16LE=function(offset,noAssert){offset>>>=0,noAssert||checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt16BE=function(offset,noAssert){offset>>>=0,noAssert||checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt32LE=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,4,this.length),this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24},Buffer.prototype.readInt32BE=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,4,this.length),this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]},Buffer.prototype.readFloatLE=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!0,23,4)},Buffer.prototype.readFloatBE=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!1,23,4)},Buffer.prototype.readDoubleLE=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!0,52,8)},Buffer.prototype.readDoubleBE=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!1,52,8)},Buffer.prototype.writeUIntLE=function(value,offset,byteLength,noAssert){if(value=+value,offset>>>=0,byteLength>>>=0,!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}var mul=1,i=0;for(this[offset]=255&value;++i>>=0,byteLength>>>=0,!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}var i=byteLength-1,mul=1;for(this[offset+i]=255&value;--i>=0&&(mul*=256);)this[offset+i]=value/mul&255;return offset+byteLength},Buffer.prototype.writeUInt8=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,1,255,0),this[offset]=255&value,offset+1},Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,2,65535,0),this[offset]=255&value,this[offset+1]=value>>>8,offset+2},Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,2,65535,0),this[offset]=value>>>8,this[offset+1]=255&value,offset+2},Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,4,4294967295,0),this[offset+3]=value>>>24,this[offset+2]=value>>>16,this[offset+1]=value>>>8,this[offset]=255&value,offset+4},Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,4,4294967295,0),this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value,offset+4},Buffer.prototype.writeIntLE=function(value,offset,byteLength,noAssert){if(value=+value,offset>>>=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0,mul=1,sub=0;for(this[offset]=255&value;++i>0)-sub&255;return offset+byteLength},Buffer.prototype.writeIntBE=function(value,offset,byteLength,noAssert){if(value=+value,offset>>>=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1,mul=1,sub=0;for(this[offset+i]=255&value;--i>=0&&(mul*=256);)value<0&&0===sub&&0!==this[offset+i+1]&&(sub=1),this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength},Buffer.prototype.writeInt8=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,1,127,-128),value<0&&(value=255+value+1),this[offset]=255&value,offset+1},Buffer.prototype.writeInt16LE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,2,32767,-32768),this[offset]=255&value,this[offset+1]=value>>>8,offset+2},Buffer.prototype.writeInt16BE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,2,32767,-32768),this[offset]=value>>>8,this[offset+1]=255&value,offset+2},Buffer.prototype.writeInt32LE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),this[offset]=255&value,this[offset+1]=value>>>8,this[offset+2]=value>>>16,this[offset+3]=value>>>24,offset+4},Buffer.prototype.writeInt32BE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),value<0&&(value=4294967295+value+1),this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value,offset+4},Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,!0,noAssert)},Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,!1,noAssert)},Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,!0,noAssert)},Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,!1,noAssert)},Buffer.prototype.copy=function(target,targetStart,start,end){if(!Buffer.isBuffer(target))throw new TypeError("argument should be a Buffer");if(start||(start=0),end||0===end||(end=this.length),targetStart>=target.length&&(targetStart=target.length),targetStart||(targetStart=0),end>0&&end=this.length)throw new RangeError("Index out of range");if(end<0)throw new RangeError("sourceEnd out of bounds");end>this.length&&(end=this.length),target.length-targetStart=0;--i)target[i+targetStart]=this[i+start];else Uint8Array.prototype.set.call(target,this.subarray(start,end),targetStart);return len},Buffer.prototype.fill=function(val,start,end,encoding){if("string"==typeof val){if("string"==typeof start?(encoding=start,start=0,end=this.length):"string"==typeof end&&(encoding=end,end=this.length),void 0!==encoding&&"string"!=typeof encoding)throw new TypeError("encoding must be a string");if("string"==typeof encoding&&!Buffer.isEncoding(encoding))throw new TypeError("Unknown encoding: "+encoding);if(1===val.length){var code=val.charCodeAt(0);("utf8"===encoding&&code<128||"latin1"===encoding)&&(val=code)}}else"number"==typeof val?val=255&val:"boolean"==typeof val&&(val=Number(val));if(start<0||this.length>>=0,end=void 0===end?this.length:end>>>0,val||(val=0);var i;if("number"==typeof val)for(i=start;i-1;)if(end=idx+className.length,(0===idx||rspace.test(clazz[idx-1]))&&(end===clazz.length||rspace.test(clazz[end])))return!0})},exports.addClass=function(value){if("function"==typeof value)return domEach(this,function(i,el){var className=el.attribs["class"]||"";exports.addClass.call([el],value.call(el,i,className))});if(!value||"string"!=typeof value)return this;for(var classNames=value.split(rspace),numElements=this.length,i=0;i=0&&(elClasses.splice(index,1),changed=!0,j--);changed&&(el.attribs["class"]=elClasses.join(" "))}}))},exports.toggleClass=function(value,stateVal){if("function"==typeof value)return domEach(this,function(i,el){exports.toggleClass.call([el],value.call(el,i,el.attribs["class"]||"",stateVal),stateVal)});if(!value||"string"!=typeof value)return this;for(var elementClasses,index,classNames=value.split(rspace),numClasses=classNames.length,state="boolean"==typeof stateVal?stateVal?1:-1:0,numElements=this.length,i=0;i=0&&index<0?elementClasses.push(classNames[j]):state<=0&&index>=0&&elementClasses.splice(index,1);this[i].attribs["class"]=elementClasses.join(" ")}return this},exports.is=function(selector){return!!selector&&this.filter(selector).length>0}},{"../static":42,"../utils":43,"lodash/assignIn":260,"lodash/forEach":267,"lodash/some":294}],35:[function(require,module,exports){function setCss(el,prop,val,idx){if("string"==typeof prop){var styles=getCss(el);"function"==typeof val&&(val=val.call(el,idx,styles[prop])),""===val?delete styles[prop]:null!=val&&(styles[prop]=val),el.attribs.style=stringify(styles)}else"object"==typeof prop&&Object.keys(prop).forEach(function(k){setCss(el,k,prop[k])})}function getCss(el,prop){var styles=parse(el.attribs.style);return"string"==typeof prop?styles[prop]:Array.isArray(prop)?_.pick(styles,prop):styles}function stringify(obj){return Object.keys(obj||{}).reduce(function(str,prop){return str+=""+(str?" ":"")+prop+": "+obj[prop]+";"},"")}function parse(styles){return styles=(styles||"").trim(),styles?styles.split(";").reduce(function(obj,str){var n=str.indexOf(":");return n<1||n===str.length-1?obj:(obj[str.slice(0,n).trim()]=str.slice(n+1).trim(),obj)},{}):{}}var domEach=require("../utils").domEach,_={pick:require("lodash/pick")},toString=Object.prototype.toString;exports.css=function(prop,val){return 2===arguments.length||"[object Object]"===toString.call(prop)?domEach(this,function(idx,el){setCss(el,prop,val,idx)}):getCss(this[0],prop)}},{"../utils":43,"lodash/pick":290}],36:[function(require,module,exports){var submittableSelector="input,select,textarea,keygen",r20=/%20/g,rCRLF=/\r?\n/g,_={map:require("lodash/map")};exports.serialize=function(){var arr=this.serializeArray(),retArr=_.map(arr,function(data){return encodeURIComponent(data.name)+"="+encodeURIComponent(data.value)});return retArr.join("&").replace(r20,"+")},exports.serializeArray=function(){var Cheerio=this.constructor;return this.map(function(){var elem=this,$elem=Cheerio(elem);return"form"===elem.name?$elem.find(submittableSelector).toArray():$elem.filter(submittableSelector).toArray()}).filter('[name!=""]:not(:disabled):not(:submit, :button, :image, :reset, :file):matches([checked], :not(:checkbox, :radio))').map(function(i,elem){var $elem=Cheerio(elem),name=$elem.attr("name"),value=$elem.val();return null==value&&(value=""),Array.isArray(value)?_.map(value,function(val){return{name:name,value:val.replace(rCRLF,"\r\n")}}):{name:name,value:value.replace(rCRLF,"\r\n")}}).get()}},{"lodash/map":285}],37:[function(require,module,exports){var parse=require("../parse"),$=require("../static"),updateDOM=parse.update,evaluate=parse.evaluate,utils=require("../utils"),domEach=utils.domEach,cloneDom=utils.cloneDom,isHtml=utils.isHtml,slice=Array.prototype.slice,_={flatten:require("lodash/flatten"),bind:require("lodash/bind"),forEach:require("lodash/forEach")};exports._makeDomArray=function(elem,clone){return null==elem?[]:elem.cheerio?clone?cloneDom(elem.get(),elem.options):elem.get():Array.isArray(elem)?_.flatten(elem.map(function(el){return this._makeDomArray(el,clone)},this)):"string"==typeof elem?evaluate(elem,this.options,!1):clone?cloneDom([elem]):[elem]};var _insert=function(concatenator){return function(){var elems=slice.call(arguments),lastIdx=this.length-1;return domEach(this,function(i,el){var dom,domSrc;domSrc="function"==typeof elems[0]?elems[0].call(el,i,$.html(el.children)):elems,dom=this._makeDomArray(domSrc,i-1&&(oldParent.children.splice(prevIdx,1),parent===oldParent&&spliceIdx>prevIdx&&spliceArgs[0]--),node.root=null,node.parent=parent,node.prev&&(node.prev.next=node.next||null),node.next&&(node.next.prev=node.prev||null),node.prev=newElems[idx-1]||prev,node.next=newElems[idx+1]||next;return prev&&(prev.next=newElems[0]),next&&(next.prev=newElems[newElems.length-1]),array.splice.apply(array,spliceArgs)};exports.appendTo=function(target){return target.cheerio||(target=this.constructor.call(this.constructor,target,null,this._originalRoot)),target.append(this),this},exports.prependTo=function(target){return target.cheerio||(target=this.constructor.call(this.constructor,target,null,this._originalRoot)),target.prepend(this),this},exports.append=_insert(function(dom,children,parent){uniqueSplice(children,children.length,0,dom,parent)}),exports.prepend=_insert(function(dom,children,parent){uniqueSplice(children,0,0,dom,parent)}),exports.wrap=function(wrapper){var wrapperFn="function"==typeof wrapper&&wrapper,lastIdx=this.length-1;return _.forEach(this,_.bind(function(el,i){var wrapperDom,elInsertLocation,j,index,parent=el.parent||el.root,siblings=parent.children;if(parent){for(wrapperFn&&(wrapper=wrapperFn.call(el,i)),"string"!=typeof wrapper||isHtml(wrapper)||(wrapper=this.parents().last().find(wrapper).clone()),wrapperDom=this._makeDomArray(wrapper,i=elInsertLocation.children.length);)"tag"===elInsertLocation.children[j].type?(elInsertLocation=elInsertLocation.children[j],j=0):j++;index=siblings.indexOf(el),updateDOM([el],elInsertLocation),uniqueSplice(siblings,index,0,wrapperDom,parent)}},this)),this},exports.after=function(){var elems=slice.call(arguments),lastIdx=this.length-1;return domEach(this,function(i,el){var parent=el.parent||el.root;if(parent){var domSrc,dom,siblings=parent.children,index=siblings.indexOf(el);index<0||(domSrc="function"==typeof elems[0]?elems[0].call(el,i,$.html(el.children)):elems,dom=this._makeDomArray(domSrc,i0})},exports.first=function(){return this.length>1?this._make(this[0]):this},exports.last=function(){return this.length>1?this._make(this[this.length-1]):this},exports.eq=function(i){return i=+i,0===i&&this.length<=1?this:(i<0&&(i=this.length+i),this[i]?this._make(this[i]):this._make([]))},exports.get=function(i){return null==i?Array.prototype.slice.call(this):this[i<0?this.length+i:i]},exports.index=function(selectorOrNeedle){var $haystack,needle;return 0===arguments.length?($haystack=this.parent().children(),needle=this[0]):"string"==typeof selectorOrNeedle?($haystack=this._make(selectorOrNeedle),needle=this[0]):($haystack=this,needle=selectorOrNeedle.cheerio?selectorOrNeedle[0]:selectorOrNeedle),$haystack.get().indexOf(needle)},exports.slice=function(){return this._make([].slice.apply(this,arguments))},exports.end=function(){return this.prevObject||this._make([])},exports.add=function(other,context){for(var selection=this._make(other,context),contents=uniqueSort(selection.get().concat(this.get())),i=0;i",options,!1)[0];return root.type="root",root.parent=null,exports.update(dom,root),root},exports.evaluate=function(content,options,isDocument){var dom;if(Buffer.isBuffer(content)&&(content=content.toString()),"string"==typeof content){var useHtmlParser2=options.xmlMode||options._useHtmlParser2;dom=useHtmlParser2?htmlparser.parseDOM(content,options):parseWithParse5(content,isDocument)}else dom=content;return dom},exports.update=function(arr,parent){Array.isArray(arr)||(arr=[arr]),parent?parent.children=arr:parent=null;for(var i=0;i)[^>]*$|#([\w\-]*)$)/;exports.isHtml=function(str){if("<"===str.charAt(0)&&">"===str.charAt(str.length-1)&&str.length>=3)return!0;var match=quickExpr.exec(str);return!(!match||!match[1])}},{"./parse":41,"dom-serializer":54,"lodash/assign":259}],44:[function(require,module,exports){module.exports={_from:"cheerio@^1.0.0-rc.3",_id:"cheerio@1.0.0-rc.3",_inBundle:!1,_integrity:"sha1-CUY21CWy6cD065GkbAVjDJoai/Y=",_location:"/cheerio",_phantomChildren:{},_requested:{type:"range",registry:!0,raw:"cheerio@^1.0.0-rc.3",name:"cheerio",escapedName:"cheerio",rawSpec:"^1.0.0-rc.3",saveSpec:null,fetchSpec:"^1.0.0-rc.3"},_requiredBy:["/"],_resolved:"https://registry.npm.taobao.org/cheerio/download/cheerio-1.0.0-rc.3.tgz",_shasum:"094636d425b2e9c0f4eb91a46c05630c9a1a8bf6",_spec:"cheerio@^1.0.0-rc.3",_where:"/Users/0nise/Desktop/fofa_view",author:{name:"Matt Mueller",email:"mattmuelle@gmail.com",url:"mat.io"},bugs:{url:"https://github.com/cheeriojs/cheerio/issues"},bundleDependencies:!1,dependencies:{"css-select":"~1.2.0","dom-serializer":"~0.1.1",entities:"~1.1.1",htmlparser2:"^3.9.1",lodash:"^4.15.0",parse5:"^3.0.1"},deprecated:!1,description:"Tiny, fast, and elegant implementation of core jQuery designed specifically for the server",devDependencies:{benchmark:"^2.1.0",coveralls:"^2.11.9","expect.js":"~0.3.1",istanbul:"^0.4.3",jquery:"^3.0.0",jsdom:"^9.2.1",jshint:"^2.9.2",mocha:"^3.1.2",xyz:"~1.1.0"},engines:{node:">= 0.6"},files:["index.js","lib"],homepage:"https://github.com/cheeriojs/cheerio#readme",keywords:["htmlparser","jquery","selector","scraper","parser","html"],license:"MIT",main:"./index.js",name:"cheerio",repository:{type:"git",url:"git://github.com/cheeriojs/cheerio.git"},scripts:{test:"make test"},version:"1.0.0-rc.3"}},{}],45:[function(require,module,exports){(function(Buffer){function isArray(arg){return Array.isArray?Array.isArray(arg):"[object Array]"===objectToString(arg)}function isBoolean(arg){return"boolean"==typeof arg}function isNull(arg){return null===arg}function isNullOrUndefined(arg){return null==arg}function isNumber(arg){return"number"==typeof arg}function isString(arg){return"string"==typeof arg}function isSymbol(arg){return"symbol"==typeof arg}function isUndefined(arg){return void 0===arg}function isRegExp(re){return"[object RegExp]"===objectToString(re)}function isObject(arg){return"object"==typeof arg&&null!==arg; -}function isDate(d){return"[object Date]"===objectToString(d)}function isError(e){return"[object Error]"===objectToString(e)||e instanceof Error}function isFunction(arg){return"function"==typeof arg}function isPrimitive(arg){return null===arg||"boolean"==typeof arg||"number"==typeof arg||"string"==typeof arg||"symbol"==typeof arg||"undefined"==typeof arg}function objectToString(o){return Object.prototype.toString.call(o)}exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isNull=isNull,exports.isNullOrUndefined=isNullOrUndefined,exports.isNumber=isNumber,exports.isString=isString,exports.isSymbol=isSymbol,exports.isUndefined=isUndefined,exports.isRegExp=isRegExp,exports.isObject=isObject,exports.isDate=isDate,exports.isError=isError,exports.isFunction=isFunction,exports.isPrimitive=isPrimitive,exports.isBuffer=Buffer.isBuffer}).call(this,{isBuffer:require("../../is-buffer/index.js")})},{"../../is-buffer/index.js":85}],46:[function(require,module,exports){"use strict";function getSelectorFunc(searchFunc){return function(query,elems,options){return"function"!=typeof query&&(query=compileUnsafe(query,options,elems)),elems=Array.isArray(elems)?removeSubsets(elems):getChildren(elems),searchFunc(query,elems)}}function is(elem,query,options){return("function"==typeof query?query:compile(query,options))(elem)}function CSSselect(query,elems,options){return selectAll(query,elems,options)}module.exports=CSSselect;var Pseudos=require("./lib/pseudos.js"),DomUtils=require("domutils"),findOne=DomUtils.findOne,findAll=DomUtils.findAll,getChildren=DomUtils.getChildren,removeSubsets=DomUtils.removeSubsets,falseFunc=require("boolbase").falseFunc,compile=require("./lib/compile.js"),compileUnsafe=compile.compileUnsafe,compileToken=compile.compileToken,selectAll=getSelectorFunc(function(query,elems){return query!==falseFunc&&elems&&0!==elems.length?findAll(query,elems):[]}),selectOne=getSelectorFunc(function(query,elems){return query!==falseFunc&&elems&&0!==elems.length?findOne(query,elems):null});CSSselect.compile=compile,CSSselect.filters=Pseudos.filters,CSSselect.pseudos=Pseudos.pseudos,CSSselect.selectAll=selectAll,CSSselect.selectOne=selectOne,CSSselect.is=is,CSSselect.parse=compile,CSSselect.iterate=selectAll,CSSselect._compileUnsafe=compileUnsafe,CSSselect._compileToken=compileToken},{"./lib/compile.js":48,"./lib/pseudos.js":51,boolbase:28,domutils:59}],47:[function(require,module,exports){var DomUtils=require("domutils"),hasAttrib=DomUtils.hasAttrib,getAttributeValue=DomUtils.getAttributeValue,falseFunc=require("boolbase").falseFunc,reChars=/[-[\]{}()*+?.,\\^$|#\s]/g,attributeRules={__proto__:null,equals:function(next,data){var name=data.name,value=data.value;return data.ignoreCase?(value=value.toLowerCase(),function(elem){var attr=getAttributeValue(elem,name);return null!=attr&&attr.toLowerCase()===value&&next(elem)}):function(elem){return getAttributeValue(elem,name)===value&&next(elem)}},hyphen:function(next,data){var name=data.name,value=data.value,len=value.length;return data.ignoreCase?(value=value.toLowerCase(),function(elem){var attr=getAttributeValue(elem,name);return null!=attr&&(attr.length===len||"-"===attr.charAt(len))&&attr.substr(0,len).toLowerCase()===value&&next(elem)}):function(elem){var attr=getAttributeValue(elem,name);return null!=attr&&attr.substr(0,len)===value&&(attr.length===len||"-"===attr.charAt(len))&&next(elem)}},element:function(next,data){var name=data.name,value=data.value;if(/\s/.test(value))return falseFunc;value=value.replace(reChars,"\\$&");var pattern="(?:^|\\s)"+value+"(?:$|\\s)",flags=data.ignoreCase?"i":"",regex=new RegExp(pattern,flags);return function(elem){var attr=getAttributeValue(elem,name);return null!=attr&®ex.test(attr)&&next(elem)}},exists:function(next,data){var name=data.name;return function(elem){return hasAttrib(elem,name)&&next(elem)}},start:function(next,data){var name=data.name,value=data.value,len=value.length;return 0===len?falseFunc:data.ignoreCase?(value=value.toLowerCase(),function(elem){var attr=getAttributeValue(elem,name);return null!=attr&&attr.substr(0,len).toLowerCase()===value&&next(elem)}):function(elem){var attr=getAttributeValue(elem,name);return null!=attr&&attr.substr(0,len)===value&&next(elem)}},end:function(next,data){var name=data.name,value=data.value,len=-value.length;return 0===len?falseFunc:data.ignoreCase?(value=value.toLowerCase(),function(elem){var attr=getAttributeValue(elem,name);return null!=attr&&attr.substr(len).toLowerCase()===value&&next(elem)}):function(elem){var attr=getAttributeValue(elem,name);return null!=attr&&attr.substr(len)===value&&next(elem)}},any:function(next,data){var name=data.name,value=data.value;if(""===value)return falseFunc;if(data.ignoreCase){var regex=new RegExp(value.replace(reChars,"\\$&"),"i");return function(elem){var attr=getAttributeValue(elem,name);return null!=attr&®ex.test(attr)&&next(elem)}}return function(elem){var attr=getAttributeValue(elem,name);return null!=attr&&attr.indexOf(value)>=0&&next(elem)}},not:function(next,data){var name=data.name,value=data.value;return""===value?function(elem){return!!getAttributeValue(elem,name)&&next(elem)}:data.ignoreCase?(value=value.toLowerCase(),function(elem){var attr=getAttributeValue(elem,name);return null!=attr&&attr.toLowerCase()!==value&&next(elem)}):function(elem){return getAttributeValue(elem,name)!==value&&next(elem)}}};module.exports={compile:function(next,data,options){if(options&&options.strict&&(data.ignoreCase||"not"===data.action))throw SyntaxError("Unsupported attribute selector");return attributeRules[data.action](next,data)},rules:attributeRules}},{boolbase:28,domutils:59}],48:[function(require,module,exports){function compile(selector,options,context){var next=compileUnsafe(selector,options,context);return wrap(next)}function wrap(next){return function(elem){return isTag(elem)&&next(elem)}}function compileUnsafe(selector,options,context){var token=parse(selector,options);return compileToken(token,options,context)}function includesScopePseudo(t){return"pseudo"===t.type&&("scope"===t.name||Array.isArray(t.data)&&t.data.some(function(data){return data.some(includesScopePseudo)}))}function absolutize(token,context){var hasContext=!!context&&!!context.length&&context.every(function(e){return e===PLACEHOLDER_ELEMENT||!!getParent(e)});token.forEach(function(t){if(t.length>0&&isTraversal(t[0])&&"descendant"!==t[0].type);else{if(!hasContext||includesScopePseudo(t))return;t.unshift(DESCENDANT_TOKEN)}t.unshift(SCOPE_TOKEN)})}function compileToken(token,options,context){token=token.filter(function(t){return t.length>0}),token.forEach(sortRules);var isArrayContext=Array.isArray(context);return context=options&&options.context||context,context&&!isArrayContext&&(context=[context]),absolutize(token,context),token.map(function(rules){return compileRules(rules,options,context,isArrayContext)}).reduce(reduceRules,falseFunc)}function isTraversal(t){return procedure[t.type]<0}function compileRules(rules,options,context,isArrayContext){var acceptSelf=isArrayContext&&"scope"===rules[0].name&&"descendant"===rules[1].type;return rules.reduce(function(func,rule,index){return func===falseFunc?func:Rules[rule.type](func,rule,options,context,acceptSelf&&1===index)},options&&options.rootFunc||trueFunc)}function reduceRules(a,b){return b===falseFunc||a===trueFunc?a:a===falseFunc||b===trueFunc?b:function(elem){return a(elem)||b(elem)}}function containsTraversal(t){return t.some(isTraversal)}module.exports=compile,module.exports.compileUnsafe=compileUnsafe,module.exports.compileToken=compileToken;var parse=require("css-what"),DomUtils=require("domutils"),isTag=DomUtils.isTag,Rules=require("./general.js"),sortRules=require("./sort.js"),BaseFuncs=require("boolbase"),trueFunc=BaseFuncs.trueFunc,falseFunc=BaseFuncs.falseFunc,procedure=require("./procedure.json"),DESCENDANT_TOKEN={type:"descendant"},SCOPE_TOKEN={type:"pseudo",name:"scope"},PLACEHOLDER_ELEMENT={},getParent=DomUtils.getParent,Pseudos=require("./pseudos.js"),filters=Pseudos.filters,existsOne=DomUtils.existsOne,isTag=DomUtils.isTag,getChildren=DomUtils.getChildren;filters.not=function(next,token,options,context){var opts={xmlMode:!(!options||!options.xmlMode),strict:!(!options||!options.strict)};if(opts.strict&&(token.length>1||token.some(containsTraversal)))throw new SyntaxError("complex selectors in :not aren't allowed in strict mode");var func=compileToken(token,opts,context);return func===falseFunc?next:func===trueFunc?falseFunc:function(elem){return!func(elem)&&next(elem)}},filters.has=function(next,token,options){var opts={xmlMode:!(!options||!options.xmlMode),strict:!(!options||!options.strict)},context=token.some(containsTraversal)?[PLACEHOLDER_ELEMENT]:null,func=compileToken(token,opts,context);return func===falseFunc?falseFunc:func===trueFunc?function(elem){return getChildren(elem).some(isTag)&&next(elem)}:(func=wrap(func),context?function(elem){return next(elem)&&(context[0]=elem,existsOne(func,getChildren(elem)))}:function(elem){return next(elem)&&existsOne(func,getChildren(elem))})},filters.matches=function(next,token,options,context){var opts={xmlMode:!(!options||!options.xmlMode),strict:!(!options||!options.strict),rootFunc:next};return compileToken(token,opts,context)}},{"./general.js":49,"./procedure.json":50,"./pseudos.js":51,"./sort.js":52,boolbase:28,"css-what":53,domutils:59}],49:[function(require,module,exports){var DomUtils=require("domutils"),isTag=DomUtils.isTag,getParent=DomUtils.getParent,getChildren=DomUtils.getChildren,getSiblings=DomUtils.getSiblings,getName=DomUtils.getName;module.exports={__proto__:null,attribute:require("./attributes.js").compile,pseudo:require("./pseudos.js").compile,tag:function(next,data){var name=data.name;return function(elem){return getName(elem)===name&&next(elem)}},descendant:function(next,rule,options,context,acceptSelf){return function(elem){if(acceptSelf&&next(elem))return!0;for(var found=!1;!found&&(elem=getParent(elem));)found=next(elem);return found}},parent:function(next,data,options){function test(elem){return isTag(elem)&&next(elem)}if(options&&options.strict)throw SyntaxError("Parent selector isn't part of CSS3");return function(elem){return getChildren(elem).some(test)}},child:function(next){return function(elem){var parent=getParent(elem);return!!parent&&next(parent)}},sibling:function(next){return function(elem){for(var siblings=getSiblings(elem),i=0;i1&&"scope"!==name)throw new SyntaxError("pseudo-selector :"+name+" requires an argument")}else if(1===func.length)throw new SyntaxError("pseudo-selector :"+name+" doesn't have any arguments")}var DomUtils=require("domutils"),isTag=DomUtils.isTag,getText=DomUtils.getText,getParent=DomUtils.getParent,getChildren=DomUtils.getChildren,getSiblings=DomUtils.getSiblings,hasAttrib=DomUtils.hasAttrib,getName=DomUtils.getName,getAttribute=DomUtils.getAttributeValue,getNCheck=require("nth-check"),checkAttrib=require("./attributes.js").rules.equals,BaseFuncs=require("boolbase"),trueFunc=BaseFuncs.trueFunc,falseFunc=BaseFuncs.falseFunc,filters={contains:function(next,text){return function(elem){return next(elem)&&getText(elem).indexOf(text)>=0}},icontains:function(next,text){var itext=text.toLowerCase();return function(elem){return next(elem)&&getText(elem).toLowerCase().indexOf(itext)>=0}},"nth-child":function(next,rule){var func=getNCheck(rule);return func===falseFunc?func:func===trueFunc?getChildFunc(next):function(elem){for(var siblings=getSiblings(elem),i=0,pos=0;i=0;i--)if(isTag(siblings[i])){if(siblings[i]===elem)break;pos++}return func(pos)&&next(elem)}},"nth-of-type":function(next,rule){var func=getNCheck(rule);return func===falseFunc?func:func===trueFunc?getChildFunc(next):function(elem){for(var siblings=getSiblings(elem),pos=0,i=0;i=0;i--)if(isTag(siblings[i])){if(siblings[i]===elem)break;getName(siblings[i])===getName(elem)&&pos++}return func(pos)&&next(elem)}},root:function(next){return function(elem){return!getParent(elem)&&next(elem)}},scope:function(next,rule,options,context){return context&&0!==context.length?1===context.length?function(elem){return context[0]===elem&&next(elem)}:function(elem){return context.indexOf(elem)>=0&&next(elem)}:filters.root(next)},checkbox:getAttribFunc("type","checkbox"),file:getAttribFunc("type","file"),password:getAttribFunc("type","password"),radio:getAttribFunc("type","radio"),reset:getAttribFunc("type","reset"),image:getAttribFunc("type","image"),submit:getAttribFunc("type","submit")},pseudos={empty:function(elem){return!getChildren(elem).some(function(elem){return isTag(elem)||"text"===elem.type})},"first-child":function(elem){return getFirstElement(getSiblings(elem))===elem},"last-child":function(elem){for(var siblings=getSiblings(elem),i=siblings.length-1;i>=0;i--){if(siblings[i]===elem)return!0;if(isTag(siblings[i]))break}return!1},"first-of-type":function(elem){for(var siblings=getSiblings(elem),i=0;i=0;i--)if(isTag(siblings[i])){if(siblings[i]===elem)return!0;if(getName(siblings[i])===getName(elem))break}return!1},"only-of-type":function(elem){for(var siblings=getSiblings(elem),i=0,j=siblings.length;i=0&&procNew>=1);else if(proc===procedure.pseudo)if(token.data)if("has"===token.name||"contains"===token.name)proc=0;else if("matches"===token.name||"not"===token.name){proc=0;for(var i=0;iproc&&(proc=cur)}token.data.length>1&&proc>0&&(proc-=1)}else proc=1;else proc=3;return proc}module.exports=sortByProcedure;var procedure=require("./procedure.json"),attributes={__proto__:null,exists:10,equals:8,not:7,start:6,end:6,any:5,hyphen:4,element:4}},{"./procedure.json":50}],53:[function(require,module,exports){"use strict";function funescape(_,escaped,escapedWhitespace){var high="0x"+escaped-65536;return high!==high||escapedWhitespace?escaped:high<0?String.fromCharCode(high+65536):String.fromCharCode(high>>10|55296,1023&high|56320)}function unescapeCSS(str){return str.replace(re_escape,funescape)}function isWhitespace(c){return" "===c||"\n"===c||"\t"===c||"\f"===c||"\r"===c}function parse(selector,options){var subselects=[];if(selector=parseSelector(subselects,selector+"",options),""!==selector)throw new SyntaxError("Unmatched selector: "+selector);return subselects}function parseSelector(subselects,selector,options){function getName(){var sub=selector.match(re_name)[0];return selector=selector.substr(sub.length),unescapeCSS(sub)}function stripWhitespace(start){for(;isWhitespace(selector.charAt(start));)start++;selector=selector.substr(start)}function isEscaped(pos){for(var slashCount=0;"\\"===selector.charAt(--pos);)slashCount++;return 1===(1&slashCount)}var data,firstChar,name,quot,tokens=[],sawWS=!1;for(stripWhitespace(0);""!==selector;)if(firstChar=selector.charAt(0),isWhitespace(firstChar))sawWS=!0,stripWhitespace(1);else if(firstChar in simpleSelectors)tokens.push({type:simpleSelectors[firstChar]}),sawWS=!1,stripWhitespace(1);else if(","===firstChar){if(0===tokens.length)throw new SyntaxError("empty sub-selector");subselects.push(tokens),tokens=[],sawWS=!1,stripWhitespace(1)}else if(sawWS&&(tokens.length>0&&tokens.push({type:"descendant"}),sawWS=!1),"*"===firstChar)selector=selector.substr(1),tokens.push({type:"universal"});else if(firstChar in attribSelectors)selector=selector.substr(1),tokens.push({type:"attribute",name:attribSelectors[firstChar][0],action:attribSelectors[firstChar][1],value:getName(),ignoreCase:!1});else if("["===firstChar){if(selector=selector.substr(1),data=selector.match(re_attr),!data)throw new SyntaxError("Malformed attribute selector: "+selector);selector=selector.substr(data[0].length),name=unescapeCSS(data[1]),options&&("lowerCaseAttributeNames"in options?!options.lowerCaseAttributeNames:options.xmlMode)||(name=name.toLowerCase()),tokens.push({type:"attribute",name:name,action:actionTypes[data[2]],value:unescapeCSS(data[4]||data[5]||""),ignoreCase:!!data[6]})}else if(":"===firstChar){if(":"===selector.charAt(1)){selector=selector.substr(2),tokens.push({type:"pseudo-element",name:getName().toLowerCase()});continue}if(selector=selector.substr(1),name=getName().toLowerCase(),data=null,"("===selector.charAt(0))if(name in unpackPseudos){quot=selector.charAt(1);var quoted=quot in quotes;if(selector=selector.substr(quoted+1),data=[],selector=parseSelector(data,selector,options),quoted){if(selector.charAt(0)!==quot)throw new SyntaxError("unmatched quotes in :"+name);selector=selector.substr(1)}if(")"!==selector.charAt(0))throw new SyntaxError("missing closing parenthesis in :"+name+" "+selector);selector=selector.substr(1)}else{for(var pos=1,counter=1;counter>0&&pos0&&0===tokens.length)throw new SyntaxError("empty sub-selector");subselects.push(tokens)}module.exports=parse;var re_name=/^(?:\\.|[\w\-\u00b0-\uFFFF])+/,re_escape=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,re_attr=/^\s*((?:\\.|[\w\u00b0-\uFFFF\-])+)\s*(?:(\S?)=\s*(?:(['"])([^]*?)\3|(#?(?:\\.|[\w\u00b0-\uFFFF\-])*)|)|)\s*(i)?\]/,actionTypes={__proto__:null,undefined:"exists","":"equals","~":"element","^":"start",$:"end","*":"any","!":"not","|":"hyphen"},simpleSelectors={__proto__:null,">":"child","<":"parent","~":"sibling","+":"adjacent"},attribSelectors={__proto__:null,"#":["id","equals"],".":["class","element"]},unpackPseudos={__proto__:null,has:!0,not:!0,matches:!0},stripQuotesFromPseudos={__proto__:null,contains:!0,icontains:!0},quotes={__proto__:null,'"':!0,"'":!0}},{}],54:[function(require,module,exports){function formatAttrs(attributes,opts){if(attributes){var value,output="";for(var key in attributes)value=attributes[key],output&&(output+=" "),output+=key,(null!==value&&""!==value||opts.xmlMode)&&(output+='="'+(opts.decodeEntities?entities.encodeXML(value):value)+'"');return output}}function renderTag(elem,opts){"svg"===elem.name&&(opts={decodeEntities:opts.decodeEntities,xmlMode:!0});var tag="<"+elem.name,attribs=formatAttrs(elem.attribs,opts);return attribs&&(tag+=" "+attribs),!opts.xmlMode||elem.children&&0!==elem.children.length?(tag+=">",elem.children&&(tag+=render(elem.children,opts)),singleTag[elem.name]&&!opts.xmlMode||(tag+="")):tag+="/>",tag}function renderDirective(elem){return"<"+elem.data+">"}function renderText(elem,opts){var data=elem.data||"";return!opts.decodeEntities||elem.parent&&elem.parent.name in unencodedElements||(data=entities.encodeXML(data)),data}function renderCdata(elem){return""}function renderComment(elem){return""}var ElementType=require("domelementtype"),entities=require("entities"),unencodedElements={__proto__:null,style:!0,script:!0,xmp:!0,iframe:!0,noembed:!0,noframes:!0,plaintext:!0,noscript:!0},singleTag={__proto__:null,area:!0,base:!0,basefont:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,isindex:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},render=module.exports=function(dom,opts){Array.isArray(dom)||dom.cheerio||(dom=[dom]),opts=opts||{};for(var output="",i=0;i-1;){for(node=ancestor=nodes[idx],nodes[idx]=null,replace=!0;ancestor;){if(nodes.indexOf(ancestor)>-1){replace=!1,nodes.splice(idx,1);break}ancestor=ancestor.parent}replace&&(nodes[idx]=node)}return nodes};var POSITION={DISCONNECTED:1,PRECEDING:2,FOLLOWING:4,CONTAINS:8,CONTAINED_BY:16},comparePos=exports.compareDocumentPosition=function(nodeA,nodeB){var current,sharedParent,siblings,aSibling,bSibling,idx,aParents=[],bParents=[];if(nodeA===nodeB)return 0;for(current=nodeA;current;)aParents.unshift(current),current=current.parent;for(current=nodeB;current;)bParents.unshift(current),current=current.parent;for(idx=0;aParents[idx]===bParents[idx];)idx++;return 0===idx?POSITION.DISCONNECTED:(sharedParent=aParents[idx-1],siblings=sharedParent.children,aSibling=aParents[idx],bSibling=bParents[idx],siblings.indexOf(aSibling)>siblings.indexOf(bSibling)?sharedParent===nodeB?POSITION.FOLLOWING|POSITION.CONTAINED_BY:POSITION.FOLLOWING:sharedParent===nodeA?POSITION.PRECEDING|POSITION.CONTAINS:POSITION.PRECEDING); -};exports.uniqueSort=function(nodes){var node,position,idx=nodes.length;for(nodes=nodes.slice();--idx>-1;)node=nodes[idx],position=nodes.indexOf(node),position>-1&&position0&&(childs=find(test,childs,recurse,limit),result=result.concat(childs),limit-=childs.length,limit<=0)));i++);return result}function findOneChild(test,elems){for(var i=0,l=elems.length;i0&&(elem=findOne(test,elems[i].children)));return elem}function existsOne(test,elems){for(var i=0,l=elems.length;i0&&existsOne(test,elems[i].children)))return!0;return!1}function findAll(test,elems){for(var result=[],i=0,j=elems.length;i0&&(result=result.concat(findAll(test,elems[i].children))));return result}var isTag=require("domelementtype").isTag;module.exports={filter:filter,find:find,findOneChild:findOneChild,findOne:findOne,existsOne:existsOne,findAll:findAll}},{domelementtype:55}],64:[function(require,module,exports){function getInnerHTML(elem,opts){return elem.children?elem.children.map(function(elem){return getOuterHTML(elem,opts)}).join(""):""}function getText(elem){return Array.isArray(elem)?elem.map(getText).join(""):isTag(elem)||elem.type===ElementType.CDATA?getText(elem.children):elem.type===ElementType.Text?elem.data:""}var ElementType=require("domelementtype"),getOuterHTML=require("dom-serializer"),isTag=ElementType.isTag;module.exports={getInnerHTML:getInnerHTML,getOuterHTML:getOuterHTML,getText:getText}},{"dom-serializer":54,domelementtype:55}],65:[function(require,module,exports){var getChildren=exports.getChildren=function(elem){return elem.children},getParent=exports.getParent=function(elem){return elem.parent};exports.getSiblings=function(elem){var parent=getParent(elem);return parent?getChildren(parent):[elem]},exports.getAttributeValue=function(elem,name){return elem.attribs&&elem.attribs[name]},exports.hasAttrib=function(elem,name){return!!elem.attribs&&hasOwnProperty.call(elem.attribs,name)},exports.getName=function(elem){return elem.name}},{}],66:[function(require,module,exports){var encode=require("./lib/encode.js"),decode=require("./lib/decode.js");exports.decode=function(data,level){return(!level||level<=0?decode.XML:decode.HTML)(data)},exports.decodeStrict=function(data,level){return(!level||level<=0?decode.XML:decode.HTMLStrict)(data)},exports.encode=function(data,level){return(!level||level<=0?encode.XML:encode.HTML)(data)},exports.encodeXML=encode.XML,exports.encodeHTML4=exports.encodeHTML5=exports.encodeHTML=encode.HTML,exports.decodeXML=exports.decodeXMLStrict=decode.XML,exports.decodeHTML4=exports.decodeHTML5=exports.decodeHTML=decode.HTML,exports.decodeHTML4Strict=exports.decodeHTML5Strict=exports.decodeHTMLStrict=decode.HTMLStrict,exports.escape=encode.escape},{"./lib/decode.js":67,"./lib/encode.js":69}],67:[function(require,module,exports){function getStrictDecoder(map){var keys=Object.keys(map).join("|"),replace=getReplacer(map);keys+="|#[xX][\\da-fA-F]+|#\\d+";var re=new RegExp("&(?:"+keys+");","g");return function(str){return String(str).replace(re,replace)}}function sorter(a,b){return a=55296&&codePoint<=57343||codePoint>1114111)return"\ufffd";codePoint in decodeMap&&(codePoint=decodeMap[codePoint]);var output="";return codePoint>65535&&(codePoint-=65536,output+=String.fromCharCode(codePoint>>>10&1023|55296),codePoint=56320|1023&codePoint),output+=String.fromCharCode(codePoint)}var decodeMap=require("../maps/decode.json");module.exports=decodeCodePoint},{"../maps/decode.json":70}],69:[function(require,module,exports){function getInverseObj(obj){return Object.keys(obj).sort().reduce(function(inverse,name){return inverse[obj[name]]="&"+name+";",inverse},{})}function getInverseReplacer(inverse){var single=[],multiple=[];return Object.keys(inverse).forEach(function(k){1===k.length?single.push("\\"+k):multiple.push(k)}),multiple.unshift("["+single.join("")+"]"),new RegExp(multiple.join("|"),"g")}function singleCharReplacer(c){return"&#x"+c.charCodeAt(0).toString(16).toUpperCase()+";"}function astralReplacer(c){var high=c.charCodeAt(0),low=c.charCodeAt(1),codePoint=1024*(high-55296)+low-56320+65536;return"&#x"+codePoint.toString(16).toUpperCase()+";"}function getInverse(inverse,re){function func(name){return inverse[name]}return function(data){return data.replace(re,func).replace(re_astralSymbols,astralReplacer).replace(re_nonASCII,singleCharReplacer)}}function escapeXML(data){return data.replace(re_xmlChars,singleCharReplacer).replace(re_astralSymbols,astralReplacer).replace(re_nonASCII,singleCharReplacer)}var inverseXML=getInverseObj(require("../maps/xml.json")),xmlReplacer=getInverseReplacer(inverseXML);exports.XML=getInverse(inverseXML,xmlReplacer);var inverseHTML=getInverseObj(require("../maps/entities.json")),htmlReplacer=getInverseReplacer(inverseHTML);exports.HTML=getInverse(inverseHTML,htmlReplacer);var re_nonASCII=/[^\0-\x7F]/g,re_astralSymbols=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,re_xmlChars=getInverseReplacer(inverseXML);exports.escape=escapeXML},{"../maps/entities.json":71,"../maps/xml.json":73}],70:[function(require,module,exports){module.exports={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376}},{}],71:[function(require,module,exports){module.exports={Aacute:"\xc1",aacute:"\xe1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223e",acd:"\u223f",acE:"\u223e\u0333",Acirc:"\xc2",acirc:"\xe2",acute:"\xb4",Acy:"\u0410",acy:"\u0430",AElig:"\xc6",aelig:"\xe6",af:"\u2061",Afr:"\ud835\udd04",afr:"\ud835\udd1e",Agrave:"\xc0",agrave:"\xe0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03b1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2a3f",amp:"&",AMP:"&",andand:"\u2a55",And:"\u2a53",and:"\u2227",andd:"\u2a5c",andslope:"\u2a58",andv:"\u2a5a",ang:"\u2220",ange:"\u29a4",angle:"\u2220",angmsdaa:"\u29a8",angmsdab:"\u29a9",angmsdac:"\u29aa",angmsdad:"\u29ab",angmsdae:"\u29ac",angmsdaf:"\u29ad",angmsdag:"\u29ae",angmsdah:"\u29af",angmsd:"\u2221",angrt:"\u221f",angrtvb:"\u22be",angrtvbd:"\u299d",angsph:"\u2222",angst:"\xc5",angzarr:"\u237c",Aogon:"\u0104",aogon:"\u0105",Aopf:"\ud835\udd38",aopf:"\ud835\udd52",apacir:"\u2a6f",ap:"\u2248",apE:"\u2a70",ape:"\u224a",apid:"\u224b",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224a",Aring:"\xc5",aring:"\xe5",Ascr:"\ud835\udc9c",ascr:"\ud835\udcb6",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224d",Atilde:"\xc3",atilde:"\xe3",Auml:"\xc4",auml:"\xe4",awconint:"\u2233",awint:"\u2a11",backcong:"\u224c",backepsilon:"\u03f6",backprime:"\u2035",backsim:"\u223d",backsimeq:"\u22cd",Backslash:"\u2216",Barv:"\u2ae7",barvee:"\u22bd",barwed:"\u2305",Barwed:"\u2306",barwedge:"\u2305",bbrk:"\u23b5",bbrktbrk:"\u23b6",bcong:"\u224c",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201e",becaus:"\u2235",because:"\u2235",Because:"\u2235",bemptyv:"\u29b0",bepsi:"\u03f6",bernou:"\u212c",Bernoullis:"\u212c",Beta:"\u0392",beta:"\u03b2",beth:"\u2136",between:"\u226c",Bfr:"\ud835\udd05",bfr:"\ud835\udd1f",bigcap:"\u22c2",bigcirc:"\u25ef",bigcup:"\u22c3",bigodot:"\u2a00",bigoplus:"\u2a01",bigotimes:"\u2a02",bigsqcup:"\u2a06",bigstar:"\u2605",bigtriangledown:"\u25bd",bigtriangleup:"\u25b3",biguplus:"\u2a04",bigvee:"\u22c1",bigwedge:"\u22c0",bkarow:"\u290d",blacklozenge:"\u29eb",blacksquare:"\u25aa",blacktriangle:"\u25b4",blacktriangledown:"\u25be",blacktriangleleft:"\u25c2",blacktriangleright:"\u25b8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20e5",bnequiv:"\u2261\u20e5",bNot:"\u2aed",bnot:"\u2310",Bopf:"\ud835\udd39",bopf:"\ud835\udd53",bot:"\u22a5",bottom:"\u22a5",bowtie:"\u22c8",boxbox:"\u29c9",boxdl:"\u2510",boxdL:"\u2555",boxDl:"\u2556",boxDL:"\u2557",boxdr:"\u250c",boxdR:"\u2552",boxDr:"\u2553",boxDR:"\u2554",boxh:"\u2500",boxH:"\u2550",boxhd:"\u252c",boxHd:"\u2564",boxhD:"\u2565",boxHD:"\u2566",boxhu:"\u2534",boxHu:"\u2567",boxhU:"\u2568",boxHU:"\u2569",boxminus:"\u229f",boxplus:"\u229e",boxtimes:"\u22a0",boxul:"\u2518",boxuL:"\u255b",boxUl:"\u255c",boxUL:"\u255d",boxur:"\u2514",boxuR:"\u2558",boxUr:"\u2559",boxUR:"\u255a",boxv:"\u2502",boxV:"\u2551",boxvh:"\u253c",boxvH:"\u256a",boxVh:"\u256b",boxVH:"\u256c",boxvl:"\u2524",boxvL:"\u2561",boxVl:"\u2562",boxVL:"\u2563",boxvr:"\u251c",boxvR:"\u255e",boxVr:"\u255f",boxVR:"\u2560",bprime:"\u2035",breve:"\u02d8",Breve:"\u02d8",brvbar:"\xa6",bscr:"\ud835\udcb7",Bscr:"\u212c",bsemi:"\u204f",bsim:"\u223d",bsime:"\u22cd",bsolb:"\u29c5",bsol:"\\",bsolhsub:"\u27c8",bull:"\u2022",bullet:"\u2022",bump:"\u224e",bumpE:"\u2aae",bumpe:"\u224f",Bumpeq:"\u224e",bumpeq:"\u224f",Cacute:"\u0106",cacute:"\u0107",capand:"\u2a44",capbrcup:"\u2a49",capcap:"\u2a4b",cap:"\u2229",Cap:"\u22d2",capcup:"\u2a47",capdot:"\u2a40",CapitalDifferentialD:"\u2145",caps:"\u2229\ufe00",caret:"\u2041",caron:"\u02c7",Cayleys:"\u212d",ccaps:"\u2a4d",Ccaron:"\u010c",ccaron:"\u010d",Ccedil:"\xc7",ccedil:"\xe7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2a4c",ccupssm:"\u2a50",Cdot:"\u010a",cdot:"\u010b",cedil:"\xb8",Cedilla:"\xb8",cemptyv:"\u29b2",cent:"\xa2",centerdot:"\xb7",CenterDot:"\xb7",cfr:"\ud835\udd20",Cfr:"\u212d",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03a7",chi:"\u03c7",circ:"\u02c6",circeq:"\u2257",circlearrowleft:"\u21ba",circlearrowright:"\u21bb",circledast:"\u229b",circledcirc:"\u229a",circleddash:"\u229d",CircleDot:"\u2299",circledR:"\xae",circledS:"\u24c8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cir:"\u25cb",cirE:"\u29c3",cire:"\u2257",cirfnint:"\u2a10",cirmid:"\u2aef",cirscir:"\u29c2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201d",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",colon:":",Colon:"\u2237",Colone:"\u2a74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2a6d",Congruent:"\u2261",conint:"\u222e",Conint:"\u222f",ContourIntegral:"\u222e",copf:"\ud835\udd54",Copf:"\u2102",coprod:"\u2210",Coproduct:"\u2210",copy:"\xa9",COPY:"\xa9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21b5",cross:"\u2717",Cross:"\u2a2f",Cscr:"\ud835\udc9e",cscr:"\ud835\udcb8",csub:"\u2acf",csube:"\u2ad1",csup:"\u2ad0",csupe:"\u2ad2",ctdot:"\u22ef",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22de",cuesc:"\u22df",cularr:"\u21b6",cularrp:"\u293d",cupbrcap:"\u2a48",cupcap:"\u2a46",CupCap:"\u224d",cup:"\u222a",Cup:"\u22d3",cupcup:"\u2a4a",cupdot:"\u228d",cupor:"\u2a45",cups:"\u222a\ufe00",curarr:"\u21b7",curarrm:"\u293c",curlyeqprec:"\u22de",curlyeqsucc:"\u22df",curlyvee:"\u22ce",curlywedge:"\u22cf",curren:"\xa4",curvearrowleft:"\u21b6",curvearrowright:"\u21b7",cuvee:"\u22ce",cuwed:"\u22cf",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232d",dagger:"\u2020",Dagger:"\u2021",daleth:"\u2138",darr:"\u2193",Darr:"\u21a1",dArr:"\u21d3",dash:"\u2010",Dashv:"\u2ae4",dashv:"\u22a3",dbkarow:"\u290f",dblac:"\u02dd",Dcaron:"\u010e",dcaron:"\u010f",Dcy:"\u0414",dcy:"\u0434",ddagger:"\u2021",ddarr:"\u21ca",DD:"\u2145",dd:"\u2146",DDotrahd:"\u2911",ddotseq:"\u2a77",deg:"\xb0",Del:"\u2207",Delta:"\u0394",delta:"\u03b4",demptyv:"\u29b1",dfisht:"\u297f",Dfr:"\ud835\udd07",dfr:"\ud835\udd21",dHar:"\u2965",dharl:"\u21c3",dharr:"\u21c2",DiacriticalAcute:"\xb4",DiacriticalDot:"\u02d9",DiacriticalDoubleAcute:"\u02dd",DiacriticalGrave:"`",DiacriticalTilde:"\u02dc",diam:"\u22c4",diamond:"\u22c4",Diamond:"\u22c4",diamondsuit:"\u2666",diams:"\u2666",die:"\xa8",DifferentialD:"\u2146",digamma:"\u03dd",disin:"\u22f2",div:"\xf7",divide:"\xf7",divideontimes:"\u22c7",divonx:"\u22c7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231e",dlcrop:"\u230d",dollar:"$",Dopf:"\ud835\udd3b",dopf:"\ud835\udd55",Dot:"\xa8",dot:"\u02d9",DotDot:"\u20dc",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22a1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222f",DoubleDot:"\xa8",DoubleDownArrow:"\u21d3",DoubleLeftArrow:"\u21d0",DoubleLeftRightArrow:"\u21d4",DoubleLeftTee:"\u2ae4",DoubleLongLeftArrow:"\u27f8",DoubleLongLeftRightArrow:"\u27fa",DoubleLongRightArrow:"\u27f9",DoubleRightArrow:"\u21d2",DoubleRightTee:"\u22a8",DoubleUpArrow:"\u21d1",DoubleUpDownArrow:"\u21d5",DoubleVerticalBar:"\u2225",DownArrowBar:"\u2913",downarrow:"\u2193",DownArrow:"\u2193",Downarrow:"\u21d3",DownArrowUpArrow:"\u21f5",DownBreve:"\u0311",downdownarrows:"\u21ca",downharpoonleft:"\u21c3",downharpoonright:"\u21c2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295e",DownLeftVectorBar:"\u2956",DownLeftVector:"\u21bd",DownRightTeeVector:"\u295f",DownRightVectorBar:"\u2957",DownRightVector:"\u21c1",DownTeeArrow:"\u21a7",DownTee:"\u22a4",drbkarow:"\u2910",drcorn:"\u231f",drcrop:"\u230c",Dscr:"\ud835\udc9f",dscr:"\ud835\udcb9",DScy:"\u0405",dscy:"\u0455",dsol:"\u29f6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22f1",dtri:"\u25bf",dtrif:"\u25be",duarr:"\u21f5",duhar:"\u296f",dwangle:"\u29a6",DZcy:"\u040f",dzcy:"\u045f",dzigrarr:"\u27ff",Eacute:"\xc9",eacute:"\xe9",easter:"\u2a6e",Ecaron:"\u011a",ecaron:"\u011b",Ecirc:"\xca",ecirc:"\xea",ecir:"\u2256",ecolon:"\u2255",Ecy:"\u042d",ecy:"\u044d",eDDot:"\u2a77",Edot:"\u0116",edot:"\u0117",eDot:"\u2251",ee:"\u2147",efDot:"\u2252",Efr:"\ud835\udd08",efr:"\ud835\udd22",eg:"\u2a9a",Egrave:"\xc8",egrave:"\xe8",egs:"\u2a96",egsdot:"\u2a98",el:"\u2a99",Element:"\u2208",elinters:"\u23e7",ell:"\u2113",els:"\u2a95",elsdot:"\u2a97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25fb",emptyv:"\u2205",EmptyVerySmallSquare:"\u25ab",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",ENG:"\u014a",eng:"\u014b",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\ud835\udd3c",eopf:"\ud835\udd56",epar:"\u22d5",eparsl:"\u29e3",eplus:"\u2a71",epsi:"\u03b5",Epsilon:"\u0395",epsilon:"\u03b5",epsiv:"\u03f5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2a96",eqslantless:"\u2a95",Equal:"\u2a75",equals:"=",EqualTilde:"\u2242",equest:"\u225f",Equilibrium:"\u21cc",equiv:"\u2261",equivDD:"\u2a78",eqvparsl:"\u29e5",erarr:"\u2971",erDot:"\u2253",escr:"\u212f",Escr:"\u2130",esdot:"\u2250",Esim:"\u2a73",esim:"\u2242",Eta:"\u0397",eta:"\u03b7",ETH:"\xd0",eth:"\xf0",Euml:"\xcb",euml:"\xeb",euro:"\u20ac",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",exponentiale:"\u2147",ExponentialE:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\ufb03",fflig:"\ufb00",ffllig:"\ufb04",Ffr:"\ud835\udd09",ffr:"\ud835\udd23",filig:"\ufb01",FilledSmallSquare:"\u25fc",FilledVerySmallSquare:"\u25aa",fjlig:"fj",flat:"\u266d",fllig:"\ufb02",fltns:"\u25b1",fnof:"\u0192",Fopf:"\ud835\udd3d",fopf:"\ud835\udd57",forall:"\u2200",ForAll:"\u2200",fork:"\u22d4",forkv:"\u2ad9",Fouriertrf:"\u2131",fpartint:"\u2a0d",frac12:"\xbd",frac13:"\u2153",frac14:"\xbc",frac15:"\u2155",frac16:"\u2159",frac18:"\u215b",frac23:"\u2154",frac25:"\u2156",frac34:"\xbe",frac35:"\u2157",frac38:"\u215c",frac45:"\u2158",frac56:"\u215a",frac58:"\u215d",frac78:"\u215e",frasl:"\u2044",frown:"\u2322",fscr:"\ud835\udcbb",Fscr:"\u2131",gacute:"\u01f5",Gamma:"\u0393",gamma:"\u03b3",Gammad:"\u03dc",gammad:"\u03dd",gap:"\u2a86",Gbreve:"\u011e",gbreve:"\u011f",Gcedil:"\u0122",Gcirc:"\u011c",gcirc:"\u011d",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",ge:"\u2265",gE:"\u2267",gEl:"\u2a8c",gel:"\u22db",geq:"\u2265",geqq:"\u2267",geqslant:"\u2a7e",gescc:"\u2aa9",ges:"\u2a7e",gesdot:"\u2a80",gesdoto:"\u2a82",gesdotol:"\u2a84",gesl:"\u22db\ufe00",gesles:"\u2a94",Gfr:"\ud835\udd0a",gfr:"\ud835\udd24",gg:"\u226b",Gg:"\u22d9",ggg:"\u22d9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gla:"\u2aa5",gl:"\u2277",glE:"\u2a92",glj:"\u2aa4",gnap:"\u2a8a",gnapprox:"\u2a8a",gne:"\u2a88",gnE:"\u2269",gneq:"\u2a88",gneqq:"\u2269",gnsim:"\u22e7",Gopf:"\ud835\udd3e",gopf:"\ud835\udd58",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22db",GreaterFullEqual:"\u2267",GreaterGreater:"\u2aa2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2a7e",GreaterTilde:"\u2273",Gscr:"\ud835\udca2",gscr:"\u210a",gsim:"\u2273",gsime:"\u2a8e",gsiml:"\u2a90",gtcc:"\u2aa7",gtcir:"\u2a7a",gt:">",GT:">",Gt:"\u226b",gtdot:"\u22d7",gtlPar:"\u2995",gtquest:"\u2a7c",gtrapprox:"\u2a86",gtrarr:"\u2978",gtrdot:"\u22d7",gtreqless:"\u22db",gtreqqless:"\u2a8c",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\ufe00",gvnE:"\u2269\ufe00",Hacek:"\u02c7",hairsp:"\u200a",half:"\xbd",hamilt:"\u210b",HARDcy:"\u042a",hardcy:"\u044a",harrcir:"\u2948",harr:"\u2194",hArr:"\u21d4",harrw:"\u21ad",Hat:"^",hbar:"\u210f",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22b9",hfr:"\ud835\udd25",Hfr:"\u210c",HilbertSpace:"\u210b",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21ff",homtht:"\u223b",hookleftarrow:"\u21a9",hookrightarrow:"\u21aa",hopf:"\ud835\udd59",Hopf:"\u210d",horbar:"\u2015",HorizontalLine:"\u2500",hscr:"\ud835\udcbd",Hscr:"\u210b",hslash:"\u210f",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224e",HumpEqual:"\u224f",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xcd",iacute:"\xed",ic:"\u2063",Icirc:"\xce",icirc:"\xee",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xa1",iff:"\u21d4",ifr:"\ud835\udd26",Ifr:"\u2111",Igrave:"\xcc",igrave:"\xec",ii:"\u2148",iiiint:"\u2a0c",iiint:"\u222d",iinfin:"\u29dc",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Imacr:"\u012a",imacr:"\u012b",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",Im:"\u2111",imof:"\u22b7",imped:"\u01b5",Implies:"\u21d2",incare:"\u2105","in":"\u2208",infin:"\u221e",infintie:"\u29dd",inodot:"\u0131",intcal:"\u22ba","int":"\u222b",Int:"\u222c",integers:"\u2124",Integral:"\u222b",intercal:"\u22ba",Intersection:"\u22c2",intlarhk:"\u2a17",intprod:"\u2a3c",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012e",iogon:"\u012f",Iopf:"\ud835\udd40",iopf:"\ud835\udd5a",Iota:"\u0399",iota:"\u03b9",iprod:"\u2a3c",iquest:"\xbf",iscr:"\ud835\udcbe",Iscr:"\u2110",isin:"\u2208",isindot:"\u22f5",isinE:"\u22f9",isins:"\u22f4",isinsv:"\u22f3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xcf",iuml:"\xef",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\ud835\udd0d",jfr:"\ud835\udd27",jmath:"\u0237",Jopf:"\ud835\udd41",jopf:"\ud835\udd5b",Jscr:"\ud835\udca5",jscr:"\ud835\udcbf",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039a",kappa:"\u03ba",kappav:"\u03f0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041a",kcy:"\u043a",Kfr:"\ud835\udd0e",kfr:"\ud835\udd28",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040c",kjcy:"\u045c",Kopf:"\ud835\udd42",kopf:"\ud835\udd5c",Kscr:"\ud835\udca6",kscr:"\ud835\udcc0",lAarr:"\u21da",Lacute:"\u0139",lacute:"\u013a",laemptyv:"\u29b4",lagran:"\u2112",Lambda:"\u039b",lambda:"\u03bb",lang:"\u27e8",Lang:"\u27ea",langd:"\u2991",langle:"\u27e8",lap:"\u2a85",Laplacetrf:"\u2112",laquo:"\xab",larrb:"\u21e4",larrbfs:"\u291f",larr:"\u2190",Larr:"\u219e",lArr:"\u21d0",larrfs:"\u291d",larrhk:"\u21a9",larrlp:"\u21ab",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21a2",latail:"\u2919",lAtail:"\u291b",lat:"\u2aab",late:"\u2aad",lates:"\u2aad\ufe00",lbarr:"\u290c",lBarr:"\u290e",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298b",lbrksld:"\u298f",lbrkslu:"\u298d",Lcaron:"\u013d",lcaron:"\u013e",Lcedil:"\u013b",lcedil:"\u013c",lceil:"\u2308",lcub:"{",Lcy:"\u041b",lcy:"\u043b",ldca:"\u2936",ldquo:"\u201c",ldquor:"\u201e",ldrdhar:"\u2967",ldrushar:"\u294b",ldsh:"\u21b2",le:"\u2264",lE:"\u2266",LeftAngleBracket:"\u27e8",LeftArrowBar:"\u21e4",leftarrow:"\u2190",LeftArrow:"\u2190",Leftarrow:"\u21d0",LeftArrowRightArrow:"\u21c6",leftarrowtail:"\u21a2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27e6",LeftDownTeeVector:"\u2961",LeftDownVectorBar:"\u2959",LeftDownVector:"\u21c3",LeftFloor:"\u230a",leftharpoondown:"\u21bd",leftharpoonup:"\u21bc",leftleftarrows:"\u21c7",leftrightarrow:"\u2194",LeftRightArrow:"\u2194",Leftrightarrow:"\u21d4",leftrightarrows:"\u21c6",leftrightharpoons:"\u21cb",leftrightsquigarrow:"\u21ad",LeftRightVector:"\u294e",LeftTeeArrow:"\u21a4",LeftTee:"\u22a3",LeftTeeVector:"\u295a",leftthreetimes:"\u22cb",LeftTriangleBar:"\u29cf",LeftTriangle:"\u22b2",LeftTriangleEqual:"\u22b4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVectorBar:"\u2958",LeftUpVector:"\u21bf",LeftVectorBar:"\u2952",LeftVector:"\u21bc",lEg:"\u2a8b",leg:"\u22da",leq:"\u2264",leqq:"\u2266",leqslant:"\u2a7d",lescc:"\u2aa8",les:"\u2a7d",lesdot:"\u2a7f",lesdoto:"\u2a81",lesdotor:"\u2a83",lesg:"\u22da\ufe00",lesges:"\u2a93",lessapprox:"\u2a85",lessdot:"\u22d6",lesseqgtr:"\u22da",lesseqqgtr:"\u2a8b",LessEqualGreater:"\u22da",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2aa1",lesssim:"\u2272",LessSlantEqual:"\u2a7d",LessTilde:"\u2272",lfisht:"\u297c",lfloor:"\u230a",Lfr:"\ud835\udd0f",lfr:"\ud835\udd29",lg:"\u2276",lgE:"\u2a91",lHar:"\u2962",lhard:"\u21bd",lharu:"\u21bc",lharul:"\u296a",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",llarr:"\u21c7",ll:"\u226a",Ll:"\u22d8",llcorner:"\u231e",Lleftarrow:"\u21da",llhard:"\u296b",lltri:"\u25fa",Lmidot:"\u013f",lmidot:"\u0140",lmoustache:"\u23b0",lmoust:"\u23b0",lnap:"\u2a89",lnapprox:"\u2a89",lne:"\u2a87",lnE:"\u2268",lneq:"\u2a87",lneqq:"\u2268",lnsim:"\u22e6",loang:"\u27ec",loarr:"\u21fd",lobrk:"\u27e6",longleftarrow:"\u27f5",LongLeftArrow:"\u27f5",Longleftarrow:"\u27f8",longleftrightarrow:"\u27f7",LongLeftRightArrow:"\u27f7",Longleftrightarrow:"\u27fa",longmapsto:"\u27fc",longrightarrow:"\u27f6",LongRightArrow:"\u27f6",Longrightarrow:"\u27f9",looparrowleft:"\u21ab",looparrowright:"\u21ac",lopar:"\u2985",Lopf:"\ud835\udd43",lopf:"\ud835\udd5d",loplus:"\u2a2d",lotimes:"\u2a34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25ca",lozenge:"\u25ca",lozf:"\u29eb",lpar:"(",lparlt:"\u2993",lrarr:"\u21c6",lrcorner:"\u231f",lrhar:"\u21cb",lrhard:"\u296d",lrm:"\u200e",lrtri:"\u22bf",lsaquo:"\u2039",lscr:"\ud835\udcc1",Lscr:"\u2112",lsh:"\u21b0",Lsh:"\u21b0",lsim:"\u2272",lsime:"\u2a8d",lsimg:"\u2a8f",lsqb:"[",lsquo:"\u2018",lsquor:"\u201a",Lstrok:"\u0141",lstrok:"\u0142",ltcc:"\u2aa6",ltcir:"\u2a79",lt:"<",LT:"<",Lt:"\u226a",ltdot:"\u22d6",lthree:"\u22cb",ltimes:"\u22c9",ltlarr:"\u2976",ltquest:"\u2a7b",ltri:"\u25c3",ltrie:"\u22b4",ltrif:"\u25c2",ltrPar:"\u2996",lurdshar:"\u294a",luruhar:"\u2966",lvertneqq:"\u2268\ufe00",lvnE:"\u2268\ufe00",macr:"\xaf",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21a6",mapsto:"\u21a6",mapstodown:"\u21a7",mapstoleft:"\u21a4",mapstoup:"\u21a5",marker:"\u25ae",mcomma:"\u2a29",Mcy:"\u041c",mcy:"\u043c",mdash:"\u2014",mDDot:"\u223a",measuredangle:"\u2221",MediumSpace:"\u205f",Mellintrf:"\u2133",Mfr:"\ud835\udd10",mfr:"\ud835\udd2a",mho:"\u2127",micro:"\xb5",midast:"*",midcir:"\u2af0",mid:"\u2223",middot:"\xb7",minusb:"\u229f",minus:"\u2212",minusd:"\u2238",minusdu:"\u2a2a",MinusPlus:"\u2213",mlcp:"\u2adb",mldr:"\u2026",mnplus:"\u2213",models:"\u22a7",Mopf:"\ud835\udd44",mopf:"\ud835\udd5e",mp:"\u2213",mscr:"\ud835\udcc2",Mscr:"\u2133",mstpos:"\u223e",Mu:"\u039c",mu:"\u03bc",multimap:"\u22b8",mumap:"\u22b8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20d2",nap:"\u2249",napE:"\u2a70\u0338",napid:"\u224b\u0338",napos:"\u0149",napprox:"\u2249",natural:"\u266e",naturals:"\u2115",natur:"\u266e",nbsp:"\xa0",nbump:"\u224e\u0338",nbumpe:"\u224f\u0338",ncap:"\u2a43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2a6d\u0338",ncup:"\u2a42",Ncy:"\u041d",ncy:"\u043d",ndash:"\u2013",nearhk:"\u2924",nearr:"\u2197",neArr:"\u21d7",nearrow:"\u2197",ne:"\u2260",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200b",NegativeThickSpace:"\u200b",NegativeThinSpace:"\u200b",NegativeVeryThinSpace:"\u200b",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226b",NestedLessLess:"\u226a",NewLine:"\n",nexist:"\u2204",nexists:"\u2204",Nfr:"\ud835\udd11",nfr:"\ud835\udd2b",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2a7e\u0338",nges:"\u2a7e\u0338",nGg:"\u22d9\u0338",ngsim:"\u2275",nGt:"\u226b\u20d2",ngt:"\u226f",ngtr:"\u226f",nGtv:"\u226b\u0338",nharr:"\u21ae",nhArr:"\u21ce",nhpar:"\u2af2",ni:"\u220b",nis:"\u22fc",nisd:"\u22fa",niv:"\u220b",NJcy:"\u040a",njcy:"\u045a",nlarr:"\u219a",nlArr:"\u21cd",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nleftarrow:"\u219a",nLeftarrow:"\u21cd",nleftrightarrow:"\u21ae",nLeftrightarrow:"\u21ce",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2a7d\u0338",nles:"\u2a7d\u0338",nless:"\u226e",nLl:"\u22d8\u0338",nlsim:"\u2274",nLt:"\u226a\u20d2",nlt:"\u226e",nltri:"\u22ea",nltrie:"\u22ec",nLtv:"\u226a\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xa0",nopf:"\ud835\udd5f",Nopf:"\u2115",Not:"\u2aec",not:"\xac",NotCongruent:"\u2262",NotCupCap:"\u226d",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226f",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226b\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2a7e\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224e\u0338",NotHumpEqual:"\u224f\u0338",notin:"\u2209",notindot:"\u22f5\u0338",notinE:"\u22f9\u0338",notinva:"\u2209",notinvb:"\u22f7",notinvc:"\u22f6",NotLeftTriangleBar:"\u29cf\u0338",NotLeftTriangle:"\u22ea",NotLeftTriangleEqual:"\u22ec",NotLess:"\u226e",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226a\u0338",NotLessSlantEqual:"\u2a7d\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2aa2\u0338",NotNestedLessLess:"\u2aa1\u0338",notni:"\u220c",notniva:"\u220c",notnivb:"\u22fe",notnivc:"\u22fd",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2aaf\u0338",NotPrecedesSlantEqual:"\u22e0",NotReverseElement:"\u220c",NotRightTriangleBar:"\u29d0\u0338",NotRightTriangle:"\u22eb",NotRightTriangleEqual:"\u22ed",NotSquareSubset:"\u228f\u0338",NotSquareSubsetEqual:"\u22e2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22e3",NotSubset:"\u2282\u20d2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2ab0\u0338",NotSucceedsSlantEqual:"\u22e1",NotSucceedsTilde:"\u227f\u0338",NotSuperset:"\u2283\u20d2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",nparallel:"\u2226",npar:"\u2226",nparsl:"\u2afd\u20e5",npart:"\u2202\u0338",npolint:"\u2a14",npr:"\u2280",nprcue:"\u22e0",nprec:"\u2280", -npreceq:"\u2aaf\u0338",npre:"\u2aaf\u0338",nrarrc:"\u2933\u0338",nrarr:"\u219b",nrArr:"\u21cf",nrarrw:"\u219d\u0338",nrightarrow:"\u219b",nRightarrow:"\u21cf",nrtri:"\u22eb",nrtrie:"\u22ed",nsc:"\u2281",nsccue:"\u22e1",nsce:"\u2ab0\u0338",Nscr:"\ud835\udca9",nscr:"\ud835\udcc3",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22e2",nsqsupe:"\u22e3",nsub:"\u2284",nsubE:"\u2ac5\u0338",nsube:"\u2288",nsubset:"\u2282\u20d2",nsubseteq:"\u2288",nsubseteqq:"\u2ac5\u0338",nsucc:"\u2281",nsucceq:"\u2ab0\u0338",nsup:"\u2285",nsupE:"\u2ac6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20d2",nsupseteq:"\u2289",nsupseteqq:"\u2ac6\u0338",ntgl:"\u2279",Ntilde:"\xd1",ntilde:"\xf1",ntlg:"\u2278",ntriangleleft:"\u22ea",ntrianglelefteq:"\u22ec",ntriangleright:"\u22eb",ntrianglerighteq:"\u22ed",Nu:"\u039d",nu:"\u03bd",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224d\u20d2",nvdash:"\u22ac",nvDash:"\u22ad",nVdash:"\u22ae",nVDash:"\u22af",nvge:"\u2265\u20d2",nvgt:">\u20d2",nvHarr:"\u2904",nvinfin:"\u29de",nvlArr:"\u2902",nvle:"\u2264\u20d2",nvlt:"<\u20d2",nvltrie:"\u22b4\u20d2",nvrArr:"\u2903",nvrtrie:"\u22b5\u20d2",nvsim:"\u223c\u20d2",nwarhk:"\u2923",nwarr:"\u2196",nwArr:"\u21d6",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xd3",oacute:"\xf3",oast:"\u229b",Ocirc:"\xd4",ocirc:"\xf4",ocir:"\u229a",Ocy:"\u041e",ocy:"\u043e",odash:"\u229d",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2a38",odot:"\u2299",odsold:"\u29bc",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29bf",Ofr:"\ud835\udd12",ofr:"\ud835\udd2c",ogon:"\u02db",Ograve:"\xd2",ograve:"\xf2",ogt:"\u29c1",ohbar:"\u29b5",ohm:"\u03a9",oint:"\u222e",olarr:"\u21ba",olcir:"\u29be",olcross:"\u29bb",oline:"\u203e",olt:"\u29c0",Omacr:"\u014c",omacr:"\u014d",Omega:"\u03a9",omega:"\u03c9",Omicron:"\u039f",omicron:"\u03bf",omid:"\u29b6",ominus:"\u2296",Oopf:"\ud835\udd46",oopf:"\ud835\udd60",opar:"\u29b7",OpenCurlyDoubleQuote:"\u201c",OpenCurlyQuote:"\u2018",operp:"\u29b9",oplus:"\u2295",orarr:"\u21bb",Or:"\u2a54",or:"\u2228",ord:"\u2a5d",order:"\u2134",orderof:"\u2134",ordf:"\xaa",ordm:"\xba",origof:"\u22b6",oror:"\u2a56",orslope:"\u2a57",orv:"\u2a5b",oS:"\u24c8",Oscr:"\ud835\udcaa",oscr:"\u2134",Oslash:"\xd8",oslash:"\xf8",osol:"\u2298",Otilde:"\xd5",otilde:"\xf5",otimesas:"\u2a36",Otimes:"\u2a37",otimes:"\u2297",Ouml:"\xd6",ouml:"\xf6",ovbar:"\u233d",OverBar:"\u203e",OverBrace:"\u23de",OverBracket:"\u23b4",OverParenthesis:"\u23dc",para:"\xb6",parallel:"\u2225",par:"\u2225",parsim:"\u2af3",parsl:"\u2afd",part:"\u2202",PartialD:"\u2202",Pcy:"\u041f",pcy:"\u043f",percnt:"%",period:".",permil:"\u2030",perp:"\u22a5",pertenk:"\u2031",Pfr:"\ud835\udd13",pfr:"\ud835\udd2d",Phi:"\u03a6",phi:"\u03c6",phiv:"\u03d5",phmmat:"\u2133",phone:"\u260e",Pi:"\u03a0",pi:"\u03c0",pitchfork:"\u22d4",piv:"\u03d6",planck:"\u210f",planckh:"\u210e",plankv:"\u210f",plusacir:"\u2a23",plusb:"\u229e",pluscir:"\u2a22",plus:"+",plusdo:"\u2214",plusdu:"\u2a25",pluse:"\u2a72",PlusMinus:"\xb1",plusmn:"\xb1",plussim:"\u2a26",plustwo:"\u2a27",pm:"\xb1",Poincareplane:"\u210c",pointint:"\u2a15",popf:"\ud835\udd61",Popf:"\u2119",pound:"\xa3",prap:"\u2ab7",Pr:"\u2abb",pr:"\u227a",prcue:"\u227c",precapprox:"\u2ab7",prec:"\u227a",preccurlyeq:"\u227c",Precedes:"\u227a",PrecedesEqual:"\u2aaf",PrecedesSlantEqual:"\u227c",PrecedesTilde:"\u227e",preceq:"\u2aaf",precnapprox:"\u2ab9",precneqq:"\u2ab5",precnsim:"\u22e8",pre:"\u2aaf",prE:"\u2ab3",precsim:"\u227e",prime:"\u2032",Prime:"\u2033",primes:"\u2119",prnap:"\u2ab9",prnE:"\u2ab5",prnsim:"\u22e8",prod:"\u220f",Product:"\u220f",profalar:"\u232e",profline:"\u2312",profsurf:"\u2313",prop:"\u221d",Proportional:"\u221d",Proportion:"\u2237",propto:"\u221d",prsim:"\u227e",prurel:"\u22b0",Pscr:"\ud835\udcab",pscr:"\ud835\udcc5",Psi:"\u03a8",psi:"\u03c8",puncsp:"\u2008",Qfr:"\ud835\udd14",qfr:"\ud835\udd2e",qint:"\u2a0c",qopf:"\ud835\udd62",Qopf:"\u211a",qprime:"\u2057",Qscr:"\ud835\udcac",qscr:"\ud835\udcc6",quaternions:"\u210d",quatint:"\u2a16",quest:"?",questeq:"\u225f",quot:'"',QUOT:'"',rAarr:"\u21db",race:"\u223d\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221a",raemptyv:"\u29b3",rang:"\u27e9",Rang:"\u27eb",rangd:"\u2992",range:"\u29a5",rangle:"\u27e9",raquo:"\xbb",rarrap:"\u2975",rarrb:"\u21e5",rarrbfs:"\u2920",rarrc:"\u2933",rarr:"\u2192",Rarr:"\u21a0",rArr:"\u21d2",rarrfs:"\u291e",rarrhk:"\u21aa",rarrlp:"\u21ac",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21a3",rarrw:"\u219d",ratail:"\u291a",rAtail:"\u291c",ratio:"\u2236",rationals:"\u211a",rbarr:"\u290d",rBarr:"\u290f",RBarr:"\u2910",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298c",rbrksld:"\u298e",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201d",rdquor:"\u201d",rdsh:"\u21b3",real:"\u211c",realine:"\u211b",realpart:"\u211c",reals:"\u211d",Re:"\u211c",rect:"\u25ad",reg:"\xae",REG:"\xae",ReverseElement:"\u220b",ReverseEquilibrium:"\u21cb",ReverseUpEquilibrium:"\u296f",rfisht:"\u297d",rfloor:"\u230b",rfr:"\ud835\udd2f",Rfr:"\u211c",rHar:"\u2964",rhard:"\u21c1",rharu:"\u21c0",rharul:"\u296c",Rho:"\u03a1",rho:"\u03c1",rhov:"\u03f1",RightAngleBracket:"\u27e9",RightArrowBar:"\u21e5",rightarrow:"\u2192",RightArrow:"\u2192",Rightarrow:"\u21d2",RightArrowLeftArrow:"\u21c4",rightarrowtail:"\u21a3",RightCeiling:"\u2309",RightDoubleBracket:"\u27e7",RightDownTeeVector:"\u295d",RightDownVectorBar:"\u2955",RightDownVector:"\u21c2",RightFloor:"\u230b",rightharpoondown:"\u21c1",rightharpoonup:"\u21c0",rightleftarrows:"\u21c4",rightleftharpoons:"\u21cc",rightrightarrows:"\u21c9",rightsquigarrow:"\u219d",RightTeeArrow:"\u21a6",RightTee:"\u22a2",RightTeeVector:"\u295b",rightthreetimes:"\u22cc",RightTriangleBar:"\u29d0",RightTriangle:"\u22b3",RightTriangleEqual:"\u22b5",RightUpDownVector:"\u294f",RightUpTeeVector:"\u295c",RightUpVectorBar:"\u2954",RightUpVector:"\u21be",RightVectorBar:"\u2953",RightVector:"\u21c0",ring:"\u02da",risingdotseq:"\u2253",rlarr:"\u21c4",rlhar:"\u21cc",rlm:"\u200f",rmoustache:"\u23b1",rmoust:"\u23b1",rnmid:"\u2aee",roang:"\u27ed",roarr:"\u21fe",robrk:"\u27e7",ropar:"\u2986",ropf:"\ud835\udd63",Ropf:"\u211d",roplus:"\u2a2e",rotimes:"\u2a35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2a12",rrarr:"\u21c9",Rrightarrow:"\u21db",rsaquo:"\u203a",rscr:"\ud835\udcc7",Rscr:"\u211b",rsh:"\u21b1",Rsh:"\u21b1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22cc",rtimes:"\u22ca",rtri:"\u25b9",rtrie:"\u22b5",rtrif:"\u25b8",rtriltri:"\u29ce",RuleDelayed:"\u29f4",ruluhar:"\u2968",rx:"\u211e",Sacute:"\u015a",sacute:"\u015b",sbquo:"\u201a",scap:"\u2ab8",Scaron:"\u0160",scaron:"\u0161",Sc:"\u2abc",sc:"\u227b",sccue:"\u227d",sce:"\u2ab0",scE:"\u2ab4",Scedil:"\u015e",scedil:"\u015f",Scirc:"\u015c",scirc:"\u015d",scnap:"\u2aba",scnE:"\u2ab6",scnsim:"\u22e9",scpolint:"\u2a13",scsim:"\u227f",Scy:"\u0421",scy:"\u0441",sdotb:"\u22a1",sdot:"\u22c5",sdote:"\u2a66",searhk:"\u2925",searr:"\u2198",seArr:"\u21d8",searrow:"\u2198",sect:"\xa7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\ud835\udd16",sfr:"\ud835\udd30",sfrown:"\u2322",sharp:"\u266f",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xad",Sigma:"\u03a3",sigma:"\u03c3",sigmaf:"\u03c2",sigmav:"\u03c2",sim:"\u223c",simdot:"\u2a6a",sime:"\u2243",simeq:"\u2243",simg:"\u2a9e",simgE:"\u2aa0",siml:"\u2a9d",simlE:"\u2a9f",simne:"\u2246",simplus:"\u2a24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2a33",smeparsl:"\u29e4",smid:"\u2223",smile:"\u2323",smt:"\u2aaa",smte:"\u2aac",smtes:"\u2aac\ufe00",SOFTcy:"\u042c",softcy:"\u044c",solbar:"\u233f",solb:"\u29c4",sol:"/",Sopf:"\ud835\udd4a",sopf:"\ud835\udd64",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\ufe00",sqcup:"\u2294",sqcups:"\u2294\ufe00",Sqrt:"\u221a",sqsub:"\u228f",sqsube:"\u2291",sqsubset:"\u228f",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",square:"\u25a1",Square:"\u25a1",SquareIntersection:"\u2293",SquareSubset:"\u228f",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25aa",squ:"\u25a1",squf:"\u25aa",srarr:"\u2192",Sscr:"\ud835\udcae",sscr:"\ud835\udcc8",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22c6",Star:"\u22c6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03f5",straightphi:"\u03d5",strns:"\xaf",sub:"\u2282",Sub:"\u22d0",subdot:"\u2abd",subE:"\u2ac5",sube:"\u2286",subedot:"\u2ac3",submult:"\u2ac1",subnE:"\u2acb",subne:"\u228a",subplus:"\u2abf",subrarr:"\u2979",subset:"\u2282",Subset:"\u22d0",subseteq:"\u2286",subseteqq:"\u2ac5",SubsetEqual:"\u2286",subsetneq:"\u228a",subsetneqq:"\u2acb",subsim:"\u2ac7",subsub:"\u2ad5",subsup:"\u2ad3",succapprox:"\u2ab8",succ:"\u227b",succcurlyeq:"\u227d",Succeeds:"\u227b",SucceedsEqual:"\u2ab0",SucceedsSlantEqual:"\u227d",SucceedsTilde:"\u227f",succeq:"\u2ab0",succnapprox:"\u2aba",succneqq:"\u2ab6",succnsim:"\u22e9",succsim:"\u227f",SuchThat:"\u220b",sum:"\u2211",Sum:"\u2211",sung:"\u266a",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",sup:"\u2283",Sup:"\u22d1",supdot:"\u2abe",supdsub:"\u2ad8",supE:"\u2ac6",supe:"\u2287",supedot:"\u2ac4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27c9",suphsub:"\u2ad7",suplarr:"\u297b",supmult:"\u2ac2",supnE:"\u2acc",supne:"\u228b",supplus:"\u2ac0",supset:"\u2283",Supset:"\u22d1",supseteq:"\u2287",supseteqq:"\u2ac6",supsetneq:"\u228b",supsetneqq:"\u2acc",supsim:"\u2ac8",supsub:"\u2ad4",supsup:"\u2ad6",swarhk:"\u2926",swarr:"\u2199",swArr:"\u21d9",swarrow:"\u2199",swnwar:"\u292a",szlig:"\xdf",Tab:"\t",target:"\u2316",Tau:"\u03a4",tau:"\u03c4",tbrk:"\u23b4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20db",telrec:"\u2315",Tfr:"\ud835\udd17",tfr:"\ud835\udd31",there4:"\u2234",therefore:"\u2234",Therefore:"\u2234",Theta:"\u0398",theta:"\u03b8",thetasym:"\u03d1",thetav:"\u03d1",thickapprox:"\u2248",thicksim:"\u223c",ThickSpace:"\u205f\u200a",ThinSpace:"\u2009",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223c",THORN:"\xde",thorn:"\xfe",tilde:"\u02dc",Tilde:"\u223c",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",timesbar:"\u2a31",timesb:"\u22a0",times:"\xd7",timesd:"\u2a30",tint:"\u222d",toea:"\u2928",topbot:"\u2336",topcir:"\u2af1",top:"\u22a4",Topf:"\ud835\udd4b",topf:"\ud835\udd65",topfork:"\u2ada",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",TRADE:"\u2122",triangle:"\u25b5",triangledown:"\u25bf",triangleleft:"\u25c3",trianglelefteq:"\u22b4",triangleq:"\u225c",triangleright:"\u25b9",trianglerighteq:"\u22b5",tridot:"\u25ec",trie:"\u225c",triminus:"\u2a3a",TripleDot:"\u20db",triplus:"\u2a39",trisb:"\u29cd",tritime:"\u2a3b",trpezium:"\u23e2",Tscr:"\ud835\udcaf",tscr:"\ud835\udcc9",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040b",tshcy:"\u045b",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226c",twoheadleftarrow:"\u219e",twoheadrightarrow:"\u21a0",Uacute:"\xda",uacute:"\xfa",uarr:"\u2191",Uarr:"\u219f",uArr:"\u21d1",Uarrocir:"\u2949",Ubrcy:"\u040e",ubrcy:"\u045e",Ubreve:"\u016c",ubreve:"\u016d",Ucirc:"\xdb",ucirc:"\xfb",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21c5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296e",ufisht:"\u297e",Ufr:"\ud835\udd18",ufr:"\ud835\udd32",Ugrave:"\xd9",ugrave:"\xf9",uHar:"\u2963",uharl:"\u21bf",uharr:"\u21be",uhblk:"\u2580",ulcorn:"\u231c",ulcorner:"\u231c",ulcrop:"\u230f",ultri:"\u25f8",Umacr:"\u016a",umacr:"\u016b",uml:"\xa8",UnderBar:"_",UnderBrace:"\u23df",UnderBracket:"\u23b5",UnderParenthesis:"\u23dd",Union:"\u22c3",UnionPlus:"\u228e",Uogon:"\u0172",uogon:"\u0173",Uopf:"\ud835\udd4c",uopf:"\ud835\udd66",UpArrowBar:"\u2912",uparrow:"\u2191",UpArrow:"\u2191",Uparrow:"\u21d1",UpArrowDownArrow:"\u21c5",updownarrow:"\u2195",UpDownArrow:"\u2195",Updownarrow:"\u21d5",UpEquilibrium:"\u296e",upharpoonleft:"\u21bf",upharpoonright:"\u21be",uplus:"\u228e",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",upsi:"\u03c5",Upsi:"\u03d2",upsih:"\u03d2",Upsilon:"\u03a5",upsilon:"\u03c5",UpTeeArrow:"\u21a5",UpTee:"\u22a5",upuparrows:"\u21c8",urcorn:"\u231d",urcorner:"\u231d",urcrop:"\u230e",Uring:"\u016e",uring:"\u016f",urtri:"\u25f9",Uscr:"\ud835\udcb0",uscr:"\ud835\udcca",utdot:"\u22f0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25b5",utrif:"\u25b4",uuarr:"\u21c8",Uuml:"\xdc",uuml:"\xfc",uwangle:"\u29a7",vangrt:"\u299c",varepsilon:"\u03f5",varkappa:"\u03f0",varnothing:"\u2205",varphi:"\u03d5",varpi:"\u03d6",varpropto:"\u221d",varr:"\u2195",vArr:"\u21d5",varrho:"\u03f1",varsigma:"\u03c2",varsubsetneq:"\u228a\ufe00",varsubsetneqq:"\u2acb\ufe00",varsupsetneq:"\u228b\ufe00",varsupsetneqq:"\u2acc\ufe00",vartheta:"\u03d1",vartriangleleft:"\u22b2",vartriangleright:"\u22b3",vBar:"\u2ae8",Vbar:"\u2aeb",vBarv:"\u2ae9",Vcy:"\u0412",vcy:"\u0432",vdash:"\u22a2",vDash:"\u22a8",Vdash:"\u22a9",VDash:"\u22ab",Vdashl:"\u2ae6",veebar:"\u22bb",vee:"\u2228",Vee:"\u22c1",veeeq:"\u225a",vellip:"\u22ee",verbar:"|",Verbar:"\u2016",vert:"|",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200a",Vfr:"\ud835\udd19",vfr:"\ud835\udd33",vltri:"\u22b2",vnsub:"\u2282\u20d2",vnsup:"\u2283\u20d2",Vopf:"\ud835\udd4d",vopf:"\ud835\udd67",vprop:"\u221d",vrtri:"\u22b3",Vscr:"\ud835\udcb1",vscr:"\ud835\udccb",vsubnE:"\u2acb\ufe00",vsubne:"\u228a\ufe00",vsupnE:"\u2acc\ufe00",vsupne:"\u228b\ufe00",Vvdash:"\u22aa",vzigzag:"\u299a",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2a5f",wedge:"\u2227",Wedge:"\u22c0",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\ud835\udd1a",wfr:"\ud835\udd34",Wopf:"\ud835\udd4e",wopf:"\ud835\udd68",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\ud835\udcb2",wscr:"\ud835\udccc",xcap:"\u22c2",xcirc:"\u25ef",xcup:"\u22c3",xdtri:"\u25bd",Xfr:"\ud835\udd1b",xfr:"\ud835\udd35",xharr:"\u27f7",xhArr:"\u27fa",Xi:"\u039e",xi:"\u03be",xlarr:"\u27f5",xlArr:"\u27f8",xmap:"\u27fc",xnis:"\u22fb",xodot:"\u2a00",Xopf:"\ud835\udd4f",xopf:"\ud835\udd69",xoplus:"\u2a01",xotime:"\u2a02",xrarr:"\u27f6",xrArr:"\u27f9",Xscr:"\ud835\udcb3",xscr:"\ud835\udccd",xsqcup:"\u2a06",xuplus:"\u2a04",xutri:"\u25b3",xvee:"\u22c1",xwedge:"\u22c0",Yacute:"\xdd",yacute:"\xfd",YAcy:"\u042f",yacy:"\u044f",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042b",ycy:"\u044b",yen:"\xa5",Yfr:"\ud835\udd1c",yfr:"\ud835\udd36",YIcy:"\u0407",yicy:"\u0457",Yopf:"\ud835\udd50",yopf:"\ud835\udd6a",Yscr:"\ud835\udcb4",yscr:"\ud835\udcce",YUcy:"\u042e",yucy:"\u044e",yuml:"\xff",Yuml:"\u0178",Zacute:"\u0179",zacute:"\u017a",Zcaron:"\u017d",zcaron:"\u017e",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017b",zdot:"\u017c",zeetrf:"\u2128",ZeroWidthSpace:"\u200b",Zeta:"\u0396",zeta:"\u03b6",zfr:"\ud835\udd37",Zfr:"\u2128",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21dd",zopf:"\ud835\udd6b",Zopf:"\u2124",Zscr:"\ud835\udcb5",zscr:"\ud835\udccf",zwj:"\u200d",zwnj:"\u200c"}},{}],72:[function(require,module,exports){module.exports={Aacute:"\xc1",aacute:"\xe1",Acirc:"\xc2",acirc:"\xe2",acute:"\xb4",AElig:"\xc6",aelig:"\xe6",Agrave:"\xc0",agrave:"\xe0",amp:"&",AMP:"&",Aring:"\xc5",aring:"\xe5",Atilde:"\xc3",atilde:"\xe3",Auml:"\xc4",auml:"\xe4",brvbar:"\xa6",Ccedil:"\xc7",ccedil:"\xe7",cedil:"\xb8",cent:"\xa2",copy:"\xa9",COPY:"\xa9",curren:"\xa4",deg:"\xb0",divide:"\xf7",Eacute:"\xc9",eacute:"\xe9",Ecirc:"\xca",ecirc:"\xea",Egrave:"\xc8",egrave:"\xe8",ETH:"\xd0",eth:"\xf0",Euml:"\xcb",euml:"\xeb",frac12:"\xbd",frac14:"\xbc",frac34:"\xbe",gt:">",GT:">",Iacute:"\xcd",iacute:"\xed",Icirc:"\xce",icirc:"\xee",iexcl:"\xa1",Igrave:"\xcc",igrave:"\xec",iquest:"\xbf",Iuml:"\xcf",iuml:"\xef",laquo:"\xab",lt:"<",LT:"<",macr:"\xaf",micro:"\xb5",middot:"\xb7",nbsp:"\xa0",not:"\xac",Ntilde:"\xd1",ntilde:"\xf1",Oacute:"\xd3",oacute:"\xf3",Ocirc:"\xd4",ocirc:"\xf4",Ograve:"\xd2",ograve:"\xf2",ordf:"\xaa",ordm:"\xba",Oslash:"\xd8",oslash:"\xf8",Otilde:"\xd5",otilde:"\xf5",Ouml:"\xd6",ouml:"\xf6",para:"\xb6",plusmn:"\xb1",pound:"\xa3",quot:'"',QUOT:'"',raquo:"\xbb",reg:"\xae",REG:"\xae",sect:"\xa7",shy:"\xad",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",szlig:"\xdf",THORN:"\xde",thorn:"\xfe",times:"\xd7",Uacute:"\xda",uacute:"\xfa",Ucirc:"\xdb",ucirc:"\xfb",Ugrave:"\xd9",ugrave:"\xf9",uml:"\xa8",Uuml:"\xdc",uuml:"\xfc",Yacute:"\xdd",yacute:"\xfd",yen:"\xa5",yuml:"\xff"}},{}],73:[function(require,module,exports){module.exports={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}},{}],74:[function(require,module,exports){function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(arg){return"function"==typeof arg}function isNumber(arg){return"number"==typeof arg}function isObject(arg){return"object"==typeof arg&&null!==arg}function isUndefined(arg){return void 0===arg}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");return this._maxListeners=n,this},EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(this._events||(this._events={}),"error"===type&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length)){if(er=arguments[1],er instanceof Error)throw er;var err=new Error('Uncaught, unspecified "error" event. ('+er+")");throw err.context=er,err}if(handler=this._events[type],isUndefined(handler))return!1;if(isFunction(handler))switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:args=Array.prototype.slice.call(arguments,1),handler.apply(this,args)}else if(isObject(handler))for(args=Array.prototype.slice.call(arguments,1),listeners=handler.slice(),len=listeners.length,i=0;i0&&this._events[type].length>m&&(this._events[type].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[type].length),"function"==typeof console.trace&&console.trace())),this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(type,listener){function g(){this.removeListener(type,g),fired||(fired=!0,listener.apply(this,arguments))}if(!isFunction(listener))throw TypeError("listener must be a function");var fired=!1;return g.listener=listener,this.on(type,g),this},EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;if(list=this._events[type],length=list.length,position=-1,list===listener||isFunction(list.listener)&&list.listener===listener)delete this._events[type],this._events.removeListener&&this.emit("removeListener",type,listener);else if(isObject(list)){for(i=length;i-- >0;)if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}if(position<0)return this;1===list.length?(list.length=0,delete this._events[type]):list.splice(position,1),this._events.removeListener&&this.emit("removeListener",type,listener)}return this},EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[type]&&delete this._events[type],this;if(0===arguments.length){for(key in this._events)"removeListener"!==key&&this.removeAllListeners(key);return this.removeAllListeners("removeListener"),this._events={},this}if(listeners=this._events[type],isFunction(listeners))this.removeListener(type,listeners);else if(listeners)for(;listeners.length;)this.removeListener(type,listeners[listeners.length-1]);return delete this._events[type],this},EventEmitter.prototype.listeners=function(type){var ret;return ret=this._events&&this._events[type]?isFunction(this._events[type])?[this._events[type]]:this._events[type].slice():[]},EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;if(evlistener)return evlistener.length}return 0},EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)}},{}],75:[function(require,module,exports){function CollectingHandler(cbs){this._cbs=cbs||{},this.events=[]}module.exports=CollectingHandler;var EVENTS=require("./").EVENTS;Object.keys(EVENTS).forEach(function(name){if(0===EVENTS[name])name="on"+name,CollectingHandler.prototype[name]=function(){this.events.push([name]),this._cbs[name]&&this._cbs[name]()};else if(1===EVENTS[name])name="on"+name,CollectingHandler.prototype[name]=function(a){this.events.push([name,a]),this._cbs[name]&&this._cbs[name](a)};else{if(2!==EVENTS[name])throw Error("wrong number of arguments");name="on"+name,CollectingHandler.prototype[name]=function(a,b){this.events.push([name,a,b]),this._cbs[name]&&this._cbs[name](a,b)}}}),CollectingHandler.prototype.onreset=function(){this.events=[],this._cbs.onreset&&this._cbs.onreset()},CollectingHandler.prototype.restart=function(){this._cbs.onreset&&this._cbs.onreset();for(var i=0,len=this.events.length;i0;this._cbs.onclosetag(this._stack[--i]));this._cbs.onend&&this._cbs.onend()},Parser.prototype.reset=function(){this._cbs.onreset&&this._cbs.onreset(),this._tokenizer.reset(),this._tagname="",this._attribname="",this._attribs=null,this._stack=[],this._cbs.onparserinit&&this._cbs.onparserinit(this)},Parser.prototype.parseComplete=function(data){this.reset(),this.end(data)},Parser.prototype.write=function(chunk){this._tokenizer.write(chunk)},Parser.prototype.end=function(chunk){this._tokenizer.end(chunk)},Parser.prototype.pause=function(){this._tokenizer.pause()},Parser.prototype.resume=function(){this._tokenizer.resume()},Parser.prototype.parseChunk=Parser.prototype.write,Parser.prototype.done=Parser.prototype.end,module.exports=Parser},{"./Tokenizer.js":80,events:74,inherits:84}],78:[function(require,module,exports){function ProxyHandler(cbs){this._cbs=cbs||{}}module.exports=ProxyHandler;var EVENTS=require("./").EVENTS;Object.keys(EVENTS).forEach(function(name){if(0===EVENTS[name])name="on"+name,ProxyHandler.prototype[name]=function(){this._cbs[name]&&this._cbs[name]()};else if(1===EVENTS[name])name="on"+name,ProxyHandler.prototype[name]=function(a){this._cbs[name]&&this._cbs[name](a)};else{if(2!==EVENTS[name])throw Error("wrong number of arguments");name="on"+name,ProxyHandler.prototype[name]=function(a,b){this._cbs[name]&&this._cbs[name](a,b)}}})},{"./":82}],79:[function(require,module,exports){function Stream(options){Parser.call(this,new Cbs(this),options)}function Cbs(scope){this.scope=scope; -}module.exports=Stream;var Parser=require("./WritableStream.js");require("inherits")(Stream,Parser),Stream.prototype.readable=!0;var EVENTS=require("../").EVENTS;Object.keys(EVENTS).forEach(function(name){if(0===EVENTS[name])Cbs.prototype["on"+name]=function(){this.scope.emit(name)};else if(1===EVENTS[name])Cbs.prototype["on"+name]=function(a){this.scope.emit(name,a)};else{if(2!==EVENTS[name])throw Error("wrong number of arguments!");Cbs.prototype["on"+name]=function(a,b){this.scope.emit(name,a,b)}}})},{"../":82,"./WritableStream.js":81,inherits:84}],80:[function(require,module,exports){function whitespace(c){return" "===c||"\n"===c||"\t"===c||"\f"===c||"\r"===c}function ifElseState(upper,SUCCESS,FAILURE){var lower=upper.toLowerCase();return upper===lower?function(c){c===lower?this._state=SUCCESS:(this._state=FAILURE,this._index--)}:function(c){c===lower||c===upper?this._state=SUCCESS:(this._state=FAILURE,this._index--)}}function consumeSpecialNameChar(upper,NEXT_STATE){var lower=upper.toLowerCase();return function(c){c===lower||c===upper?this._state=NEXT_STATE:(this._state=IN_TAG_NAME,this._index--)}}function Tokenizer(options,cbs){this._state=TEXT,this._buffer="",this._sectionStart=0,this._index=0,this._bufferOffset=0,this._baseState=TEXT,this._special=SPECIAL_NONE,this._cbs=cbs,this._running=!0,this._ended=!1,this._xmlMode=!(!options||!options.xmlMode),this._decodeEntities=!(!options||!options.decodeEntities)}module.exports=Tokenizer;var decodeCodePoint=require("entities/lib/decode_codepoint.js"),entityMap=require("entities/maps/entities.json"),legacyMap=require("entities/maps/legacy.json"),xmlMap=require("entities/maps/xml.json"),i=0,TEXT=i++,BEFORE_TAG_NAME=i++,IN_TAG_NAME=i++,IN_SELF_CLOSING_TAG=i++,BEFORE_CLOSING_TAG_NAME=i++,IN_CLOSING_TAG_NAME=i++,AFTER_CLOSING_TAG_NAME=i++,BEFORE_ATTRIBUTE_NAME=i++,IN_ATTRIBUTE_NAME=i++,AFTER_ATTRIBUTE_NAME=i++,BEFORE_ATTRIBUTE_VALUE=i++,IN_ATTRIBUTE_VALUE_DQ=i++,IN_ATTRIBUTE_VALUE_SQ=i++,IN_ATTRIBUTE_VALUE_NQ=i++,BEFORE_DECLARATION=i++,IN_DECLARATION=i++,IN_PROCESSING_INSTRUCTION=i++,BEFORE_COMMENT=i++,IN_COMMENT=i++,AFTER_COMMENT_1=i++,AFTER_COMMENT_2=i++,BEFORE_CDATA_1=i++,BEFORE_CDATA_2=i++,BEFORE_CDATA_3=i++,BEFORE_CDATA_4=i++,BEFORE_CDATA_5=i++,BEFORE_CDATA_6=i++,IN_CDATA=i++,AFTER_CDATA_1=i++,AFTER_CDATA_2=i++,BEFORE_SPECIAL=i++,BEFORE_SPECIAL_END=i++,BEFORE_SCRIPT_1=i++,BEFORE_SCRIPT_2=i++,BEFORE_SCRIPT_3=i++,BEFORE_SCRIPT_4=i++,BEFORE_SCRIPT_5=i++,AFTER_SCRIPT_1=i++,AFTER_SCRIPT_2=i++,AFTER_SCRIPT_3=i++,AFTER_SCRIPT_4=i++,AFTER_SCRIPT_5=i++,BEFORE_STYLE_1=i++,BEFORE_STYLE_2=i++,BEFORE_STYLE_3=i++,BEFORE_STYLE_4=i++,AFTER_STYLE_1=i++,AFTER_STYLE_2=i++,AFTER_STYLE_3=i++,AFTER_STYLE_4=i++,BEFORE_ENTITY=i++,BEFORE_NUMERIC_ENTITY=i++,IN_NAMED_ENTITY=i++,IN_NUMERIC_ENTITY=i++,IN_HEX_ENTITY=i++,j=0,SPECIAL_NONE=j++,SPECIAL_SCRIPT=j++,SPECIAL_STYLE=j++;Tokenizer.prototype._stateText=function(c){"<"===c?(this._index>this._sectionStart&&this._cbs.ontext(this._getSection()),this._state=BEFORE_TAG_NAME,this._sectionStart=this._index):this._decodeEntities&&this._special===SPECIAL_NONE&&"&"===c&&(this._index>this._sectionStart&&this._cbs.ontext(this._getSection()),this._baseState=TEXT,this._state=BEFORE_ENTITY,this._sectionStart=this._index)},Tokenizer.prototype._stateBeforeTagName=function(c){"/"===c?this._state=BEFORE_CLOSING_TAG_NAME:"<"===c?(this._cbs.ontext(this._getSection()),this._sectionStart=this._index):">"===c||this._special!==SPECIAL_NONE||whitespace(c)?this._state=TEXT:"!"===c?(this._state=BEFORE_DECLARATION,this._sectionStart=this._index+1):"?"===c?(this._state=IN_PROCESSING_INSTRUCTION,this._sectionStart=this._index+1):(this._state=this._xmlMode||"s"!==c&&"S"!==c?IN_TAG_NAME:BEFORE_SPECIAL,this._sectionStart=this._index)},Tokenizer.prototype._stateInTagName=function(c){("/"===c||">"===c||whitespace(c))&&(this._emitToken("onopentagname"),this._state=BEFORE_ATTRIBUTE_NAME,this._index--)},Tokenizer.prototype._stateBeforeCloseingTagName=function(c){whitespace(c)||(">"===c?this._state=TEXT:this._special!==SPECIAL_NONE?"s"===c||"S"===c?this._state=BEFORE_SPECIAL_END:(this._state=TEXT,this._index--):(this._state=IN_CLOSING_TAG_NAME,this._sectionStart=this._index))},Tokenizer.prototype._stateInCloseingTagName=function(c){(">"===c||whitespace(c))&&(this._emitToken("onclosetag"),this._state=AFTER_CLOSING_TAG_NAME,this._index--)},Tokenizer.prototype._stateAfterCloseingTagName=function(c){">"===c&&(this._state=TEXT,this._sectionStart=this._index+1)},Tokenizer.prototype._stateBeforeAttributeName=function(c){">"===c?(this._cbs.onopentagend(),this._state=TEXT,this._sectionStart=this._index+1):"/"===c?this._state=IN_SELF_CLOSING_TAG:whitespace(c)||(this._state=IN_ATTRIBUTE_NAME,this._sectionStart=this._index)},Tokenizer.prototype._stateInSelfClosingTag=function(c){">"===c?(this._cbs.onselfclosingtag(),this._state=TEXT,this._sectionStart=this._index+1):whitespace(c)||(this._state=BEFORE_ATTRIBUTE_NAME,this._index--)},Tokenizer.prototype._stateInAttributeName=function(c){("="===c||"/"===c||">"===c||whitespace(c))&&(this._cbs.onattribname(this._getSection()),this._sectionStart=-1,this._state=AFTER_ATTRIBUTE_NAME,this._index--)},Tokenizer.prototype._stateAfterAttributeName=function(c){"="===c?this._state=BEFORE_ATTRIBUTE_VALUE:"/"===c||">"===c?(this._cbs.onattribend(),this._state=BEFORE_ATTRIBUTE_NAME,this._index--):whitespace(c)||(this._cbs.onattribend(),this._state=IN_ATTRIBUTE_NAME,this._sectionStart=this._index)},Tokenizer.prototype._stateBeforeAttributeValue=function(c){'"'===c?(this._state=IN_ATTRIBUTE_VALUE_DQ,this._sectionStart=this._index+1):"'"===c?(this._state=IN_ATTRIBUTE_VALUE_SQ,this._sectionStart=this._index+1):whitespace(c)||(this._state=IN_ATTRIBUTE_VALUE_NQ,this._sectionStart=this._index,this._index--)},Tokenizer.prototype._stateInAttributeValueDoubleQuotes=function(c){'"'===c?(this._emitToken("onattribdata"),this._cbs.onattribend(),this._state=BEFORE_ATTRIBUTE_NAME):this._decodeEntities&&"&"===c&&(this._emitToken("onattribdata"),this._baseState=this._state,this._state=BEFORE_ENTITY,this._sectionStart=this._index)},Tokenizer.prototype._stateInAttributeValueSingleQuotes=function(c){"'"===c?(this._emitToken("onattribdata"),this._cbs.onattribend(),this._state=BEFORE_ATTRIBUTE_NAME):this._decodeEntities&&"&"===c&&(this._emitToken("onattribdata"),this._baseState=this._state,this._state=BEFORE_ENTITY,this._sectionStart=this._index)},Tokenizer.prototype._stateInAttributeValueNoQuotes=function(c){whitespace(c)||">"===c?(this._emitToken("onattribdata"),this._cbs.onattribend(),this._state=BEFORE_ATTRIBUTE_NAME,this._index--):this._decodeEntities&&"&"===c&&(this._emitToken("onattribdata"),this._baseState=this._state,this._state=BEFORE_ENTITY,this._sectionStart=this._index)},Tokenizer.prototype._stateBeforeDeclaration=function(c){this._state="["===c?BEFORE_CDATA_1:"-"===c?BEFORE_COMMENT:IN_DECLARATION},Tokenizer.prototype._stateInDeclaration=function(c){">"===c&&(this._cbs.ondeclaration(this._getSection()),this._state=TEXT,this._sectionStart=this._index+1)},Tokenizer.prototype._stateInProcessingInstruction=function(c){">"===c&&(this._cbs.onprocessinginstruction(this._getSection()),this._state=TEXT,this._sectionStart=this._index+1)},Tokenizer.prototype._stateBeforeComment=function(c){"-"===c?(this._state=IN_COMMENT,this._sectionStart=this._index+1):this._state=IN_DECLARATION},Tokenizer.prototype._stateInComment=function(c){"-"===c&&(this._state=AFTER_COMMENT_1)},Tokenizer.prototype._stateAfterComment1=function(c){"-"===c?this._state=AFTER_COMMENT_2:this._state=IN_COMMENT},Tokenizer.prototype._stateAfterComment2=function(c){">"===c?(this._cbs.oncomment(this._buffer.substring(this._sectionStart,this._index-2)),this._state=TEXT,this._sectionStart=this._index+1):"-"!==c&&(this._state=IN_COMMENT)},Tokenizer.prototype._stateBeforeCdata1=ifElseState("C",BEFORE_CDATA_2,IN_DECLARATION),Tokenizer.prototype._stateBeforeCdata2=ifElseState("D",BEFORE_CDATA_3,IN_DECLARATION),Tokenizer.prototype._stateBeforeCdata3=ifElseState("A",BEFORE_CDATA_4,IN_DECLARATION),Tokenizer.prototype._stateBeforeCdata4=ifElseState("T",BEFORE_CDATA_5,IN_DECLARATION),Tokenizer.prototype._stateBeforeCdata5=ifElseState("A",BEFORE_CDATA_6,IN_DECLARATION),Tokenizer.prototype._stateBeforeCdata6=function(c){"["===c?(this._state=IN_CDATA,this._sectionStart=this._index+1):(this._state=IN_DECLARATION,this._index--)},Tokenizer.prototype._stateInCdata=function(c){"]"===c&&(this._state=AFTER_CDATA_1)},Tokenizer.prototype._stateAfterCdata1=function(c){"]"===c?this._state=AFTER_CDATA_2:this._state=IN_CDATA},Tokenizer.prototype._stateAfterCdata2=function(c){">"===c?(this._cbs.oncdata(this._buffer.substring(this._sectionStart,this._index-2)),this._state=TEXT,this._sectionStart=this._index+1):"]"!==c&&(this._state=IN_CDATA)},Tokenizer.prototype._stateBeforeSpecial=function(c){"c"===c||"C"===c?this._state=BEFORE_SCRIPT_1:"t"===c||"T"===c?this._state=BEFORE_STYLE_1:(this._state=IN_TAG_NAME,this._index--)},Tokenizer.prototype._stateBeforeSpecialEnd=function(c){this._special!==SPECIAL_SCRIPT||"c"!==c&&"C"!==c?this._special!==SPECIAL_STYLE||"t"!==c&&"T"!==c?this._state=TEXT:this._state=AFTER_STYLE_1:this._state=AFTER_SCRIPT_1},Tokenizer.prototype._stateBeforeScript1=consumeSpecialNameChar("R",BEFORE_SCRIPT_2),Tokenizer.prototype._stateBeforeScript2=consumeSpecialNameChar("I",BEFORE_SCRIPT_3),Tokenizer.prototype._stateBeforeScript3=consumeSpecialNameChar("P",BEFORE_SCRIPT_4),Tokenizer.prototype._stateBeforeScript4=consumeSpecialNameChar("T",BEFORE_SCRIPT_5),Tokenizer.prototype._stateBeforeScript5=function(c){("/"===c||">"===c||whitespace(c))&&(this._special=SPECIAL_SCRIPT),this._state=IN_TAG_NAME,this._index--},Tokenizer.prototype._stateAfterScript1=ifElseState("R",AFTER_SCRIPT_2,TEXT),Tokenizer.prototype._stateAfterScript2=ifElseState("I",AFTER_SCRIPT_3,TEXT),Tokenizer.prototype._stateAfterScript3=ifElseState("P",AFTER_SCRIPT_4,TEXT),Tokenizer.prototype._stateAfterScript4=ifElseState("T",AFTER_SCRIPT_5,TEXT),Tokenizer.prototype._stateAfterScript5=function(c){">"===c||whitespace(c)?(this._special=SPECIAL_NONE,this._state=IN_CLOSING_TAG_NAME,this._sectionStart=this._index-6,this._index--):this._state=TEXT},Tokenizer.prototype._stateBeforeStyle1=consumeSpecialNameChar("Y",BEFORE_STYLE_2),Tokenizer.prototype._stateBeforeStyle2=consumeSpecialNameChar("L",BEFORE_STYLE_3),Tokenizer.prototype._stateBeforeStyle3=consumeSpecialNameChar("E",BEFORE_STYLE_4),Tokenizer.prototype._stateBeforeStyle4=function(c){("/"===c||">"===c||whitespace(c))&&(this._special=SPECIAL_STYLE),this._state=IN_TAG_NAME,this._index--},Tokenizer.prototype._stateAfterStyle1=ifElseState("Y",AFTER_STYLE_2,TEXT),Tokenizer.prototype._stateAfterStyle2=ifElseState("L",AFTER_STYLE_3,TEXT),Tokenizer.prototype._stateAfterStyle3=ifElseState("E",AFTER_STYLE_4,TEXT),Tokenizer.prototype._stateAfterStyle4=function(c){">"===c||whitespace(c)?(this._special=SPECIAL_NONE,this._state=IN_CLOSING_TAG_NAME,this._sectionStart=this._index-5,this._index--):this._state=TEXT},Tokenizer.prototype._stateBeforeEntity=ifElseState("#",BEFORE_NUMERIC_ENTITY,IN_NAMED_ENTITY),Tokenizer.prototype._stateBeforeNumericEntity=ifElseState("X",IN_HEX_ENTITY,IN_NUMERIC_ENTITY),Tokenizer.prototype._parseNamedEntityStrict=function(){if(this._sectionStart+16&&(limit=6);limit>=2;){var entity=this._buffer.substr(start,limit);if(legacyMap.hasOwnProperty(entity))return this._emitPartial(legacyMap[entity]),void(this._sectionStart+=limit+1);limit--}},Tokenizer.prototype._stateInNamedEntity=function(c){";"===c?(this._parseNamedEntityStrict(),this._sectionStart+1"z")&&(c<"A"||c>"Z")&&(c<"0"||c>"9")&&(this._xmlMode||this._sectionStart+1===this._index||(this._baseState!==TEXT?"="!==c&&this._parseNamedEntityStrict():this._parseLegacyEntity()),this._state=this._baseState,this._index--)},Tokenizer.prototype._decodeNumericEntity=function(offset,base){var sectionStart=this._sectionStart+offset;if(sectionStart!==this._index){var entity=this._buffer.substring(sectionStart,this._index),parsed=parseInt(entity,base);this._emitPartial(decodeCodePoint(parsed)),this._sectionStart=this._index}else this._sectionStart--;this._state=this._baseState},Tokenizer.prototype._stateInNumericEntity=function(c){";"===c?(this._decodeNumericEntity(2,10),this._sectionStart++):(c<"0"||c>"9")&&(this._xmlMode?this._state=this._baseState:this._decodeNumericEntity(2,10),this._index--)},Tokenizer.prototype._stateInHexEntity=function(c){";"===c?(this._decodeNumericEntity(3,16),this._sectionStart++):(c<"a"||c>"f")&&(c<"A"||c>"F")&&(c<"0"||c>"9")&&(this._xmlMode?this._state=this._baseState:this._decodeNumericEntity(3,16),this._index--)},Tokenizer.prototype._cleanup=function(){this._sectionStart<0?(this._buffer="",this._bufferOffset+=this._index,this._index=0):this._running&&(this._state===TEXT?(this._sectionStart!==this._index&&this._cbs.ontext(this._buffer.substr(this._sectionStart)),this._buffer="",this._bufferOffset+=this._index,this._index=0):this._sectionStart===this._index?(this._buffer="",this._bufferOffset+=this._index,this._index=0):(this._buffer=this._buffer.substr(this._sectionStart),this._index-=this._sectionStart,this._bufferOffset+=this._sectionStart),this._sectionStart=0)},Tokenizer.prototype.write=function(chunk){this._ended&&this._cbs.onerror(Error(".write() after done!")),this._buffer+=chunk,this._parse()},Tokenizer.prototype._parse=function(){for(;this._index>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];for(i+=d,e=s&(1<<-nBits)-1,s>>=-nBits,nBits+=eLen;nBits>0;e=256*e+buffer[offset+i],i+=d,nBits-=8);for(m=e&(1<<-nBits)-1,e>>=-nBits,nBits+=mLen;nBits>0;m=256*m+buffer[offset+i],i+=d,nBits-=8);if(0===e)e=1-eBias;else{if(e===eMax)return m?NaN:(s?-1:1)*(1/0);m+=Math.pow(2,mLen),e-=eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)},exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=8*nBytes-mLen-1,eMax=(1<>1,rt=23===mLen?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||0===value&&1/value<0?1:0;for(value=Math.abs(value),isNaN(value)||value===1/0?(m=isNaN(value)?1:0,e=eMax):(e=Math.floor(Math.log(value)/Math.LN2),value*(c=Math.pow(2,-e))<1&&(e--,c*=2),value+=e+eBias>=1?rt/c:rt*Math.pow(2,1-eBias),value*c>=2&&(e++,c/=2),e+eBias>=eMax?(m=0,e=eMax):e+eBias>=1?(m=(value*c-1)*Math.pow(2,mLen),e+=eBias):(m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen),e=0));mLen>=8;buffer[offset+i]=255&m,i+=d,m/=256,mLen-=8);for(e=e<0;buffer[offset+i]=255&e,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=128*s}},{}],84:[function(require,module,exports){"function"==typeof Object.create?module.exports=function(ctor,superCtor){superCtor&&(ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}}))}:module.exports=function(ctor,superCtor){if(superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}}},{}],85:[function(require,module,exports){function isBuffer(obj){return!!obj.constructor&&"function"==typeof obj.constructor.isBuffer&&obj.constructor.isBuffer(obj)}function isSlowBuffer(obj){return"function"==typeof obj.readFloatLE&&"function"==typeof obj.slice&&isBuffer(obj.slice(0,0))}module.exports=function(obj){return null!=obj&&(isBuffer(obj)||isSlowBuffer(obj)||!!obj._isBuffer)}},{}],86:[function(require,module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return"[object Array]"==toString.call(arr)}},{}],87:[function(require,module,exports){(function(global){!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory(global):"function"==typeof define&&define.amd?define(factory):factory(global)}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:this,function(global){"use strict";global=global||{};var fromUint8Array,_Base64=global.Base64,version="2.6.3",b64chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b64tab=function(bin){for(var t={},i=0,l=bin.length;i>>6)+fromCharCode(128|63&cc):fromCharCode(224|cc>>>12&15)+fromCharCode(128|cc>>>6&63)+fromCharCode(128|63&cc)}var cc=65536+1024*(c.charCodeAt(0)-55296)+(c.charCodeAt(1)-56320);return fromCharCode(240|cc>>>18&7)+fromCharCode(128|cc>>>12&63)+fromCharCode(128|cc>>>6&63)+fromCharCode(128|63&cc)},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=function(u){return u.replace(re_utob,cb_utob)},cb_encode=function(ccc){var padlen=[0,2,1][ccc.length%3],ord=ccc.charCodeAt(0)<<16|(ccc.length>1?ccc.charCodeAt(1):0)<<8|(ccc.length>2?ccc.charCodeAt(2):0),chars=[b64chars.charAt(ord>>>18),b64chars.charAt(ord>>>12&63),padlen>=2?"=":b64chars.charAt(ord>>>6&63),padlen>=1?"=":b64chars.charAt(63&ord)];return chars.join("")},btoa=global.btoa&&"function"==typeof global.btoa?function(b){return global.btoa(b)}:function(b){if(b.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return b.replace(/[\s\S]{1,3}/g,cb_encode)},_encode=function(u){return btoa(utob(String(u)))},mkUriSafe=function(b64){return b64.replace(/[+\/]/g,function(m0){return"+"==m0?"-":"_"}).replace(/=/g,"")},encode=function(u,urisafe){return urisafe?mkUriSafe(_encode(u)):_encode(u)},encodeURI=function(u){return encode(u,!0)};global.Uint8Array&&(fromUint8Array=function(a,urisafe){for(var b64="",i=0,l=a.length;i>>18)+b64chars.charAt(ord>>>12&63)+("undefined"!=typeof a1?b64chars.charAt(ord>>>6&63):"=")+("undefined"!=typeof a2?b64chars.charAt(63&ord):"=")}return urisafe?mkUriSafe(b64):b64});var toUint8Array,re_btou=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,cb_btou=function(cccc){switch(cccc.length){case 4:var cp=(7&cccc.charCodeAt(0))<<18|(63&cccc.charCodeAt(1))<<12|(63&cccc.charCodeAt(2))<<6|63&cccc.charCodeAt(3),offset=cp-65536;return fromCharCode((offset>>>10)+55296)+fromCharCode((1023&offset)+56320);case 3:return fromCharCode((15&cccc.charCodeAt(0))<<12|(63&cccc.charCodeAt(1))<<6|63&cccc.charCodeAt(2));default:return fromCharCode((31&cccc.charCodeAt(0))<<6|63&cccc.charCodeAt(1))}},btou=function(b){return b.replace(re_btou,cb_btou)},cb_decode=function(cccc){var len=cccc.length,padlen=len%4,n=(len>0?b64tab[cccc.charAt(0)]<<18:0)|(len>1?b64tab[cccc.charAt(1)]<<12:0)|(len>2?b64tab[cccc.charAt(2)]<<6:0)|(len>3?b64tab[cccc.charAt(3)]:0),chars=[fromCharCode(n>>>16),fromCharCode(n>>>8&255),fromCharCode(255&n)];return chars.length-=[0,0,2,1][padlen],chars.join("")},_atob=global.atob&&"function"==typeof global.atob?function(a){return global.atob(a)}:function(a){return a.replace(/\S{1,4}/g,cb_decode)},atob=function(a){return _atob(String(a).replace(/[^A-Za-z0-9\+\/]/g,""))},_decode=function(a){return btou(_atob(a))},_fromURI=function(a){return String(a).replace(/[-_]/g,function(m0){return"-"==m0?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},decode=function(a){return _decode(_fromURI(a))};global.Uint8Array&&(toUint8Array=function(a){return Uint8Array.from(atob(_fromURI(a)),function(c){return c.charCodeAt(0)})});var noConflict=function(){var Base64=global.Base64;return global.Base64=_Base64,Base64};if(global.Base64={VERSION:version,atob:atob,btoa:btoa,fromBase64:decode,toBase64:encode,utob:utob,encode:encode,encodeURI:encodeURI,btou:btou,decode:decode,noConflict:noConflict,fromUint8Array:fromUint8Array,toUint8Array:toUint8Array},"function"==typeof Object.defineProperty){var noEnum=function(v){return{value:v,enumerable:!1,writable:!0,configurable:!0}};global.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",noEnum(function(){return decode(this)})),Object.defineProperty(String.prototype,"toBase64",noEnum(function(urisafe){return encode(this,urisafe)})),Object.defineProperty(String.prototype,"toBase64URI",noEnum(function(){return encode(this,!0)}))}}return global.Meteor&&(Base64=global.Base64),"undefined"!=typeof module&&module.exports?module.exports.Base64=global.Base64:"function"==typeof define&&define.amd&&define([],function(){return global.Base64}),{Base64:global.Base64}})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],88:[function(require,module,exports){var getNative=require("./_getNative"),root=require("./_root"),DataView=getNative(root,"DataView");module.exports=DataView},{"./_getNative":190,"./_root":239}],89:[function(require,module,exports){function Hash(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index-1}var baseIndexOf=require("./_baseIndexOf");module.exports=arrayIncludes},{"./_baseIndexOf":126}],106:[function(require,module,exports){function arrayLikeKeys(value,inherited){var isArr=isArray(value),isArg=!isArr&&isArguments(value),isBuff=!isArr&&!isArg&&isBuffer(value),isType=!isArr&&!isArg&&!isBuff&&isTypedArray(value),skipIndexes=isArr||isArg||isBuff||isType,result=skipIndexes?baseTimes(value.length,String):[],length=result.length;for(var key in value)!inherited&&!hasOwnProperty.call(value,key)||skipIndexes&&("length"==key||isBuff&&("offset"==key||"parent"==key)||isType&&("buffer"==key||"byteLength"==key||"byteOffset"==key)||isIndex(key,length))||result.push(key);return result}var baseTimes=require("./_baseTimes"),isArguments=require("./isArguments"),isArray=require("./isArray"),isBuffer=require("./isBuffer"),isIndex=require("./_isIndex"),isTypedArray=require("./isTypedArray"),objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;module.exports=arrayLikeKeys},{"./_baseTimes":153,"./_isIndex":206,"./isArguments":271,"./isArray":272,"./isBuffer":275,"./isTypedArray":282}],107:[function(require,module,exports){function arrayMap(array,iteratee){for(var index=-1,length=null==array?0:array.length,result=Array(length);++index0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}var arrayPush=require("./_arrayPush"),isFlattenable=require("./_isFlattenable");module.exports=baseFlatten},{"./_arrayPush":108,"./_isFlattenable":205}],120:[function(require,module,exports){var createBaseFor=require("./_createBaseFor"),baseFor=createBaseFor();module.exports=baseFor},{"./_createBaseFor":170}],121:[function(require,module,exports){function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}var baseFor=require("./_baseFor"),keys=require("./keys");module.exports=baseForOwn},{"./_baseFor":120,"./keys":283}],122:[function(require,module,exports){function baseGet(object,path){path=castPath(path,object);for(var index=0,length=path.length;null!=object&&index1?sources[length-1]:void 0,guard=length>2?sources[2]:void 0;for(customizer=assigner.length>3&&"function"==typeof customizer?(length--,customizer):void 0,guard&&isIterateeCall(sources[0],sources[1],guard)&&(customizer=length<3?void 0:customizer,length=1),object=Object(object);++index1&&args.reverse(),isAry&&aryarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&COMPARE_UNORDERED_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index1?"& ":"")+details[lastIndex],details=details.join(length>2?", ":" "),source.replace(reWrapComment,"{\n/* [wrapped with "+details+"] */\n")}var reWrapComment=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;module.exports=insertWrapDetails},{}],205:[function(require,module,exports){function isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol])}var Symbol=require("./_Symbol"),isArguments=require("./isArguments"),isArray=require("./isArray"),spreadableSymbol=Symbol?Symbol.isConcatSpreadable:void 0;module.exports=isFlattenable},{"./_Symbol":99,"./isArguments":271,"./isArray":272}],206:[function(require,module,exports){function isIndex(value,length){var type=typeof value;return length=null==length?MAX_SAFE_INTEGER:length,!!length&&("number"==type||"symbol"!=type&&reIsUint.test(value))&&value>-1&&value%1==0&&value-1}var assocIndexOf=require("./_assocIndexOf");module.exports=listCacheHas},{"./_assocIndexOf":113}],218:[function(require,module,exports){function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this}var assocIndexOf=require("./_assocIndexOf");module.exports=listCacheSet},{"./_assocIndexOf":113}],219:[function(require,module,exports){function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}var Hash=require("./_Hash"),ListCache=require("./_ListCache"),Map=require("./_Map");module.exports=mapCacheClear},{"./_Hash":89,"./_ListCache":91,"./_Map":93}],220:[function(require,module,exports){function mapCacheDelete(key){var result=getMapData(this,key)["delete"](key);return this.size-=result?1:0,result}var getMapData=require("./_getMapData");module.exports=mapCacheDelete},{"./_getMapData":188}],221:[function(require,module,exports){function mapCacheGet(key){return getMapData(this,key).get(key)}var getMapData=require("./_getMapData");module.exports=mapCacheGet},{"./_getMapData":188}],222:[function(require,module,exports){function mapCacheHas(key){return getMapData(this,key).has(key)}var getMapData=require("./_getMapData");module.exports=mapCacheHas},{"./_getMapData":188}],223:[function(require,module,exports){function mapCacheSet(key,value){var data=getMapData(this,key),size=data.size;return data.set(key,value),this.size+=data.size==size?0:1,this}var getMapData=require("./_getMapData");module.exports=mapCacheSet},{"./_getMapData":188}],224:[function(require,module,exports){function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach(function(value,key){result[++index]=[key,value]}),result}module.exports=mapToArray},{}],225:[function(require,module,exports){function matchesStrictComparable(key,srcValue){return function(object){return null!=object&&(object[key]===srcValue&&(void 0!==srcValue||key in Object(object)))}}module.exports=matchesStrictComparable},{}],226:[function(require,module,exports){function memoizeCapped(func){var result=memoize(func,function(key){return cache.size===MAX_MEMOIZE_SIZE&&cache.clear(),key}),cache=result.cache;return result}var memoize=require("./memoize"),MAX_MEMOIZE_SIZE=500;module.exports=memoizeCapped},{"./memoize":286}],227:[function(require,module,exports){function mergeData(data,source){var bitmask=data[1],srcBitmask=source[1],newBitmask=bitmask|srcBitmask,isCommon=newBitmask<(WRAP_BIND_FLAG|WRAP_BIND_KEY_FLAG|WRAP_ARY_FLAG),isCombo=srcBitmask==WRAP_ARY_FLAG&&bitmask==WRAP_CURRY_FLAG||srcBitmask==WRAP_ARY_FLAG&&bitmask==WRAP_REARG_FLAG&&data[7].length<=source[8]||srcBitmask==(WRAP_ARY_FLAG|WRAP_REARG_FLAG)&&source[7].length<=source[8]&&bitmask==WRAP_CURRY_FLAG;if(!isCommon&&!isCombo)return data;srcBitmask&WRAP_BIND_FLAG&&(data[2]=source[2],newBitmask|=bitmask&WRAP_BIND_FLAG?0:WRAP_CURRY_BOUND_FLAG);var value=source[3];if(value){var partials=data[3];data[3]=partials?composeArgs(partials,value,source[4]):value,data[4]=partials?replaceHolders(data[3],PLACEHOLDER):source[4]}return value=source[5],value&&(partials=data[5],data[5]=partials?composeArgsRight(partials,value,source[6]):value,data[6]=partials?replaceHolders(data[5],PLACEHOLDER):source[6]),value=source[7],value&&(data[7]=value),srcBitmask&WRAP_ARY_FLAG&&(data[8]=null==data[8]?source[8]:nativeMin(data[8],source[8])),null==data[9]&&(data[9]=source[9]),data[0]=source[0],data[1]=newBitmask,data}var composeArgs=require("./_composeArgs"),composeArgsRight=require("./_composeArgsRight"),replaceHolders=require("./_replaceHolders"),PLACEHOLDER="__lodash_placeholder__",WRAP_BIND_FLAG=1,WRAP_BIND_KEY_FLAG=2,WRAP_CURRY_BOUND_FLAG=4,WRAP_CURRY_FLAG=8,WRAP_ARY_FLAG=128,WRAP_REARG_FLAG=256,nativeMin=Math.min;module.exports=mergeData},{"./_composeArgs":162,"./_composeArgsRight":163,"./_replaceHolders":238}],228:[function(require,module,exports){var WeakMap=require("./_WeakMap"),metaMap=WeakMap&&new WeakMap;module.exports=metaMap},{"./_WeakMap":101}],229:[function(require,module,exports){var getNative=require("./_getNative"),nativeCreate=getNative(Object,"create"); -module.exports=nativeCreate},{"./_getNative":190}],230:[function(require,module,exports){var overArg=require("./_overArg"),nativeKeys=overArg(Object.keys,Object);module.exports=nativeKeys},{"./_overArg":234}],231:[function(require,module,exports){function nativeKeysIn(object){var result=[];if(null!=object)for(var key in Object(object))result.push(key);return result}module.exports=nativeKeysIn},{}],232:[function(require,module,exports){var freeGlobal=require("./_freeGlobal"),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{var types=freeModule&&freeModule.require&&freeModule.require("util").types;return types?types:freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}();module.exports=nodeUtil},{"./_freeGlobal":183}],233:[function(require,module,exports){function objectToString(value){return nativeObjectToString.call(value)}var objectProto=Object.prototype,nativeObjectToString=objectProto.toString;module.exports=objectToString},{}],234:[function(require,module,exports){function overArg(func,transform){return function(arg){return func(transform(arg))}}module.exports=overArg},{}],235:[function(require,module,exports){function overRest(func,start,transform){return start=nativeMax(void 0===start?func.length-1:start,0),function(){for(var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);++index0){if(++count>=HOT_COUNT)return arguments[0]}else count=0;return func.apply(void 0,arguments)}}var HOT_COUNT=800,HOT_SPAN=16,nativeNow=Date.now;module.exports=shortOut},{}],248:[function(require,module,exports){function stackClear(){this.__data__=new ListCache,this.size=0}var ListCache=require("./_ListCache");module.exports=stackClear},{"./_ListCache":91}],249:[function(require,module,exports){function stackDelete(key){var data=this.__data__,result=data["delete"](key);return this.size=data.size,result}module.exports=stackDelete},{}],250:[function(require,module,exports){function stackGet(key){return this.__data__.get(key)}module.exports=stackGet},{}],251:[function(require,module,exports){function stackHas(key){return this.__data__.has(key)}module.exports=stackHas},{}],252:[function(require,module,exports){function stackSet(key,value){var data=this.__data__;if(data instanceof ListCache){var pairs=data.__data__;if(!Map||pairs.length2?sources[2]:void 0;for(guard&&isIterateeCall(sources[0],sources[1],guard)&&(length=1);++index-1&&value%1==0&&value<=MAX_SAFE_INTEGER}var MAX_SAFE_INTEGER=9007199254740991;module.exports=isLength},{}],278:[function(require,module,exports){function isObject(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}module.exports=isObject},{}],279:[function(require,module,exports){function isObjectLike(value){return null!=value&&"object"==typeof value}module.exports=isObjectLike},{}],280:[function(require,module,exports){function isPlainObject(value){if(!isObjectLike(value)||baseGetTag(value)!=objectTag)return!1;var proto=getPrototype(value);if(null===proto)return!0;var Ctor=hasOwnProperty.call(proto,"constructor")&&proto.constructor;return"function"==typeof Ctor&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString}var baseGetTag=require("./_baseGetTag"),getPrototype=require("./_getPrototype"),isObjectLike=require("./isObjectLike"),objectTag="[object Object]",funcProto=Function.prototype,objectProto=Object.prototype,funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectCtorString=funcToString.call(Object);module.exports=isPlainObject},{"./_baseGetTag":124,"./_getPrototype":191,"./isObjectLike":279}],281:[function(require,module,exports){function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&baseGetTag(value)==symbolTag}var baseGetTag=require("./_baseGetTag"),isObjectLike=require("./isObjectLike"),symbolTag="[object Symbol]";module.exports=isSymbol},{"./_baseGetTag":124,"./isObjectLike":279}],282:[function(require,module,exports){var baseIsTypedArray=require("./_baseIsTypedArray"),baseUnary=require("./_baseUnary"),nodeUtil=require("./_nodeUtil"),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;module.exports=isTypedArray},{"./_baseIsTypedArray":133,"./_baseUnary":155,"./_nodeUtil":232}],283:[function(require,module,exports){function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}var arrayLikeKeys=require("./_arrayLikeKeys"),baseKeys=require("./_baseKeys"),isArrayLike=require("./isArrayLike");module.exports=keys},{"./_arrayLikeKeys":106,"./_baseKeys":135,"./isArrayLike":273}],284:[function(require,module,exports){function keysIn(object){return isArrayLike(object)?arrayLikeKeys(object,!0):baseKeysIn(object)}var arrayLikeKeys=require("./_arrayLikeKeys"),baseKeysIn=require("./_baseKeysIn"),isArrayLike=require("./isArrayLike");module.exports=keysIn},{"./_arrayLikeKeys":106,"./_baseKeysIn":136,"./isArrayLike":273}],285:[function(require,module,exports){function map(collection,iteratee){var func=isArray(collection)?arrayMap:baseMap;return func(collection,baseIteratee(iteratee,3))}var arrayMap=require("./_arrayMap"),baseIteratee=require("./_baseIteratee"),baseMap=require("./_baseMap"),isArray=require("./isArray");module.exports=map},{"./_arrayMap":107,"./_baseIteratee":134,"./_baseMap":138,"./isArray":272}],286:[function(require,module,exports){function memoize(func,resolver){if("function"!=typeof func||null!=resolver&&"function"!=typeof resolver)throw new TypeError(FUNC_ERROR_TEXT);var memoized=function(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key))return cache.get(key);var result=func.apply(this,args);return memoized.cache=cache.set(key,result)||cache,result};return memoized.cache=new(memoize.Cache||MapCache),memoized}var MapCache=require("./_MapCache"),FUNC_ERROR_TEXT="Expected a function";memoize.Cache=MapCache,module.exports=memoize},{"./_MapCache":94}],287:[function(require,module,exports){var baseMerge=require("./_baseMerge"),createAssigner=require("./_createAssigner"),merge=createAssigner(function(object,source,srcIndex){baseMerge(object,source,srcIndex)});module.exports=merge},{"./_baseMerge":141,"./_createAssigner":168}],288:[function(require,module,exports){function negate(predicate){if("function"!=typeof predicate)throw new TypeError(FUNC_ERROR_TEXT);return function(){var args=arguments;switch(args.length){case 0:return!predicate.call(this);case 1:return!predicate.call(this,args[0]);case 2:return!predicate.call(this,args[0],args[1]);case 3:return!predicate.call(this,args[0],args[1],args[2])}return!predicate.apply(this,args)}}var FUNC_ERROR_TEXT="Expected a function";module.exports=negate},{}],289:[function(require,module,exports){function noop(){}module.exports=noop},{}],290:[function(require,module,exports){var basePick=require("./_basePick"),flatRest=require("./_flatRest"),pick=flatRest(function(object,paths){return null==object?{}:basePick(object,paths)});module.exports=pick},{"./_basePick":143,"./_flatRest":182}],291:[function(require,module,exports){function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var baseProperty=require("./_baseProperty"),basePropertyDeep=require("./_basePropertyDeep"),isKey=require("./_isKey"),toKey=require("./_toKey");module.exports=property},{"./_baseProperty":145,"./_basePropertyDeep":146,"./_isKey":208,"./_toKey":255}],292:[function(require,module,exports){function reduce(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduce:baseReduce,initAccum=arguments.length<3;return func(collection,baseIteratee(iteratee,4),accumulator,initAccum,baseEach)}var arrayReduce=require("./_arrayReduce"),baseEach=require("./_baseEach"),baseIteratee=require("./_baseIteratee"),baseReduce=require("./_baseReduce"),isArray=require("./isArray");module.exports=reduce},{"./_arrayReduce":109,"./_baseEach":116,"./_baseIteratee":134,"./_baseReduce":147,"./isArray":272}],293:[function(require,module,exports){function reject(collection,predicate){var func=isArray(collection)?arrayFilter:baseFilter;return func(collection,negate(baseIteratee(predicate,3)))}var arrayFilter=require("./_arrayFilter"),baseFilter=require("./_baseFilter"),baseIteratee=require("./_baseIteratee"),isArray=require("./isArray"),negate=require("./negate");module.exports=reject},{"./_arrayFilter":104,"./_baseFilter":117,"./_baseIteratee":134,"./isArray":272,"./negate":288}],294:[function(require,module,exports){function some(collection,predicate,guard){var func=isArray(collection)?arraySome:baseSome;return guard&&isIterateeCall(collection,predicate,guard)&&(predicate=void 0),func(collection,baseIteratee(predicate,3))}var arraySome=require("./_arraySome"),baseIteratee=require("./_baseIteratee"),baseSome=require("./_baseSome"),isArray=require("./isArray"),isIterateeCall=require("./_isIterateeCall");module.exports=some},{"./_arraySome":110,"./_baseIteratee":134,"./_baseSome":152,"./_isIterateeCall":207,"./isArray":272}],295:[function(require,module,exports){function stubArray(){return[]}module.exports=stubArray},{}],296:[function(require,module,exports){function stubFalse(){return!1}module.exports=stubFalse},{}],297:[function(require,module,exports){function toFinite(value){if(!value)return 0===value?value:0;if(value=toNumber(value),value===INFINITY||value===-INFINITY){var sign=value<0?-1:1;return sign*MAX_INTEGER}return value===value?value:0}var toNumber=require("./toNumber"),INFINITY=1/0,MAX_INTEGER=1.7976931348623157e308;module.exports=toFinite},{"./toNumber":299}],298:[function(require,module,exports){function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0}var toFinite=require("./toFinite");module.exports=toInteger},{"./toFinite":297}],299:[function(require,module,exports){function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}var isObject=require("./isObject"),isSymbol=require("./isSymbol"),NAN=NaN,reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt;module.exports=toNumber},{"./isObject":278,"./isSymbol":281}],300:[function(require,module,exports){function toPlainObject(value){return copyObject(value,keysIn(value))}var copyObject=require("./_copyObject"),keysIn=require("./keysIn");module.exports=toPlainObject},{"./_copyObject":165,"./keysIn":284}],301:[function(require,module,exports){function toString(value){return null==value?"":baseToString(value)}var baseToString=require("./_baseToString");module.exports=toString},{"./_baseToString":154}],302:[function(require,module,exports){function lodash(value){if(isObjectLike(value)&&!isArray(value)&&!(value instanceof LazyWrapper)){if(value instanceof LodashWrapper)return value;if(hasOwnProperty.call(value,"__wrapped__"))return wrapperClone(value)}return new LodashWrapper(value)}var LazyWrapper=require("./_LazyWrapper"),LodashWrapper=require("./_LodashWrapper"),baseLodash=require("./_baseLodash"),isArray=require("./isArray"),isObjectLike=require("./isObjectLike"),wrapperClone=require("./_wrapperClone"),objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;lodash.prototype=baseLodash.prototype,lodash.prototype.constructor=lodash,module.exports=lodash},{"./_LazyWrapper":90,"./_LodashWrapper":92,"./_baseLodash":137,"./_wrapperClone":258,"./isArray":272,"./isObjectLike":279}],303:[function(require,module,exports){function compile(parsed){var a=parsed[0],b=parsed[1]-1;if(b<0&&a<=0)return falseFunc;if(a===-1)return function(pos){return pos<=b};if(0===a)return function(pos){return pos===b};if(1===a)return b<0?trueFunc:function(pos){return pos>=b};var bMod=b%a;return bMod<0&&(bMod+=a),a>1?function(pos){return pos>=b&&pos%a===bMod}:(a*=-1,function(pos){return pos<=b&&pos%a===bMod})}module.exports=compile;var BaseFuncs=require("boolbase"),trueFunc=BaseFuncs.trueFunc,falseFunc=BaseFuncs.falseFunc},{boolbase:28}],304:[function(require,module,exports){var parse=require("./parse.js"),compile=require("./compile.js");module.exports=function(formula){return compile(parse(formula))},module.exports.parse=parse,module.exports.compile=compile},{"./compile.js":303,"./parse.js":305}],305:[function(require,module,exports){function parse(formula){if(formula=formula.trim().toLowerCase(),"even"===formula)return[2,0];if("odd"===formula)return[2,1];var parsed=formula.match(re_nthElement);if(!parsed)throw new SyntaxError("n-th rule couldn't be parsed ('"+formula+"')");var a;return parsed[1]?(a=parseInt(parsed[1],10),isNaN(a)&&(a="-"===parsed[1].charAt(0)?-1:1)):a=0,[a,parsed[3]?parseInt((parsed[2]||"")+parsed[3],10):0]}module.exports=parse;var re_nthElement=/^([+\-]?\d*n)?\s*(?:([+\-]?)\s*(\d+))?$/},{}],306:[function(require,module,exports){"use strict";function enquoteDoctypeId(id){var quote=id.indexOf('"')!==-1?"'":'"';return quote+id+quote}function hasPrefix(publicId,prefixes){for(var i=0;i-1)return DOCUMENT_MODE.QUIRKS;var prefixes=null===systemId?QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES:QUIRKS_MODE_PUBLIC_ID_PREFIXES;if(hasPrefix(publicId,prefixes))return DOCUMENT_MODE.QUIRKS;if(prefixes=null===systemId?LIMITED_QUIRKS_PUBLIC_ID_PREFIXES:LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES,hasPrefix(publicId,prefixes))return DOCUMENT_MODE.LIMITED_QUIRKS}return DOCUMENT_MODE.NO_QUIRKS},exports.serializeContent=function(name,publicId,systemId){var str="!DOCTYPE ";return name&&(str+=name),null!==publicId?str+=" PUBLIC "+enquoteDoctypeId(publicId):null!==systemId&&(str+=" SYSTEM"),null!==systemId&&(str+=" "+enquoteDoctypeId(systemId)),str}},{"./html":308}],307:[function(require,module,exports){"use strict";function isMathMLTextIntegrationPoint(tn,ns){return ns===NS.MATHML&&(tn===$.MI||tn===$.MO||tn===$.MN||tn===$.MS||tn===$.MTEXT)}function isHtmlIntegrationPoint(tn,ns,attrs){if(ns===NS.MATHML&&tn===$.ANNOTATION_XML)for(var i=0;i0;i--)mxn.onItemPop(this.items[i]);orig.popAllUpToHtmlElement.call(this)},remove:function(element){mxn.onItemPop(this.current),orig.remove.call(this,element)}}}},{"../../utils/mixin":331,util:354}],311:[function(require,module,exports){"use strict";var Mixin=require("../../utils/mixin"),Tokenizer=require("../../tokenizer"),LocationInfoTokenizerMixin=require("./tokenizer_mixin"),PositionTrackingPreprocessorMixin=require("../position_tracking/preprocessor_mixin"),LocationInfoOpenElementStackMixin=require("./open_element_stack_mixin"),HTML=require("../../common/html"),inherits=require("util").inherits,$=HTML.TAG_NAMES,LocationInfoParserMixin=module.exports=function(parser){Mixin.call(this,parser),this.parser=parser,this.posTracker=null,this.lastStartTagToken=null,this.lastFosterParentingLocation=null,this.currentToken=null};inherits(LocationInfoParserMixin,Mixin),LocationInfoParserMixin.prototype._setStartLocation=function(element){this.lastStartTagToken?(element.__location=Object.create(this.lastStartTagToken.location),element.__location.startTag=this.lastStartTagToken.location):element.__location=null},LocationInfoParserMixin.prototype._setEndLocation=function(element,closingToken){var loc=element.__location;if(loc)if(closingToken.location){var ctLoc=closingToken.location,tn=this.parser.treeAdapter.getTagName(element),isClosingEndTag=closingToken.type===Tokenizer.END_TAG_TOKEN&&tn===closingToken.tagName;isClosingEndTag?(loc.endTag=Object.create(ctLoc),loc.endOffset=ctLoc.endOffset):loc.endOffset=ctLoc.startOffset}else closingToken.type===Tokenizer.EOF_TOKEN&&(loc.endOffset=this.posTracker.offset)},LocationInfoParserMixin.prototype._getOverriddenMethods=function(mxn,orig){return{_bootstrap:function(document,fragmentContext){orig._bootstrap.call(this,document,fragmentContext),mxn.lastStartTagToken=null,mxn.lastFosterParentingLocation=null,mxn.currentToken=null,mxn.posTracker=new PositionTrackingPreprocessorMixin(this.tokenizer.preprocessor),new LocationInfoTokenizerMixin(this.tokenizer),new LocationInfoOpenElementStackMixin(this.openElements,{onItemPop:function(element){mxn._setEndLocation(element,mxn.currentToken)}})},_runParsingLoop:function(scriptHandler){orig._runParsingLoop.call(this,scriptHandler);for(var i=this.openElements.stackTop;i>=0;i--)mxn._setEndLocation(this.openElements.items[i],mxn.currentToken)},_processTokenInForeignContent:function(token){mxn.currentToken=token,orig._processTokenInForeignContent.call(this,token)},_processToken:function(token){mxn.currentToken=token,orig._processToken.call(this,token);var requireExplicitUpdate=token.type===Tokenizer.END_TAG_TOKEN&&(token.tagName===$.HTML||token.tagName===$.BODY&&this.openElements.hasInScope($.BODY));if(requireExplicitUpdate)for(var i=this.openElements.stackTop;i>=0;i--){var element=this.openElements.items[i];if(this.treeAdapter.getTagName(element)===token.tagName){mxn._setEndLocation(element,token);break}}},_setDocumentType:function(token){orig._setDocumentType.call(this,token);for(var documentChildren=this.treeAdapter.getChildNodes(this.document),cnLength=documentChildren.length,i=0;i=NOAH_ARK_CAPACITY)for(var neAttrsLength=this.treeAdapter.getAttrList(newElement).length,neTagName=this.treeAdapter.getTagName(newElement),neNamespaceURI=this.treeAdapter.getNamespaceURI(newElement),i=this.length-1;i>=0;i--){var entry=this.entries[i];if(entry.type===FormattingElementList.MARKER_ENTRY)break;var element=entry.element,elementAttrs=this.treeAdapter.getAttrList(element),isCandidate=this.treeAdapter.getTagName(element)===neTagName&&this.treeAdapter.getNamespaceURI(element)===neNamespaceURI&&elementAttrs.length===neAttrsLength;isCandidate&&candidates.push({idx:i,attrs:elementAttrs})}return candidates.length=NOAH_ARK_CAPACITY-1;i--)this.entries.splice(candidates[i].idx,1),this.length--}},FormattingElementList.prototype.insertMarker=function(){this.entries.push({type:FormattingElementList.MARKER_ENTRY}),this.length++},FormattingElementList.prototype.pushElement=function(element,token){this._ensureNoahArkCondition(element),this.entries.push({type:FormattingElementList.ELEMENT_ENTRY,element:element,token:token}),this.length++},FormattingElementList.prototype.insertElementAfterBookmark=function(element,token){for(var bookmarkIdx=this.length-1;bookmarkIdx>=0&&this.entries[bookmarkIdx]!==this.bookmark;bookmarkIdx--);this.entries.splice(bookmarkIdx+1,0,{type:FormattingElementList.ELEMENT_ENTRY,element:element,token:token}),this.length++},FormattingElementList.prototype.removeEntry=function(entry){for(var i=this.length-1;i>=0;i--)if(this.entries[i]===entry){this.entries.splice(i,1),this.length--;break}},FormattingElementList.prototype.clearToLastMarker=function(){for(;this.length;){var entry=this.entries.pop();if(this.length--,entry.type===FormattingElementList.MARKER_ENTRY)break}},FormattingElementList.prototype.getElementEntryInScopeWithTagName=function(tagName){for(var i=this.length-1;i>=0;i--){var entry=this.entries[i];if(entry.type===FormattingElementList.MARKER_ENTRY)return null;if(this.treeAdapter.getTagName(entry.element)===tagName)return entry}return null},FormattingElementList.prototype.getElementEntry=function(element){for(var i=this.length-1;i>=0;i--){var entry=this.entries[i];if(entry.type===FormattingElementList.ELEMENT_ENTRY&&entry.element===element)return entry}return null}},{}],316:[function(require,module,exports){"use strict";function aaObtainFormattingElementEntry(p,token){var formattingElementEntry=p.activeFormattingElements.getElementEntryInScopeWithTagName(token.tagName);return formattingElementEntry?p.openElements.contains(formattingElementEntry.element)?p.openElements.hasInScope(token.tagName)||(formattingElementEntry=null):(p.activeFormattingElements.removeEntry(formattingElementEntry),formattingElementEntry=null):genericEndTagInBody(p,token),formattingElementEntry}function aaObtainFurthestBlock(p,formattingElementEntry){for(var furthestBlock=null,i=p.openElements.stackTop;i>=0;i--){var element=p.openElements.items[i];if(element===formattingElementEntry.element)break;p._isSpecialElement(element)&&(furthestBlock=element)}return furthestBlock||(p.openElements.popUntilElementPopped(formattingElementEntry.element),p.activeFormattingElements.removeEntry(formattingElementEntry)),furthestBlock}function aaInnerLoop(p,furthestBlock,formattingElement){for(var lastElement=furthestBlock,nextElement=p.openElements.getCommonAncestor(furthestBlock),i=0,element=nextElement;element!==formattingElement;i++,element=nextElement){nextElement=p.openElements.getCommonAncestor(element);var elementEntry=p.activeFormattingElements.getElementEntry(element),counterOverflow=elementEntry&&i>=AA_INNER_LOOP_ITER,shouldRemoveFromOpenElements=!elementEntry||counterOverflow;shouldRemoveFromOpenElements?(counterOverflow&&p.activeFormattingElements.removeEntry(elementEntry),p.openElements.remove(element)):(element=aaRecreateElementFromEntry(p,elementEntry),lastElement===furthestBlock&&(p.activeFormattingElements.bookmark=elementEntry),p.treeAdapter.detachNode(lastElement),p.treeAdapter.appendChild(element,lastElement),lastElement=element)}return lastElement}function aaRecreateElementFromEntry(p,elementEntry){var ns=p.treeAdapter.getNamespaceURI(elementEntry.element),newElement=p.treeAdapter.createElement(elementEntry.token.tagName,ns,elementEntry.token.attrs);return p.openElements.replace(elementEntry.element,newElement),elementEntry.element=newElement,newElement}function aaInsertLastNodeInCommonAncestor(p,commonAncestor,lastElement){if(p._isElementCausesFosterParenting(commonAncestor))p._fosterParentElement(lastElement);else{var tn=p.treeAdapter.getTagName(commonAncestor),ns=p.treeAdapter.getNamespaceURI(commonAncestor);tn===$.TEMPLATE&&ns===NS.HTML&&(commonAncestor=p.treeAdapter.getTemplateContent(commonAncestor)),p.treeAdapter.appendChild(commonAncestor,lastElement)}}function aaReplaceFormattingElement(p,furthestBlock,formattingElementEntry){var ns=p.treeAdapter.getNamespaceURI(formattingElementEntry.element),token=formattingElementEntry.token,newElement=p.treeAdapter.createElement(token.tagName,ns,token.attrs);p._adoptNodes(furthestBlock,newElement),p.treeAdapter.appendChild(furthestBlock,newElement),p.activeFormattingElements.insertElementAfterBookmark(newElement,formattingElementEntry.token),p.activeFormattingElements.removeEntry(formattingElementEntry),p.openElements.remove(formattingElementEntry.element),p.openElements.insertAfter(furthestBlock,newElement)}function callAdoptionAgency(p,token){for(var formattingElementEntry,i=0;i0&&(p.openElements.generateImpliedEndTags(),p.openElements.popUntilTagNamePopped($.TEMPLATE),p.activeFormattingElements.clearToLastMarker(),p._popTmplInsertionMode(),p._resetInsertionMode())}function tokenInHead(p,token){p.openElements.pop(),p.insertionMode=AFTER_HEAD_MODE,p._processToken(token)}function startTagAfterHead(p,token){var tn=token.tagName;tn===$.HTML?startTagInBody(p,token):tn===$.BODY?(p._insertElement(token,NS.HTML),p.framesetOk=!1,p.insertionMode=IN_BODY_MODE):tn===$.FRAMESET?(p._insertElement(token,NS.HTML),p.insertionMode=IN_FRAMESET_MODE):tn===$.BASE||tn===$.BASEFONT||tn===$.BGSOUND||tn===$.LINK||tn===$.META||tn===$.NOFRAMES||tn===$.SCRIPT||tn===$.STYLE||tn===$.TEMPLATE||tn===$.TITLE?(p.openElements.push(p.headElement),startTagInHead(p,token),p.openElements.remove(p.headElement)):tn!==$.HEAD&&tokenAfterHead(p,token)}function endTagAfterHead(p,token){var tn=token.tagName;tn===$.BODY||tn===$.HTML||tn===$.BR?tokenAfterHead(p,token):tn===$.TEMPLATE&&endTagInHead(p,token)}function tokenAfterHead(p,token){p._insertFakeElement($.BODY),p.insertionMode=IN_BODY_MODE,p._processToken(token)}function whitespaceCharacterInBody(p,token){p._reconstructActiveFormattingElements(),p._insertCharacters(token)}function characterInBody(p,token){p._reconstructActiveFormattingElements(),p._insertCharacters(token),p.framesetOk=!1}function htmlStartTagInBody(p,token){0===p.openElements.tmplCount&&p.treeAdapter.adoptAttributes(p.openElements.items[0],token.attrs)}function bodyStartTagInBody(p,token){var bodyElement=p.openElements.tryPeekProperlyNestedBodyElement();bodyElement&&0===p.openElements.tmplCount&&(p.framesetOk=!1,p.treeAdapter.adoptAttributes(bodyElement,token.attrs))}function framesetStartTagInBody(p,token){var bodyElement=p.openElements.tryPeekProperlyNestedBodyElement();p.framesetOk&&bodyElement&&(p.treeAdapter.detachNode(bodyElement),p.openElements.popAllUpToHtmlElement(),p._insertElement(token,NS.HTML),p.insertionMode=IN_FRAMESET_MODE)}function addressStartTagInBody(p,token){p.openElements.hasInButtonScope($.P)&&p._closePElement(),p._insertElement(token,NS.HTML)}function numberedHeaderStartTagInBody(p,token){p.openElements.hasInButtonScope($.P)&&p._closePElement();var tn=p.openElements.currentTagName;tn!==$.H1&&tn!==$.H2&&tn!==$.H3&&tn!==$.H4&&tn!==$.H5&&tn!==$.H6||p.openElements.pop(),p._insertElement(token,NS.HTML)}function preStartTagInBody(p,token){p.openElements.hasInButtonScope($.P)&&p._closePElement(),p._insertElement(token,NS.HTML),p.skipNextNewLine=!0,p.framesetOk=!1}function formStartTagInBody(p,token){var inTemplate=p.openElements.tmplCount>0;p.formElement&&!inTemplate||(p.openElements.hasInButtonScope($.P)&&p._closePElement(),p._insertElement(token,NS.HTML),inTemplate||(p.formElement=p.openElements.current))}function listItemStartTagInBody(p,token){p.framesetOk=!1;for(var tn=token.tagName,i=p.openElements.stackTop;i>=0;i--){var element=p.openElements.items[i],elementTn=p.treeAdapter.getTagName(element),closeTn=null;if(tn===$.LI&&elementTn===$.LI?closeTn=$.LI:tn!==$.DD&&tn!==$.DT||elementTn!==$.DD&&elementTn!==$.DT||(closeTn=elementTn),closeTn){p.openElements.generateImpliedEndTagsWithExclusion(closeTn),p.openElements.popUntilTagNamePopped(closeTn);break}if(elementTn!==$.ADDRESS&&elementTn!==$.DIV&&elementTn!==$.P&&p._isSpecialElement(element))break}p.openElements.hasInButtonScope($.P)&&p._closePElement(),p._insertElement(token,NS.HTML)}function plaintextStartTagInBody(p,token){p.openElements.hasInButtonScope($.P)&&p._closePElement(),p._insertElement(token,NS.HTML),p.tokenizer.state=Tokenizer.MODE.PLAINTEXT}function buttonStartTagInBody(p,token){p.openElements.hasInScope($.BUTTON)&&(p.openElements.generateImpliedEndTags(),p.openElements.popUntilTagNamePopped($.BUTTON)),p._reconstructActiveFormattingElements(),p._insertElement(token,NS.HTML),p.framesetOk=!1}function aStartTagInBody(p,token){var activeElementEntry=p.activeFormattingElements.getElementEntryInScopeWithTagName($.A);activeElementEntry&&(callAdoptionAgency(p,token),p.openElements.remove(activeElementEntry.element),p.activeFormattingElements.removeEntry(activeElementEntry)),p._reconstructActiveFormattingElements(),p._insertElement(token,NS.HTML),p.activeFormattingElements.pushElement(p.openElements.current,token)}function bStartTagInBody(p,token){p._reconstructActiveFormattingElements(),p._insertElement(token,NS.HTML),p.activeFormattingElements.pushElement(p.openElements.current,token)}function nobrStartTagInBody(p,token){p._reconstructActiveFormattingElements(),p.openElements.hasInScope($.NOBR)&&(callAdoptionAgency(p,token),p._reconstructActiveFormattingElements()),p._insertElement(token,NS.HTML),p.activeFormattingElements.pushElement(p.openElements.current,token)}function appletStartTagInBody(p,token){p._reconstructActiveFormattingElements(),p._insertElement(token,NS.HTML),p.activeFormattingElements.insertMarker(),p.framesetOk=!1}function tableStartTagInBody(p,token){p.treeAdapter.getDocumentMode(p.document)!==HTML.DOCUMENT_MODE.QUIRKS&&p.openElements.hasInButtonScope($.P)&&p._closePElement(),p._insertElement(token,NS.HTML),p.framesetOk=!1,p.insertionMode=IN_TABLE_MODE}function areaStartTagInBody(p,token){p._reconstructActiveFormattingElements(),p._appendElement(token,NS.HTML),p.framesetOk=!1}function inputStartTagInBody(p,token){p._reconstructActiveFormattingElements(),p._appendElement(token,NS.HTML);var inputType=Tokenizer.getTokenAttr(token,ATTRS.TYPE);inputType&&inputType.toLowerCase()===HIDDEN_INPUT_TYPE||(p.framesetOk=!1)}function paramStartTagInBody(p,token){p._appendElement(token,NS.HTML)}function hrStartTagInBody(p,token){p.openElements.hasInButtonScope($.P)&&p._closePElement(),p.openElements.currentTagName===$.MENUITEM&&p.openElements.pop(),p._appendElement(token,NS.HTML),p.framesetOk=!1}function imageStartTagInBody(p,token){token.tagName=$.IMG,areaStartTagInBody(p,token)}function textareaStartTagInBody(p,token){p._insertElement(token,NS.HTML),p.skipNextNewLine=!0,p.tokenizer.state=Tokenizer.MODE.RCDATA,p.originalInsertionMode=p.insertionMode,p.framesetOk=!1,p.insertionMode=TEXT_MODE}function xmpStartTagInBody(p,token){p.openElements.hasInButtonScope($.P)&&p._closePElement(),p._reconstructActiveFormattingElements(),p.framesetOk=!1,p._switchToTextParsing(token,Tokenizer.MODE.RAWTEXT)}function iframeStartTagInBody(p,token){p.framesetOk=!1,p._switchToTextParsing(token,Tokenizer.MODE.RAWTEXT)}function noembedStartTagInBody(p,token){p._switchToTextParsing(token,Tokenizer.MODE.RAWTEXT)}function selectStartTagInBody(p,token){p._reconstructActiveFormattingElements(),p._insertElement(token,NS.HTML),p.framesetOk=!1,p.insertionMode===IN_TABLE_MODE||p.insertionMode===IN_CAPTION_MODE||p.insertionMode===IN_TABLE_BODY_MODE||p.insertionMode===IN_ROW_MODE||p.insertionMode===IN_CELL_MODE?p.insertionMode=IN_SELECT_IN_TABLE_MODE:p.insertionMode=IN_SELECT_MODE}function optgroupStartTagInBody(p,token){p.openElements.currentTagName===$.OPTION&&p.openElements.pop(),p._reconstructActiveFormattingElements(),p._insertElement(token,NS.HTML)}function rbStartTagInBody(p,token){p.openElements.hasInScope($.RUBY)&&p.openElements.generateImpliedEndTags(),p._insertElement(token,NS.HTML)}function rtStartTagInBody(p,token){p.openElements.hasInScope($.RUBY)&&p.openElements.generateImpliedEndTagsWithExclusion($.RTC),p._insertElement(token,NS.HTML)}function menuitemStartTagInBody(p,token){p.openElements.currentTagName===$.MENUITEM&&p.openElements.pop(),p._reconstructActiveFormattingElements(),p._insertElement(token,NS.HTML)}function menuStartTagInBody(p,token){p.openElements.hasInButtonScope($.P)&&p._closePElement(),p.openElements.currentTagName===$.MENUITEM&&p.openElements.pop(),p._insertElement(token,NS.HTML)}function mathStartTagInBody(p,token){p._reconstructActiveFormattingElements(),foreignContent.adjustTokenMathMLAttrs(token),foreignContent.adjustTokenXMLAttrs(token),token.selfClosing?p._appendElement(token,NS.MATHML):p._insertElement(token,NS.MATHML)}function svgStartTagInBody(p,token){p._reconstructActiveFormattingElements(),foreignContent.adjustTokenSVGAttrs(token),foreignContent.adjustTokenXMLAttrs(token),token.selfClosing?p._appendElement(token,NS.SVG):p._insertElement(token,NS.SVG)}function genericStartTagInBody(p,token){p._reconstructActiveFormattingElements(),p._insertElement(token,NS.HTML)}function startTagInBody(p,token){var tn=token.tagName;switch(tn.length){case 1:tn===$.I||tn===$.S||tn===$.B||tn===$.U?bStartTagInBody(p,token):tn===$.P?addressStartTagInBody(p,token):tn===$.A?aStartTagInBody(p,token):genericStartTagInBody(p,token);break;case 2:tn===$.DL||tn===$.OL||tn===$.UL?addressStartTagInBody(p,token):tn===$.H1||tn===$.H2||tn===$.H3||tn===$.H4||tn===$.H5||tn===$.H6?numberedHeaderStartTagInBody(p,token):tn===$.LI||tn===$.DD||tn===$.DT?listItemStartTagInBody(p,token):tn===$.EM||tn===$.TT?bStartTagInBody(p,token):tn===$.BR?areaStartTagInBody(p,token):tn===$.HR?hrStartTagInBody(p,token):tn===$.RB?rbStartTagInBody(p,token):tn===$.RT||tn===$.RP?rtStartTagInBody(p,token):tn!==$.TH&&tn!==$.TD&&tn!==$.TR&&genericStartTagInBody(p,token);break;case 3:tn===$.DIV||tn===$.DIR||tn===$.NAV?addressStartTagInBody(p,token):tn===$.PRE?preStartTagInBody(p,token):tn===$.BIG?bStartTagInBody(p,token):tn===$.IMG||tn===$.WBR?areaStartTagInBody(p,token):tn===$.XMP?xmpStartTagInBody(p,token):tn===$.SVG?svgStartTagInBody(p,token):tn===$.RTC?rbStartTagInBody(p,token):tn!==$.COL&&genericStartTagInBody(p,token);break;case 4:tn===$.HTML?htmlStartTagInBody(p,token):tn===$.BASE||tn===$.LINK||tn===$.META?startTagInHead(p,token):tn===$.BODY?bodyStartTagInBody(p,token):tn===$.MAIN?addressStartTagInBody(p,token):tn===$.FORM?formStartTagInBody(p,token):tn===$.CODE||tn===$.FONT?bStartTagInBody(p,token):tn===$.NOBR?nobrStartTagInBody(p,token):tn===$.AREA?areaStartTagInBody(p,token):tn===$.MATH?mathStartTagInBody(p,token):tn===$.MENU?menuStartTagInBody(p,token):tn!==$.HEAD&&genericStartTagInBody(p,token);break;case 5:tn===$.STYLE||tn===$.TITLE?startTagInHead(p,token):tn===$.ASIDE?addressStartTagInBody(p,token):tn===$.SMALL?bStartTagInBody(p,token):tn===$.TABLE?tableStartTagInBody(p,token):tn===$.EMBED?areaStartTagInBody(p,token):tn===$.INPUT?inputStartTagInBody(p,token):tn===$.PARAM||tn===$.TRACK?paramStartTagInBody(p,token):tn===$.IMAGE?imageStartTagInBody(p,token):tn!==$.FRAME&&tn!==$.TBODY&&tn!==$.TFOOT&&tn!==$.THEAD&&genericStartTagInBody(p,token);break;case 6:tn===$.SCRIPT?startTagInHead(p,token):tn===$.CENTER||tn===$.FIGURE||tn===$.FOOTER||tn===$.HEADER||tn===$.HGROUP?addressStartTagInBody(p,token):tn===$.BUTTON?buttonStartTagInBody(p,token):tn===$.STRIKE||tn===$.STRONG?bStartTagInBody(p,token):tn===$.APPLET||tn===$.OBJECT?appletStartTagInBody(p,token):tn===$.KEYGEN?areaStartTagInBody(p,token):tn===$.SOURCE?paramStartTagInBody(p,token):tn===$.IFRAME?iframeStartTagInBody(p,token):tn===$.SELECT?selectStartTagInBody(p,token):tn===$.OPTION?optgroupStartTagInBody(p,token):genericStartTagInBody(p,token);break;case 7:tn===$.BGSOUND?startTagInHead(p,token):tn===$.DETAILS||tn===$.ADDRESS||tn===$.ARTICLE||tn===$.SECTION||tn===$.SUMMARY?addressStartTagInBody(p,token):tn===$.LISTING?preStartTagInBody(p,token):tn===$.MARQUEE?appletStartTagInBody(p,token):tn===$.NOEMBED?noembedStartTagInBody(p,token):tn!==$.CAPTION&&genericStartTagInBody(p,token);break;case 8:tn===$.BASEFONT?startTagInHead(p,token):tn===$.MENUITEM?menuitemStartTagInBody(p,token):tn===$.FRAMESET?framesetStartTagInBody(p,token):tn===$.FIELDSET?addressStartTagInBody(p,token):tn===$.TEXTAREA?textareaStartTagInBody(p,token):tn===$.TEMPLATE?startTagInHead(p,token):tn===$.NOSCRIPT?noembedStartTagInBody(p,token):tn===$.OPTGROUP?optgroupStartTagInBody(p,token):tn!==$.COLGROUP&&genericStartTagInBody(p,token);break;case 9:tn===$.PLAINTEXT?plaintextStartTagInBody(p,token):genericStartTagInBody(p,token);break;case 10:tn===$.BLOCKQUOTE||tn===$.FIGCAPTION?addressStartTagInBody(p,token):genericStartTagInBody(p,token);break;default:genericStartTagInBody(p,token)}}function bodyEndTagInBody(p){p.openElements.hasInScope($.BODY)&&(p.insertionMode=AFTER_BODY_MODE)}function htmlEndTagInBody(p,token){p.openElements.hasInScope($.BODY)&&(p.insertionMode=AFTER_BODY_MODE,p._processToken(token))}function addressEndTagInBody(p,token){var tn=token.tagName;p.openElements.hasInScope(tn)&&(p.openElements.generateImpliedEndTags(),p.openElements.popUntilTagNamePopped(tn))}function formEndTagInBody(p){var inTemplate=p.openElements.tmplCount>0,formElement=p.formElement;inTemplate||(p.formElement=null),(formElement||inTemplate)&&p.openElements.hasInScope($.FORM)&&(p.openElements.generateImpliedEndTags(),inTemplate?p.openElements.popUntilTagNamePopped($.FORM):p.openElements.remove(formElement))}function pEndTagInBody(p){p.openElements.hasInButtonScope($.P)||p._insertFakeElement($.P),p._closePElement()}function liEndTagInBody(p){p.openElements.hasInListItemScope($.LI)&&(p.openElements.generateImpliedEndTagsWithExclusion($.LI),p.openElements.popUntilTagNamePopped($.LI))}function ddEndTagInBody(p,token){var tn=token.tagName;p.openElements.hasInScope(tn)&&(p.openElements.generateImpliedEndTagsWithExclusion(tn),p.openElements.popUntilTagNamePopped(tn))}function numberedHeaderEndTagInBody(p){p.openElements.hasNumberedHeaderInScope()&&(p.openElements.generateImpliedEndTags(),p.openElements.popUntilNumberedHeaderPopped())}function appletEndTagInBody(p,token){var tn=token.tagName;p.openElements.hasInScope(tn)&&(p.openElements.generateImpliedEndTags(),p.openElements.popUntilTagNamePopped(tn),p.activeFormattingElements.clearToLastMarker())}function brEndTagInBody(p){p._reconstructActiveFormattingElements(),p._insertFakeElement($.BR),p.openElements.pop(),p.framesetOk=!1}function genericEndTagInBody(p,token){for(var tn=token.tagName,i=p.openElements.stackTop;i>0;i--){var element=p.openElements.items[i];if(p.treeAdapter.getTagName(element)===tn){p.openElements.generateImpliedEndTagsWithExclusion(tn),p.openElements.popUntilElementPopped(element);break}if(p._isSpecialElement(element))break}}function endTagInBody(p,token){var tn=token.tagName;switch(tn.length){case 1:tn===$.A||tn===$.B||tn===$.I||tn===$.S||tn===$.U?callAdoptionAgency(p,token):tn===$.P?pEndTagInBody(p,token):genericEndTagInBody(p,token);break;case 2:tn===$.DL||tn===$.UL||tn===$.OL?addressEndTagInBody(p,token):tn===$.LI?liEndTagInBody(p,token):tn===$.DD||tn===$.DT?ddEndTagInBody(p,token):tn===$.H1||tn===$.H2||tn===$.H3||tn===$.H4||tn===$.H5||tn===$.H6?numberedHeaderEndTagInBody(p,token):tn===$.BR?brEndTagInBody(p,token):tn===$.EM||tn===$.TT?callAdoptionAgency(p,token):genericEndTagInBody(p,token);break;case 3:tn===$.BIG?callAdoptionAgency(p,token):tn===$.DIR||tn===$.DIV||tn===$.NAV?addressEndTagInBody(p,token):genericEndTagInBody(p,token);break;case 4:tn===$.BODY?bodyEndTagInBody(p,token):tn===$.HTML?htmlEndTagInBody(p,token):tn===$.FORM?formEndTagInBody(p,token):tn===$.CODE||tn===$.FONT||tn===$.NOBR?callAdoptionAgency(p,token):tn===$.MAIN||tn===$.MENU?addressEndTagInBody(p,token):genericEndTagInBody(p,token);break;case 5:tn===$.ASIDE?addressEndTagInBody(p,token):tn===$.SMALL?callAdoptionAgency(p,token):genericEndTagInBody(p,token);break;case 6:tn===$.CENTER||tn===$.FIGURE||tn===$.FOOTER||tn===$.HEADER||tn===$.HGROUP?addressEndTagInBody(p,token):tn===$.APPLET||tn===$.OBJECT?appletEndTagInBody(p,token):tn===$.STRIKE||tn===$.STRONG?callAdoptionAgency(p,token):genericEndTagInBody(p,token);break;case 7:tn===$.ADDRESS||tn===$.ARTICLE||tn===$.DETAILS||tn===$.SECTION||tn===$.SUMMARY?addressEndTagInBody(p,token):tn===$.MARQUEE?appletEndTagInBody(p,token):genericEndTagInBody(p,token);break;case 8:tn===$.FIELDSET?addressEndTagInBody(p,token):tn===$.TEMPLATE?endTagInHead(p,token):genericEndTagInBody(p,token);break;case 10:tn===$.BLOCKQUOTE||tn===$.FIGCAPTION?addressEndTagInBody(p,token):genericEndTagInBody(p,token);break;default:genericEndTagInBody(p,token)}}function eofInBody(p,token){p.tmplInsertionModeStackTop>-1?eofInTemplate(p,token):p.stopped=!0}function endTagInText(p,token){token.tagName===$.SCRIPT&&(p.pendingScript=p.openElements.current),p.openElements.pop(),p.insertionMode=p.originalInsertionMode}function eofInText(p,token){p.openElements.pop(),p.insertionMode=p.originalInsertionMode,p._processToken(token)}function characterInTable(p,token){var curTn=p.openElements.currentTagName;curTn===$.TABLE||curTn===$.TBODY||curTn===$.TFOOT||curTn===$.THEAD||curTn===$.TR?(p.pendingCharacterTokens=[],p.hasNonWhitespacePendingCharacterToken=!1,p.originalInsertionMode=p.insertionMode,p.insertionMode=IN_TABLE_TEXT_MODE,p._processToken(token)):tokenInTable(p,token)}function captionStartTagInTable(p,token){p.openElements.clearBackToTableContext(),p.activeFormattingElements.insertMarker(),p._insertElement(token,NS.HTML),p.insertionMode=IN_CAPTION_MODE}function colgroupStartTagInTable(p,token){p.openElements.clearBackToTableContext(),p._insertElement(token,NS.HTML),p.insertionMode=IN_COLUMN_GROUP_MODE}function colStartTagInTable(p,token){p.openElements.clearBackToTableContext(),p._insertFakeElement($.COLGROUP),p.insertionMode=IN_COLUMN_GROUP_MODE,p._processToken(token)}function tbodyStartTagInTable(p,token){p.openElements.clearBackToTableContext(),p._insertElement(token,NS.HTML),p.insertionMode=IN_TABLE_BODY_MODE}function tdStartTagInTable(p,token){p.openElements.clearBackToTableContext(),p._insertFakeElement($.TBODY),p.insertionMode=IN_TABLE_BODY_MODE,p._processToken(token)}function tableStartTagInTable(p,token){p.openElements.hasInTableScope($.TABLE)&&(p.openElements.popUntilTagNamePopped($.TABLE),p._resetInsertionMode(),p._processToken(token))}function inputStartTagInTable(p,token){var inputType=Tokenizer.getTokenAttr(token,ATTRS.TYPE);inputType&&inputType.toLowerCase()===HIDDEN_INPUT_TYPE?p._appendElement(token,NS.HTML):tokenInTable(p,token)}function formStartTagInTable(p,token){p.formElement||0!==p.openElements.tmplCount||(p._insertElement(token,NS.HTML),p.formElement=p.openElements.current,p.openElements.pop())}function startTagInTable(p,token){var tn=token.tagName;switch(tn.length){case 2:tn===$.TD||tn===$.TH||tn===$.TR?tdStartTagInTable(p,token):tokenInTable(p,token);break;case 3:tn===$.COL?colStartTagInTable(p,token):tokenInTable(p,token);break;case 4:tn===$.FORM?formStartTagInTable(p,token):tokenInTable(p,token);break;case 5:tn===$.TABLE?tableStartTagInTable(p,token):tn===$.STYLE?startTagInHead(p,token):tn===$.TBODY||tn===$.TFOOT||tn===$.THEAD?tbodyStartTagInTable(p,token):tn===$.INPUT?inputStartTagInTable(p,token):tokenInTable(p,token);break;case 6:tn===$.SCRIPT?startTagInHead(p,token):tokenInTable(p,token);break;case 7:tn===$.CAPTION?captionStartTagInTable(p,token):tokenInTable(p,token);break;case 8:tn===$.COLGROUP?colgroupStartTagInTable(p,token):tn===$.TEMPLATE?startTagInHead(p,token):tokenInTable(p,token);break;default:tokenInTable(p,token)}}function endTagInTable(p,token){var tn=token.tagName;tn===$.TABLE?p.openElements.hasInTableScope($.TABLE)&&(p.openElements.popUntilTagNamePopped($.TABLE),p._resetInsertionMode()):tn===$.TEMPLATE?endTagInHead(p,token):tn!==$.BODY&&tn!==$.CAPTION&&tn!==$.COL&&tn!==$.COLGROUP&&tn!==$.HTML&&tn!==$.TBODY&&tn!==$.TD&&tn!==$.TFOOT&&tn!==$.TH&&tn!==$.THEAD&&tn!==$.TR&&tokenInTable(p,token)}function tokenInTable(p,token){var savedFosterParentingState=p.fosterParentingEnabled;p.fosterParentingEnabled=!0,p._processTokenInBodyMode(token),p.fosterParentingEnabled=savedFosterParentingState}function whitespaceCharacterInTableText(p,token){p.pendingCharacterTokens.push(token)}function characterInTableText(p,token){p.pendingCharacterTokens.push(token),p.hasNonWhitespacePendingCharacterToken=!0}function tokenInTableText(p,token){var i=0;if(p.hasNonWhitespacePendingCharacterToken)for(;i0?(p.openElements.popUntilTagNamePopped($.TEMPLATE),p.activeFormattingElements.clearToLastMarker(),p._popTmplInsertionMode(),p._resetInsertionMode(),p._processToken(token)):p.stopped=!0}function startTagAfterBody(p,token){token.tagName===$.HTML?startTagInBody(p,token):tokenAfterBody(p,token)}function endTagAfterBody(p,token){token.tagName===$.HTML?p.fragmentContext||(p.insertionMode=AFTER_AFTER_BODY_MODE):tokenAfterBody(p,token)}function tokenAfterBody(p,token){p.insertionMode=IN_BODY_MODE,p._processToken(token)}function startTagInFrameset(p,token){var tn=token.tagName;tn===$.HTML?startTagInBody(p,token):tn===$.FRAMESET?p._insertElement(token,NS.HTML):tn===$.FRAME?p._appendElement(token,NS.HTML):tn===$.NOFRAMES&&startTagInHead(p,token)}function endTagInFrameset(p,token){token.tagName!==$.FRAMESET||p.openElements.isRootHtmlElementCurrent()||(p.openElements.pop(),p.fragmentContext||p.openElements.currentTagName===$.FRAMESET||(p.insertionMode=AFTER_FRAMESET_MODE))}function startTagAfterFrameset(p,token){var tn=token.tagName;tn===$.HTML?startTagInBody(p,token):tn===$.NOFRAMES&&startTagInHead(p,token)}function endTagAfterFrameset(p,token){token.tagName===$.HTML&&(p.insertionMode=AFTER_AFTER_FRAMESET_MODE)}function startTagAfterAfterBody(p,token){token.tagName===$.HTML?startTagInBody(p,token):tokenAfterAfterBody(p,token)}function tokenAfterAfterBody(p,token){p.insertionMode=IN_BODY_MODE,p._processToken(token)}function startTagAfterAfterFrameset(p,token){var tn=token.tagName;tn===$.HTML?startTagInBody(p,token):tn===$.NOFRAMES&&startTagInHead(p,token)}function nullCharacterInForeignContent(p,token){token.chars=UNICODE.REPLACEMENT_CHARACTER,p._insertCharacters(token)}function characterInForeignContent(p,token){p._insertCharacters(token),p.framesetOk=!1}function startTagInForeignContent(p,token){if(foreignContent.causesExit(token)&&!p.fragmentContext){for(;p.treeAdapter.getNamespaceURI(p.openElements.current)!==NS.HTML&&!p._isIntegrationPoint(p.openElements.current);)p.openElements.pop();p._processToken(token)}else{var current=p._getAdjustedCurrentElement(),currentNs=p.treeAdapter.getNamespaceURI(current);currentNs===NS.MATHML?foreignContent.adjustTokenMathMLAttrs(token):currentNs===NS.SVG&&(foreignContent.adjustTokenSVGTagName(token),foreignContent.adjustTokenSVGAttrs(token)),foreignContent.adjustTokenXMLAttrs(token),token.selfClosing?p._appendElement(token,currentNs):p._insertElement(token,currentNs)}}function endTagInForeignContent(p,token){for(var i=p.openElements.stackTop;i>0;i--){var element=p.openElements.items[i];if(p.treeAdapter.getNamespaceURI(element)===NS.HTML){p._processToken(token);break}if(p.treeAdapter.getTagName(element).toLowerCase()===token.tagName){p.openElements.popUntilElementPopped(element);break}}}var Tokenizer=require("../tokenizer"),OpenElementStack=require("./open_element_stack"),FormattingElementList=require("./formatting_element_list"),LocationInfoParserMixin=require("../extensions/location_info/parser_mixin"),defaultTreeAdapter=require("../tree_adapters/default"),mergeOptions=require("../utils/merge_options"),doctype=require("../common/doctype"),foreignContent=require("../common/foreign_content"),UNICODE=require("../common/unicode"),HTML=require("../common/html"),$=HTML.TAG_NAMES,NS=HTML.NAMESPACES,ATTRS=HTML.ATTRS,DEFAULT_OPTIONS={locationInfo:!1,treeAdapter:defaultTreeAdapter},HIDDEN_INPUT_TYPE="hidden",AA_OUTER_LOOP_ITER=8,AA_INNER_LOOP_ITER=3,INITIAL_MODE="INITIAL_MODE",BEFORE_HTML_MODE="BEFORE_HTML_MODE",BEFORE_HEAD_MODE="BEFORE_HEAD_MODE",IN_HEAD_MODE="IN_HEAD_MODE",AFTER_HEAD_MODE="AFTER_HEAD_MODE",IN_BODY_MODE="IN_BODY_MODE",TEXT_MODE="TEXT_MODE",IN_TABLE_MODE="IN_TABLE_MODE",IN_TABLE_TEXT_MODE="IN_TABLE_TEXT_MODE",IN_CAPTION_MODE="IN_CAPTION_MODE",IN_COLUMN_GROUP_MODE="IN_COLUMN_GROUP_MODE",IN_TABLE_BODY_MODE="IN_TABLE_BODY_MODE",IN_ROW_MODE="IN_ROW_MODE",IN_CELL_MODE="IN_CELL_MODE",IN_SELECT_MODE="IN_SELECT_MODE",IN_SELECT_IN_TABLE_MODE="IN_SELECT_IN_TABLE_MODE",IN_TEMPLATE_MODE="IN_TEMPLATE_MODE",AFTER_BODY_MODE="AFTER_BODY_MODE",IN_FRAMESET_MODE="IN_FRAMESET_MODE",AFTER_FRAMESET_MODE="AFTER_FRAMESET_MODE",AFTER_AFTER_BODY_MODE="AFTER_AFTER_BODY_MODE",AFTER_AFTER_FRAMESET_MODE="AFTER_AFTER_FRAMESET_MODE",INSERTION_MODE_RESET_MAP=Object.create(null); -INSERTION_MODE_RESET_MAP[$.TR]=IN_ROW_MODE,INSERTION_MODE_RESET_MAP[$.TBODY]=INSERTION_MODE_RESET_MAP[$.THEAD]=INSERTION_MODE_RESET_MAP[$.TFOOT]=IN_TABLE_BODY_MODE,INSERTION_MODE_RESET_MAP[$.CAPTION]=IN_CAPTION_MODE,INSERTION_MODE_RESET_MAP[$.COLGROUP]=IN_COLUMN_GROUP_MODE,INSERTION_MODE_RESET_MAP[$.TABLE]=IN_TABLE_MODE,INSERTION_MODE_RESET_MAP[$.BODY]=IN_BODY_MODE,INSERTION_MODE_RESET_MAP[$.FRAMESET]=IN_FRAMESET_MODE;var TEMPLATE_INSERTION_MODE_SWITCH_MAP=Object.create(null);TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.CAPTION]=TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.COLGROUP]=TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TBODY]=TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TFOOT]=TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.THEAD]=IN_TABLE_MODE,TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.COL]=IN_COLUMN_GROUP_MODE,TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TR]=IN_TABLE_BODY_MODE,TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TD]=TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TH]=IN_ROW_MODE;var _=Object.create(null);_[INITIAL_MODE]=Object.create(null),_[INITIAL_MODE][Tokenizer.CHARACTER_TOKEN]=_[INITIAL_MODE][Tokenizer.NULL_CHARACTER_TOKEN]=tokenInInitialMode,_[INITIAL_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN]=ignoreToken,_[INITIAL_MODE][Tokenizer.COMMENT_TOKEN]=appendComment,_[INITIAL_MODE][Tokenizer.DOCTYPE_TOKEN]=doctypeInInitialMode,_[INITIAL_MODE][Tokenizer.START_TAG_TOKEN]=_[INITIAL_MODE][Tokenizer.END_TAG_TOKEN]=_[INITIAL_MODE][Tokenizer.EOF_TOKEN]=tokenInInitialMode,_[BEFORE_HTML_MODE]=Object.create(null),_[BEFORE_HTML_MODE][Tokenizer.CHARACTER_TOKEN]=_[BEFORE_HTML_MODE][Tokenizer.NULL_CHARACTER_TOKEN]=tokenBeforeHtml,_[BEFORE_HTML_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN]=ignoreToken,_[BEFORE_HTML_MODE][Tokenizer.COMMENT_TOKEN]=appendComment,_[BEFORE_HTML_MODE][Tokenizer.DOCTYPE_TOKEN]=ignoreToken,_[BEFORE_HTML_MODE][Tokenizer.START_TAG_TOKEN]=startTagBeforeHtml,_[BEFORE_HTML_MODE][Tokenizer.END_TAG_TOKEN]=endTagBeforeHtml,_[BEFORE_HTML_MODE][Tokenizer.EOF_TOKEN]=tokenBeforeHtml,_[BEFORE_HEAD_MODE]=Object.create(null),_[BEFORE_HEAD_MODE][Tokenizer.CHARACTER_TOKEN]=_[BEFORE_HEAD_MODE][Tokenizer.NULL_CHARACTER_TOKEN]=tokenBeforeHead,_[BEFORE_HEAD_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN]=ignoreToken,_[BEFORE_HEAD_MODE][Tokenizer.COMMENT_TOKEN]=appendComment,_[BEFORE_HEAD_MODE][Tokenizer.DOCTYPE_TOKEN]=ignoreToken,_[BEFORE_HEAD_MODE][Tokenizer.START_TAG_TOKEN]=startTagBeforeHead,_[BEFORE_HEAD_MODE][Tokenizer.END_TAG_TOKEN]=endTagBeforeHead,_[BEFORE_HEAD_MODE][Tokenizer.EOF_TOKEN]=tokenBeforeHead,_[IN_HEAD_MODE]=Object.create(null),_[IN_HEAD_MODE][Tokenizer.CHARACTER_TOKEN]=_[IN_HEAD_MODE][Tokenizer.NULL_CHARACTER_TOKEN]=tokenInHead,_[IN_HEAD_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN]=insertCharacters,_[IN_HEAD_MODE][Tokenizer.COMMENT_TOKEN]=appendComment,_[IN_HEAD_MODE][Tokenizer.DOCTYPE_TOKEN]=ignoreToken,_[IN_HEAD_MODE][Tokenizer.START_TAG_TOKEN]=startTagInHead,_[IN_HEAD_MODE][Tokenizer.END_TAG_TOKEN]=endTagInHead,_[IN_HEAD_MODE][Tokenizer.EOF_TOKEN]=tokenInHead,_[AFTER_HEAD_MODE]=Object.create(null),_[AFTER_HEAD_MODE][Tokenizer.CHARACTER_TOKEN]=_[AFTER_HEAD_MODE][Tokenizer.NULL_CHARACTER_TOKEN]=tokenAfterHead,_[AFTER_HEAD_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN]=insertCharacters,_[AFTER_HEAD_MODE][Tokenizer.COMMENT_TOKEN]=appendComment,_[AFTER_HEAD_MODE][Tokenizer.DOCTYPE_TOKEN]=ignoreToken,_[AFTER_HEAD_MODE][Tokenizer.START_TAG_TOKEN]=startTagAfterHead,_[AFTER_HEAD_MODE][Tokenizer.END_TAG_TOKEN]=endTagAfterHead,_[AFTER_HEAD_MODE][Tokenizer.EOF_TOKEN]=tokenAfterHead,_[IN_BODY_MODE]=Object.create(null),_[IN_BODY_MODE][Tokenizer.CHARACTER_TOKEN]=characterInBody,_[IN_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN]=ignoreToken,_[IN_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN]=whitespaceCharacterInBody,_[IN_BODY_MODE][Tokenizer.COMMENT_TOKEN]=appendComment,_[IN_BODY_MODE][Tokenizer.DOCTYPE_TOKEN]=ignoreToken,_[IN_BODY_MODE][Tokenizer.START_TAG_TOKEN]=startTagInBody,_[IN_BODY_MODE][Tokenizer.END_TAG_TOKEN]=endTagInBody,_[IN_BODY_MODE][Tokenizer.EOF_TOKEN]=eofInBody,_[TEXT_MODE]=Object.create(null),_[TEXT_MODE][Tokenizer.CHARACTER_TOKEN]=_[TEXT_MODE][Tokenizer.NULL_CHARACTER_TOKEN]=_[TEXT_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN]=insertCharacters,_[TEXT_MODE][Tokenizer.COMMENT_TOKEN]=_[TEXT_MODE][Tokenizer.DOCTYPE_TOKEN]=_[TEXT_MODE][Tokenizer.START_TAG_TOKEN]=ignoreToken,_[TEXT_MODE][Tokenizer.END_TAG_TOKEN]=endTagInText,_[TEXT_MODE][Tokenizer.EOF_TOKEN]=eofInText,_[IN_TABLE_MODE]=Object.create(null),_[IN_TABLE_MODE][Tokenizer.CHARACTER_TOKEN]=_[IN_TABLE_MODE][Tokenizer.NULL_CHARACTER_TOKEN]=_[IN_TABLE_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN]=characterInTable,_[IN_TABLE_MODE][Tokenizer.COMMENT_TOKEN]=appendComment,_[IN_TABLE_MODE][Tokenizer.DOCTYPE_TOKEN]=ignoreToken,_[IN_TABLE_MODE][Tokenizer.START_TAG_TOKEN]=startTagInTable,_[IN_TABLE_MODE][Tokenizer.END_TAG_TOKEN]=endTagInTable,_[IN_TABLE_MODE][Tokenizer.EOF_TOKEN]=eofInBody,_[IN_TABLE_TEXT_MODE]=Object.create(null),_[IN_TABLE_TEXT_MODE][Tokenizer.CHARACTER_TOKEN]=characterInTableText,_[IN_TABLE_TEXT_MODE][Tokenizer.NULL_CHARACTER_TOKEN]=ignoreToken,_[IN_TABLE_TEXT_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN]=whitespaceCharacterInTableText,_[IN_TABLE_TEXT_MODE][Tokenizer.COMMENT_TOKEN]=_[IN_TABLE_TEXT_MODE][Tokenizer.DOCTYPE_TOKEN]=_[IN_TABLE_TEXT_MODE][Tokenizer.START_TAG_TOKEN]=_[IN_TABLE_TEXT_MODE][Tokenizer.END_TAG_TOKEN]=_[IN_TABLE_TEXT_MODE][Tokenizer.EOF_TOKEN]=tokenInTableText,_[IN_CAPTION_MODE]=Object.create(null),_[IN_CAPTION_MODE][Tokenizer.CHARACTER_TOKEN]=characterInBody,_[IN_CAPTION_MODE][Tokenizer.NULL_CHARACTER_TOKEN]=ignoreToken,_[IN_CAPTION_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN]=whitespaceCharacterInBody,_[IN_CAPTION_MODE][Tokenizer.COMMENT_TOKEN]=appendComment,_[IN_CAPTION_MODE][Tokenizer.DOCTYPE_TOKEN]=ignoreToken,_[IN_CAPTION_MODE][Tokenizer.START_TAG_TOKEN]=startTagInCaption,_[IN_CAPTION_MODE][Tokenizer.END_TAG_TOKEN]=endTagInCaption,_[IN_CAPTION_MODE][Tokenizer.EOF_TOKEN]=eofInBody,_[IN_COLUMN_GROUP_MODE]=Object.create(null),_[IN_COLUMN_GROUP_MODE][Tokenizer.CHARACTER_TOKEN]=_[IN_COLUMN_GROUP_MODE][Tokenizer.NULL_CHARACTER_TOKEN]=tokenInColumnGroup,_[IN_COLUMN_GROUP_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN]=insertCharacters,_[IN_COLUMN_GROUP_MODE][Tokenizer.COMMENT_TOKEN]=appendComment,_[IN_COLUMN_GROUP_MODE][Tokenizer.DOCTYPE_TOKEN]=ignoreToken,_[IN_COLUMN_GROUP_MODE][Tokenizer.START_TAG_TOKEN]=startTagInColumnGroup,_[IN_COLUMN_GROUP_MODE][Tokenizer.END_TAG_TOKEN]=endTagInColumnGroup,_[IN_COLUMN_GROUP_MODE][Tokenizer.EOF_TOKEN]=eofInBody,_[IN_TABLE_BODY_MODE]=Object.create(null),_[IN_TABLE_BODY_MODE][Tokenizer.CHARACTER_TOKEN]=_[IN_TABLE_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN]=_[IN_TABLE_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN]=characterInTable,_[IN_TABLE_BODY_MODE][Tokenizer.COMMENT_TOKEN]=appendComment,_[IN_TABLE_BODY_MODE][Tokenizer.DOCTYPE_TOKEN]=ignoreToken,_[IN_TABLE_BODY_MODE][Tokenizer.START_TAG_TOKEN]=startTagInTableBody,_[IN_TABLE_BODY_MODE][Tokenizer.END_TAG_TOKEN]=endTagInTableBody,_[IN_TABLE_BODY_MODE][Tokenizer.EOF_TOKEN]=eofInBody,_[IN_ROW_MODE]=Object.create(null),_[IN_ROW_MODE][Tokenizer.CHARACTER_TOKEN]=_[IN_ROW_MODE][Tokenizer.NULL_CHARACTER_TOKEN]=_[IN_ROW_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN]=characterInTable,_[IN_ROW_MODE][Tokenizer.COMMENT_TOKEN]=appendComment,_[IN_ROW_MODE][Tokenizer.DOCTYPE_TOKEN]=ignoreToken,_[IN_ROW_MODE][Tokenizer.START_TAG_TOKEN]=startTagInRow,_[IN_ROW_MODE][Tokenizer.END_TAG_TOKEN]=endTagInRow,_[IN_ROW_MODE][Tokenizer.EOF_TOKEN]=eofInBody,_[IN_CELL_MODE]=Object.create(null),_[IN_CELL_MODE][Tokenizer.CHARACTER_TOKEN]=characterInBody,_[IN_CELL_MODE][Tokenizer.NULL_CHARACTER_TOKEN]=ignoreToken,_[IN_CELL_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN]=whitespaceCharacterInBody,_[IN_CELL_MODE][Tokenizer.COMMENT_TOKEN]=appendComment,_[IN_CELL_MODE][Tokenizer.DOCTYPE_TOKEN]=ignoreToken,_[IN_CELL_MODE][Tokenizer.START_TAG_TOKEN]=startTagInCell,_[IN_CELL_MODE][Tokenizer.END_TAG_TOKEN]=endTagInCell,_[IN_CELL_MODE][Tokenizer.EOF_TOKEN]=eofInBody,_[IN_SELECT_MODE]=Object.create(null),_[IN_SELECT_MODE][Tokenizer.CHARACTER_TOKEN]=insertCharacters,_[IN_SELECT_MODE][Tokenizer.NULL_CHARACTER_TOKEN]=ignoreToken,_[IN_SELECT_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN]=insertCharacters,_[IN_SELECT_MODE][Tokenizer.COMMENT_TOKEN]=appendComment,_[IN_SELECT_MODE][Tokenizer.DOCTYPE_TOKEN]=ignoreToken,_[IN_SELECT_MODE][Tokenizer.START_TAG_TOKEN]=startTagInSelect,_[IN_SELECT_MODE][Tokenizer.END_TAG_TOKEN]=endTagInSelect,_[IN_SELECT_MODE][Tokenizer.EOF_TOKEN]=eofInBody,_[IN_SELECT_IN_TABLE_MODE]=Object.create(null),_[IN_SELECT_IN_TABLE_MODE][Tokenizer.CHARACTER_TOKEN]=insertCharacters,_[IN_SELECT_IN_TABLE_MODE][Tokenizer.NULL_CHARACTER_TOKEN]=ignoreToken,_[IN_SELECT_IN_TABLE_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN]=insertCharacters,_[IN_SELECT_IN_TABLE_MODE][Tokenizer.COMMENT_TOKEN]=appendComment,_[IN_SELECT_IN_TABLE_MODE][Tokenizer.DOCTYPE_TOKEN]=ignoreToken,_[IN_SELECT_IN_TABLE_MODE][Tokenizer.START_TAG_TOKEN]=startTagInSelectInTable,_[IN_SELECT_IN_TABLE_MODE][Tokenizer.END_TAG_TOKEN]=endTagInSelectInTable,_[IN_SELECT_IN_TABLE_MODE][Tokenizer.EOF_TOKEN]=eofInBody,_[IN_TEMPLATE_MODE]=Object.create(null),_[IN_TEMPLATE_MODE][Tokenizer.CHARACTER_TOKEN]=characterInBody,_[IN_TEMPLATE_MODE][Tokenizer.NULL_CHARACTER_TOKEN]=ignoreToken,_[IN_TEMPLATE_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN]=whitespaceCharacterInBody,_[IN_TEMPLATE_MODE][Tokenizer.COMMENT_TOKEN]=appendComment,_[IN_TEMPLATE_MODE][Tokenizer.DOCTYPE_TOKEN]=ignoreToken,_[IN_TEMPLATE_MODE][Tokenizer.START_TAG_TOKEN]=startTagInTemplate,_[IN_TEMPLATE_MODE][Tokenizer.END_TAG_TOKEN]=endTagInTemplate,_[IN_TEMPLATE_MODE][Tokenizer.EOF_TOKEN]=eofInTemplate,_[AFTER_BODY_MODE]=Object.create(null),_[AFTER_BODY_MODE][Tokenizer.CHARACTER_TOKEN]=_[AFTER_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN]=tokenAfterBody,_[AFTER_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN]=whitespaceCharacterInBody,_[AFTER_BODY_MODE][Tokenizer.COMMENT_TOKEN]=appendCommentToRootHtmlElement,_[AFTER_BODY_MODE][Tokenizer.DOCTYPE_TOKEN]=ignoreToken,_[AFTER_BODY_MODE][Tokenizer.START_TAG_TOKEN]=startTagAfterBody,_[AFTER_BODY_MODE][Tokenizer.END_TAG_TOKEN]=endTagAfterBody,_[AFTER_BODY_MODE][Tokenizer.EOF_TOKEN]=stopParsing,_[IN_FRAMESET_MODE]=Object.create(null),_[IN_FRAMESET_MODE][Tokenizer.CHARACTER_TOKEN]=_[IN_FRAMESET_MODE][Tokenizer.NULL_CHARACTER_TOKEN]=ignoreToken,_[IN_FRAMESET_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN]=insertCharacters,_[IN_FRAMESET_MODE][Tokenizer.COMMENT_TOKEN]=appendComment,_[IN_FRAMESET_MODE][Tokenizer.DOCTYPE_TOKEN]=ignoreToken,_[IN_FRAMESET_MODE][Tokenizer.START_TAG_TOKEN]=startTagInFrameset,_[IN_FRAMESET_MODE][Tokenizer.END_TAG_TOKEN]=endTagInFrameset,_[IN_FRAMESET_MODE][Tokenizer.EOF_TOKEN]=stopParsing,_[AFTER_FRAMESET_MODE]=Object.create(null),_[AFTER_FRAMESET_MODE][Tokenizer.CHARACTER_TOKEN]=_[AFTER_FRAMESET_MODE][Tokenizer.NULL_CHARACTER_TOKEN]=ignoreToken,_[AFTER_FRAMESET_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN]=insertCharacters,_[AFTER_FRAMESET_MODE][Tokenizer.COMMENT_TOKEN]=appendComment,_[AFTER_FRAMESET_MODE][Tokenizer.DOCTYPE_TOKEN]=ignoreToken,_[AFTER_FRAMESET_MODE][Tokenizer.START_TAG_TOKEN]=startTagAfterFrameset,_[AFTER_FRAMESET_MODE][Tokenizer.END_TAG_TOKEN]=endTagAfterFrameset,_[AFTER_FRAMESET_MODE][Tokenizer.EOF_TOKEN]=stopParsing,_[AFTER_AFTER_BODY_MODE]=Object.create(null),_[AFTER_AFTER_BODY_MODE][Tokenizer.CHARACTER_TOKEN]=tokenAfterAfterBody,_[AFTER_AFTER_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN]=tokenAfterAfterBody,_[AFTER_AFTER_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN]=whitespaceCharacterInBody,_[AFTER_AFTER_BODY_MODE][Tokenizer.COMMENT_TOKEN]=appendCommentToDocument,_[AFTER_AFTER_BODY_MODE][Tokenizer.DOCTYPE_TOKEN]=ignoreToken,_[AFTER_AFTER_BODY_MODE][Tokenizer.START_TAG_TOKEN]=startTagAfterAfterBody,_[AFTER_AFTER_BODY_MODE][Tokenizer.END_TAG_TOKEN]=tokenAfterAfterBody,_[AFTER_AFTER_BODY_MODE][Tokenizer.EOF_TOKEN]=stopParsing,_[AFTER_AFTER_FRAMESET_MODE]=Object.create(null),_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.CHARACTER_TOKEN]=_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.NULL_CHARACTER_TOKEN]=ignoreToken,_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN]=whitespaceCharacterInBody,_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.COMMENT_TOKEN]=appendCommentToDocument,_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.DOCTYPE_TOKEN]=ignoreToken,_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.START_TAG_TOKEN]=startTagAfterAfterFrameset,_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.END_TAG_TOKEN]=ignoreToken,_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.EOF_TOKEN]=stopParsing;var Parser=module.exports=function(options){this.options=mergeOptions(DEFAULT_OPTIONS,options),this.treeAdapter=this.options.treeAdapter,this.pendingScript=null,this.options.locationInfo&&new LocationInfoParserMixin(this)};Parser.prototype.parse=function(html){var document=this.treeAdapter.createDocument();return this._bootstrap(document,null),this.tokenizer.write(html,!0),this._runParsingLoop(null),document},Parser.prototype.parseFragment=function(html,fragmentContext){fragmentContext||(fragmentContext=this.treeAdapter.createElement($.TEMPLATE,NS.HTML,[]));var documentMock=this.treeAdapter.createElement("documentmock",NS.HTML,[]);this._bootstrap(documentMock,fragmentContext),this.treeAdapter.getTagName(fragmentContext)===$.TEMPLATE&&this._pushTmplInsertionMode(IN_TEMPLATE_MODE),this._initTokenizerForFragmentParsing(),this._insertFakeRootElement(),this._resetInsertionMode(),this._findFormInFragmentContext(),this.tokenizer.write(html,!0),this._runParsingLoop(null);var rootElement=this.treeAdapter.getFirstChild(documentMock),fragment=this.treeAdapter.createDocumentFragment();return this._adoptNodes(rootElement,fragment),fragment},Parser.prototype._bootstrap=function(document,fragmentContext){this.tokenizer=new Tokenizer(this.options),this.stopped=!1,this.insertionMode=INITIAL_MODE,this.originalInsertionMode="",this.document=document,this.fragmentContext=fragmentContext,this.headElement=null,this.formElement=null,this.openElements=new OpenElementStack(this.document,this.treeAdapter),this.activeFormattingElements=new FormattingElementList(this.treeAdapter),this.tmplInsertionModeStack=[],this.tmplInsertionModeStackTop=-1,this.currentTmplInsertionMode=null,this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1},Parser.prototype._runParsingLoop=function(scriptHandler){for(;!this.stopped;){this._setupTokenizerCDATAMode();var token=this.tokenizer.getNextToken();if(token.type===Tokenizer.HIBERNATION_TOKEN)break;if(this.skipNextNewLine&&(this.skipNextNewLine=!1,token.type===Tokenizer.WHITESPACE_CHARACTER_TOKEN&&"\n"===token.chars[0])){if(1===token.chars.length)continue;token.chars=token.chars.substr(1)}if(this._processInputToken(token),scriptHandler&&this.pendingScript)break}},Parser.prototype.runParsingLoopForCurrentChunk=function(writeCallback,scriptHandler){if(this._runParsingLoop(scriptHandler),scriptHandler&&this.pendingScript){var script=this.pendingScript;return this.pendingScript=null,void scriptHandler(script)}writeCallback&&writeCallback()},Parser.prototype._setupTokenizerCDATAMode=function(){var current=this._getAdjustedCurrentElement();this.tokenizer.allowCDATA=current&¤t!==this.document&&this.treeAdapter.getNamespaceURI(current)!==NS.HTML&&!this._isIntegrationPoint(current)},Parser.prototype._switchToTextParsing=function(currentToken,nextTokenizerState){this._insertElement(currentToken,NS.HTML),this.tokenizer.state=nextTokenizerState,this.originalInsertionMode=this.insertionMode,this.insertionMode=TEXT_MODE},Parser.prototype.switchToPlaintextParsing=function(){this.insertionMode=TEXT_MODE,this.originalInsertionMode=IN_BODY_MODE,this.tokenizer.state=Tokenizer.MODE.PLAINTEXT},Parser.prototype._getAdjustedCurrentElement=function(){return 0===this.openElements.stackTop&&this.fragmentContext?this.fragmentContext:this.openElements.current},Parser.prototype._findFormInFragmentContext=function(){var node=this.fragmentContext;do{if(this.treeAdapter.getTagName(node)===$.FORM){this.formElement=node;break}node=this.treeAdapter.getParentNode(node)}while(node)},Parser.prototype._initTokenizerForFragmentParsing=function(){if(this.treeAdapter.getNamespaceURI(this.fragmentContext)===NS.HTML){var tn=this.treeAdapter.getTagName(this.fragmentContext);tn===$.TITLE||tn===$.TEXTAREA?this.tokenizer.state=Tokenizer.MODE.RCDATA:tn===$.STYLE||tn===$.XMP||tn===$.IFRAME||tn===$.NOEMBED||tn===$.NOFRAMES||tn===$.NOSCRIPT?this.tokenizer.state=Tokenizer.MODE.RAWTEXT:tn===$.SCRIPT?this.tokenizer.state=Tokenizer.MODE.SCRIPT_DATA:tn===$.PLAINTEXT&&(this.tokenizer.state=Tokenizer.MODE.PLAINTEXT)}},Parser.prototype._setDocumentType=function(token){this.treeAdapter.setDocumentType(this.document,token.name,token.publicId,token.systemId)},Parser.prototype._attachElementToTree=function(element){if(this._shouldFosterParentOnInsertion())this._fosterParentElement(element);else{var parent=this.openElements.currentTmplContent||this.openElements.current;this.treeAdapter.appendChild(parent,element)}},Parser.prototype._appendElement=function(token,namespaceURI){var element=this.treeAdapter.createElement(token.tagName,namespaceURI,token.attrs);this._attachElementToTree(element)},Parser.prototype._insertElement=function(token,namespaceURI){var element=this.treeAdapter.createElement(token.tagName,namespaceURI,token.attrs);this._attachElementToTree(element),this.openElements.push(element)},Parser.prototype._insertFakeElement=function(tagName){var element=this.treeAdapter.createElement(tagName,NS.HTML,[]);this._attachElementToTree(element),this.openElements.push(element)},Parser.prototype._insertTemplate=function(token){var tmpl=this.treeAdapter.createElement(token.tagName,NS.HTML,token.attrs),content=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(tmpl,content),this._attachElementToTree(tmpl),this.openElements.push(tmpl)},Parser.prototype._insertFakeRootElement=function(){var element=this.treeAdapter.createElement($.HTML,NS.HTML,[]);this.treeAdapter.appendChild(this.openElements.current,element),this.openElements.push(element)},Parser.prototype._appendCommentNode=function(token,parent){var commentNode=this.treeAdapter.createCommentNode(token.data);this.treeAdapter.appendChild(parent,commentNode)},Parser.prototype._insertCharacters=function(token){if(this._shouldFosterParentOnInsertion())this._fosterParentText(token.chars);else{var parent=this.openElements.currentTmplContent||this.openElements.current;this.treeAdapter.insertText(parent,token.chars)}},Parser.prototype._adoptNodes=function(donor,recipient){for(;;){var child=this.treeAdapter.getFirstChild(donor);if(!child)break;this.treeAdapter.detachNode(child),this.treeAdapter.appendChild(recipient,child)}},Parser.prototype._shouldProcessTokenInForeignContent=function(token){var current=this._getAdjustedCurrentElement();if(!current||current===this.document)return!1;var ns=this.treeAdapter.getNamespaceURI(current);if(ns===NS.HTML)return!1;if(this.treeAdapter.getTagName(current)===$.ANNOTATION_XML&&ns===NS.MATHML&&token.type===Tokenizer.START_TAG_TOKEN&&token.tagName===$.SVG)return!1;var isCharacterToken=token.type===Tokenizer.CHARACTER_TOKEN||token.type===Tokenizer.NULL_CHARACTER_TOKEN||token.type===Tokenizer.WHITESPACE_CHARACTER_TOKEN,isMathMLTextStartTag=token.type===Tokenizer.START_TAG_TOKEN&&token.tagName!==$.MGLYPH&&token.tagName!==$.MALIGNMARK;return(!isMathMLTextStartTag&&!isCharacterToken||!this._isIntegrationPoint(current,NS.MATHML))&&((token.type!==Tokenizer.START_TAG_TOKEN&&!isCharacterToken||!this._isIntegrationPoint(current,NS.HTML))&&token.type!==Tokenizer.EOF_TOKEN)},Parser.prototype._processToken=function(token){_[this.insertionMode][token.type](this,token)},Parser.prototype._processTokenInBodyMode=function(token){_[IN_BODY_MODE][token.type](this,token)},Parser.prototype._processTokenInForeignContent=function(token){token.type===Tokenizer.CHARACTER_TOKEN?characterInForeignContent(this,token):token.type===Tokenizer.NULL_CHARACTER_TOKEN?nullCharacterInForeignContent(this,token):token.type===Tokenizer.WHITESPACE_CHARACTER_TOKEN?insertCharacters(this,token):token.type===Tokenizer.COMMENT_TOKEN?appendComment(this,token):token.type===Tokenizer.START_TAG_TOKEN?startTagInForeignContent(this,token):token.type===Tokenizer.END_TAG_TOKEN&&endTagInForeignContent(this,token)},Parser.prototype._processInputToken=function(token){this._shouldProcessTokenInForeignContent(token)?this._processTokenInForeignContent(token):this._processToken(token)},Parser.prototype._isIntegrationPoint=function(element,foreignNS){var tn=this.treeAdapter.getTagName(element),ns=this.treeAdapter.getNamespaceURI(element),attrs=this.treeAdapter.getAttrList(element);return foreignContent.isIntegrationPoint(tn,ns,attrs,foreignNS)},Parser.prototype._reconstructActiveFormattingElements=function(){var listLength=this.activeFormattingElements.length;if(listLength){var unopenIdx=listLength,entry=null;do if(unopenIdx--,entry=this.activeFormattingElements.entries[unopenIdx],entry.type===FormattingElementList.MARKER_ENTRY||this.openElements.contains(entry.element)){unopenIdx++;break}while(unopenIdx>0);for(var i=unopenIdx;i=0;i--){var element=this.openElements.items[i];0===i&&(last=!0,this.fragmentContext&&(element=this.fragmentContext));var tn=this.treeAdapter.getTagName(element),newInsertionMode=INSERTION_MODE_RESET_MAP[tn];if(newInsertionMode){this.insertionMode=newInsertionMode;break}if(!(last||tn!==$.TD&&tn!==$.TH)){this.insertionMode=IN_CELL_MODE;break}if(!last&&tn===$.HEAD){this.insertionMode=IN_HEAD_MODE;break}if(tn===$.SELECT){this._resetInsertionModeForSelect(i);break}if(tn===$.TEMPLATE){this.insertionMode=this.currentTmplInsertionMode;break}if(tn===$.HTML){this.insertionMode=this.headElement?AFTER_HEAD_MODE:BEFORE_HEAD_MODE;break}if(last){this.insertionMode=IN_BODY_MODE;break}}},Parser.prototype._resetInsertionModeForSelect=function(selectIdx){if(selectIdx>0)for(var i=selectIdx-1;i>0;i--){var ancestor=this.openElements.items[i],tn=this.treeAdapter.getTagName(ancestor);if(tn===$.TEMPLATE)break;if(tn===$.TABLE)return void(this.insertionMode=IN_SELECT_IN_TABLE_MODE)}this.insertionMode=IN_SELECT_MODE},Parser.prototype._pushTmplInsertionMode=function(mode){this.tmplInsertionModeStack.push(mode),this.tmplInsertionModeStackTop++,this.currentTmplInsertionMode=mode},Parser.prototype._popTmplInsertionMode=function(){this.tmplInsertionModeStack.pop(),this.tmplInsertionModeStackTop--,this.currentTmplInsertionMode=this.tmplInsertionModeStack[this.tmplInsertionModeStackTop]},Parser.prototype._isElementCausesFosterParenting=function(element){var tn=this.treeAdapter.getTagName(element);return tn===$.TABLE||tn===$.TBODY||tn===$.TFOOT||tn===$.THEAD||tn===$.TR},Parser.prototype._shouldFosterParentOnInsertion=function(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.current)},Parser.prototype._findFosterParentingLocation=function(){for(var location={parent:null,beforeElement:null},i=this.openElements.stackTop;i>=0;i--){var openElement=this.openElements.items[i],tn=this.treeAdapter.getTagName(openElement),ns=this.treeAdapter.getNamespaceURI(openElement);if(tn===$.TEMPLATE&&ns===NS.HTML){location.parent=this.treeAdapter.getTemplateContent(openElement);break}if(tn===$.TABLE){location.parent=this.treeAdapter.getParentNode(openElement),location.parent?location.beforeElement=openElement:location.parent=this.openElements.items[i-1];break}}return location.parent||(location.parent=this.openElements.items[0]),location},Parser.prototype._fosterParentElement=function(element){var location=this._findFosterParentingLocation();location.beforeElement?this.treeAdapter.insertBefore(location.parent,element,location.beforeElement):this.treeAdapter.appendChild(location.parent,element)},Parser.prototype._fosterParentText=function(chars){var location=this._findFosterParentingLocation();location.beforeElement?this.treeAdapter.insertTextBefore(location.parent,chars,location.beforeElement):this.treeAdapter.insertText(location.parent,chars)},Parser.prototype._isSpecialElement=function(element){var tn=this.treeAdapter.getTagName(element),ns=this.treeAdapter.getNamespaceURI(element);return HTML.SPECIAL_ELEMENTS[ns][tn]}},{"../common/doctype":306,"../common/foreign_content":307,"../common/html":308,"../common/unicode":309,"../extensions/location_info/parser_mixin":311,"../tokenizer":325,"../tree_adapters/default":328,"../utils/merge_options":330,"./formatting_element_list":315,"./open_element_stack":317}],317:[function(require,module,exports){"use strict";function isImpliedEndTagRequired(tn){switch(tn.length){case 1:return tn===$.P;case 2:return tn===$.RB||tn===$.RP||tn===$.RT||tn===$.DD||tn===$.DT||tn===$.LI;case 3:return tn===$.RTC;case 6:return tn===$.OPTION;case 8:return tn===$.OPTGROUP||tn===$.MENUITEM}return!1}function isScopingElement(tn,ns){switch(tn.length){case 2:if(tn===$.TD||tn===$.TH)return ns===NS.HTML;if(tn===$.MI||tn===$.MO||tn===$.MN||tn===$.MS)return ns===NS.MATHML;break;case 4:if(tn===$.HTML)return ns===NS.HTML;if(tn===$.DESC)return ns===NS.SVG;break;case 5:if(tn===$.TABLE)return ns===NS.HTML;if(tn===$.MTEXT)return ns===NS.MATHML;if(tn===$.TITLE)return ns===NS.SVG;break;case 6:return(tn===$.APPLET||tn===$.OBJECT)&&ns===NS.HTML;case 7:return(tn===$.CAPTION||tn===$.MARQUEE)&&ns===NS.HTML;case 8:return tn===$.TEMPLATE&&ns===NS.HTML;case 13:return tn===$.FOREIGN_OBJECT&&ns===NS.SVG;case 14:return tn===$.ANNOTATION_XML&&ns===NS.MATHML}return!1}var HTML=require("../common/html"),$=HTML.TAG_NAMES,NS=HTML.NAMESPACES,OpenElementStack=module.exports=function(document,treeAdapter){this.stackTop=-1,this.items=[],this.current=document,this.currentTagName=null,this.currentTmplContent=null,this.tmplCount=0,this.treeAdapter=treeAdapter};OpenElementStack.prototype._indexOf=function(element){for(var idx=-1,i=this.stackTop;i>=0;i--)if(this.items[i]===element){idx=i;break}return idx},OpenElementStack.prototype._isInTemplate=function(){return this.currentTagName===$.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===NS.HTML},OpenElementStack.prototype._updateCurrentElement=function(){this.current=this.items[this.stackTop],this.currentTagName=this.current&&this.treeAdapter.getTagName(this.current),this.currentTmplContent=this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):null},OpenElementStack.prototype.push=function(element){this.items[++this.stackTop]=element,this._updateCurrentElement(),this._isInTemplate()&&this.tmplCount++},OpenElementStack.prototype.pop=function(){this.stackTop--,this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this._updateCurrentElement()},OpenElementStack.prototype.replace=function(oldElement,newElement){var idx=this._indexOf(oldElement);this.items[idx]=newElement,idx===this.stackTop&&this._updateCurrentElement()},OpenElementStack.prototype.insertAfter=function(referenceElement,newElement){var insertionIdx=this._indexOf(referenceElement)+1;this.items.splice(insertionIdx,0,newElement),insertionIdx===++this.stackTop&&this._updateCurrentElement()},OpenElementStack.prototype.popUntilTagNamePopped=function(tagName){for(;this.stackTop>-1;){var tn=this.currentTagName,ns=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),tn===tagName&&ns===NS.HTML)break}},OpenElementStack.prototype.popUntilElementPopped=function(element){for(;this.stackTop>-1;){var poppedElement=this.current;if(this.pop(),poppedElement===element)break}},OpenElementStack.prototype.popUntilNumberedHeaderPopped=function(){for(;this.stackTop>-1;){var tn=this.currentTagName,ns=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),tn===$.H1||tn===$.H2||tn===$.H3||tn===$.H4||tn===$.H5||tn===$.H6&&ns===NS.HTML)break}},OpenElementStack.prototype.popUntilTableCellPopped=function(){for(;this.stackTop>-1;){var tn=this.currentTagName,ns=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),tn===$.TD||tn===$.TH&&ns===NS.HTML)break}},OpenElementStack.prototype.popAllUpToHtmlElement=function(){this.stackTop=0,this._updateCurrentElement()},OpenElementStack.prototype.clearBackToTableContext=function(){for(;this.currentTagName!==$.TABLE&&this.currentTagName!==$.TEMPLATE&&this.currentTagName!==$.HTML||this.treeAdapter.getNamespaceURI(this.current)!==NS.HTML;)this.pop()},OpenElementStack.prototype.clearBackToTableBodyContext=function(){for(;this.currentTagName!==$.TBODY&&this.currentTagName!==$.TFOOT&&this.currentTagName!==$.THEAD&&this.currentTagName!==$.TEMPLATE&&this.currentTagName!==$.HTML||this.treeAdapter.getNamespaceURI(this.current)!==NS.HTML;)this.pop()},OpenElementStack.prototype.clearBackToTableRowContext=function(){for(;this.currentTagName!==$.TR&&this.currentTagName!==$.TEMPLATE&&this.currentTagName!==$.HTML||this.treeAdapter.getNamespaceURI(this.current)!==NS.HTML;)this.pop()},OpenElementStack.prototype.remove=function(element){for(var i=this.stackTop;i>=0;i--)if(this.items[i]===element){this.items.splice(i,1),this.stackTop--,this._updateCurrentElement();break}},OpenElementStack.prototype.tryPeekProperlyNestedBodyElement=function(){var element=this.items[1];return element&&this.treeAdapter.getTagName(element)===$.BODY?element:null},OpenElementStack.prototype.contains=function(element){return this._indexOf(element)>-1},OpenElementStack.prototype.getCommonAncestor=function(element){var elementIdx=this._indexOf(element);return--elementIdx>=0?this.items[elementIdx]:null},OpenElementStack.prototype.isRootHtmlElementCurrent=function(){return 0===this.stackTop&&this.currentTagName===$.HTML},OpenElementStack.prototype.hasInScope=function(tagName){for(var i=this.stackTop;i>=0;i--){var tn=this.treeAdapter.getTagName(this.items[i]),ns=this.treeAdapter.getNamespaceURI(this.items[i]);if(tn===tagName&&ns===NS.HTML)return!0;if(isScopingElement(tn,ns))return!1}return!0},OpenElementStack.prototype.hasNumberedHeaderInScope=function(){for(var i=this.stackTop;i>=0;i--){var tn=this.treeAdapter.getTagName(this.items[i]),ns=this.treeAdapter.getNamespaceURI(this.items[i]);if((tn===$.H1||tn===$.H2||tn===$.H3||tn===$.H4||tn===$.H5||tn===$.H6)&&ns===NS.HTML)return!0;if(isScopingElement(tn,ns))return!1}return!0},OpenElementStack.prototype.hasInListItemScope=function(tagName){for(var i=this.stackTop;i>=0;i--){var tn=this.treeAdapter.getTagName(this.items[i]),ns=this.treeAdapter.getNamespaceURI(this.items[i]);if(tn===tagName&&ns===NS.HTML)return!0;if((tn===$.UL||tn===$.OL)&&ns===NS.HTML||isScopingElement(tn,ns))return!1}return!0},OpenElementStack.prototype.hasInButtonScope=function(tagName){for(var i=this.stackTop;i>=0;i--){var tn=this.treeAdapter.getTagName(this.items[i]),ns=this.treeAdapter.getNamespaceURI(this.items[i]);if(tn===tagName&&ns===NS.HTML)return!0;if(tn===$.BUTTON&&ns===NS.HTML||isScopingElement(tn,ns))return!1}return!0},OpenElementStack.prototype.hasInTableScope=function(tagName){for(var i=this.stackTop;i>=0;i--){var tn=this.treeAdapter.getTagName(this.items[i]),ns=this.treeAdapter.getNamespaceURI(this.items[i]);if(ns===NS.HTML){if(tn===tagName)return!0;if(tn===$.TABLE||tn===$.TEMPLATE||tn===$.HTML)return!1}}return!0},OpenElementStack.prototype.hasTableBodyContextInTableScope=function(){for(var i=this.stackTop;i>=0;i--){var tn=this.treeAdapter.getTagName(this.items[i]),ns=this.treeAdapter.getNamespaceURI(this.items[i]);if(ns===NS.HTML){if(tn===$.TBODY||tn===$.THEAD||tn===$.TFOOT)return!0; -if(tn===$.TABLE||tn===$.HTML)return!1}}return!0},OpenElementStack.prototype.hasInSelectScope=function(tagName){for(var i=this.stackTop;i>=0;i--){var tn=this.treeAdapter.getTagName(this.items[i]),ns=this.treeAdapter.getNamespaceURI(this.items[i]);if(ns===NS.HTML){if(tn===tagName)return!0;if(tn!==$.OPTION&&tn!==$.OPTGROUP)return!1}}return!0},OpenElementStack.prototype.generateImpliedEndTags=function(){for(;isImpliedEndTagRequired(this.currentTagName);)this.pop()},OpenElementStack.prototype.generateImpliedEndTagsWithExclusion=function(exclusionTagName){for(;isImpliedEndTagRequired(this.currentTagName)&&this.currentTagName!==exclusionTagName;)this.pop()}},{"../common/html":308}],318:[function(require,module,exports){"use strict";var WritableStream=require("stream").Writable,inherits=require("util").inherits,Parser=require("./index"),ParserStream=module.exports=function(options){WritableStream.call(this),this.parser=new Parser(options),this.lastChunkWritten=!1,this.writeCallback=null,this.pausedByScript=!1,this.document=this.parser.treeAdapter.createDocument(),this.pendingHtmlInsertions=[],this._resume=this._resume.bind(this),this._documentWrite=this._documentWrite.bind(this),this._scriptHandler=this._scriptHandler.bind(this),this.parser._bootstrap(this.document,null)};inherits(ParserStream,WritableStream),ParserStream.prototype._write=function(chunk,encoding,callback){this.writeCallback=callback,this.parser.tokenizer.write(chunk.toString("utf8"),this.lastChunkWritten),this._runParsingLoop()},ParserStream.prototype.end=function(chunk,encoding,callback){this.lastChunkWritten=!0,WritableStream.prototype.end.call(this,chunk||"",encoding,callback)},ParserStream.prototype._runParsingLoop=function(){this.parser.runParsingLoopForCurrentChunk(this.writeCallback,this._scriptHandler)},ParserStream.prototype._resume=function(){if(!this.pausedByScript)throw new Error("Parser was already resumed");for(;this.pendingHtmlInsertions.length;){var html=this.pendingHtmlInsertions.pop();this.parser.tokenizer.insertHtmlAtCurrentPos(html)}this.pausedByScript=!1,this.parser.tokenizer.active&&this._runParsingLoop()},ParserStream.prototype._documentWrite=function(html){this.parser.stopped||this.pendingHtmlInsertions.push(html)},ParserStream.prototype._scriptHandler=function(scriptElement){this.listeners("script").length?(this.pausedByScript=!0,this.emit("script",scriptElement,this._documentWrite,this._resume)):this._runParsingLoop()}},{"./index":316,stream:334,util:354}],319:[function(require,module,exports){"use strict";var ParserStream=require("./parser_stream"),inherits=require("util").inherits,$=require("../common/html").TAG_NAMES,PlainTextConversionStream=module.exports=function(options){ParserStream.call(this,options),this.parser._insertFakeElement($.HTML),this.parser._insertFakeElement($.HEAD),this.parser.openElements.pop(),this.parser._insertFakeElement($.BODY),this.parser._insertFakeElement($.PRE),this.parser.treeAdapter.insertText(this.parser.openElements.current,"\n"),this.parser.switchToPlaintextParsing()};inherits(PlainTextConversionStream,ParserStream)},{"../common/html":308,"./parser_stream":318,util:354}],320:[function(require,module,exports){"use strict";var WritableStream=require("stream").Writable,util=require("util"),DevNullStream=module.exports=function(){WritableStream.call(this)};util.inherits(DevNullStream,WritableStream),DevNullStream.prototype._write=function(chunk,encoding,cb){cb()}},{stream:334,util:354}],321:[function(require,module,exports){"use strict";var TransformStream=require("stream").Transform,DevNullStream=require("./dev_null_stream"),inherits=require("util").inherits,Tokenizer=require("../tokenizer"),LocationInfoTokenizerMixin=require("../extensions/location_info/tokenizer_mixin"),ParserFeedbackSimulator=require("./parser_feedback_simulator"),mergeOptions=require("../utils/merge_options"),DEFAULT_OPTIONS={locationInfo:!1},SAXParser=module.exports=function(options){TransformStream.call(this),this.options=mergeOptions(DEFAULT_OPTIONS,options),this.tokenizer=new Tokenizer(options),this.options.locationInfo&&new LocationInfoTokenizerMixin(this.tokenizer),this.parserFeedbackSimulator=new ParserFeedbackSimulator(this.tokenizer),this.pendingText=null,this.currentTokenLocation=void 0,this.lastChunkWritten=!1,this.stopped=!1,this.pipe(new DevNullStream)};inherits(SAXParser,TransformStream),SAXParser.prototype._transform=function(chunk,encoding,callback){this.stopped||(this.tokenizer.write(chunk.toString("utf8"),this.lastChunkWritten),this._runParsingLoop()),this.push(chunk),callback()},SAXParser.prototype._flush=function(callback){callback()},SAXParser.prototype.end=function(chunk,encoding,callback){this.lastChunkWritten=!0,TransformStream.prototype.end.call(this,chunk,encoding,callback)},SAXParser.prototype.stop=function(){this.stopped=!0},SAXParser.prototype._runParsingLoop=function(){do{var token=this.parserFeedbackSimulator.getNextToken();if(token.type===Tokenizer.HIBERNATION_TOKEN)break;token.type===Tokenizer.CHARACTER_TOKEN||token.type===Tokenizer.WHITESPACE_CHARACTER_TOKEN||token.type===Tokenizer.NULL_CHARACTER_TOKEN?(this.options.locationInfo&&(null===this.pendingText?this.currentTokenLocation=token.location:this.currentTokenLocation.endOffset=token.location.endOffset),this.pendingText=(this.pendingText||"")+token.chars):(this._emitPendingText(),this._handleToken(token))}while(!this.stopped&&token.type!==Tokenizer.EOF_TOKEN)},SAXParser.prototype._handleToken=function(token){this.options.locationInfo&&(this.currentTokenLocation=token.location),token.type===Tokenizer.START_TAG_TOKEN?this.emit("startTag",token.tagName,token.attrs,token.selfClosing,this.currentTokenLocation):token.type===Tokenizer.END_TAG_TOKEN?this.emit("endTag",token.tagName,this.currentTokenLocation):token.type===Tokenizer.COMMENT_TOKEN?this.emit("comment",token.data,this.currentTokenLocation):token.type===Tokenizer.DOCTYPE_TOKEN&&this.emit("doctype",token.name,token.publicId,token.systemId,this.currentTokenLocation)},SAXParser.prototype._emitPendingText=function(){null!==this.pendingText&&(this.emit("text",this.pendingText,this.currentTokenLocation),this.pendingText=null)}},{"../extensions/location_info/tokenizer_mixin":312,"../tokenizer":325,"../utils/merge_options":330,"./dev_null_stream":320,"./parser_feedback_simulator":322,stream:334,util:354}],322:[function(require,module,exports){"use strict";var Tokenizer=require("../tokenizer"),foreignContent=require("../common/foreign_content"),UNICODE=require("../common/unicode"),HTML=require("../common/html"),$=HTML.TAG_NAMES,NS=HTML.NAMESPACES,ParserFeedbackSimulator=module.exports=function(tokenizer){this.tokenizer=tokenizer,this.namespaceStack=[],this.namespaceStackTop=-1,this._enterNamespace(NS.HTML)};ParserFeedbackSimulator.prototype.getNextToken=function(){var token=this.tokenizer.getNextToken();if(token.type===Tokenizer.START_TAG_TOKEN)this._handleStartTagToken(token);else if(token.type===Tokenizer.END_TAG_TOKEN)this._handleEndTagToken(token);else if(token.type===Tokenizer.NULL_CHARACTER_TOKEN&&this.inForeignContent)token.type=Tokenizer.CHARACTER_TOKEN,token.chars=UNICODE.REPLACEMENT_CHARACTER;else if(this.skipNextNewLine&&(token.type!==Tokenizer.HIBERNATION_TOKEN&&(this.skipNextNewLine=!1),token.type===Tokenizer.WHITESPACE_CHARACTER_TOKEN&&"\n"===token.chars[0])){if(1===token.chars.length)return this.getNextToken();token.chars=token.chars.substr(1)}return token},ParserFeedbackSimulator.prototype._enterNamespace=function(namespace){this.namespaceStackTop++,this.namespaceStack.push(namespace),this.inForeignContent=namespace!==NS.HTML,this.currentNamespace=namespace,this.tokenizer.allowCDATA=this.inForeignContent},ParserFeedbackSimulator.prototype._leaveCurrentNamespace=function(){this.namespaceStackTop--,this.namespaceStack.pop(),this.currentNamespace=this.namespaceStack[this.namespaceStackTop],this.inForeignContent=this.currentNamespace!==NS.HTML,this.tokenizer.allowCDATA=this.inForeignContent},ParserFeedbackSimulator.prototype._ensureTokenizerMode=function(tn){tn===$.TEXTAREA||tn===$.TITLE?this.tokenizer.state=Tokenizer.MODE.RCDATA:tn===$.PLAINTEXT?this.tokenizer.state=Tokenizer.MODE.PLAINTEXT:tn===$.SCRIPT?this.tokenizer.state=Tokenizer.MODE.SCRIPT_DATA:tn!==$.STYLE&&tn!==$.IFRAME&&tn!==$.XMP&&tn!==$.NOEMBED&&tn!==$.NOFRAMES&&tn!==$.NOSCRIPT||(this.tokenizer.state=Tokenizer.MODE.RAWTEXT)},ParserFeedbackSimulator.prototype._handleStartTagToken=function(token){var tn=token.tagName;if(tn===$.SVG?this._enterNamespace(NS.SVG):tn===$.MATH&&this._enterNamespace(NS.MATHML),this.inForeignContent){if(foreignContent.causesExit(token))return void this._leaveCurrentNamespace();var currentNs=this.currentNamespace;currentNs===NS.MATHML?foreignContent.adjustTokenMathMLAttrs(token):currentNs===NS.SVG&&(foreignContent.adjustTokenSVGTagName(token),foreignContent.adjustTokenSVGAttrs(token)),foreignContent.adjustTokenXMLAttrs(token),tn=token.tagName,!token.selfClosing&&foreignContent.isIntegrationPoint(tn,currentNs,token.attrs)&&this._enterNamespace(NS.HTML)}else tn===$.PRE||tn===$.TEXTAREA||tn===$.LISTING?this.skipNextNewLine=!0:tn===$.IMAGE&&(token.tagName=$.IMG),this._ensureTokenizerMode(tn)},ParserFeedbackSimulator.prototype._handleEndTagToken=function(token){var tn=token.tagName;if(this.inForeignContent)(tn===$.SVG&&this.currentNamespace===NS.SVG||tn===$.MATH&&this.currentNamespace===NS.MATHML)&&this._leaveCurrentNamespace();else{var previousNs=this.namespaceStack[this.namespaceStackTop-1];previousNs===NS.SVG&&foreignContent.SVG_TAG_NAMES_ADJUSTMENT_MAP[tn]&&(tn=foreignContent.SVG_TAG_NAMES_ADJUSTMENT_MAP[tn]),foreignContent.isIntegrationPoint(tn,previousNs,token.attrs)&&this._leaveCurrentNamespace()}this.currentNamespace===NS.SVG&&foreignContent.adjustTokenSVGTagName(token)}},{"../common/foreign_content":307,"../common/html":308,"../common/unicode":309,"../tokenizer":325}],323:[function(require,module,exports){"use strict";var defaultTreeAdapter=require("../tree_adapters/default"),mergeOptions=require("../utils/merge_options"),doctype=require("../common/doctype"),HTML=require("../common/html"),$=HTML.TAG_NAMES,NS=HTML.NAMESPACES,DEFAULT_OPTIONS={treeAdapter:defaultTreeAdapter},AMP_REGEX=/&/g,NBSP_REGEX=/\u00a0/g,DOUBLE_QUOTE_REGEX=/"/g,LT_REGEX=//g,Serializer=module.exports=function(node,options){this.options=mergeOptions(DEFAULT_OPTIONS,options),this.treeAdapter=this.options.treeAdapter,this.html="",this.startNode=node};Serializer.escapeString=function(str,attrMode){return str=str.replace(AMP_REGEX,"&").replace(NBSP_REGEX," "),str=attrMode?str.replace(DOUBLE_QUOTE_REGEX,"""):str.replace(LT_REGEX,"<").replace(GT_REGEX,">")},Serializer.prototype.serialize=function(){return this._serializeChildNodes(this.startNode),this.html},Serializer.prototype._serializeChildNodes=function(parentNode){var childNodes=this.treeAdapter.getChildNodes(parentNode);if(childNodes)for(var i=0,cnLength=childNodes.length;i",tn!==$.AREA&&tn!==$.BASE&&tn!==$.BASEFONT&&tn!==$.BGSOUND&&tn!==$.BR&&tn!==$.BR&&tn!==$.COL&&tn!==$.EMBED&&tn!==$.FRAME&&tn!==$.HR&&tn!==$.IMG&&tn!==$.INPUT&&tn!==$.KEYGEN&&tn!==$.LINK&&tn!==$.MENUITEM&&tn!==$.META&&tn!==$.PARAM&&tn!==$.SOURCE&&tn!==$.TRACK&&tn!==$.WBR){var childNodesHolder=tn===$.TEMPLATE&&ns===NS.HTML?this.treeAdapter.getTemplateContent(node):node;this._serializeChildNodes(childNodesHolder),this.html+=""}},Serializer.prototype._serializeAttributes=function(node){for(var attrs=this.treeAdapter.getAttrList(node),i=0,attrsLength=attrs.length;i"},Serializer.prototype._serializeDocumentTypeNode=function(node){var name=this.treeAdapter.getDocumentTypeNodeName(node);this.html+="<"+doctype.serializeContent(name,null,null)+">"}},{"../common/doctype":306,"../common/html":308,"../tree_adapters/default":328,"../utils/merge_options":330}],324:[function(require,module,exports){"use strict";var ReadableStream=require("stream").Readable,inherits=require("util").inherits,Serializer=require("./index"),SerializerStream=module.exports=function(node,options){ReadableStream.call(this),this.serializer=new Serializer(node,options),Object.defineProperty(this.serializer,"html",{get:function(){return""},set:this.push.bind(this)})};inherits(SerializerStream,ReadableStream),SerializerStream.prototype._read=function(){this.serializer.serialize(),this.push(null)}},{"./index":323,stream:334,util:354}],325:[function(require,module,exports){"use strict";function isWhitespace(cp){return cp===$.SPACE||cp===$.LINE_FEED||cp===$.TABULATION||cp===$.FORM_FEED}function isAsciiDigit(cp){return cp>=$.DIGIT_0&&cp<=$.DIGIT_9}function isAsciiUpper(cp){return cp>=$.LATIN_CAPITAL_A&&cp<=$.LATIN_CAPITAL_Z}function isAsciiLower(cp){return cp>=$.LATIN_SMALL_A&&cp<=$.LATIN_SMALL_Z}function isAsciiLetter(cp){return isAsciiLower(cp)||isAsciiUpper(cp)}function isAsciiAlphaNumeric(cp){return isAsciiLetter(cp)||isAsciiDigit(cp)}function isDigit(cp,isHex){return isAsciiDigit(cp)||isHex&&(cp>=$.LATIN_CAPITAL_A&&cp<=$.LATIN_CAPITAL_F||cp>=$.LATIN_SMALL_A&&cp<=$.LATIN_SMALL_F)}function isReservedCodePoint(cp){return cp>=55296&&cp<=57343||cp>1114111}function toAsciiLowerCodePoint(cp){return cp+32}function toChar(cp){return cp<=65535?String.fromCharCode(cp):(cp-=65536,String.fromCharCode(cp>>>10&1023|55296)+String.fromCharCode(56320|1023&cp))}function toAsciiLowerChar(cp){return String.fromCharCode(toAsciiLowerCodePoint(cp))}function findNamedEntityTreeBranch(nodeIx,cp){for(var branchCount=neTree[++nodeIx],lo=++nodeIx,hi=lo+branchCount-1;lo<=hi;){var mid=lo+hi>>>1,midCp=neTree[mid];if(midCpcp))return neTree[mid+branchCount];hi=mid-1}}return-1}var Preprocessor=require("./preprocessor"),UNICODE=require("../common/unicode"),neTree=require("./named_entity_data"),$=UNICODE.CODE_POINTS,$$=UNICODE.CODE_POINT_SEQUENCES,NUMERIC_ENTITY_REPLACEMENTS={0:65533,13:13,128:8364,129:129,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,141:141,142:381,143:143,144:144,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,157:157,158:382,159:376},HAS_DATA_FLAG=1,DATA_DUPLET_FLAG=2,HAS_BRANCHES_FLAG=4,MAX_BRANCH_MARKER_VALUE=HAS_DATA_FLAG|DATA_DUPLET_FLAG|HAS_BRANCHES_FLAG,DATA_STATE="DATA_STATE",CHARACTER_REFERENCE_IN_DATA_STATE="CHARACTER_REFERENCE_IN_DATA_STATE",RCDATA_STATE="RCDATA_STATE",CHARACTER_REFERENCE_IN_RCDATA_STATE="CHARACTER_REFERENCE_IN_RCDATA_STATE",RAWTEXT_STATE="RAWTEXT_STATE",SCRIPT_DATA_STATE="SCRIPT_DATA_STATE",PLAINTEXT_STATE="PLAINTEXT_STATE",TAG_OPEN_STATE="TAG_OPEN_STATE",END_TAG_OPEN_STATE="END_TAG_OPEN_STATE",TAG_NAME_STATE="TAG_NAME_STATE",RCDATA_LESS_THAN_SIGN_STATE="RCDATA_LESS_THAN_SIGN_STATE",RCDATA_END_TAG_OPEN_STATE="RCDATA_END_TAG_OPEN_STATE",RCDATA_END_TAG_NAME_STATE="RCDATA_END_TAG_NAME_STATE",RAWTEXT_LESS_THAN_SIGN_STATE="RAWTEXT_LESS_THAN_SIGN_STATE",RAWTEXT_END_TAG_OPEN_STATE="RAWTEXT_END_TAG_OPEN_STATE",RAWTEXT_END_TAG_NAME_STATE="RAWTEXT_END_TAG_NAME_STATE",SCRIPT_DATA_LESS_THAN_SIGN_STATE="SCRIPT_DATA_LESS_THAN_SIGN_STATE",SCRIPT_DATA_END_TAG_OPEN_STATE="SCRIPT_DATA_END_TAG_OPEN_STATE",SCRIPT_DATA_END_TAG_NAME_STATE="SCRIPT_DATA_END_TAG_NAME_STATE",SCRIPT_DATA_ESCAPE_START_STATE="SCRIPT_DATA_ESCAPE_START_STATE",SCRIPT_DATA_ESCAPE_START_DASH_STATE="SCRIPT_DATA_ESCAPE_START_DASH_STATE",SCRIPT_DATA_ESCAPED_STATE="SCRIPT_DATA_ESCAPED_STATE",SCRIPT_DATA_ESCAPED_DASH_STATE="SCRIPT_DATA_ESCAPED_DASH_STATE",SCRIPT_DATA_ESCAPED_DASH_DASH_STATE="SCRIPT_DATA_ESCAPED_DASH_DASH_STATE",SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE",SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE="SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE",SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE="SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE",SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE="SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE",SCRIPT_DATA_DOUBLE_ESCAPED_STATE="SCRIPT_DATA_DOUBLE_ESCAPED_STATE",SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE",SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE",SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE",SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE="SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE",BEFORE_ATTRIBUTE_NAME_STATE="BEFORE_ATTRIBUTE_NAME_STATE",ATTRIBUTE_NAME_STATE="ATTRIBUTE_NAME_STATE",AFTER_ATTRIBUTE_NAME_STATE="AFTER_ATTRIBUTE_NAME_STATE",BEFORE_ATTRIBUTE_VALUE_STATE="BEFORE_ATTRIBUTE_VALUE_STATE",ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE="ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE",ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE="ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE",ATTRIBUTE_VALUE_UNQUOTED_STATE="ATTRIBUTE_VALUE_UNQUOTED_STATE",CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE="CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE",AFTER_ATTRIBUTE_VALUE_QUOTED_STATE="AFTER_ATTRIBUTE_VALUE_QUOTED_STATE",SELF_CLOSING_START_TAG_STATE="SELF_CLOSING_START_TAG_STATE",BOGUS_COMMENT_STATE="BOGUS_COMMENT_STATE",BOGUS_COMMENT_STATE_CONTINUATION="BOGUS_COMMENT_STATE_CONTINUATION",MARKUP_DECLARATION_OPEN_STATE="MARKUP_DECLARATION_OPEN_STATE",COMMENT_START_STATE="COMMENT_START_STATE",COMMENT_START_DASH_STATE="COMMENT_START_DASH_STATE",COMMENT_STATE="COMMENT_STATE",COMMENT_END_DASH_STATE="COMMENT_END_DASH_STATE",COMMENT_END_STATE="COMMENT_END_STATE",COMMENT_END_BANG_STATE="COMMENT_END_BANG_STATE",DOCTYPE_STATE="DOCTYPE_STATE",DOCTYPE_NAME_STATE="DOCTYPE_NAME_STATE",AFTER_DOCTYPE_NAME_STATE="AFTER_DOCTYPE_NAME_STATE",BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE",DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE",DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE",BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE",BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE",DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE",DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE",AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE="AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE",BOGUS_DOCTYPE_STATE="BOGUS_DOCTYPE_STATE",CDATA_SECTION_STATE="CDATA_SECTION_STATE",Tokenizer=module.exports=function(){this.preprocessor=new Preprocessor,this.tokenQueue=[],this.allowCDATA=!1,this.state=DATA_STATE,this.returnState="",this.tempBuff=[],this.additionalAllowedCp=void 0,this.lastStartTagName="",this.consumedAfterSnapshot=-1,this.active=!1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr=null};Tokenizer.CHARACTER_TOKEN="CHARACTER_TOKEN",Tokenizer.NULL_CHARACTER_TOKEN="NULL_CHARACTER_TOKEN",Tokenizer.WHITESPACE_CHARACTER_TOKEN="WHITESPACE_CHARACTER_TOKEN",Tokenizer.START_TAG_TOKEN="START_TAG_TOKEN",Tokenizer.END_TAG_TOKEN="END_TAG_TOKEN",Tokenizer.COMMENT_TOKEN="COMMENT_TOKEN",Tokenizer.DOCTYPE_TOKEN="DOCTYPE_TOKEN",Tokenizer.EOF_TOKEN="EOF_TOKEN",Tokenizer.HIBERNATION_TOKEN="HIBERNATION_TOKEN",Tokenizer.MODE={DATA:DATA_STATE,RCDATA:RCDATA_STATE,RAWTEXT:RAWTEXT_STATE,SCRIPT_DATA:SCRIPT_DATA_STATE,PLAINTEXT:PLAINTEXT_STATE},Tokenizer.getTokenAttr=function(token,attrName){for(var i=token.attrs.length-1;i>=0;i--)if(token.attrs[i].name===attrName)return token.attrs[i].value;return null},Tokenizer.prototype.getNextToken=function(){for(;!this.tokenQueue.length&&this.active;){this._hibernationSnapshot();var cp=this._consume();this._ensureHibernation()||this[this.state](cp)}return this.tokenQueue.shift()},Tokenizer.prototype.write=function(chunk,isLastChunk){this.active=!0,this.preprocessor.write(chunk,isLastChunk)},Tokenizer.prototype.insertHtmlAtCurrentPos=function(chunk){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(chunk)},Tokenizer.prototype._hibernationSnapshot=function(){this.consumedAfterSnapshot=0},Tokenizer.prototype._ensureHibernation=function(){if(this.preprocessor.endOfChunkHit){for(;this.consumedAfterSnapshot>0;this.consumedAfterSnapshot--)this.preprocessor.retreat();return this.active=!1,this.tokenQueue.push({type:Tokenizer.HIBERNATION_TOKEN}),!0}return!1},Tokenizer.prototype._consume=function(){return this.consumedAfterSnapshot++,this.preprocessor.advance()},Tokenizer.prototype._unconsume=function(){this.consumedAfterSnapshot--,this.preprocessor.retreat()},Tokenizer.prototype._unconsumeSeveral=function(count){for(;count--;)this._unconsume()},Tokenizer.prototype._reconsumeInState=function(state){this.state=state,this._unconsume()},Tokenizer.prototype._consumeSubsequentIfMatch=function(pattern,startCp,caseSensitive){for(var consumedCount=0,isMatch=!0,patternLength=pattern.length,patternPos=0,cp=startCp,patternCp=void 0;patternPos0&&(cp=this._consume(),consumedCount++),cp===$.EOF){isMatch=!1;break}if(patternCp=pattern[patternPos],cp!==patternCp&&(caseSensitive||cp!==toAsciiLowerCodePoint(patternCp))){isMatch=!1;break}}return isMatch||this._unconsumeSeveral(consumedCount),isMatch},Tokenizer.prototype._lookahead=function(){var cp=this._consume();return this._unconsume(),cp},Tokenizer.prototype.isTempBufferEqualToScriptString=function(){if(this.tempBuff.length!==$$.SCRIPT_STRING.length)return!1;for(var i=0;i-1;){var current=neTree[i],inNode=current")):cp===$.NULL?(this.state=SCRIPT_DATA_ESCAPED_STATE,this._emitChar(UNICODE.REPLACEMENT_CHARACTER)):cp===$.EOF?this._reconsumeInState(DATA_STATE):(this.state=SCRIPT_DATA_ESCAPED_STATE,this._emitCodePoint(cp))},_[SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE]=function(cp){cp===$.SOLIDUS?(this.tempBuff=[],this.state=SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE):isAsciiLetter(cp)?(this.tempBuff=[],this._emitChar("<"),this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE)):(this._emitChar("<"),this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE))},_[SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE]=function(cp){isAsciiLetter(cp)?(this._createEndTagToken(),this._reconsumeInState(SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE)):(this._emitChar("<"),this._emitChar("/"),this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE))},_[SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE]=function(cp){if(isAsciiUpper(cp))this.currentToken.tagName+=toAsciiLowerChar(cp),this.tempBuff.push(cp);else if(isAsciiLower(cp))this.currentToken.tagName+=toChar(cp),this.tempBuff.push(cp);else{if(this._isAppropriateEndTagToken()){if(isWhitespace(cp))return void(this.state=BEFORE_ATTRIBUTE_NAME_STATE);if(cp===$.SOLIDUS)return void(this.state=SELF_CLOSING_START_TAG_STATE);if(cp===$.GREATER_THAN_SIGN)return this._emitCurrentToken(),void(this.state=DATA_STATE)}this._emitChar("<"),this._emitChar("/"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE)}},_[SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE]=function(cp){isWhitespace(cp)||cp===$.SOLIDUS||cp===$.GREATER_THAN_SIGN?(this.state=this.isTempBufferEqualToScriptString()?SCRIPT_DATA_DOUBLE_ESCAPED_STATE:SCRIPT_DATA_ESCAPED_STATE,this._emitCodePoint(cp)):isAsciiUpper(cp)?(this.tempBuff.push(toAsciiLowerCodePoint(cp)),this._emitCodePoint(cp)):isAsciiLower(cp)?(this.tempBuff.push(cp),this._emitCodePoint(cp)):this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE)},_[SCRIPT_DATA_DOUBLE_ESCAPED_STATE]=function(cp){cp===$.HYPHEN_MINUS?(this.state=SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE,this._emitChar("-")):cp===$.LESS_THAN_SIGN?(this.state=SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE,this._emitChar("<")):cp===$.NULL?this._emitChar(UNICODE.REPLACEMENT_CHARACTER):cp===$.EOF?this._reconsumeInState(DATA_STATE):this._emitCodePoint(cp)},_[SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE]=function(cp){cp===$.HYPHEN_MINUS?(this.state=SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE,this._emitChar("-")):cp===$.LESS_THAN_SIGN?(this.state=SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE,this._emitChar("<")):cp===$.NULL?(this.state=SCRIPT_DATA_DOUBLE_ESCAPED_STATE,this._emitChar(UNICODE.REPLACEMENT_CHARACTER)):cp===$.EOF?this._reconsumeInState(DATA_STATE):(this.state=SCRIPT_DATA_DOUBLE_ESCAPED_STATE,this._emitCodePoint(cp))},_[SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE]=function(cp){cp===$.HYPHEN_MINUS?this._emitChar("-"):cp===$.LESS_THAN_SIGN?(this.state=SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE,this._emitChar("<")):cp===$.GREATER_THAN_SIGN?(this.state=SCRIPT_DATA_STATE,this._emitChar(">")):cp===$.NULL?(this.state=SCRIPT_DATA_DOUBLE_ESCAPED_STATE,this._emitChar(UNICODE.REPLACEMENT_CHARACTER)):cp===$.EOF?this._reconsumeInState(DATA_STATE):(this.state=SCRIPT_DATA_DOUBLE_ESCAPED_STATE,this._emitCodePoint(cp))},_[SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE]=function(cp){cp===$.SOLIDUS?(this.tempBuff=[],this.state=SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE,this._emitChar("/")):this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPED_STATE)},_[SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE]=function(cp){isWhitespace(cp)||cp===$.SOLIDUS||cp===$.GREATER_THAN_SIGN?(this.state=this.isTempBufferEqualToScriptString()?SCRIPT_DATA_ESCAPED_STATE:SCRIPT_DATA_DOUBLE_ESCAPED_STATE,this._emitCodePoint(cp)):isAsciiUpper(cp)?(this.tempBuff.push(toAsciiLowerCodePoint(cp)),this._emitCodePoint(cp)):isAsciiLower(cp)?(this.tempBuff.push(cp),this._emitCodePoint(cp)):this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPED_STATE)},_[BEFORE_ATTRIBUTE_NAME_STATE]=function(cp){isWhitespace(cp)||(cp===$.SOLIDUS||cp===$.GREATER_THAN_SIGN||cp===$.EOF?this._reconsumeInState(AFTER_ATTRIBUTE_NAME_STATE):cp===$.EQUALS_SIGN?(this._createAttr("="),this.state=ATTRIBUTE_NAME_STATE):(this._createAttr(""),this._reconsumeInState(ATTRIBUTE_NAME_STATE)))},_[ATTRIBUTE_NAME_STATE]=function(cp){isWhitespace(cp)||cp===$.SOLIDUS||cp===$.GREATER_THAN_SIGN||cp===$.EOF?(this._leaveAttrName(AFTER_ATTRIBUTE_NAME_STATE),this._unconsume()):cp===$.EQUALS_SIGN?this._leaveAttrName(BEFORE_ATTRIBUTE_VALUE_STATE):isAsciiUpper(cp)?this.currentAttr.name+=toAsciiLowerChar(cp):cp===$.QUOTATION_MARK||cp===$.APOSTROPHE||cp===$.LESS_THAN_SIGN?this.currentAttr.name+=toChar(cp):cp===$.NULL?this.currentAttr.name+=UNICODE.REPLACEMENT_CHARACTER:this.currentAttr.name+=toChar(cp)},_[AFTER_ATTRIBUTE_NAME_STATE]=function(cp){isWhitespace(cp)||(cp===$.SOLIDUS?this.state=SELF_CLOSING_START_TAG_STATE:cp===$.EQUALS_SIGN?this.state=BEFORE_ATTRIBUTE_VALUE_STATE:cp===$.GREATER_THAN_SIGN?(this.state=DATA_STATE,this._emitCurrentToken()):cp===$.EOF?this._reconsumeInState(DATA_STATE):(this._createAttr(""),this._reconsumeInState(ATTRIBUTE_NAME_STATE)))},_[BEFORE_ATTRIBUTE_VALUE_STATE]=function(cp){isWhitespace(cp)||(cp===$.QUOTATION_MARK?this.state=ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE:cp===$.APOSTROPHE?this.state=ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE:this._reconsumeInState(ATTRIBUTE_VALUE_UNQUOTED_STATE))},_[ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE]=function(cp){cp===$.QUOTATION_MARK?this.state=AFTER_ATTRIBUTE_VALUE_QUOTED_STATE:cp===$.AMPERSAND?(this.additionalAllowedCp=$.QUOTATION_MARK,this.returnState=this.state,this.state=CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE):cp===$.NULL?this.currentAttr.value+=UNICODE.REPLACEMENT_CHARACTER:cp===$.EOF?this._reconsumeInState(DATA_STATE):this.currentAttr.value+=toChar(cp)},_[ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE]=function(cp){cp===$.APOSTROPHE?this.state=AFTER_ATTRIBUTE_VALUE_QUOTED_STATE:cp===$.AMPERSAND?(this.additionalAllowedCp=$.APOSTROPHE,this.returnState=this.state,this.state=CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE):cp===$.NULL?this.currentAttr.value+=UNICODE.REPLACEMENT_CHARACTER:cp===$.EOF?this._reconsumeInState(DATA_STATE):this.currentAttr.value+=toChar(cp)},_[ATTRIBUTE_VALUE_UNQUOTED_STATE]=function(cp){isWhitespace(cp)?this._leaveAttrValue(BEFORE_ATTRIBUTE_NAME_STATE):cp===$.AMPERSAND?(this.additionalAllowedCp=$.GREATER_THAN_SIGN,this.returnState=this.state,this.state=CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE):cp===$.GREATER_THAN_SIGN?(this._leaveAttrValue(DATA_STATE),this._emitCurrentToken()):cp===$.NULL?this.currentAttr.value+=UNICODE.REPLACEMENT_CHARACTER:cp===$.QUOTATION_MARK||cp===$.APOSTROPHE||cp===$.LESS_THAN_SIGN||cp===$.EQUALS_SIGN||cp===$.GRAVE_ACCENT?this.currentAttr.value+=toChar(cp):cp===$.EOF?this._reconsumeInState(DATA_STATE):this.currentAttr.value+=toChar(cp)},_[CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE]=function(cp){var referencedCodePoints=this._consumeCharacterReference(cp,!0);if(!this._ensureHibernation()){if(referencedCodePoints)for(var i=0;i=55296&&cp1<=56319&&cp2>=56320&&cp2<=57343}function getSurrogatePairCodePoint(cp1,cp2){return 1024*(cp1-55296)+9216+cp2}var UNICODE=require("../common/unicode"),$=UNICODE.CODE_POINTS,DEFAULT_BUFFER_WATERLINE=65536,Preprocessor=module.exports=function(){this.html=null,this.pos=-1,this.lastGapPos=-1,this.lastCharPos=-1,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=DEFAULT_BUFFER_WATERLINE};Preprocessor.prototype.dropParsedChunk=function(){this.pos>this.bufferWaterline&&(this.lastCharPos-=this.pos,this.html=this.html.substring(this.pos),this.pos=0,this.lastGapPos=-1,this.gapStack=[])},Preprocessor.prototype._addGap=function(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos},Preprocessor.prototype._processHighRangeCodePoint=function(cp){if(this.pos!==this.lastCharPos){var nextCp=this.html.charCodeAt(this.pos+1);isSurrogatePair(cp,nextCp)&&(this.pos++,cp=getSurrogatePairCodePoint(cp,nextCp),this._addGap())}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,$.EOF;return cp},Preprocessor.prototype.write=function(chunk,isLastChunk){this.html?this.html+=chunk:this.html=chunk,this.lastCharPos=this.html.length-1,this.endOfChunkHit=!1,this.lastChunkWritten=isLastChunk},Preprocessor.prototype.insertHtmlAtCurrentPos=function(chunk){this.html=this.html.substring(0,this.pos+1)+chunk+this.html.substring(this.pos+1,this.html.length),this.lastCharPos=this.html.length-1,this.endOfChunkHit=!1},Preprocessor.prototype.advance=function(){if(this.pos++,this.pos>this.lastCharPos)return this.lastChunkWritten||(this.endOfChunkHit=!0),$.EOF;var cp=this.html.charCodeAt(this.pos);return this.skipNextNewLine&&cp===$.LINE_FEED?(this.skipNextNewLine=!1,this._addGap(),this.advance()):cp===$.CARRIAGE_RETURN?(this.skipNextNewLine=!0,$.LINE_FEED):(this.skipNextNewLine=!1,cp>=55296?this._processHighRangeCodePoint(cp):cp)},Preprocessor.prototype.retreat=function(){this.pos===this.lastGapPos&&(this.lastGapPos=this.gapStack.pop(),this.pos--),this.pos--}},{"../common/unicode":309}],328:[function(require,module,exports){"use strict";var DOCUMENT_MODE=require("../common/html").DOCUMENT_MODE;exports.createDocument=function(){return{nodeName:"#document",mode:DOCUMENT_MODE.NO_QUIRKS,childNodes:[]}},exports.createDocumentFragment=function(){return{nodeName:"#document-fragment",childNodes:[]}},exports.createElement=function(tagName,namespaceURI,attrs){return{nodeName:tagName,tagName:tagName,attrs:attrs,namespaceURI:namespaceURI,childNodes:[],parentNode:null}},exports.createCommentNode=function(data){return{nodeName:"#comment",data:data,parentNode:null}};var createTextNode=function(value){return{nodeName:"#text",value:value,parentNode:null}},appendChild=exports.appendChild=function(parentNode,newNode){parentNode.childNodes.push(newNode),newNode.parentNode=parentNode},insertBefore=exports.insertBefore=function(parentNode,newNode,referenceNode){var insertionIdx=parentNode.childNodes.indexOf(referenceNode);parentNode.childNodes.splice(insertionIdx,0,newNode),newNode.parentNode=parentNode};exports.setTemplateContent=function(templateElement,contentElement){templateElement.content=contentElement},exports.getTemplateContent=function(templateElement){return templateElement.content},exports.setDocumentType=function(document,name,publicId,systemId){for(var doctypeNode=null,i=0;i1)for(var i=1;i0?("string"==typeof chunk||state.objectMode||Object.getPrototypeOf(chunk)===Buffer.prototype||(chunk=_uint8ArrayToBuffer(chunk)),addToFront?state.endEmitted?stream.emit("error",new Error("stream.unshift() after end event")):addChunk(stream,state,chunk,!0):state.ended?stream.emit("error",new Error("stream.push() after EOF")):(state.reading=!1,state.decoder&&!encoding?(chunk=state.decoder.write(chunk),state.objectMode||0!==chunk.length?addChunk(stream,state,chunk,!1):maybeReadMore(stream,state)):addChunk(stream,state,chunk,!1))):addToFront||(state.reading=!1)}return needMoreData(state)}function addChunk(stream,state,chunk,addToFront){state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream)),maybeReadMore(stream,state)}function chunkInvalid(state,chunk){var er;return _isUint8Array(chunk)||"string"==typeof chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||0===state.length&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function onEofChunk(stream,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?pna.nextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,pna.nextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return nstr.length?str.length:n;if(ret+=nb===str.length?str:str.slice(0,n),n-=nb,0===n){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=Buffer.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),n-=nb,0===n){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,pna.nextTick(endReadableNT,state,stream))}function endReadableNT(state,stream){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}function indexOf(xs,x){for(var i=0,l=xs.length;i=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(n=howMuchToRead(n,state),0===n&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n0?fromList(n,state):null,null===ret?(state.needReadable=!0,n=0):state.length-=n,0===state.length&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),null!==ret&&this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable,unpipeInfo){debug("onunpipe"),readable===src&&unpipeInfo&&unpipeInfo.hasUnpiped===!1&&(unpipeInfo.hasUnpiped=!0,cleanup())}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",unpipe),src.removeListener("data",ondata),cleanedUp=!0,!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1;var ret=dest.write(chunk);!1!==ret||increasedAwaitDrain||((1===state.pipesCount&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EElistenerCount(dest,"error")&&dest.emit("error",er); -}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:unpipe;state.endEmitted?pna.nextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1,increasedAwaitDrain=!1;return src.on("data",ondata),prependListener(dest,"error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState,unpipeInfo={hasUnpiped:!1};if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this,unpipeInfo),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i-1?setImmediate:pna.nextTick;Writable.WritableState=WritableState;var util=Object.create(require("core-util-is"));util.inherits=require("inherits");var internalUtil={deprecate:require("util-deprecate")},Stream=require("./internal/streams/stream"),Buffer=require("safe-buffer").Buffer,OurUint8Array=global.Uint8Array||function(){},destroyImpl=require("./internal/streams/destroy");util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(_){}}();var realHasInstance;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return!!realHasInstance.call(this,object)||this===Writable&&(object&&object._writableState instanceof WritableState)}})):realHasInstance=function(object){return object instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=!state.objectMode&&_isUint8Array(chunk);return isBuf&&!Buffer.isBuffer(chunk)&&(chunk=_uint8ArrayToBuffer(chunk)),"function"==typeof encoding&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),"function"!=typeof cb&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret},Writable.prototype.cork=function(){var state=this._writableState;state.corked++},Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,state.writing||state.corked||state.finished||state.bufferProcessing||!state.bufferedRequest||clearBuffer(this,state))},Writable.prototype.setDefaultEncoding=function(encoding){if("string"==typeof encoding&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this},Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;"function"==typeof chunk?(cb=chunk,chunk=null,encoding=null):"function"==typeof encoding&&(cb=encoding,encoding=null),null!==chunk&&void 0!==chunk&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||state.finished||endWritable(this,state,cb)},Object.defineProperty(Writable.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(value){this._writableState&&(this._writableState.destroyed=value)}}),Writable.prototype.destroy=destroyImpl.destroy,Writable.prototype._undestroy=destroyImpl.undestroy,Writable.prototype._destroy=function(err,cb){this.end(),cb(err)}}).call(this,require("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},require("timers").setImmediate)},{"./_stream_duplex":336,"./internal/streams/destroy":342,"./internal/streams/stream":343,_process:333,"core-util-is":45,inherits:84,"process-nextick-args":332,"safe-buffer":348,timers:350,"util-deprecate":351}],341:[function(require,module,exports){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function copyBuffer(src,target,offset){src.copy(target,offset)}var Buffer=require("safe-buffer").Buffer,util=require("util");module.exports=function(){function BufferList(){_classCallCheck(this,BufferList),this.head=null,this.tail=null,this.length=0}return BufferList.prototype.push=function(v){var entry={data:v,next:null};this.length>0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};0===this.length&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var ret=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s){if(0===this.length)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s+p.data;return ret},BufferList.prototype.concat=function(n){if(0===this.length)return Buffer.alloc(0);if(1===this.length)return this.head.data;for(var ret=Buffer.allocUnsafe(n>>>0),p=this.head,i=0;p;)copyBuffer(p.data,ret,i),i+=p.data.length,p=p.next;return ret},BufferList}(),util&&util.inspect&&util.inspect.custom&&(module.exports.prototype[util.inspect.custom]=function(){var obj=util.inspect({length:this.length});return this.constructor.name+" "+obj})},{"safe-buffer":348,util:29}],342:[function(require,module,exports){"use strict";function destroy(err,cb){var _this=this,readableDestroyed=this._readableState&&this._readableState.destroyed,writableDestroyed=this._writableState&&this._writableState.destroyed;return readableDestroyed||writableDestroyed?(cb?cb(err):!err||this._writableState&&this._writableState.errorEmitted||pna.nextTick(emitErrorNT,this,err),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(err||null,function(err){!cb&&err?(pna.nextTick(emitErrorNT,_this,err),_this._writableState&&(_this._writableState.errorEmitted=!0)):cb&&cb(err)}),this)}function undestroy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function emitErrorNT(self,err){self.emit("error",err)}var pna=require("process-nextick-args");module.exports={destroy:destroy,undestroy:undestroy}},{"process-nextick-args":332}],343:[function(require,module,exports){module.exports=require("events").EventEmitter},{events:74}],344:[function(require,module,exports){module.exports=require("./readable").PassThrough},{"./readable":345}],345:[function(require,module,exports){exports=module.exports=require("./lib/_stream_readable.js"),exports.Stream=exports,exports.Readable=exports,exports.Writable=require("./lib/_stream_writable.js"),exports.Duplex=require("./lib/_stream_duplex.js"),exports.Transform=require("./lib/_stream_transform.js"),exports.PassThrough=require("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":336,"./lib/_stream_passthrough.js":337,"./lib/_stream_readable.js":338,"./lib/_stream_transform.js":339,"./lib/_stream_writable.js":340}],346:[function(require,module,exports){module.exports=require("./readable").Transform},{"./readable":345}],347:[function(require,module,exports){module.exports=require("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":340}],348:[function(require,module,exports){arguments[4][30][0].apply(exports,arguments)},{buffer:32,dup:30}],349:[function(require,module,exports){"use strict";function _normalizeEncoding(enc){if(!enc)return"utf8";for(var retried;;)switch(enc){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return enc;default:if(retried)return;enc=(""+enc).toLowerCase(),retried=!0}}function normalizeEncoding(enc){var nenc=_normalizeEncoding(enc);if("string"!=typeof nenc&&(Buffer.isEncoding===isEncoding||!isEncoding(enc)))throw new Error("Unknown encoding: "+enc);return nenc||enc}function StringDecoder(encoding){this.encoding=normalizeEncoding(encoding);var nb;switch(this.encoding){case"utf16le":this.text=utf16Text,this.end=utf16End,nb=4;break;case"utf8":this.fillLast=utf8FillLast,nb=4;break;case"base64":this.text=base64Text,this.end=base64End,nb=3;break;default:return this.write=simpleWrite,void(this.end=simpleEnd)}this.lastNeed=0,this.lastTotal=0,this.lastChar=Buffer.allocUnsafe(nb)}function utf8CheckByte(byte){return byte<=127?0:byte>>5===6?2:byte>>4===14?3:byte>>3===30?4:byte>>6===2?-1:-2}function utf8CheckIncomplete(self,buf,i){var j=buf.length-1;if(j=0?(nb>0&&(self.lastNeed=nb-1),nb):--j=0?(nb>0&&(self.lastNeed=nb-2),nb):--j=0?(nb>0&&(2===nb?nb=0:self.lastNeed=nb-3),nb):0))}function utf8CheckExtraBytes(self,buf,p){if(128!==(192&buf[0]))return self.lastNeed=0,"\ufffd";if(self.lastNeed>1&&buf.length>1){if(128!==(192&buf[1]))return self.lastNeed=1,"\ufffd";if(self.lastNeed>2&&buf.length>2&&128!==(192&buf[2]))return self.lastNeed=2,"\ufffd"}}function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed,r=utf8CheckExtraBytes(this,buf,p);return void 0!==r?r:this.lastNeed<=buf.length?(buf.copy(this.lastChar,p,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(buf.copy(this.lastChar,p,0,buf.length),void(this.lastNeed-=buf.length))}function utf8Text(buf,i){var total=utf8CheckIncomplete(this,buf,i);if(!this.lastNeed)return buf.toString("utf8",i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);return buf.copy(this.lastChar,0,end),buf.toString("utf8",i,end)}function utf8End(buf){var r=buf&&buf.length?this.write(buf):"";return this.lastNeed?r+"\ufffd":r}function utf16Text(buf,i){if((buf.length-i)%2===0){var r=buf.toString("utf16le",i);if(r){var c=r.charCodeAt(r.length-1);if(c>=55296&&c<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=buf[buf.length-1],buf.toString("utf16le",i,buf.length-1)}function utf16End(buf){var r=buf&&buf.length?this.write(buf):"";if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r+this.lastChar.toString("utf16le",0,end)}return r}function base64Text(buf,i){var n=(buf.length-i)%3;return 0===n?buf.toString("base64",i):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=buf[buf.length-1]:(this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1]),buf.toString("base64",i,buf.length-n))}function base64End(buf){var r=buf&&buf.length?this.write(buf):"";return this.lastNeed?r+this.lastChar.toString("base64",0,3-this.lastNeed):r}function simpleWrite(buf){return buf.toString(this.encoding)}function simpleEnd(buf){return buf&&buf.length?this.write(buf):""}var Buffer=require("safe-buffer").Buffer,isEncoding=Buffer.isEncoding||function(encoding){switch(encoding=""+encoding,encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};exports.StringDecoder=StringDecoder,StringDecoder.prototype.write=function(buf){if(0===buf.length)return"";var r,i;if(this.lastNeed){if(r=this.fillLast(buf),void 0===r)return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i=0&&(item._idleTimeoutId=setTimeout(function(){item._onTimeout&&item._onTimeout()},msecs))},exports.setImmediate="function"==typeof setImmediate?setImmediate:function(fn){var id=nextImmediateId++,args=!(arguments.length<2)&&slice.call(arguments,1);return immediateIds[id]=!0,nextTick(function(){immediateIds[id]&&(args?fn.apply(null,args):fn.call(null),exports.clearImmediate(id))}),id},exports.clearImmediate="function"==typeof clearImmediate?clearImmediate:function(id){delete immediateIds[id]}}).call(this,require("timers").setImmediate,require("timers").clearImmediate)},{"process/browser.js":333,timers:350}],351:[function(require,module,exports){(function(global){function deprecate(fn,msg){function deprecated(){if(!warned){if(config("throwDeprecation"))throw new Error(msg);config("traceDeprecation")?console.trace(msg):console.warn(msg),warned=!0}return fn.apply(this,arguments)}if(config("noDeprecation"))return fn;var warned=!1;return deprecated}function config(name){try{if(!global.localStorage)return!1}catch(_){return!1}var val=global.localStorage[name];return null!=val&&"true"===String(val).toLowerCase()}module.exports=deprecate}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],352:[function(require,module,exports){"function"==typeof Object.create?module.exports=function(ctor,superCtor){ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}})}:module.exports=function(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}},{}],353:[function(require,module,exports){module.exports=function(arg){return arg&&"object"==typeof arg&&"function"==typeof arg.copy&&"function"==typeof arg.fill&&"function"==typeof arg.readUInt8}},{}],354:[function(require,module,exports){(function(process,global){function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(ctx.depth=arguments[2]),arguments.length>=4&&(ctx.colors=arguments[3]),isBoolean(opts)?ctx.showHidden=opts:opts&&exports._extend(ctx,opts),isUndefined(ctx.showHidden)&&(ctx.showHidden=!1),isUndefined(ctx.depth)&&(ctx.depth=2),isUndefined(ctx.colors)&&(ctx.colors=!1),isUndefined(ctx.customInspect)&&(ctx.customInspect=!0),ctx.colors&&(ctx.stylize=stylizeWithColor),formatValue(ctx,obj,ctx.depth)}function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];return style?"\x1b["+inspect.colors[style][0]+"m"+str+"\x1b["+inspect.colors[style][1]+"m":str}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};return array.forEach(function(val,idx){hash[val]=!0}),hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&(!value.constructor||value.constructor.prototype!==value)){var ret=value.inspect(recurseTimes,ctx);return isString(ret)||(ret=formatValue(ctx,ret,recurseTimes)),ret}var primitive=formatPrimitive(ctx,value);if(primitive)return primitive;var keys=Object.keys(value),visibleKeys=arrayToHash(keys);if(ctx.showHidden&&(keys=Object.getOwnPropertyNames(value)),isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0))return formatError(value);if(0===keys.length){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value))return ctx.stylize(RegExp.prototype.toString.call(value),"regexp");if(isDate(value))return ctx.stylize(Date.prototype.toString.call(value),"date");if(isError(value))return formatError(value)}var base="",array=!1,braces=["{","}"];if(isArray(value)&&(array=!0,braces=["[","]"]),isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)&&(base=" "+RegExp.prototype.toString.call(value)),isDate(value)&&(base=" "+Date.prototype.toUTCString.call(value)),isError(value)&&(base=" "+formatError(value)),0===keys.length&&(!array||0==value.length))return braces[0]+base+braces[1];if(recurseTimes<0)return isRegExp(value)?ctx.stylize(RegExp.prototype.toString.call(value),"regexp"):ctx.stylize("[Object]","special");ctx.seen.push(value);var output;return output=array?formatArray(ctx,value,recurseTimes,visibleKeys,keys):keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)}),ctx.seen.pop(),reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}return isNumber(value)?ctx.stylize(""+value,"number"):isBoolean(value)?ctx.stylize(""+value,"boolean"):isNull(value)?ctx.stylize("null","null"):void 0}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){for(var output=[],i=0,l=value.length;i-1&&(str=array?str.split("\n").map(function(line){return" "+line}).join("\n").substr(2):"\n"+str.split("\n").map(function(line){return" "+line}).join("\n"))):str=ctx.stylize("[Circular]","special")),isUndefined(name)){if(array&&key.match(/^\d+$/))return str;name=JSON.stringify(""+key),name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(name=name.substr(1,name.length-2),name=ctx.stylize(name,"name")):(name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),name=ctx.stylize(name,"string"))}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0,length=output.reduce(function(prev,cur){return numLinesEst++,cur.indexOf("\n")>=0&&numLinesEst++,prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);return length>60?braces[0]+(""===base?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]:braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}function isBoolean(arg){return"boolean"==typeof arg}function isNull(arg){return null===arg}function isNullOrUndefined(arg){return null==arg}function isNumber(arg){return"number"==typeof arg}function isString(arg){return"string"==typeof arg}function isSymbol(arg){return"symbol"==typeof arg}function isUndefined(arg){return void 0===arg}function isRegExp(re){return isObject(re)&&"[object RegExp]"===objectToString(re)}function isObject(arg){return"object"==typeof arg&&null!==arg}function isDate(d){return isObject(d)&&"[object Date]"===objectToString(d)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(arg){return"function"==typeof arg}function isPrimitive(arg){return null===arg||"boolean"==typeof arg||"number"==typeof arg||"string"==typeof arg||"symbol"==typeof arg||"undefined"==typeof arg}function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}function timestamp(){var d=new Date,time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){for(var objects=[],i=0;i=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}}),x=args[i];i0?domainList.each(function(j,domainElement){var domainNode=(0,_cheerio2["default"])((0,_cheerio2["default"])((0,_cheerio2["default"])(this))),domainNodeClass=domainNode.attr("class");if(void 0===domainNodeClass||null===domainNodeClass)return host=domainNode.attr("href"),!1}):host=reDomain.text().replace(/ /g,"").replace(/ /g,"").replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"");var port="",protocol="",portNode=(0,_cheerio2["default"])((0,_cheerio2["default"])(this).find("div[class~=re-port]")[0]),portElement=portNode.find("a[class~=wordLineFeed]");if(null!==portElement&&void 0!==portElement)port=portElement.text();else{var hostSplit=host.split(":");hostSplit.length>1&&(port=hostSplit[1])}port=port.replace(/ /g,"").replace(/ /g,"").replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"");var protocolElement=portNode.find("a[class~=pro]");null!==protocolElement&&void 0!==protocolElement&&(protocol=protocolElement.text()),"443"!==port||null!=protocol&&""!==protocol&&void 0!==protocol||(protocol="https"),null!=protocol&&""!==protocol&&void 0!==protocol||(protocol="http"),""!==port&&null!==port&&void 0!==port||(port="80"),null!=protocol&&void 0!==protocol&&""!==protocol&&"http"!==protocol&&"https"!==protocol&&host.indexOf(":")===-1&&(host=host+":"+port);var title="",domainNextNode=reDomain.next(),domainTitleNode=domainNextNode.find("a");void 0!==domainTitleNode&&null!=domainTitleNode&&0!==domainTitleNode.length||(title=domainNextNode.text()),title=title.replace(/ /g,"").replace(/ /g,"").replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,""),""===title&&"http"!==protocol&&"https"!==protocol&&(title=protocol),url=host.indexOf("http")>-1?host:newUrl;var line="\n \n "+title+"\n "+protocol+"\n "+port+"\n "+host+'\n \n \n ';innerHtml+=line}),document.getElementById("tbody").innerHTML=innerHtml,document.getElementById("zichanHost").setAttribute("href",newUrl),document.getElementById("cHost").setAttribute("href",cHost),layer.close(load)})},template=function(data){if(null==data)return void layer.msg("\u8bf7\u5237\u65b0Tab\u9875\u9762");var load=layer.load(0,{content:""}),url=(JSON.stringify(data),data.url),ip="";domainReg.test(url)&&(ip=url.replace("https://","").replace("http://",""),ip=ip.substr(0,ip.indexOf("/")),ip.indexOf(":")>0&&(ip=ip.substr(0,ip.indexOf(":"))));var newUrl=baseFofaUrl+ip;(0,_axios2["default"])({method:"get",url:newUrl}).then(function(response){var rspData=response.data,root=_cheerio2["default"].load(rspData),rspIp=root("li[class=layui-this]").find("div[class=ellipise]").text();rspIp=rspIp.replace(/ /g,"").replace(/ /g,"").replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"");var elementList=root("div[class=ip-table]").find("div[class~=ip-table-item]"),country="\u56fd\u5bb6/\u5730\u533a\uff1a",city="\u57ce\u5e02\uff1a",group="\u7ec4\u7ec7\uff1a",asn="ASN\uff1a",port="\u7aef\u53e3\uff1a",protocol="\u534f\u8bae\uff1a";elementList.each(function(i,elem){var thisNode=(0,_cheerio2["default"])((0,_cheerio2["default"])(this)),tmpStr=thisNode.find("div[class=ip-table-content]").text(),nameKey=thisNode.find("span[class=ip-table-label]").text();tmpStr=tmpStr.toString(),tmpStr=tmpStr.replace(/ /g,"").replace(/ /g,"").replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,""),null!==tmpStr&&void 0!==tmpStr&&""!==tmpStr||(tmpStr=(0,_cheerio2["default"])((0,_cheerio2["default"])(this)).find("div[class~=ip-table-content]").text(),tmpStr=tmpStr.replace("\n",""),tmpStr=tmpStr.replace(/ /g,"").replace(/ /g,"").replace(/\n/g,",").replace(/\r/g,"").replace(/\t/g,"")),nameKey.indexOf("IP")>-1?rspIp=tmpStr:nameKey.indexOf("\u56fd\u5bb6")>-1?country+=tmpStr:nameKey.indexOf("\u57ce\u5e02")>-1?city+=tmpStr:nameKey.indexOf("\u7ec4\u7ec7")>-1?group+=tmpStr:nameKey.indexOf("ASN")>-1?asn+=tmpStr:nameKey.indexOf("\u7aef\u53e3")>-1?port+=tmpStr:nameKey.indexOf("\u534f\u8bae")>-1&&(protocol+=tmpStr)}),port.endsWith(",")&&(port=port.substring(0,port.length-2)),port=port.replace("\u7aef\u53e3\uff1a","");var splitPortArr=port.split(",");if(null!==splitPortArr&&void 0!==splitPortArr&&splitPortArr.length>0){port="";for(var i=0;i";port+=tmpStr}}protocol.endsWith(",")&&(protocol=protocol.substring(0,protocol.length-2)),protocol=protocol.replace("\u534f\u8bae\uff1a","");var splitProtocolArr=protocol.split(",");if(null!==splitProtocolArr&&void 0!==splitProtocolArr&&splitProtocolArr.length>0){protocol="";for(var _i=0;_i";protocol+=_tmpStr}}return""===rspIp||rspIp.indexOf("\u65e0\u6570\u636e")>-1?(layer.close(load),void layer.msg("\u65e0\u6570\u636e")):(port="\u7aef\u53e3\uff1a"+port,protocol="\u534f\u8bae\uff1a"+protocol,document.getElementById("country").innerHTML=country,document.getElementById("city").innerHTML=city,document.getElementById("group").innerHTML=group,document.getElementById("asn").innerHTML=asn,document.getElementById("port").innerHTML=port,document.getElementById("protocol").innerHTML=protocol,document.getElementById("hostInfo").setAttribute("href",newUrl),void getZichan(ipReg.exec(rspIp)[0],load))})};_ext2["default"].tabs.query({active:!0,currentWindow:!0},function(tabs){var activeTab=tabs[0];chrome.tabs.sendMessage(activeTab.id,{action:"process-page"},template)})},{"./utils/ext":356,"./utils/storage":357,axios:1,cheerio:33,"js-base64":87}],356:[function(require,module,exports){"use strict";function Extension(){var _this=this;apis.forEach(function(api){_this[api]=null;try{chrome[api]&&(_this[api]=chrome[api])}catch(e){}try{window[api]&&(_this[api]=window[api])}catch(e){}try{browser[api]&&(_this[api]=browser[api])}catch(e){}try{_this.api=browser.extension[api]}catch(e){}});try{browser&&browser.runtime&&(this.runtime=browser.runtime)}catch(e){}try{browser&&browser.browserAction&&(this.browserAction=browser.browserAction)}catch(e){}}var apis=["alarms","bookmarks","browserAction","commands","contextMenus","cookies","downloads","events","extension","extensionTypes","history","i18n","idle","notifications","pageAction","runtime","storage","tabs","webNavigation","webRequest","windows"];module.exports=new Extension},{}],357:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _ext=require("./ext"),_ext2=_interopRequireDefault(_ext);module.exports=_ext2["default"].storage.sync?_ext2["default"].storage.sync:_ext2["default"].storage.local},{"./ext":356}]},{},[355]); \ No newline at end of file +(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i