(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Docxtemplater=f()}})(function(){var define,module,exports;return 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;i0){throw new Error("Invalid string. Length must be a multiple of 4")}var validLen=b64.indexOf("=");if(validLen===-1)validLen=len;var placeHoldersLen=validLen===len?0:4-validLen%4;return[validLen,placeHoldersLen]}function byteLength(b64){var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function _byteLength(b64,validLen,placeHoldersLen){return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function toByteArray(b64){var tmp;var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];var arr=new Arr(_byteLength(b64,validLen,placeHoldersLen));var curByte=0;var len=placeHoldersLen>0?validLen-4:validLen;for(var i=0;i>16&255;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}if(placeHoldersLen===2){tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4;arr[curByte++]=tmp&255}if(placeHoldersLen===1){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++]=tmp&255}return arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[num&63]}function encodeChunk(uint8,start,end){var tmp;var output=[];for(var i=start;ilen2?len2:i+maxChunkLength))}if(extraBytes===1){tmp=uint8[len-1];parts.push(lookup[tmp>>2]+lookup[tmp<<4&63]+"==")}else if(extraBytes===2){tmp=(uint8[len-2]<<8)+uint8[len-1];parts.push(lookup[tmp>>10]+lookup[tmp>>4&63]+lookup[tmp<<2&63]+"=")}return parts.join("")}},{}],2:[function(require,module,exports){"use strict";var base64=require("base64-js");var ieee754=require("ieee754");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();if(!Buffer.TYPED_ARRAY_SUPPORT&&typeof console!=="undefined"&&typeof console.error==="function"){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.")}function typedArraySupport(){try{var arr=new Uint8Array(1);arr.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return arr.foo()===42}catch(e){return false}}Object.defineProperty(Buffer.prototype,"parent",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.buffer}});Object.defineProperty(Buffer.prototype,"offset",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.byteOffset}});function createBuffer(length){if(length>K_MAX_LENGTH){throw new RangeError('The value "'+length+'" is invalid for option "size"')}var buf=new Uint8Array(length);buf.__proto__=Buffer.prototype;return buf}function Buffer(arg,encodingOrOffset,length){if(typeof arg==="number"){if(typeof encodingOrOffset==="string"){throw new TypeError('The "string" argument must be of type string. Received type number')}return allocUnsafe(arg)}return from(arg,encodingOrOffset,length)}if(typeof Symbol!=="undefined"&&Symbol.species!=null&&Buffer[Symbol.species]===Buffer){Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:true,enumerable:false,writable:false})}Buffer.poolSize=8192;function from(value,encodingOrOffset,length){if(typeof value==="string"){return fromString(value,encodingOrOffset)}if(ArrayBuffer.isView(value)){return fromArrayLike(value)}if(value==null){throw 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(typeof value==="number"){throw new TypeError('The "value" argument must not be of type number. Received type number')}var valueOf=value.valueOf&&value.valueOf();if(valueOf!=null&&valueOf!==value){return Buffer.from(valueOf,encodingOrOffset,length)}var b=fromObject(value);if(b)return b;if(typeof Symbol!=="undefined"&&Symbol.toPrimitive!=null&&typeof value[Symbol.toPrimitive]==="function"){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)}Buffer.from=function(value,encodingOrOffset,length){return from(value,encodingOrOffset,length)};Buffer.prototype.__proto__=Uint8Array.prototype;Buffer.__proto__=Uint8Array;function assertSize(size){if(typeof size!=="number"){throw new TypeError('"size" argument must be of type number')}else if(size<0){throw new RangeError('The value "'+size+'" is invalid for option "size"')}}function alloc(size,fill,encoding){assertSize(size);if(size<=0){return createBuffer(size)}if(fill!==undefined){return typeof encoding==="string"?createBuffer(size).fill(fill,encoding):createBuffer(size).fill(fill)}return createBuffer(size)}Buffer.alloc=function(size,fill,encoding){return alloc(size,fill,encoding)};function allocUnsafe(size){assertSize(size);return createBuffer(size<0?0:checked(size)|0)}Buffer.allocUnsafe=function(size){return allocUnsafe(size)};Buffer.allocUnsafeSlow=function(size){return allocUnsafe(size)};function fromString(string,encoding){if(typeof encoding!=="string"||encoding===""){encoding="utf8"}if(!Buffer.isEncoding(encoding)){throw new TypeError("Unknown encoding: "+encoding)}var length=byteLength(string,encoding)|0;var buf=createBuffer(length);var actual=buf.write(string,encoding);if(actual!==length){buf=buf.slice(0,actual)}return buf}function fromArrayLike(array){var length=array.length<0?0:checked(array.length)|0;var buf=createBuffer(length);for(var 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 length|0}function SlowBuffer(length){if(+length!=length){length=0}return Buffer.alloc(+length)}Buffer.isBuffer=function isBuffer(b){return b!=null&&b._isBuffer===true&&b!==Buffer.prototype};Buffer.compare=function compare(a,b){if(isInstance(a,Uint8Array))a=Buffer.from(a,a.offset,a.byteLength);if(isInstance(b,Uint8Array))b=Buffer.from(b,b.offset,b.byteLength);if(!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;var x=a.length;var y=b.length;for(var i=0,len=Math.min(x,y);i2&&arguments[2]===true;if(!mustMatch&&len===0)return 0;var loweredCase=false;for(;;){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 len*2;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase){return mustMatch?-1:utf8ToBytes(string).length}encoding=(""+encoding).toLowerCase();loweredCase=true}}}Buffer.byteLength=byteLength;function slowToString(encoding,start,end){var loweredCase=false;if(start===undefined||start<0){start=0}if(start>this.length){return""}if(end===undefined||end>this.length){end=this.length}if(end<=0){return""}end>>>=0;start>>>=0;if(end<=start){return""}if(!encoding)encoding="utf8";while(true){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=true}}}Buffer.prototype._isBuffer=true;function swap(b,n,m){var i=b[n];b[n]=b[m];b[m]=i}Buffer.prototype.swap16=function swap16(){var len=this.length;if(len%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var i=0;imax)str+=" ... ";return""};Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){if(isInstance(target,Uint8Array)){target=Buffer.from(target,target.offset,target.byteLength)}if(!Buffer.isBuffer(target)){throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. '+"Received type "+typeof target)}if(start===undefined){start=0}if(end===undefined){end=target?target.length:0}if(thisStart===undefined){thisStart=0}if(thisEnd===undefined){thisEnd=this.length}if(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}start>>>=0;end>>>=0;thisStart>>>=0;thisEnd>>>=0;if(this===target)return 0;var x=thisEnd-thisStart;var y=end-start;var len=Math.min(x,y);var thisCopy=this.slice(thisStart,thisEnd);var targetCopy=target.slice(start,end);for(var i=0;i2147483647){byteOffset=2147483647}else if(byteOffset<-2147483648){byteOffset=-2147483648}byteOffset=+byteOffset;if(numberIsNaN(byteOffset)){byteOffset=dir?0:buffer.length-1}if(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1}else if(byteOffset<0){if(dir)byteOffset=0;else return-1}if(typeof val==="string"){val=Buffer.from(val,encoding)}if(Buffer.isBuffer(val)){if(val.length===0){return-1}return arrayIndexOf(buffer,val,byteOffset,encoding,dir)}else if(typeof val==="number"){val=val&255;if(typeof Uint8Array.prototype.indexOf==="function"){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset)}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset)}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir)}throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){var indexSize=1;var arrLength=arr.length;var valLength=val.length;if(encoding!==undefined){encoding=String(encoding).toLowerCase();if(encoding==="ucs2"||encoding==="ucs-2"||encoding==="utf16le"||encoding==="utf-16le"){if(arr.length<2||val.length<2){return-1}indexSize=2;arrLength/=2;valLength/=2;byteOffset/=2}}function read(buf,i){if(indexSize===1){return buf[i]}else{return buf.readUInt16BE(i*indexSize)}}var i;if(dir){var foundIndex=-1;for(i=byteOffset;iarrLength)byteOffset=arrLength-valLength;for(i=byteOffset;i>=0;i--){var found=true;for(var j=0;jremaining){length=remaining}}var strLen=string.length;if(length>strLen/2){length=strLen/2}for(var i=0;i>>0;if(isFinite(length)){length=length>>>0;if(encoding===undefined)encoding="utf8"}else{encoding=length;length=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var remaining=this.length-offset;if(length===undefined||length>remaining)length=remaining;if(string.length>0&&(length<0||offset<0)||offset>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!encoding)encoding="utf8";var loweredCase=false;for(;;){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=true}}};Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);var res=[];var i=start;while(i239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:if(firstByte<128){codePoint=firstByte}break;case 2:secondByte=buf[i+1];if((secondByte&192)===128){tempCodePoint=(firstByte&31)<<6|secondByte&63;if(tempCodePoint>127){codePoint=tempCodePoint}}break;case 3:secondByte=buf[i+1];thirdByte=buf[i+2];if((secondByte&192)===128&&(thirdByte&192)===128){tempCodePoint=(firstByte&15)<<12|(secondByte&63)<<6|thirdByte&63;if(tempCodePoint>2047&&(tempCodePoint<55296||tempCodePoint>57343)){codePoint=tempCodePoint}}break;case 4:secondByte=buf[i+1];thirdByte=buf[i+2];fourthByte=buf[i+3];if((secondByte&192)===128&&(thirdByte&192)===128&&(fourthByte&192)===128){tempCodePoint=(firstByte&15)<<18|(secondByte&63)<<12|(thirdByte&63)<<6|fourthByte&63;if(tempCodePoint>65535&&tempCodePoint<1114112){codePoint=tempCodePoint}}}}if(codePoint===null){codePoint=65533;bytesPerSequence=1}else if(codePoint>65535){codePoint-=65536;res.push(codePoint>>>10&1023|55296);codePoint=56320|codePoint&1023}res.push(codePoint);i+=bytesPerSequence}return decodeCodePointsArray(res)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH){return String.fromCharCode.apply(String,codePoints)}var res="";var i=0;while(ilen)end=len;var out="";for(var i=start;ilen){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(endlength)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function readUIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){checkOffset(offset,byteLength,this.length)}var val=this[offset+--byteLength];var mul=1;while(byteLength>0&&(mul*=256)){val+=this[offset+--byteLength]*mul}return val};Buffer.prototype.readUInt8=function readUInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUInt16LE=function readUInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUInt16BE=function readUInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUInt32LE=function readUInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUInt32BE=function readUInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readIntLE=function readIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readIntBE=function readIntBE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var i=byteLength;var mul=1;var val=this[offset+--i];while(i>0&&(mul*=256)){val+=this[offset+--i]*mul}mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readInt8=function readInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function readInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function readInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function readInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function readInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readFloatLE=function readFloatLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function readFloatBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function readDoubleLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function readDoubleBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};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")}Buffer.prototype.writeUIntLE=function writeUIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}var mul=1;var i=0;this[offset]=value&255;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}var i=byteLength-1;var mul=1;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){this[offset+i]=value/mul&255}return offset+byteLength};Buffer.prototype.writeUInt8=function writeUInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,255,0);this[offset]=value&255;return offset+1};Buffer.prototype.writeUInt16LE=function writeUInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!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]=value&255;return offset+4};Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!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]=value&255;return offset+4};Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0;var mul=1;var sub=0;this[offset]=value&255;while(++i>0)-sub&255}return offset+byteLength};Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1;var mul=1;var sub=0;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){if(value<0&&sub===0&&this[offset+i+1]!==0){sub=1}this[offset+i]=(value/mul>>0)-sub&255}return offset+byteLength};Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(value<0)value=255+value+1;this[offset]=value&255;return offset+1};Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);this[offset]=value&255;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24;return offset+4};Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};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){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,4,34028234663852886e22,-34028234663852886e22)}ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,8,17976931348623157e292,-17976931348623157e292)}ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function copy(target,targetStart,start,end){if(!Buffer.isBuffer(target))throw new TypeError("argument should be a Buffer");if(!start)start=0;if(!end&&end!==0)end=this.length;if(targetStart>=target.length)targetStart=target.length;if(!targetStart)targetStart=0;if(end>0&&end=this.length)throw new RangeError("Index out of range");if(end<0)throw new RangeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(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 fill(val,start,end,encoding){if(typeof val==="string"){if(typeof start==="string"){encoding=start;start=0;end=this.length}else if(typeof end==="string"){encoding=end;end=this.length}if(encoding!==undefined&&typeof encoding!=="string"){throw new TypeError("encoding must be a string")}if(typeof encoding==="string"&&!Buffer.isEncoding(encoding)){throw new TypeError("Unknown encoding: "+encoding)}if(val.length===1){var code=val.charCodeAt(0);if(encoding==="utf8"&&code<128||encoding==="latin1"){val=code}}}else if(typeof val==="number"){val=val&255}if(start<0||this.length>>0;end=end===undefined?this.length:end>>>0;if(!val)val=0;var i;if(typeof val==="number"){for(i=start;i55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){if((units-=3)>-1)bytes.push(239,191,189);continue}else if(i+1===length){if((units-=3)>-1)bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=codePoint;continue}codePoint=(leadSurrogate-55296<<10|codePoint-56320)+65536}else if(leadSurrogate){if((units-=3)>-1)bytes.push(239,191,189)}leadSurrogate=null;if(codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,codePoint&63|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}else if(codePoint<1114112){if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}else{throw new Error("Invalid code point")}}return bytes}function asciiToBytes(str){var byteArray=[];for(var 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)break;dst[i+offset]=src[i]}return i}function isInstance(obj,type){return obj instanceof type||obj!=null&&obj.constructor!=null&&obj.constructor.name!=null&&obj.constructor.name===type.name}function numberIsNaN(obj){return obj!==obj}},{"base64-js":1,ieee754:3}],3:[function(require,module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m;var eLen=nBytes*8-mLen-1;var eMax=(1<>1;var nBits=-7;var i=isLE?nBytes-1:0;var d=isLE?-1:1;var s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8){}m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8){}if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=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;var eLen=nBytes*8-mLen-1;var eMax=(1<>1;var rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0;var i=isLE?0:nBytes-1;var d=isLE?1:-1;var s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8){}e=e<0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8){}buffer[offset+i-d]|=s*128}},{}],4:[function(require,module,exports){"use strict";var coreContentType="application/vnd.openxmlformats-package.core-properties+xml";var appContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml";var customContentType="application/vnd.openxmlformats-officedocument.custom-properties+xml";var settingsContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml";var diagramDataContentType="application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml";var diagramDrawingContentType="application/vnd.ms-office.drawingml.diagramDrawing+xml";module.exports={settingsContentType:settingsContentType,coreContentType:coreContentType,appContentType:appContentType,customContentType:customContentType,diagramDataContentType:diagramDataContentType,diagramDrawingContentType:diagramDrawingContentType}},{}],5:[function(require,module,exports){"use strict";function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e");if(end===-1){end=partValue.lastIndexOf(">")}return partValue.substr(0,end)+" ".concat(attr,'="').concat(attrValue,'"')+partValue.substr(end)}function getSingleAttribute(value,attributeName){var index=value.indexOf(" ".concat(attributeName,'="'));if(index===-1){return null}var startIndex=value.substr(index).search(/["']/)+index;var endIndex=value.substr(startIndex+1).search(/["']/)+startIndex;return value.substr(startIndex+1,endIndex-startIndex)}function endsWith(str,suffix){return str.indexOf(suffix,str.length-suffix.length)!==-1}function startsWith(str,prefix){return str.substring(0,prefix.length)===prefix}function getDuplicates(arr){var duplicates=[];var hash={},result=[];for(var i=0,l=arr.length;i0){result.push(chunk)}}return result}function getDefaults(){return{errorLogging:"json",stripInvalidXMLChars:false,paragraphLoop:false,nullGetter:function nullGetter(part){return part.module?"":"undefined"},xmlFileNames:["[Content_Types].xml"],parser:parser,linebreaks:false,fileTypeConfig:null,delimiters:{start:"{",end:"}"},syntax:{changeDelimiterPrefix:"="}}}function xml2str(xmlNode){return(new XMLSerializer).serializeToString(xmlNode).replace(/xmlns(:[a-z0-9]+)?="" ?/g,"")}function str2xml(str){if(str.charCodeAt(0)===65279){str=str.substr(1)}return(new DOMParser).parseFromString(str,"text/xml")}var charMap=[["&","&"],["<","<"],[">",">"],['"',"""],["'","'"]];var charMapRegexes=charMap.map(function(_ref){var _ref2=_slicedToArray(_ref,2),endChar=_ref2[0],startChar=_ref2[1];return{rstart:new RegExp(startChar,"g"),rend:new RegExp(endChar,"g"),start:startChar,end:endChar}});function wordToUtf8(string){for(var i=charMapRegexes.length-1;i>=0;i--){var r=charMapRegexes[i];string=string.replace(r.rstart,r.end)}return string}function utf8ToWord(string){var _string;if((_string=string)!==null&&_string!==void 0&&_string.toString){string=string.toString()}else{string=""}var r;for(var i=0,l=charMapRegexes.length;i"}function isStarting(value,element){return value.indexOf("<"+element)===0&&[">"," ","/"].indexOf(value[element.length+1])!==-1}function getRight(parsed,element,index){var val=getRightOrNull(parsed,element,index);if(val!==null){return val}throwXmlTagNotFound({position:"right",element:element,parsed:parsed,index:index})}function getRightOrNull(parsed,elements,index){if(typeof elements==="string"){elements=[elements]}var level=1;for(var i=index,l=parsed.length;i=0;i--){var part=parsed[i];for(var _i10=0,_elements4=elements;_i10<_elements4.length;_i10++){var element=_elements4[_i10];if(isStarting(part.value,element)){level--}if(isEnding(part.value,element)){level++}if(level===0){return i}}}return null}function isTagStart(tagType,_ref3){var type=_ref3.type,tag=_ref3.tag,position=_ref3.position;return type==="tag"&&tag===tagType&&(position==="start"||position==="selfclosing")}function isTagEnd(tagType,_ref4){var type=_ref4.type,tag=_ref4.tag,position=_ref4.position;return type==="tag"&&tag===tagType&&position==="end"}function isParagraphStart(_ref5){var type=_ref5.type,tag=_ref5.tag,position=_ref5.position;return["w:p","a:p"].indexOf(tag)!==-1&&type==="tag"&&position==="start"}function isParagraphEnd(_ref6){var type=_ref6.type,tag=_ref6.tag,position=_ref6.position;return["w:p","a:p"].indexOf(tag)!==-1&&type==="tag"&&position==="end"}function isTextStart(_ref7){var type=_ref7.type,position=_ref7.position,text=_ref7.text;return text&&type==="tag"&&position==="start"}function isTextEnd(_ref8){var type=_ref8.type,position=_ref8.position,text=_ref8.text;return text&&type==="tag"&&position==="end"}function isContent(_ref9){var type=_ref9.type,position=_ref9.position;return type==="placeholder"||type==="content"&&position==="insidetag"}function isModule(_ref0,modules){var module=_ref0.module,type=_ref0.type;if(!(modules instanceof Array)){modules=[modules]}return type==="placeholder"&&modules.indexOf(module)!==-1}var corruptCharacters=/[\x00-\x08\x0B\x0C\x0E-\x1F]/g;function hasCorruptCharacters(string){corruptCharacters.lastIndex=0;return corruptCharacters.test(string)}function removeCorruptCharacters(string){if(typeof string!=="string"){string=String(string)}return string.replace(corruptCharacters,"")}function invertMap(map){var invertedMap={};for(var key in map){var value=map[key];invertedMap[value]||(invertedMap[value]=[]);invertedMap[value].push(key)}return invertedMap}function stableSort(arr,compare){return arr.map(function(item,index){return{item:item,index:index}}).sort(function(a,b){return compare(a.item,b.item)||a.index-b.index}).map(function(_ref1){var item=_ref1.item;return item})}module.exports={endsWith:endsWith,startsWith:startsWith,isContent:isContent,isParagraphStart:isParagraphStart,isParagraphEnd:isParagraphEnd,isTagStart:isTagStart,isTagEnd:isTagEnd,isTextStart:isTextStart,isTextEnd:isTextEnd,isStarting:isStarting,isEnding:isEnding,isModule:isModule,uniq:uniq,getDuplicates:getDuplicates,chunkBy:chunkBy,last:last,first:first,xml2str:xml2str,str2xml:str2xml,getRightOrNull:getRightOrNull,getRight:getRight,getLeftOrNull:getLeftOrNull,getLeft:getLeft,pregMatchAll:pregMatchAll,convertSpaces:convertSpaces,charMapRegexes:charMapRegexes,hasCorruptCharacters:hasCorruptCharacters,removeCorruptCharacters:removeCorruptCharacters,getDefaults:getDefaults,wordToUtf8:wordToUtf8,utf8ToWord:utf8ToWord,concatArrays:concatArrays,pushArray:pushArray,invertMap:invertMap,charMap:charMap,getSingleAttribute:getSingleAttribute,setSingleAttribute:setSingleAttribute,isWhiteSpace:isWhiteSpace,stableSort:stableSort}},{"./errors.js":7,"./utils.js":31,"@xmldom/xmldom":40}],6:[function(require,module,exports){"use strict";var _require=require("./doc-utils.js"),pushArray=_require.pushArray;function replaceErrors(key,value){if(value instanceof Error){return pushArray(Object.getOwnPropertyNames(value),["stack"]).reduce(function(error,key){error[key]=value[key];if(key==="stack"){error[key]=value[key].toString()}return error},{})}return value}function logger(error,logging){console.log(JSON.stringify({error:error},replaceErrors,logging==="json"?2:null));if(error.properties&&error.properties.errors instanceof Array){var errorMessages=error.properties.errors.map(function(error){return error.properties.explanation}).join("\n");console.log("errorMessages",errorMessages)}}module.exports=logger},{"./doc-utils.js":5}],7:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r"},{tag:"w:tc",shouldContain:["w:p"],value:""},{tag:"w:tr",shouldContain:["w:tc"],drop:true},{tag:"w:tbl",shouldContain:["w:tr"],drop:true}]}}function PptXFileTypeConfig(){return{getTemplatedFiles:function getTemplatedFiles(){return[]},textPath:function textPath(doc){return doc.textTarget},tagsXmlTextArray:["Company","HyperlinkBase","Manager","cp:category","cp:keywords","dc:creator","dc:description","dc:subject","dc:title","a:t","m:t","vt:lpstr","vt:lpwstr"],tagsXmlLexedArray:["p:sp","a:tc","a:tr","a:tbl","a:graphicData","a:p","a:r","a:rPr","p:txBody","a:txBody","a:off","a:ext","p:graphicFrame","p:xfrm","a16:rowId","a:endParaRPr"],droppedTagsInsidePlaceholder:["a:p","a:endParaRPr"],expandTags:[{contains:"a:tc",expand:"a:tr"}],onParagraphLoop:[{contains:"a:p",expand:"a:p",onlyTextInTag:true}],tagRawXml:"p:sp",baseModules:[loopModule,expandPairTrait,rawXmlModule,render],tagShouldContain:[{tag:"a:tbl",shouldContain:["a:tr"],dropParent:"p:graphicFrame"},{tag:"p:txBody",shouldContain:["a:p"],value:""},{tag:"a:txBody",shouldContain:["a:p"],value:""}]}}module.exports={docx:DocXFileTypeConfig,pptx:PptXFileTypeConfig}},{"./modules/expand-pair-trait.js":19,"./modules/loop.js":20,"./modules/rawxml.js":21,"./modules/render.js":22,"./modules/space-preserve.js":23}],9:[function(require,module,exports){"use strict";var docxContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml";var docxmContentType="application/vnd.ms-word.document.macroEnabled.main+xml";var dotxContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml";var dotmContentType="application/vnd.ms-word.template.macroEnabledTemplate.main+xml";var headerContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml";var footnotesContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml";var commentsContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml";var footerContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml";var pptxContentType="application/vnd.openxmlformats-officedocument.presentationml.slide+xml";var pptxSlideMaster="application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml";var pptxSlideLayout="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml";var pptxPresentationContentType="application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml";var xlsxContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml";var xlsmContentType="application/vnd.ms-excel.sheet.macroEnabled.main+xml";var xlsxWorksheetContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml";var main=[docxContentType,docxmContentType,dotxContentType,dotmContentType];var filetypes={main:main,docx:[headerContentType].concat(main,[footerContentType,footnotesContentType,commentsContentType]),pptx:[pptxContentType,pptxSlideMaster,pptxSlideLayout,pptxPresentationContentType],xlsx:[xlsxContentType,xlsmContentType,xlsxWorksheetContentType]};module.exports=filetypes},{}],10:[function(require,module,exports){"use strict";var _require=require("./doc-utils.js"),str2xml=_require.str2xml;var ctXML="[Content_Types].xml";function collectContentTypes(overrides,defaults,zip){var partNames={};for(var _i2=0;_i2r.length)&&(a=r.length);for(var e=0,n=Array(a);e2&&arguments[2]!==undefined?arguments[2]:path.length;var localTags=tags;for(var i=0;ipart.lIndex){size--}}return size}while(stack.length>0){var current=stack.pop();var localTags=getLocalTags(tags,current.path);for(var _i4=0,_current$items2=current.items;_i4<_current$items2.length;_i4++){var _localTags4,_part$value2;var part=_current$items2[_i4];if(part.attrParsed){for(var key in part.attrParsed){processFiltered(part,current,part.attrParsed[key].filter(isPlaceholder))}continue}if(part.subparsed){if(part.dataBound!==false){var _localTags,_part$value;(_localTags=localTags)[_part$value=part.value]||(_localTags[_part$value]={})}processFiltered(part,current,part.subparsed.filter(isPlaceholder));continue}if(part.cellParsed){for(var _i6=0,_part$cellPostParsed2=part.cellPostParsed;_i6<_part$cellPostParsed2.length;_i6++){var cp=_part$cellPostParsed2[_i6];if(cp.type==="placeholder"){if(cp.module==="pro-xml-templating/xls-module-loop"){continue}else if(cp.subparsed){var _localTags2,_cp$value;(_localTags2=localTags)[_cp$value=cp.value]||(_localTags2[_cp$value]={});processFiltered(cp,current,cp.subparsed.filter(isPlaceholder))}else{var _localTags3,_cp$value2;var sizeScope=getScopeSize(part,current.parents);localTags=getLocalTags(tags,current.path,sizeScope);(_localTags3=localTags)[_cp$value2=cp.value]||(_localTags3[_cp$value2]={})}}}continue}if(part.dataBound===false){continue}(_localTags4=localTags)[_part$value2=part.value]||(_localTags4[_part$value2]={})}}return tags}module.exports={getTags:getTags,isPlaceholder:isPlaceholder}},{}],14:[function(require,module,exports){"use strict";var _require=require("./doc-utils.js"),startsWith=_require.startsWith,endsWith=_require.endsWith,isStarting=_require.isStarting,isEnding=_require.isEnding,isWhiteSpace=_require.isWhiteSpace;var filetypes=require("./filetypes.js");function addEmptyParagraphAfterTable(parts){var lastNonEmpty="";for(var i=0,len=parts.length;i")){if(!startsWith(p,"".concat(p)}}lastNonEmpty=p;parts[i]=p}return parts}function joinUncorrupt(parts,options){var contains=options.fileTypeConfig.tagShouldContain||[];var collecting="";var currentlyCollecting=-1;if(filetypes.docx.indexOf(options.contentType)!==-1){parts=addEmptyParagraphAfterTable(parts)}var startIndex=-1;for(var j=0,len2=contains.length;j0;k--){if(isStarting(parts[k],dropParent)){start=k;break}}for(var _k=start;_k<=parts.length;_k++){if(isEnding(parts[_k],dropParent)){parts[_k]="";break}parts[_k]=""}}else{for(var _k2=startIndex;_k2<=i;_k2++){parts[_k2]=""}if(!drop){parts[i]=collecting+value+part}}}collecting+=part;for(var _k3=0,len3=shouldContain.length;_k3r.length)&&(a=r.length);for(var e=0,n=Array(a);e",cursor);if(cursor===-1||nextOpening!==-1&&cursor>nextOpening){throwXmlInvalid(content,offset)}var tagText=content.slice(offset,cursor+1);var _getTag=getTag(tagText),tag=_getTag.tag,position=_getTag.position;var text=allMatches[tag];if(text==null){continue}totalMatches.push({type:"tag",position:position,text:text,offset:offset,value:tagText,tag:tag})}return totalMatches}function getDelimiterErrors(delimiterMatches,fullText,syntaxOptions){var errors=[];var inDelimiter=false;var lastDelimiterMatch={offset:0};var xtag;var delimiterWithErrors=delimiterMatches.reduce(function(delimiterAcc,currDelimiterMatch){var position=currDelimiterMatch.position;var delimiterOffset=currDelimiterMatch.offset;var lastDelimiterOffset=lastDelimiterMatch.offset;var lastDelimiterLength=lastDelimiterMatch.length;xtag=fullText.substr(lastDelimiterOffset,delimiterOffset-lastDelimiterOffset);if(inDelimiter&&position==="start"){if(lastDelimiterOffset+lastDelimiterLength===delimiterOffset){xtag=fullText.substr(lastDelimiterOffset,delimiterOffset-lastDelimiterOffset+lastDelimiterLength+4);if(!syntaxOptions.allowUnclosedTag){errors.push(getDuplicateOpenTagException({xtag:xtag,offset:lastDelimiterOffset}));lastDelimiterMatch=currDelimiterMatch;delimiterAcc.push(_objectSpread(_objectSpread({},currDelimiterMatch),{},{error:true}));return delimiterAcc}}if(!syntaxOptions.allowUnclosedTag){errors.push(getUnclosedTagException({xtag:wordToUtf8(xtag),offset:lastDelimiterOffset}));lastDelimiterMatch=currDelimiterMatch;delimiterAcc.push(_objectSpread(_objectSpread({},currDelimiterMatch),{},{error:true}));return delimiterAcc}delimiterAcc.pop()}if(!inDelimiter&&position==="end"){if(syntaxOptions.allowUnopenedTag){return delimiterAcc}if(lastDelimiterOffset+lastDelimiterLength===delimiterOffset){xtag=fullText.substr(lastDelimiterOffset-4,delimiterOffset-lastDelimiterOffset+lastDelimiterLength+4);errors.push(getDuplicateCloseTagException({xtag:xtag,offset:lastDelimiterOffset}));lastDelimiterMatch=currDelimiterMatch;delimiterAcc.push(_objectSpread(_objectSpread({},currDelimiterMatch),{},{error:true}));return delimiterAcc}errors.push(getUnopenedTagException({xtag:xtag,offset:delimiterOffset}));lastDelimiterMatch=currDelimiterMatch;delimiterAcc.push(_objectSpread(_objectSpread({},currDelimiterMatch),{},{error:true}));return delimiterAcc}inDelimiter=position==="start";lastDelimiterMatch=currDelimiterMatch;delimiterAcc.push(currDelimiterMatch);return delimiterAcc},[]);if(inDelimiter){var lastDelimiterOffset=lastDelimiterMatch.offset;xtag=fullText.substr(lastDelimiterOffset,fullText.length-lastDelimiterOffset);if(!syntaxOptions.allowUnclosedTag){errors.push(getUnclosedTagException({xtag:wordToUtf8(xtag),offset:lastDelimiterOffset}))}else{delimiterWithErrors.pop()}}return{delimiterWithErrors:delimiterWithErrors,errors:errors}}function compareOffsets(startOffset,endOffset){if(startOffset===-1&&endOffset===-1){return DELIMITER_NONE}if(startOffset===endOffset){return DELIMITER_EQUAL}if(startOffset===-1||endOffset===-1){return endOffset0){cursor=cutNext;cutNext=0}for(var _i6=0;_i60){parts.push({type:"content",value:_value})}}else{cursor=delimiterInOffset.offset-offset+delimiterInOffset.length}continue}if(_value.length>0){parts.push({type:"content",value:_value});cursor+=_value.length}var delimiterPart={type:"delimiter",position:delimiterInOffset.position,offset:cursor+offset};parts.push(delimiterPart);cursor=delimiterInOffset.offset-offset+delimiterInOffset.length}cutNext=cursor-partContent.length;var value=partContent.substr(cursor);if(value.length>0){parts.push({type:"content",value:value})}return parts},this);return{parsed:parsed,errors:errors}}function isInsideContent(part){return part.type==="content"&&part.position==="insidetag"}function getContentParts(xmlparsed){return xmlparsed.filter(isInsideContent)}function decodeContentParts(xmlparsed,fileType){var inTextTag=false;for(var _i8=0;_i8/g,">")}}}module.exports={parseDelimiters:parseDelimiters,parse:function parse(xmllexed,delimiters,syntax,fileType){decodeContentParts(xmllexed,fileType);var _parseDelimiters=parseDelimiters(getContentParts(xmllexed),delimiters,syntax),delimiterParsed=_parseDelimiters.parsed,errors=_parseDelimiters.errors;var lexed=[];var index=0;var lIndex=0;for(var _i0=0;_i0cursor&&match.offset-cursor>0){parsed.push({type:"content",value:content.substr(cursor,match.offset-cursor)})}cursor=match.offset+match.value.length;delete match.offset;parsed.push(match)}if(content.length>cursor){parsed.push({type:"content",value:content.substr(cursor)})}return parsed}}},{"./doc-utils.js":5,"./errors.js":7}],16:[function(require,module,exports){"use strict";function getMinFromArrays(arrays,state){var minIndex=-1;for(var i=0,l=arrays.length;i=arrays[i].length){continue}if(minIndex===-1||arrays[i][state[i]].offset0});var resultArray=new Array(totalLength);var state=arrays.map(function(){return 0});for(var i=0;i0){var result=transformer(transformedTraits);pushArray(errors,result.errors);transformedTraits=result.traits}if(errors.length>0){return{pairs:pairs,errors:errors}}var countOpen=0;for(var _i4=0;_i4=0?countOpen:0}return{pairs:pairs,errors:errors}}var ExpandPairTrait=function(){function ExpandPairTrait(){_classCallCheck(this,ExpandPairTrait);this.name="ExpandPairTrait"}return _createClass(ExpandPairTrait,[{key:"optionsTransformer",value:function optionsTransformer(options,docxtemplater){if(docxtemplater.options.paragraphLoop){pushArray(docxtemplater.fileTypeConfig.expandTags,docxtemplater.fileTypeConfig.onParagraphLoop)}this.expandTags=docxtemplater.fileTypeConfig.expandTags;return options}},{key:"postparse",value:function postparse(postparsed,_ref){var _this=this;var getTraits=_ref.getTraits,_postparse=_ref.postparse,fileType=_ref.fileType;var traits=getTraits(traitName,postparsed);traits=traits.map(function(trait){return trait||[]});traits=mergeSort(traits);var _getPairs=getPairs(traits),pairs=_getPairs.pairs,errors=_getPairs.errors;var lastRight=0;var lastPair=null;var expandedPairs=pairs.map(function(pair){var expandTo=pair[0].part.expandTo;if(expandTo==="auto"&&fileType!=="text"){var result=getExpandToDefault(postparsed,pair,_this.expandTags);if(result.error){errors.push(result.error)}expandTo=result.value}if(!expandTo||fileType==="text"){var _left=pair[0].offset;var _right=pair[1].offset;if(_left0){return{postparsed:postparsed,errors:errors}}var currentPairIndex=0;var innerParts;var newParsed=postparsed.reduce(function(newParsed,part,i){var inPair=currentPairIndexr.length)&&(a=r.length);for(var e=0,n=Array(a);e':""}function isEnclosedByParagraphs(parsed){return parsed.length&&isParagraphStart(parsed[0])&&isParagraphEnd(last(parsed))}function getOffset(chunk){return hasContent(chunk)?0:chunk.length}function addPageBreakAtEnd(subRendered){var j=subRendered.parts.length-1;if(subRendered.parts[j]===""){subRendered.parts.splice(j,0,'')}else{subRendered.parts.push('')}}function addPageBreakAtBeginning(subRendered){subRendered.parts.unshift('')}function isContinuous(parts){return parts.some(function(part){return isTagStart("w:type",part)&&part.value.indexOf("continuous")!==-1})}function isNextPage(parts){return parts.some(function(part){return isTagStart("w:type",part)&&part.value.indexOf('w:val="nextPage"')!==-1})}function addSectionBefore(parts,sect){return pushArray(["".concat(sect.map(function(_ref){var value=_ref.value;return value}).join(""),"")],parts)}function addContinuousType(parts){var stop=false;var inSectPr=false;var result=[];for(var _i4=0;_i4')}}result.push(part)}return result}function dropHeaderFooterRefs(parts){return parts.filter(function(text){return!startsWith(text,"=0;i--){var part=parsed[i];if(isTagEnd("w:sectPr",part)){inSectPr=true}if(isTagStart("w:sectPr",part)){sectPr.unshift(part.value);inSectPr=false}if(inSectPr){sectPr.unshift(part.value)}if(isParagraphStart(part)){if(sectPr.length>0){return sectPr.join("")}break}}return""}var LoopModule=function(){function LoopModule(){_classCallCheck(this,LoopModule);this.name="LoopModule";this.inXfrm=false;this.totalSectPr=0;this.prefix={start:"#",end:"/",dash:/^-([^\s]+)\s(.+)/,inverted:"^"}}return _createClass(LoopModule,[{key:"optionsTransformer",value:function optionsTransformer(opts,docxtemplater){this.docxtemplater=docxtemplater;return opts}},{key:"preparse",value:function preparse(parsed,_ref3){var contentType=_ref3.contentType;if(filetypes.main.indexOf(contentType)!==-1){this.sects=getSectPr(parsed)}}},{key:"matchers",value:function matchers(){var module=moduleName;return[[this.prefix.start,module,{expandTo:"auto",location:"start",inverted:false}],[this.prefix.inverted,module,{expandTo:"auto",location:"start",inverted:true}],[this.prefix.end,module,{location:"end"}],[this.prefix.dash,module,function(_ref4){var _ref5=_slicedToArray(_ref4,3),expandTo=_ref5[1],value=_ref5[2];return{location:"start",inverted:false,expandTo:expandTo,value:value}}]]}},{key:"getTraits",value:function getTraits(traitName,parsed){if(traitName!=="expandPair"){return}var tags=[];for(var offset=0,len=parsed.length;offset0){basePart.sectPrCount=getSectPrHeaderFooterChangeCount(parsed);this.totalSectPr+=basePart.sectPrCount;var sects=this.sects;sects.some(function(sect,index){if(basePart.lIndex0){throw errorList}return value})})})}},{key:"render",value:function render(part,options){if(part.tag==="p:xfrm"){this.inXfrm=part.position==="start"}if(part.tag==="a:ext"&&this.inXfrm){this.lastExt=part;return part}if(!isModule(part,moduleName)){return null}var totalValue=[];var errors=[];var heightOffset=0;var self=this;var firstTag=part.subparsed[0];var tagHeight=0;if((firstTag===null||firstTag===void 0?void 0:firstTag.tag)==="a:tr"){tagHeight=+getSingleAttribute(firstTag.value,"h")}heightOffset-=tagHeight;var a16RowIdOffset=0;var insideParagraphLoop=isInsideParagraphLoop(part);function loopOver(scope,i,length){heightOffset+=tagHeight;var scopeManager=options.scopeManager.createSubScopeManager(scope,part.value,i,part,length);for(var _i0=0,_part$subparsed2=part.subparsed;_i0<_part$subparsed2.length;_i0++){var pp=_part$subparsed2[_i0];if(isTagStart("a16:rowId",pp)){var val=+getSingleAttribute(pp.value,"val")+a16RowIdOffset;a16RowIdOffset=1;pp.value=setSingleAttribute(pp.value,"val",val)}}var subRendered=options.render(_objectSpread(_objectSpread({},options),{},{compiled:part.subparsed,tags:{},scopeManager:scopeManager}));if(part.hasPageBreak&&i===length-1&&insideParagraphLoop){addPageBreakAtEnd(subRendered)}var isNotFirst=scopeManager.scopePathItem.some(function(i){return i!==0});if(isNotFirst){if(part.sectPrCount===1){subRendered.parts=dropHeaderFooterRefs(subRendered.parts)}if(part.addContinuousType){subRendered.parts=addContinuousType(subRendered.parts)}}else if(part.addNextPage){subRendered.parts=addSectionBefore(subRendered.parts,self.sects[part.addNextPage.index])}if(part.addNextPage){addPageBreakAtEnd(subRendered)}if(part.hasPageBreakBeginning&&insideParagraphLoop){addPageBreakAtBeginning(subRendered)}for(var _i10=0,_subRendered$parts2=subRendered.parts;_i10<_subRendered$parts2.length;_i10++){var _val=_subRendered$parts2[_i10];totalValue.push(_val)}pushArray(errors,subRendered.errors)}var value=options.scopeManager.getValue(part.value,{part:part});value!==null&&value!==void 0?value:value=options.nullGetter(part);var result=options.scopeManager.loopOverValue(value,loopOver,part.inverted);if(result===false){if(part.lastParagrapSectPr){if(part.paragraphLoop){return{value:"".concat(part.lastParagrapSectPr,"")}}return{value:"".concat(part.lastParagrapSectPr,"")}}return{value:getPageBreakIfApplies(part)||"",errors:errors}}if(heightOffset!==0){var cy=+getSingleAttribute(this.lastExt.value,"cy");this.lastExt.value=setSingleAttribute(this.lastExt.value,"cy",cy+heightOffset)}return{value:options.joinUncorrupt(totalValue,_objectSpread(_objectSpread({},options),{},{basePart:part})),errors:errors}}}])}();module.exports=function(){return wrapper(new LoopModule)}},{"../doc-utils.js":5,"../filetypes.js":9,"../module-wrapper.js":17}],21:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t":"";this.prefix=ftprefix[docxtemplater.fileType];this.runStartTag="".concat(this.prefix,":r");this.runPropsStartTag="".concat(this.prefix,":rPr");return options}},{key:"set",value:function set(obj){if(obj.compiled){this.compiled=obj.compiled}if(obj.data!=null){this.data=obj.data}}},{key:"getRenderedMap",value:function getRenderedMap(mapper){for(var from in this.compiled){mapper[from]={from:from,data:this.data}}return mapper}},{key:"postparse",value:function postparse(postparsed,options){var errors=[];for(var _i2=0;_i2").concat(this.brTag,"<").concat(this.prefix,":r>").concat(this.recordedRun,"<").concat(this.prefix,":t").concat(this.docxtemplater.fileType==="docx"?' xml:space="preserve"':"",">"))}}return result}}])}();module.exports=function(){return wrapper(new Render)}},{"../content-types.js":4,"../doc-utils.js":5,"../errors.js":7,"../module-wrapper.js":17}],23:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t"){return tag}if(tag.indexOf('xml:space="preserve"')!==-1){return tag}return tag.substr(0,tag.length-1)+' xml:space="preserve">'}function isInsideLoop(meta,chunk){return meta&&meta.basePart&&chunk.length>1}var SpacePreserve=function(){function SpacePreserve(){_classCallCheck(this,SpacePreserve);this.name="SpacePreserveModule"}return _createClass(SpacePreserve,[{key:"postparse",value:function postparse(postparsed,meta){var chunk=[],inTextTag=false,endLindex=0,lastTextTag=0;function isStartingPlaceHolder(part,chunk){return part.type==="placeholder"&&chunk.length>1}var result=postparsed.reduce(function(postparsed,part){if(isWtStart(part)){inTextTag=true;lastTextTag=chunk.length}if(!inTextTag){postparsed.push(part);return postparsed}chunk.push(part);if(isInsideLoop(meta,chunk)){endLindex=meta.basePart.endLindex;chunk[0].value=addXMLPreserve(chunk,0)}if(isStartingPlaceHolder(part,chunk)){chunk[lastTextTag].value=addXMLPreserve(chunk,lastTextTag);endLindex=part.endLindex}if(isTextEnd(part)&&part.lIndex>endLindex){if(endLindex!==0){chunk[lastTextTag].value=addXMLPreserve(chunk,lastTextTag)}pushArray(postparsed,chunk);chunk=[];inTextTag=false;endLindex=0;lastTextTag=0}return postparsed},[]);pushArray(result,chunk);return result}},{key:"postrender",value:function postrender(parts){var lastNonEmpty="";var lastNonEmptyIndex=0;for(var i=0,len=parts.length;i";p=p.substr(wtEndlen)}lastNonEmpty=p;lastNonEmptyIndex=i;parts[i]=p}return parts}}])}();module.exports=function(){return wrapper(new SpacePreserve)}},{"../doc-utils.js":5,"../module-wrapper.js":17}],24:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;rr.length)&&(a=r.length);for(var e=0,n=Array(a);e0){var bestMatch=null;for(var _i6=0;_i6bestMatch.priority){bestMatch=_match}}bestMatch.offset=startOffset;delete bestMatch.priority;bestMatch.endLindex=endLindex;bestMatch.lIndex=endLindex;bestMatch.raw=placeHolderContent;if(bestMatch.onMatch){bestMatch.onMatch(bestMatch)}delete bestMatch.onMatch;delete bestMatch.prefix;return bestMatch}for(var _i8=0;_i8>>6;buf[i++]=128|c&63}else if(c<65536){buf[i++]=224|c>>>12;buf[i++]=128|c>>>6&63;buf[i++]=128|c&63}else{buf[i++]=240|c>>>18;buf[i++]=128|c>>>12&63;buf[i++]=128|c>>>6&63;buf[i++]=128|c&63}}return buf}function postrender(parts,options){for(var _i2=0,_options$modules2=options.modules;_i2<_options$modules2.length;_i2++){var _module=_options$modules2[_i2];parts=_module.postrender(parts,options)}var fullLength=0;var newParts=options.joinUncorrupt(parts,options);var longStr="";var lenStr=0;var maxCompact=65536;var uintArrays=[];for(var i=0,len=newParts.length;imaxCompact){var _arr=string2buf(longStr);fullLength+=_arr.length;uintArrays.push(_arr);longStr=""}longStr+=part;lenStr+=part.length;delete newParts[i]}var arr=string2buf(longStr);fullLength+=arr.length;uintArrays.push(arr);var array=new Uint8Array(fullLength);var j=0;for(var _i4=0;_i4>>0;var value;for(var i=0;i0){return _getValue.call(this,tag,meta,num-1)}return result}function _getValueAsync(tag,meta,num){var _this2=this;var scope=this.scopeList[num];var parser;if(!this.cachedParsers||!meta.part){parser=this.parser(tag,{tag:meta.part,scopePath:this.scopePath})}else if(this.cachedParsers[meta.part.lIndex]){parser=this.cachedParsers[meta.part.lIndex]}else{parser=this.cachedParsers[meta.part.lIndex]=this.parser(tag,{tag:meta.part,scopePath:this.scopePath})}return Promise.resolve().then(function(){return parser.get(scope,_this2.getContext(meta,num))})["catch"](function(error){throw getScopeParserExecutionError({tag:tag,scope:scope,error:error,offset:meta.part.offset})}).then(function(result){if(result==null&&num>0){return _getValueAsync.call(_this2,tag,meta,num-1)}return result})}var ScopeManager=function(){function ScopeManager(options){_classCallCheck(this,ScopeManager);this.root=options.root||this;this.resolveOffset=options.resolveOffset||0;this.scopePath=options.scopePath;this.scopePathItem=options.scopePathItem;this.scopePathLength=options.scopePathLength;this.scopeList=options.scopeList;this.scopeType="";this.scopeTypes=options.scopeTypes;this.scopeLindex=options.scopeLindex;this.parser=options.parser;this.resolved=options.resolved;this.cachedParsers=options.cachedParsers}return _createClass(ScopeManager,[{key:"loopOver",value:function loopOver(tag,functor,inverted,meta){return this.loopOverValue(this.getValue(tag,meta),functor,inverted)}},{key:"functorIfInverted",value:function functorIfInverted(inverted,functor,value,i,length){if(inverted){functor(value,i,length)}return inverted}},{key:"isValueFalsy",value:function isValueFalsy(value,type){return value==null||!value||type==="[object Array]"&&value.length===0}},{key:"loopOverValue",value:function loopOverValue(value,functor,inverted){if(this.root.finishedResolving){inverted=false}var type=Object.prototype.toString.call(value);if(this.isValueFalsy(value,type)){this.scopeType=false;return this.functorIfInverted(inverted,functor,last(this.scopeList),0,1)}if(type==="[object Array]"){this.scopeType="array";for(var i=0;ir.length)&&(a=r.length);for(var e=0,n=Array(a);e0?limits[_i7-1].right:0);if(_limit2.left]*>)([^<>]*))|(<(?:").concat(taj,")[^>]*/>)"),"g");res.matches=pregMatchAll(regexp,res.content);return res}},{"./doc-utils.js":5}],33:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:{},noPostParse=_ref2.noPostParse;this.setModules({inspect:{filePath:this.filePath}});var options=this.getOptions();this.parsed=Parser.parse(this.lexed,this.modules,options);this.setModules({inspect:{filePath:this.filePath,parsed:this.parsed}});if(noPostParse){return this}return this.postparse()}},{key:"postparse",value:function postparse(){var options=this.getOptions();var _Parser$postparse=Parser.postparse(this.parsed,this.modules,options),postparsed=_Parser$postparse.postparsed,postparsedErrors=_Parser$postparse.errors;this.postparsed=postparsed;this.setModules({inspect:{filePath:this.filePath,postparsed:this.postparsed}});pushArray(this.allErrors,postparsedErrors);this.errorChecker(this.allErrors);return this}},{key:"errorChecker",value:function errorChecker(errors){for(var _i4=0,_errors2=errors;_i4<_errors2.length;_i4++){var error=_errors2[_i4];error.properties||(error.properties={});error.properties.file=this.filePath}for(var _i6=0,_this$modules4=this.modules;_i6<_this$modules4.length;_i6++){var _module2=_this$modules4[_i6];errors=_module2.errorsTransformer(errors)}}},{key:"baseNullGetter",value:function baseNullGetter(part,sm){var value=null;for(var _i8=0,_this$modules6=this.modules;_i8<_this$modules6.length;_i8++){var _module3=_this$modules6[_i8];if(value!=null){continue}value=_module3.nullGetter(part,sm,this)}if(value!=null){return value}return this.nullGetter(part,sm)}},{key:"getOptions",value:function getOptions(){return{compiled:this.postparsed,cachedParsers:this.cachedParsers,tags:this.tags,modules:this.modules,parser:this.parser,contentType:this.contentType,relsType:this.relsType,baseNullGetter:this.baseNullGetter.bind(this),filePath:this.filePath,fileTypeConfig:this.fileTypeConfig,fileType:this.fileType,linebreaks:this.linebreaks,stripInvalidXMLChars:this.stripInvalidXMLChars}}},{key:"render",value:function render(to){this.filePath=to;var options=this.getOptions();options.resolved=this.scopeManager.resolved;options.scopeManager=this.scopeManager;options.render=_render;options.joinUncorrupt=joinUncorrupt;var _render2=_render(options),errors=_render2.errors,parts=_render2.parts;if(errors.length>0){this.allErrors=errors;this.errorChecker(errors);return this}this.content=postrender(parts,options);this.setModules({inspect:{filePath:this.filePath,content:this.content}});return this}}])}()},{"./doc-utils.js":5,"./join-uncorrupt.js":14,"./lexer.js":15,"./parser.js":24,"./postrender.js":25,"./render.js":27,"./resolve.js":28,"./xml-matcher.js":32}],34:[function(require,module,exports){"use strict";function find(list,predicate,ac){if(ac===undefined){ac=Array.prototype}if(list&&typeof ac.find==="function"){return ac.find.call(list,predicate)}for(var i=0;i-1}var NAMESPACE=freeze({HTML:"http://www.w3.org/1999/xhtml",SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});exports.assign=assign;exports.find=find;exports.freeze=freeze;exports.HTML_BOOLEAN_ATTRIBUTES=HTML_BOOLEAN_ATTRIBUTES;exports.HTML_RAW_TEXT_ELEMENTS=HTML_RAW_TEXT_ELEMENTS;exports.HTML_VOID_ELEMENTS=HTML_VOID_ELEMENTS;exports.hasDefaultHTMLNamespace=hasDefaultHTMLNamespace;exports.hasOwn=hasOwn;exports.isHTMLBooleanAttribute=isHTMLBooleanAttribute;exports.isHTMLRawTextElement=isHTMLRawTextElement;exports.isHTMLEscapableRawTextElement=isHTMLEscapableRawTextElement;exports.isHTMLMimeType=isHTMLMimeType;exports.isHTMLVoidElement=isHTMLVoidElement;exports.isValidMimeType=isValidMimeType;exports.MIME_TYPE=MIME_TYPE;exports.NAMESPACE=NAMESPACE},{}],35:[function(require,module,exports){"use strict";var conventions=require("./conventions");var dom=require("./dom");var errors=require("./errors");var entities=require("./entities");var sax=require("./sax");var DOMImplementation=dom.DOMImplementation;var hasDefaultHTMLNamespace=conventions.hasDefaultHTMLNamespace;var isHTMLMimeType=conventions.isHTMLMimeType;var isValidMimeType=conventions.isValidMimeType;var MIME_TYPE=conventions.MIME_TYPE;var NAMESPACE=conventions.NAMESPACE;var ParseError=errors.ParseError;var XMLReader=sax.XMLReader;function normalizeLineEndings(input){return input.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028\u2029]/g,"\n")}function DOMParser(options){options=options||{};if(options.locator===undefined){options.locator=true}this.assign=options.assign||conventions.assign;this.domHandler=options.domHandler||DOMHandler;this.onError=options.onError||options.errorHandler;if(options.errorHandler&&typeof options.errorHandler!=="function"){throw new TypeError("errorHandler object is no longer supported, switch to onError!")}else if(options.errorHandler){options.errorHandler("warning","The `errorHandler` option has been deprecated, use `onError` instead!",this)}this.normalizeLineEndings=options.normalizeLineEndings||normalizeLineEndings;this.locator=!!options.locator;this.xmlns=this.assign(Object.create(null),options.xmlns)}DOMParser.prototype.parseFromString=function(source,mimeType){if(!isValidMimeType(mimeType)){throw new TypeError('DOMParser.parseFromString: the provided mimeType "'+mimeType+'" is not valid.')}var defaultNSMap=this.assign(Object.create(null),this.xmlns);var entityMap=entities.XML_ENTITIES;var defaultNamespace=defaultNSMap[""]||null;if(hasDefaultHTMLNamespace(mimeType)){entityMap=entities.HTML_ENTITIES;defaultNamespace=NAMESPACE.HTML}else if(mimeType===MIME_TYPE.XML_SVG_IMAGE){defaultNamespace=NAMESPACE.SVG}defaultNSMap[""]=defaultNamespace;defaultNSMap.xml=defaultNSMap.xml||NAMESPACE.XML;var domBuilder=new this.domHandler({mimeType:mimeType,defaultNamespace:defaultNamespace,onError:this.onError});var locator=this.locator?{}:undefined;if(this.locator){domBuilder.setDocumentLocator(locator)}var sax=new XMLReader;sax.errorHandler=domBuilder;sax.domBuilder=domBuilder;var isXml=!conventions.isHTMLMimeType(mimeType);if(isXml&&typeof source!=="string"){sax.errorHandler.fatalError("source is not a string")}sax.parse(this.normalizeLineEndings(String(source)),defaultNSMap,entityMap);if(!domBuilder.doc.documentElement){sax.errorHandler.fatalError("missing root element")}return domBuilder.doc};function DOMHandler(options){var opt=options||{};this.mimeType=opt.mimeType||MIME_TYPE.XML_APPLICATION;this.defaultNamespace=opt.defaultNamespace||null;this.cdata=false;this.currentElement=undefined;this.doc=undefined;this.locator=undefined;this.onError=opt.onError}function position(locator,node){node.lineNumber=locator.lineNumber;node.columnNumber=locator.columnNumber}DOMHandler.prototype={startDocument:function(){var impl=new DOMImplementation;this.doc=isHTMLMimeType(this.mimeType)?impl.createHTMLDocument(false):impl.createDocument(this.defaultNamespace,"")},startElement:function(namespaceURI,localName,qName,attrs){var doc=this.doc;var el=doc.createElementNS(namespaceURI,qName||localName);var len=attrs.length;appendElement(this,el);this.currentElement=el;this.locator&&position(this.locator,el);for(var i=0;i=start+length||start){return new java.lang.String(chars,start,length)+""}return chars}}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(key){DOMHandler.prototype[key]=function(){return null}});function appendElement(handler,node){if(!handler.currentElement){handler.doc.appendChild(node)}else{handler.currentElement.appendChild(node)}}function onErrorStopParsing(level){if(level==="error")throw"onErrorStopParsing"}function onWarningStopParsing(){throw"onWarningStopParsing"}exports.__DOMHandler=DOMHandler;exports.DOMParser=DOMParser;exports.normalizeLineEndings=normalizeLineEndings;exports.onErrorStopParsing=onErrorStopParsing;exports.onWarningStopParsing=onWarningStopParsing},{"./conventions":34,"./dom":36,"./entities":37,"./errors":38,"./sax":41}],36:[function(require,module,exports){"use strict";var conventions=require("./conventions");var find=conventions.find;var hasDefaultHTMLNamespace=conventions.hasDefaultHTMLNamespace;var hasOwn=conventions.hasOwn;var isHTMLMimeType=conventions.isHTMLMimeType;var isHTMLRawTextElement=conventions.isHTMLRawTextElement;var isHTMLVoidElement=conventions.isHTMLVoidElement;var MIME_TYPE=conventions.MIME_TYPE;var NAMESPACE=conventions.NAMESPACE;var PDC=Symbol();var errors=require("./errors");var DOMException=errors.DOMException;var DOMExceptionName=errors.DOMExceptionName;var g=require("./grammar");function checkSymbol(symbol){if(symbol!==PDC){throw new TypeError("Illegal constructor")}}function notEmptyString(input){return input!==""}function splitOnASCIIWhitespace(input){return input?input.split(/[\t\n\f\r ]+/).filter(notEmptyString):[]}function orderedSetReducer(current,element){if(!hasOwn(current,element)){current[element]=true}return current}function toOrderedSet(input){if(!input)return[];var list=splitOnASCIIWhitespace(input);return Object.keys(list.reduce(orderedSetReducer,{}))}function arrayIncludes(list){return function(element){return list&&list.indexOf(element)!==-1}}function validateQualifiedName(qualifiedName){if(!g.QName_exact.test(qualifiedName)){throw new DOMException(DOMException.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+qualifiedName+'"')}}function validateAndExtract(namespace,qualifiedName){validateQualifiedName(qualifiedName);namespace=namespace||null;var prefix=null;var localName=qualifiedName;if(qualifiedName.indexOf(":")>=0){var splitResult=qualifiedName.split(":");prefix=splitResult[0];localName=splitResult[1]}if(prefix!==null&&namespace===null){throw new DOMException(DOMException.NAMESPACE_ERR,"prefix is non-null and namespace is null")}if(prefix==="xml"&&namespace!==conventions.NAMESPACE.XML){throw new DOMException(DOMException.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace')}if((prefix==="xmlns"||qualifiedName==="xmlns")&&namespace!==conventions.NAMESPACE.XMLNS){throw new DOMException(DOMException.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace')}if(namespace===conventions.NAMESPACE.XMLNS&&prefix!=="xmlns"&&qualifiedName!=="xmlns"){throw new DOMException(DOMException.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"')}return[namespace,prefix,localName]}function copy(src,dest){for(var p in src){if(hasOwn(src,p)){dest[p]=src[p]}}}function _extends(Class,Super){var pt=Class.prototype;if(!(pt instanceof Super)){function t(){}t.prototype=Super.prototype;t=new t;copy(pt,t);Class.prototype=pt=t}if(pt.constructor!=Class){if(typeof Class!="function"){console.error("unknown Class:"+Class)}pt.constructor=Class}}var NodeType={};var ELEMENT_NODE=NodeType.ELEMENT_NODE=1;var ATTRIBUTE_NODE=NodeType.ATTRIBUTE_NODE=2;var TEXT_NODE=NodeType.TEXT_NODE=3;var CDATA_SECTION_NODE=NodeType.CDATA_SECTION_NODE=4;var ENTITY_REFERENCE_NODE=NodeType.ENTITY_REFERENCE_NODE=5;var ENTITY_NODE=NodeType.ENTITY_NODE=6;var PROCESSING_INSTRUCTION_NODE=NodeType.PROCESSING_INSTRUCTION_NODE=7;var COMMENT_NODE=NodeType.COMMENT_NODE=8;var DOCUMENT_NODE=NodeType.DOCUMENT_NODE=9;var DOCUMENT_TYPE_NODE=NodeType.DOCUMENT_TYPE_NODE=10;var DOCUMENT_FRAGMENT_NODE=NodeType.DOCUMENT_FRAGMENT_NODE=11;var NOTATION_NODE=NodeType.NOTATION_NODE=12;var DocumentPosition=conventions.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function commonAncestor(a,b){if(b.length=0&&index=0){var lastIndex=list.length-1;while(i<=lastIndex){list[i]=list[++i]}list.length=lastIndex;if(el){var doc=el.ownerDocument;if(doc){_onRemoveAttribute(doc,el,attr)}attr.ownerElement=null}}}NamedNodeMap.prototype={length:0,item:NodeList.prototype.item,getNamedItem:function(localName){if(this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()){localName=localName.toLowerCase()}var i=0;while(idocGUID(node1.ownerDocument)?DocumentPosition.DOCUMENT_POSITION_FOLLOWING:DocumentPosition.DOCUMENT_POSITION_PRECEDING)}if(attr2&&node1===node2){return DocumentPosition.DOCUMENT_POSITION_CONTAINS+DocumentPosition.DOCUMENT_POSITION_PRECEDING}if(attr1&&node1===node2){return DocumentPosition.DOCUMENT_POSITION_CONTAINED_BY+DocumentPosition.DOCUMENT_POSITION_FOLLOWING}var chain1=[];var ancestor1=node1.parentNode;while(ancestor1){if(!attr2&&ancestor1===node2){return DocumentPosition.DOCUMENT_POSITION_CONTAINED_BY+DocumentPosition.DOCUMENT_POSITION_FOLLOWING}chain1.push(ancestor1);ancestor1=ancestor1.parentNode}chain1.reverse();var chain2=[];var ancestor2=node2.parentNode;while(ancestor2){if(!attr1&&ancestor2===node1){return DocumentPosition.DOCUMENT_POSITION_CONTAINS+DocumentPosition.DOCUMENT_POSITION_PRECEDING}chain2.push(ancestor2);ancestor2=ancestor2.parentNode}chain2.reverse();var ca=commonAncestor(chain1,chain2);for(var n in ca.childNodes){var child=ca.childNodes[n];if(child===node2)return DocumentPosition.DOCUMENT_POSITION_FOLLOWING;if(child===node1)return DocumentPosition.DOCUMENT_POSITION_PRECEDING;if(chain2.indexOf(child)>=0)return DocumentPosition.DOCUMENT_POSITION_FOLLOWING;if(chain1.indexOf(child)>=0)return DocumentPosition.DOCUMENT_POSITION_PRECEDING}return 0}};function _xmlEncoder(c){return c=="<"&&"<"||c==">"&&">"||c=="&"&&"&"||c=='"'&&"""||"&#"+c.charCodeAt()+";"}copy(NodeType,Node);copy(NodeType,Node.prototype);copy(DocumentPosition,Node);copy(DocumentPosition,Node.prototype);function _visitNode(node,callback){if(callback(node)){return true}if(node=node.firstChild){do{if(_visitNode(node,callback)){return true}}while(node=node.nextSibling)}}function Document(symbol,options){checkSymbol(symbol);var opt=options||{};this.ownerDocument=this;this.contentType=opt.contentType||MIME_TYPE.XML_APPLICATION;this.type=isHTMLMimeType(this.contentType)?"html":"xml"}function _onAddAttribute(doc,el,newAttr){doc&&doc._inc++;var ns=newAttr.namespaceURI;if(ns===NAMESPACE.XMLNS){el._nsMap[newAttr.prefix?newAttr.localName:""]=newAttr.value}}function _onRemoveAttribute(doc,el,newAttr,remove){doc&&doc._inc++;var ns=newAttr.namespaceURI;if(ns===NAMESPACE.XMLNS){delete el._nsMap[newAttr.prefix?newAttr.localName:""]}}function _onUpdateChild(doc,parent,newChild){if(doc&&doc._inc){doc._inc++;var childNodes=parent.childNodes;if(newChild&&!newChild.nextSibling){childNodes[childNodes.length++]=newChild}else{var child=parent.firstChild;var i=0;while(child){childNodes[i++]=child;child=child.nextSibling}childNodes.length=i;delete childNodes[childNodes.length]}}}function _removeChild(parentNode,child){if(parentNode!==child.parentNode){throw new DOMException(DOMException.NOT_FOUND_ERR,"child's parent is not parent")}var oldPreviousSibling=child.previousSibling;var oldNextSibling=child.nextSibling;if(oldPreviousSibling){oldPreviousSibling.nextSibling=oldNextSibling}else{parentNode.firstChild=oldNextSibling}if(oldNextSibling){oldNextSibling.previousSibling=oldPreviousSibling}else{parentNode.lastChild=oldPreviousSibling}_onUpdateChild(parentNode.ownerDocument,parentNode);child.parentNode=null;child.previousSibling=null;child.nextSibling=null;return child}function hasValidParentNodeType(node){return node&&(node.nodeType===Node.DOCUMENT_NODE||node.nodeType===Node.DOCUMENT_FRAGMENT_NODE||node.nodeType===Node.ELEMENT_NODE)}function hasInsertableNodeType(node){return node&&(node.nodeType===Node.CDATA_SECTION_NODE||node.nodeType===Node.COMMENT_NODE||node.nodeType===Node.DOCUMENT_FRAGMENT_NODE||node.nodeType===Node.DOCUMENT_TYPE_NODE||node.nodeType===Node.ELEMENT_NODE||node.nodeType===Node.PROCESSING_INSTRUCTION_NODE||node.nodeType===Node.TEXT_NODE)}function isDocTypeNode(node){return node&&node.nodeType===Node.DOCUMENT_TYPE_NODE}function isElementNode(node){return node&&node.nodeType===Node.ELEMENT_NODE}function isTextNode(node){return node&&node.nodeType===Node.TEXT_NODE}function isElementInsertionPossible(doc,child){var parentChildNodes=doc.childNodes||[];if(find(parentChildNodes,isElementNode)||isDocTypeNode(child)){return false}var docTypeNode=find(parentChildNodes,isDocTypeNode);return!(child&&docTypeNode&&parentChildNodes.indexOf(docTypeNode)>parentChildNodes.indexOf(child))}function isElementReplacementPossible(doc,child){var parentChildNodes=doc.childNodes||[];function hasElementChildThatIsNotChild(node){return isElementNode(node)&&node!==child}if(find(parentChildNodes,hasElementChildThatIsNotChild)){return false}var docTypeNode=find(parentChildNodes,isDocTypeNode);return!(child&&docTypeNode&&parentChildNodes.indexOf(docTypeNode)>parentChildNodes.indexOf(child))}function assertPreInsertionValidity1to5(parent,node,child){if(!hasValidParentNodeType(parent)){throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+parent.nodeType)}if(child&&child.parentNode!==parent){throw new DOMException(DOMException.NOT_FOUND_ERR,"child not in parent")}if(!hasInsertableNodeType(node)||isDocTypeNode(node)&&parent.nodeType!==Node.DOCUMENT_NODE){throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,"Unexpected node type "+node.nodeType+" for parent node type "+parent.nodeType)}}function assertPreInsertionValidityInDocument(parent,node,child){var parentChildNodes=parent.childNodes||[];var nodeChildNodes=node.childNodes||[];if(node.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var nodeChildElements=nodeChildNodes.filter(isElementNode);if(nodeChildElements.length>1||find(nodeChildNodes,isTextNode)){throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment")}if(nodeChildElements.length===1&&!isElementInsertionPossible(parent,child)){throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}}if(isElementNode(node)){if(!isElementInsertionPossible(parent,child)){throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype")}}if(isDocTypeNode(node)){if(find(parentChildNodes,isDocTypeNode)){throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed")}var parentElementChild=find(parentChildNodes,isElementNode);if(child&&parentChildNodes.indexOf(parentElementChild)1||find(nodeChildNodes,isTextNode)){throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment")}if(nodeChildElements.length===1&&!isElementReplacementPossible(parent,child)){throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}}if(isElementNode(node)){if(!isElementReplacementPossible(parent,child)){throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype")}}if(isDocTypeNode(node)){function hasDoctypeChildThatIsNotChild(node){return isDocTypeNode(node)&&node!==child}if(find(parentChildNodes,hasDoctypeChildThatIsNotChild)){throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed")}var parentElementChild=find(parentChildNodes,isElementNode);if(child&&parentChildNodes.indexOf(parentElementChild)0){_visitNode(base,function(node){if(node!==base&&node.nodeType===ELEMENT_NODE){var nodeClassNames=node.getAttribute("class");if(nodeClassNames){var matches=classNames===nodeClassNames;if(!matches){var nodeClassNamesSet=toOrderedSet(nodeClassNames);matches=classNamesSet.every(arrayIncludes(nodeClassNamesSet))}if(matches){ls.push(node)}}}})}return ls})},getElementsByTagName:function(qualifiedName){var isHTMLDocument=(this.nodeType===DOCUMENT_NODE?this:this.ownerDocument).type==="html";var lowerQualifiedName=qualifiedName.toLowerCase();return new LiveNodeList(this,function(base){var ls=[];_visitNode(base,function(node){if(node===base||node.nodeType!==ELEMENT_NODE){return}if(qualifiedName==="*"){ls.push(node)}else{var nodeQualifiedName=node.getQualifiedName();var matchingQName=isHTMLDocument&&node.namespaceURI===NAMESPACE.HTML?lowerQualifiedName:qualifiedName;if(nodeQualifiedName===matchingQName){ls.push(node)}}});return ls})},getElementsByTagNameNS:function(namespaceURI,localName){return new LiveNodeList(this,function(base){var ls=[];_visitNode(base,function(node){if(node!==base&&node.nodeType===ELEMENT_NODE&&(namespaceURI==="*"||node.namespaceURI===namespaceURI)&&(localName==="*"||node.localName==localName)){ls.push(node)}});return ls})}};Document.prototype.getElementsByClassName=Element.prototype.getElementsByClassName;Document.prototype.getElementsByTagName=Element.prototype.getElementsByTagName;Document.prototype.getElementsByTagNameNS=Element.prototype.getElementsByTagNameNS;_extends(Element,Node);function Attr(symbol){checkSymbol(symbol);this.namespaceURI=null;this.prefix=null;this.ownerElement=null}Attr.prototype.nodeType=ATTRIBUTE_NODE;_extends(Attr,Node);function CharacterData(symbol){checkSymbol(symbol)}CharacterData.prototype={data:"",substringData:function(offset,count){return this.data.substring(offset,offset+count)},appendData:function(text){text=this.data+text;this.nodeValue=this.data=text;this.length=text.length},insertData:function(offset,text){this.replaceData(offset,0,text)},deleteData:function(offset,count){this.replaceData(offset,count,"")},replaceData:function(offset,count,text){var start=this.data.substring(0,offset);var end=this.data.substring(offset+count);text=start+text+end;this.nodeValue=this.data=text;this.length=text.length}};_extends(CharacterData,Node);function Text(symbol){checkSymbol(symbol)}Text.prototype={nodeName:"#text",nodeType:TEXT_NODE,splitText:function(offset){var text=this.data;var newText=text.substring(offset);text=text.substring(0,offset);this.data=this.nodeValue=text;this.length=text.length;var newNode=this.ownerDocument.createTextNode(newText);if(this.parentNode){this.parentNode.insertBefore(newNode,this.nextSibling)}return newNode}};_extends(Text,CharacterData);function Comment(symbol){checkSymbol(symbol)}Comment.prototype={nodeName:"#comment",nodeType:COMMENT_NODE};_extends(Comment,CharacterData);function CDATASection(symbol){checkSymbol(symbol)}CDATASection.prototype={nodeName:"#cdata-section",nodeType:CDATA_SECTION_NODE};_extends(CDATASection,Text);function DocumentType(symbol){checkSymbol(symbol)}DocumentType.prototype.nodeType=DOCUMENT_TYPE_NODE;_extends(DocumentType,Node);function Notation(symbol){checkSymbol(symbol)}Notation.prototype.nodeType=NOTATION_NODE;_extends(Notation,Node);function Entity(symbol){checkSymbol(symbol)}Entity.prototype.nodeType=ENTITY_NODE;_extends(Entity,Node);function EntityReference(symbol){checkSymbol(symbol)}EntityReference.prototype.nodeType=ENTITY_REFERENCE_NODE;_extends(EntityReference,Node);function DocumentFragment(symbol){checkSymbol(symbol)}DocumentFragment.prototype.nodeName="#document-fragment";DocumentFragment.prototype.nodeType=DOCUMENT_FRAGMENT_NODE;_extends(DocumentFragment,Node);function ProcessingInstruction(symbol){checkSymbol(symbol)}ProcessingInstruction.prototype.nodeType=PROCESSING_INSTRUCTION_NODE;_extends(ProcessingInstruction,CharacterData);function XMLSerializer(){}XMLSerializer.prototype.serializeToString=function(node,nodeFilter){return nodeSerializeToString.call(node,nodeFilter)};Node.prototype.toString=nodeSerializeToString;function nodeSerializeToString(nodeFilter){var buf=[];var refNode=this.nodeType===DOCUMENT_NODE&&this.documentElement||this;var prefix=refNode.prefix;var uri=refNode.namespaceURI;if(uri&&prefix==null){var prefix=refNode.lookupPrefix(uri);if(prefix==null){var visibleNamespaces=[{namespace:uri,prefix:null}]}}serializeToString(this,buf,nodeFilter,visibleNamespaces);return buf.join("")}function needNamespaceDefine(node,isHTML,visibleNamespaces){var prefix=node.prefix||"";var uri=node.namespaceURI;if(!uri){return false}if(prefix==="xml"&&uri===NAMESPACE.XML||uri===NAMESPACE.XMLNS){return false}var i=visibleNamespaces.length;while(i--){var ns=visibleNamespaces[i];if(ns.prefix===prefix){return ns.namespace!==uri}}return true}function addSerializedAttribute(buf,qualifiedName,value){buf.push(" ",qualifiedName,'="',value.replace(/[<>&"\t\n\r]/g,_xmlEncoder),'"')}function serializeToString(node,buf,nodeFilter,visibleNamespaces){if(!visibleNamespaces){visibleNamespaces=[]}var doc=node.nodeType===DOCUMENT_NODE?node:node.ownerDocument;var isHTML=doc.type==="html";if(nodeFilter){node=nodeFilter(node);if(node){if(typeof node=="string"){buf.push(node);return}}else{return}}switch(node.nodeType){case ELEMENT_NODE:var attrs=node.attributes;var len=attrs.length;var child=node.firstChild;var nodeName=node.tagName;var prefixedNodeName=nodeName;if(!isHTML&&!node.prefix&&node.namespaceURI){var defaultNS;for(var ai=0;ai=0;nsi--){var namespace=visibleNamespaces[nsi];if(namespace.prefix===""&&namespace.namespace===node.namespaceURI){defaultNS=namespace.namespace;break}}}if(defaultNS!==node.namespaceURI){for(var nsi=visibleNamespaces.length-1;nsi>=0;nsi--){var namespace=visibleNamespaces[nsi];if(namespace.namespace===node.namespaceURI){if(namespace.prefix){prefixedNodeName=namespace.prefix+":"+nodeName}break}}}}buf.push("<",prefixedNodeName);for(var i=0;i")}else{buf.push(">");if(isHTML&&isHTMLRawTextElement(nodeName)){while(child){if(child.data){buf.push(child.data)}else{serializeToString(child,buf,nodeFilter,visibleNamespaces.slice())}child=child.nextSibling}}else{while(child){serializeToString(child,buf,nodeFilter,visibleNamespaces.slice());child=child.nextSibling}}buf.push("")}return;case DOCUMENT_NODE:case DOCUMENT_FRAGMENT_NODE:var child=node.firstChild;while(child){serializeToString(child,buf,nodeFilter,visibleNamespaces.slice());child=child.nextSibling}return;case ATTRIBUTE_NODE:return addSerializedAttribute(buf,node.name,node.value);case TEXT_NODE:return buf.push(node.data.replace(/[<&>]/g,_xmlEncoder));case CDATA_SECTION_NODE:return buf.push(g.CDATA_START,node.data,g.CDATA_END);case COMMENT_NODE:return buf.push(g.COMMENT_START,node.data,g.COMMENT_END);case DOCUMENT_TYPE_NODE:var pubid=node.publicId;var sysid=node.systemId;buf.push(g.DOCTYPE_DECL_START," ",node.name);if(pubid){buf.push(" ",g.PUBLIC," ",pubid);if(sysid&&sysid!=="."){buf.push(" ",sysid)}}else if(sysid&&sysid!=="."){buf.push(" ",g.SYSTEM," ",sysid)}if(node.internalSubset){buf.push(" [",node.internalSubset,"]")}buf.push(">");return;case PROCESSING_INSTRUCTION_NODE:return buf.push("");case ENTITY_REFERENCE_NODE:return buf.push("&",node.nodeName,";");default:buf.push("??",node.nodeName)}}function importNode(doc,node,deep){var node2;switch(node.nodeType){case ELEMENT_NODE:node2=node.cloneNode(false);node2.ownerDocument=doc;case DOCUMENT_FRAGMENT_NODE:break;case ATTRIBUTE_NODE:deep=true;break}if(!node2){node2=node.cloneNode(false)}node2.ownerDocument=doc;node2.parentNode=null;if(deep){var child=node.firstChild;while(child){node2.appendChild(importNode(doc,child,deep));child=child.nextSibling}}return node2}function cloneNode(doc,node,deep){var node2=new node.constructor(PDC);for(var n in node){if(hasOwn(node,n)){var v=node[n];if(typeof v!="object"){if(v!=node2[n]){node2[n]=v}}}}if(node.childNodes){node2.childNodes=new NodeList}node2.ownerDocument=doc;switch(node2.nodeType){case ELEMENT_NODE:var attrs=node.attributes;var attrs2=node2.attributes=new NamedNodeMap;var len=attrs.length;attrs2._ownerElement=node2;for(var i=0;i",lt:"<",quot:'"'});exports.HTML_ENTITIES=freeze({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"});exports.entityMap=exports.HTML_ENTITIES},{"./conventions":34}],38:[function(require,module,exports){"use strict";var conventions=require("./conventions");function extendError(constructor,writableName){constructor.prototype=Object.create(Error.prototype,{constructor:{value:constructor},name:{value:constructor.name,enumerable:true,writable:writableName}})}var DOMExceptionName=conventions.freeze({Error:"Error",IndexSizeError:"IndexSizeError",DomstringSizeError:"DomstringSizeError",HierarchyRequestError:"HierarchyRequestError",WrongDocumentError:"WrongDocumentError",InvalidCharacterError:"InvalidCharacterError",NoDataAllowedError:"NoDataAllowedError",NoModificationAllowedError:"NoModificationAllowedError",NotFoundError:"NotFoundError",NotSupportedError:"NotSupportedError",InUseAttributeError:"InUseAttributeError",InvalidStateError:"InvalidStateError",SyntaxError:"SyntaxError",InvalidModificationError:"InvalidModificationError",NamespaceError:"NamespaceError",InvalidAccessError:"InvalidAccessError",ValidationError:"ValidationError",TypeMismatchError:"TypeMismatchError",SecurityError:"SecurityError",NetworkError:"NetworkError",AbortError:"AbortError",URLMismatchError:"URLMismatchError",QuotaExceededError:"QuotaExceededError",TimeoutError:"TimeoutError",InvalidNodeTypeError:"InvalidNodeTypeError",DataCloneError:"DataCloneError",EncodingError:"EncodingError",NotReadableError:"NotReadableError",UnknownError:"UnknownError",ConstraintError:"ConstraintError",DataError:"DataError",TransactionInactiveError:"TransactionInactiveError",ReadOnlyError:"ReadOnlyError",VersionError:"VersionError",OperationError:"OperationError",NotAllowedError:"NotAllowedError",OptOutError:"OptOutError"});var DOMExceptionNames=Object.keys(DOMExceptionName);function isValidDomExceptionCode(value){return typeof value==="number"&&value>=1&&value<=25}function endsWithError(value){return typeof value==="string"&&value.substring(value.length-DOMExceptionName.Error.length)===DOMExceptionName.Error}function DOMException(messageOrCode,nameOrMessage){if(isValidDomExceptionCode(messageOrCode)){this.name=DOMExceptionNames[messageOrCode];this.message=nameOrMessage||""}else{this.message=messageOrCode;this.name=endsWithError(nameOrMessage)?nameOrMessage:DOMExceptionName.Error}if(Error.captureStackTrace)Error.captureStackTrace(this,DOMException)}extendError(DOMException,true);Object.defineProperties(DOMException.prototype,{code:{enumerable:true,get:function(){var code=DOMExceptionNames.indexOf(this.name);if(isValidDomExceptionCode(code))return code;return 0}}});var ExceptionCode={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};var entries=Object.entries(ExceptionCode);for(var i=0;i/);var PubidChar=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/;var PubidLiteral=regg('"',PubidChar,'*"',"|","'",chars_without(PubidChar,"'"),"*'");var COMMENT_START="\x3c!--";var COMMENT_END="--\x3e";var Comment=reg(COMMENT_START,regg(chars_without(Char,"-"),"|",reg("-",chars_without(Char,"-"))),"*",COMMENT_END);var PCDATA="#PCDATA";var Mixed=regg(reg(/\(/,S_OPT,PCDATA,regg(S_OPT,/\|/,S_OPT,QName),"*",S_OPT,/\)\*/),"|",reg(/\(/,S_OPT,PCDATA,S_OPT,/\)/));var _children_quantity=/[?*+]?/;var children=reg(/\([^>]+\)/,_children_quantity);var contentspec=regg("EMPTY","|","ANY","|",Mixed,"|",children);var ELEMENTDECL_START="");var NotationType=reg("NOTATION",S,/\(/,S_OPT,Name,regg(S_OPT,/\|/,S_OPT,Name),"*",S_OPT,/\)/);var Enumeration=reg(/\(/,S_OPT,Nmtoken,regg(S_OPT,/\|/,S_OPT,Nmtoken),"*",S_OPT,/\)/);var EnumeratedType=regg(NotationType,"|",Enumeration);var AttType=regg(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",EnumeratedType);var DefaultDecl=regg(/#REQUIRED|#IMPLIED/,"|",regg(regg("#FIXED",S),"?",AttValue));var AttDef=regg(S,Name,S,AttType,S,DefaultDecl);var ATTLIST_DECL_START="");var ABOUT_LEGACY_COMPAT="about:legacy-compat";var ABOUT_LEGACY_COMPAT_SystemLiteral=regg('"'+ABOUT_LEGACY_COMPAT+'"',"|","'"+ABOUT_LEGACY_COMPAT+"'");var SYSTEM="SYSTEM";var PUBLIC="PUBLIC";var ExternalID=regg(regg(SYSTEM,S,SystemLiteral),"|",regg(PUBLIC,S,PubidLiteral,S,SystemLiteral));var ExternalID_match=reg("^",regg(regg(SYSTEM,S,"(?",SystemLiteral,")"),"|",regg(PUBLIC,S,"(?",PubidLiteral,")",S,"(?",SystemLiteral,")")));var NDataDecl=regg(S,"NDATA",S,Name);var EntityDef=regg(EntityValue,"|",regg(ExternalID,NDataDecl,"?"));var ENTITY_DECL_START="");var PEDef=regg(EntityValue,"|",ExternalID);var PEDecl=reg(ENTITY_DECL_START,S,"%",S,Name,S,PEDef,S_OPT,">");var EntityDecl=regg(GEDecl,"|",PEDecl);var PublicID=reg(PUBLIC,S,PubidLiteral);var NotationDecl=reg("");var Eq=reg(S_OPT,"=",S_OPT);var VersionNum=/1[.]\d+/;var VersionInfo=reg(S,"version",Eq,regg("'",VersionNum,"'","|",'"',VersionNum,'"'));var EncName=/[A-Za-z][-A-Za-z0-9._]*/;var EncodingDecl=regg(S,"encoding",Eq,regg('"',EncName,'"',"|","'",EncName,"'"));var SDDecl=regg(S,"standalone",Eq,regg("'",regg("yes","|","no"),"'","|",'"',regg("yes","|","no"),'"'));var XMLDecl=reg(/^<\?xml/,VersionInfo,EncodingDecl,"?",SDDecl,"?",S_OPT,/\?>/);var DOCTYPE_DECL_START="";var CDStart=//;var CData=reg(Char,"*?",CDEnd);var CDSect=reg(CDStart,CData);exports.chars=chars;exports.chars_without=chars_without;exports.detectUnicodeSupport=detectUnicodeSupport;exports.reg=reg;exports.regg=regg;exports.ABOUT_LEGACY_COMPAT=ABOUT_LEGACY_COMPAT;exports.ABOUT_LEGACY_COMPAT_SystemLiteral=ABOUT_LEGACY_COMPAT_SystemLiteral;exports.AttlistDecl=AttlistDecl;exports.CDATA_START=CDATA_START;exports.CDATA_END=CDATA_END;exports.CDSect=CDSect;exports.Char=Char;exports.Comment=Comment;exports.COMMENT_START=COMMENT_START;exports.COMMENT_END=COMMENT_END;exports.DOCTYPE_DECL_START=DOCTYPE_DECL_START;exports.elementdecl=elementdecl;exports.EntityDecl=EntityDecl;exports.EntityValue=EntityValue;exports.ExternalID=ExternalID;exports.ExternalID_match=ExternalID_match;exports.Name=Name;exports.NotationDecl=NotationDecl;exports.Reference=Reference;exports.PEReference=PEReference;exports.PI=PI;exports.PUBLIC=PUBLIC;exports.PubidLiteral=PubidLiteral;exports.QName=QName;exports.QName_exact=QName_exact;exports.QName_group=QName_group;exports.S=S;exports.SChar_s=SChar_s;exports.S_OPT=S_OPT;exports.SYSTEM=SYSTEM;exports.SystemLiteral=SystemLiteral;exports.UNICODE_REPLACEMENT_CHARACTER=UNICODE_REPLACEMENT_CHARACTER;exports.UNICODE_SUPPORT=UNICODE_SUPPORT;exports.XMLDecl=XMLDecl},{}],40:[function(require,module,exports){"use strict";var conventions=require("./conventions");exports.assign=conventions.assign;exports.hasDefaultHTMLNamespace=conventions.hasDefaultHTMLNamespace;exports.isHTMLMimeType=conventions.isHTMLMimeType;exports.isValidMimeType=conventions.isValidMimeType;exports.MIME_TYPE=conventions.MIME_TYPE;exports.NAMESPACE=conventions.NAMESPACE;var errors=require("./errors");exports.DOMException=errors.DOMException;exports.DOMExceptionName=errors.DOMExceptionName;exports.ExceptionCode=errors.ExceptionCode;exports.ParseError=errors.ParseError;var dom=require("./dom");exports.Attr=dom.Attr;exports.CDATASection=dom.CDATASection;exports.CharacterData=dom.CharacterData;exports.Comment=dom.Comment;exports.Document=dom.Document;exports.DocumentFragment=dom.DocumentFragment;exports.DocumentType=dom.DocumentType;exports.DOMImplementation=dom.DOMImplementation;exports.Element=dom.Element;exports.Entity=dom.Entity;exports.EntityReference=dom.EntityReference;exports.LiveNodeList=dom.LiveNodeList;exports.NamedNodeMap=dom.NamedNodeMap;exports.Node=dom.Node;exports.NodeList=dom.NodeList;exports.Notation=dom.Notation;exports.ProcessingInstruction=dom.ProcessingInstruction;exports.Text=dom.Text;exports.XMLSerializer=dom.XMLSerializer;var domParser=require("./dom-parser");exports.DOMParser=domParser.DOMParser;exports.normalizeLineEndings=domParser.normalizeLineEndings;exports.onErrorStopParsing=domParser.onErrorStopParsing;exports.onWarningStopParsing=domParser.onWarningStopParsing},{"./conventions":34,"./dom":36,"./dom-parser":35,"./errors":38}],41:[function(require,module,exports){"use strict";var conventions=require("./conventions");var g=require("./grammar");var errors=require("./errors");var isHTMLEscapableRawTextElement=conventions.isHTMLEscapableRawTextElement;var isHTMLMimeType=conventions.isHTMLMimeType;var isHTMLRawTextElement=conventions.isHTMLRawTextElement;var hasOwn=conventions.hasOwn;var NAMESPACE=conventions.NAMESPACE;var ParseError=errors.ParseError;var DOMException=errors.DOMException;var S_TAG=0;var S_ATTR=1;var S_ATTR_SPACE=2;var S_EQ=3;var S_ATTR_NOQUOT_VALUE=4;var S_ATTR_END=5;var S_TAG_SPACE=6;var S_TAG_CLOSE=7;function XMLReader(){}XMLReader.prototype={parse:function(source,defaultNSMap,entityMap){var domBuilder=this.domBuilder;domBuilder.startDocument();_copy(defaultNSMap,defaultNSMap=Object.create(null));parse(source,defaultNSMap,entityMap,domBuilder,this.errorHandler);domBuilder.endDocument()}};var ENTITY_REG=/&#?\w+;?/g;function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){var isHTML=isHTMLMimeType(domBuilder.mimeType);if(source.indexOf(g.UNICODE_REPLACEMENT_CHARACTER)>=0){errorHandler.warning("Unicode replacement character detected, source encoding issues?")}function fixedFromCharCode(code){if(code>65535){code-=65536;var surrogate1=55296+(code>>10),surrogate2=56320+(code&1023);return String.fromCharCode(surrogate1,surrogate2)}else{return String.fromCharCode(code)}}function entityReplacer(a){var complete=a[a.length-1]===";"?a:a+";";if(!isHTML&&complete!==a){errorHandler.error("EntityRef: expecting ;");return a}var match=g.Reference.exec(complete);if(!match||match[0].length!==complete.length){errorHandler.error("entity not matching Reference production: "+a);return a}var k=complete.slice(1,-1);if(hasOwn(entityMap,k)){return entityMap[k]}else if(k.charAt(0)==="#"){return fixedFromCharCode(parseInt(k.substring(1).replace("x","0x")))}else{errorHandler.error("entity not found:"+a);return a}}function appendText(end){if(end>start){var xt=source.substring(start,end).replace(ENTITY_REG,entityReplacer);locator&&position(start);domBuilder.characters(xt,0,end-start);start=end}}var lineStart=0;var lineEnd=0;var linePattern=/\r\n?|\n|$/g;var locator=domBuilder.locator;function position(p,m){while(p>=lineEnd&&(m=linePattern.exec(source))){lineStart=lineEnd;lineEnd=m.index+m[0].length;locator.lineNumber++}locator.columnNumber=p-lineStart+1}var parseStack=[{currentNSMap:defaultNSMapCopy}];var unclosedTags=[];var start=0;while(true){try{var tagStart=source.indexOf("<",start);if(tagStart<0){if(!isHTML&&unclosedTags.length>0){return errorHandler.fatalError("unclosed xml tag(s): "+unclosedTags.join(", "))}if(!source.substring(start).match(/^\s*$/)){var doc=domBuilder.doc;var text=doc.createTextNode(source.substring(start));if(doc.documentElement){return errorHandler.error("Extra content at the end of the document")}doc.appendChild(text);domBuilder.currentElement=text}return}if(tagStart>start){var fromSource=source.substring(start,tagStart);if(!isHTML&&unclosedTags.length===0){fromSource=fromSource.replace(new RegExp(g.S_OPT.source,"g"),"");fromSource&&errorHandler.error("Unexpected content outside root element: '"+fromSource+"'")}appendText(tagStart)}switch(source.charAt(tagStart+1)){case"/":var end=source.indexOf(">",tagStart+2);var tagNameRaw=source.substring(tagStart+2,end>0?end:undefined);if(!tagNameRaw){return errorHandler.fatalError("end tag name missing")}var tagNameMatch=end>0&&g.reg("^",g.QName_group,g.S_OPT,"$").exec(tagNameRaw);if(!tagNameMatch){return errorHandler.fatalError('end tag name contains invalid characters: "'+tagNameRaw+'"')}if(!domBuilder.currentElement&&!domBuilder.doc.documentElement){return}var currentTagName=unclosedTags[unclosedTags.length-1]||domBuilder.currentElement.tagName||domBuilder.doc.documentElement.tagName||"";if(currentTagName!==tagNameMatch[1]){var tagNameLower=tagNameMatch[1].toLowerCase();if(!isHTML||currentTagName.toLowerCase()!==tagNameLower){return errorHandler.fatalError('Opening and ending tag mismatch: "'+currentTagName+'" != "'+tagNameRaw+'"')}}var config=parseStack.pop();unclosedTags.pop();var localNSMap=config.localNSMap;domBuilder.endElement(config.uri,config.localName,currentTagName);if(localNSMap){for(var prefix in localNSMap){if(hasOwn(localNSMap,prefix)){domBuilder.endPrefixMapping(prefix)}}}end++;break;case"?":locator&&position(tagStart);end=parseProcessingInstruction(source,tagStart,domBuilder,errorHandler);break;case"!":locator&&position(tagStart);end=parseDoctypeCommentOrCData(source,tagStart,domBuilder,errorHandler,isHTML);break;default:locator&&position(tagStart);var el=new ElementAttributes;var currentNSMap=parseStack[parseStack.length-1].currentNSMap;var end=parseElementStartPart(source,tagStart,el,currentNSMap,entityReplacer,errorHandler,isHTML);var len=el.length;if(!el.closed){if(isHTML&&conventions.isHTMLVoidElement(el.tagName)){el.closed=true}else{unclosedTags.push(el.tagName)}}if(locator&&len){var locator2=copyLocator(locator,{});for(var i=0;istart){start=end}else{appendText(Math.max(tagStart,start)+1)}}}function copyLocator(f,t){t.lineNumber=f.lineNumber;t.columnNumber=f.columnNumber;return t}function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,errorHandler,isHTML){function addAttribute(qname,value,startIndex){if(hasOwn(el.attributeNames,qname)){return errorHandler.fatalError("Attribute "+qname+" redefined")}if(!isHTML&&value.indexOf("<")>=0){return errorHandler.fatalError("Unescaped '<' not allowed in attributes values")}el.addValue(qname,value.replace(/[\t\n\r]/g," ").replace(ENTITY_REG,entityReplacer),startIndex)}var attrName;var value;var p=++start;var s=S_TAG;while(true){var c=source.charAt(p);switch(c){case"=":if(s===S_ATTR){attrName=source.slice(start,p);s=S_EQ}else if(s===S_ATTR_SPACE){s=S_EQ}else{throw new Error("attribute equal must after attrName")}break;case"'":case'"':if(s===S_EQ||s===S_ATTR){if(s===S_ATTR){errorHandler.warning('attribute value must after "="');attrName=source.slice(start,p)}start=p+1;p=source.indexOf(c,start);if(p>0){value=source.slice(start,p);addAttribute(attrName,value,start-1);s=S_ATTR_END}else{throw new Error("attribute value no end '"+c+"' match")}}else if(s==S_ATTR_NOQUOT_VALUE){value=source.slice(start,p);addAttribute(attrName,value,start);errorHandler.warning('attribute "'+attrName+'" missed start quot('+c+")!!");start=p+1;s=S_ATTR_END}else{throw new Error('attribute value must after "="')}break;case"/":switch(s){case S_TAG:el.setTagName(source.slice(start,p));case S_ATTR_END:case S_TAG_SPACE:case S_TAG_CLOSE:s=S_TAG_CLOSE;el.closed=true;case S_ATTR_NOQUOT_VALUE:case S_ATTR:break;case S_ATTR_SPACE:el.closed=true;break;default:throw new Error("attribute invalid close char('/')")}break;case"":errorHandler.error("unexpected end of input");if(s==S_TAG){el.setTagName(source.slice(start,p))}return p;case">":switch(s){case S_TAG:el.setTagName(source.slice(start,p));case S_ATTR_END:case S_TAG_SPACE:case S_TAG_CLOSE:break;case S_ATTR_NOQUOT_VALUE:case S_ATTR:value=source.slice(start,p);if(value.slice(-1)==="/"){el.closed=true;value=value.slice(0,-1)}case S_ATTR_SPACE:if(s===S_ATTR_SPACE){value=attrName}if(s==S_ATTR_NOQUOT_VALUE){errorHandler.warning('attribute "'+value+'" missed quot(")!');addAttribute(attrName,value,start)}else{if(!isHTML){errorHandler.warning('attribute "'+value+'" missed value!! "'+value+'" instead!!')}addAttribute(value,value,start)}break;case S_EQ:if(!isHTML){return errorHandler.fatalError("AttValue: ' or \" expected")}}return p;case"€":c=" ";default:if(c<=" "){switch(s){case S_TAG:el.setTagName(source.slice(start,p));s=S_TAG_SPACE;break;case S_ATTR:attrName=source.slice(start,p);s=S_ATTR_SPACE;break;case S_ATTR_NOQUOT_VALUE:var value=source.slice(start,p);errorHandler.warning('attribute "'+value+'" missed quot(")!!');addAttribute(attrName,value,start);case S_ATTR_END:s=S_TAG_SPACE;break}}else{switch(s){case S_ATTR_SPACE:if(!isHTML){errorHandler.warning('attribute "'+attrName+'" missed value!! "'+attrName+'" instead2!!')}addAttribute(attrName,attrName,start);start=p;s=S_ATTR;break;case S_ATTR_END:errorHandler.warning('attribute space is required"'+attrName+'"!!');case S_TAG_SPACE:s=S_ATTR;start=p;break;case S_EQ:s=S_ATTR_NOQUOT_VALUE;start=p;break;case S_TAG_CLOSE:throw new Error("elements closed character '/' and '>' must be connected to")}}}p++}}function appendElement(el,domBuilder,currentNSMap){var tagName=el.tagName;var localNSMap=null;var i=el.length;while(i--){var a=el[i];var qName=a.qName;var value=a.value;var nsp=qName.indexOf(":");if(nsp>0){var prefix=a.prefix=qName.slice(0,nsp);var localName=qName.slice(nsp+1);var nsPrefix=prefix==="xmlns"&&localName}else{localName=qName;prefix=null;nsPrefix=qName==="xmlns"&&""}a.localName=localName;if(nsPrefix!==false){if(localNSMap==null){localNSMap=Object.create(null);_copy(currentNSMap,currentNSMap=Object.create(null))}currentNSMap[nsPrefix]=localNSMap[nsPrefix]=value;a.uri=NAMESPACE.XMLNS;domBuilder.startPrefixMapping(nsPrefix,value)}}var i=el.length;while(i--){a=el[i];if(a.prefix){if(a.prefix==="xml"){a.uri=NAMESPACE.XML}if(a.prefix!=="xmlns"){a.uri=currentNSMap[a.prefix]}}}var nsp=tagName.indexOf(":");if(nsp>0){prefix=el.prefix=tagName.slice(0,nsp);localName=el.localName=tagName.slice(nsp+1)}else{prefix=null;localName=el.localName=tagName}var ns=el.uri=currentNSMap[prefix||""];domBuilder.startElement(ns,localName,tagName,el);if(el.closed){domBuilder.endElement(ns,localName,tagName);if(localNSMap){for(prefix in localNSMap){if(hasOwn(localNSMap,prefix)){domBuilder.endPrefixMapping(prefix)}}}}else{el.currentNSMap=currentNSMap;el.localNSMap=localNSMap;return true}}function parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){var isEscapableRaw=isHTMLEscapableRawTextElement(tagName);if(isEscapableRaw||isHTMLRawTextElement(tagName)){var elEndStart=source.indexOf("",elStartEnd);var text=source.substring(elStartEnd+1,elEndStart);if(isEscapableRaw){text=text.replace(ENTITY_REG,entityReplacer)}domBuilder.characters(text,0,text.length);return elEndStart}return elStartEnd+1}function _copy(source,target){for(var n in source){if(hasOwn(source,n)){target[n]=source[n]}}}function parseUtils(source,start){var index=start;function char(n){n=n||0;return source.charAt(index+n)}function skip(n){n=n||1;index+=n}function skipBlanks(){var blanks=0;while(index"){return errorHandler.fatalError("doctype not terminated with > at position "+p.getIndex())}p.skip(1);domBuilder.startDTD(doctype.name,doctype.publicId,doctype.systemId,doctype.internalSubset);domBuilder.endDTD();return p.getIndex()}default:return errorHandler.fatalError('Not well-formed XML starting with "0){return errorHandler.fatalError("processing instruction at position "+start+" is an xml declaration which is only at the start of the document")}if(!g.XMLDecl.test(source.substring(start))){return errorHandler.fatalError("xml declaration is not well-formed")}}domBuilder.processingInstruction(match[1],match[2]);return start+match[0].length}function ElementAttributes(){this.attributeNames=Object.create(null)}ElementAttributes.prototype={setTagName:function(tagName){if(!g.QName_exact.test(tagName)){throw new Error("invalid tagName:"+tagName)}this.tagName=tagName},addValue:function(qName,value,offset){if(!g.QName_exact.test(qName)){throw new Error("invalid attribute:"+qName)}this.attributeNames[qName]=this.length;this[this.length++]={qName:qName,value:value,offset:offset}},length:0,getLocalName:function(i){return this[i].localName},getLocator:function(i){return this[i].locator},getQName:function(i){return this[i].qName},getURI:function(i){return this[i].uri},getValue:function(i){return this[i].value}};exports.XMLReader=XMLReader;exports.parseUtils=parseUtils;exports.parseDoctypeCommentOrCData=parseDoctypeCommentOrCData},{"./conventions":34,"./errors":38,"./grammar":39}],"/src/js/docxtemplater.js":[function(require,module,exports){(function(Buffer){"use strict";var _excluded=["modules"];function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;rr.length)&&(a=r.length);for(var e=0,n=Array(a);e0){throw new XTInternalError('Detected duplicate module "'.concat(duplicates[0],'"'))}}function addXmlFileNamesFromXmlContentType(doc){for(var _i2=0,_doc$modules2=doc.modules;_i2<_doc$modules2.length;_i2++){var _module=_doc$modules2[_i2];for(var _i4=0,_ref3=_module.xmlContentTypes||[];_i4<_ref3.length;_i4++){var contentType=_ref3[_i4];var candidates=doc.invertedContentTypes[contentType]||[];for(var _i6=0;_i61&&arguments[1]!==undefined?arguments[1]:{},_ref4$modules=_ref4.modules,modules=_ref4$modules===void 0?[]:_ref4$modules,options=_objectWithoutProperties(_ref4,_excluded);_classCallCheck(this,Docxtemplater);this.targets=[];this.rendered=false;this.scopeManagers={};this.compiled={};this.modules=[commonModule()];this.xmlDocuments={};if(arguments.length===0){deprecatedMessage(this,"Deprecated docxtemplater constructor with no arguments, view upgrade guide : https://docxtemplater.com/docs/api/#upgrade-guide, stack : ".concat((new Error).stack));this.hideDeprecations=true;this.setOptions(options)}else{this.hideDeprecations=true;this.setOptions(options);if(isBuffer(zip)){throw new Error("You passed a Buffer to the Docxtemplater constructor. The first argument of docxtemplater's constructor must be a valid zip file (jszip v2 or pizzip v3)")}if(!zip||!zip.files||typeof zip.file!=="function"){throw new Error("The first argument of docxtemplater's constructor must be a valid zip file (jszip v2 or pizzip v3)")}if(!Array.isArray(modules)){throw new Error("The modules argument of docxtemplater's constructor must be an array")}for(var _i12=0;_i12currentModuleApiVersion[1]){throwApiVersionError("The minor api version is not uptodate, you probably have to update docxtemplater with npm install --save docxtemplater",{neededVersion:neededVersion,currentModuleApiVersion:currentModuleApiVersion,explanation:"moduleAPIVersionMismatch : needed=".concat(neededVersion.join("."),", current=").concat(currentModuleApiVersion.join("."))})}if(neededVersion[1]===currentModuleApiVersion[1]&&neededVersion[2]>currentModuleApiVersion[2]){throwApiVersionError("The patch api version is not uptodate, you probably have to update docxtemplater with npm install --save docxtemplater",{neededVersion:neededVersion,currentModuleApiVersion:currentModuleApiVersion,explanation:"moduleAPIVersionMismatch : needed=".concat(neededVersion.join("."),", current=").concat(currentModuleApiVersion.join("."))})}return true}},{key:"setModules",value:function setModules(obj){for(var _i14=0,_this$modules2=this.modules;_i14<_this$modules2.length;_i14++){var _module3=_this$modules2[_i14];_module3.set(obj)}}},{key:"sendEvent",value:function sendEvent(eventName){for(var _i16=0,_this$modules4=this.modules;_i16<_this$modules4.length;_i16++){var _module4=_this$modules4[_i16];_module4.on(eventName)}}},{key:"attachModule",value:function attachModule(module){if(this.v4Constructor){throw new XTInternalError("attachModule() should not be called manually when using the v4 constructor")}deprecatedMethod(this,"attachModule");var moduleType=_typeof(module);if(moduleType==="function"){throw new XTInternalError("Cannot attach a class/function as a module. Most probably you forgot to instantiate the module by using `new` on the module.")}if(!module||moduleType!=="object"){throw new XTInternalError("Cannot attachModule with a falsy value")}if(module.requiredAPIVersion){this.verifyApiVersion(module.requiredAPIVersion)}if(module.attached===true){if(typeof module.clone==="function"){module=module.clone()}else{throw new Error('Cannot attach a module that was already attached : "'.concat(module.name,'". The most likely cause is that you are instantiating the module at the root level, and using it for multiple instances of Docxtemplater'))}}module.attached=true;var wrappedModule=moduleWrapper(module);this.modules.push(wrappedModule);wrappedModule.on("attached");if(this.fileType){dropUnsupportedFileTypesModules(this)}return this}},{key:"setOptions",value:function setOptions(options){var _this$delimiters,_this$delimiters2;if(this.v4Constructor){throw new Error("setOptions() should not be called manually when using the v4 constructor")}deprecatedMethod(this,"setOptions");if(!options){throw new Error("setOptions should be called with an object as first parameter")}this.options={};var defaults=getDefaults();for(var key in defaults){var defaultValue=defaults[key];this.options[key]=options[key]!=null?options[key]:this[key]||defaultValue;this[key]=this.options[key]}(_this$delimiters=this.delimiters).start&&(_this$delimiters.start=utf8ToWord(this.delimiters.start));(_this$delimiters2=this.delimiters).end&&(_this$delimiters2.end=utf8ToWord(this.delimiters.end));return this}},{key:"loadZip",value:function loadZip(zip){if(this.v4Constructor){throw new Error("loadZip() should not be called manually when using the v4 constructor")}deprecatedMethod(this,"loadZip");if(zip.loadAsync){throw new XTInternalError("Docxtemplater doesn't handle JSZip version >=3, please use pizzip")}this.zip=zip;this.updateFileTypeConfig();this.modules=concatArrays([this.fileTypeConfig.baseModules.map(function(moduleFunction){return moduleFunction()}),this.modules]);for(var _i18=0,_this$modules6=this.modules;_i18<_this$modules6.length;_i18++){var _module5=_this$modules6[_i18];_module5.zip=this.zip;_module5.docxtemplater=this}dropUnsupportedFileTypesModules(this);return this}},{key:"precompileFile",value:function precompileFile(fileName){var currentFile=this.createTemplateClass(fileName);currentFile.preparse();this.compiled[fileName]=currentFile}},{key:"compileFile",value:function compileFile(fileName){this.compiled[fileName].parse()}},{key:"getScopeManager",value:function getScopeManager(to,currentFile,tags){var _this$scopeManagers;(_this$scopeManagers=this.scopeManagers)[to]||(_this$scopeManagers[to]=createScope({tags:tags,parser:this.parser,cachedParsers:currentFile.cachedParsers}));return this.scopeManagers[to]}},{key:"resolveData",value:function resolveData(data){var _this=this;deprecatedMethod(this,"resolveData");var errors=[];if(!Object.keys(this.compiled).length){throwResolveBeforeCompile()}return Promise.resolve(data).then(function(data){_this.data=data;_this.setModules({data:_this.data,Lexer:Lexer});_this.mapper=_this.modules.reduce(function(value,module){return module.getRenderedMap(value)},{});return Promise.all(Object.keys(_this.mapper).map(function(to){var _this$mapper$to=_this.mapper[to],from=_this$mapper$to.from,data=_this$mapper$to.data;return Promise.resolve(data).then(function(data){var currentFile=_this.compiled[from];currentFile.filePath=to;currentFile.scopeManager=_this.getScopeManager(to,currentFile,data);return currentFile.resolveTags(data).then(function(result){currentFile.scopeManager.finishedResolving=true;return result},function(errs){pushArray(errors,errs)})})})).then(function(resolved){if(errors.length!==0){if(_this.options.errorLogging){logErrors(errors,_this.options.errorLogging)}throwMultiError(errors)}return concatArrays(resolved)})})}},{key:"compile",value:function compile(){deprecatedMethod(this,"compile");this.updateFileTypeConfig();throwIfDuplicateModules(this.modules);this.modules=reorderModules(this.modules);if(Object.keys(this.compiled).length){return this}var options=this.options;for(var _i20=0,_this$modules8=this.modules;_i20<_this$modules8.length;_i20++){var _module6=_this$modules8[_i20];options=_module6.optionsTransformer(options,this)}this.options=options;this.options.xmlFileNames=uniq(this.options.xmlFileNames);for(var _i22=0,_this$options$xmlFile2=this.options.xmlFileNames;_i22<_this$options$xmlFile2.length;_i22++){var fileName=_this$options$xmlFile2[_i22];var content=this.zip.files[fileName].asText();this.xmlDocuments[fileName]=str2xml(content)}this.setModules({zip:this.zip,xmlDocuments:this.xmlDocuments});this.getTemplatedFiles();this.sendEvent("before-preparse");for(var _i24=0,_this$templatedFiles2=this.templatedFiles;_i24<_this$templatedFiles2.length;_i24++){var _fileName=_this$templatedFiles2[_i24];if(this.zip.files[_fileName]!=null){this.precompileFile(_fileName)}}this.sendEvent("after-preparse");for(var _i26=0,_this$templatedFiles4=this.templatedFiles;_i26<_this$templatedFiles4.length;_i26++){var _fileName2=_this$templatedFiles4[_i26];if(this.zip.files[_fileName2]!=null){this.compiled[_fileName2].parse({noPostParse:true})}}this.sendEvent("after-parse");for(var _i28=0,_this$templatedFiles6=this.templatedFiles;_i28<_this$templatedFiles6.length;_i28++){var _fileName3=_this$templatedFiles6[_i28];if(this.zip.files[_fileName3]!=null){this.compiled[_fileName3].postparse()}}this.sendEvent("after-postparse");this.setModules({compiled:this.compiled});verifyErrors(this);return this}},{key:"updateFileTypeConfig",value:function updateFileTypeConfig(){this.relsTypes=getRelsTypes(this.zip);var _getContentTypes=getContentTypes(this.zip),overrides=_getContentTypes.overrides,defaults=_getContentTypes.defaults,contentTypes=_getContentTypes.contentTypes,contentTypeXml=_getContentTypes.contentTypeXml;if(contentTypeXml){this.filesContentTypes=collectContentTypes(overrides,defaults,this.zip);this.invertedContentTypes=invertMap(this.filesContentTypes);this.setModules({contentTypes:this.contentTypes,invertedContentTypes:this.invertedContentTypes})}var fileType;if(this.zip.files.mimetype){fileType="odt"}for(var _i30=0,_this$modules0=this.modules;_i30<_this$modules0.length;_i30++){var _module7=_this$modules0[_i30];fileType=_module7.getFileType({zip:this.zip,contentTypes:contentTypes,contentTypeXml:contentTypeXml,overrides:overrides,defaults:defaults,doc:this})||fileType}this.fileType=fileType;if(fileType==="odt"){throwFileTypeNotHandled(fileType)}if(!fileType){throwFileTypeNotIdentified(this.zip)}addXmlFileNamesFromXmlContentType(this);dropUnsupportedFileTypesModules(this);this.fileTypeConfig=this.options.fileTypeConfig||this.fileTypeConfig;if(!this.fileTypeConfig){if(Docxtemplater.FileTypeConfig[this.fileType]){this.fileTypeConfig=Docxtemplater.FileTypeConfig[this.fileType]()}else{var message='Filetype "'.concat(this.fileType,'" is not supported');var id="filetype_not_supported";if(this.fileType==="xlsx"){message='Filetype "'.concat(this.fileType,'" is supported only with the paid XlsxModule');id="xlsx_filetype_needs_xlsx_module"}var err=new XTTemplateError(message);err.properties={id:id,explanation:message};throw err}}return this}},{key:"renderAsync",value:function renderAsync(data){var _this2=this;this.hideDeprecations=true;var promise=this.resolveData(data);this.hideDeprecations=false;return promise.then(function(){return _this2.render()})}},{key:"render",value:function render(data){if(this.rendered){throwRenderTwice()}this.rendered=true;if(Object.keys(this.compiled).length===0){this.compile()}if(this.errors.length>0){throwRenderInvalidTemplate()}if(arguments.length>0){this.data=data}this.setModules({data:this.data,Lexer:Lexer});this.mapper||(this.mapper=this.modules.reduce(function(value,module){return module.getRenderedMap(value)},{}));var output=[];for(var to in this.mapper){var _this$mapper$to2=this.mapper[to],from=_this$mapper$to2.from,_data=_this$mapper$to2.data;var currentFile=this.compiled[from];currentFile.scopeManager=this.getScopeManager(to,currentFile,_data);currentFile.render(to);output.push([to,currentFile.content,currentFile]);delete currentFile.content}for(var _i32=0;_i32