1 line
84 KiB
JavaScript
1 line
84 KiB
JavaScript
!function(){var e={673:function(e){e.exports={XMLSerializer:window.XMLSerializer,DOMParser:window.DOMParser,XMLDocument:window.XMLDocument}},891:function(e){e.exports=function(e,t,r){for(var n={},o=0,i=e.length;o<i;o++){var a=e[o],s=a.getAttribute("ContentType"),u=a.getAttribute("PartName").substr(1);n[u]=s}for(var l=function(){var e=t[c],o=e.getAttribute("ContentType"),i=e.getAttribute("Extension");r.file(/./).map((function(e){var t=e.name;t.slice(t.length-i.length)!==i||n[t]||"[Content_Types].xml"===t||(n[t]=o)}))},c=0,p=t.length;c<p;c++)l();return n}},356:function(e){e.exports={settingsContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml",coreContentType:"application/vnd.openxmlformats-package.core-properties+xml",appContentType:"application/vnd.openxmlformats-officedocument.extended-properties+xml",customContentType:"application/vnd.openxmlformats-officedocument.custom-properties+xml"}},207:function(e,t,r){function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var o=r(673),i=o.DOMParser,a=o.XMLSerializer,s=r(946).throwXmlTagNotFound,u=r(320),l=u.last,c=u.first,p={},f=[["&","&"],["<","<"],[">",">"],['"',"""],["'","'"]],h=f.map((function(e){var t,r,o=(r=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,r)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=o[0],a=o[1];return{rstart:new RegExp(a,"g"),rend:new RegExp(i,"g"),start:a,end:i}})),d=new RegExp(String.fromCharCode(160),"g");function y(e,t){return e==="</"+t+">"}function v(e,t){return 0===e.indexOf("<"+t)&&-1!==[">"," ","/"].indexOf(e[t.length+1])}function m(e,t,r){"string"==typeof t&&(t=[t]);for(var n=1,o=r,i=e.length;o<i;o++)for(var a=e[o],s=0,u=t.length;s<u;s++){var l=t[s];if(y(a.value,l)&&n--,v(a.value,l)&&n++,0===n)return o}return null}function g(e,t,r){"string"==typeof t&&(t=[t]);for(var n=1,o=r;o>=0;o--)for(var i=e[o],a=0,s=t.length;a<s;a++){var u=t[a];if(v(i.value,u)&&n--,y(i.value,u)&&n++,0===n)return o}return null}function b(e,t){var r=t.type,n=t.tag,o=t.position;return"tag"===r&&n===e&&"start"===o}function w(e,t){var r=t.type,n=t.tag,o=t.position;return"tag"===r&&n===e&&"end"===o}var x=/[\x00-\x08\x0B\x0C\x0E-\x1F]/;e.exports={endsWith:function(e,t){return-1!==e.indexOf(t,e.length-t.length)},startsWith:function(e,t){return e.substring(0,t.length)===t},isContent:function(e){var t=e.type,r=e.position;return"placeholder"===t||"content"===t&&"insidetag"===r},isParagraphStart:function(e){return b("w:p",e)||b("a:p",e)},isParagraphEnd:function(e){return w("w:p",e)||w("a:p",e)},isTagStart:function(e,t){var r=t.type,n=t.tag,o=t.position;return"tag"===r&&n===e&&("start"===o||"selfclosing"===o)},isTagEnd:w,isTextStart:function(e){var t=e.type,r=e.position,n=e.text;return"tag"===t&&"start"===r&&n},isTextEnd:function(e){var t=e.type,r=e.position,n=e.text;return"tag"===t&&"end"===r&&n},isStarting:v,isEnding:y,isModule:function(e,t){var r=e.module,n=e.type;return t instanceof Array||(t=[t]),"placeholder"===n&&-1!==t.indexOf(r)},uniq:function(e){for(var t={},r=[],n=0,o=e.length;n<o;++n)t[e[n]]||(t[e[n]]=!0,r.push(e[n]));return r},getDuplicates:function(e){for(var t=[],r={},n=[],o=0,i=e.length;o<i;++o)r[e[o]]?t.push(e[o]):(r[e[o]]=!0,n.push(e[o]));return t},chunkBy:function(e,t){return e.reduce((function(e,r){var n=l(e),o=t(r);return"start"===o?e.push([r]):"end"===o?(n.push(r),e.push([])):n.push(r),e}),[[]]).filter((function(e){return e.length>0}))},last:l,first:c,xml2str:function(e){return(new a).serializeToString(e).replace(/xmlns(:[a-z0-9]+)?="" ?/g,"")},str2xml:function(e){return 65279===e.charCodeAt(0)&&(e=e.substr(1)),(new i).parseFromString(e,"text/xml")},getRightOrNull:m,getRight:function(e,t,r){var n=m(e,t,r);if(null!==n)return n;s({position:"right",element:t,parsed:e,index:r})},getLeftOrNull:g,getLeft:function(e,t,r){var n=g(e,t,r);if(null!==n)return n;s({position:"left",element:t,parsed:e,index:r})},pregMatchAll:function(e,t){for(var r,n=[];null!=(r=e.exec(t));)n.push({array:r,offset:r.index});return n},convertSpaces:function(e){return e.replace(d," ")},charMapRegexes:h,hasCorruptCharacters:function(e){return x.test(e)},defaults:{errorLogging:"json",paragraphLoop:!1,nullGetter:function(e){return e.module?"":"undefined"},xmlFileNames:["[Content_Types].xml"],parser:function(e){return{get:function(t){return"."===e?t:t?t[e]:t}}},linebreaks:!1,fileTypeConfig:null,delimiters:{start:"{",end:"}"},syntax:{}},wordToUtf8:function(e){for(var t,r=h.length-1;r>=0;r--)t=h[r],e=e.replace(t.rstart,t.end);return e},utf8ToWord:function(e){var t;e=e.toString();for(var r=0,n=h.length;r<n;r++)t=h[r],e=e.replace(t.rend,t.start);return e},concatArrays:function(e){for(var t=[],r=0;r<e.length;r++)for(var n=e[r],o=0,i=n.length;o<i;o++)t.push(n[o]);return t},invertMap:function(e){return Object.keys(e).reduce((function(t,r){var n=e[r];return t[n]=t[n]||[],t[n].push(r),t}),{})},charMap:f,getSingleAttribute:function(e,t){var r=e.indexOf(" ".concat(t,'="'));if(-1===r)return null;var n=e.substr(r).search(/["']/)+r,o=e.substr(n+1).search(/["']/)+n;return e.substr(n+1,o-n)},setSingleAttribute:function(e,t,r){var n;if(p[t]?n=p[t]:(n=new RegExp("(<.* ".concat(t,'=")([^"]*)(".*)$')),p[t]=n),n.test(e))return e.replace(n,"$1".concat(r,"$3"));var o=e.lastIndexOf("/>");return-1===o&&(o=e.lastIndexOf(">")),e.substr(0,o)+" ".concat(t,'="').concat(r,'"')+e.substr(o)},isWhiteSpace:function(e){return/^[ \n\r\t]+$/.test(e)},stableSort:function(e,t){return e.map((function(e,t){return{item:e,index:t}})).sort((function(e,r){return t(e.item,r.item)||e.index-r.index})).map((function(e){return e.item}))}}},807:function(e,t,r){var n=["modules"];function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var s=r(207);s.traits=r(536),s.moduleWrapper=r(899);var u=r(779),l=r(946),c=l.throwMultiError,p=l.throwResolveBeforeCompile,f=l.throwRenderInvalidTemplate,h=l.throwRenderTwice,d=r(460),y=r(891),v=r(438),m=r(263),g=s.defaults,b=s.str2xml,w=s.xml2str,x=s.moduleWrapper,T=s.concatArrays,P=s.uniq,O=s.getDuplicates,S=s.stableSort,j=r(946),E=j.XTInternalError,k=j.throwFileTypeNotIdentified,C=j.throwFileTypeNotHandled,I=j.throwApiVersionError,M=[3,38,0];function A(e){e.modules=e.modules.filter((function(t){if(t.supportedFileTypes){if(!Array.isArray(t.supportedFileTypes))throw new Error("The supportedFileTypes field of the module must be an array");var r=-1!==t.supportedFileTypes.indexOf(e.fileType);return r||t.on("detached"),r}return!0}))}var L=function(){function e(t){var r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=o.modules,a=void 0===i?[]:i,s=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(o,n);if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!Array.isArray(a))throw new Error("The modules argument of docxtemplater's constructor must be an array");if(this.targets=[],this.rendered=!1,this.scopeManagers={},this.compiled={},this.modules=[v()],this.setOptions(s),a.forEach((function(e){r.attachModule(e)})),arguments.length>0){if(!t||!t.files||"function"!=typeof t.file)throw new Error("The first argument of docxtemplater's constructor must be a valid zip file (jszip v2 or pizzip v3)");this.loadZip(t),this.compile(),this.v4Constructor=!0}}return t=e,r=[{key:"verifyApiVersion",value:function(e){return 3!==(e=e.split(".").map((function(e){return parseInt(e,10)}))).length&&I("neededVersion is not a valid version",{neededVersion:e,explanation:"the neededVersion must be an array of length 3"}),e[0]!==M[0]&&I("The major api version do not match, you probably have to update docxtemplater with npm install --save docxtemplater",{neededVersion:e,currentModuleApiVersion:M,explanation:"moduleAPIVersionMismatch : needed=".concat(e.join("."),", current=").concat(M.join("."))}),e[1]>M[1]&&I("The minor api version is not uptodate, you probably have to update docxtemplater with npm install --save docxtemplater",{neededVersion:e,currentModuleApiVersion:M,explanation:"moduleAPIVersionMismatch : needed=".concat(e.join("."),", current=").concat(M.join("."))}),e[1]===M[1]&&e[2]>M[2]&&I("The patch api version is not uptodate, you probably have to update docxtemplater with npm install --save docxtemplater",{neededVersion:e,currentModuleApiVersion:M,explanation:"moduleAPIVersionMismatch : needed=".concat(e.join("."),", current=").concat(M.join("."))}),!0}},{key:"setModules",value:function(e){this.modules.forEach((function(t){t.set(e)}))}},{key:"sendEvent",value:function(e){this.modules.forEach((function(t){t.on(e)}))}},{key:"attachModule",value:function(e){if(this.v4Constructor)throw new E("attachModule() should not be called manually when using the v4 constructor");var t=o(e);if("function"===t)throw new E("Cannot attach a class/function as a module. Most probably you forgot to instantiate the module by using `new` on the module.");if(!e||"object"!==t)throw new E("Cannot attachModule with a falsy value");if(e.requiredAPIVersion&&this.verifyApiVersion(e.requiredAPIVersion),!0===e.attached){if("function"!=typeof e.clone)throw new Error('Cannot attach a module that was already attached : "'.concat(e.name,'". The most likely cause is that you are instantiating the module at the root level, and using it for multiple instances of Docxtemplater'));e=e.clone()}e.attached=!0;var r=x(e);return this.modules.push(r),r.on("attached"),this.fileType&&A(this),this}},{key:"setOptions",value:function(e){var t=this;if(this.v4Constructor)throw new Error("setOptions() should not be called manually when using the v4 constructor");if(!e)throw new Error("setOptions should be called with an object as first parameter");return this.options={},Object.keys(g).forEach((function(r){var n=g[r];t.options[r]=null!=e[r]?e[r]:t[r]||n,t[r]=t.options[r]})),this.delimiters.start=s.utf8ToWord(this.delimiters.start),this.delimiters.end=s.utf8ToWord(this.delimiters.end),this}},{key:"loadZip",value:function(e){if(this.v4Constructor)throw new Error("loadZip() should not be called manually when using the v4 constructor");if(e.loadAsync)throw new E("Docxtemplater doesn't handle JSZip version >=3, please use pizzip");return this.zip=e,this.updateFileTypeConfig(),this.modules=T([this.fileTypeConfig.baseModules.map((function(e){return e()})),this.modules]),A(this),this}},{key:"precompileFile",value:function(e){var t=this.createTemplateClass(e);t.preparse(),this.compiled[e]=t}},{key:"compileFile",value:function(e){this.compiled[e].parse()}},{key:"getScopeManager",value:function(e,t,r){return this.scopeManagers[e]||(this.scopeManagers[e]=u({tags:r,parser:this.parser,cachedParsers:t.cachedParsers})),this.scopeManagers[e]}},{key:"resolveData",value:function(e){var t=this,r=[];return Object.keys(this.compiled).length||p(),Promise.resolve(e).then((function(e){return t.setData(e),t.setModules({data:t.data,Lexer:m}),t.mapper=t.modules.reduce((function(e,t){return t.getRenderedMap(e)}),{}),Promise.all(Object.keys(t.mapper).map((function(e){var n=t.mapper[e],o=n.from,i=n.data;return Promise.resolve(i).then((function(n){var i=t.compiled[o];return i.filePath=e,i.scopeManager=t.getScopeManager(e,i,n),i.resolveTags(n).then((function(e){return i.scopeManager.finishedResolving=!0,e}),(function(e){Array.prototype.push.apply(r,e)}))}))}))).then((function(e){return 0!==r.length&&(t.options.errorLogging&&d(r,t.options.errorLogging),c(r)),T(e)}))}))}},{key:"reorderModules",value:function(){this.modules=S(this.modules,(function(e,t){return(t.priority||0)-(e.priority||0)}))}},{key:"throwIfDuplicateModules",value:function(){var e=O(this.modules.map((function(e){return e.name})));if(e.length>0)throw new E('Detected duplicate module "'.concat(e[0],'"'))}},{key:"compile",value:function(){var e=this;return this.updateFileTypeConfig(),this.throwIfDuplicateModules(),this.reorderModules(),Object.keys(this.compiled).length||(this.options=this.modules.reduce((function(t,r){return r.optionsTransformer(t,e)}),this.options),this.options.xmlFileNames=P(this.options.xmlFileNames),this.xmlDocuments=this.options.xmlFileNames.reduce((function(t,r){var n=e.zip.files[r].asText();return t[r]=b(n),t}),{}),this.setModules({zip:this.zip,xmlDocuments:this.xmlDocuments}),this.getTemplatedFiles(),this.templatedFiles.forEach((function(t){null!=e.zip.files[t]&&e.precompileFile(t)})),this.templatedFiles.forEach((function(t){null!=e.zip.files[t]&&e.compileFile(t)})),this.setModules({compiled:this.compiled}),_(this)),this}},{key:"getRelsTypes",value:function(){for(var e=this.zip.files["_rels/.rels"],t=e?b(e.asText()):null,r=t?t.getElementsByTagName("Relationship"):[],n={},o=0,i=r.length;o<i;o++){var a=r[o];n[a.getAttribute("Target")]=a.getAttribute("Type")}return n}},{key:"getContentTypes",value:function(){var e=this.zip.files["[Content_Types].xml"],t=e?b(e.asText()):null;return{overrides:t?t.getElementsByTagName("Override"):null,defaults:t?t.getElementsByTagName("Default"):null,contentTypes:e,contentTypeXml:t}}},{key:"updateFileTypeConfig",value:function(){var t,r=this;this.zip.files.mimetype&&(t="odt"),this.relsTypes=this.getRelsTypes();var n=this.getContentTypes(),o=n.overrides,i=n.defaults,a=n.contentTypes,u=n.contentTypeXml;return u&&(this.filesContentTypes=y(o,i,this.zip),this.invertedContentTypes=s.invertMap(this.filesContentTypes),this.setModules({contentTypes:this.contentTypes,invertedContentTypes:this.invertedContentTypes})),this.modules.forEach((function(e){t=e.getFileType({zip:r.zip,contentTypes:a,contentTypeXml:u,overrides:o,defaults:i,doc:r})||t})),"odt"===t&&C(t),t||k(),this.fileType=t,A(this),this.fileTypeConfig=this.options.fileTypeConfig||this.fileTypeConfig||e.FileTypeConfig[this.fileType](),this}},{key:"renderAsync",value:function(e){var t=this;return this.resolveData(e).then((function(){return t.render()}))}},{key:"render",value:function(e){var t=this;return this.rendered&&h(),this.rendered=!0,this.compile(),this.errors.length>0&&f(),e&&this.setData(e),this.setModules({data:this.data,Lexer:m}),this.mapper=this.mapper||this.modules.reduce((function(e,t){return t.getRenderedMap(e)}),{}),Object.keys(this.mapper).forEach((function(e){var r=t.mapper[e],n=r.from,o=r.data,i=t.compiled[n];i.scopeManager=t.getScopeManager(e,i,o),i.render(e),t.zip.file(e,i.content,{createFolders:!0})})),_(this),this.sendEvent("syncing-zip"),this.syncZip(),this}},{key:"syncZip",value:function(){var e=this;Object.keys(this.xmlDocuments).forEach((function(t){e.zip.remove(t);var r=w(e.xmlDocuments[t]);return e.zip.file(t,r,{createFolders:!0})}))}},{key:"setData",value:function(e){return this.data=e,this}},{key:"getZip",value:function(){return this.zip}},{key:"createTemplateClass",value:function(e){var t=this.zip.files[e].asText();return this.createTemplateClassFromContent(t,e)}},{key:"createTemplateClassFromContent",value:function(t,r){var n=this,o={filePath:r,contentType:this.filesContentTypes[r],relsType:this.relsTypes[r]};return Object.keys(g).concat(["filesContentTypes","fileTypeConfig","fileType","modules"]).forEach((function(e){o[e]=n[e]})),new e.XmlTemplater(t,o)}},{key:"getFullText",value:function(e){return this.createTemplateClass(e||this.fileTypeConfig.textPath(this)).getFullText()}},{key:"getTemplatedFiles",value:function(){var e=this;return this.templatedFiles=this.fileTypeConfig.getTemplatedFiles(this.zip),this.targets.forEach((function(t){e.templatedFiles.push(t)})),this.templatedFiles=P(this.templatedFiles),this.templatedFiles}}],r&&i(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r}();function _(e){var t=e.compiled;e.errors=T(Object.keys(t).map((function(e){return t[e].allErrors}))),0!==e.errors.length&&(e.options.errorLogging&&d(e.errors,e.options.errorLogging),c(e.errors))}L.DocUtils=s,L.Errors=r(946),L.XmlTemplater=r(245),L.FileTypeConfig=r(271),L.XmlMatcher=r(367),e.exports=L,e.exports.default=L},460:function(e){function t(e,t){return t instanceof Error?Object.getOwnPropertyNames(t).concat("stack").reduce((function(e,r){return e[r]=t[r],"stack"===r&&(e[r]=t[r].toString()),e}),{}):t}e.exports=function(e,r){if(console.log(JSON.stringify({error:e},t,"json"===r?2:null)),e.properties&&e.properties.errors instanceof Array){var n=e.properties.errors.map((function(e){return e.properties.explanation})).join("\n");console.log("errorMessages",n)}}},946:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var i=r(320),a=i.last,s=i.first;function u(e){this.name="GenericError",this.message=e,this.stack=new Error(e).stack}function l(e){this.name="TemplateError",this.message=e,this.stack=new Error(e).stack}function c(e){this.name="RenderingError",this.message=e,this.stack=new Error(e).stack}function p(e){this.name="ScopeParserError",this.message=e,this.stack=new Error(e).stack}function f(e){this.name="InternalError",this.properties={explanation:"InternalError"},this.message=e,this.stack=new Error(e).stack}function h(e){this.name="APIVersionError",this.properties={explanation:"APIVersionError"},this.message=e,this.stack=new Error(e).stack}u.prototype=Error.prototype,l.prototype=new u,c.prototype=new u,p.prototype=new u,f.prototype=new u,h.prototype=new u,e.exports={XTError:u,XTTemplateError:l,XTInternalError:f,XTScopeParserError:p,XTAPIVersionError:h,RenderingError:c,XTRenderingError:c,getClosingTagNotMatchOpeningTag:function(e){var t=e.tags,r=new l("Closing tag does not match opening tag");return r.properties={id:"closing_tag_does_not_match_opening_tag",explanation:'The tag "'.concat(t[0].value,'" is closed by the tag "').concat(t[1].value,'"'),openingtag:s(t).value,offset:[s(t).offset,a(t).offset],closingtag:a(t).value},r},getLoopPositionProducesInvalidXMLError:function(e){var t=e.tag,r=e.offset,n=new l('The position of the loop tags "'.concat(t,'" would produce invalid XML'));return n.properties={xtag:t,id:"loop_position_invalid",explanation:'The tags "'.concat(t,'" are misplaced in the document, for example one of them is in a table and the other one outside the table'),offset:r},n},getScopeCompilationError:function(e){var t=e.tag,r=e.rootError,n=e.offset,o=new p("Scope parser compilation failed");return o.properties={id:"scopeparser_compilation_failed",offset:n,xtag:t,explanation:'The scope parser for the tag "'.concat(t,'" failed to compile'),rootError:r},o},getScopeParserExecutionError:function(e){var t=e.tag,r=e.scope,n=e.error,o=e.offset,i=new p("Scope parser execution failed");return i.properties={id:"scopeparser_execution_failed",explanation:"The scope parser for the tag ".concat(t," failed to execute"),scope:r,offset:o,xtag:t,rootError:n},i},getUnclosedTagException:function(e){var t=new l("Unclosed tag");return t.properties={xtag:s(e.xtag.split(" ")).substr(1),id:"unclosed_tag",context:e.xtag,offset:e.offset,lIndex:e.lIndex,explanation:'The tag beginning with "'.concat(e.xtag.substr(0,10),'" is unclosed')},t},getUnopenedTagException:function(e){var t=new l("Unopened tag");return t.properties={xtag:a(e.xtag.split(" ")),id:"unopened_tag",context:e.xtag,offset:e.offset,lIndex:e.lIndex,explanation:'The tag beginning with "'.concat(e.xtag.substr(0,10),'" is unopened')},t},getUnmatchedLoopException:function(e){var t=e.location,r=e.offset,n=e.square,o="start"===t?"unclosed":"unopened",i=new l("".concat("start"===t?"Unclosed":"Unopened"," loop")),a=e.value;return i.properties={id:"".concat(o,"_loop"),explanation:'The loop with tag "'.concat(a,'" is ').concat(o),xtag:a,offset:r},n&&(i.properties.square=n),i},getDuplicateCloseTagException:function(e){var t=new l("Duplicate close tag, expected one close tag");return t.properties={xtag:s(e.xtag.split(" ")),id:"duplicate_close_tag",context:e.xtag,offset:e.offset,lIndex:e.lIndex,explanation:'The tag ending with "'.concat(e.xtag.substr(0,10),'" has duplicate close tags')},t},getDuplicateOpenTagException:function(e){var t=new l("Duplicate open tag, expected one open tag");return t.properties={xtag:s(e.xtag.split(" ")),id:"duplicate_open_tag",context:e.xtag,offset:e.offset,lIndex:e.lIndex,explanation:'The tag beginning with "'.concat(e.xtag.substr(0,10),'" has duplicate open tags')},t},getCorruptCharactersException:function(e){var t=e.tag,r=e.value,n=e.offset,o=new c("There are some XML corrupt characters");return o.properties={id:"invalid_xml_characters",xtag:t,value:r,offset:n,explanation:"There are some corrupt characters for the field ".concat(t)},o},getInvalidRawXMLValueException:function(e){var t=e.tag,r=e.value,n=e.offset,o=new c("Non string values are not allowed for rawXML tags");return o.properties={id:"invalid_raw_xml_value",xtag:t,value:r,offset:n,explanation:"The value of the raw tag : '".concat(t,"' is not a string")},o},getUnbalancedLoopException:function(e,t){var r=new l("Unbalanced loop tag"),n=t[0].part.value,o=t[1].part.value,i=e[0].part.value,a=e[1].part.value;return r.properties={id:"unbalanced_loop_tags",explanation:"Unbalanced loop tags {#".concat(n,"}{/").concat(o,"}{#").concat(i,"}{/").concat(a,"}"),offset:[t[0].part.offset,e[1].part.offset],lastPair:{left:t[0].part.value,right:t[1].part.value},pair:{left:e[0].part.value,right:e[1].part.value}},r},throwApiVersionError:function(e,t){var r=new h(e);throw r.properties=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){var o,i,a,s;o=e,i=t,a=r[t],s=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(i),(i="symbol"==n(s)?s:s+"")in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:"api_version_error"},t),r},throwFileTypeNotHandled:function(e){var t=new f('The filetype "'.concat(e,'" is not handled by docxtemplater'));throw t.properties={id:"filetype_not_handled",explanation:'The file you are trying to generate is of type "'.concat(e,'", but only docx and pptx formats are handled'),fileType:e},t},throwFileTypeNotIdentified:function(){var e=new f("The filetype for this file could not be identified, is this file corrupted ?");throw e.properties={id:"filetype_not_identified",explanation:"The filetype for this file could not be identified, is this file corrupted ?"},e},throwMalformedXml:function(){var e=new f("Malformed xml");throw e.properties={explanation:"The template contains malformed xml",id:"malformed_xml"},e},throwMultiError:function(e){var t=new l("Multi error");throw t.properties={errors:e,id:"multi_error",explanation:"The template has multiple errors"},t},throwExpandNotFound:function(e){var t=e.part,r=t.value,n=t.offset,o=e.id,i=void 0===o?"raw_tag_outerxml_invalid":o,a=e.message,s=void 0===a?"Raw tag not in paragraph":a,u=e.part,c=e.explanation,p=void 0===c?'The tag "'.concat(r,'" is not inside a paragraph'):c;"function"==typeof p&&(p=p(u));var f=new l(s);throw f.properties={id:i,explanation:p,rootError:e.rootError,xtag:r,offset:n,postparsed:e.postparsed,expandTo:e.expandTo,index:e.index},f},throwRawTagShouldBeOnlyTextInParagraph:function(e){var t=new l("Raw tag should be the only text in paragraph"),r=e.part.value;throw t.properties={id:"raw_xml_tag_should_be_only_text_in_paragraph",explanation:'The raw tag "'.concat(r,'" should be the only text in this paragraph. This means that this tag should not be surrounded by any text or spaces.'),xtag:r,offset:e.part.offset,paragraphParts:e.paragraphParts},t},throwUnimplementedTagType:function(e,t){var r='Unimplemented tag type "'.concat(e.type,'"');e.module&&(r+=' "'.concat(e.module,'"'));var n=new l(r);throw n.properties={part:e,index:t,id:"unimplemented_tag_type"},n},throwXmlTagNotFound:function(e){var t=new l('No tag "'.concat(e.element,'" was found at the ').concat(e.position)),r=e.parsed[e.index];throw t.properties={id:"no_xml_tag_found_at_".concat(e.position),explanation:'No tag "'.concat(e.element,'" was found at the ').concat(e.position),offset:r.offset,part:r,parsed:e.parsed,index:e.index,element:e.element},t},throwXmlInvalid:function(e,t){var r=new l("An XML file has invalid xml");throw r.properties={id:"file_has_invalid_xml",content:e,offset:t,explanation:"The docx contains invalid XML, it is most likely corrupt"},r},throwResolveBeforeCompile:function(){var e=new f("You must run `.compile()` before running `.resolveData()`");throw e.properties={id:"resolve_before_compile",explanation:"You must run `.compile()` before running `.resolveData()`"},e},throwRenderInvalidTemplate:function(){var e=new f("You should not call .render on a document that had compilation errors");throw e.properties={id:"render_on_invalid_template",explanation:"You should not call .render on a document that had compilation errors"},e},throwRenderTwice:function(){var e=new f("You should not call .render twice on the same docxtemplater instance");throw e.properties={id:"render_twice",explanation:"You should not call .render twice on the same docxtemplater instance"},e}}},271:function(e,t,r){var n=r(885),o=r(522),i=r(60),a=r(201),s=r(307);e.exports={docx:function(){return{getTemplatedFiles:function(){return[]},textPath:function(e){return e.textTarget},tagsXmlTextArray:["Company","HyperlinkBase","Manager","cp:category","cp:keywords","dc:creator","dc:description","dc:subject","dc:title","cp:contentStatus","w:t","m:t","vt:lpstr","vt:lpwstr"],tagsXmlLexedArray:["w:proofState","w:tc","w:tr","w:tbl","w:body","w:document","w:p","w:r","w:br","w:rPr","w:pPr","w:spacing","w:sdtContent","w:sdt","w:drawing","w:sectPr","w:type","w:headerReference","w:footerReference","w:bookmarkStart","w:bookmarkEnd","w:commentRangeStart","w:commentRangeEnd","w:commentReference"],droppedTagsInsidePlaceholder:["w:p","w:br","w:bookmarkStart","w:bookmarkEnd"],expandTags:[{contains:"w:tc",expand:"w:tr"}],onParagraphLoop:[{contains:"w:p",expand:"w:p",onlyTextInTag:!0}],tagRawXml:"w:p",baseModules:[n,o,a,i,s],tagShouldContain:[{tag:"w:tbl",shouldContain:["w:tr"],drop:!0},{tag:"w:tc",shouldContain:["w:p"],value:"<w:p></w:p>"},{tag:"w:sdtContent",shouldContain:["w:p","w:r","w:commentRangeStart","w:sdt"],value:"<w:p></w:p>"}]}},pptx:function(){return{getTemplatedFiles:function(){return[]},textPath:function(e){return e.textTarget},tagsXmlTextArray:["Company","HyperlinkBase","Manager","cp:category","cp:keywords","dc:creator","dc:description","dc:subject","dc:title","a:t","m:t","vt:lpstr","vt:lpwstr"],tagsXmlLexedArray:["p:sp","a:tc","a:tr","a:tbl","a:graphicData","a:p","a:r","a:rPr","p:txBody","a:txBody","a:off","a:ext","p:graphicFrame","p:xfrm","a16:rowId","a:endParaRPr"],droppedTagsInsidePlaceholder:["a:p","a:endParaRPr"],expandTags:[{contains:"a:tc",expand:"a:tr"}],onParagraphLoop:[{contains:"a:p",expand:"a:p",onlyTextInTag:!0}],tagRawXml:"p:sp",baseModules:[n,a,i,s],tagShouldContain:[{tag:"a:tbl",shouldContain:["a:tr"],dropParent:"p:graphicFrame"},{tag:"p:txBody",shouldContain:["a:p"],value:"<a:p></a:p>"},{tag:"a:txBody",shouldContain:["a:p"],value:"<a:p></a:p>"}]}}}},322:function(e){var t=["application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml","application/vnd.ms-word.document.macroEnabled.main+xml","application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml","application/vnd.ms-word.template.macroEnabledTemplate.main+xml"],r={main:t,docx:["application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml"].concat(t,["application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml","application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml","application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml"]),pptx:["application/vnd.openxmlformats-officedocument.presentationml.slide+xml","application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml","application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml","application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml"]};e.exports=r},830:function(e){e.exports=function(e,t){if(null==e.lIndex)return null;var r=t.scopeManager.scopePathItem;return e.parentPart&&(r=r.slice(0,r.length-1)),t.filePath+"@"+e.lIndex.toString()+"-"+r.join("-")}},208:function(e,t,r){var n=r(207),o=n.startsWith,i=n.endsWith,a=n.isStarting,s=n.isEnding,u=n.isWhiteSpace,l=r(322);e.exports=function(e,t){var r=t.fileTypeConfig.tagShouldContain||[],n="",c=-1;-1!==l.docx.indexOf(t.contentType)&&(e=function(e){for(var t="",r=0,n=e.length;r<n;r++){var a=e[r];u(a)||(i(t,"</w:tbl>")&&(o(a,"<w:p")||o(a,"<w:tbl")||o(a,"<w:sectPr")||(a="<w:p/>".concat(a))),t=a,e[r]=a)}return e}(e));for(var p=-1,f=0,h=e.length;f<h;f++)for(var d=e[f],y=0,v=r.length;y<v;y++){var m=r[y],g=m.tag,b=m.shouldContain,w=m.value,x=m.drop,T=m.dropParent;if(c===y){if(s(d,g)){if(c=-1,T){for(var P=void 0,O=void 0,S=p;S>0;S--)if(a(e[S],T)){P=S;break}for(var j=f;j<e.length;j++)if(s(e[j],T)){O=j;break}for(var E=P;E<=O;E++)e[E]=""}else if(x)for(var k=p;k<=f;k++)e[k]="";else{for(var C=p;C<f;C++)e[C]="";e[f]=n+w+d}break}n+=d;for(var I=0,M=b.length;I<M;I++){var A=b[I];if(a(d,A)){c=-1;break}}break}if(-1===c&&a(d,g)&&-1===d.substr(1).indexOf("<")){if("/"===d[d.length-2]){e[f]="";break}p=f,c=y,n=d;break}}return e}},263:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e,t)||function(){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 i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){var o,i,a,s;o=e,i=t,a=r[t],s=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(i),(i="symbol"==n(s)?s:s+"")in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var u=r(946),l=u.getUnclosedTagException,c=u.getUnopenedTagException,p=u.getDuplicateOpenTagException,f=u.getDuplicateCloseTagException,h=u.throwMalformedXml,d=u.throwXmlInvalid,y=u.XTTemplateError,v=r(207),m=v.isTextStart,g=v.isTextEnd,b=v.wordToUtf8,w=0,x=1,T=2,P=3;function O(e,t){return e[0]<=t.offset&&t.offset<e[1]}function S(e){var t="",r=1,n=e.indexOf(" ");return"/"===e[e.length-2]?(t="selfclosing",-1===n&&(n=e.length-2)):"/"===e[1]?(r=2,t="end",-1===n&&(n=e.length-1)):(t="start",-1===n&&(n=e.length-1)),{tag:e.slice(r,n),position:t}}function j(e,t){return-1===e&&-1===t?w:e===t?x:-1===e||-1===t?t<e?T:P:e<t?T:P}function E(e){var t=e.split(" ");if(2!==t.length){var r=new y("New Delimiters cannot be parsed");throw r.properties={id:"change_delimiters_invalid",explanation:"Cannot parser delimiters"},r}var n=o(t,2),i=n[0],a=n[1];if(0===i.length||0===a.length){var s=new y("New Delimiters cannot be parsed");throw s.properties={id:"change_delimiters_invalid",explanation:"Cannot parser delimiters"},s}return[i,a]}function k(e,t,r){var n=e.map((function(e){return e.value})).join(""),i=function(e,t){for(var r=[],n=t.start,i=t.end,a=-1,s=!1;;){var u=e.indexOf(n,a+1),l=e.indexOf(i,a+1),c=null,p=void 0,f=j(u,l);switch(f===x&&(f=s?P:T),f){case w:return r;case P:s=!1,a=l,c="end",p=i.length;break;case T:s=!0,a=u,c="start",p=n.length}if(f!==T||"="!==e[a+n.length])r.push({offset:a,position:c,length:p});else{r.push({offset:u,position:"start",length:n.length,changedelimiter:!0});var h=e.indexOf("=",a+n.length+1),d=e.indexOf(i,h+1);r.push({offset:d,position:"end",length:i.length,changedelimiter:!0});var y=o(E(e.substr(a+n.length+1,h-a-n.length-1)),2);n=y[0],i=y[1],a=d}}}(n,t),a=0,u=e.map((function(e){return{offset:(a+=e.value.length)-e.value.length,lIndex:e.lIndex}})),h=function(e,t,r){var n,o=[],i=!1,a={offset:0},u=e.reduce((function(e,u){var h=u.position,d=u.offset,y=a.offset,v=a.length;return n=t.substr(y,d-y),i&&"start"===h?y+v===d?(n=t.substr(y,d-y+v+4),o.push(p({xtag:n,offset:y})),a=u,e.push(s(s({},u),{},{error:!0})),e):(o.push(l({xtag:b(n),offset:y})),a=u,e.push(s(s({},u),{},{error:!0})),e):i||"end"!==h?(i=!i,a=u,e.push(u),e):r.allowUnopenedTag?e:y+v===d?(n=t.substr(y-4,d-y+v+4),o.push(f({xtag:n,offset:y})),a=u,e.push(s(s({},u),{},{error:!0})),e):(o.push(c({xtag:n,offset:d})),a=u,e.push(s(s({},u),{},{error:!0})),e)}),[]);if(i){var h=a.offset;n=t.substr(h,t.length-h),o.push(l({xtag:b(n),offset:h}))}return{delimiterWithErrors:u,errors:o}}(i,n,r),d=h.delimiterWithErrors,y=h.errors,v=0,m=0,g=u.map((function(t,r){for(var n=t.offset,o=[n,n+e[r].value.length],i=e[r].value,a=[];m<d.length&&O(o,d[m]);)a.push(d[m]),m++;var s=[],u=0;v>0&&(u=v,v=0),a.forEach((function(e){var t=i.substr(u,e.offset-n-u);if(e.changedelimiter)"start"===e.position?t.length>0&&s.push({type:"content",value:t}):u=e.offset-n+e.length;else{t.length>0&&(s.push({type:"content",value:t}),u+=t.length);var r={type:"delimiter",position:e.position,offset:u+n};s.push(r),u=e.offset-n+e.length}})),v=u-i.length;var l=i.substr(u);return l.length>0&&s.push({type:"content",value:l}),s}),this);return{parsed:g,errors:y}}function C(e){return"content"===e.type&&"insidetag"===e.position}e.exports={parseDelimiters:k,parse:function(e,t,r,n){!function(e,t){var r=!1;e.forEach((function(e){r=function(e,t){return m(e)?(t&&h(),!0):g(e)?(t||h(),!1):t}(e,r),"content"===e.type&&(e.position=r?"insidetag":"outsidetag"),"text"!==t&&C(e)&&(e.value=e.value.replace(/>/g,">"))}))}(e,n);var o=k(e.filter(C),t,r),i=o.parsed,a=o.errors,s=[],u=0,l=0;return e.forEach((function(e){C(e)?(Array.prototype.push.apply(s,i[u].map((function(e){return"content"===e.type&&(e.position="insidetag"),e.lIndex=l++,e}))),u++):(e.lIndex=l++,s.push(e))})),{errors:a,lexed:s}},xmlparse:function(e,t){var r=function(e,t,r){for(var n=0,o=e.length,i={},a=0,s=t.length;a<s;a++)i[t[a]]=!0;for(var u=0,l=r.length;u<l;u++)i[r[u]]=!1;for(var c=[];n<o&&-1!==(n=e.indexOf("<",n));){var p=n,f=e.indexOf("<",n+1);(-1===(n=e.indexOf(">",n))||-1!==f&&n>f)&&d(e,p);var h=e.slice(p,n+1),y=S(h),v=y.tag,m=y.position,g=i[v];null!=g&&c.push({type:"tag",position:m,text:g,offset:p,value:h,tag:v})}return c}(e,t.text,t.other),n=0,o=r.reduce((function(t,r){var o=e.substr(n,r.offset-n);return o.length>0&&t.push({type:"content",value:o}),n=r.offset+r.value.length,delete r.offset,t.push(r),t}),[]),i=e.substr(n);return i.length>0&&o.push({type:"content",value:i}),o}}},798:function(e){function t(e,t){for(var r=-1,n=0,o=e.length;n<o;n++)t[n]>=e[n].length||(-1===r||e[n][t[n]].offset<e[r][t[r]].offset)&&(r=n);return r}e.exports=function(e){var r=e.reduce((function(e,t){return e+t.length}),0);e=e.filter((function(e){return e.length>0}));for(var n=new Array(r),o=e.map((function(){return 0})),i=0;i<r;i++){var a=t(e,o);n[i]=e[a][o[a]],o[a]++}return n}},899:function(e,t,r){var n=r(946).XTInternalError;function o(){}function i(e){return e}e.exports=function(e){var t={set:o,matchers:function(){return[]},parse:o,render:o,getTraits:o,getFileType:o,nullGetter:o,optionsTransformer:i,postrender:i,errorsTransformer:i,getRenderedMap:i,preparse:i,postparse:i,on:o,resolve:o,preResolve:o};if(Object.keys(t).every((function(t){return!e[t]}))){var r=new n("This module cannot be wrapped, because it doesn't define any of the necessary functions");throw r.properties={id:"module_cannot_be_wrapped",explanation:"This module cannot be wrapped, because it doesn't define any of the necessary functions"},r}return Object.keys(t).forEach((function(r){e[r]=e[r]||t[r]})),e}},438:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}var a=r(899),s=r(322),u=r(356),l=[u.settingsContentType,u.coreContentType,u.appContentType,u.customContentType],c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="Common"},(t=[{key:"getFileType",value:function(e){var t=e.doc,r=t.invertedContentTypes;if(r){for(var n=0,o=l.length;n<o;n++){var i=l[n];r[i]&&Array.prototype.push.apply(t.targets,r[i])}for(var a,u=["docx","pptx"],c=0,p=u.length;c<p;c++){for(var f=s[u[c]],h=0,d=f.length;h<d;h++){var y=f[h];if(r[y])for(var v=0,m=r[y].length;v<m;v++){var g=r[y][v];t.relsTypes[g]&&-1===["http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument","http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"].indexOf(t.relsTypes[g])||(a=u[c],-1===s.main.indexOf(y)&&y!==s.pptx[0]||t.textTarget||(t.textTarget=g),t.targets.push(g))}}if(a)return a}return a}}}])&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();e.exports=function(){return a(new c)}},201:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}var a=r(798),s=r(207),u=s.getLeft,l=s.getRight,c=r(899),p=r(536).getExpandToDefault,f=r(946),h=f.getUnmatchedLoopException,d=f.getClosingTagNotMatchOpeningTag,y=f.getUnbalancedLoopException;function v(e){switch(e.location){case"start":return 1;case"end":return-1}}function m(e,t){return null!=e&&null!=t&&("start"===e.part.location&&"end"===t.part.location&&e.part.value===t.part.value||""===t.part.value)}function g(e){for(var t=0,r=[];t<e.length;){var n=e[t].part;if("end"===n.location){if(0===t)return e.splice(0,1),r.push(h(n)),{traits:e,errors:r};var o=t,i=t-1,a=1;if(m(e[i],e[o]))return e.splice(o,1),e.splice(i,1),{errors:r,traits:e};for(;a<50;){var s=e[i-a],u=e[o+a];if(m(s,e[o]))return e.splice(o,1),e.splice(i-a,1),{errors:r,traits:e};if(m(e[i],u))return e.splice(o+a,1),e.splice(i,1),{errors:r,traits:e};a++}return r.push(d({tags:[e[i].part,e[o].part]})),e.splice(o,1),e.splice(i,1),{traits:e,errors:r}}t++}return e.forEach((function(e){var t=e.part;r.push(h(t))})),{traits:[],errors:r}}var b=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="ExpandPairTrait"},(t=[{key:"optionsTransformer",value:function(e,t){return this.expandTags=t.fileTypeConfig.expandTags.concat(t.options.paragraphLoop?t.fileTypeConfig.onParagraphLoop:[]),e}},{key:"postparse",value:function(e,t){var r=this,n=t.getTraits,o=t.postparse,i=t.fileType,s=n("expandPair",e);s=s.map((function(e){return e||[]}));var c=function(e){for(var t={},r=[],n=[],o=[],i=0;i<e.length;i++)o.push(e[i]);for(;o.length>0;){var a=g(o);r=r.concat(a.errors),o=a.traits}if(r.length>0)return{pairs:n,errors:r};for(var s=0,u=0;u<e.length;u++){var l=e[u],c=v(l.part);if(s+=c,1===c)t[s]=l;else{var p=t[s+1];0===s&&(n=n.concat([[p,l]]))}s=s>=0?s:0}return{pairs:n,errors:r}}(s=a(s)),f=c.pairs,h=c.errors,d=0,m=null,b=f.map((function(t){var n,o,a=t[0].part.expandTo;if("auto"===a&&"text"!==i){var s=p(e,t,r.expandTags);s.error&&h.push(s.error),a=s.value}if(!a||"text"===i){var c=t[0].offset,f=t[1].offset;return c<d&&h.push(y(t,m)),m=t,d=f,[c,f]}try{n=u(e,a,t[0].offset)}catch(e){h.push(e)}try{o=l(e,a,t[1].offset)}catch(e){h.push(e)}return n<d&&h.push(y(t,m)),d=o,m=t,[n,o]}));if(h.length>0)return{postparsed:e,errors:h};var w,x=0;return{postparsed:e.reduce((function(t,r,n){var i=x<f.length&&b[x][0]<=n&&n<=b[x][1],a=f[x],s=b[x];if(!i)return t.push(r),t;if(s[0]===n&&(w=[]),a[0].offset!==n&&a[1].offset!==n&&w.push(r),s[1]===n){var u=e[a[0].offset];u.subparsed=o(w,{basePart:u}),u.endLindex=a[1].part.lIndex,delete u.location,delete u.expandTo,t.push(u),x++}return t}),[]),errors:h}}}])&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();e.exports=function(){return c(new b)}},885:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){var n,o,i;n=e,o=t,i=r[t],(o=l(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function a(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function l(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}var c=r(207),p=c.chunkBy,f=c.last,h=c.isParagraphStart,d=c.isModule,y=c.isParagraphEnd,v=c.isContent,m=c.startsWith,g=c.isTagEnd,b=c.isTagStart,w=c.getSingleAttribute,x=c.setSingleAttribute,T=r(322),P=r(899),O="loop";function S(e){var t=function(e){for(var t=0,r=e.length;t<r;t++)if("content"!==e[t].type)return e[t];return null}(e.subparsed);return null!=t&&"w:t"!==t.tag}function j(e){return e.hasPageBreak&&S(e)?'<w:p><w:r><w:br w:type="page"/></w:r></w:p>':""}function E(e){return e.some((function(e){return v(e)}))?0:e.length}function k(e){var t=e.parts.length-1;"</w:p>"===e.parts[t]?e.parts.splice(t,0,'<w:r><w:br w:type="page"/></w:r>'):e.parts.push('<w:p><w:r><w:br w:type="page"/></w:r></w:p>')}function C(e){return e.some((function(e){return"w:br"===e.tag&&-1!==e.value.indexOf('w:type="page"')}))}function I(e){return e.some((function(e){return"w:drawing"===e.tag}))}var M=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="LoopModule",this.inXfrm=!1,this.totalSectPr=0,this.prefix={start:"#",end:"/",dash:/^-([^\s]+)\s(.+)/,inverted:"^"}},t=[{key:"optionsTransformer",value:function(e,t){return this.docxtemplater=t,e}},{key:"preparse",value:function(e,t){var r,n,o=t.contentType;-1!==T.main.indexOf(o)&&(this.sects=(r=!1,n=[],e.forEach((function(e){b("w:sectPr",e)&&(n.push([]),r=!0),r&&n[n.length-1].push(e),g("w:sectPr",e)&&(r=!1)})),n))}},{key:"matchers",value:function(){var e=O;return[[this.prefix.start,e,{expandTo:"auto",location:"start",inverted:!1}],[this.prefix.inverted,e,{expandTo:"auto",location:"start",inverted:!0}],[this.prefix.end,e,{location:"end"}],[this.prefix.dash,e,function(e){var t,r,n=(r=3,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,r)||a(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());return{location:"start",inverted:!1,expandTo:n[1],value:n[2]}}]]}},{key:"getTraits",value:function(e,t){if("expandPair"===e)return t.reduce((function(e,t,r){return d(t,O)&&null==t.subparsed&&e.push({part:t,offset:r}),e}),[])}},{key:"postparse",value:function(e,t){var r=t.basePart;if(r&&"docx"===this.docxtemplater.fileType&&e.length>0){r.sectPrCount=function(e){var t=!1,r=0;return e.forEach((function(e){b("w:sectPr",e)&&(t=!0),t&&("w:headerReference"!==e.tag&&"w:footerReference"!==e.tag||(r++,t=!1)),g("w:sectPr",e)&&(t=!1)})),r}(e),this.totalSectPr+=r.sectPrCount;var n=this.sects;n.some((function(t,o){return r.lIndex<t[0].lIndex?(o+1<n.length&&n[o+1].some((function(e){return b("w:type",e)&&-1!==e.value.indexOf("continuous")}))&&(r.addContinuousType=!0),!0):e[0].lIndex<t[0].lIndex&&t[0].lIndex<r.lIndex?(n[o].some((function(e){return b("w:type",e)&&-1!==e.value.indexOf('w:val="nextPage"')}))&&(r.addNextPage={index:o}),!0):void 0})),r.lastParagrapSectPr=function(e){for(var t=[],r=!1,n=e.length-1;n>=0;n--){var o=e[n];if(g("w:sectPr",o)&&(r=!0),b("w:sectPr",o)&&(t.unshift(o.value),r=!1),r&&t.unshift(o.value),h(o)){if(t.length>0)return t.join("");break}}return""}(e)}if(!r||"auto"!==r.expandTo||r.module!==O||!function(e){return e.length&&h(e[0])&&y(f(e))}(e))return e;r.paragraphLoop=!0;var o=0,i=p(e,(function(e){return h(e)&&1==++o?"start":y(e)&&0==--o?"end":null})),a=i[0],s=f(i),u=E(a),l=E(s);return r.hasPageBreakBeginning=C(a),r.hasPageBreak=C(s),I(a)&&(u=0),I(s)&&(l=0),e.slice(u,e.length-l)}},{key:"resolve",value:function(e,t){if(!d(e,O))return null;var r=t.scopeManager,n=r.getValueAsync(e.value,{part:e}),o=[];function u(n,a,s){var u=r.createSubScopeManager(n,e.value,a,e,s);o.push(t.resolve(i(i({},t),{},{compiled:e.subparsed,tags:{},scopeManager:u})))}var l=[];return n.then((function(t){return new Promise((function(e){t instanceof Array?Promise.all(t).then(e):e(t)})).then((function(t){return r.loopOverValue(t,u,e.inverted),Promise.all(o).then((function(e){return e.map((function(e){var t,r=e.resolved,n=e.errors;return l.push.apply(l,function(e){if(Array.isArray(e))return s(e)}(t=n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||a(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),r}))})).then((function(e){if(l.length>0)throw l;return e}))}))}))}},{key:"render",value:function(e,t){if("p:xfrm"===e.tag&&(this.inXfrm="start"===e.position),"a:ext"===e.tag&&this.inXfrm)return this.lastExt=e,e;if(!d(e,O))return null;var r=[],n=[],o=0,a=this,s=e.subparsed[0],u=0;"a:tr"===(null==s?void 0:s.tag)&&(u=+w(s.value,"h")),o-=u;var l=0,c=S(e);if(!1===t.scopeManager.loopOver(e.value,(function(s,p,f){o+=u;var h=t.scopeManager.createSubScopeManager(s,e.value,p,e,f);e.subparsed.forEach((function(e){if(b("a16:rowId",e)){var t=+w(e.value,"val")+l;l=1,e.value=x(e.value,"val",t)}}));var d,y,v,g=t.render(i(i({},t),{},{compiled:e.subparsed,tags:{},scopeManager:h}));e.hasPageBreak&&p===f-1&&c&&k(g),h.scopePathItem.some((function(e){return 0!==e}))?(1===e.sectPrCount&&(g.parts=g.parts.filter((function(e){return!m(e,"<w:headerReference")&&!m(e,"<w:footerReference")}))),e.addContinuousType&&(g.parts=(d=g.parts,y=!1,v=!1,d.reduce((function(e,t){return!1===y&&m(t,"<w:sectPr")&&(v=!0),v&&(m(t,"<w:type")&&(y=!0),!1===y&&m(t,"</w:sectPr")&&e.push('<w:type w:val="continuous"/>')),e.push(t),e}),[])))):e.addNextPage&&(g.parts=function(e,t){return["<w:p><w:pPr>".concat(t.map((function(e){return e.value})).join(""),"</w:pPr></w:p>")].concat(e)}(g.parts,a.sects[e.addNextPage.index])),e.addNextPage&&k(g),e.hasPageBreakBeginning&&c&&function(e){e.parts.unshift('<w:p><w:r><w:br w:type="page"/></w:r></w:p>')}(g);for(var T=0,P=g.parts.length;T<P;T++)r.push(g.parts[T]);Array.prototype.push.apply(n,g.errors)}),e.inverted,{part:e}))return e.lastParagrapSectPr?e.paragraphLoop?{value:"<w:p><w:pPr>".concat(e.lastParagrapSectPr,"</w:pPr></w:p>")}:{value:"</w:t></w:r></w:p><w:p><w:pPr>".concat(e.lastParagrapSectPr,"</w:pPr><w:r><w:t>")}:{value:j(e)||"",errors:n};if(0!==o){var p=+w(this.lastExt.value,"cy");this.lastExt.value=x(this.lastExt.value,"cy",p+o)}return{value:t.joinUncorrupt(r,i(i({},t),{},{basePart:e})),errors:n}}}],t&&u(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();e.exports=function(){return P(new M)}},60:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}var a=r(536),s=r(207).isContent,u=r(946),l=u.throwRawTagShouldBeOnlyTextInParagraph,c=u.getInvalidRawXMLValueException,p="rawxml",f=r(899);function h(e){var t=e.part,r=e.left,n=e.right,o=e.postparsed,i=e.index,a=o.slice(r+1,n);return a.forEach((function(e,n){n!==i-r-1&&s(e)&&l({paragraphParts:a,part:t})})),t}var d=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="RawXmlModule",this.prefix="@"},(t=[{key:"optionsTransformer",value:function(e,t){return this.fileTypeConfig=t.fileTypeConfig,e}},{key:"matchers",value:function(){return[[this.prefix,p]]}},{key:"postparse",value:function(e){return a.expandToOne(e,{moduleName:p,getInner:h,expandTo:this.fileTypeConfig.tagRawXml,error:{message:"Raw tag not in paragraph",id:"raw_tag_outerxml_invalid",explanation:function(e){return'The tag "'.concat(e.value,'" is not inside a paragraph, putting raw tags inside an inline loop is disallowed.')}}})}},{key:"render",value:function(e,t){if(e.module!==p)return null;var r,n=[];try{null==(r=t.scopeManager.getValue(e.value,{part:e}))&&(r=t.nullGetter(e))}catch(e){return n.push(e),{errors:n}}return"string"==typeof(r=r||"")?{value:r}:{errors:[c({tag:e.value,value:r,offset:e.offset})]}}}])&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();e.exports=function(){return f(new d)}},307:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}var a=r(899),s=r(946).getScopeCompilationError,u=r(207),l=u.utf8ToWord,c=u.hasCorruptCharacters,p=r(946).getCorruptCharactersException,f=r(356),h=f.settingsContentType,d=f.coreContentType,y=f.appContentType,v=f.customContentType,m={docx:"w",pptx:"a"},g=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="Render",this.recordRun=!1,this.recordedRun=[]},(t=[{key:"optionsTransformer",value:function(e,t){return this.parser=t.parser,this.fileType=t.fileType,e}},{key:"set",value:function(e){e.compiled&&(this.compiled=e.compiled),null!=e.data&&(this.data=e.data)}},{key:"getRenderedMap",value:function(e){var t=this;return Object.keys(this.compiled).reduce((function(e,r){return e[r]={from:r,data:t.data},e}),e)}},{key:"postparse",value:function(e,t){var r=this,n=[];return e.forEach((function(e){if("placeholder"===e.type){var o=e.value;try{t.cachedParsers[e.lIndex]=r.parser(o,{tag:e})}catch(t){n.push(s({tag:o,rootError:t,offset:e.offset}))}}})),{postparsed:e,errors:n}}},{key:"render",value:function(e,t){var r=t.contentType,n=t.scopeManager,o=t.linebreaks,i=t.nullGetter,a=t.fileType;if(o&&-1!==[h,d,y,v].indexOf(r)&&(o=!1),o&&this.recordRuns(e),"placeholder"===e.type&&!e.module){var s;try{s=n.getValue(e.value,{part:e})}catch(e){return{errors:[e]}}return null==s&&(s=i(e)),c(s)?{errors:[p({tag:e.value,value:s,offset:e.offset})]}:"text"===a?{value:s}:{value:o&&"string"==typeof s?this.renderLineBreaks(s):l(s)}}}},{key:"recordRuns",value:function(e){e.tag==="".concat(m[this.fileType],":r")?this.recordedRun=[]:e.tag==="".concat(m[this.fileType],":rPr")?("start"===e.position&&(this.recordRun=!0,this.recordedRun=[e.value]),"end"!==e.position&&"selfclosing"!==e.position||(this.recordedRun.push(e.value),this.recordRun=!1)):this.recordRun&&this.recordedRun.push(e.value)}},{key:"renderLineBreaks",value:function(e){var t=this,r=m[this.fileType],n="docx"===this.fileType?"<w:r><w:br/></w:r>":"<a:br/>",o=e.split("\n"),i=this.recordedRun.join("");return o.map((function(e){return l(e)})).reduce((function(e,a,s){return e.push(a),s<o.length-1&&e.push("</".concat(r,":t></").concat(r,":r>").concat(n,"<").concat(r,":r>").concat(i,"<").concat(r,":t").concat("docx"===t.fileType?' xml:space="preserve"':"",">")),e}),[])}}])&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();e.exports=function(){return a(new g)}},522:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}var a=r(899),s=r(207),u=s.isTextStart,l=s.isTextEnd,c=s.endsWith,p=s.startsWith;function f(e,t){var r=e[t].value;return"</w:t>"===e[t+1].value||-1!==r.indexOf('xml:space="preserve"')?r:r.substr(0,r.length-1)+' xml:space="preserve">'}var h=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="SpacePreserveModule"},(t=[{key:"postparse",value:function(e,t){var r=[],n=!1,o=0,i=0,a=e.reduce((function(e,a){return function(e){return u(e)&&"w:t"===e.tag}(a)&&(n=!0,i=r.length),n?(r.push(a),function(e,t){return e&&e.basePart&&t.length>1}(t,r)&&(o=t.basePart.endLindex,r[0].value=f(r,0)),function(e,t){return"placeholder"===e.type&&t.length>1}(a,r)&&(r[i].value=f(r,i),o=a.endLindex),l(a)&&a.lIndex>o&&(0!==o&&(r[i].value=f(r,i)),Array.prototype.push.apply(e,r),r=[],n=!1,o=0,i=0),e):(e.push(a),e)}),[]);return Array.prototype.push.apply(a,r),a}},{key:"postrender",value:function(e){for(var t="",r=0,n=0,o=e.length;n<o;n++){var i=n,a=e[n];""!==a&&(c(t,'<w:t xml:space="preserve">')&&p(a,"</w:t>")&&(e[r]=t.substr(0,t.length-26)+"<w:t/>",a=a.substr(6)),t=a,r=i,e[n]=a)}return e}}])&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();e.exports=function(){return a(new h)}},690:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){var o,i,a,s;o=e,i=t,a=r[t],s=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(i),(i="symbol"==n(s)?s:s+"")in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||s(e,t)||function(){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 s(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var l=r(207).wordToUtf8,c=r(650),p=c.match,f=c.getValue,h=c.getValues;var d={preparse:function(e,t,r){return{preparsed:function(e,r){return t.forEach((function(t){t.preparse(e,r)}))}(e,r)}},parse:function(e,t,r){var n,o=!1,c="",d=[],y=r.fileTypeConfig.droppedTagsInsidePlaceholder||[];return e.reduce((function(e,v){return"delimiter"===v.type?(o="start"===v.position,"end"===v.position&&(r.parse=function(e){return function(e,t){var r,n=t.modules,o=t.startOffset,l=t.lIndex;t.offset=o,t.match=p,t.getValue=f,t.getValues=h;var c=function(e,t){for(var r=[],n=0,o=e.length;n<o;n++){var i=e[n];if(i.matchers){var a=i.matchers(t);if(!(a instanceof Array))throw new Error("module matcher returns a non array");r.push.apply(r,function(e){if(Array.isArray(e))return u(e)}(l=a)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(l)||s(l)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}}var l;return r}(n,t),d=function(e,t,r){for(var n=[],o=0,s=e.length;o<s;o++){var u=e[o],l=a(u,2),c=l[0],p=l[1],f=u[2]||{};if(r.match(c,t)){var h=r.getValues(c,t);if("function"==typeof f&&(f=f(h)),!f.value){var d=a(h,2);f.value=d[1]}n.push(i({type:"placeholder",prefix:c,module:p,onMatch:f.onMatch,priority:f.priority},f))}}return n}(c,e,t);if(d.length>0){var y=null;return d.forEach((function(e){e.priority=e.priority||-e.value.length,(!y||e.priority>y.priority)&&(y=e)})),y.offset=o,delete y.priority,y.endLindex=l,y.lIndex=l,y.raw=e,y.onMatch&&y.onMatch(y),delete y.onMatch,delete y.prefix,y}for(var v=0,m=n.length;v<m;v++)if(r=n[v].parse(e,t))return r.offset=o,r.endLindex=l,r.lIndex=l,r.raw=e,r;return{type:"placeholder",value:e,offset:o,endLindex:l,lIndex:l}}(e,i(i(i({},r),v),{},{startOffset:n,modules:t}))},e.push(r.parse(l(c))),Array.prototype.push.apply(e,d),d=[]),"start"===v.position&&(d=[],n=v.offset),c="",e):o?"content"!==v.type||"insidetag"!==v.position?(-1!==y.indexOf(v.tag)||d.push(v),e):(c+=v.value,e):(e.push(v),e)}),[])},postparse:function(e,t,r){function n(e,r){return t.map((function(t){return t.getTraits(e,r)}))}var o=[];return{postparsed:function e(r,a){return t.reduce((function(t,r){var s=r.postparse(t,i(i({},a),{},{postparse:function(t,r){return e(t,i(i({},a),r))},getTraits:n}));return null==s?t:s.errors?(Array.prototype.push.apply(o,s.errors),s.postparsed):s}),r)}(e,r),errors:o}}};e.exports=d},183:function(e){function t(e){var t,r,n,o,i=0,a=e.length;for(n=0;n<a;n++)55296==(64512&(t=e.charCodeAt(n)))&&n+1<a&&56320==(64512&(r=e.charCodeAt(n+1)))&&(t=65536+(t-55296<<10)+(r-56320),n++),i+=t<128?1:t<2048?2:t<65536?3:4;var s=new Uint8Array(i);for(o=0,n=0;o<i;n++)55296==(64512&(t=e.charCodeAt(n)))&&n+1<a&&56320==(64512&(r=e.charCodeAt(n+1)))&&(t=65536+(t-55296<<10)+(r-56320),n++),t<128?s[o++]=t:t<2048?(s[o++]=192|t>>>6,s[o++]=128|63&t):t<65536?(s[o++]=224|t>>>12,s[o++]=128|t>>>6&63,s[o++]=128|63&t):(s[o++]=240|t>>>18,s[o++]=128|t>>>12&63,s[o++]=128|t>>>6&63,s[o++]=128|63&t);return s}e.exports=function(e,r){for(var n=0,o=r.modules.length;n<o;n++)e=r.modules[n].postrender(e,r);for(var i=0,a=r.joinUncorrupt(e,r),s="",u=0,l=[],c=0,p=a.length;c<p;c++){var f=a[c];if(f.length+u>65536){var h=t(s);i+=h.length,l.push(h),s=""}s+=f,u+=f.length,delete a[c]}var d=t(s);i+=d.length,l.push(d);var y=new Uint8Array(i),v=0;return l.forEach((function(e){for(var t=0;t<e.length;++t)y[t+v]=e[t];v+=e.length})),y}},650:function(e){var t=new RegExp(String.fromCharCode(160),"g");function r(e){return e.replace(t," ")}e.exports={match:function(e,t){return"string"==typeof e?r(t.substr(0,e.length))===e:e instanceof RegExp?e.test(r(t)):void 0},getValue:function(e,t){return"string"==typeof e?r(t).substr(e.length):e instanceof RegExp?r(t).match(e)[1]:void 0},getValues:function(e,t){return"string"==typeof e?[t,r(t).substr(e.length)]:e instanceof RegExp?r(t).match(e):void 0}}},789:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){var o,i,a,s;o=e,i=t,a=r[t],s=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(i),(i="symbol"==n(s)?s:s+"")in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var a=r(946),s=a.throwUnimplementedTagType,u=a.XTScopeParserError,l=r(830);e.exports=function(e){var t=e.baseNullGetter,r=e.compiled,n=e.scopeManager;e.nullGetter=function(e,r){return t(e,r||n)};var o=[],a=r.map((function(t,r){var n;e.index=r;try{n=function(e,t){for(var r,n=0,o=t.modules.length;n<o;n++)if(r=t.modules[n].render(e,t))return r;return!1}(t,i(i({},e),{},{resolvedId:l(t,e)}))}catch(e){if(e instanceof u)return o.push(e),t;throw e}return n?(n.errors&&Array.prototype.push.apply(o,n.errors),n):"content"===t.type||"tag"===t.type?t:void s(t,r)})).reduce((function(e,t){var r=t.value;if(r instanceof Array)for(var n=0,o=r.length;n<o;n++)e.push(r[n]);else r&&e.push(r);return e}),[]);return{errors:o,parts:a}}},945:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){var o,i,a,s;o=e,i=t,a=r[t],s=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(i),(i="symbol"==n(s)?s:s+"")in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var s=r(830);e.exports=function(e){var t=[],r=e.baseNullGetter,n=e.compiled,i=e.scopeManager;e.nullGetter=function(e,t){return r(e,t||i)},e.resolved=t;var u=[];return Promise.all(n.filter((function(e){return-1===["content","tag"].indexOf(e.type)})).reduce((function(r,n){e.resolvedId=s(n,e);var l,c=function(e,t){for(var r,n=0,o=t.modules.length;n<o;n++)if(r=t.modules[n].resolve(e,t))return r;return!1}(n,a(a({},e),{},{resolvedId:s(n,e)}));if(c)l=c.then((function(e){t.push({tag:n.value,lIndex:n.lIndex,value:e})}));else{if("placeholder"!==n.type)return;l=i.getValueAsync(n.value,{part:n}).then((function(t){return null==t?e.nullGetter(n):t})).then((function(e){return t.push({tag:n.value,lIndex:n.lIndex,value:e}),e}))}return r.push(l.catch((function(e){var t;e instanceof Array?u.push.apply(u,function(e){if(Array.isArray(e))return o(e)}(t=e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):u.push(e)}))),r}),[])).then((function(){return{errors:u,resolved:t}}))}},779:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}var a=r(946).getScopeParserExecutionError,s=r(320).last,u=r(207).concatArrays;function l(e,t){for(var r,n=e.length>>>0,o=0;o<n;o++)if(r=e[o],t.call(this,r,o,e))return r}function c(e,t,r){var n,o,i=this,s=this.scopeList[r];if(this.root.finishedResolving){for(var u=this.resolved,p=function(){var e=i.scopeLindex[f];u=(u=l(u,(function(t){return t.lIndex===e}))).value[i.scopePathItem[f]]},f=this.resolveOffset,h=this.scopePath.length;f<h;f++)p();return l(u,(function(e){return t.part.lIndex===e.lIndex})).value}o=this.cachedParsers&&t.part?this.cachedParsers[t.part.lIndex]?this.cachedParsers[t.part.lIndex]:this.cachedParsers[t.part.lIndex]=this.parser(e,{tag:t.part,scopePath:this.scopePath}):this.parser(e,{tag:t.part,scopePath:this.scopePath});try{n=o.get(s,this.getContext(t,r))}catch(r){throw a({tag:e,scope:s,error:r,offset:t.part.offset})}return null==n&&r>0?c.call(this,e,t,r-1):n}function p(e,t,r){var n,o=this,i=this.scopeList[r];return n=this.cachedParsers&&t.part?this.cachedParsers[t.part.lIndex]?this.cachedParsers[t.part.lIndex]:this.cachedParsers[t.part.lIndex]=this.parser(e,{tag:t.part,scopePath:this.scopePath}):this.parser(e,{tag:t.part,scopePath:this.scopePath}),Promise.resolve().then((function(){return n.get(i,o.getContext(t,r))})).catch((function(r){throw a({tag:e,scope:i,error:r,offset:t.part.offset})})).then((function(n){return null==n&&r>0?p.call(o,e,t,r-1):n}))}var f=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.root=t.root||this,this.resolveOffset=t.resolveOffset||0,this.scopePath=t.scopePath,this.scopePathItem=t.scopePathItem,this.scopePathLength=t.scopePathLength,this.scopeList=t.scopeList,this.scopeType="",this.scopeTypes=t.scopeTypes,this.scopeLindex=t.scopeLindex,this.parser=t.parser,this.resolved=t.resolved,this.cachedParsers=t.cachedParsers}return t=e,(r=[{key:"loopOver",value:function(e,t,r,n){return this.loopOverValue(this.getValue(e,n),t,r)}},{key:"functorIfInverted",value:function(e,t,r,n,o){return e&&t(r,n,o),e}},{key:"isValueFalsy",value:function(e,t){return null==e||!e||"[object Array]"===t&&0===e.length}},{key:"loopOverValue",value:function(e,t,r){this.root.finishedResolving&&(r=!1);var n=Object.prototype.toString.call(e);if(this.isValueFalsy(e,n))return this.scopeType=!1,this.functorIfInverted(r,t,s(this.scopeList),0,1);if("[object Array]"===n){this.scopeType="array";for(var o=0;o<e.length;o++)this.functorIfInverted(!r,t,e[o],o,e.length);return!0}return"[object Object]"===n?(this.scopeType="object",this.functorIfInverted(!r,t,e,0,1)):this.functorIfInverted(!r,t,s(this.scopeList),0,1)}},{key:"getValue",value:function(e,t){var r=c.call(this,e,t,this.scopeList.length-1);return"function"==typeof r?r(this.scopeList[this.scopeList.length-1],this):r}},{key:"getValueAsync",value:function(e,t){var r=this;return p.call(this,e,t,this.scopeList.length-1).then((function(e){return"function"==typeof e?e(r.scopeList[r.scopeList.length-1],r):e}))}},{key:"getContext",value:function(e,t){return{num:t,meta:e,scopeList:this.scopeList,resolved:this.resolved,scopePath:this.scopePath,scopeTypes:this.scopeTypes,scopePathItem:this.scopePathItem,scopePathLength:this.scopePathLength}}},{key:"createSubScopeManager",value:function(t,r,n,o,i){return new e({root:this.root,resolveOffset:this.resolveOffset,resolved:this.resolved,parser:this.parser,cachedParsers:this.cachedParsers,scopeTypes:u([this.scopeTypes,[this.scopeType]]),scopeList:u([this.scopeList,[t]]),scopePath:u([this.scopePath,[r]]),scopePathItem:u([this.scopePathItem,[n]]),scopePathLength:u([this.scopePathLength,[i]]),scopeLindex:u([this.scopeLindex,[o.lIndex]])})}}])&&o(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r}();e.exports=function(e){return e.scopePath=[],e.scopePathItem=[],e.scopePathLength=[],e.scopeTypes=[],e.scopeLindex=[],e.scopeList=[e.tags],new f(e)}},536:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||i(e,t)||function(){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 i(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var u=r(207),l=u.getRightOrNull,c=u.getRight,p=u.getLeft,f=u.getLeftOrNull,h=u.chunkBy,d=u.isTagStart,y=u.isTagEnd,v=u.isContent,m=u.last,g=u.first,b=r(946),w=b.XTTemplateError,x=b.throwExpandNotFound,T=b.getLoopPositionProducesInvalidXMLError;function P(e,t){return 0!==e.length&&0===m(e).substr(1).indexOf(t)}function O(e,t,r,o){var i=e.expandTo||o.expandTo;if(i){var a,u;try{u=p(r,i,t),a=c(r,i,t)}catch(a){throw a instanceof w&&x(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){var o,i,a,s;o=e,i=t,a=r[t],s=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(i),(i="symbol"==n(s)?s:s+"")in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({part:e,rootError:a,postparsed:r,expandTo:i,index:t},o.error)),a}return[u,a]}}e.exports={expandToOne:function(e,t){var r=[];e.errors&&(r=e.errors,e=e.postparsed);for(var n=[],s=0,u=e.length;s<u;s++){var l=e[s];if("placeholder"===l.type&&l.module===t.moduleName&&!l.subparsed)try{var c=O(l,s,e,t);if(!c)continue;var p=o(c,2),f=p[0],h=p[1];n.push({left:f,right:h,part:l,i:s,leftPart:e[f],rightPart:e[h]})}catch(e){if(!(e instanceof w))throw e;r.push(e)}}n.sort((function(e,t){return e.left===t.left?t.part.lIndex<e.part.lIndex?1:-1:t.left<e.left?1:-1}));var d=-1,y=0;return n.forEach((function(s,u){var l,c;if(d=Math.max(d,u>0?n[u-1].right:0),!(s.left<d)){var p;try{p=function(e,t,r,n){var i=o(e,2),a=i[0],s=i[1],u=r.indexOf(t),l=r.slice(a,u),c=r.slice(u+1,s+1),p=n.getInner({postparse:n.postparse,index:u,part:t,leftParts:l,rightParts:c,left:a,right:s,postparsed:r});return p.length||(p.expanded=[l,c],p=[p]),{left:a,right:s,inner:p}}([s.left+y,s.right+y],s.part,e,t)}catch(e){if(!(e instanceof w))throw e;r.push(e)}p&&(y+=p.inner.length-(p.right+1-p.left),(l=e).splice.apply(l,[p.left,p.right+1-p.left].concat(function(e){if(Array.isArray(e))return a(e)}(c=p.inner)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(c)||i(c)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())))}})),{postparsed:e,errors:r}},getExpandToDefault:function(e,t,r){var n=function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r],o=n.position,i=n.value,a=n.tag;a&&("end"===o?P(t,a)?t.pop():t.push(i):"start"===o&&t.push(i))}return t}(e.slice(t[0].offset,t[1].offset));if(n.filter((function(e){return"/"===e[1]})).length!==n.filter((function(e){return"/"!==e[1]&&"/"!==e[e.length-2]})).length)return{error:T({tag:g(t).part.value,offset:[g(t).part.offset,m(t).part.offset]})};for(var o,i=function(){var o=r[a],i=o.contains,s=o.expand,u=o.onlyTextInTag;if(function(e,t){for(var r=0;r<t.length;r++)if(0===t[r].indexOf("<".concat(e)))return!0;return!1}(i,n)){if(u){var c=f(e,i,t[0].offset),p=l(e,i,t[1].offset);if(null===c||null===p)return 0;var b=h(e.slice(c,p),(function(e){return d(i,e)?"start":y(i,e)?"end":null})),w=g(b),x=m(b),T=w.filter(v),P=x.filter(v);if(1!==T.length||1!==P.length)return 0}return{v:{value:s}}}},a=0,s=r.length;a<s;a++)if(0!==(o=i())&&o)return o.v;return{}}}},320:function(e){e.exports={last:function(e){return e[e.length-1]},first:function(e){return e[0]}}},367:function(e,t,r){var n=r(207).pregMatchAll;e.exports=function(e,t){var r={content:e},o=t.join("|"),i=new RegExp("(?:(<(?:".concat(o,")[^>]*>)([^<>]*)</(?:").concat(o,")>)|(<(?:").concat(o,")[^>]*/>)"),"g");return r.matches=n(i,r.content),r}},245:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}var a=r(207),s=a.wordToUtf8,u=a.convertSpaces,l=r(367),c=r(263),p=r(690),f=r(789),h=r(183),d=r(945),y=r(208);e.exports=function(){return e=function e(t,r){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.cachedParsers={},this.content=t,Object.keys(r).forEach((function(e){n[e]=r[e]})),this.setModules({inspect:{filePath:r.filePath}})},t=[{key:"resolveTags",value:function(e){var t=this;this.tags=e;var r=this.getOptions(),n=this.filePath;r.scopeManager=this.scopeManager,r.resolve=d;var o=[];return Promise.all(this.modules.map((function(e){return Promise.resolve(e.preResolve(r)).catch((function(e){o.push(e)}))}))).then((function(){if(0!==o.length)throw o;return d(r).then((function(e){var o=e.resolved,i=e.errors;if(0!==(i=i.map((function(e){return e instanceof Error||(e=new Error(e)),e.properties=e.properties||{},e.properties.file=n,e}))).length)throw i;return Promise.all(o).then((function(e){return r.scopeManager.root.finishedResolving=!0,r.scopeManager.resolved=e,t.setModules({inspect:{resolved:e,filePath:n}}),e}))}))}))}},{key:"getFullText",value:function(){return e=this.content,t=this.fileTypeConfig.tagsXmlTextArray,r=l(e,t).matches.map((function(e){return e.array[2]})),s(u(r.join("")));var e,t,r}},{key:"setModules",value:function(e){this.modules.forEach((function(t){t.set(e)}))}},{key:"preparse",value:function(){this.allErrors=[],this.xmllexed=c.xmlparse(this.content,{text:this.fileTypeConfig.tagsXmlTextArray,other:this.fileTypeConfig.tagsXmlLexedArray}),this.setModules({inspect:{filePath:this.filePath,xmllexed:this.xmllexed}});var e=c.parse(this.xmllexed,this.delimiters,this.syntax,this.fileType),t=e.lexed,r=e.errors;this.allErrors=this.allErrors.concat(r),this.lexed=t,this.setModules({inspect:{filePath:this.filePath,lexed:this.lexed}});var n=this.getOptions();p.preparse(this.lexed,this.modules,n)}},{key:"parse",value:function(){this.setModules({inspect:{filePath:this.filePath}});var e=this.getOptions();this.parsed=p.parse(this.lexed,this.modules,e),this.setModules({inspect:{filePath:this.filePath,parsed:this.parsed}});var t=p.postparse(this.parsed,this.modules,e),r=t.postparsed,n=t.errors;return this.postparsed=r,this.setModules({inspect:{filePath:this.filePath,postparsed:this.postparsed}}),this.allErrors=this.allErrors.concat(n),this.errorChecker(this.allErrors),this}},{key:"errorChecker",value:function(e){var t=this;e.forEach((function(e){e.properties=e.properties||{},e.properties.file=t.filePath})),this.modules.forEach((function(t){e=t.errorsTransformer(e)}))}},{key:"baseNullGetter",value:function(e,t){var r=this,n=this.modules.reduce((function(n,o){return null!=n?n:o.nullGetter(e,t,r)}),null);return null!=n?n:this.nullGetter(e,t)}},{key:"getOptions",value:function(){return{compiled:this.postparsed,cachedParsers:this.cachedParsers,tags:this.tags,modules:this.modules,parser:this.parser,contentType:this.contentType,relsType:this.relsType,baseNullGetter:this.baseNullGetter.bind(this),filePath:this.filePath,fileTypeConfig:this.fileTypeConfig,fileType:this.fileType,linebreaks:this.linebreaks}}},{key:"render",value:function(e){this.filePath=e;var t=this.getOptions();t.resolved=this.scopeManager.resolved,t.scopeManager=this.scopeManager,t.render=f,t.joinUncorrupt=y;var r=f(t),n=r.errors,o=r.parts;return n.length>0?(this.allErrors=n,this.errorChecker(n),this):(this.content=h(o,t),this.setModules({inspect:{filePath:this.filePath,content:this.content}}),this)}}],t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}()}},t={},r=function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}(807);window.docxtemplater=r}(); |