(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;iarr.length)len=arr.length;for(var i=0,arr2=new Array(len);i");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 uniq(arr){var hash={},result=[];for(var i=0,l=arr.length;i0})}var defaults={errorLogging:"json",paragraphLoop:false,nullGetter:function nullGetter(part){return part.module?"":"undefined"},xmlFileNames:["[Content_Types].xml"],parser:parser,linebreaks:false,fileTypeConfig:null,delimiters:{start:"{",end:"}"},syntax:{}};function xml2str(xmlNode){var a=new XMLSerializer;return a.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){var r;for(var i=charMapRegexes.length-1;i>=0;i--){r=charMapRegexes[i];string=string.replace(r.rstart,r.end)}return string}function utf8ToWord(string){string=string.toString();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 j=0,len=elements.length;j"},{tag:"w:sdtContent",shouldContain:["w:p","w:r","w:commentRangeStart","w:sdt"],value:""}]}}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: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"],drop:true},{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":12,"./modules/loop.js":13,"./modules/rawxml.js":14,"./modules/render.js":15,"./modules/space-preserve.js":16}],6:[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 main=[docxContentType,docxmContentType,dotxContentType,dotmContentType];var filetypes={main:main,docx:[headerContentType].concat(main,[footerContentType,footnotesContentType,commentsContentType]),pptx:[pptxContentType,pptxSlideMaster,pptxSlideLayout,pptxPresentationContentType]};module.exports=filetypes},{}],7:[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 i=0,len=parts.length;i-1){}break}if(currentlyCollecting===-1&&isStarting(part,tag)&&part.substr(1).indexOf("<")===-1){if(part[part.length-2]==="/"){parts[i]="";break}else{startIndex=i;currentlyCollecting=j;collecting=part;break}}}}return parts}module.exports=joinUncorrupt},{"./doc-utils.js":2,"./filetypes.js":6}],8:[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 _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_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(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i",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);errors.push(getDuplicateOpenTagException({xtag:xtag,offset:lastDelimiterOffset}));lastDelimiterMatch=currDelimiterMatch;delimiterAcc.push(_objectSpread(_objectSpread({},currDelimiterMatch),{},{error:true}));return delimiterAcc}errors.push(getUnclosedTagException({xtag:wordToUtf8(xtag),offset:lastDelimiterOffset}));lastDelimiterMatch=currDelimiterMatch;delimiterAcc.push(_objectSpread(_objectSpread({},currDelimiterMatch),{},{error:true}));return delimiterAcc}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=!inDelimiter;lastDelimiterMatch=currDelimiterMatch;delimiterAcc.push(currDelimiterMatch);return delimiterAcc},[]);if(inDelimiter){var lastDelimiterOffset=lastDelimiterMatch.offset;xtag=fullText.substr(lastDelimiterOffset,fullText.length-lastDelimiterOffset);errors.push(getUnclosedTagException({xtag:wordToUtf8(xtag),offset:lastDelimiterOffset}))}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}delimitersInOffset.forEach(function(delimiterInOffset){var value=partContent.substr(cursor,delimiterInOffset.offset-offset-cursor);if(delimiterInOffset.changedelimiter){if(delimiterInOffset.position==="start"){if(value.length>0){parts.push({type:"content",value:value})}}else{cursor=delimiterInOffset.offset-offset+delimiterInOffset.length}return}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){var inTextTag=false;xmlparsed.forEach(function(part){inTextTag=updateInTextTag(part,inTextTag);if(part.type==="content"){part.position=inTextTag?"insidetag":"outsidetag"}if(isInsideContent(part)){part.value=part.value.replace(/>/g,">")}})}module.exports={parseDelimiters:parseDelimiters,parse:function parse(xmlparsed,delimiters,syntaxOptions){decodeContentParts(xmlparsed);var _parseDelimiters=parseDelimiters(getContentParts(xmlparsed),delimiters,syntaxOptions),delimiterParsed=_parseDelimiters.parsed,errors=_parseDelimiters.errors;var lexed=[];var index=0;var lIndex=0;xmlparsed.forEach(function(part){if(isInsideContent(part)){Array.prototype.push.apply(lexed,delimiterParsed[index].map(function(p){if(p.type==="content"){p.position="insidetag"}p.lIndex=lIndex++;return p}));index++}else{part.lIndex=lIndex++;lexed.push(part)}});return{errors:errors,lexed:lexed}},xmlparse:function xmlparse(content,xmltags){var matches=tagMatcher(content,xmltags.text,xmltags.other);var cursor=0;var parsed=matches.reduce(function(parsed,match){var value=content.substr(cursor,match.offset-cursor);if(value.length>0){parsed.push({type:"content",value:value})}cursor=match.offset+match.value.length;delete match.offset;parsed.push(match);return parsed},[]);var value=content.substr(cursor);if(value.length>0){parsed.push({type:"content",value:value})}return parsed}}},{"./doc-utils.js":2,"./errors.js":4}],9:[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);errors=errors.concat(result.errors);transformedTraits=result.traits}if(errors.length>0){return{pairs:pairs,errors:errors}}var countOpen=0;for(var _i=0;_i=0?countOpen:0}return{pairs:pairs,errors:errors}}var ExpandPairTrait=function(){function ExpandPairTrait(){_classCallCheck(this,ExpandPairTrait);this.name="ExpandPairTrait"}_createClass(ExpandPairTrait,[{key:"clone",value:function clone(){return new ExpandPairTrait}},{key:"optionsTransformer",value:function optionsTransformer(options,docxtemplater){this.expandTags=docxtemplater.fileTypeConfig.expandTags.concat(docxtemplater.options.paragraphLoop?docxtemplater.fileTypeConfig.onParagraphLoop:[]);return options}},{key:"postparse",value:function postparse(postparsed,_ref2){var _this=this;var getTraits=_ref2.getTraits,_postparse=_ref2.postparse;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"){var result=getExpandToDefault(postparsed,pair,_this.expandTags);if(result.error){errors.push(result.error)}expandTo=result.value}if(!expandTo){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=currentPairIndexarr.length)len=arr.length;for(var i=0,arr2=new Array(len);i':""}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["".concat(sect.map(function(_ref){var value=_ref.value;return value}).join(""),"")].concat(parts)}function addContinuousType(parts){var stop=false;var inSectPr=false;return parts.reduce(function(result,part){if(stop===false&&startsWith(part,"')}}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:"^"}}_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}return parsed.reduce(function(tags,part,offset){if(isModule(part,moduleName)&&part.subparsed==null){tags.push({part:part,offset:offset})}return tags},[])}},{key:"postparse",value:function postparse(parsed,_ref6){var basePart=_ref6.basePart;if(basePart&&this.docxtemplater.fileType==="docx"&&parsed.length>0){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);part.subparsed.forEach(function(pp){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 _i=0,len=subRendered.parts.length;_i".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}}}]);return LoopModule}();module.exports=function(){return wrapper(new LoopModule)}},{"../doc-utils.js":2,"../filetypes.js":6,"../module-wrapper.js":10}],14:[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(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(target,props){for(var i=0;i":"";var lines=value.split("\n");var runprops=this.recordedRun.join("");return lines.map(function(line){return utf8ToWord(line)}).reduce(function(result,line,i){result.push(line);if(i").concat(br,"<").concat(p,":r>").concat(runprops,"<").concat(p,":t").concat(_this3.fileType==="docx"?' xml:space="preserve"':"",">"))}return result},[])}}]);return Render}();module.exports=function(){return wrapper(new Render)}},{"../doc-utils.js":2,"../errors.js":4,"../module-wrapper.js":10}],16:[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(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(target,props){for(var i=0;i"){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"}_createClass(SpacePreserve,[{key:"clone",value:function clone(){return new 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)}Array.prototype.push.apply(postparsed,chunk);chunk=[];inTextTag=false;endLindex=0;lastTextTag=0}return postparsed},[]);Array.prototype.push.apply(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=index;parts[i]=p}return parts}}]);return SpacePreserve}();module.exports=function(){return wrapper(new SpacePreserve)}},{"../doc-utils.js":2,"../module-wrapper.js":10}],17:[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;rarr.length)len=arr.length;for(var i=0,arr2=new Array(len);i0){var bestMatch=null;matches.forEach(function(match){match.priority=match.priority||-match.value.length;if(!bestMatch||match.priority>bestMatch.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 i=0,l=modules.length;i>>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 i=0,l=options.modules.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;uintArrays.forEach(function(buf){for(var _i2=0;_i2arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i>>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}_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;iarr.length)len=arr.length;for(var i=0,arr2=new Array(len);i0?limits[i-1].right:0);if(limit.left]*>)([^<>]*))|(<(?:").concat(taj,")[^>]*/>)"),"g");res.matches=pregMatchAll(regexp,res.content);return res}},{"./doc-utils.js":2}],26:[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(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(target,props){for(var i=0;i0){this.allErrors=errors;this.errorChecker(errors);return this}this.content=postrender(parts,options);this.setModules({inspect:{content:this.content}});return this}}]);return XmlTemplater}()},{"./doc-utils.js":2,"./join-uncorrupt.js":7,"./lexer.js":8,"./parser.js":17,"./postrender.js":18,"./render.js":20,"./resolve.js":21,"./xml-matcher.js":25}],27:[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=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(hander,node){if(!hander.currentElement){hander.doc.appendChild(node)}else{hander.currentElement.appendChild(node)}}exports.__DOMHandler=DOMHandler;exports.normalizeLineEndings=normalizeLineEndings;exports.DOMParser=DOMParser},{"./conventions":27,"./dom":29,"./entities":30,"./sax":32}],29:[function(require,module,exports){var conventions=require("./conventions");var find=conventions.find;var NAMESPACE=conventions.NAMESPACE;function notEmptyString(input){return input!==""}function splitOnASCIIWhitespace(input){return input?input.split(/[\t\n\f\r ]+/).filter(notEmptyString):[]}function orderedSetReducer(current,element){if(!current.hasOwnProperty(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 copy(src,dest){for(var p in src){if(Object.prototype.hasOwnProperty.call(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 ExceptionCode={};var ExceptionMessage={};var INDEX_SIZE_ERR=ExceptionCode.INDEX_SIZE_ERR=(ExceptionMessage[1]="Index size error",1);var DOMSTRING_SIZE_ERR=ExceptionCode.DOMSTRING_SIZE_ERR=(ExceptionMessage[2]="DOMString size error",2);var HIERARCHY_REQUEST_ERR=ExceptionCode.HIERARCHY_REQUEST_ERR=(ExceptionMessage[3]="Hierarchy request error",3);var WRONG_DOCUMENT_ERR=ExceptionCode.WRONG_DOCUMENT_ERR=(ExceptionMessage[4]="Wrong document",4);var INVALID_CHARACTER_ERR=ExceptionCode.INVALID_CHARACTER_ERR=(ExceptionMessage[5]="Invalid character",5);var NO_DATA_ALLOWED_ERR=ExceptionCode.NO_DATA_ALLOWED_ERR=(ExceptionMessage[6]="No data allowed",6);var NO_MODIFICATION_ALLOWED_ERR=ExceptionCode.NO_MODIFICATION_ALLOWED_ERR=(ExceptionMessage[7]="No modification allowed",7);var NOT_FOUND_ERR=ExceptionCode.NOT_FOUND_ERR=(ExceptionMessage[8]="Not found",8);var NOT_SUPPORTED_ERR=ExceptionCode.NOT_SUPPORTED_ERR=(ExceptionMessage[9]="Not supported",9);var INUSE_ATTRIBUTE_ERR=ExceptionCode.INUSE_ATTRIBUTE_ERR=(ExceptionMessage[10]="Attribute in use",10);var INVALID_STATE_ERR=ExceptionCode.INVALID_STATE_ERR=(ExceptionMessage[11]="Invalid state",11);var SYNTAX_ERR=ExceptionCode.SYNTAX_ERR=(ExceptionMessage[12]="Syntax error",12);var INVALID_MODIFICATION_ERR=ExceptionCode.INVALID_MODIFICATION_ERR=(ExceptionMessage[13]="Invalid modification",13);var NAMESPACE_ERR=ExceptionCode.NAMESPACE_ERR=(ExceptionMessage[14]="Invalid namespace",14);var INVALID_ACCESS_ERR=ExceptionCode.INVALID_ACCESS_ERR=(ExceptionMessage[15]="Invalid access",15);function DOMException(code,message){if(message instanceof Error){var error=message}else{error=this;Error.call(this,ExceptionMessage[code]);this.message=ExceptionMessage[code];if(Error.captureStackTrace)Error.captureStackTrace(this,DOMException)}error.code=code;if(message)this.message=this.message+": "+message;return error}DOMException.prototype=Error.prototype;copy(ExceptionCode,DOMException);function NodeList(){}NodeList.prototype={length:0,item:function(index){return index>=0&&index=0){var lastIndex=list.length-1;while(i0},lookupPrefix:function(namespaceURI){var el=this;while(el){var map=el._nsMap;if(map){for(var n in map){if(Object.prototype.hasOwnProperty.call(map,n)&&map[n]===namespaceURI){return n}}}el=el.nodeType==ATTRIBUTE_NODE?el.ownerDocument:el.parentNode}return null},lookupNamespaceURI:function(prefix){var el=this;while(el){var map=el._nsMap;if(map){if(Object.prototype.hasOwnProperty.call(map,prefix)){return map[prefix]}}el=el.nodeType==ATTRIBUTE_NODE?el.ownerDocument:el.parentNode}return null},isDefaultNamespace:function(namespaceURI){var prefix=this.lookupPrefix(namespaceURI);return prefix==null}};function _xmlEncoder(c){return c=="<"&&"<"||c==">"&&">"||c=="&"&&"&"||c=='"'&&"""||"&#"+c.charCodeAt()+";"}copy(NodeType,Node);copy(NodeType,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(){this.ownerDocument=this}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,el,newChild){if(doc&&doc._inc){doc._inc++;var cs=el.childNodes;if(newChild){cs[cs.length++]=newChild}else{var child=el.firstChild;var i=0;while(child){cs[i++]=child;child=child.nextSibling}cs.length=i;delete cs[cs.length]}}}function _removeChild(parentNode,child){var previous=child.previousSibling;var next=child.nextSibling;if(previous){previous.nextSibling=next}else{parentNode.firstChild=next}if(next){next.previousSibling=previous}else{parentNode.lastChild=previous}child.parentNode=null;child.previousSibling=null;child.nextSibling=null;_onUpdateChild(parentNode.ownerDocument,parentNode);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&&(isElementNode(node)||isTextNode(node)||isDocTypeNode(node)||node.nodeType===Node.DOCUMENT_FRAGMENT_NODE||node.nodeType===Node.COMMENT_NODE||node.nodeType===Node.PROCESSING_INSTRUCTION_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(HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+parent.nodeType)}if(child&&child.parentNode!==parent){throw new DOMException(NOT_FOUND_ERR,"child not in parent")}if(!hasInsertableNodeType(node)||isDocTypeNode(node)&&parent.nodeType!==Node.DOCUMENT_NODE){throw new 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(HIERARCHY_REQUEST_ERR,"More than one element or text in fragment")}if(nodeChildElements.length===1&&!isElementInsertionPossible(parent,child)){throw new DOMException(HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}}if(isElementNode(node)){if(!isElementInsertionPossible(parent,child)){throw new DOMException(HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype")}}if(isDocTypeNode(node)){if(find(parentChildNodes,isDocTypeNode)){throw new 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(HIERARCHY_REQUEST_ERR,"More than one element or text in fragment")}if(nodeChildElements.length===1&&!isElementReplacementPossible(parent,child)){throw new DOMException(HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}}if(isElementNode(node)){if(!isElementReplacementPossible(parent,child)){throw new 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(HIERARCHY_REQUEST_ERR,"Only one doctype is allowed")}var parentElementChild=find(parentChildNodes,isElementNode);if(child&&parentChildNodes.indexOf(parentElementChild)0){_visitNode(base.documentElement,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})},createElement:function(tagName){var node=new Element;node.ownerDocument=this;node.nodeName=tagName;node.tagName=tagName;node.localName=tagName;node.childNodes=new NodeList;var attrs=node.attributes=new NamedNodeMap;attrs._ownerElement=node;return node},createDocumentFragment:function(){var node=new DocumentFragment;node.ownerDocument=this;node.childNodes=new NodeList;return node},createTextNode:function(data){var node=new Text;node.ownerDocument=this;node.appendData(data);return node},createComment:function(data){var node=new Comment;node.ownerDocument=this;node.appendData(data);return node},createCDATASection:function(data){var node=new CDATASection;node.ownerDocument=this;node.appendData(data);return node},createProcessingInstruction:function(target,data){var node=new ProcessingInstruction;node.ownerDocument=this;node.tagName=node.nodeName=node.target=target;node.nodeValue=node.data=data;return node},createAttribute:function(name){var node=new Attr;node.ownerDocument=this;node.name=name;node.nodeName=name;node.localName=name;node.specified=true;return node},createEntityReference:function(name){var node=new EntityReference;node.ownerDocument=this;node.nodeName=name;return node},createElementNS:function(namespaceURI,qualifiedName){var node=new Element;var pl=qualifiedName.split(":");var attrs=node.attributes=new NamedNodeMap;node.childNodes=new NodeList;node.ownerDocument=this;node.nodeName=qualifiedName;node.tagName=qualifiedName;node.namespaceURI=namespaceURI;if(pl.length==2){node.prefix=pl[0];node.localName=pl[1]}else{node.localName=qualifiedName}attrs._ownerElement=node;return node},createAttributeNS:function(namespaceURI,qualifiedName){var node=new Attr;var pl=qualifiedName.split(":");node.ownerDocument=this;node.nodeName=qualifiedName;node.name=qualifiedName;node.namespaceURI=namespaceURI;node.specified=true;if(pl.length==2){node.prefix=pl[0];node.localName=pl[1]}else{node.localName=qualifiedName}return node}};_extends(Document,Node);function Element(){this._nsMap={}}Element.prototype={nodeType:ELEMENT_NODE,hasAttribute:function(name){return this.getAttributeNode(name)!=null},getAttribute:function(name){var attr=this.getAttributeNode(name);return attr&&attr.value||""},getAttributeNode:function(name){return this.attributes.getNamedItem(name)},setAttribute:function(name,value){var attr=this.ownerDocument.createAttribute(name);attr.value=attr.nodeValue=""+value;this.setAttributeNode(attr)},removeAttribute:function(name){var attr=this.getAttributeNode(name);attr&&this.removeAttributeNode(attr)},appendChild:function(newChild){if(newChild.nodeType===DOCUMENT_FRAGMENT_NODE){return this.insertBefore(newChild,null)}else{return _appendSingleChild(this,newChild)}},setAttributeNode:function(newAttr){return this.attributes.setNamedItem(newAttr)},setAttributeNodeNS:function(newAttr){return this.attributes.setNamedItemNS(newAttr)},removeAttributeNode:function(oldAttr){return this.attributes.removeNamedItem(oldAttr.nodeName)},removeAttributeNS:function(namespaceURI,localName){var old=this.getAttributeNodeNS(namespaceURI,localName);old&&this.removeAttributeNode(old)},hasAttributeNS:function(namespaceURI,localName){return this.getAttributeNodeNS(namespaceURI,localName)!=null},getAttributeNS:function(namespaceURI,localName){var attr=this.getAttributeNodeNS(namespaceURI,localName);return attr&&attr.value||""},setAttributeNS:function(namespaceURI,qualifiedName,value){var attr=this.ownerDocument.createAttributeNS(namespaceURI,qualifiedName);attr.value=attr.nodeValue=""+value;this.setAttributeNode(attr)},getAttributeNodeNS:function(namespaceURI,localName){return this.attributes.getNamedItemNS(namespaceURI,localName)},getElementsByTagName:function(tagName){return new LiveNodeList(this,function(base){var ls=[];_visitNode(base,function(node){if(node!==base&&node.nodeType==ELEMENT_NODE&&(tagName==="*"||node.tagName==tagName)){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.getElementsByTagName=Element.prototype.getElementsByTagName;Document.prototype.getElementsByTagNameNS=Element.prototype.getElementsByTagNameNS;_extends(Element,Node);function Attr(){}Attr.prototype.nodeType=ATTRIBUTE_NODE;_extends(Attr,Node);function CharacterData(){}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)},appendChild:function(newChild){throw new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR])},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(){}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(){}Comment.prototype={nodeName:"#comment",nodeType:COMMENT_NODE};_extends(Comment,CharacterData);function CDATASection(){}CDATASection.prototype={nodeName:"#cdata-section",nodeType:CDATA_SECTION_NODE};_extends(CDATASection,CharacterData);function DocumentType(){}DocumentType.prototype.nodeType=DOCUMENT_TYPE_NODE;_extends(DocumentType,Node);function Notation(){}Notation.prototype.nodeType=NOTATION_NODE;_extends(Notation,Node);function Entity(){}Entity.prototype.nodeType=ENTITY_NODE;_extends(Entity,Node);function EntityReference(){}EntityReference.prototype.nodeType=ENTITY_REFERENCE_NODE;_extends(EntityReference,Node);function DocumentFragment(){}DocumentFragment.prototype.nodeName="#document-fragment";DocumentFragment.prototype.nodeType=DOCUMENT_FRAGMENT_NODE;_extends(DocumentFragment,Node);function ProcessingInstruction(){}ProcessingInstruction.prototype.nodeType=PROCESSING_INSTRUCTION_NODE;_extends(ProcessingInstruction,Node);function XMLSerializer(){}XMLSerializer.prototype.serializeToString=function(node,isHtml,nodeFilter){return nodeSerializeToString.call(node,isHtml,nodeFilter)};Node.prototype.toString=nodeSerializeToString;function nodeSerializeToString(isHtml,nodeFilter){var buf=[];var refNode=this.nodeType==9&&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,isHtml,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,isHTML,nodeFilter,visibleNamespaces){if(!visibleNamespaces){visibleNamespaces=[]}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;isHTML=NAMESPACE.isHTML(node.namespaceURI)||isHTML;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");if(isHTML&&/^script$/i.test(nodeName)){while(child){if(child.data){buf.push(child.data)}else{serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces.slice())}child=child.nextSibling}}else{while(child){serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces.slice());child=child.nextSibling}}buf.push("")}else{buf.push("/>")}return;case DOCUMENT_NODE:case DOCUMENT_FRAGMENT_NODE:var child=node.firstChild;while(child){serializeToString(child,buf,isHTML,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("");case COMMENT_NODE:return buf.push("\x3c!--",node.data,"--\x3e");case DOCUMENT_TYPE_NODE:var pubid=node.publicId;var sysid=node.systemId;buf.push("")}else if(sysid&&sysid!="."){buf.push(" SYSTEM ",sysid,">")}else{var sub=node.internalSubset;if(sub){buf.push(" [",sub,"]")}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;for(var n in node){if(Object.prototype.hasOwnProperty.call(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":27}],31:[function(require,module,exports){var dom=require("./dom");exports.DOMImplementation=dom.DOMImplementation;exports.XMLSerializer=dom.XMLSerializer;exports.DOMParser=require("./dom-parser").DOMParser},{"./dom":29,"./dom-parser":28}],32:[function(require,module,exports){var NAMESPACE=require("./conventions").NAMESPACE;var nameStartChar=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;var nameChar=new RegExp("[\\-\\.0-9"+nameStartChar.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");var tagNamePattern=new RegExp("^"+nameStartChar.source+nameChar.source+"*(?::"+nameStartChar.source+nameChar.source+"*)?$");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 ParseError(message,locator){this.message=message;this.locator=locator;if(Error.captureStackTrace)Error.captureStackTrace(this,ParseError)}ParseError.prototype=new Error;ParseError.prototype.name=ParseError.name;function XMLReader(){}XMLReader.prototype={parse:function(source,defaultNSMap,entityMap){var domBuilder=this.domBuilder;domBuilder.startDocument();_copy(defaultNSMap,defaultNSMap={});parse(source,defaultNSMap,entityMap,domBuilder,this.errorHandler);domBuilder.endDocument()}};function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){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 k=a.slice(1,-1);if(Object.hasOwnProperty.call(entityMap,k)){return entityMap[k]}else if(k.charAt(0)==="#"){return fixedFromCharCode(parseInt(k.substr(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(/&#?\w+;/g,entityReplacer);locator&&position(start);domBuilder.characters(xt,0,end-start);start=end}}function position(p,m){while(p>=lineEnd&&(m=linePattern.exec(source))){lineStart=m.index;lineEnd=lineStart+m[0].length;locator.lineNumber++}locator.columnNumber=p-lineStart+1}var lineStart=0;var lineEnd=0;var linePattern=/.*(?:\r\n?|\n)|.*$/g;var locator=domBuilder.locator;var parseStack=[{currentNSMap:defaultNSMapCopy}];var closeMap={};var start=0;while(true){try{var tagStart=source.indexOf("<",start);if(tagStart<0){if(!source.substr(start).match(/^\s*$/)){var doc=domBuilder.doc;var text=doc.createTextNode(source.substr(start));doc.appendChild(text);domBuilder.currentElement=text}return}if(tagStart>start){appendText(tagStart)}switch(source.charAt(tagStart+1)){case"/":var end=source.indexOf(">",tagStart+3);var tagName=source.substring(tagStart+2,end).replace(/[ \t\n\r]+$/g,"");var config=parseStack.pop();if(end<0){tagName=source.substring(tagStart+2).replace(/[\s<].*/,"");errorHandler.error("end tag name: "+tagName+" is not complete:"+config.tagName);end=tagStart+1+tagName.length}else if(tagName.match(/\sstart){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){function addAttribute(qname,value,startIndex){if(el.attributeNames.hasOwnProperty(qname)){errorHandler.fatalError("Attribute "+qname+" redefined")}el.addValue(qname,value.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,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(!NAMESPACE.isHTML(currentNSMap[""])||!value.match(/^(?:disabled|checked|selected)$/i)){errorHandler.warning('attribute "'+value+'" missed value!! "'+value+'" instead!!')}addAttribute(value,value,start)}break;case S_EQ:throw new Error("attribute value missed!!")}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:var tagName=el.tagName;if(!NAMESPACE.isHTML(currentNSMap[""])||!attrName.match(/^(?:disabled|checked|selected)$/i)){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={};_copy(currentNSMap,currentNSMap={})}currentNSMap[nsPrefix]=localNSMap[nsPrefix]=value;a.uri=NAMESPACE.XMLNS;domBuilder.startPrefixMapping(nsPrefix,value)}}var i=el.length;while(i--){a=el[i];var prefix=a.prefix;if(prefix){if(prefix==="xml"){a.uri=NAMESPACE.XML}if(prefix!=="xmlns"){a.uri=currentNSMap[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(Object.prototype.hasOwnProperty.call(localNSMap,prefix)){domBuilder.endPrefixMapping(prefix)}}}}else{el.currentNSMap=currentNSMap;el.localNSMap=localNSMap;return true}}function parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){if(/^(?:script|textarea)$/i.test(tagName)){var elEndStart=source.indexOf("",elStartEnd);var text=source.substring(elStartEnd+1,elEndStart);if(/[&<]/.test(text)){if(/^script$/i.test(tagName)){domBuilder.characters(text,0,text.length);return elEndStart}text=text.replace(/&#?\w+;/g,entityReplacer);domBuilder.characters(text,0,text.length);return elEndStart}}return elStartEnd+1}function fixSelfClosed(source,elStartEnd,tagName,closeMap){var pos=closeMap[tagName];if(pos==null){pos=source.lastIndexOf("");if(posstart){domBuilder.comment(source,start+4,end-start-4);return end+3}else{errorHandler.error("Unclosed comment");return-1}}else{return-1}default:if(source.substr(start+3,6)=="CDATA["){var end=source.indexOf("]]>",start+9);domBuilder.startCDATA();domBuilder.characters(source,start+9,end-start-9);domBuilder.endCDATA();return end+3}var matchs=split(source,start);var len=matchs.length;if(len>1&&/!doctype/i.test(matchs[0][0])){var name=matchs[1][0];var pubid=false;var sysid=false;if(len>3){if(/^public$/i.test(matchs[2][0])){pubid=matchs[3][0];sysid=len>4&&matchs[4][0]}else if(/^system$/i.test(matchs[2][0])){sysid=matchs[3][0]}}var lastMatch=matchs[len-1];domBuilder.startDTD(name,pubid,sysid);domBuilder.endDTD();return lastMatch.index+lastMatch[0].length}}return-1}function parseInstruction(source,start,domBuilder){var end=source.indexOf("?>",start);if(end){var match=source.substring(start,end).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(match){var len=match[0].length;domBuilder.processingInstruction(match[1],match[2]);return end+2}else{return-1}}return-1}function ElementAttributes(){this.attributeNames={}}ElementAttributes.prototype={setTagName:function(tagName){if(!tagNamePattern.test(tagName)){throw new Error("invalid tagName:"+tagName)}this.tagName=tagName},addValue:function(qName,value,offset){if(!tagNamePattern.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}};function split(source,start){var match;var buf=[];var reg=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;reg.lastIndex=start;reg.exec(source);while(match=reg.exec(source)){buf.push(match);if(match[1])return buf}}exports.XMLReader=XMLReader;exports.ParseError=ParseError},{"./conventions":27}],"/src/js/docxtemplater.js":[function(require,module,exports){"use strict";var _excluded=["modules"];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 _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(target,props){for(var i=0;i1&&arguments[1]!==undefined?arguments[1]:{},_ref$modules=_ref.modules,modules=_ref$modules===void 0?[]:_ref$modules,options=_objectWithoutProperties(_ref,_excluded);_classCallCheck(this,Docxtemplater);if(!Array.isArray(modules)){throw new Error("The modules argument of docxtemplater's constructor must be an array")}this.targets=[];this.rendered=false;this.scopeManagers={};this.compiled={};this.modules=[commonModule()];this.setOptions(options);modules.forEach(function(module){_this.attachModule(module)});if(arguments.length>0){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)")}this.loadZip(zip);this.compile();this.v4Constructor=true}}_createClass(Docxtemplater,[{key:"verifyApiVersion",value:function verifyApiVersion(neededVersion){neededVersion=neededVersion.split(".").map(function(i){return parseInt(i,10)});if(neededVersion.length!==3){throwApiVersionError("neededVersion is not a valid version",{neededVersion:neededVersion,explanation:"the neededVersion must be an array of length 3"})}if(neededVersion[0]!==currentModuleApiVersion[0]){throwApiVersionError("The major api version do not match, 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]){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){this.modules.forEach(function(module){module.set(obj)})}},{key:"sendEvent",value:function sendEvent(eventName){this.modules.forEach(function(module){module.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")}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 _this2=this;if(this.v4Constructor){throw new Error("setOptions() should not be called manually when using the v4 constructor")}if(!options){throw new Error("setOptions should be called with an object as first parameter")}this.options={};Object.keys(defaults).forEach(function(key){var defaultValue=defaults[key];_this2.options[key]=options[key]!=null?options[key]:_this2[key]||defaultValue;_this2[key]=_this2.options[key]});this.delimiters.start=DocUtils.utf8ToWord(this.delimiters.start);this.delimiters.end=DocUtils.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")}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]);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){if(!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 _this3=this;var errors=[];if(!Object.keys(this.compiled).length){throwResolveBeforeCompile()}return Promise.resolve(data).then(function(data){_this3.setData(data);_this3.setModules({data:_this3.data,Lexer:Lexer});_this3.mapper=_this3.modules.reduce(function(value,module){return module.getRenderedMap(value)},{});return Promise.all(Object.keys(_this3.mapper).map(function(to){var _this3$mapper$to=_this3.mapper[to],from=_this3$mapper$to.from,data=_this3$mapper$to.data;return Promise.resolve(data).then(function(data){var currentFile=_this3.compiled[from];currentFile.filePath=to;currentFile.scopeManager=_this3.getScopeManager(to,currentFile,data);return currentFile.resolveTags(data).then(function(result){currentFile.scopeManager.finishedResolving=true;return result},function(errs){Array.prototype.push.apply(errors,errs)})})})).then(function(resolved){if(errors.length!==0){if(_this3.options.errorLogging){logErrors(errors,_this3.options.errorLogging)}throwMultiError(errors)}return concatArrays(resolved)})})}},{key:"reorderModules",value:function reorderModules(){this.modules=stableSort(this.modules,function(m1,m2){return(m2.priority||0)-(m1.priority||0)})}},{key:"compile",value:function compile(){var _this4=this;this.updateFileTypeConfig();this.reorderModules();if(Object.keys(this.compiled).length){return this}this.options=this.modules.reduce(function(options,module){return module.optionsTransformer(options,_this4)},this.options);this.options.xmlFileNames=uniq(this.options.xmlFileNames);this.xmlDocuments=this.options.xmlFileNames.reduce(function(xmlDocuments,fileName){var content=_this4.zip.files[fileName].asText();xmlDocuments[fileName]=str2xml(content);return xmlDocuments},{});this.setModules({zip:this.zip,xmlDocuments:this.xmlDocuments});this.getTemplatedFiles();this.templatedFiles.forEach(function(fileName){if(_this4.zip.files[fileName]!=null){_this4.precompileFile(fileName)}});this.templatedFiles.forEach(function(fileName){if(_this4.zip.files[fileName]!=null){_this4.compileFile(fileName)}});this.setModules({compiled:this.compiled});verifyErrors(this);return this}},{key:"getRelsTypes",value:function getRelsTypes(){var rootRels=this.zip.files[relsFile];var rootRelsXml=rootRels?str2xml(rootRels.asText()):null;var rootRelationships=rootRelsXml?rootRelsXml.getElementsByTagName("Relationship"):[];var relsTypes={};for(var i=0,len=rootRelationships.length;i0){throwRenderInvalidTemplate()}if(data){this.setData(data)}this.setModules({data:this.data,Lexer:Lexer});this.mapper=this.mapper||this.modules.reduce(function(value,module){return module.getRenderedMap(value)},{});Object.keys(this.mapper).forEach(function(to){var _this7$mapper$to=_this7.mapper[to],from=_this7$mapper$to.from,data=_this7$mapper$to.data;var currentFile=_this7.compiled[from];currentFile.scopeManager=_this7.getScopeManager(to,currentFile,data);currentFile.render(to);_this7.zip.file(to,currentFile.content,{createFolders:true})});verifyErrors(this);this.sendEvent("syncing-zip");this.syncZip();return this}},{key:"syncZip",value:function syncZip(){var _this8=this;Object.keys(this.xmlDocuments).forEach(function(fileName){_this8.zip.remove(fileName);var content=xml2str(_this8.xmlDocuments[fileName]);return _this8.zip.file(fileName,content,{createFolders:true})})}},{key:"setData",value:function setData(data){this.data=data;return this}},{key:"getZip",value:function getZip(){return this.zip}},{key:"createTemplateClass",value:function createTemplateClass(path){var content=this.zip.files[path].asText();return this.createTemplateClassFromContent(content,path)}},{key:"createTemplateClassFromContent",value:function createTemplateClassFromContent(content,filePath){var _this9=this;var xmltOptions={filePath:filePath,contentType:this.filesContentTypes[filePath],relsType:this.relsTypes[filePath]};Object.keys(defaults).concat(["filesContentTypes","fileTypeConfig","fileType","modules"]).forEach(function(key){xmltOptions[key]=_this9[key]});return new Docxtemplater.XmlTemplater(content,xmltOptions)}},{key:"getFullText",value:function getFullText(path){return this.createTemplateClass(path||this.fileTypeConfig.textPath(this)).getFullText()}},{key:"getTemplatedFiles",value:function getTemplatedFiles(){var _this10=this;this.templatedFiles=this.fileTypeConfig.getTemplatedFiles(this.zip);this.targets.forEach(function(target){_this10.templatedFiles.push(target)});this.templatedFiles=uniq(this.templatedFiles);return this.templatedFiles}}]);return Docxtemplater}();function verifyErrors(doc){var compiled=doc.compiled;doc.errors=concatArrays(Object.keys(compiled).map(function(name){return compiled[name].allErrors}));if(doc.errors.length!==0){if(doc.options.errorLogging){logErrors(doc.errors,doc.options.errorLogging)}throwMultiError(doc.errors)}}Docxtemplater.DocUtils=DocUtils;Docxtemplater.Errors=require("./errors.js");Docxtemplater.XmlTemplater=require("./xml-templater.js");Docxtemplater.FileTypeConfig=require("./file-type-config.js");Docxtemplater.XmlMatcher=require("./xml-matcher.js");module.exports=Docxtemplater},{"./collect-content-types.js":1,"./doc-utils.js":2,"./error-logger.js":3,"./errors.js":4,"./file-type-config.js":5,"./lexer.js":8,"./module-wrapper.js":10,"./modules/common.js":11,"./scope-manager.js":22,"./traits.js":23,"./xml-matcher.js":25,"./xml-templater.js":26}]},{},[])("/src/js/docxtemplater.js")});