forked from VolodymyrBaydalka/docxjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docx-preview.min.js
2 lines (2 loc) · 41.8 KB
/
docx-preview.min.js
1
2
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("JSZip")):"function"==typeof define&&define.amd?define(["JSZip"],t):"object"==typeof exports?exports.docx=t(require("JSZip")):e.docx=t(e.JSZip)}(window,(function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=5)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ns={wordml:"http://schemas.openxmlformats.org/wordprocessingml/2006/main"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);function a(e,t,r){void 0===t&&(t=null),void 0===r&&(r=null);for(var n=[],a=0;a<e.childNodes.length;a++){var s=e.childNodes[a];1!=s.nodeType||null!=t&&s.namespaceURI!=t||null!=r&&s.localName!=r||n.push(s)}return n}function s(e,t,r){return e.getAttributeNS(t,r)}function o(e,t,r){var n=e.getAttributeNS(t,r);return n?"#"+n:null}function l(e,r,n,a){void 0===a&&(a=t.LengthUsage.Dxa);var s=e.getAttributeNS(r,n);return s?{value:parseInt(s)*a.mul,type:a.unit}:null}function i(e){return{type:s(e,n.ns.wordml,"val"),color:o(e,n.ns.wordml,"color"),size:l(e,n.ns.wordml,"sz",t.LengthUsage.Border)}}t.elements=a,t.stringAttr=s,t.intAttr=function(e,t,r){var n=e.getAttributeNS(t,r);return n?parseInt(n):null},t.colorAttr=o,t.boolAttr=function(e,t,r,n){void 0===n&&(n=!1);var a=e.getAttributeNS(t,r);return null==a?n:"true"===a||"1"===a},t.LengthUsage={Dxa:{mul:.05,unit:"pt"},Emu:{mul:1/12700,unit:"pt"},FontSize:{mul:.5,unit:"pt"},Border:{mul:.125,unit:"pt"},Percent:{mul:.02,unit:"%"},LineHeight:{mul:1/240,unit:null}},t.lengthAttr=l,t.parseBorder=i,t.parseBorders=function(e){for(var t={},r=0,s=a(e,n.ns.wordml);r<s.length;r++){var o=s[r];switch(o.localName){case"left":t.left=i(o);break;case"top":t.top=i(o);break;case"right":t.right=i(o);break;case"botton":t.botton=i(o)}}return t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Document="document",e.Paragraph="paragraph",e.Run="run",e.Break="break",e.Table="table",e.Row="row",e.Cell="cell",e.Hyperlink="hyperlink",e.Drawing="drawing",e.Image="image",e.Text="text",e.Tab="tab",e.Symbol="symbol"}(t.DomType||(t.DomType={})),function(e){e[e.Settings=0]="Settings",e[e.Theme=1]="Theme",e[e.StylesWithEffects=2]="StylesWithEffects",e[e.Styles=3]="Styles",e[e.FontTable=4]="FontTable",e[e.Image=5]="Image",e[e.WebSettings=6]="WebSettings",e[e.Unknown=7]="Unknown"}(t.DomRelationshipType||(t.DomRelationshipType={}))},function(e,t,r){"use strict";function n(e,t){return e?e+" "+t:t}Object.defineProperty(t,"__esModule",{value:!0}),t.addElementClass=function(e,t){return e.className=n(e.className,t)},t.appendClass=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),a=r(1);function s(e){return{numberOfColumns:a.intAttr(e,n.ns.wordml,"num"),space:a.lengthAttr(e,n.ns.wordml,"space"),separator:a.boolAttr(e,n.ns.wordml,"sep"),equalWidth:a.boolAttr(e,n.ns.wordml,"equalWidth",!0),columns:a.elements(e,n.ns.wordml,"col").map((function(e){return{width:a.lengthAttr(e,n.ns.wordml,"w"),space:a.lengthAttr(e,n.ns.wordml,"space")}}))}}t.parseSectionProperties=function(e){for(var t={},r=0,o=a.elements(e,n.ns.wordml);r<o.length;r++){var l=o[r];switch(l.localName){case"pgSz":t.pageSize={width:a.lengthAttr(l,n.ns.wordml,"w"),height:a.lengthAttr(l,n.ns.wordml,"h"),orientation:a.stringAttr(l,n.ns.wordml,"orient")};break;case"pgMar":t.pageMargins={left:a.lengthAttr(l,n.ns.wordml,"left"),right:a.lengthAttr(l,n.ns.wordml,"right"),top:a.lengthAttr(l,n.ns.wordml,"top"),bottom:a.lengthAttr(l,n.ns.wordml,"bottom"),header:a.lengthAttr(l,n.ns.wordml,"header"),footer:a.lengthAttr(l,n.ns.wordml,"footer"),gutter:a.lengthAttr(l,n.ns.wordml,"gutter")};break;case"cols":t.columns=s(l)}}return t}},function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var a=r(6),s=r(8),o=r(10);t.renderAsync=function(e,t,r,l){void 0===r&&(r=null),void 0===l&&(l=null);var i=new s.DocumentParser,c=new o.HtmlRenderer(window.document),u=n({ignoreHeight:!1,ignoreWidth:!1,ignoreFonts:!1,breakPages:!0,debug:!1,experimental:!1,className:"docx",inWrapper:!0},l);return i.ignoreWidth=u.ignoreWidth,i.debug=u.debug||i.debug,c.className=u.className||"docx",c.inWrapper=u.inWrapper,a.Document.load(e,i).then((function(e){return c.render(e,t,r,u),e}))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,a=r(7);!function(e){e.Document="word/document.xml",e.Style="word/styles.xml",e.Numbering="word/numbering.xml",e.FontTable="word/fontTable.xml",e.DocumentRelations="word/_rels/document.xml.rels",e.NumberingRelations="word/_rels/numbering.xml.rels",e.FontRelations="word/_rels/fontTable.xml.rels"}(n||(n={}));var s=function(){function e(){this.zip=new a,this.docRelations=null,this.fontRelations=null,this.numRelations=null,this.styles=null,this.fonts=null,this.numbering=null,this.document=null}return e.load=function(t,r){var a=new e;return a.zip.loadAsync(t).then((function(e){var t=[a.loadPart(n.DocumentRelations,r),a.loadPart(n.FontRelations,r),a.loadPart(n.NumberingRelations,r),a.loadPart(n.Style,r),a.loadPart(n.FontTable,r),a.loadPart(n.Numbering,r),a.loadPart(n.Document,r)];return Promise.all(t.filter((function(e){return null!=e}))).then((function(e){return a}))}))},e.prototype.loadDocumentImage=function(e){return this.loadResource(this.docRelations,e,"blob").then((function(e){return e?URL.createObjectURL(e):null}))},e.prototype.loadNumberingImage=function(e){return this.loadResource(this.numRelations,e,"blob").then((function(e){return e?URL.createObjectURL(e):null}))},e.prototype.loadFont=function(e,t){return this.loadResource(this.fontRelations,e,"uint8array").then((function(e){return e?URL.createObjectURL(new Blob([o(e,t)])):e}))},e.prototype.loadResource=function(e,t,r){void 0===r&&(r="base64");var n=e.find((function(e){return e.id==t}));return n?this.zip.files["word/"+n.target].async(r):Promise.resolve(null)},e.prototype.loadPart=function(e,t){var r=this,a=this.zip.files[e];return a?a.async("text").then((function(a){switch(e){case n.FontRelations:r.fontRelations=t.parseDocumentRelationsFile(a);break;case n.DocumentRelations:r.docRelations=t.parseDocumentRelationsFile(a);break;case n.NumberingRelations:r.numRelations=t.parseDocumentRelationsFile(a);break;case n.Style:r.styles=t.parseStylesFile(a);break;case n.Numbering:r.numbering=t.parseNumberingFile(a);break;case n.Document:r.document=t.parseDocumentFile(a);break;case n.FontTable:r.fontTable=t.parseFontTable(a)}return r})):null},e}();function o(e,t){for(var r=t.replace(/{|}|-/g,""),n=new Array(16),a=0;a<16;a++)n[16-a-1]=parseInt(r.substr(2*a,2),16);for(a=0;a<32;a++)e[a]=e[a]^n[a%16];return e}t.Document=s,t.deobfuscate=o},function(t,r){t.exports=e},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),a=r(3),s=r(0),o=r(1),l=r(9),i=r(4);t.autos={shd:"white",color:"black",highlight:"transparent"};var c,u=function(){function e(){this.skipDeclaration=!0,this.ignoreWidth=!1,this.debug=!1}return e.prototype.parseDocumentRelationsFile=function(e){var t=p.parse(e,this.skipDeclaration);return p.elements(t).map((function(e){return{id:p.stringAttr(e,"Id"),type:d.valueOfRelType(e),target:p.stringAttr(e,"Target")}}))},e.prototype.parseFontTable=function(e){var t=p.parse(e,this.skipDeclaration);return p.elements(t).map((function(e){return{name:p.stringAttr(e,"name"),fontKey:p.elementStringAttr(e,"embedRegular","fontKey"),refId:p.elementStringAttr(e,"embedRegular","id")}}))},e.prototype.parseDocumentFile=function(e){var t=this,r={type:n.DomType.Document,children:[],style:{},props:null},a=p.byTagName(p.parse(e,this.skipDeclaration),"body");return p.foreach(a,(function(e){switch(e.localName){case"p":r.children.push(t.parseParagraph(e));break;case"tbl":r.children.push(t.parseTable(e));break;case"sectPr":r.props=i.parseSectionProperties(e)}})),r},e.prototype.parseStylesFile=function(e){var t=this,r=[],n=p.parse(e,this.skipDeclaration);return p.foreach(n,(function(e){switch(e.localName){case"style":r.push(t.parseStyle(e));break;case"docDefaults":r.push(t.parseDefaultStyles(e))}})),r},e.prototype.parseDefaultStyles=function(e){var t=this,r={id:null,name:null,target:null,basedOn:null,styles:[]};return p.foreach(e,(function(e){switch(e.localName){case"rPrDefault":var n=p.byTagName(e,"rPr");n&&r.styles.push({target:"span",values:t.parseDefaultProperties(n,{})});break;case"pPrDefault":var a=p.byTagName(e,"pPr");a&&r.styles.push({target:"p",values:t.parseDefaultProperties(a,{})})}})),r},e.prototype.parseCommonProperties=function(e,t){if(e.namespaceURI==s.ns.wordml)switch(e.localName){case"color":t.color=o.colorAttr(e,e.namespaceURI,"val");break;case"sz":t.fontSize=o.lengthAttr(e,e.namespaceURI,"val",o.LengthUsage.FontSize)}},e.prototype.parseStyle=function(e){var t=this,r={id:p.className(e,"styleId"),isDefault:p.boolAttr(e,"default"),name:null,target:null,basedOn:null,styles:[],linked:null};switch(p.stringAttr(e,"type")){case"paragraph":r.target="p";break;case"table":r.target="table";break;case"character":r.target="span"}return p.foreach(e,(function(e){switch(e.localName){case"basedOn":r.basedOn=p.className(e,"val");break;case"name":r.name=p.stringAttr(e,"val");break;case"link":r.linked=p.className(e,"val");break;case"aliases":r.aliases=p.stringAttr(e,"val").split(",");break;case"pPr":r.styles.push({target:"p",values:t.parseDefaultProperties(e,{})});break;case"rPr":r.styles.push({target:"span",values:t.parseDefaultProperties(e,{})});break;case"tblPr":case"tcPr":r.styles.push({target:"td",values:t.parseDefaultProperties(e,{})});break;case"tblStylePr":for(var n=0,a=t.parseTableStyle(e);n<a.length;n++){var s=a[n];r.styles.push(s)}break;case"rsid":case"qFormat":case"hidden":case"semiHidden":case"unhideWhenUsed":case"autoRedefine":case"uiPriority":break;default:t.debug&&console.warn("DOCX: Unknown style element: "+e.localName)}})),r},e.prototype.parseTableStyle=function(e){var t=this,r=[],n=p.stringAttr(e,"type"),a="";switch(n){case"firstRow":a="tr.first-row td";break;case"lastRow":a="tr.last-row td";break;case"firstCol":a="td.first-col";break;case"lastCol":a="td.last-col";break;case"band1Vert":a="td.odd-col";break;case"band2Vert":a="td.even-col";break;case"band1Horz":a="tr.odd-row";break;case"band2Horz":a="tr.even-row";break;default:return[]}return p.foreach(e,(function(e){switch(e.localName){case"pPr":r.push({target:a+" p",values:t.parseDefaultProperties(e,{})});break;case"rPr":r.push({target:a+" span",values:t.parseDefaultProperties(e,{})});break;case"tblPr":case"tcPr":r.push({target:a,values:t.parseDefaultProperties(e,{})})}})),r},e.prototype.parseNumberingFile=function(e){var t=this,r=[],n=p.parse(e,this.skipDeclaration),a={},s=[];return p.foreach(n,(function(e){switch(e.localName){case"abstractNum":t.parseAbstractNumbering(e,s).forEach((function(e){return r.push(e)}));break;case"numPicBullet":s.push(t.parseNumberingPicBullet(e));break;case"num":var n=p.stringAttr(e,"numId"),o=p.elementStringAttr(e,"abstractNumId","val");a[o]=n}})),r.forEach((function(e){return e.id=a[e.id]})),r},e.prototype.parseNumberingPicBullet=function(e){var t=p.byTagName(e,"pict"),r=t&&p.byTagName(t,"shape"),n=r&&p.byTagName(r,"imagedata");return n?{id:p.intAttr(e,"numPicBulletId"),src:p.stringAttr(n,"id"),style:p.stringAttr(r,"style")}:null},e.prototype.parseAbstractNumbering=function(e,t){var r=this,n=[],a=p.stringAttr(e,"abstractNumId");return p.foreach(e,(function(e){switch(e.localName){case"lvl":n.push(r.parseNumberingLevel(a,e,t))}})),n},e.prototype.parseNumberingLevel=function(e,t,r){var n=this,a={id:e,level:p.intAttr(t,"ilvl"),style:{}};return p.foreach(t,(function(e){switch(e.localName){case"pPr":n.parseDefaultProperties(e,a.style);break;case"lvlPicBulletId":var t=p.intAttr(e,"val");a.bullet=r.filter((function(e){return e.id==t}))[0];break;case"lvlText":a.levelText=p.stringAttr(e,"val");break;case"numFmt":a.format=p.stringAttr(e,"val")}})),a},e.prototype.parseParagraph=function(e){var t=this,r={type:n.DomType.Paragraph,children:[],props:{}};return p.foreach(e,(function(e){switch(e.localName){case"r":r.children.push(t.parseRun(e,r));break;case"hyperlink":r.children.push(t.parseHyperlink(e,r));break;case"bookmarkStart":r.children.push(t.parseBookmark(e));break;case"pPr":t.parseParagraphProperties(e,r),t.parseCommonProperties(e,r.props)}})),r},e.prototype.parseParagraphProperties=function(e,t){var r=this;this.parseDefaultProperties(e,t.style={},null,(function(e){if(l.parseParagraphProperties(e,t.props))return!0;switch(e.localName){case"pStyle":a.addElementClass(t,p.className(e,"val"));break;case"cnfStyle":a.addElementClass(t,d.classNameOfCnfStyle(e));break;case"framePr":r.parseFrame(e,t);break;case"rPr":break;default:return!1}return!0}))},e.prototype.parseFrame=function(e,t){"drop"==p.stringAttr(e,"dropCap")&&(t.style.float="left")},e.prototype.parseBookmark=function(e){var t={type:n.DomType.Run};return t.id=p.stringAttr(e,"name"),t},e.prototype.parseHyperlink=function(e,t){var r=this,a={type:n.DomType.Hyperlink,parent:t,children:[]},s=p.stringAttr(e,"anchor");return s&&(a.href="#"+s),p.foreach(e,(function(e){switch(e.localName){case"r":a.children.push(r.parseRun(e,a))}})),a},e.prototype.parseRun=function(e,t){var r=this,a={type:n.DomType.Run,parent:t,children:[]};return p.foreach(e,(function(e){switch(e.localName){case"t":a.children.push({type:n.DomType.Text,text:e.textContent});break;case"fldChar":a.fldCharType=p.stringAttr(e,"fldCharType");break;case"br":a.children.push({type:n.DomType.Break,break:p.stringAttr(e,"type")||"textWrapping"});break;case"lastRenderedPageBreak":a.children.push({type:n.DomType.Break,break:"page"});break;case"sym":a.children.push({type:n.DomType.Symbol,font:p.stringAttr(e,"font"),char:p.stringAttr(e,"char")});break;case"tab":a.children.push({type:n.DomType.Tab});break;case"instrText":a.instrText=e.textContent;break;case"drawing":var t=r.parseDrawing(e);t&&(a.children=[t]);break;case"rPr":r.parseRunProperties(e,a)}})),a},e.prototype.parseRunProperties=function(e,t){this.parseDefaultProperties(e,t.style={},null,(function(e){switch(e.localName){case"rStyle":t.className=p.className(e,"val");break;case"vertAlign":switch(p.stringAttr(e,"val")){case"subscript":t.wrapper="sub";break;case"superscript":t.wrapper="sup"}break;default:return!1}return!0}))},e.prototype.parseDrawing=function(e){for(var t=0,r=p.elements(e);t<r.length;t++){var n=r[t];switch(n.localName){case"inline":case"anchor":return this.parseDrawingWrapper(n)}}},e.prototype.parseDrawingWrapper=function(e){for(var t={type:n.DomType.Drawing,children:[],style:{}},r="anchor"==e.localName,a=null,s=p.boolAttr(e,"simplePos"),o={relative:"page",align:"left",offset:"0"},l={relative:"page",align:"top",offset:"0"},i=0,u=p.elements(e);i<u.length;i++){var d=u[i];switch(d.localName){case"simplePos":s&&(o.offset=p.sizeAttr(d,"x",c.Emu),l.offset=p.sizeAttr(d,"y",c.Emu));break;case"extent":t.style.width=p.sizeAttr(d,"cx",c.Emu),t.style.height=p.sizeAttr(d,"cy",c.Emu);break;case"positionH":case"positionV":if(!s){var h="positionH"==d.localName?o:l,m=p.byTagName(d,"align"),f=p.byTagName(d,"posOffset");m&&(h.align=m.textContent),f&&(h.offset=p.sizeValue(f,c.Emu))}break;case"wrapTopAndBottom":a="wrapTopAndBottom";break;case"wrapNone":a="wrapNone";break;case"graphic":var g=this.parseGraphic(d);g&&t.children.push(g)}}return"wrapTopAndBottom"==a?(t.style.display="block",o.align&&(t.style["text-align"]=o.align,t.style.width="100%")):"wrapNone"==a?(t.style.display="block",t.style.position="relative",t.style.width="0px",t.style.height="0px",o.offset&&(t.style.left=o.offset),l.offset&&(t.style.top=l.offset)):!r||"left"!=o.align&&"right"!=o.align||(t.style.float=o.align),t},e.prototype.parseGraphic=function(e){for(var t=p.byTagName(e,"graphicData"),r=0,n=p.elements(t);r<n.length;r++){var a=n[r];switch(a.localName){case"pic":return this.parsePicture(a)}}return null},e.prototype.parsePicture=function(e){var t={type:n.DomType.Image,src:"",style:{}},r=p.byTagName(e,"blipFill"),a=p.byTagName(r,"blip");t.src=p.stringAttr(a,"embed");var s=p.byTagName(e,"spPr"),o=p.byTagName(s,"xfrm");t.style.position="relative";for(var l=0,i=p.elements(o);l<i.length;l++){var u=i[l];switch(u.localName){case"ext":t.style.width=p.sizeAttr(u,"cx",c.Emu),t.style.height=p.sizeAttr(u,"cy",c.Emu);break;case"off":t.style.left=p.sizeAttr(u,"x",c.Emu),t.style.top=p.sizeAttr(u,"y",c.Emu)}}return t},e.prototype.parseTable=function(e){var t=this,r={type:n.DomType.Table,children:[]};return p.foreach(e,(function(e){switch(e.localName){case"tr":r.children.push(t.parseTableRow(e));break;case"tblGrid":r.columns=t.parseTableColumns(e);break;case"tblPr":t.parseTableProperties(e,r)}})),r},e.prototype.parseTableColumns=function(e){var t=[];return p.foreach(e,(function(e){switch(e.localName){case"gridCol":t.push({width:p.sizeAttr(e,"w")})}})),t},e.prototype.parseTableProperties=function(e,t){var r=this;switch(t.style={},t.cellStyle={},this.parseDefaultProperties(e,t.style,t.cellStyle,(function(e){switch(e.localName){case"tblStyle":t.className=p.className(e,"val");break;case"tblLook":a.addElementClass(t,d.classNameOftblLook(e));break;case"tblpPr":r.parseTablePosition(e,t);break;default:return!1}return!0})),t.style["text-align"]){case"center":delete t.style["text-align"],t.style["margin-left"]="auto",t.style["margin-right"]="auto";break;case"right":delete t.style["text-align"],t.style["margin-left"]="auto"}},e.prototype.parseTablePosition=function(e,t){var r=p.sizeAttr(e,"topFromText"),n=p.sizeAttr(e,"bottomFromText"),a=p.sizeAttr(e,"rightFromText"),s=p.sizeAttr(e,"leftFromText");t.style.float="left",t.style["margin-bottom"]=d.addSize(t.style["margin-bottom"],n),t.style["margin-left"]=d.addSize(t.style["margin-left"],s),t.style["margin-right"]=d.addSize(t.style["margin-right"],a),t.style["margin-top"]=d.addSize(t.style["margin-top"],r)},e.prototype.parseTableRow=function(e){var t=this,r={type:n.DomType.Row,children:[]};return p.foreach(e,(function(e){switch(e.localName){case"tc":r.children.push(t.parseTableCell(e));break;case"trPr":t.parseTableRowProperties(e,r)}})),r},e.prototype.parseTableRowProperties=function(e,t){t.style=this.parseDefaultProperties(e,{},null,(function(e){switch(e.localName){case"cnfStyle":t.className=d.classNameOfCnfStyle(e);break;default:return!1}return!0}))},e.prototype.parseTableCell=function(e){var t=this,r={type:n.DomType.Cell,children:[]};return p.foreach(e,(function(e){switch(e.localName){case"tbl":r.children.push(t.parseTable(e));break;case"p":r.children.push(t.parseParagraph(e));break;case"tcPr":t.parseTableCellProperties(e,r)}})),r},e.prototype.parseTableCellProperties=function(e,t){t.style=this.parseDefaultProperties(e,{},null,(function(e){switch(e.localName){case"gridSpan":t.span=p.intAttr(e,"val",null);break;case"vMerge":break;case"cnfStyle":t.className=d.classNameOfCnfStyle(e);break;default:return!1}return!0}))},e.prototype.parseDefaultProperties=function(e,r,n,a){var s=this;void 0===r&&(r=null),void 0===n&&(n=null),void 0===a&&(a=null),r=r||{};return p.foreach(e,(function(o){switch(o.localName){case"jc":r["text-align"]=d.valueOfJc(o);break;case"textAlignment":r["vertical-align"]=d.valueOfTextAlignment(o);break;case"color":r.color=p.colorAttr(o,"val",null,t.autos.color);break;case"sz":r["font-size"]=r["min-height"]=p.sizeAttr(o,"val",c.FontSize);break;case"shd":r["background-color"]=p.colorAttr(o,"fill",null,t.autos.shd);break;case"highlight":r["background-color"]=p.colorAttr(o,"val",null,t.autos.highlight);break;case"tcW":if(s.ignoreWidth)break;case"tblW":r.width=d.valueOfSize(o,"w");break;case"trHeight":s.parseTrHeight(o,r);break;case"strike":r["text-decoration"]=d.valueOfStrike(o);break;case"b":r["font-weight"]=d.valueOfBold(o);break;case"i":r["font-style"]="italic";break;case"u":s.parseUnderline(o,r);break;case"ind":case"tblInd":s.parseIndentation(o,r);break;case"rFonts":s.parseFont(o,r);break;case"tblBorders":s.parseBorderProperties(o,n||r);break;case"tblCellSpacing":r["border-spacing"]=d.valueOfMargin(o),r["border-collapse"]="separate";break;case"pBdr":s.parseBorderProperties(o,r);break;case"bdr":r.border=d.valueOfBorder(o);break;case"tcBorders":s.parseBorderProperties(o,r);break;case"noWrap":break;case"tblCellMar":case"tcMar":s.parseMarginProperties(o,n||r);break;case"tblLayout":r["table-layout"]=d.valueOfTblLayout(o);break;case"vAlign":r["vertical-align"]=p.stringAttr(o,"val");break;case"spacing":"pPr"==e.localName&&s.parseSpacing(o,r);break;case"lang":case"noProof":case"webHidden":break;default:null==a||a(o)||s.debug&&console.warn("DOCX: Unknown document element: "+o.localName)}})),r},e.prototype.parseUnderline=function(e,t){var r=p.stringAttr(e,"val");if(null!=r&&"none"!=r){switch(r){case"dash":case"dashDotDotHeavy":case"dashDotHeavy":case"dashedHeavy":case"dashLong":case"dashLongHeavy":case"dotDash":case"dotDotDash":t["text-decoration-style"]="dashed";break;case"dotted":case"dottedHeavy":t["text-decoration-style"]="dotted";break;case"double":t["text-decoration-style"]="double";break;case"single":case"thick":t["text-decoration"]="underline";break;case"wave":case"wavyDouble":case"wavyHeavy":t["text-decoration-style"]="wavy";break;case"words":t["text-decoration"]="underline"}var n=p.colorAttr(e,"color");n&&(t["text-decoration-color"]=n)}},e.prototype.parseFont=function(e,t){var r=p.stringAttr(e,"ascii");r&&(t["font-family"]=r)},e.prototype.parseIndentation=function(e,t){var r=p.sizeAttr(e,"firstLine"),n=p.sizeAttr(e,"left"),a=p.sizeAttr(e,"start"),s=p.sizeAttr(e,"right"),o=p.sizeAttr(e,"end");r&&(t["text-indent"]=r),(n||a)&&(t["margin-left"]=n||a),(s||o)&&(t["margin-right"]=s||o)},e.prototype.parseSpacing=function(e,t){var r=p.sizeAttr(e,"before"),n=p.sizeAttr(e,"after"),a=p.intAttr(e,"line",null),s=p.stringAttr(e,"lineRule");if(r&&(t["margin-top"]=r),n&&(t["margin-bottom"]=n),null!==a)switch(s){case"auto":t["line-height"]=""+(a/240).toFixed(2);break;case"atLeast":t["line-height"]="calc(100% + "+a/20+"pt)";break;default:t["line-height"]=t["min-height"]=a/20+"pt"}},e.prototype.parseMarginProperties=function(e,t){p.foreach(e,(function(e){switch(e.localName){case"left":t["padding-left"]=d.valueOfMargin(e);break;case"right":t["padding-right"]=d.valueOfMargin(e);break;case"top":t["padding-top"]=d.valueOfMargin(e);break;case"bottom":t["padding-bottom"]=d.valueOfMargin(e)}}))},e.prototype.parseTrHeight=function(e,t){switch(p.stringAttr(e,"hRule")){case"exact":t.height=p.sizeAttr(e,"val");break;case"atLeast":default:t.height=p.sizeAttr(e,"val")}},e.prototype.parseBorderProperties=function(e,t){p.foreach(e,(function(e){switch(e.localName){case"start":case"left":t["border-left"]=d.valueOfBorder(e);break;case"end":case"right":t["border-right"]=d.valueOfBorder(e);break;case"top":t["border-top"]=d.valueOfBorder(e);break;case"bottom":t["border-bottom"]=d.valueOfBorder(e)}}))},e}();t.DocumentParser=u,function(e){e[e.FontSize=0]="FontSize",e[e.Dxa=1]="Dxa",e[e.Emu=2]="Emu",e[e.Border=3]="Border",e[e.Percent=4]="Percent"}(c||(c={}));var p=function(){function e(){}return e.parse=function(e,t){return void 0===t&&(t=!0),t&&(e=e.replace(/<[?].*[?]>/,"")),(new DOMParser).parseFromString(e,"application/xml").firstChild},e.elements=function(e,t){void 0===t&&(t=null);for(var r=[],n=0;n<e.childNodes.length;n++){var a=e.childNodes[n];1!=a.nodeType||null!=t&&a.localName!=t||r.push(a)}return r},e.foreach=function(e,t){for(var r=0;r<e.childNodes.length;r++){var n=e.childNodes[r];1==n.nodeType&&t(n)}},e.byTagName=function(e,t){for(var r=0;r<e.childNodes.length;r++){var n=e.childNodes[r];if(1==n.nodeType&&n.localName==t)return e.childNodes[r]}return null},e.elementStringAttr=function(t,r,n){var a=e.byTagName(t,r);return a?e.stringAttr(a,n):null},e.stringAttr=function(e,t){for(var r=e,n=0;n<r.attributes.length;n++){var a=r.attributes.item(n);if(a.localName==t)return a.value}return null},e.colorAttr=function(t,r,n,a){void 0===n&&(n=null),void 0===a&&(a="black");var s=e.stringAttr(t,r);switch(s){case"yellow":return s;case"auto":return a}return s?"#"+s:n},e.boolAttr=function(t,r,n){switch(void 0===n&&(n=!1),e.stringAttr(t,r)){case"1":return!0;case"0":return!1}return n},e.intAttr=function(t,r,n){return void 0===n&&(n=0),e.stringAttr(t,r)?parseInt(e.stringAttr(t,r)):n},e.sizeAttr=function(t,r,n){return void 0===n&&(n=c.Dxa),e.convertSize(e.stringAttr(t,r),n)},e.sizeValue=function(t,r){return void 0===r&&(r=c.Dxa),e.convertSize(t.textContent,r)},e.convertSize=function(e,t){if(void 0===t&&(t=c.Dxa),null==e||e.indexOf("pt")>-1)return e;var r=parseInt(e);switch(t){case c.Dxa:return(.05*r).toFixed(2)+"pt";case c.Emu:return(r/12700).toFixed(2)+"pt";case c.FontSize:return(.5*r).toFixed(2)+"pt";case c.Border:return(.125*r).toFixed(2)+"pt";case c.Percent:return(.02*r).toFixed(2)+"%"}return e},e.className=function(t,r){var n=e.stringAttr(t,r);return n&&n.replace(/[ .]+/g,"-").replace(/[&]+/g,"and")},e}(),d=function(){function e(){}return e.valueOfBold=function(e){return p.boolAttr(e,"val",!0)?"bold":"normal"},e.valueOfSize=function(e,t){var r=c.Dxa;switch(p.stringAttr(e,"type")){case"dxa":break;case"pct":r=c.Percent}return p.sizeAttr(e,t,r)},e.valueOfStrike=function(e){return p.boolAttr(e,"val",!0)?"line-through":"none"},e.valueOfMargin=function(e){return p.sizeAttr(e,"w")},e.valueOfRelType=function(e){switch(p.sizeAttr(e,"Type")){case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings":return n.DomRelationshipType.Settings;case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme":return n.DomRelationshipType.Theme;case"http://schemas.microsoft.com/office/2007/relationships/stylesWithEffects":return n.DomRelationshipType.StylesWithEffects;case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles":return n.DomRelationshipType.Styles;case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable":return n.DomRelationshipType.FontTable;case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image":return n.DomRelationshipType.Image;case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings":return n.DomRelationshipType.WebSettings}return n.DomRelationshipType.Unknown},e.valueOfBorder=function(e){if("nil"==p.stringAttr(e,"val"))return"none";var t=p.colorAttr(e,"color");return p.sizeAttr(e,"sz",c.Border)+" solid "+("auto"==t?"black":t)},e.valueOfTblLayout=function(e){return"fixed"==p.stringAttr(e,"val")?"fixed":"auto"},e.classNameOfCnfStyle=function(e){var t="",r=p.stringAttr(e,"val");return"1"==r[0]&&(t+=" first-row"),"1"==r[1]&&(t+=" last-row"),"1"==r[2]&&(t+=" first-col"),"1"==r[3]&&(t+=" last-col"),"1"==r[4]&&(t+=" odd-col"),"1"==r[5]&&(t+=" even-col"),"1"==r[6]&&(t+=" odd-row"),"1"==r[7]&&(t+=" even-row"),"1"==r[8]&&(t+=" ne-cell"),"1"==r[9]&&(t+=" nw-cell"),"1"==r[10]&&(t+=" se-cell"),"1"==r[11]&&(t+=" sw-cell"),t.trim()},e.valueOfJc=function(e){var t=p.stringAttr(e,"val");switch(t){case"start":case"left":return"left";case"center":return"center";case"end":case"right":return"right";case"both":return"justify"}return t},e.valueOfTextAlignment=function(e){var t=p.stringAttr(e,"val");switch(t){case"auto":case"baseline":return"baseline";case"top":return"top";case"center":return"middle";case"bottom":return"bottom"}return t},e.addSize=function(e,t){return null==e?t:null==t?e:"calc("+e+" + "+t+")"},e.checkMask=function(e,t){return(e&t)==t},e.classNameOftblLook=function(e){var t="";return p.boolAttr(e,"firstColumn")&&(t+=" first-col"),p.boolAttr(e,"firstRow")&&(t+=" first-row"),p.boolAttr(e,"lastColumn")&&(t+=" lat-col"),p.boolAttr(e,"lastRow")&&(t+=" last-row"),p.boolAttr(e,"noHBand")&&(t+=" no-hband"),p.boolAttr(e,"noVBand")&&(t+=" no-vband"),t.trim()},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),a=r(0),s=r(4);t.parseParagraphProperties=function(e,t){if(e.namespaceURI!=a.ns.wordml)return!1;switch(e.localName){case"tabs":t.tabs=function(e){return n.elements(e,a.ns.wordml,"tab").map((function(e){return{position:n.lengthAttr(e,a.ns.wordml,"pos"),leader:n.stringAttr(e,a.ns.wordml,"leader"),style:n.stringAttr(e,a.ns.wordml,"val")}}))}(e);break;case"sectPr":t.sectionProps=s.parseSectionProperties(e);break;case"numPr":t.numbering=function(e){for(var t={},r=0,s=n.elements(e,a.ns.wordml);r<s.length;r++){var o=s[r];switch(o.localName){case"numId":t.id=n.stringAttr(o,a.ns.wordml,"val");break;case"ilvl":t.level=n.intAttr(o,a.ns.wordml,"val")}}return t}(e);break;case"spacing":return t.lineSpacing=function(e){return{before:n.lengthAttr(e,a.ns.wordml,"before"),after:n.lengthAttr(e,a.ns.wordml,"after"),line:n.intAttr(e,a.ns.wordml,"line"),lineRule:n.stringAttr(e,a.ns.wordml,"lineRule")}}(e),!1;default:return!1}return!0}},function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),s=r(3),o=r(11),l=function(){function e(e){this.htmlDocument=e,this.inWrapper=!0,this.className="docx"}return e.prototype.render=function(e,t,r,n){void 0===r&&(r=null),this.document=e,this.options=n,c(r=r||t),c(t),p(r,"docxjs library predefined styles"),r.appendChild(this.renderDefaultStyle()),p(r,"docx document styles"),r.appendChild(this.renderStyles(e.styles)),e.numbering&&(p(r,"docx document numbering styles"),r.appendChild(this.renderNumbering(e.numbering,r))),n.ignoreFonts||this.renderFontTable(e.fontTable,r);var a=this.renderSections(e.document);if(this.inWrapper){var s=this.renderWrapper();i(s,a),t.appendChild(s)}else i(t,a)},e.prototype.renderFontTable=function(e,t){for(var r=function(e){n.document.loadFont(e.refId,e.fontKey).then((function(r){var n='@font-face {\n font-family: "'+e.name+'";\n src: url('+r+");\n }";p(t,"Font "+e.name),t.appendChild(u(n))}))},n=this,a=0,s=e.filter((function(e){return e.refId}));a<s.length;a++){r(s[a])}},e.prototype.processClassName=function(e){return e?this.className+"_"+e:this.className},e.prototype.processStyles=function(e){for(var t={},r=0,n=e.filter((function(e){return null!=e.id}));r<n.length;r++){t[(m=n[r]).id]=m}for(var a=0,s=e.filter((function(e){return e.basedOn}));a<s.length;a++){var o=t[(m=s[a]).basedOn];if(o)for(var l,i=function(e){(l=o.styles.filter((function(t){return t.target==e.target})))&&l.length>0&&c.copyStyleProperties(l[0].values,e.values)},c=this,u=0,p=m.styles;u<p.length;u++){i(p[u])}else this.options.debug&&console.warn("Can't find base style "+m.basedOn)}for(var d=0,h=e;d<h.length;d++){var m;(m=h[d]).id=this.processClassName(m.id)}return t},e.prototype.processElement=function(e){if(e.children)for(var t=0,r=e.children;t<r.length;t++){var n=r[t];n.className=this.processClassName(n.className),n.parent=e,n.type==a.DomType.Table?this.processTable(n):this.processElement(n)}},e.prototype.processTable=function(e){for(var t=0,r=e.children;t<r.length;t++)for(var n=0,a=r[t].children;n<a.length;n++){var s=a[n];s.style=this.copyStyleProperties(e.cellStyle,s.style,["border-left","border-right","border-top","border-bottom","padding-left","padding-right","padding-top","padding-bottom"]),this.processElement(s)}},e.prototype.copyStyleProperties=function(e,t,r){if(void 0===r&&(r=null),!e)return t;null==t&&(t={}),null==r&&(r=Object.getOwnPropertyNames(e));for(var n=0,a=r;n<a.length;n++){var s=a[n];e.hasOwnProperty(s)&&!t.hasOwnProperty(s)&&(t[s]=e[s])}return t},e.prototype.createSection=function(e,t){var r=this.htmlDocument.createElement("section");return r.className=e,t&&(t.pageMargins&&(r.style.paddingLeft=this.renderLength(t.pageMargins.left),r.style.paddingRight=this.renderLength(t.pageMargins.right),r.style.paddingTop=this.renderLength(t.pageMargins.top),r.style.paddingBottom=this.renderLength(t.pageMargins.bottom)),t.pageSize&&(this.options.ignoreWidth||(r.style.width=this.renderLength(t.pageSize.width)),this.options.ignoreHeight||(r.style.minHeight=this.renderLength(t.pageSize.height))),t.columns&&t.columns.numberOfColumns&&(r.style.columnCount=""+t.columns.numberOfColumns,r.style.columnGap=this.renderLength(t.columns.space),t.columns.separator&&(r.style.columnRule="1px solid black"))),r},e.prototype.renderSections=function(e){var t=[];this.processElement(e);for(var r=0,n=this.splitBySection(e.children);r<n.length;r++){var a=n[r],s=this.createSection(this.className,a.sectProps||e.props);this.renderElements(a.elements,e,s),t.push(s)}return t},e.prototype.splitBySection=function(e){for(var t={sectProps:null,elements:[]},r=[t],s=0,o=e;s<o.length;s++){var l=o[s];if(t.elements.push(l),l.type==a.DomType.Paragraph){var i=l,c=i.props.sectionProps,u=-1,p=-1;if(this.options.breakPages&&i.children&&(u=i.children.findIndex((function(e){var t,r;return r=null===(t=e.children)||void 0===t?void 0:t.findIndex((function(e){return"page"==e.break})),-1!=(p=null!=r?r:-1)}))),(c||-1!=u)&&(t.sectProps=c,t={sectProps:null,elements:[]},r.push(t)),-1!=u){var d=i.children[u],h=p<d.children.length-1;if(u<i.children.length-1||h){var m=l.children,f=n(n({},l),{children:m.slice(u)});if(l.children=m.slice(0,u),t.elements.push(f),h){var g=d.children,b=n(n({},d),{children:g.slice(0,p)});l.children.push(b),d.children=g.slice(p)}}}}}return r},e.prototype.renderLength=function(e){return e?""+e.value+e.type:null},e.prototype.renderWrapper=function(){var e=document.createElement("div");return e.className=this.className+"-wrapper",e},e.prototype.renderDefaultStyle=function(){return u("."+this.className+"-wrapper { background: gray; padding: 30px; padding-bottom: 0px; display: flex; flex-flow: column; align-items: center; } \n ."+this.className+"-wrapper section."+this.className+" { background: white; box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); margin-bottom: 30px; }\n ."+this.className+" { color: black; }\n section."+this.className+" { box-sizing: border-box; }\n ."+this.className+" table { border-collapse: collapse; }\n ."+this.className+" table td, ."+this.className+" table th { vertical-align: top; }\n ."+this.className+" p { margin: 0pt; }")},e.prototype.renderNumbering=function(e,t){for(var r,a,s=this,o="",l=[],i=function(){if(r="p."+c.numberingClass(h.id,h.level),a="none",h.levelText&&"decimal"==h.format){var e=c.numberingCounter(h.id,h.level);h.level>0?o+=c.styleToString("p."+c.numberingClass(h.id,h.level-1),{"counter-reset":e}):l.push(e),o+=c.styleToString(r+":before",{content:c.levelTextToContent(h.levelText,h.id),"counter-increment":e}),o+=c.styleToString(r,n({display:"list-item","list-style-position":"inside","list-style-type":"none"},h.style))}else if(h.bullet){var i=("--"+c.className+"-"+h.bullet.src).toLowerCase();o+=c.styleToString(r+":before",{content:"' '",display:"inline-block",background:"var("+i+")"},h.bullet.style),c.document.loadNumberingImage(h.bullet.src).then((function(e){var r="."+s.className+"-wrapper { "+i+": url("+e+") }";t.appendChild(u(r))}))}else a=c.numFormatToCssValue(h.format);o+=c.styleToString(r,n({display:"list-item","list-style-position":"inside","list-style-type":a},h.style))},c=this,p=0,d=e;p<d.length;p++){var h=d[p];i()}return l.length>0&&(o+=this.styleToString("."+this.className+"-wrapper",{"counter-reset":l.join(" ")})),u(o)},e.prototype.renderStyles=function(e){for(var t="",r=this.processStyles(e),n=0,a=e;n<a.length;n++){var s=a[n],o=s.styles;if(s.linked){var l=s.linked&&r[s.linked];l?o=o.concat(l.styles):this.options.debug&&console.warn("Can't find linked style "+s.linked)}for(var i=0,c=o;i<c.length;i++){var p=c[i],d="";s.target==p.target?d+=s.target+"."+s.id:s.target?d+=s.target+"."+s.id+" "+p.target:d+="."+s.id+" "+p.target,s.isDefault&&s.target&&(d="."+this.className+" "+s.target+", "+d),t+=this.styleToString(d,p.values)}}return u(t)},e.prototype.renderElement=function(e,t){switch(e.type){case a.DomType.Paragraph:return this.renderParagraph(e);case a.DomType.Run:return this.renderRun(e);case a.DomType.Table:return this.renderTable(e);case a.DomType.Row:return this.renderTableRow(e);case a.DomType.Cell:return this.renderTableCell(e);case a.DomType.Hyperlink:return this.renderHyperlink(e);case a.DomType.Drawing:return this.renderDrawing(e);case a.DomType.Image:return this.renderImage(e);case a.DomType.Text:return this.renderText(e);case a.DomType.Tab:return this.renderTab(e);case a.DomType.Symbol:return this.renderSymbol(e)}return null},e.prototype.renderChildren=function(e,t){return this.renderElements(e.children,e,t)},e.prototype.renderElements=function(e,t,r){var n=this;if(null==e)return null;var a=e.map((function(e){return n.renderElement(e,t)})).filter((function(e){return null!=e}));if(r)for(var s=0,o=a;s<o.length;s++){var l=o[s];r.appendChild(l)}return a},e.prototype.renderParagraph=function(e){var t=this.htmlDocument.createElement("p");if(this.renderClass(e,t),this.renderChildren(e,t),this.renderStyleValues(e.style,t),this.renderCommonProeprties(t,e.props),e.props.numbering){var r=this.numberingClass(e.props.numbering.id,e.props.numbering.level);t.className=s.appendClass(t.className,r)}return t},e.prototype.renderCommonProeprties=function(e,t){null!=t&&(t.color&&(e.style.color=t.color),t.fontSize&&(e.style.fontSize=this.renderLength(t.fontSize)))},e.prototype.renderHyperlink=function(e){var t=this.htmlDocument.createElement("a");return this.renderChildren(e,t),this.renderStyleValues(e.style,t),e.href&&(t.href=e.href),t},e.prototype.renderDrawing=function(e){var t=this.htmlDocument.createElement("div");return t.style.display="inline-block",t.style.position="relative",t.style.textIndent="0px",this.renderChildren(e,t),this.renderStyleValues(e.style,t),t},e.prototype.renderImage=function(e){var t=this.htmlDocument.createElement("img");return this.renderStyleValues(e.style,t),this.document&&this.document.loadDocumentImage(e.src).then((function(e){t.src=e})),t},e.prototype.renderText=function(e){return this.htmlDocument.createTextNode(e.text)},e.prototype.renderSymbol=function(e){var t=this.htmlDocument.createElement("span");return t.style.fontFamily=e.font,t.innerHTML="&#x"+e.char+";",t},e.prototype.renderTab=function(e){var t=this.htmlDocument.createElement("span");return t.innerHTML=" ",this.options.experimental&&setTimeout((function(){var r=function(e,t){var r=e.parent;for(;null!=r&&r.type!=t;)r=r.parent;return r}(e,a.DomType.Paragraph);r.props.tabs.sort((function(e,t){return e.position.value-t.position.value})),t.style.display="inline-block",o.updateTabStop(t,r.props.tabs)}),0),t},e.prototype.renderRun=function(e){if(e.break)return"page"==e.break?null:this.htmlDocument.createElement("br");if(e.fldCharType||e.instrText)return null;var t=this.htmlDocument.createElement("span");if(e.id&&(t.id=e.id),this.renderClass(e,t),this.renderChildren(e,t),this.renderStyleValues(e.style,t),e.href){var r=this.htmlDocument.createElement("a");return r.href=e.href,r.appendChild(t),r}if(e.wrapper){var n=this.htmlDocument.createElement(e.wrapper);return n.appendChild(t),n}return t},e.prototype.renderTable=function(e){var t=this.htmlDocument.createElement("table");return this.renderClass(e,t),this.renderChildren(e,t),this.renderStyleValues(e.style,t),e.columns&&t.appendChild(this.renderTableColumns(e.columns)),t},e.prototype.renderTableColumns=function(e){for(var t=this.htmlDocument.createElement("colGroup"),r=0,n=e;r<n.length;r++){var a=n[r],s=this.htmlDocument.createElement("col");a.width&&(s.style.width=a.width+"px"),t.appendChild(s)}return t},e.prototype.renderTableRow=function(e){var t=this.htmlDocument.createElement("tr");return this.renderClass(e,t),this.renderChildren(e,t),this.renderStyleValues(e.style,t),t},e.prototype.renderTableCell=function(e){var t=this.htmlDocument.createElement("td");return this.renderClass(e,t),this.renderChildren(e,t),this.renderStyleValues(e.style,t),e.span&&(t.colSpan=e.span),t},e.prototype.renderStyleValues=function(e,t){if(null!=e)for(var r in e)e.hasOwnProperty(r)&&(t.style[r]=e[r])},e.prototype.renderClass=function(e,t){e.className&&(t.className=e.className)},e.prototype.numberingClass=function(e,t){return this.className+"-num-"+e+"-"+t},e.prototype.styleToString=function(e,t,r){void 0===r&&(r=null);var n=e+" {\r\n";for(var a in t)n+=" "+a+": "+t[a]+";\r\n";return r&&(n+=";"+r),n+"}\r\n"},e.prototype.numberingCounter=function(e,t){return this.className+"-num-"+e+"-"+t},e.prototype.levelTextToContent=function(e,t){var r=this;return'"'+e.replace(/%\d*/g,(function(e){var n=parseInt(e.substring(1),10)-1;return'"counter('+r.numberingCounter(t,n)+')"'}))+'"'},e.prototype.numFormatToCssValue=function(e){return{none:"none",bullet:"disc",decimal:"decimal",lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman"}[e]||e},e}();function i(e,t){for(var r=0,n=t;r<n.length;r++){var a=n[r];e.appendChild(a)}}function c(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function u(e){var t=document.createElement("style");return t.type="text/css",t.innerHTML=e,t}function p(e,t){e.appendChild(document.createComment(t))}t.HtmlRenderer=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateTabStop=function(e,t,r){void 0===r&&(r=.75);var n=e.closest("p"),a=e.getBoundingClientRect(),s=n.getBoundingClientRect(),o=(a.left-s.left)*r,l=t.find((function(e){return"clear"!=e.style&&e.position.value>o}));if(null!=l)switch(e.style.display="inline-block",e.style.width=l.position.value-o+"pt",l.leader){case"dot":case"middleDot":e.style.borderBottom="1px black dotted";break;case"hyphen":case"heavy":case"underscore":e.style.borderBottom="1px black solid"}}}])}));
//# sourceMappingURL=docx-preview.min.js.map