@syncfusion/ej2-docx-renderer 0.0.0-stage → 35.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/base.d.ts +4 -0
- package/base.js +4 -0
- package/dist/ej2-docx-renderer.umd.min.js +2 -0
- package/dist/ej2-docx-renderer.umd.min.js.map +1 -0
- package/dist/es6/ej2-docx-renderer.es2015.js +52432 -0
- package/dist/es6/ej2-docx-renderer.es2015.js.map +1 -0
- package/dist/es6/ej2-docx-renderer.es5.js +54425 -0
- package/dist/es6/ej2-docx-renderer.es5.js.map +1 -0
- package/dist/global/ej2-docx-renderer.min.js +2 -0
- package/dist/global/ej2-docx-renderer.min.js.map +1 -0
- package/dist/global/index.d.ts +5 -0
- package/format.d.ts +4 -0
- package/format.js +4 -0
- package/helper.d.ts +4 -0
- package/helper.js +4 -0
- package/index.d.ts +4 -0
- package/index.js +4 -0
- package/license +10 -0
- package/list.d.ts +4 -0
- package/list.js +4 -0
- package/package.json +26 -4
- package/parser.d.ts +4 -0
- package/parser.js +4 -0
- package/src/base/constants.d.ts +2 -0
- package/src/base/constants.js +2 -0
- package/src/base/dictionary.d.ts +52 -0
- package/src/base/dictionary.js +137 -0
- package/src/base/index.d.ts +9 -0
- package/src/base/index.js +9 -0
- package/src/base/keywords.d.ts +422 -0
- package/src/base/keywords.js +422 -0
- package/src/base/types.d.ts +2590 -0
- package/src/base/types.js +1056 -0
- package/src/base/unique-format.d.ts +87 -0
- package/src/base/unique-format.js +858 -0
- package/src/base/unique-formats.d.ts +32 -0
- package/src/base/unique-formats.js +87 -0
- package/src/document-canvas.d.ts +61 -0
- package/src/document-canvas.js +221 -0
- package/src/docx-renderer.d.ts +941 -0
- package/src/docx-renderer.js +2251 -0
- package/src/format/border.d.ts +53 -0
- package/src/format/border.js +600 -0
- package/src/format/borders.d.ts +44 -0
- package/src/format/borders.js +314 -0
- package/src/format/cell-format.d.ts +42 -0
- package/src/format/cell-format.js +309 -0
- package/src/format/character-format.d.ts +152 -0
- package/src/format/character-format.js +1224 -0
- package/src/format/index.d.ts +14 -0
- package/src/format/index.js +14 -0
- package/src/format/list-format.d.ts +32 -0
- package/src/format/list-format.js +238 -0
- package/src/format/paragraph-format.d.ts +103 -0
- package/src/format/paragraph-format.js +854 -0
- package/src/format/row-format.d.ts +119 -0
- package/src/format/row-format.js +545 -0
- package/src/format/section-format.d.ts +89 -0
- package/src/format/section-format.js +689 -0
- package/src/format/shading.d.ts +24 -0
- package/src/format/shading.js +137 -0
- package/src/format/style.d.ts +106 -0
- package/src/format/style.js +286 -0
- package/src/format/table-format.d.ts +51 -0
- package/src/format/table-format.js +395 -0
- package/src/global.js +1 -0
- package/src/helper/document-editor-helper.d.ts +515 -0
- package/src/helper/document-editor-helper.js +1302 -0
- package/src/helper/document-editor-settings.d.ts +293 -0
- package/src/helper/document-editor-settings.js +94 -0
- package/src/helper/index.d.ts +5 -0
- package/src/helper/index.js +5 -0
- package/src/helper/layout-helper-methods.d.ts +539 -0
- package/src/helper/layout-helper-methods.js +1065 -0
- package/src/helper/renderer-hooks.d.ts +74 -0
- package/src/helper/renderer-hooks.js +14 -0
- package/src/helper/revision-helper-methods.d.ts +199 -0
- package/src/helper/revision-helper-methods.js +362 -0
- package/src/index.d.ts +18 -0
- package/src/index.js +18 -0
- package/src/layout-helper.d.ts +190 -0
- package/src/layout-helper.js +1368 -0
- package/src/layout.d.ts +779 -0
- package/src/layout.js +17232 -0
- package/src/list/abstract-list.d.ts +25 -0
- package/src/list/abstract-list.js +67 -0
- package/src/list/index.d.ts +7 -0
- package/src/list/index.js +7 -0
- package/src/list/level-override.d.ts +22 -0
- package/src/list/level-override.js +43 -0
- package/src/list/list-level.d.ts +57 -0
- package/src/list/list-level.js +249 -0
- package/src/list/list.d.ts +30 -0
- package/src/list/list.js +100 -0
- package/src/page.d.ts +4155 -0
- package/src/page.js +11342 -0
- package/src/parser/index.d.ts +1 -0
- package/src/parser/index.js +1 -0
- package/src/parser/sfdt-reader.d.ts +254 -0
- package/src/parser/sfdt-reader.js +4569 -0
- package/src/render.d.ts +226 -0
- package/src/render.js +4222 -0
- package/src/text-helper.d.ts +144 -0
- package/src/text-helper.js +1079 -0
- package/src/text-helpers/index.d.ts +2 -0
- package/src/text-helpers/index.js +2 -0
- package/src/text-helpers/optimized.d.ts +45 -0
- package/src/text-helpers/optimized.js +121 -0
- package/src/text-helpers/regular.d.ts +37 -0
- package/src/text-helpers/regular.js +93 -0
- package/src/themes/font-scheme.d.ts +28 -0
- package/src/themes/font-scheme.js +107 -0
- package/src/themes/index.d.ts +6 -0
- package/src/themes/index.js +6 -0
- package/src/themes/major-minor-font-scheme.d.ts +14 -0
- package/src/themes/major-minor-font-scheme.js +45 -0
- package/src/themes/themes.d.ts +11 -0
- package/src/themes/themes.js +31 -0
- package/src/utility/index.d.ts +1 -0
- package/src/utility/index.js +1 -0
- package/src/utility/path-util.d.ts +133 -0
- package/src/utility/path-util.js +639 -0
- package/text-helpers.d.ts +4 -0
- package/text-helpers.js +4 -0
- package/themes.d.ts +4 -0
- package/themes.js +4 -0
- package/utility.d.ts +4 -0
- package/utility.js +4 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
this.ej=this.ej||{},this.ej.docxrenderer=function(e,t,i,r){"use strict";function n(e){var t,i=[],r=s(e);if(r.length>0)for(var n=0;n<r.length;n++){var o=r[parseInt(n.toString(),10)],a="";switch((a=o[0]).toLowerCase()){case"m":for(t=1;t<o.length;t++)i.push({command:a,x:o[parseInt(t.toString(),10)],y:o[t+1]}),t+=1,"m"===a?a="l":"M"===a&&(a="L");break;case"l":case"t":for(t=1;t<o.length;t++)i.push({command:a,x:o[parseInt(t.toString(),10)],y:o[t+1]}),t+=1;break;case"h":for(t=1;t<o.length;t++)i.push({command:a,x:o[parseInt(t.toString(),10)]});break;case"v":for(t=1;t<o.length;t++)i.push({command:a,y:o[parseInt(t.toString(),10)]});break;case"z":i.push({command:a});break;case"c":for(t=1;t<o.length;t++)i.push({command:a,x1:o[parseInt(t.toString(),10)],y1:o[t+1],x2:o[t+2],y2:o[t+3],x:o[t+4],y:o[t+5]}),t+=5;break;case"s":for(t=1;t<o.length;t++)i.push({command:a,x2:o[parseInt(t.toString(),10)],y2:o[t+1],x:o[t+2],y:o[t+3]}),t+=3;break;case"q":for(t=1;t<o.length;t++)i.push({command:a,x1:o[parseInt(t.toString(),10)],y1:o[t+1],x:o[t+2],y:o[t+3]}),t+=3;break;case"a":for(t=1;t<o.length;t++)i.push({command:a,r1:o[parseInt(t.toString(),10)],r2:o[t+1],angle:o[t+2],largeArc:o[t+3],sweep:o[t+4],x:o[t+5],y:o[t+6]}),t+=6}}return i}function o(e){var t,i="";for(t=0;t<e.length;t++)i+=0===t?a(e[parseInt(t.toString(),10)]):" "+a(e[parseInt(t.toString(),10)]);return i}function a(e){var t="";switch(e.command){case"Z":case"z":t=e.command;break;case"M":case"m":case"L":case"l":t=e.command+" "+e.x+" "+e.y;break;case"C":case"c":t=e.command+" "+e.x1+" "+e.y1+" "+e.x2+" "+e.y2+" "+e.x+" "+e.y;break;case"Q":case"q":t=e.command+" "+e.x1+" "+e.y1+" "+e.x+" "+e.y;break;case"A":case"a":var i=e.command,r=e.angle,n=e.largeArc?"1":"0",o=e.sweep?"1":"0";t=i+" "+e.r1+" "+e.r2+" "+r+" "+n+" "+o+" "+e.x+" "+e.y;break;case"H":case"h":t=e.command+" "+e.x;break;case"V":case"v":t=e.command+" "+e.y;break;case"S":case"s":t=e.command+" "+e.x2+" "+e.y2+" "+e.x+" "+e.y;break;case"T":case"t":t=e.command+" "+e.x+" "+e.y}return t}function s(e){var t=/([a-z]+)|([+-]?(?:\d+\.?\d*|\.\d+))/gi,i=[],r=[],n={};t.lastIndex=0;var o=!1;for(n=t.exec(e);n;)"e"===n[1]?o=!0:n[1]?("zm"===n[1].toLowerCase()?(i.length&&r.push(i),r.push(["Z"]),i=[n[1].substring(1,2)]):(i.length&&r.push(i),i=[n[1]]),o=!1):(i.length||(i=[]),o||i.push(Number(n[2])),o=!1),n=t.exec(e);return i.length&&r.push(i),r}function l(e){var t,i,r,n,o,a,s,l,d,h;for(s=0,l=0,h=0,d=e.length;h<d;++h){var c=e[parseInt(h.toString(),10)],g=c.command;if(/[MLHVCSQTA]/.test(g))"x"in c&&(c.x=s=c.x),"y"in c&&(c.y=l=c.y);else{"x1"in c&&(c.x1=r=s+c.x1),"x2"in c&&(c.x2=o=s+c.x2),"y1"in c&&(c.y1=n=l+c.y1),"y2"in c&&(c.y2=a=l+c.y2),"x"in c&&(c.x=s+=c.x),"y"in c&&(c.y=l+=c.y);var p=void 0;switch(g){case"m":case"M":p={command:"M",x:s,y:l};break;case"l":case"L":p={command:"L",x:s,y:l};break;case"h":case"H":p={command:"H",x:s};break;case"v":case"V":p={command:"V",y:l};break;case"c":case"C":p={command:"C",x:s,y:l,x1:r,y1:n,x2:o,y2:a};break;case"s":case"S":p={command:"S",x:s,y:l,x2:o,y2:a};break;case"q":case"Q":p={command:"Q",x:s,y:l,x1:r,y1:n};break;case"t":case"T":p={command:"T",x:s,y:l};break;case"a":case"A":(p={command:"A",x:s,y:l}).r1=c.r1,p.r2=c.r2,p.angle=c.angle,p.largeArc=c.largeArc,p.sweep=c.sweep;break;case"z":case"Z":p={command:"Z"},s=t,l=i,p=e[parseInt(h.toString(),10)]}p&&(e[parseInt(h.toString(),10)]=p)}"M"!==g&&"m"!==g||(t=s,i=l)}return e}function d(e,t,i,r,n,a,s,l){var d,g,p,u,f,m,y,v,W;for(f=0,m=0,v=0,y=e.length;v<y;++v){var b=e[v],x=b.command;"x"in b&&(f=b.x),"y"in b&&(m=b.y),"y1"in b&&(g=b.y1),"y2"in b&&(u=b.y2),"x1"in b&&(d=b.x1),"x2"in b&&(p=b.x2),r?(void 0!==f&&(f=c(f,t,n,s)),void 0!==m&&(m=c(m,i,a,l)),void 0!==d&&(d=c(d,t,n,s)),void 0!==g&&(g=c(g,i,a,l)),void 0!==p&&(p=c(p,t,n,s)),void 0!==u&&(u=c(u,i,a,l))):(void 0!==f&&(f=Number((f+t).toFixed(2))),void 0!==m&&(m=Number((m+i).toFixed(2))),void 0!==d&&(d=Number((d+t).toFixed(2))),void 0!==g&&(g=Number((g+i).toFixed(2))),void 0!==p&&(p=Number((p+t).toFixed(2))),void 0!==u&&(u=Number((u+i).toFixed(2)))),(W=h(b,x,{x:f,y:m,x1:d,y1:g,x2:p,y2:u,r1:b.r1,r2:b.r2},r,t,i))&&(e[v]=W)}return o(e)}function h(e,t,i,r,n,o){switch(t){case"M":case"L":e.x=i.x,e.y=i.y;break;case"H":e.x=i.x;break;case"V":e.y=i.y;break;case"C":e.x=i.x,e.y=i.y,e.x1=i.x1,e.y1=i.y1,e.x2=i.x2,e.y2=i.y2;break;case"S":e.x=i.x,e.y=i.y,e.x2=i.x2,e.y2=i.y2;break;case"Q":e.x=i.x,e.y=i.y,e.x1=i.x1,e.y1=i.y1;break;case"T":e.x=i.x,e.y=i.y;break;case"A":var a=i.r1,s=i.r2;r&&(i.r1=a*=n,i.r2=s*=o),e.x=i.x,e.y=i.y,e.r1=i.r1,e.r2=i.r2;break;case"z":case"Z":e={command:"Z"}}return e}function c(e,t,i,r){return e!==i?e=r!==i?e*t-(Number(i)*t-Number(i))+(r-Number(i)):Number(e)*t-(Number(i)*t-Number(i)):r!==i&&(e=r),Number(e.toFixed(2))}function g(e){var t,i,r,n,o,a,s,l,d,h,c=[];for(s=0,l=0,h=0,d=e.length;h<d;++h){var g=e[h],p="";p=g.command,"y1"in g&&(n=g.y1),"y2"in g&&(a=g.y2),"x1"in g&&(r=g.x1),"x2"in g&&(o=g.x2),"x"in g&&(s=g.x),"y"in g&&(l=g.y);var u=c[c.length-1];switch(p){case"M":c.push({command:"M",x:s,y:l});break;case"L":c.push({command:"L",x0:t,y0:i,x:s,y:l});break;case"H":c.push({command:"L",x0:t,y0:i,x:s,y:i});break;case"V":c.push({command:"L",x0:t,y0:i,x:t,y:l});break;case"C":c.push({command:"C",x0:t,y0:i,x1:r,y1:n,x2:o,y2:a,x:s,y:l});break;case"S":if(u){var f=void 0,m={x:2*t-(f="C"===u.command||"S"===u.command?{x:u.x2,y:u.y2}:{x:t,y:i}).x,y:2*i-f.y};c.push({command:"C",x0:t,y0:i,x1:m.x,y1:m.y,x2:o,y2:a,x:s,y:l})}break;case"Q":c.push({command:"Q",x0:t,y0:i,x1:r,y1:n,x:s,y:l});break;case"T":if(u){var f=void 0,m={x:2*t-(f="Q"===u.command?{x:u.x1,y:u.y1}:{x:t,y:i}).x,y:2*i-f.y};c.push({command:"Q",x0:t,y0:i,x1:m.x,y1:m.y,x:s,y:l})}break;case"A":var y=g;y.command="A",c.push(y);break;case"Z":case"z":c.push({command:"Z"}),s=t,l=i}t=s,i=l}return c}var p=function(){function e(){this.keysInternal=[],this.valuesInternal=[]}return Object.defineProperty(e.prototype,"length",{get:function(){return this.keysInternal.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"keys",{get:function(){return this.keysInternal},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"values",{get:function(){return this.valuesInternal},enumerable:!0,configurable:!0}),e.prototype.add=function(e,i){if(t.isNullOrUndefined(e))throw new ReferenceError("Provided key or value is not valid.");return this.keysInternal.indexOf(e)<0&&(this.keysInternal.push(e),this.valuesInternal.push(i)),1},e.prototype.get=function(e){if(t.isNullOrUndefined(e))throw new ReferenceError("Provided key is not valid.");var i=this.keysInternal.indexOf(e);return i<0||i>this.keysInternal.length-1?void 0:this.valuesInternal[i]},e.prototype.set=function(e,i){if(t.isNullOrUndefined(e))throw new ReferenceError("Provided key is not valid.");var r=this.keysInternal.indexOf(e);if(r<0||r>this.keysInternal.length-1)throw new RangeError("No item with the specified key has been added.");this.valuesInternal[r]=i},e.prototype.remove=function(e){if(t.isNullOrUndefined(e))throw new ReferenceError("Provided key is not valid.");var i=this.keysInternal.indexOf(e);if(i<0||i>this.keysInternal.length-1)throw new RangeError("No item with the specified key has been added.");return this.keysInternal.splice(i,1),this.valuesInternal.splice(i,1),!0},e.prototype.containsKey=function(e){if(t.isNullOrUndefined(e))throw new ReferenceError("Provided key is not valid.");var i=this.keysInternal.indexOf(e);return!(i<0||i>this.keysInternal.length-1)},e.prototype.clear=function(){this.keysInternal=[],this.valuesInternal=[]},e.prototype.destroy=function(){this.clear(),this.keysInternal=void 0,this.valuesInternal=void 0},e}(),u=function(){function e(e){this.referenceCount=0,this.uniqueFormatType=e,this.propertiesHash=new p}return e.prototype.isEqual=function(e,t,i){var r=!1;switch(this.uniqueFormatType){case 1:r=this.isBorderEqual(e,t,i);break;case 2:r=this.isCharacterFormatEqual(e,t,i);break;case 3:r=this.isParagraphFormatEqual(e,t,i);break;case 4:r=this.isCellFormatEqual(e,t,i);break;case 5:r=this.isShadingEqual(e,t,i);break;case 6:r=this.isRowFormatEqual(e,t,i);break;case 7:r=this.isListFormatEqual(e,t,i);break;case 8:r=this.isTableFormatEqual(e,t,i);break;case 9:r=this.isListLevelEqual(e,t,i);break;case 10:r=this.isSectionFormatEqual(e,t,i);break;case 11:r=this.isColumnFormatEqual(e,t,i)}return r},e.prototype.isNotEqual=function(i,r,n,o,a){var s=void 0,l=e.getPropertyType(a,i);this.propertiesHash.containsKey(l)&&(s=this.propertiesHash.get(l));var d=void 0;return i===n?d=o:r.containsKey(l)&&(d=r.get(l)),!(s===d||!t.isNullOrUndefined(s)&&!t.isNullOrUndefined(d)&&s===d)},e.getPropertyType=function(e,t){var i=0;switch(e){case 1:i=this.getBorderPropertyType(t);break;case 2:i=this.getCharacterFormatPropertyType(t);break;case 3:i=this.getParaFormatPropertyType(t);break;case 4:i=this.getCellFormatPropertyType(t);break;case 5:i=this.getShadingPropertyType(t);break;case 6:i=this.getRowFormatType(t);break;case 7:i=this.getListFormatType(t);break;case 8:i=this.getTableFormatType(t);break;case 9:i=this.getListLevelType(t);break;case 10:i=this.getSectionFormatType(t);break;case 11:i=this.getColumnFormatType(t)}return i},e.getRowFormatType=function(e){switch(e){case"allowBreakAcrossPages":return 1;case"isHeader":return 2;case"height":return 3;case"heightType":return 4;case"gridBefore":return 5;case"gridBeforeWidth":return 6;case"gridBeforeWidthType":return 7;case"gridAfter":return 8;case"gridAfterWidth":return 9;case"gridAfterWidthType":return 10;case"leftMargin":return 11;case"topMargin":return 12;case"bottomMargin":return 13;case"rightMargin":return 14;case"leftIndent":return 15;case"verticallyMergedCellsLeftMargin":return 16;case"verticallyMergedCellsRightMargin":return 17;case"verticallyMergedCellsTopMargin":return 18;case"verticallyMergedCellsBottomMargin":return 19;default:return 0}},e.getListFormatType=function(e){switch(e){case"listId":return 1;case"listLevelNumber":return 2;case"nsid":return 3;default:return 0}},e.getTableFormatType=function(e){switch(e){case"leftMargin":return 1;case"rightMargin":return 2;case"topMargin":return 3;case"bottomMargin":return 4;case"cellSpacing":return 5;case"leftIndent":return 6;case"tableAlignment":return 7;case"preferredWidth":return 8;case"preferredWidthType":return 9;case"bidi":return 10;case"allowAutoFit":return 11;case"horizontalPositionAbs":return 12;case"horizontalPosition":return 13;default:return 0}},e.getListLevelType=function(e){switch(e){case"listLevelPattern":return 1;case"startAt":return 2;case"followCharacter":return 3;case"numberFormat":return 4;case"restartLevel":return 5;case"isLegalStyleNumbering":return 6;case"paraStyleName":return 7;case"numberAlignment":return 8;default:return 0}},e.getShadingPropertyType=function(e){switch(e){case"backgroundColor":return 1;case"foregroundColor":return 2;case"textureStyle":return 3;default:return 0}},e.getCellFormatPropertyType=function(e){switch(e){case"leftMargin":return 1;case"rightMargin":return 2;case"topMargin":return 3;case"bottomMargin":return 4;case"columnSpan":return 5;case"rowSpan":return 6;case"verticalAlignment":return 7;case"preferredWidthType":return 8;case"preferredWidth":return 9;case"cellWidth":return 10;default:return 0}},e.getBorderPropertyType=function(e){switch(e){case"color":return 1;case"lineStyle":return 2;case"lineWidth":return 3;case"shadow":return 4;case"space":return 5;case"hasNoneStyle":return 6;default:return 0}},e.getCharacterFormatPropertyType=function(e){switch(e){case"fontColor":return 1;case"fontFamily":return 2;case"fontSize":return 3;case"bold":return 4;case"italic":return 5;case"underline":return 6;case"strikethrough":return 7;case"baselineAlignment":return 8;case"highlightColor":return 9;case"bidi":return 10;case"bdo":return 11;case"boldBidi":return 12;case"italicBidi":return 13;case"fontFamilyBidi":return 14;case"fontSizeBidi":return 15;case"allCaps":return 16;case"localeIdBidi":return 17;case"complexScript":return 18;case"fontFamilyFarEast":return 19;case"fontFamilyAscii":return 20;case"fontFamilyNonFarEast":return 21;case"localeIdAscii":return 22;case"localeIdFarEast":return 23;case"characterSpacing":return 24;case"scaling":return 25;case"hidden":return 26;case"underlineColor":return 27;case"fontHintType":return 28;case"ligature":return 29;case"specVanish":return 30;case"isKernFont":return 31;case"kern":return 32;default:return 0}},e.getParaFormatPropertyType=function(e){switch(e){case"leftIndent":return 1;case"rightIndent":return 2;case"firstLineIndent":return 3;case"textAlignment":return 4;case"beforeSpacing":return 5;case"afterSpacing":return 6;case"lineSpacing":return 7;case"lineSpacingType":return 8;case"outlineLevel":return 9;case"bidi":return 10;case"contextualSpacing":return 11;case"keepWithNext":return 12;case"keepLinesTogether":return 13;case"widowControl":return 14;case"spaceBeforeAuto":return 15;case"spaceAfterAuto":return 16;default:return 0}},e.getColumnFormatType=function(e){switch(e){case"width":return 1;case"space":return 2;default:return 0}},e.getSectionFormatType=function(e){switch(e){case"headerDistance":return 1;case"footerDistance":return 2;case"differentFirstPage":return 3;case"differentOddAndEvenPages":return 4;case"pageWidth":return 5;case"pageHeight":return 6;case"leftMargin":return 7;case"topMargin":return 8;case"rightMargin":return 9;case"bottomMargin":return 10;case"bidi":return 11;case"restartPageNumbering":return 12;case"pageStartingNumber":return 13;case"endnoteNumberFormat":return 14;case"endnotePosition":return 15;case"footNoteNumberFormat":return 16;case"footnotePosition":return 17;case"restartIndexForEndnotes":return 18;case"restartIndexForFootnotes":return 19;case"initialFootNoteNumber":return 20;case"initialEndNoteNumber":return 21;case"pageNumberStyle":return 22;case"numberOfColumns":return 23;case"equalWidth":return 24;case"lineBetweenColumns":return 25;case"columns":return 26;case"breakCode":return 27;default:return 0}},e.prototype.isBorderEqual=function(e,t,i){return!this.isNotEqual("color",e,t,i,1)&&(!this.isNotEqual("lineStyle",e,t,i,1)&&(!this.isNotEqual("lineWidth",e,t,i,1)&&(!this.isNotEqual("shadow",e,t,i,1)&&(!this.isNotEqual("space",e,t,i,1)&&!this.isNotEqual("hasNoneStyle",e,t,i,1)))))},e.prototype.isCharacterFormatEqual=function(e,t,i){return!this.isNotEqual("fontColor",e,t,i,2)&&(!this.isNotEqual("fontFamily",e,t,i,2)&&(!this.isNotEqual("fontSize",e,t,i,2)&&(!this.isNotEqual("bold",e,t,i,2)&&(!this.isNotEqual("italic",e,t,i,2)&&(!this.isNotEqual("underline",e,t,i,2)&&(!this.isNotEqual("strikethrough",e,t,i,2)&&(!this.isNotEqual("baselineAlignment",e,t,i,2)&&(!this.isNotEqual("highlightColor",e,t,i,2)&&(!this.isNotEqual("bidi",e,t,i,2)&&(!this.isNotEqual("bdo",e,t,i,2)&&(!this.isNotEqual("fontColor",e,t,i,2)&&(!this.isNotEqual("fontFamilyBidi",e,t,i,2)&&(!this.isNotEqual("fontSizeBidi",e,t,i,2)&&(!this.isNotEqual("boldBidi",e,t,i,2)&&(!this.isNotEqual("italicBidi",e,t,i,2)&&(!this.isNotEqual("allCaps",e,t,i,2)&&(!this.isNotEqual("localeIdBidi",e,t,i,2)&&(!this.isNotEqual("localeIdAscii",e,t,i,2)&&(!this.isNotEqual("localeIdFarEast",e,t,i,2)&&(!this.isNotEqual("complexScript",e,t,i,2)&&(!this.isNotEqual("hidden",e,t,i,2)&&(!this.isNotEqual("specVanish",e,t,i,2)&&(!this.isNotEqual("isKernFont",e,t,i,2)&&(!this.isNotEqual("kern",e,t,i,2)&&(!this.isNotEqual("fontFamilyFarEast",e,t,i,2)&&(!this.isNotEqual("fontFamilyAscii",e,t,i,2)&&(!this.isNotEqual("fontFamilyNonFarEast",e,t,i,2)&&(!this.isNotEqual("characterSpacing",e,t,i,2)&&(!this.isNotEqual("scaling",e,t,i,2)&&(!this.isNotEqual("underlineColor",e,t,i,2)&&(!this.isNotEqual("ligature",e,t,i,2)&&!this.isNotEqual("fontHintType",e,t,i,2))))))))))))))))))))))))))))))))},e.prototype.isParagraphFormatEqual=function(e,t,i){return!this.isNotEqual("leftIndent",e,t,i,3)&&(!this.isNotEqual("rightIndent",e,t,i,3)&&(!this.isNotEqual("firstLineIndent",e,t,i,3)&&(!this.isNotEqual("textAlignment",e,t,i,3)&&(!this.isNotEqual("beforeSpacing",e,t,i,3)&&(!this.isNotEqual("afterSpacing",e,t,i,3)&&(!this.isNotEqual("spaceBeforeAuto",e,t,i,3)&&(!this.isNotEqual("spaceAfterAuto",e,t,i,3)&&(!this.isNotEqual("lineSpacing",e,t,i,3)&&(!this.isNotEqual("lineSpacingType",e,t,i,3)&&(!this.isNotEqual("outlineLevel",e,t,i,3)&&(!this.isNotEqual("bidi",e,t,i,3)&&(!this.isNotEqual("contextualSpacing",e,t,i,3)&&(!this.isNotEqual("keepWithNext",e,t,i,3)&&(!this.isNotEqual("keepLinesTogether",e,t,i,3)&&!this.isNotEqual("widowControl",e,t,i,3)))))))))))))))},e.prototype.isCellFormatEqual=function(e,t,i){return!this.isNotEqual("leftMargin",e,t,i,4)&&(!this.isNotEqual("rightMargin",e,t,i,4)&&(!this.isNotEqual("topMargin",e,t,i,4)&&(!this.isNotEqual("bottomMargin",e,t,i,4)&&(!this.isNotEqual("columnSpan",e,t,i,4)&&(!this.isNotEqual("rowSpan",e,t,i,4)&&(!this.isNotEqual("verticalAlignment",e,t,i,4)&&(!this.isNotEqual("preferredWidthType",e,t,i,4)&&(!this.isNotEqual("preferredWidth",e,t,i,4)&&(!this.isNotEqual("cellWidth",e,t,i,4)&&!this.isNotEqual("verticallyMergedCellsKeepWithNext",e,t,i,4))))))))))},e.prototype.isShadingEqual=function(e,t,i){return!this.isNotEqual("backgroundColor",e,t,i,5)&&(!this.isNotEqual("foregroundColor",e,t,i,5)&&!this.isNotEqual("textureStyle",e,t,i,5))},e.prototype.isRowFormatEqual=function(e,t,i){return!this.isNotEqual("allowBreakAcrossPages",e,t,i,6)&&(!this.isNotEqual("isHeader",e,t,i,6)&&(!this.isNotEqual("height",e,t,i,6)&&(!this.isNotEqual("heightType",e,t,i,6)&&(!this.isNotEqual("gridBefore",e,t,i,6)&&(!this.isNotEqual("gridBeforeWidth",e,t,i,6)&&(!this.isNotEqual("gridBeforeWidthType",e,t,i,6)&&(!this.isNotEqual("gridAfter",e,t,i,6)&&(!this.isNotEqual("gridAfterWidth",e,t,i,6)&&(!this.isNotEqual("gridAfterWidthType",e,t,i,6)&&(!this.isNotEqual("leftMargin",e,t,i,6)&&(!this.isNotEqual("topMargin",e,t,i,6)&&(!this.isNotEqual("bottomMargin",e,t,i,6)&&(!this.isNotEqual("rightMargin",e,t,i,6)&&(!this.isNotEqual("leftIndent",e,t,i,6)&&(!this.isNotEqual("verticallyMergedCellsLeftMargin",e,t,i,6)&&(!this.isNotEqual("verticallyMergedCellsRightMargin",e,t,i,6)&&(!this.isNotEqual("verticallyMergedCellsTopMargin",e,t,i,6)&&!this.isNotEqual("verticallyMergedCellsBottomMargin",e,t,i,6))))))))))))))))))},e.prototype.isListFormatEqual=function(e,t,i){return!this.isNotEqual("listId",e,t,i,7)&&(!this.isNotEqual("listLevelNumber",e,t,i,7)&&!this.isNotEqual("nsid",e,t,i,7))},e.prototype.isTableFormatEqual=function(e,t,i){return!this.isNotEqual("leftMargin",e,t,i,8)&&(!this.isNotEqual("rightMargin",e,t,i,8)&&(!this.isNotEqual("topMargin",e,t,i,8)&&(!this.isNotEqual("bottomMargin",e,t,i,8)&&(!this.isNotEqual("cellSpacing",e,t,i,8)&&(!this.isNotEqual("leftIndent",e,t,i,8)&&(!this.isNotEqual("tableAlignment",e,t,i,8)&&(!this.isNotEqual("preferredWidth",e,t,i,8)&&(!this.isNotEqual("preferredWidthType",e,t,i,8)&&(!this.isNotEqual("bidi",e,t,i,8)&&(!this.isNotEqual("allowAutoFit",e,t,i,8)&&(!this.isNotEqual("horizontalPositionAbs",e,t,i,8)&&!this.isNotEqual("horizontalPosition",e,t,i,8))))))))))))},e.prototype.isListLevelEqual=function(e,t,i){return!this.isNotEqual("listLevelPattern",e,t,i,9)&&(!this.isNotEqual("startAt",e,t,i,9)&&(!this.isNotEqual("followCharacter",e,t,i,9)&&(!this.isNotEqual("numberFormat",e,t,i,9)&&(!this.isNotEqual("paraStyleName",e,t,i,9)&&(!this.isNotEqual("restartLevel",e,t,i,9)&&(!this.isNotEqual("isLegalStyleNumbering",e,t,i,9)&&!this.isNotEqual("numberAlignment",e,t,i,9)))))))},e.prototype.isSectionFormatEqual=function(e,t,i){return!this.isNotEqual("headerDistance",e,t,i,10)&&(!this.isNotEqual("footerDistance",e,t,i,10)&&(!this.isNotEqual("differentFirstPage",e,t,i,10)&&(!this.isNotEqual("differentOddAndEvenPages",e,t,i,10)&&(!this.isNotEqual("pageWidth",e,t,i,10)&&(!this.isNotEqual("pageHeight",e,t,i,10)&&(!this.isNotEqual("leftMargin",e,t,i,10)&&(!this.isNotEqual("topMargin",e,t,i,10)&&(!this.isNotEqual("rightMargin",e,t,i,10)&&(!this.isNotEqual("bottomMargin",e,t,i,10)&&(!this.isNotEqual("bidi",e,t,i,10)&&(!this.isNotEqual("restartPageNumbering",e,t,i,10)&&(!this.isNotEqual("pageStartingNumber",e,t,i,10)&&(!this.isNotEqual("endnoteNumberFormat",e,t,i,10)&&(!this.isNotEqual("endnotePosition",e,t,i,10)&&(!this.isNotEqual("footNoteNumberFormat",e,t,i,10)&&(!this.isNotEqual("footnotePosition",e,t,i,10)&&(!this.isNotEqual("restartIndexForEndnotes",e,t,i,10)&&(!this.isNotEqual("restartIndexForFootnotes",e,t,i,10)&&(!this.isNotEqual("initialFootNoteNumber",e,t,i,10)&&(!this.isNotEqual("initialEndNoteNumber",e,t,i,10)&&(!this.isNotEqual("pageNumberStyle",e,t,i,10)&&(!this.isNotEqual("numberOfColumns",e,t,i,10)&&(!this.isNotEqual("equalWidth",e,t,i,10)&&(!this.isNotEqual("lineBetweenColumns",e,t,i,10)&&!this.isNotEqual("breakCode",e,t,i,10)))))))))))))))))))))))))},e.prototype.isColumnFormatEqual=function(e,t,i){return!this.isNotEqual("width",e,t,i,11)&&!this.isNotEqual("space",e,t,i,11)},e.prototype.cloneItems=function(t,i,r,n){for(var o=e.getPropertyType(n,i),a=t.propertiesHash.keys,s=0;s<a.length;s++)a[s]===o?this.propertiesHash.add(o,r):this.propertiesHash.add(a[s],t.propertiesHash.get(a[s]));t.propertiesHash.containsKey(o)||this.propertiesHash.add(o,r)},e.prototype.mergeProperties=function(e){for(var t=e.cloneProperties(),i=this.propertiesHash.keys,r=0;r<i.length;r++)t.containsKey(i[r])||t.add(i[r],this.propertiesHash.get(i[r]));return t},e.prototype.cloneProperties=function(){for(var e=new p,t=this.propertiesHash.keys,i=0;i<t.length;i++)e.add(t[i],this.propertiesHash.get(t[i]));return e},e.prototype.destroy=function(){t.isNullOrUndefined(this.propertiesHash)||this.propertiesHash.destroy(),this.propertiesHash=void 0,this.referenceCount=void 0,this.uniqueFormatType=void 0},e}(),f=function(){function e(){this.items=[]}return e.prototype.addUniqueFormat=function(e,i){for(var r=void 0,n=0;n<this.items.length;n++)if(this.items[n].isEqual(e,void 0,void 0)){r=this.items[n];break}return t.isNullOrUndefined(r)?((r=new u(i)).propertiesHash=e,r.referenceCount=1,this.items.push(r)):r.referenceCount++,r},e.prototype.updateUniqueFormat=function(e,i,r){for(var n=void 0,o=0;o<this.items.length;o++)if(this.items[o].isEqual(e.propertiesHash,i,r)){n=this.items[o];break}return t.isNullOrUndefined(n)?((n=new u(e.uniqueFormatType)).cloneItems(e,i,r,e.uniqueFormatType),n.referenceCount=1,this.items.push(n)):n.referenceCount++,this.remove(e),n},e.prototype.remove=function(e){--e.referenceCount<=0&&(this.items.splice(this.items.indexOf(e),1),e.destroy(),e=void 0)},e.prototype.clear=function(){if(t.isNullOrUndefined(this.items))for(var e=0;e<this.items.length;e++)this.items[e].destroy();this.items=[]},e.prototype.destroy=function(){this.clear(),this.items=void 0},e}(),m=function(){function e(e){this.uniqueBorderFormat=void 0,this.ownerBase=void 0,this.ownerBase=e}return Object.defineProperty(e.prototype,"color",{get:function(){return this.getPropertyValue("color")},set:function(e){this.setPropertyValue("color",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineStyle",{get:function(){return this.getPropertyValue("lineStyle")},set:function(e){this.setPropertyValue("lineStyle",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineWidth",{get:function(){return this.getPropertyValue("lineWidth")},set:function(e){this.setPropertyValue("lineWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shadow",{get:function(){return this.getPropertyValue("shadow")},set:function(e){this.setPropertyValue("shadow",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"space",{get:function(){return this.getPropertyValue("space")},set:function(e){this.setPropertyValue("space",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasNoneStyle",{get:function(){return this.getPropertyValue("hasNoneStyle")},set:function(e){this.setPropertyValue("hasNoneStyle",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isBorderDefined",{get:function(){return"None"!==this.lineStyle||this.hasNoneStyle&&this.hasValue("hasNoneStyle")},enumerable:!0,configurable:!0}),e.prototype.getPropertyValue=function(i){if(this.hasValue(i)){var r=u.getPropertyType(e.uniqueFormatType,i);if(!t.isNullOrUndefined(this.uniqueBorderFormat)){var n=this.uniqueBorderFormat.propertiesHash.get(r);if(!t.isNullOrUndefined(n))return n}}return e.getPropertyDefaultValue(i)},e.prototype.setPropertyValue=function(i,r){if((t.isNullOrUndefined(r)||""===r)&&(r=e.getPropertyDefaultValue(i)),t.isNullOrUndefined(this.uniqueBorderFormat))this.initializeUniqueBorder(i,r);else{var n=u.getPropertyType(this.uniqueBorderFormat.uniqueFormatType,i);if(this.uniqueBorderFormat.propertiesHash.containsKey(n)&&this.uniqueBorderFormat.propertiesHash.get(n)===r)return;this.uniqueBorderFormat=e.uniqueBorderFormats.updateUniqueFormat(this.uniqueBorderFormat,i,r)}},e.prototype.initializeUniqueBorder=function(t,i){var r=new p;this.addUniqueBorderFormat("color",t,i,r),this.addUniqueBorderFormat("lineStyle",t,i,r),this.addUniqueBorderFormat("lineWidth",t,i,r),this.addUniqueBorderFormat("shadow",t,i,r),this.addUniqueBorderFormat("space",t,i,r),this.addUniqueBorderFormat("hasNoneStyle",t,i,r),this.uniqueBorderFormat=e.uniqueBorderFormats.addUniqueFormat(r,e.uniqueFormatType)},e.prototype.addUniqueBorderFormat=function(t,i,r,n){var o=u.getPropertyType(e.uniqueFormatType,t);t===i&&n.add(o,r)},e.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"color":t="#000000";break;case"lineStyle":t="None";break;case"lineWidth":t=0;break;case"shadow":t=!1;break;case"space":t=0;break;case"hasNoneStyle":t=!1}return t},e.prototype.getLineWidth=function(){switch(this.lineStyle){case"None":case"Cleared":return 0;case"Triple":case"Double":case"ThinThickSmallGap":case"ThickThinSmallGap":case"ThinThickThinSmallGap":case"ThinThickMediumGap":case"ThickThinMediumGap":case"ThinThickThinMediumGap":case"ThinThickLargeGap":case"ThickThinLargeGap":case"ThinThickThinLargeGap":case"Emboss3D":case"Engrave3D":for(var e=this.getBorderLineWidthArray(this.lineStyle,this.lineWidth),t=0,i=0;i<e.length;i++)t+=e[i];return t;case"Single":case"DashLargeGap":case"DashSmallGap":case"Dot":case"DashDot":case"DashDotDot":case"Thick":return this.lineWidth>=.5?this.lineWidth:.5;case"SingleWavy":return 1.5===this.lineWidth?3:2.5;case"DoubleWavy":return 6.75;case"DashDotStroked":case"Outset":return this.lineWidth>=.5?this.lineWidth:.5}return this.lineWidth>=.5?this.lineWidth:.5},e.prototype.getBorderLineWidthArray=function(e,t){var i=[t];switch(e){case"Double":i=[1,1,1];break;case"ThinThickSmallGap":i=[1,-.75,-.75];break;case"ThickThinSmallGap":i=[-.75,-.75,1];break;case"ThinThickMediumGap":i=[1,.5,.5];break;case"ThickThinMediumGap":i=[.5,.5,1];break;case"ThinThickLargeGap":i=[-1.5,1,-.75];break;case"ThickThinLargeGap":i=[-.75,1,-1.5];break;case"Triple":i=[1,1,1,1,1];break;case"ThinThickThinSmallGap":i=[-.75,-.75,1,-.75,-.75];break;case"ThinThickThinMediumGap":i=[.5,.5,1,.5,.5];break;case"ThinThickThinLargeGap":i=[-.75,1,-1.5,1,-.75];break;case"Emboss3D":case"Engrave3D":i=[.25,0,1,0,.25]}if(1===i.length)return[t];for(var r=0;r<i.length;r++)i[parseInt(r.toString(),10)]>=0?i[parseInt(r.toString(),10)]=i[parseInt(r.toString(),10)]*t:i[parseInt(r.toString(),10)]=Math.abs(i[parseInt(r.toString(),10)]);return i},e.prototype.getBorderWeight=function(){var e=0,t=this.getBorderNumber();switch(this.lineStyle){case"Single":case"DashSmallGap":case"DashDot":case"DashDotDot":case"Double":case"Triple":case"ThinThickSmallGap":case"ThickThinSmallGap":case"ThinThickThinSmallGap":case"ThinThickMediumGap":case"ThickThinMediumGap":case"ThinThickThinMediumGap":case"ThinThickLargeGap":case"ThickThinLargeGap":case"ThinThickThinLargeGap":case"SingleWavy":case"DoubleWavy":case"DashDotStroked":case"Emboss3D":case"Engrave3D":case"Outset":case"Inset":case"Thick":e=this.lineWidth*t;break;case"Dot":case"DashLargeGap":e=1}return e},e.prototype.getBorderNumber=function(){var e=0;switch(this.lineStyle){case"Single":e=1;break;case"Thick":e=2;break;case"Double":e=3;break;case"Dot":e=4;break;case"DashLargeGap":e=5;break;case"DashDot":e=6;break;case"DashDotDot":e=7;break;case"Triple":e=8;break;case"ThinThickSmallGap":e=9;break;case"ThickThinSmallGap":e=10;break;case"ThinThickThinSmallGap":e=11;break;case"ThinThickMediumGap":e=12;break;case"ThickThinMediumGap":e=13;break;case"ThinThickThinMediumGap":e=14;break;case"ThinThickLargeGap":e=15;break;case"ThickThinLargeGap":e=16;break;case"ThinThickThinLargeGap":e=17;break;case"SingleWavy":e=18;break;case"DoubleWavy":e=19;break;case"DashSmallGap":e=20;break;case"DashDotStroked":e=21;break;case"Emboss3D":e=22;break;case"Engrave3D":e=23;break;case"Outset":e=24;break;case"Inset":e=25}return e},e.prototype.getNumberOfLines=function(){var e=0;switch(this.lineStyle){case"Single":case"Dot":case"DashSmallGap":case"DashLargeGap":case"DashDot":case"DashDotDot":e=1;break;case"Double":e=3;break;case"Triple":e=5;break;case"ThinThickSmallGap":case"ThickThinSmallGap":e=3;break;case"ThinThickThinSmallGap":e=5;break;case"ThinThickMediumGap":case"ThickThinMediumGap":e=3;break;case"ThinThickThinMediumGap":e=5;break;case"ThinThickLargeGap":case"ThickThinLargeGap":e=3;break;case"ThinThickThinLargeGap":e=5;break;case"SingleWavy":e=1;break;case"DoubleWavy":e=2;break;case"DashDotStroked":e=1;break;case"Emboss3D":case"Engrave3D":e=3;break;case"Outset":case"Inset":case"Thick":e=1}return e},e.prototype.getPrecedence=function(){var e=0;switch(this.lineStyle){case"Single":e=1;break;case"Thick":e=2;break;case"Double":e=3;break;case"Dot":e=4;break;case"DashLargeGap":e=5;break;case"DashDot":e=6;break;case"DashDotDot":e=7;break;case"Triple":e=8;break;case"ThinThickSmallGap":e=9;break;case"ThickThinSmallGap":e=10;break;case"ThinThickThinSmallGap":e=11;break;case"ThinThickMediumGap":e=12;break;case"ThickThinMediumGap":e=13;break;case"ThinThickThinMediumGap":e=14;break;case"ThinThickLargeGap":e=15;break;case"ThickThinLargeGap":e=16;break;case"ThinThickThinLargeGap":e=17;break;case"SingleWavy":e=18;break;case"DoubleWavy":e=19;break;case"DashSmallGap":e=20;break;case"DashDotStroked":e=21;break;case"Emboss3D":e=22;break;case"Engrave3D":e=23;break;case"Outset":e=24;break;case"Inset":e=25}return e},e.prototype.hasValues=function(){return this.hasValue("color")||this.hasValue("lineStyle")||this.hasValue("lineWidth")||this.hasValue("shadow")||this.hasValue("space")||this.hasValue("hasNoneStyle")},e.prototype.hasValue=function(e){if(!t.isNullOrUndefined(this.uniqueBorderFormat)){var i=u.getPropertyType(this.uniqueBorderFormat.uniqueFormatType,e);return this.uniqueBorderFormat.propertiesHash.containsKey(i)}return!1},e.prototype.cloneFormat=function(){var t=new e(void 0);return t.color=this.color,t.lineStyle=this.lineStyle,t.lineWidth=this.lineWidth,t.shadow=this.shadow,t.space=this.space,t},e.prototype.clearFormat=function(){t.isNullOrUndefined(this.uniqueBorderFormat)||e.uniqueBorderFormats.remove(this.uniqueBorderFormat),this.uniqueBorderFormat=void 0},e.prototype.destroy=function(){this.clearFormat(),this.ownerBase=void 0},e.prototype.isEqualFormat=function(e){var t=!1;return this.color===e.color&&this.lineStyle===e.lineStyle&&this.lineWidth===e.lineWidth&&this.shadow===e.shadow&&this.space===e.space&&(t=!0),t},e.prototype.copyFormat=function(e){t.isNullOrUndefined(e)||t.isNullOrUndefined(e.uniqueBorderFormat)||(e.hasValue("color")&&(this.color=e.color),e.hasValue("lineStyle")&&(this.lineStyle=e.lineStyle),e.hasValue("lineWidth")&&(this.lineWidth=e.lineWidth),e.hasValue("shadow")&&(this.shadow=e.shadow),e.hasValue("space")&&(this.space=e.space),e.hasValue("hasNoneStyle")&&(this.hasNoneStyle=e.hasNoneStyle))},e.clear=function(){this.uniqueBorderFormats.clear()},e.uniqueBorderFormats=new f,e.uniqueFormatType=1,e}(),y=function(){function e(e){this.uniqueSectionFormat=void 0,this.columns=[],this.ownerBase=e,this.columns=[],this.removedHeaderFooters=[]}return Object.defineProperty(e.prototype,"headerDistance",{get:function(){return this.getPropertyValue("headerDistance")},set:function(e){this.setPropertyValue("headerDistance",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"footerDistance",{get:function(){return this.getPropertyValue("footerDistance")},set:function(e){this.setPropertyValue("footerDistance",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"differentFirstPage",{get:function(){return this.getPropertyValue("differentFirstPage")},set:function(e){this.setPropertyValue("differentFirstPage",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"differentOddAndEvenPages",{get:function(){return this.getPropertyValue("differentOddAndEvenPages")},set:function(e){this.setPropertyValue("differentOddAndEvenPages",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageHeight",{get:function(){return this.getPropertyValue("pageHeight")},set:function(e){this.setPropertyValue("pageHeight",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightMargin",{get:function(){return this.getPropertyValue("rightMargin")},set:function(e){this.setPropertyValue("rightMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageWidth",{get:function(){return this.getPropertyValue("pageWidth")},set:function(e){this.setPropertyValue("pageWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftMargin",{get:function(){return this.getPropertyValue("leftMargin")},set:function(e){this.setPropertyValue("leftMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottomMargin",{get:function(){return this.getPropertyValue("bottomMargin")},set:function(e){this.setPropertyValue("bottomMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"topMargin",{get:function(){return this.getPropertyValue("topMargin")},set:function(e){this.setPropertyValue("topMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bidi",{get:function(){return this.getPropertyValue("bidi")},set:function(e){this.setPropertyValue("bidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"restartPageNumbering",{get:function(){return this.getPropertyValue("restartPageNumbering")},set:function(e){this.setPropertyValue("restartPageNumbering",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageStartingNumber",{get:function(){return this.getPropertyValue("pageStartingNumber")},set:function(e){this.setPropertyValue("pageStartingNumber",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"endnoteNumberFormat",{get:function(){return this.getPropertyValue("endnoteNumberFormat")},set:function(e){this.setPropertyValue("endnoteNumberFormat",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"restartIndexForEndnotes",{get:function(){return this.getPropertyValue("restartIndexForEndnotes")},set:function(e){this.setPropertyValue("restartIndexForEndnotes",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"restartIndexForFootnotes",{get:function(){return this.getPropertyValue("restartIndexForFootnotes")},set:function(e){this.setPropertyValue("restartIndexForFootnotes",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"footNoteNumberFormat",{get:function(){return this.getPropertyValue("footNoteNumberFormat")},set:function(e){this.setPropertyValue("footNoteNumberFormat",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"initialFootNoteNumber",{get:function(){return this.getPropertyValue("initialFootNoteNumber")},set:function(e){this.setPropertyValue("initialFootNoteNumber",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"initialEndNoteNumber",{get:function(){return this.getPropertyValue("initialEndNoteNumber")},set:function(e){this.setPropertyValue("initialEndNoteNumber",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageNumberStyle",{get:function(){return this.getPropertyValue("pageNumberStyle")},set:function(e){this.setPropertyValue("pageNumberStyle",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numberOfColumns",{get:function(){return this.getPropertyValue("numberOfColumns")},set:function(e){this.setPropertyValue("numberOfColumns",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"equalWidth",{get:function(){return this.getPropertyValue("equalWidth")},set:function(e){this.setPropertyValue("equalWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineBetweenColumns",{get:function(){return this.getPropertyValue("lineBetweenColumns")},set:function(e){this.setPropertyValue("lineBetweenColumns",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"breakCode",{get:function(){return this.getPropertyValue("breakCode")},set:function(e){this.setPropertyValue("breakCode",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstPageHeader",{get:function(){return this.getPropertyValue("firstPageHeader")},set:function(e){this.setPropertyValue("firstPageHeader",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstPageFooter",{get:function(){return this.getPropertyValue("firstPageFooter")},set:function(e){this.setPropertyValue("firstPageFooter",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"oddPageHeader",{get:function(){return this.getPropertyValue("oddPageHeader")},set:function(e){this.setPropertyValue("oddPageHeader",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"oddPageFooter",{get:function(){return this.getPropertyValue("oddPageFooter")},set:function(e){this.setPropertyValue("oddPageFooter",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"evenPageHeader",{get:function(){return this.getPropertyValue("evenPageHeader")},set:function(e){this.setPropertyValue("evenPageHeader",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"evenPageFooter",{get:function(){return this.getPropertyValue("evenPageFooter")},set:function(e){this.setPropertyValue("evenPageFooter",e)},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){t.isNullOrUndefined(this.uniqueSectionFormat)||e.uniqueSectionFormats.remove(this.uniqueSectionFormat),this.uniqueSectionFormat=void 0,this.ownerBase=void 0,this.columns=void 0,this.removedHeaderFooters=void 0},e.prototype.hasValue=function(e){if(!t.isNullOrUndefined(this.uniqueSectionFormat)){var i=u.getPropertyType(this.uniqueSectionFormat.uniqueFormatType,e);return this.uniqueSectionFormat.propertiesHash.containsKey(i)}return!1},e.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"headerDistance":case"footerDistance":t=36;break;case"differentFirstPage":case"differentOddAndEvenPages":t=!1;break;case"pageWidth":t=612;break;case"pageHeight":t=792;break;case"leftMargin":case"topMargin":case"rightMargin":case"bottomMargin":t=72;break;case"bidi":case"restartPageNumbering":t=!1;break;case"pageStartingNumber":t=1;break;case"footnotePosition":t="PrintAtBottomOfPage";break;case"endnoteNumberFormat":t="LowerCaseRoman";break;case"endnotePosition":t="DisplayEndOfDocument";break;case"restartIndexForEndnotes":case"restartIndexForFootnotes":t="DoNotRestart";break;case"footNoteNumberFormat":t="Arabic";break;case"initialFootNoteNumber":case"initialEndNoteNumber":t=1;break;case"pageNumberStyle":t="Arabic";break;case"numberOfColumns":t=1;break;case"equalWidth":t=!0;break;case"lineBetweenColumns":t=!1;break;case"breakCode":t="NewPage";break;case"firstPageHeader":case"firstPageFooter":case"oddPageHeader":case"oddPageFooter":case"evenPageHeader":case"evenPageFooter":t=void 0}return t},e.prototype.getPropertyValue=function(i){if(this.hasValue(i)){var r=u.getPropertyType(e.uniqueFormatType,i);if(!t.isNullOrUndefined(this.uniqueSectionFormat)&&this.uniqueSectionFormat.propertiesHash.containsKey(r))return this.uniqueSectionFormat.propertiesHash.get(r)}return e.getPropertyDefaultValue(i)},e.prototype.setPropertyValue=function(i,r){if((t.isNullOrUndefined(r)||""===r)&&(r=e.getPropertyDefaultValue(i)),t.isNullOrUndefined(this.uniqueSectionFormat))this.initializeUniqueSectionFormat(i,r);else{var n=u.getPropertyType(this.uniqueSectionFormat.uniqueFormatType,i);if(this.uniqueSectionFormat.propertiesHash.containsKey(n)&&this.uniqueSectionFormat.propertiesHash.get(n)===r)return;this.uniqueSectionFormat=e.uniqueSectionFormats.updateUniqueFormat(this.uniqueSectionFormat,i,r)}},e.prototype.initializeUniqueSectionFormat=function(t,i){var r=new p;this.addUniqueSectionFormat("headerDistance",t,i,r),this.addUniqueSectionFormat("footerDistance",t,i,r),this.addUniqueSectionFormat("differentFirstPage",t,i,r),this.addUniqueSectionFormat("differentOddAndEvenPages",t,i,r),this.addUniqueSectionFormat("pageWidth",t,i,r),this.addUniqueSectionFormat("pageHeight",t,i,r),this.addUniqueSectionFormat("leftMargin",t,i,r),this.addUniqueSectionFormat("topMargin",t,i,r),this.addUniqueSectionFormat("rightMargin",t,i,r),this.addUniqueSectionFormat("bottomMargin",t,i,r),this.addUniqueSectionFormat("bidi",t,i,r),this.addUniqueSectionFormat("restartPageNumbering",t,i,r),this.addUniqueSectionFormat("pageStartingNumber",t,i,r),this.addUniqueSectionFormat("endnoteNumberFormat",t,i,r),this.addUniqueSectionFormat("endnotePosition",t,i,r),this.addUniqueSectionFormat("footNoteNumberFormat",t,i,r),this.addUniqueSectionFormat("footnotePosition",t,i,r),this.addUniqueSectionFormat("restartIndexForEndnotes",t,i,r),this.addUniqueSectionFormat("restartIndexForFootnotes",t,i,r),this.addUniqueSectionFormat("initialFootNoteNumber",t,i,r),this.addUniqueSectionFormat("initialEndNoteNumber",t,i,r),this.addUniqueSectionFormat("pageNumberStyle",t,i,r),this.addUniqueSectionFormat("numberOfColumns",t,i,r),this.addUniqueSectionFormat("equalWidth",t,i,r),this.addUniqueSectionFormat("lineBetweenColumns",t,i,r),this.addUniqueSectionFormat("breakCode",t,i,r),this.uniqueSectionFormat=e.uniqueSectionFormats.addUniqueFormat(r,e.uniqueFormatType)},e.prototype.addUniqueSectionFormat=function(t,i,r,n){var o=u.getPropertyType(e.uniqueFormatType,t);t===i?n.add(o,r):n.add(o,e.getPropertyDefaultValue(t))},e.prototype.copyFormat=function(e,i){i&&(i.isUndoing||i.isRedoing)?(this.uniqueSectionFormat=e.uniqueSectionFormat,this.columns=e.columns,this.removedHeaderFooters=e.removedHeaderFooters):t.isNullOrUndefined(e)||(this.removedHeaderFooters=e.removedHeaderFooters,!t.isNullOrUndefined(e.uniqueSectionFormat)&&e.uniqueSectionFormat.propertiesHash&&(this.updateUniqueSectionFormat(e),this.columns=e.columns))},e.prototype.updateUniqueSectionFormat=function(i){var r=void 0;this.uniqueSectionFormat&&(r=this.uniqueSectionFormat.mergeProperties(i.uniqueSectionFormat),0===this.uniqueSectionFormat.referenceCount&&(e.uniqueSectionFormats.remove(this.uniqueSectionFormat),this.uniqueSectionFormat=void 0)),this.uniqueSectionFormat=new u(e.uniqueFormatType),t.isNullOrUndefined(r)&&(r=this.uniqueSectionFormat.mergeProperties(i.uniqueSectionFormat)),this.uniqueSectionFormat=e.uniqueSectionFormats.addUniqueFormat(r,e.uniqueFormatType)},e.prototype.cloneFormat=function(){var t=new e;return t.uniqueSectionFormat=this.uniqueSectionFormat,t.columns=this.columns,t},e.clear=function(){this.uniqueSectionFormats.clear()},e.uniqueSectionFormats=new f,e.uniqueFormatType=10,e}(),v=function(){function e(e){this.uniqueColumnFormat=void 0,this.ownerBase=e}return e.prototype.destroy=function(){t.isNullOrUndefined(this.uniqueColumnFormat)||e.uniqueColumnFormats.remove(this.uniqueColumnFormat),this.uniqueColumnFormat=void 0,this.ownerBase=void 0},e.prototype.hasValue=function(e){if(!t.isNullOrUndefined(this.uniqueColumnFormat)){var i=u.getPropertyType(this.uniqueColumnFormat.uniqueFormatType,e);return this.uniqueColumnFormat.propertiesHash.containsKey(i)}return!1},Object.defineProperty(e.prototype,"index",{get:function(){return this.indexIn},set:function(e){this.indexIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.getPropertyValue("width")},set:function(e){this.setPropertyValue("width",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"space",{get:function(){return this.getPropertyValue("space")},set:function(e){this.setPropertyValue("space",e)},enumerable:!0,configurable:!0}),e.prototype.getPropertyValue=function(i){if(this.hasValue(i)){var r=u.getPropertyType(e.uniqueFormatType,i);if(!t.isNullOrUndefined(this.uniqueColumnFormat)&&this.uniqueColumnFormat.propertiesHash.containsKey(r))return this.uniqueColumnFormat.propertiesHash.get(r)}return e.getPropertyDefaultValue(i)},e.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"width":t=36;break;case"space":t=0}return t},e.prototype.setPropertyValue=function(i,r){if((t.isNullOrUndefined(r)||""===r)&&(r=e.getPropertyDefaultValue(i)),t.isNullOrUndefined(this.uniqueColumnFormat))this.initializeUniqueColumnFormat(i,r);else{var n=u.getPropertyType(this.uniqueColumnFormat.uniqueFormatType,i);if(this.uniqueColumnFormat.propertiesHash.containsKey(n)&&this.uniqueColumnFormat.propertiesHash.get(n)===r)return;this.uniqueColumnFormat=e.uniqueColumnFormats.updateUniqueFormat(this.uniqueColumnFormat,i,r)}},e.prototype.initializeUniqueColumnFormat=function(t,i){var r=new p;this.addUniqueColumnFormat("width",t,i,r),this.addUniqueColumnFormat("space",t,i,r),this.uniqueColumnFormat=e.uniqueColumnFormats.addUniqueFormat(r,e.uniqueFormatType)},e.prototype.addUniqueColumnFormat=function(t,i,r,n){var o=u.getPropertyType(e.uniqueFormatType,t);t===i?n.add(o,r):n.add(o,e.getPropertyDefaultValue(t))},e.prototype.updateUniqueColumnFormat=function(i){var r=void 0;this.uniqueColumnFormat&&(r=this.uniqueColumnFormat.mergeProperties(i.uniqueColumnFormat),0===this.uniqueColumnFormat.referenceCount&&(e.uniqueColumnFormats.remove(this.uniqueColumnFormat),this.uniqueColumnFormat=void 0)),this.uniqueColumnFormat=new u(e.uniqueFormatType),t.isNullOrUndefined(r)&&(r=this.uniqueColumnFormat.mergeProperties(i.uniqueColumnFormat)),this.uniqueColumnFormat=e.uniqueColumnFormats.addUniqueFormat(r,e.uniqueFormatType)},e.prototype.cloneFormat=function(){var t=new e(void 0);return t.width=this.width,t.space=this.space,t},e.prototype.copyFormat=function(e){t.isNullOrUndefined(e)||t.isNullOrUndefined(e.uniqueColumnFormat)||(this.width=e.width,this.space=e.space)},e.clear=function(){this.uniqueColumnFormats.clear()},e.uniqueColumnFormats=new f,e.uniqueFormatType=11,e}(),W=function(){function e(e){this.uniqueRowFormat=void 0,this.borders=new Us(this),this.ownerBase=void 0,this.beforeWidth=0,this.afterWidth=0,this.revisions=[],this.removedIds=[],this.ownerBase=e}return Object.defineProperty(e.prototype,"gridBefore",{get:function(){return this.getPropertyValue("gridBefore")},set:function(e){this.setPropertyValue("gridBefore",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gridBeforeWidth",{get:function(){return this.getPropertyValue("gridBeforeWidth")},set:function(e){this.setPropertyValue("gridBeforeWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gridBeforeWidthType",{get:function(){return this.getPropertyValue("gridBeforeWidthType")},set:function(e){this.setPropertyValue("gridBeforeWidthType",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gridAfter",{get:function(){return this.getPropertyValue("gridAfter")},set:function(e){this.setPropertyValue("gridAfter",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gridAfterWidth",{get:function(){return this.getPropertyValue("gridAfterWidth")},set:function(e){this.setPropertyValue("gridAfterWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gridAfterWidthType",{get:function(){return this.getPropertyValue("gridAfterWidthType")},set:function(e){this.setPropertyValue("gridAfterWidthType",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowBreakAcrossPages",{get:function(){return this.getPropertyValue("allowBreakAcrossPages")},set:function(e){this.setPropertyValue("allowBreakAcrossPages",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isHeader",{get:function(){return this.getPropertyValue("isHeader")},set:function(e){this.setPropertyValue("isHeader",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightMargin",{get:function(){return this.getPropertyValue("rightMargin")},set:function(e){this.setPropertyValue("rightMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.getPropertyValue("height")},set:function(e){0!==e||"AtLeast"!==this.heightType&&"Exactly"!==this.heightType?"Auto"===this.heightType&&(e=0):e=1,this.setPropertyValue("height",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"heightType",{get:function(){return this.getPropertyValue("heightType")},set:function(e){this.height="AtLeast"===e||"Exactly"===e?1:0,this.setPropertyValue("heightType",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottomMargin",{get:function(){return this.getPropertyValue("bottomMargin")},set:function(e){this.setPropertyValue("bottomMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftIndent",{get:function(){return this.getPropertyValue("leftIndent")},set:function(e){this.setPropertyValue("leftIndent",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"topMargin",{get:function(){return this.getPropertyValue("topMargin")},set:function(e){this.setPropertyValue("topMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftMargin",{get:function(){return this.getPropertyValue("leftMargin")},set:function(e){this.setPropertyValue("leftMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"verticallyMergedCellsLeftMargin",{get:function(){return this.getPropertyValue("verticallyMergedCellsLeftMargin")},set:function(e){this.setPropertyValue("verticallyMergedCellsLeftMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"verticallyMergedCellsRightMargin",{get:function(){return this.getPropertyValue("verticallyMergedCellsRightMargin")},set:function(e){this.setPropertyValue("verticallyMergedCellsRightMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"verticallyMergedCellsTopMargin",{get:function(){return this.getPropertyValue("verticallyMergedCellsTopMargin")},set:function(e){this.setPropertyValue("verticallyMergedCellsTopMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"verticallyMergedCellsBottomMargin",{get:function(){return this.getPropertyValue("verticallyMergedCellsBottomMargin")},set:function(e){this.setPropertyValue("verticallyMergedCellsBottomMargin",e)},enumerable:!0,configurable:!0}),e.prototype.getPropertyValue=function(i){if(this.hasValue(i)){var r=u.getPropertyType(e.uniqueFormatType,i);if(!t.isNullOrUndefined(this.uniqueRowFormat)&&this.uniqueRowFormat.propertiesHash.containsKey(r))return this.uniqueRowFormat.propertiesHash.get(r)}return e.getPropertyDefaultValue(i)},e.prototype.setPropertyValue=function(i,r){if((t.isNullOrUndefined(r)||""===r)&&(r=e.getPropertyDefaultValue(i)),t.isNullOrUndefined(this.uniqueRowFormat))this.initializeUniqueRowFormat(i,r);else{var n=u.getPropertyType(this.uniqueRowFormat.uniqueFormatType,i);if(this.uniqueRowFormat.propertiesHash.containsKey(n)&&this.uniqueRowFormat.propertiesHash.get(n)===r)return;this.uniqueRowFormat=e.uniqueRowFormats.updateUniqueFormat(this.uniqueRowFormat,i,r)}},e.prototype.initializeUniqueRowFormat=function(t,i){var r=new p;this.addUniqueRowFormat("allowBreakAcrossPages",t,i,r),this.addUniqueRowFormat("isHeader",t,i,r),this.addUniqueRowFormat("height",t,i,r),this.addUniqueRowFormat("heightType",t,i,r),this.addUniqueRowFormat("gridBefore",t,i,r),this.addUniqueRowFormat("gridBeforeWidth",t,i,r),this.addUniqueRowFormat("gridBeforeWidthType",t,i,r),this.addUniqueRowFormat("gridAfter",t,i,r),this.addUniqueRowFormat("gridAfterWidth",t,i,r),this.addUniqueRowFormat("gridgridAfterWidth",t,i,r),this.addUniqueRowFormat("gridBeforeWidthType",t,i,r),this.addUniqueRowFormat("leftMargin",t,i,r),this.addUniqueRowFormat("rightMargin",t,i,r),this.addUniqueRowFormat("topMargin",t,i,r),this.addUniqueRowFormat("bottomMargin",t,i,r),this.addUniqueRowFormat("leftIndent",t,i,r),this.addUniqueRowFormat("verticallyMergedCellsLeftMargin",t,i,r),this.addUniqueRowFormat("verticallyMergedCellsRightMargin",t,i,r),this.addUniqueRowFormat("verticallyMergedCellsTopMargin",t,i,r),this.addUniqueRowFormat("verticallyMergedCellsBottomMargin",t,i,r),this.uniqueRowFormat=e.uniqueRowFormats.addUniqueFormat(r,e.uniqueFormatType)},e.prototype.addUniqueRowFormat=function(t,i,r,n){var o=u.getPropertyType(e.uniqueFormatType,t);t===i&&n.add(o,r)},e.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"allowBreakAcrossPages":t=!0;break;case"isHeader":t=!1;break;case"height":t=0;break;case"heightType":t="Auto";break;case"gridBefore":case"gridBeforeWidth":t=0;break;case"gridBeforeWidthType":t="Point";break;case"gridAfter":case"gridAfterWidth":t=0;break;case"gridAfterWidthType":t="Point";break;case"leftMargin":case"topMargin":case"bottomMargin":case"rightMargin":t=void 0;break;case"leftIndent":t=0;break;case"verticallyMergedCellsLeftMargin":case"verticallyMergedCellsRightMargin":case"verticallyMergedCellsTopMargin":case"verticallyMergedCellsBottomMargin":t=void 0}return t},e.prototype.containsMargins=function(){return!(t.isNullOrUndefined(this.leftMargin)&&t.isNullOrUndefined(this.rightMargin)&&t.isNullOrUndefined(this.bottomMargin)&&t.isNullOrUndefined(this.topMargin))},e.prototype.cloneFormat=function(){var t=new e;return t.allowBreakAcrossPages=this.allowBreakAcrossPages,t.heightType=this.heightType,t.height=this.height,t.isHeader=this.isHeader,t.gridBefore=this.gridBefore,t.gridBeforeWidth=this.gridBeforeWidth,t.gridBeforeWidthType=this.gridBeforeWidthType,t.gridAfter=this.gridAfter,t.gridAfterWidth=this.gridAfterWidth,t.gridAfterWidthType=this.gridAfterWidthType,t.leftMargin=this.leftMargin,t.rightMargin=this.rightMargin,t.topMargin=this.topMargin,t.bottomMargin=this.bottomMargin,t.leftIndent=this.leftIndent,t.verticallyMergedCellsLeftMargin=this.verticallyMergedCellsLeftMargin,t.verticallyMergedCellsRightMargin=this.verticallyMergedCellsRightMargin,t.verticallyMergedCellsTopMargin=this.verticallyMergedCellsTopMargin,t.verticallyMergedCellsBottomMargin=this.verticallyMergedCellsBottomMargin,this.revisions.length>0?t.removedIds=F.cloneRevisions(this.revisions):t.removedIds=this.removedIds.slice(),t},e.prototype.hasValue=function(e){if(!t.isNullOrUndefined(this.uniqueRowFormat)){var i=u.getPropertyType(this.uniqueRowFormat.uniqueFormatType,e);return this.uniqueRowFormat.propertiesHash.containsKey(i)}return!1},e.prototype.copyFormat=function(e){t.isNullOrUndefined(e)||(t.isNullOrUndefined(e.uniqueRowFormat)||(this.allowBreakAcrossPages=e.allowBreakAcrossPages,this.isHeader=e.isHeader,this.heightType=e.heightType,this.height=e.height,this.gridBefore=e.gridBefore,this.gridBeforeWidth=e.gridBeforeWidth,this.gridBeforeWidthType=e.gridBeforeWidthType,this.gridAfter=e.gridAfter,this.gridAfterWidth=e.gridAfterWidth,this.gridAfterWidthType=e.gridAfterWidthType,this.leftMargin=e.leftMargin,this.topMargin=e.topMargin,this.rightMargin=e.rightMargin,this.bottomMargin=e.bottomMargin,this.leftIndent=e.leftIndent,this.verticallyMergedCellsLeftMargin=e.verticallyMergedCellsLeftMargin,this.verticallyMergedCellsRightMargin=e.verticallyMergedCellsRightMargin,this.verticallyMergedCellsTopMargin=e.verticallyMergedCellsTopMargin,this.verticallyMergedCellsBottomMargin=e.verticallyMergedCellsBottomMargin,this.revisions=e.revisions),t.isNullOrUndefined(e.borders)||(this.borders=new Us(this),this.borders.ownerBase=e,this.borders.copyFormat(e.borders)),e.revisions.length>0?this.removedIds=F.cloneRevisions(e.revisions):this.removedIds=e.removedIds.slice())},e.prototype.destroy=function(){t.isNullOrUndefined(this.borders)||this.borders.destroy(),t.isNullOrUndefined(this.uniqueRowFormat)||e.uniqueRowFormats.remove(this.uniqueRowFormat),this.beforeWidth=void 0,this.afterWidth=void 0,this.borders=void 0,this.uniqueRowFormat=void 0},e.clear=function(){this.uniqueRowFormats.clear()},Object.defineProperty(e.prototype,"revisionLength",{get:function(){return t.isNullOrUndefined(this.revisions)?0:this.revisions.length},enumerable:!0,configurable:!0}),e.prototype.getRevision=function(e){if(!t.isNullOrUndefined(this.revisions))return this.revisions[e]},e.prototype.addRevision=function(e){-1===this.revisions.indexOf(e)&&this.revisions.push(e),e.hasChanges=!0},e.prototype.insertRevisionAt=function(e,t){this.revisions.splice(e,0,t),t.hasChanges=!0},e.prototype.removeRevision=function(e){this.revisions.splice(e,1)[0].hasChanges=!0},e.prototype.getAllRevision=function(){return this.revisions},e.prototype.getRevisionRange=function(e){var t=[];return-1!==this.revisions.indexOf(e)&&t.push(this),t},e.uniqueRowFormats=new f,e.uniqueFormatType=6,e}(),b=function(){function e(e){this.uniqueShadingFormat=void 0,this.ownerBase=void 0,this.ownerBase=e}return Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this.getPropertyValue("backgroundColor")},set:function(e){this.setPropertyValue("backgroundColor",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"foregroundColor",{get:function(){return this.getPropertyValue("foregroundColor")},set:function(e){this.setPropertyValue("foregroundColor",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textureStyle",{get:function(){return this.getPropertyValue("textureStyle")},set:function(e){this.setPropertyValue("textureStyle",e)},enumerable:!0,configurable:!0}),e.prototype.getPropertyValue=function(i){if(this.hasValue(i)){var r=u.getPropertyType(e.uniqueFormatType,i);if(!t.isNullOrUndefined(this.uniqueShadingFormat)&&this.uniqueShadingFormat.propertiesHash.containsKey(r))return this.uniqueShadingFormat.propertiesHash.get(r)}return e.getPropertyDefaultValue(i)},e.prototype.setPropertyValue=function(i,r){if((t.isNullOrUndefined(r)||""===r)&&(r=e.getPropertyDefaultValue(i)),t.isNullOrUndefined(this.uniqueShadingFormat))this.initializeUniqueShading(i,r);else{var n=u.getPropertyType(this.uniqueShadingFormat.uniqueFormatType,i);if(this.uniqueShadingFormat.propertiesHash.containsKey(n)&&this.uniqueShadingFormat.propertiesHash.get(n)===r)return;this.uniqueShadingFormat=e.uniqueShadingFormats.updateUniqueFormat(this.uniqueShadingFormat,i,r)}},e.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"backgroundColor":case"foregroundColor":t="empty";break;case"textureStyle":t="TextureNone"}return t},e.prototype.initializeUniqueShading=function(t,i){var r=new p;this.addUniqueShading("backgroundColor",t,i,r),this.addUniqueShading("foregroundColor",t,i,r),this.addUniqueShading("textureStyle",t,i,r),this.uniqueShadingFormat=e.uniqueShadingFormats.addUniqueFormat(r,e.uniqueFormatType)},e.prototype.addUniqueShading=function(t,i,r,n){var o=u.getPropertyType(e.uniqueFormatType,t);t===i?n.add(o,r):n.add(o,e.getPropertyDefaultValue(t))},e.prototype.destroy=function(){t.isNullOrUndefined(this.uniqueShadingFormat)||e.uniqueShadingFormats.remove(this.uniqueShadingFormat),this.uniqueShadingFormat=void 0},e.prototype.cloneFormat=function(){var t=new e(void 0);return t.backgroundColor=this.backgroundColor,t.foregroundColor=this.foregroundColor,t.textureStyle=this.textureStyle,t},e.prototype.copyFormat=function(e){t.isNullOrUndefined(e)||t.isNullOrUndefined(e.uniqueShadingFormat)||(this.backgroundColor=e.backgroundColor,this.foregroundColor=e.foregroundColor,this.textureStyle=e.textureStyle)},e.prototype.hasValue=function(e){if(!t.isNullOrUndefined(this.uniqueShadingFormat)){var i=u.getPropertyType(this.uniqueShadingFormat.uniqueFormatType,e);return this.uniqueShadingFormat.propertiesHash.containsKey(i)}return!1},e.clear=function(){this.uniqueShadingFormats.clear()},e.uniqueShadingFormats=new f,e.uniqueFormatType=5,e}(),x=function(){function e(e){this.uniqueCellFormat=void 0,this.initialCellWidth=0,this.borders=new Us(this),this.shading=new b(this),this.ownerBase=e,this.borders=new Us(this),this.shading=new b(this)}return Object.defineProperty(e.prototype,"leftMargin",{get:function(){return this.getPropertyValue("leftMargin")},set:function(e){this.setPropertyValue("leftMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightMargin",{get:function(){return this.getPropertyValue("rightMargin")},set:function(e){this.setPropertyValue("rightMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"topMargin",{get:function(){return this.getPropertyValue("topMargin")},set:function(e){this.setPropertyValue("topMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottomMargin",{get:function(){return this.getPropertyValue("bottomMargin")},set:function(e){this.setPropertyValue("bottomMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cellWidth",{get:function(){return this.getPropertyValue("cellWidth")},set:function(e){this.setPropertyValue("cellWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnSpan",{get:function(){return this.getPropertyValue("columnSpan")},set:function(e){this.setPropertyValue("columnSpan",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowSpan",{get:function(){return this.getPropertyValue("rowSpan")},set:function(e){this.setPropertyValue("rowSpan",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"preferredWidth",{get:function(){return this.getPropertyValue("preferredWidth")},set:function(e){this.setPropertyValue("preferredWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"verticalAlignment",{get:function(){return this.getPropertyValue("verticalAlignment")},set:function(e){this.setPropertyValue("verticalAlignment",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"preferredWidthType",{get:function(){return this.getPropertyValue("preferredWidthType")},set:function(e){this.setPropertyValue("preferredWidthType",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"verticallyMergedCellsKeepWithNext",{get:function(){return this.getPropertyValue("verticallyMergedCellsKeepWithNext")},set:function(e){this.setPropertyValue("verticallyMergedCellsKeepWithNext",e)},enumerable:!0,configurable:!0}),e.prototype.getPropertyValue=function(i){if(this.hasValue(i)){var r=u.getPropertyType(e.uniqueFormatType,i);if(!t.isNullOrUndefined(this.uniqueCellFormat)&&this.uniqueCellFormat.propertiesHash.containsKey(r))return this.uniqueCellFormat.propertiesHash.get(r)}return e.getPropertyDefaultValue(i)},e.prototype.setPropertyValue=function(i,r){if((t.isNullOrUndefined(r)||""===r)&&(r=e.getPropertyDefaultValue(i)),t.isNullOrUndefined(this.uniqueCellFormat))this.initializeUniqueCellFormat(i,r);else{var n=u.getPropertyType(this.uniqueCellFormat.uniqueFormatType,i);if(this.uniqueCellFormat.propertiesHash.containsKey(n)&&this.uniqueCellFormat.propertiesHash.get(n)===r)return;this.uniqueCellFormat=e.uniqueCellFormats.updateUniqueFormat(this.uniqueCellFormat,i,r)}},e.prototype.initializeUniqueCellFormat=function(t,i){var r=new p;this.addUniqueCellFormat("leftMargin",t,i,r),this.addUniqueCellFormat("topMargin",t,i,r),this.addUniqueCellFormat("bottomMargin",t,i,r),this.addUniqueCellFormat("rightMargin",t,i,r),this.addUniqueCellFormat("cellWidth",t,i,r),this.addUniqueCellFormat("columnSpan",t,i,r),this.addUniqueCellFormat("rowSpan",t,i,r),this.addUniqueCellFormat("preferredWidth",t,i,r),this.addUniqueCellFormat("verticalAlignment",t,i,r),this.addUniqueCellFormat("preferredWidthType",t,i,r),this.addUniqueCellFormat("verticallyMergedCellsKeepWithNext",t,i,r),this.uniqueCellFormat=e.uniqueCellFormats.addUniqueFormat(r,e.uniqueFormatType)},e.prototype.addUniqueCellFormat=function(t,i,r,n){var o=u.getPropertyType(e.uniqueFormatType,t);t===i&&n.add(o,r)},e.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"leftMargin":case"topMargin":case"bottomMargin":case"rightMargin":t=void 0;break;case"cellWidth":t=0;break;case"columnSpan":case"rowSpan":t=1;break;case"preferredWidth":t=0;break;case"verticalAlignment":t="Top";break;case"preferredWidthType":t="Point";break;case"verticallyMergedCellsKeepWithNext":t=!1}return t},e.prototype.containsMargins=function(){return!(t.isNullOrUndefined(this.leftMargin)&&t.isNullOrUndefined(this.rightMargin)&&t.isNullOrUndefined(this.bottomMargin)&&t.isNullOrUndefined(this.topMargin))},e.prototype.destroy=function(){t.isNullOrUndefined(this.borders)||this.borders.destroy(),t.isNullOrUndefined(this.shading)||this.shading.destroy(),t.isNullOrUndefined(this.uniqueCellFormat)||e.uniqueCellFormats.remove(this.uniqueCellFormat),this.uniqueCellFormat=void 0,this.borders=void 0,this.shading=void 0},e.prototype.cloneFormat=function(){var i=new e(void 0);return i.verticalAlignment=this.verticalAlignment,i.leftMargin=this.leftMargin,i.rightMargin=this.rightMargin,i.topMargin=this.topMargin,i.bottomMargin=this.bottomMargin,i.preferredWidth=this.preferredWidth,i.preferredWidthType=this.preferredWidthType,i.verticallyMergedCellsKeepWithNext=this.verticallyMergedCellsKeepWithNext,i.cellWidth=this.cellWidth,i.borders=t.isNullOrUndefined(this.borders)?void 0:this.borders.cloneFormat(),i.shading=t.isNullOrUndefined(this.shading)?void 0:this.shading.cloneFormat(),i},e.prototype.hasValue=function(e){if(!t.isNullOrUndefined(this.uniqueCellFormat)){var i=u.getPropertyType(this.uniqueCellFormat.uniqueFormatType,e);return this.uniqueCellFormat.propertiesHash.containsKey(i)}return!1},e.prototype.copyFormat=function(e){t.isNullOrUndefined(e)||(t.isNullOrUndefined(e.uniqueCellFormat)||(this.cellWidth=e.cellWidth,this.leftMargin=e.leftMargin,this.topMargin=e.topMargin,this.rightMargin=e.rightMargin,this.bottomMargin=e.bottomMargin,this.preferredWidth=e.preferredWidth,this.columnSpan=e.columnSpan,this.rowSpan=e.rowSpan,this.preferredWidthType=e.preferredWidthType,this.verticalAlignment=e.verticalAlignment,this.verticallyMergedCellsKeepWithNext=e.verticallyMergedCellsKeepWithNext),t.isNullOrUndefined(e.shading)||(this.shading=new b(this),this.shading.copyFormat(e.shading)),t.isNullOrUndefined(e.borders)||(this.borders=new Us(this),this.borders.copyFormat(e.borders)))},e.prototype.initializeCellBorders=function(){this.borders.left.lineStyle="Single",this.borders.left.lineWidth=.5,this.borders.right.lineStyle="Single",this.borders.right.lineWidth=.5,this.borders.top.lineStyle="Single",this.borders.top.lineWidth=.5,this.borders.bottom.lineStyle="Single",this.borders.bottom.lineWidth=.5,this.borders.horizontal.lineStyle="Single",this.borders.horizontal.lineWidth=.5,this.borders.vertical.lineStyle="Single",this.borders.vertical.lineWidth=.5},e.clear=function(){this.uniqueCellFormats.clear()},e.uniqueCellFormats=new f,e.uniqueFormatType=4,e}(),w=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),F=function(){function e(){this.author=null,this.date=null,this.customData=null,this.revisionID="",this.hasChanges=!1}return e.prototype.destroy=function(){this.author=void 0,this.revisionID=void 0,this.date=void 0,this.ownerNode=void 0,this.customData=void 0,this.range=[],this.range=void 0,this.hasChanges=void 0},e.cloneRevisions=function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i].revisionID);return t},e}(),C=function(e){function i(i,r,n,o){var a=e.call(this)||this;return a.author=r,t.isNullOrUndefined(a.author)&&(a.author="Unknown"),a.date=n,a.owner=i,a.ownerNode=o,a}return w(i,e),i.prototype.destroy=function(){this.owner=void 0,e.prototype.destroy.call(this)},i.prototype.cloneRevision=function(){var e=new i(this.owner,this.author,this.date);return e.revisionID=this.revisionID,e.revisionType=this.revisionType,e.author=this.author,e.date=this.date,e.customData=this.customData,e},i.prototype.getRange=function(e){return this.ownerNode instanceof Qs?((t.isNullOrUndefined(this.range)||t.isNullOrUndefined(e)||e||!t.isNullOrUndefined(this.owner)&&!t.isNullOrUndefined(this.owner.editorProperties)&&this.owner.editorProperties.hasChanges||this.hasChanges)&&(this.range=this.ownerNode.getRevisionRange(this),this.hasChanges=!1),this.range):this.ownerNode.getRevisionRange(this)},i}(F),P=function(){function e(){this.changes=[]}return e.prototype.clear=function(){this.changes=[]},e.prototype.destroy=function(){if(this.changes){for(var e=0;e<this.changes.length;e++)this.changes[parseInt(e.toString(),10)].destroy();this.changes=[]}},e}(),T=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.changes=[],t}return w(t,e),t.prototype.clear=function(){this.changes=[]},t.prototype.destroy=function(){if(this.changes){for(var e=0;e<this.changes.length;e++)this.changes[e].destroy();this.changes=[]}},t}(P),O=function(){function e(e){this.documentHelper=void 0,this.documentHelper=e}return e.prototype.destroy=function(){this.documentHelper=void 0},e.prototype.retrieveRevisionByType=function(e,t){for(var i=0;i<e.revisionLength;i++)if(e.revisions[i].revisionType===t)return e.revisions[i]},e.prototype.insertRevision=function(e,i,r,n,o,a,s){if(!this.documentHelper.editorProperties.isRemoteAction||!t.isNullOrUndefined(this.documentHelper.editorProperties.revisionData)||this.documentHelper.parser.isPaste){var l;if(t.isNullOrUndefined(o)&&!t.isNullOrUndefined(this.documentHelper.editorProperties.revisionData)&&this.documentHelper.editorProperties.revisionData.length>0){var d=this.documentHelper.editorProperties.revisionData[0];r=d.author,n=d.date}t.isNullOrUndefined(s)||(l=s),r=t.isNullOrUndefined(r)?this.documentHelper.editorProperties.currentUser?this.documentHelper.editorProperties.currentUser:"Guest user":r;var h=t.isNullOrUndefined(n)?bs.getUtcDate():n;return this.documentHelper.editorProperties.revision=new C(this.documentHelper,r,h,this.getOwnerNodeForRevision(e)),this.documentHelper.editorProperties.revision.revisionType=i,this.documentHelper.documentEditorSettings.revisionSettings&&this.documentHelper.documentEditorSettings.revisionSettings.customData&&(this.documentHelper.editorProperties.revision.customData=this.documentHelper.documentEditorSettings.revisionSettings.customData),this.documentHelper.editorProperties.enableCollaborativeEditing&&this.documentHelper.editorProperties.isRemoteAction&&!t.isNullOrUndefined(l)&&""!=l?this.documentHelper.editorProperties.revision.revisionID=l:this.documentHelper.editorProperties.revision.revisionID=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),!t.isNullOrUndefined(o)&&o.length>0&&(this.clearAndUpdateRevisions(o,this.documentHelper.editorProperties.revision,o.indexOf(e)),this.documentHelper.editorProperties.isupdateCurrentTrackChanges=!0),t.isNullOrUndefined(e)||-1===e.getAllRevision().indexOf(this.documentHelper.editorProperties.revision)&&e.addRevision(this.documentHelper.editorProperties.revision),this.documentHelper.editorProperties.isRemoteAction&&this.documentHelper.parser.isPaste?this.documentHelper.editorProperties.remotePasteRevision.push(this.documentHelper.editorProperties.revision):this.documentHelper.editorProperties.revision.getRange().length>0&&this.documentHelper.parser.isPaste,this.documentHelper.editorProperties.revisionItem=e,this.documentHelper.editorProperties.revision}},e.prototype.getOwnerNodeForRevision=function(e){return e instanceof nl?e.paragraph.getSplitWidgets()[0]:e},e.prototype.clearAndUpdateRevisions=function(e,t,i){for(var r=i;r<e.length;r++)if(e[r]instanceof nl||e[r]instanceof S){var n=e[r];if(n instanceof hl&&""===n.text){n.removeRevision(n.revisionLength-1);continue}for(var o=0;o<n.revisionLength;o++){var a=n.getRevision(o);this.compareTwoRevisions(a,t)&&(n.removeRevision(o),n.insertRevisionAt(o,t))}}},e.prototype.compareTwoRevisions=function(e,t){return e.revisionType===t.revisionType&&e.author===t.author},e}(),S=function(){function e(e,i){if(this.uniqueCharacterFormat=void 0,this.ownerBase=void 0,this.baseCharStyle=void 0,this.owner=void 0,this.removedIds=[],this.revisions=[],this.ownerBase=e,t.isNullOrUndefined(i)){var r=void 0;if(this.ownerBase instanceof nl?r=this.ownerBase.paragraph:this.ownerBase instanceof Qs&&(r=this.ownerBase),!t.isNullOrUndefined(r)){var n=r.bodyWidget;n&&n.page&&n.page.documentHelper&&(this.owner=n.page.documentHelper)}}else this.owner=i}return Object.defineProperty(e.prototype,"bold",{get:function(){return this.getPropertyValue("bold")},set:function(e){this.setPropertyValue("bold",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"italic",{get:function(){return this.getPropertyValue("italic")},set:function(e){this.setPropertyValue("italic",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontSize",{get:function(){return this.getPropertyValue("fontSize")},set:function(e){this.setPropertyValue("fontSize",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"characterSpacing",{get:function(){return this.getPropertyValue("characterSpacing")},set:function(e){this.setPropertyValue("characterSpacing",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scaling",{get:function(){return this.getPropertyValue("scaling")},set:function(e){this.setPropertyValue("scaling",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontFamily",{get:function(){return this.getPropertyValue("fontFamily")},set:function(e){this.setPropertyValue("fontFamily",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"underline",{get:function(){return this.getPropertyValue("underline")},set:function(e){this.setPropertyValue("underline",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"underlineColor",{get:function(){return this.getPropertyValue("underlineColor")},set:function(e){this.setPropertyValue("underlineColor",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontHintType",{get:function(){return this.getPropertyValue("fontHintType")},set:function(e){this.setPropertyValue("fontHintType",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"strikethrough",{get:function(){return this.getPropertyValue("strikethrough")},set:function(e){this.setPropertyValue("strikethrough",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"baselineAlignment",{get:function(){return this.getPropertyValue("baselineAlignment")},set:function(e){this.setPropertyValue("baselineAlignment",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"highlightColor",{get:function(){return this.getPropertyValue("highlightColor")},set:function(e){this.setPropertyValue("highlightColor",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontColor",{get:function(){return this.getPropertyValue("fontColor")},set:function(e){this.setPropertyValue("fontColor",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ligature",{get:function(){return this.getPropertyValue("ligature")},set:function(e){this.setPropertyValue("ligature",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bidi",{get:function(){return this.getPropertyValue("bidi")},set:function(e){this.setPropertyValue("bidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localeIdBidi",{get:function(){return this.getPropertyValue("localeIdBidi")},set:function(e){this.setPropertyValue("localeIdBidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localeIdFarEast",{get:function(){return this.getPropertyValue("localeIdFarEast")},set:function(e){this.setPropertyValue("localeIdFarEast",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localeIdAscii",{get:function(){return this.getPropertyValue("localeIdAscii")},set:function(e){this.setPropertyValue("localeIdAscii",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bdo",{get:function(){return this.getPropertyValue("bdo")},set:function(e){this.setPropertyValue("bdo",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"boldBidi",{get:function(){return this.getPropertyValue("boldBidi")},set:function(e){this.setPropertyValue("boldBidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"italicBidi",{get:function(){return this.getPropertyValue("italicBidi")},set:function(e){this.setPropertyValue("italicBidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontSizeBidi",{get:function(){return this.getPropertyValue("fontSizeBidi")},set:function(e){this.setPropertyValue("fontSizeBidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontFamilyBidi",{get:function(){return this.getPropertyValue("fontFamilyBidi")},set:function(e){this.setPropertyValue("fontFamilyBidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allCaps",{get:function(){return this.getPropertyValue("allCaps")},set:function(e){this.setPropertyValue("allCaps",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Lowercase",{get:function(){return this.getPropertyValue("Lowercase")},set:function(e){this.setPropertyValue("Lowercase",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Uppercase",{get:function(){return this.getPropertyValue("Uppercase")},set:function(e){this.setPropertyValue("Uppercase",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"SentenceCase",{get:function(){return this.getPropertyValue("SentenceCase")},set:function(e){this.setPropertyValue("SentenceCase",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ToggleCase",{get:function(){return this.getPropertyValue("ToggleCase")},set:function(e){this.setPropertyValue("ToggleCase",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CapitalizeEachWord",{get:function(){return this.getPropertyValue("CapitalizeEachWord")},set:function(e){this.setPropertyValue("CapitalizeEachWord",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"complexScript",{get:function(){return this.getPropertyValue("complexScript")},set:function(e){this.setPropertyValue("complexScript",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hidden",{get:function(){return this.getPropertyValue("hidden")},set:function(e){this.setPropertyValue("hidden",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"specVanish",{get:function(){return this.getPropertyValue("specVanish")},set:function(e){this.setPropertyValue("specVanish",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"kern",{get:function(){return this.getPropertyValue("kern")},set:function(e){this.setPropertyValue("kern",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isKernFont",{get:function(){return this.getPropertyValue("isKernFont")},set:function(e){this.setPropertyValue("isKernFont",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontFamilyFarEast",{get:function(){return this.getPropertyValue("fontFamilyFarEast")},set:function(e){this.setPropertyValue("fontFamilyFarEast",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontFamilyAscii",{get:function(){return this.getPropertyValue("fontFamilyAscii")},set:function(e){this.setPropertyValue("fontFamilyAscii",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontFamilyNonFarEast",{get:function(){return this.getPropertyValue("fontFamilyNonFarEast")},set:function(e){this.setPropertyValue("fontFamilyNonFarEast",e)},enumerable:!0,configurable:!0}),e.prototype.getPropertyValue=function(i){if(this.hasValue(i)){var r=u.getPropertyType(e.uniqueFormatType,i);if(!t.isNullOrUndefined(this.uniqueCharacterFormat)&&this.uniqueCharacterFormat.propertiesHash.containsKey(r))return this.uniqueCharacterFormat.propertiesHash.get(r)}else{var n=this.checkCharacterStyle(i);if(!t.isNullOrUndefined(n))return n;if(!t.isNullOrUndefined(this.baseCharStyle)){var o=void 0,a=void 0;if(t.isNullOrUndefined(this.ownerBase)||(o=this.ownerBase.paragraph,a=this.ownerBase.line),!t.isNullOrUndefined(o)&&!t.isNullOrUndefined(a))for(var s=a.children.length,l=0;l<s;l++){var d=this.ownerBase.line.children[l];if(d instanceof hl){var h=d.text;(h.startsWith("HYPERLINK")||h.startsWith(" HYPERLINK"))&&-1!==h.indexOf("_Toc")&&(this.baseCharStyle=this.ownerBase.paragraph.paragraphFormat.baseStyle)}}}var c=this.checkBaseStyle(i);if(!t.isNullOrUndefined(c))return c}return this.getDefaultValue(i)},e.prototype.getDefaultValue=function(i){var r=u.getPropertyType(e.uniqueFormatType,i),n=this.documentCharacterFormat();if(t.isNullOrUndefined(n))return e.getPropertyDefaultValue(i);var o=n.documentFormat;if(t.isNullOrUndefined(o)||t.isNullOrUndefined(o.uniqueCharacterFormat)||!o.uniqueCharacterFormat.propertiesHash.containsKey(r)){var a=n.editorFormat;return!t.isNullOrUndefined(a)&&a.hasOwnProperty(i)?a[i]:e.getPropertyDefaultValue(i)}return o.uniqueCharacterFormat.propertiesHash.get(r)},e.prototype.documentCharacterFormat=function(){if(!t.isNullOrUndefined(this.ownerBase)){if(!t.isNullOrUndefined(this.owner))return{editorFormat:this.owner.editorCharacterFormat,documentFormat:this.owner.characterFormat};var e;if(this.ownerBase instanceof nl?e=this.ownerBase.paragraph:this.ownerBase instanceof Qs&&(e=this.ownerBase),e){var i=e.bodyWidget;if(i&&i.page&&i.page.documentHelper){var r=i.page.documentHelper;return this.owner=r,{editorFormat:r.editorCharacterFormat,documentFormat:r.characterFormat}}}}},e.prototype.checkBaseStyle=function(i){var r;for(t.isNullOrUndefined(this.ownerBase)||(t.isNullOrUndefined(this.ownerBase.paragraph)||t.isNullOrUndefined(this.ownerBase.paragraph.paragraphFormat)?this.ownerBase instanceof Qs&&!t.isNullOrUndefined(this.ownerBase.paragraphFormat)?r=this.ownerBase.paragraphFormat.baseStyle:t.isNullOrUndefined(this.ownerBase instanceof Os)||(r=this.ownerBase.basedOn):r=this.ownerBase.paragraph.paragraphFormat.baseStyle);!t.isNullOrUndefined(r)&&!r.characterFormat.hasValue(i);){if(!t.isNullOrUndefined(r.link)&&t.isNullOrUndefined(r.basedOn)&&"Character"==r.link.type&&r.link.characterFormat.hasValue(i)&&"Normal"!=r.name){r=r.link;break}r=r.basedOn}if(!t.isNullOrUndefined(r)){var n=u.getPropertyType(e.uniqueFormatType,i);return r.characterFormat.uniqueCharacterFormat.propertiesHash.get(n)}},e.prototype.checkCharacterStyle=function(i){var r=this.baseCharStyle;if(!t.isNullOrUndefined(r))for(;!t.isNullOrUndefined(r)&&"Default Paragraph Font"!==r.name;){if(r.characterFormat.hasValue(i)){if("bold"===i&&!t.isNullOrUndefined(this.ownerBase)&&this.ownerBase instanceof hl&&!t.isNullOrUndefined(this.ownerBase.paragraph)&&!t.isNullOrUndefined(this.ownerBase.paragraph.paragraphFormat.baseStyle)&&this.ownerBase.paragraph.paragraphFormat.baseStyle instanceof Os&&this.ownerBase.paragraph.paragraphFormat.baseStyle.characterFormat&&r.name!==this.ownerBase.paragraph.paragraphFormat.baseStyle.name&&r.characterFormat.hasValue(i)===this.ownerBase.paragraph.paragraphFormat.baseStyle.characterFormat.hasValue(i))return this.hasValue(i);var n=u.getPropertyType(e.uniqueFormatType,i);return r.characterFormat.uniqueCharacterFormat.propertiesHash.get(n)}r=r.basedOn}},e.prototype.setPropertyValue=function(i,r){if((t.isNullOrUndefined(r)||""===r)&&(r=e.getPropertyDefaultValue(i)),t.isNullOrUndefined(this.uniqueCharacterFormat)||t.isNullOrUndefined(this.uniqueCharacterFormat.propertiesHash)&&t.isNullOrUndefined(this.uniqueCharacterFormat.uniqueFormatType)&&t.isNullOrUndefined(this.uniqueCharacterFormat.referenceCount))this.initializeUniqueCharacterFormat(i,r);else{var n=u.getPropertyType(this.uniqueCharacterFormat.uniqueFormatType,i);if(this.uniqueCharacterFormat.propertiesHash.containsKey(n)&&this.uniqueCharacterFormat.propertiesHash.get(n)===r)return;this.uniqueCharacterFormat=e.uniqueCharacterFormats.updateUniqueFormat(this.uniqueCharacterFormat,i,r)}},e.prototype.initializeUniqueCharacterFormat=function(t,i){var r=new p;this.addUniqueCharacterFormat("fontColor",t,i,r),this.addUniqueCharacterFormat("fontFamily",t,i,r),this.addUniqueCharacterFormat("fontSize",t,i,r),this.addUniqueCharacterFormat("bold",t,i,r),this.addUniqueCharacterFormat("italic",t,i,r),this.addUniqueCharacterFormat("underline",t,i,r),this.addUniqueCharacterFormat("underlineColor",t,i,r),this.addUniqueCharacterFormat("ligature",t,i,r),this.addUniqueCharacterFormat("fontHintType",t,i,r),this.addUniqueCharacterFormat("strikethrough",t,i,r),this.addUniqueCharacterFormat("baselineAlignment",t,i,r),this.addUniqueCharacterFormat("highlightColor",t,i,r),this.addUniqueCharacterFormat("styleName",t,i,r),this.addUniqueCharacterFormat("bidi",t,i,r),this.addUniqueCharacterFormat("bdo",t,i,r),this.addUniqueCharacterFormat("fontFamilyBidi",t,i,r),this.addUniqueCharacterFormat("fontSizeBidi",t,i,r),this.addUniqueCharacterFormat("boldBidi",t,i,r),this.addUniqueCharacterFormat("italicBidi",t,i,r),this.addUniqueCharacterFormat("allCaps",t,i,r),this.addUniqueCharacterFormat("Uppercase",t,i,r),this.addUniqueCharacterFormat("Lowercase",t,i,r),this.addUniqueCharacterFormat("SentenceCase",t,i,r),this.addUniqueCharacterFormat("ToggleCase",t,i,r),this.addUniqueCharacterFormat("CapitalizeEachWord",t,i,r),this.addUniqueCharacterFormat("localeIdAscii",t,i,r),this.addUniqueCharacterFormat("localeIdFarEast",t,i,r),this.addUniqueCharacterFormat("localeIdBidi",t,i,r),this.addUniqueCharacterFormat("fontFamilyFarEast",t,i,r),this.addUniqueCharacterFormat("fontFamilyAscii",t,i,r),this.addUniqueCharacterFormat("fontFamilyNonFarEast",t,i,r),this.addUniqueCharacterFormat("complexScript",t,i,r),this.addUniqueCharacterFormat("characterSpacing",t,i,r),this.addUniqueCharacterFormat("scaling",t,i,r),this.addUniqueCharacterFormat("hidden",t,i,r),this.addUniqueCharacterFormat("specVanish",t,i,r),this.addUniqueCharacterFormat("isKernFont",t,i,r),this.addUniqueCharacterFormat("kern",t,i,r),this.uniqueCharacterFormat=e.uniqueCharacterFormats.addUniqueFormat(r,e.uniqueFormatType)},e.prototype.addUniqueCharacterFormat=function(t,i,r,n){var o=u.getPropertyType(e.uniqueFormatType,t);t===i&&n.add(o,r)},e.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"bold":case"italic":t=!1;break;case"fontSize":t=11;break;case"underline":t="None";break;case"underlineColor":t=void 0;break;case"ligature":t="None";break;case"fontHintType":t="Default";break;case"strikethrough":t="None";break;case"baselineAlignment":t="Normal";break;case"highlightColor":t="NoColor";break;case"fontColor":t="#00000000";break;case"fontFamily":t="Calibri";break;case"styleName":t="Default Paragraph Font";break;case"bidi":t=!1;break;case"bdo":t="None";break;case"boldBidi":case"italicBidi":t=!1;break;case"fontSizeBidi":t=11;break;case"fontFamilyBidi":t="Calibri";break;case"allCaps":case"Uppercase":case"Lowercase":case"CapitalizeEachWord":case"SentenceCase":case"ToggleCase":t=!1;break;case"localeIdAscii":case"localeIdFarEast":case"localeIdBidi":t=0;break;case"complexScript":t=!1;break;case"hidden":case"specVanish":case"isKernFont":t=!1;break;case"fontFamilyFarEast":case"fontFamilyAscii":case"fontFamilyNonFarEast":t=void 0;break;case"characterSpacing":case"kern":t=0;break;case"scaling":t=100}return t},e.prototype.isEqualFormat=function(e){return this.fontSize===e.fontSize&&this.fontFamily===e.fontFamily&&this.bold===e.bold&&this.italic===e.italic&&this.baselineAlignment===e.baselineAlignment&&this.underline===e.underline&&this.fontColor===e.fontColor&&this.strikethrough===e.strikethrough&&this.highlightColor===e.highlightColor&&this.bidi===e.bidi&&this.bdo===e.bdo&&this.allCaps===e.allCaps&&this.Uppercase===e.Uppercase&&this.Lowercase===e.Lowercase&&this.ToggleCase===e.ToggleCase&&this.SentenceCase===e.SentenceCase&&this.CapitalizeEachWord===e.CapitalizeEachWord&&this.localeIdBidi===e.localeIdBidi&&this.localeIdAscii===e.localeIdAscii&&this.localeIdFarEast===e.localeIdFarEast&&this.complexScript===e.complexScript&&this.fontFamilyAscii===e.fontFamilyAscii&&this.fontFamilyBidi===e.fontFamilyBidi&&this.fontFamilyFarEast===e.fontFamilyFarEast&&this.characterSpacing===e.characterSpacing&&this.scaling===e.scaling&&this.fontFamilyNonFarEast===e.fontFamilyNonFarEast&&this.hidden===e.hidden&&this.specVanish===e.specVanish&&this.isKernFont===e.isKernFont&&this.kern===e.kern&&this.ligature===e.ligature},e.prototype.isSameFormat=function(e){return this.baseCharStyle===e.baseCharStyle&&this.uniqueCharacterFormat===e.uniqueCharacterFormat},e.prototype.cloneFormat=function(){var t=new e(void 0,this.owner);return t.uniqueCharacterFormat=this.uniqueCharacterFormat,t.baseCharStyle=this.baseCharStyle,this.revisions.length>0?t.removedIds=F.cloneRevisions(this.revisions):t.removedIds=this.removedIds.slice(),t},e.prototype.hasValue=function(e){if(!t.isNullOrUndefined(this.uniqueCharacterFormat)&&!t.isNullOrUndefined(this.uniqueCharacterFormat.propertiesHash)){var i=u.getPropertyType(this.uniqueCharacterFormat.uniqueFormatType,e);return this.uniqueCharacterFormat.propertiesHash.containsKey(i)}return!1},e.prototype.clearFormat=function(){t.isNullOrUndefined(this.uniqueCharacterFormat)||0!==this.uniqueCharacterFormat.referenceCount||e.uniqueCharacterFormats.remove(this.uniqueCharacterFormat),this.uniqueCharacterFormat=void 0,this.baseCharStyle=void 0},e.prototype.destroy=function(){t.isNullOrUndefined(this.uniqueCharacterFormat)||e.uniqueCharacterFormats.remove(this.uniqueCharacterFormat),this.uniqueCharacterFormat=void 0,this.baseCharStyle=void 0,this.ownerBase=void 0,this.owner=void 0},e.prototype.copyFormat=function(e){t.isNullOrUndefined(e)||(!t.isNullOrUndefined(e.uniqueCharacterFormat)&&e.uniqueCharacterFormat.propertiesHash&&this.updateUniqueCharacterFormat(e),t.isNullOrUndefined(e.baseCharStyle)||(this.baseCharStyle=e.baseCharStyle),e.revisions.length>0?this.removedIds=F.cloneRevisions(e.revisions):this.removedIds=e.removedIds.slice())},e.prototype.isEqualTocFormat=function(e){return this.fontFamily===e.fontFamily&&this.bold===e.bold&&this.italic===e.italic&&this.strikethrough===e.strikethrough&&this.highlightColor===e.highlightColor&&this.fontFamilyAscii===e.fontFamilyAscii&&this.fontFamilyFarEast===e.fontFamilyFarEast&&this.fontFamilyNonFarEast===e.fontFamilyNonFarEast},e.prototype.copyTocFormat=function(e){t.isNullOrUndefined(e.bold)||(this.bold=e.bold),t.isNullOrUndefined(e.italic)||(this.italic=e.italic),t.isNullOrUndefined(e.strikethrough)||(this.strikethrough=e.strikethrough),t.isNullOrUndefined(e.highlightColor)||(this.highlightColor=e.highlightColor),t.isNullOrUndefined(e.fontFamily)||(this.fontFamily=e.fontFamily,this.fontFamilyAscii=e.fontFamily,this.fontFamilyFarEast=e.fontFamily,this.fontFamilyNonFarEast=e.fontFamily)},e.prototype.updateUniqueCharacterFormat=function(i){var r=void 0;this.uniqueCharacterFormat&&(r=this.uniqueCharacterFormat.mergeProperties(i.uniqueCharacterFormat),0===this.uniqueCharacterFormat.referenceCount&&(e.uniqueCharacterFormats.remove(this.uniqueCharacterFormat),this.uniqueCharacterFormat=void 0)),this.uniqueCharacterFormat=new u(e.uniqueFormatType),t.isNullOrUndefined(r)&&(r=this.uniqueCharacterFormat.mergeProperties(i.uniqueCharacterFormat)),this.uniqueCharacterFormat=e.uniqueCharacterFormats.addUniqueFormat(r,e.uniqueFormatType)},e.clear=function(){this.uniqueCharacterFormats.clear()},e.prototype.applyStyle=function(e){this.baseCharStyle=e},e.prototype.getValue=function(e){return this.hasValue(e)?this.getPropertyValue(e):void 0},e.prototype.mergeFormat=function(e){t.isNullOrUndefined(this.getValue("bold"))&&(this.bold=e.getValue("bold")),t.isNullOrUndefined(this.getValue("italic"))&&(this.italic=e.getValue("italic")),t.isNullOrUndefined(this.getValue("fontSize"))&&(this.fontSize=e.getValue("fontSize")),t.isNullOrUndefined(this.getValue("boldBidi"))&&(this.boldBidi=e.getValue("boldBidi")),t.isNullOrUndefined(this.getValue("italicBidi"))&&(this.italicBidi=e.getValue("italicBidi")),t.isNullOrUndefined(this.getValue("fontSizeBidi"))&&(this.fontSizeBidi=e.getValue("fontSizeBidi")),t.isNullOrUndefined(this.getValue("characterSpacing"))&&(this.characterSpacing=e.getValue("characterSpacing")),t.isNullOrUndefined(this.getValue("scaling"))&&(this.scaling=e.getValue("scaling")),t.isNullOrUndefined(this.getValue("kern"))&&(this.kern=e.getValue("kern")),t.isNullOrUndefined(this.getValue("isKernFont"))&&(this.isKernFont=e.getValue("isKernFont")),t.isNullOrUndefined(this.getValue("fontFamily"))?this.fontFamily=e.getValue("fontFamily"):(t.isNullOrUndefined(this.getValue("fontFamilyAscii"))&&(this.fontFamilyAscii=e.getValue("fontFamily")),t.isNullOrUndefined(this.getValue("fontFamilyFarEast"))&&(this.fontFamilyFarEast=e.getValue("fontFamily")),t.isNullOrUndefined(this.getValue("fontFamilyNonFarEast"))&&(this.fontFamilyNonFarEast=e.getValue("fontFamily"))),t.isNullOrUndefined(this.getValue("underline"))&&(this.underline=e.getValue("underline")),t.isNullOrUndefined(this.getValue("fontHintType"))&&(this.fontHintType=e.getValue("fontHintType")),t.isNullOrUndefined(this.getValue("strikethrough"))&&(this.strikethrough=e.getValue("strikethrough")),t.isNullOrUndefined(this.getValue("baselineAlignment"))&&(this.baselineAlignment=e.getValue("baselineAlignment")),t.isNullOrUndefined(this.getValue("highlightColor"))&&(this.highlightColor=e.getValue("highlightColor")),t.isNullOrUndefined(this.getValue("fontColor"))&&(this.fontColor=e.getValue("fontColor")),t.isNullOrUndefined(this.getValue("ligature"))&&(this.ligature=e.getValue("ligature")),t.isNullOrUndefined(this.getValue("bidi"))&&(this.bidi=e.getValue("bidi")),t.isNullOrUndefined(this.getValue("bdo"))&&(this.bdo=e.getValue("bdo")),t.isNullOrUndefined(this.getValue("allCaps"))&&(this.allCaps=e.getValue("allCaps")),t.isNullOrUndefined(this.getValue("Lowercase"))&&(this.Lowercase=e.getValue("Lowercase")),t.isNullOrUndefined(this.getValue("SentenceCase"))&&(this.SentenceCase=e.getValue("SentenceCase")),t.isNullOrUndefined(this.getValue("ToggleCase"))&&(this.ToggleCase=e.getValue("ToggleCase")),t.isNullOrUndefined(this.getValue("CapitalizeEachWord"))&&(this.CapitalizeEachWord=e.getValue("CapitalizeEachWord")),t.isNullOrUndefined(this.getValue("Uppercase"))&&(this.Uppercase=e.getValue("Uppercase")),t.isNullOrUndefined(this.getValue("localeIdBidi"))&&(this.localeIdBidi=e.getValue("localeIdBidi")),t.isNullOrUndefined(this.getValue("localeIdAscii"))&&(this.localeIdAscii=e.getValue("localeIdAscii")),t.isNullOrUndefined(this.getValue("localeIdFarEast"))&&(this.localeIdFarEast=e.getValue("localeIdFarEast")),t.isNullOrUndefined(this.getValue("complexScript"))&&(this.complexScript=e.getValue("complexScript")),t.isNullOrUndefined(this.getValue("fontFamilyAscii"))&&(this.fontFamilyAscii=e.getValue("fontFamilyAscii")),t.isNullOrUndefined(this.getValue("fontFamilyBidi"))&&(this.fontFamilyBidi=e.getValue("fontFamilyBidi")),t.isNullOrUndefined(this.getValue("fontFamilyFarEast"))&&(this.fontFamilyFarEast=e.getValue("fontFamilyFarEast")),t.isNullOrUndefined(this.getValue("fontFamilyNonFarEast"))&&(this.fontFamilyNonFarEast=e.getValue("fontFamilyNonFarEast"))},e.prototype.assignFormat=function(e){e.hasValue("bold")&&(this.bold=e.getValue("bold")),e.hasValue("italic")&&(this.italic=e.getValue("italic")),e.hasValue("fontSize")&&(this.fontSize=e.getValue("fontSize")),e.hasValue("characterSpacing")&&(this.characterSpacing=e.getValue("characterSpacing")),e.hasValue("scaling")&&(this.scaling=e.getValue("scaling")),e.hasValue("kern")&&(this.kern=e.getValue("kern")),e.hasValue("isKernFont")&&(this.isKernFont=e.getValue("isKernFont")),e.hasValue("fontFamily")&&(this.fontFamily=e.getValue("fontFamily"),this.fontFamilyFarEast=e.getValue("fontFamily"),this.fontFamilyAscii=e.getValue("fontFamily"),this.fontFamilyNonFarEast=e.getValue("fontFamily"),this.fontFamilyBidi=e.getValue("fontFamily")),e.hasValue("underline")&&(this.underline=e.getValue("underline")),e.hasValue("fontHintType")&&(this.fontHintType=e.getValue("fontHintType")),e.hasValue("strikethrough")&&(this.strikethrough=e.getValue("strikethrough")),e.hasValue("baselineAlignment")&&(this.baselineAlignment=e.getValue("baselineAlignment")),e.hasValue("highlightColor")&&(this.highlightColor=e.getValue("highlightColor")),e.hasValue("fontColor")&&(this.fontColor=e.getValue("fontColor")),e.hasValue("ligature")&&(this.ligature=e.getValue("ligature")),e.hasValue("bidi")&&(this.bidi=e.getValue("bidi")),e.hasValue("bdo")&&(this.bdo=e.getValue("bdo")),e.hasValue("allCaps")&&(this.allCaps=e.getValue("allCaps")),e.hasValue("Lowercase")&&(this.Lowercase=e.getValue("Lowercase")),e.hasValue("SentenceCase")&&(this.SentenceCase=e.getValue("SentenceCase")),e.hasValue("ToggleCase")&&(this.ToggleCase=e.getValue("ToggleCase")),e.hasValue("CapitalizeEachWord")&&(this.CapitalizeEachWord=e.getValue("CapitalizeEachWord")),e.hasValue("Uppercase")&&(this.Uppercase=e.getValue("Uppercase")),e.hasValue("localeIdBidi")&&(this.localeIdBidi=e.getValue("localeIdBidi")),e.hasValue("localeIdAscii")&&(this.localeIdAscii=e.getValue("localeIdAscii")),e.hasValue("localeIdFarEast")&&(this.localeIdFarEast=e.getValue("localeIdFarEast")),e.hasValue("complexScript")&&(this.complexScript=e.getValue("complexScript"))},e.prototype.hasValueWithParent=function(e){var i=this.hasValue(e);!i&&!t.isNullOrUndefined(this.baseCharStyle)&&this.baseCharStyle instanceof Ss&&(i=this.baseCharStyle.characterFormat.hasValue(e));var r=this.documentCharacterFormat();return i||t.isNullOrUndefined(r)||t.isNullOrUndefined(r.documentFormat)||(i=r.documentFormat.hasValue(e)),i},Object.defineProperty(e.prototype,"revisionLength",{get:function(){return t.isNullOrUndefined(this.revisions)?0:this.revisions.length},enumerable:!0,configurable:!0}),e.prototype.getRevision=function(e){if(!t.isNullOrUndefined(this.revisions))return this.revisions[e]},e.prototype.getListDocumentHelper=function(){var e=this.ownerBase instanceof Qs?this.ownerBase.bodyWidget:void 0;if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(e.page)&&!t.isNullOrUndefined(e.page.documentHelper)&&"function"==typeof e.page.documentHelper.getListById)return e.page.documentHelper;if(!t.isNullOrUndefined(this.owner)){if("function"==typeof this.owner.getListById)return this.owner;if(!t.isNullOrUndefined(this.owner)&&"function"==typeof this.owner.getListById)return this.owner}},e.prototype.markFollowedListLayout=function(){if(this.ownerBase instanceof Qs&&!t.isNullOrUndefined(this.ownerBase.paragraphFormat)&&!t.isNullOrUndefined(this.ownerBase.paragraphFormat.listFormat)){var e=this.ownerBase.paragraphFormat.listFormat,i=this.getListDocumentHelper();t.isNullOrUndefined(i)||t.isNullOrUndefined(i.getListById(e.listId))||t.isNullOrUndefined(e.listLevel)||"Bullet"===e.listLevel.listLevelPattern||(i.isFollowedListLayoutRequired=!0)}},e.prototype.addRevision=function(e){-1===this.revisions.indexOf(e)&&this.revisions.push(e),this.markFollowedListLayout(),e.hasChanges=!0},e.prototype.insertRevisionAt=function(e,t){this.revisions.splice(e,0,t),this.markFollowedListLayout(),t.hasChanges=!0},e.prototype.removeRevision=function(e){var t=this.revisions.splice(e,1)[0];return this.markFollowedListLayout(),t.hasChanges=!0,t},e.prototype.getAllRevision=function(){return this.revisions},e.prototype.clearRevision=function(){this.revisions=[]},e.prototype.getRevisionRange=function(e){var t=[];return-1!==this.revisions.indexOf(e)&&t.push(this),t},e.uniqueCharacterFormats=new f,e.uniqueFormatType=2,e}(),N=["sections","sec"],I=["fontSubstitutionTable","fst"],k=["characterFormat","cf"],A=["paragraphFormat","pf"],L=["lists","li"],U=["abstractLists","al"],B=["background","bg"],H=["styles","sty"],R=["comments","cm"],q=["revisions","r"],E=["customXml","cx"],M=["defaultTabWidth","dtw"],V=["formatting","fmt"],D=["trackChanges","tc"],z=["protectionType","pt"],_=["enforcement","enf"],j=["hashValue","hv"],G=["saltValue","sv"],K=["cryptProviderType","cpt"],Y=["cryptAlgorithmClass","cac"],X=["cryptAlgorithmType","cat"],J=["cryptAlgorithmSid","cas"],Z=["cryptSpinCount","csc"],Q=["dontUseHTMLParagraphAutoSpacing","dhtml"],$=["alignTablesRowByRow","atrr"],ee=["formFieldShading","ffs"],te=["lastParagraphMarkCopied","lpmc"],ie=["footnotes","fn"],re=["endnotes","en"],ne=["compatibilityMode","comp"],oe=["themeFontLanguages","tfl"],ae=["themes","thm"],se=["name","n"],le=["basedOn","b"],de=["next","nx"],he=["link","l"],ce=["localeId","id"],ge=["localeIdFarEast","idfe"],pe=["localeIdBidi","idbi"],ue=["bold","b"],fe=["italic","i"],me=["ligature","lig"],ye=["underline","u"],ve=["underlineColor","uc"],We=["fontHintType","fht"],be=["baselineAlignment","ba"],xe=["strikethrough","st"],we=["highlightColor","hc"],Fe=["fontSize","fsz"],Ce=["fontColor","fc"],Pe=["fontFamily","ff"],Te=["styleName","stn"],Oe=["bidi","bi"],Se=["bdo","bdo"],Ne=["breakClearType","bct"],Ie=["fontSizeBidi","fszbi"],ke=["fontFamilyBidi","ffbi"],Ae=["boldBidi","bbi"],Le=["italicBidi","ibi"],Ue=["allCaps","ac"],Be=["complexScript","cs"],He=["fontFamilyAscii","ffa"],Re=["fontFamilyFarEast","fffe"],qe=["fontFamilyNonFarEast","ffnfe"],Ee=["revisionIds","rids"],Me=["listId","lid"],Ve=["characterSpacing","csp"],De=["scaling","sc"],ze=["listLevelNumber","lilno"],_e=["leftIndent","lin"],je=["rightIndent","rin"],Ge=["firstLineIndent","fin"],Ke=["textAlignment","ta"],Ye=["afterSpacing","as"],Xe=["beforeSpacing","bs"],Je=["spaceAfterAuto","saa"],Ze=["spaceBeforeAuto","sba"],Qe=["lineSpacing","ls"],$e=["lineSpacingType","lst"],et=["listFormat","lif"],tt=["keepWithNext","kwn"],it=["widowControl","wc"],rt=["keepLinesTogether","klt"],nt=["outlineLevel","ol"],ot=["contextualSpacing","cs"],at=["borders","bdrs"],st=["tabs","tb"],lt=["headerDistance","hd"],dt=["footerDistance","fd"],ht=["differentFirstPage","dfp"],ct=["differentOddAndEvenPages","doep"],gt=["pageWidth","pw"],pt=["pageHeight","ph"],ut=["leftMargin","lm"],ft=["rightMargin","rm"],mt=["topMargin","tm"],yt=["bottomMargin","bm"],vt=["restartPageNumbering","rpn"],Wt=["pageStartingNumber","psn"],bt=["endnoteNumberFormat","enf"],xt=["footNoteNumberFormat","fnf"],wt=["restartIndexForFootnotes","rif"],Ft=["restartIndexForEndnotes","rie"],Ct=["initialFootNoteNumber","ifn"],Pt=["initialEndNoteNumber","ien"],Tt=["pageNumberStyle","pgns"],Ot=["columns","cols"],St=["numberOfColumns","ncols"],Nt=["equalWidth","eqw"],It=["lineBetweenColumns","lbtc"],kt=["breakCode","bc"],At=["cellWidth","cw"],Lt=["columnSpan","colsp"],Ut=["rowSpan","rwsp"],Bt=["verticalAlignment","va"],Ht=["allowBreakAcrossPages","abrk"],Rt=["isHeader","hdr"],qt=["heightType","ht"],Et=["beforeWidth","bw"],Mt=["afterWidth","aw"],Vt=["gridBefore","gb"],Dt=["gridBeforeWidth","gbw"],zt=["gridBeforeWidthType","gbwt"],_t=["gridAfter","ga"],jt=["gridAfterWidth","gaw"],Gt=["gridAfterWidthType","gawt"],Kt=["allowAutoFit","auft"],Yt=["cellSpacing","csp"],Xt=["shading","sd"],Jt=["tableAlignment","ta"],Zt=["preferredWidth","pw"],Qt=["preferredWidthType","pwt"],$t=["verticallyMergedCellsKeepWithNext","vkwn"],ei=["verticallyMergedCellsLeftMargin","vlm"],ti=["verticallyMergedCellsRightMargin","vrm"],ii=["verticallyMergedCellsTopMargin","vtm"],ri=["verticallyMergedCellsBottomMargin","vbm"],ni=["horizontalPositionAbs","hpa"],oi=["texture","t"],ai=["backgroundColor","bgc"],si=["foregroundColor","fgc"],li=["shadow","sh"],di=["hasNoneStyle","hns"],hi=["vertical","v"],ci=["horizontal","h"],gi=["diagonalUp","du"],pi=["diagonalDown","dd"],ui=["lineStyle","ls"],fi=["lineWidth","lw"],mi=["layout","l"],yi=["dataFormat","df"],vi=["yValue","y"],Wi=["chartData","chd"],bi=["categoryXName","cx"],xi=["line","l"],wi=["foreColor","fc"],Fi=["pattern","pt"],Ci=["layoutX","x"],Pi=["layoutY","y"],Ti=["direction","dir"],Oi=["endStyle","est"],Si=["numberValue","no"],Ni=["markerStyle","mst"],Ii=["markerColor","mc"],ki=["markerSize","msz"],Ai=["forward","fw"],Li=["backward","bw"],Ui=["intercept","itr"],Bi=["isDisplayRSquared","idrs"],Hi=["isDisplayEquation","ideq"],Ri=["seriesName","sn"],qi=["dataLabel","sl"],Ei=["errorBar","eb"],Mi=["seriesFormat","sf"],Vi=["trendLines","tl"],Di=["dataPoints","dp"],zi=["firstSliceAngle","fsa"],_i=["holeSize","hsz"],ji=["isLegendKey","lk"],Gi=["isBubbleSize","bsz"],Ki=["isCategoryName","icn"],Yi=["isSeriesName","isn"],Xi=["isValue","iv"],Ji=["isPercentage","ip"],Zi=["isLeaderLines","il"],Qi=["showSeriesKeys","sk"],$i=["hasHorzBorder","hhbdr"],er=["hasVertBorder","hvbdr"],tr=["hasBorders","hbdr"],ir=["categoryType","ct"],rr=["chartCategory","c"],nr=["chartSeries","cs"],or=["chartArea","ca"],ar=["chartTitleArea","cta"],sr=["plotArea","pa"],lr=["chartLegend","cl"],dr=["chartPrimaryCategoryAxis","cpca"],hr=["chartPrimaryValueAxis","cpva"],cr=["chartTitle","ctt"],gr=["chartType","ct"],pr=["gapWidth","gw"],ur=["overlap","o"],fr=["chartDataTable","cdt"],mr=["text","tlp"],yr=["shapeId","sid"],vr=["alternativeText","at"],Wr=["visible","v"],br=["belowText","b"],xr=["horizontalRule","ihr"],wr=["width","w"],Fr=["height","h"],Cr=["widthScale","ws"],Pr=["heightScale","hs"],Tr=["lineFormat","lf"],Or=["fillFormat","ff"],Sr=["textWrappingStyle","tws"],Nr=["textWrappingType","twt"],Ir=["verticalRelativePercent","vrp"],kr=["horizontalRelativePercent","hrp"],Ar=["heightRelativePercent","hrp"],Lr=["widthRelativePercent","wrp"],Ur=["zOrderPosition","z"],Br=["layoutInCell","lc"],Hr=["lockAnchor","la"],Rr=["autoShapeType","ast"],qr=["textFrame","tf"],Er=["color","c"],Mr=["fill","f"],Vr=["isDefaultFill","idf"],Dr=["fillType","ft"],zr=["textVerticalAlignment","tva"],_r=["imageString","img"],jr=["metaFileImageString","mtimg"],Gr=["length","l"],Kr=["isInlineImage","inimg"],Yr=["isMetaFile","imf"],Xr=["hasImageReference","hir"],Jr=["top","tp"],Zr=["bottom","bt"],Qr=["right","rg"],$r=["left","lt"],en=["getimageheight","gih"],tn=["getimagewidth","giw"],rn=["hasFieldEnd","hfe"],nn=["formFieldData","ffd"],on=["fieldType","ft"],an=["isCreatedUsingHtmlSpanTag","ishst"],sn=["enabled","e"],ln=["helpText","h"],dn=["statusText","st"],hn=["textInput","ti"],cn=["checkBox","c"],gn=["dropDownList","ddl"],pn=["maxLength","ml"],un=["defaultValue","dv"],fn=["format","f"],mn=["sizeType","szt"],yn=["size","sz"],vn=["checked","chk"],Wn=["dropDownItems","ddi"],bn=["selectedIndex","si"],xn=["commentId","cid"],wn=["commentCharacterType","cct"],Fn=["author","a"],Cn=["initial","i"],Pn=["date","dt"],Tn=["done","dn"],On=["replyComments","rc"],Sn=["revisionType","rt"],Nn=["revisionId","rid"],In=["customData","cd"],kn=["itemID","iid"],An=["xml","x"],Ln=["footnoteType","fnt"],Un=["symbolCode","sc"],Bn=["symbolFontName","sfn"],Hn=["customMarker","cm"],Rn=["inlines","i"],qn=["contentControlProperties","ccp"],En=["cellContentControl","ccc"],Mn=["lockContentControl","lcc"],Vn=["lockContents","lc"],Dn=["isInsertRevision","iir"],zn=["isDeleteRevision","idr"],_n=["authorName","an"],jn=["revDateTime","rdt"],Gn=["tag","tg"],Kn=["title","tt"],Yn=["hasPlaceHolderText","hpt"],Xn=["multiline","mul"],Jn=["isTemporary","it"],Zn=["dateCalendarType","dtct"],Qn=["dateStorageFormat","dtsf"],$n=["dateDisplayLocale","dtdl"],eo=["dateDisplayFormat","dtdf"],to=["isChecked","ichk"],io=["uncheckedState","uchk"],ro=["checkedState","chks"],no=["contentControlListItems","ccli"],oo=["xmlMapping","x"],ao=["font","f"],so=["value","v"],lo=["displayText","dt"],ho=["isMapped","imap"],co=["isWordMl","iwml"],go=["prefixMapping","pmap"],po=["xPath","xp"],uo=["storeItemId","siid"],fo=["customXmlPart","cxp"],mo=["id","i"],yo=["cellFormat","tcpr"],vo=["rowFormat","trpr"],Wo=["cells","c"],bo=["rows","r"],xo=["description","desc"],wo=["wrapTextAround","wta"],Fo=["isLegalStyleNumbering","isLgl"],Co=["positioning","p"],Po=["tableFormat","tblpr"],To=["allowOverlap","ao"],Oo=["distanceTop","dt"],So=["distanceRight","dr"],No=["distanceLeft","dl"],Io=["distanceBottom","db"],ko=["verticalOrigin","vo"],Ao=["verticalPosition","vp"],Lo=["horizontalOrigin","ho"],Uo=["horizontalAlignment","ha"],Bo=["horizontalPosition","hp"],Ho=["blocks","b"],Ro=["header","h"],qo=["footer","f"],Eo=["evenHeader","eh"],Mo=["evenFooter","ef"],Vo=["firstPageHeader","fph"],Do=["firstPageFooter","fpf"],zo=["headersFooters","hf"],_o=["sectionFormat","secpr"],jo=["listLevelPattern","lilp"],Go=["followCharacter","fchar"],Ko=["numberAlignment","nalign"],Yo=["startAt","sa"],Xo=["restartLevel","rl"],Jo=["levelNumber","lvlno"],Zo=["numberFormat","nf"],Qo=["paraStyleName","psty"],$o=["abstractListId","alid"],ea=["levels","lvl"],ta=["overrideListLevel","o"],ia=["levelOverrides","lo"],ra=["separator","s"],na=["continuationSeparator","cs"],oa=["continuationNotice","cn"],aa=["bookmarkType","bkt"],sa=["properties","p"],la=["tabJustification","tj"],da=["position","p"],ha=["deletePosition","dp"],ca=["leader","l"],ga=["tabLeader","tl"],pa=["editRangeId","erid"],ua=["columnFirst","cft"],fa=["columnLast","clt"],ma=["user","u"],ya=["group","g"],va=["editableRangeStart","ers"],Wa=["space","sp"],ba=["fontScheme","fsc"],xa=["fontSchemeName","fscn"],wa=["majorFontScheme","majfs"],Fa=["minorFontScheme","minfs"],Ca=["fontSchemeList","fsl"],Pa=["fontTypeface","ft"],Ta=["typeface","t"],Oa=["panose","p"],Sa=["type","t"],Na=["majorUnit","maju"],Ia=["isAutoMajor","iam"],ka=["maximumValue","maxv"],Aa=["minimumValue","minv"],La=["hasMajorGridLines","hmajgl"],Ua=["hasMinorGridLines","hmingl"],Ba=["majorTickMark","majtm"],Ha=["minorTickMark","mintm"],Ra=["tickLabelPosition","tlp"],qa=["rgb","rgb"],Ea=["appearance","a"],Ma=["lineFormatType","lft"],Va=["allowSpaceOfSameStyleInTable","stytbl"],Da=["weight","w"],za=["inlineFormat","inf"],_a=["fontName","fn"],ja=["isCompressed","comp"],Ga=["columnIndex","ci"],Ka=["images","imgs"],Ya=["isAfterParagraphMark","apm"],Xa=["isAfterCellMark","acm"],Ja=["isAfterRowMark","arm"],Za=["grid","grd"],Qa=["columnCount","colc"],$a=["isAfterTableMark","atm"],es=["iOps"],ts=["hidden","hdn"],is=["specVanish","spv"],rs=["kern","krn"],ns=["isKernFont","ikf"],os=["editingpoints","ep"],as=["childShapes","csh"],ss=["offsetXValue","oxv"],ls=["offsetYValue","oyv"],ds=["extentXValue","exv"],hs=["extentYValue","eyv"],cs=["allowHyphensInBookmarkNames","ahb"],gs=["coordinateXOrigin","cxo"],ps=["coordinateYOrigin","cyo"],us=["coordinateSize","cos"],fs=["is2007Shape","i2007s"],ms=["lineFromXPosition","lfx"],ys=["lineFromYPosition","lfy"],vs=["lineToXPosition","ltx"],Ws=["lineToYPosition","lty"],bs=function(){function e(){}return e.containsUnderlinedImage=function(e){for(var t=!1,i=0;i<e.children.length;i++){var r=e.children[i];if(r instanceof hl||r instanceof kl||r instanceof ol)return!1;r instanceof Il&&(t=r.getAllRevision().length>0&&"Insertion"===r.getRevision(0).revisionType||r.characterFormat&&"None"!==r.characterFormat.underline)}return t},e.checkTextFormat=function(e){var t=/^[0-9]+$/;return!(!/^(M{0,3})(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/i.test(e)&&!t.test(e))},e.convertRgbToHex=function(e){var t=e.toString(16);return 1===t.length?"0"+t:t},e.getHighlightColorCode=function(e){var t="#ffffff";switch(e){case"Yellow":t="#ffff00";break;case"BrightGreen":t="#00ff00";break;case"Turquoise":t="#00ffff";break;case"Pink":t="#ff00ff";break;case"Blue":t="#0000ff";break;case"Red":t="#ff0000";break;case"DarkBlue":t="#000080";break;case"Teal":t="#008080";break;case"Green":t="#008000";break;case"Violet":t="#800080";break;case"DarkRed":t="#800000";break;case"DarkYellow":t="#808000";break;case"Gray50":t="#808080";break;case"Gray25":t="#c0c0c0";break;case"Black":t="#000000"}return t},e.isVeryDark=function(e){var t=e.substring(1);return(299*parseInt(t.substr(0,2),16)+587*parseInt(t.substr(2,2),16)+114*parseInt(t.substr(4,2),16))/1e3<=60},e.getColor=function(e){return e.length>0&&"#"===e[0]&&e.length>7?e.substr(0,7):e},e.getSfdtDocument=function(e){if(e=e instanceof Object?e:JSON.parse(e),!t.isNullOrUndefined(e.sfdt)){var r=new i.ZipArchive;r.open(JSON.stringify(e.sfdt));var n=r.items[0],o=new Uint8Array(n.data),a=new TextDecoder("utf-8").decode(o);e=JSON.parse(a)}return e},e.indexOfAny=function(e,i){for(var r=void 0,n=0;n<i.length;n++){var o=e.indexOf(i[parseInt(n.toString(),10)]);-1!==o&&t.isNullOrUndefined(r)?r=o:-1!==o&&o<r&&(r=o)}return t.isNullOrUndefined(r)?-1:r},e.convertHexToRgb=function(e){var t,i,r;if(e){e=e.replace(/[^0-9A-‌​F]/gi,"");var n=parseInt(e,16);return 8===e.length?(t=n>>32&255,i=n>>16&255,r=n>>8&255):6===e.length&&(t=n>>16&255,i=n>>8&255,r=255&n),{r:t,g:i,b:r}}},e.convertPointToPixel=function(t){var i=void 0!==t?t:0,r=e.round(i,5);return e.round(96*r/72,5)},e.convertPixelToPoint=function(t){var i=void 0!==t?t:0;return e.round(72*i/96,5)},e.isLinkedFieldCharacter=function(e){return e instanceof ol&&0===e.fieldType?!t.isNullOrUndefined(e.fieldEnd):e instanceof ol&&2===e.fieldType?!t.isNullOrUndefined(e.fieldBegin)&&!t.isNullOrUndefined(e.fieldEnd):!t.isNullOrUndefined(e.fieldBegin)},e.removeSpace=function(e){if(!t.isNullOrUndefined(e)&&0!==e.length)for(var i=0;i<e.length;i++)" "===e.charAt(i)&&(e=e.replace(" ",""));return e},e.trimStart=function(e){var t=0;for(t;t<e.length&&" "===e[parseInt(t.toString(),10)];t++);return e.substring(t,e.length)},e.trimEnd=function(e){var t=e.length-1;for(t;t>=0&&" "===e[parseInt(t.toString(),10)];t--);return e.substring(0,t+1)},e.endsWith=function(e){return!t.isNullOrUndefined(e)&&0!==e.length&&" "===e[e.length-1]},e.addSpace=function(e){var t="";if(e>0)for(var i=0;i<e;i++)t+=" ";return t},e.getBoolValue=function(e){return e?1:0},e.getBoolInfo=function(e,t){return 1===t?this.getBoolValue(e):e},e.parseBoolValue=function(e){return e instanceof String?!t.isNullOrUndefined(e)&&"f"!==e&&"0"!==e&&"off"!==e&&"false"!==e:1==e},e.getBaselineAlignmentEnumValue=function(e){switch(e){case"Normal":return 0;case"Superscript":return 1;case"Subscript":return 2}},e.getFontHintTypeEnumValue=function(e){switch(e){case"Default":return 0;case"EastAsia":return 1;case"CS":return 2}},e.getUnderlineEnumValue=function(e){switch(e){case"None":return 0;case"Single":return 1;case"Words":return 2;case"Double":return 3;case"Dotted":return 4;case"Thick":return 5;case"Dash":return 6;case"DashLong":return 7;case"DotDash":return 8;case"DotDotDash":return 9;case"Wavy":return 10;case"DottedHeavy":return 11;case"DashHeavy":return 12;case"DashLongHeavy":return 13;case"DotDashHeavy":return 14;case"DotDotDashHeavy":return 15;case"WavyHeavy":return 16;case"WavyDouble":return 17}},e.getStrikeThroughEnumValue=function(e){switch(e){case"None":return 0;case"SingleStrike":return 1;case"DoubleStrike":return 2}},e.getHighlightColorEnumValue=function(e){switch(e){case"NoColor":return 0;case"Yellow":return 1;case"BrightGreen":return 2;case"Turquoise":return 3;case"Pink":return 4;case"Blue":return 5;case"Red":return 6;case"DarkBlue":return 7;case"Teal":return 8;case"Green":return 9;case"Violet":return 10;case"DarkRed":return 11;case"DarkYellow":return 12;case"Gray50":return 13;case"Gray25":return 14;case"Black":return 15;default:return e}},e.getBiDirectionalOverride=function(e){switch(e){case"None":return 0;case"LTR":return 1;case"RTL":return 2}},e.getOutlineLevelEnumValue=function(e){switch(e){case"BodyText":return 0;case"Level1":return 1;case"Level2":return 2;case"Level3":return 3;case"Level4":return 4;case"Level5":return 5;case"Level6":return 6;case"Level7":return 7;case"Level8":return 8;case"Level9":return 9}},e.getTextAlignmentEnumValue=function(e){switch(e){case"Left":return 0;case"Center":return 1;case"Right":return 2;case"Justify":return 3}},e.getLineStyleEnumValue=function(e){switch(e){case"Single":return 0;case"None":return 1;case"Dot":return 2;case"DashSmallGap":return 3;case"DashLargeGap":return 4;case"DashDot":return 5;case"DashDotDot":return 6;case"Double":return 7;case"Triple":return 8;case"ThinThickSmallGap":return 9;case"ThickThinSmallGap":return 10;case"ThinThickThinSmallGap":return 11;case"ThinThickMediumGap":return 12;case"ThickThinMediumGap":return 13;case"ThinThickThinMediumGap":return 14;case"ThinThickLargeGap":return 15;case"ThickThinLargeGap":return 16;case"ThinThickThinLargeGap":return 17;case"SingleWavy":return 18;case"DoubleWavy":return 19;case"DashDotStroked":return 20;case"Emboss3D":return 21;case"Engrave3D":return 22;case"Outset":return 23;case"Inset":return 24;case"Thick":return 25;case"Cleared":return 26}},e.getLineSpacingTypeEnumValue=function(e){switch(e){case"Multiple":return 0;case"AtLeast":return 1;case"Exactly":return 2;case"Single":return 3;case"Double":return 4}},e.writeBorder=function(t,i){var r={};return r[Er[i]]=t.hasValue("color")?t.color:void 0,r[di[i]]=t.hasValue("hasNoneStyle")?e.getBoolInfo(t.hasNoneStyle,i):void 0,r[ui[i]]=t.hasValue("lineStyle")?1==i?this.getLineStyleEnumValue(t.lineStyle):t.lineStyle:void 0,r[fi[i]]=t.hasValue("lineWidth")?t.lineWidth:void 0,r[li[i]]=t.hasValue("shadow")?e.getBoolInfo(t.shadow,i):void 0,r[Wa[i]]=t.hasValue("space")?t.space:void 0,r},e.writeBorders=function(e,t){var i={};return i[Jr[t]]=this.writeBorder(e.getBorder("top"),t),i[$r[t]]=this.writeBorder(e.getBorder("left"),t),i[Qr[t]]=this.writeBorder(e.getBorder("right"),t),i[Zr[t]]=this.writeBorder(e.getBorder("bottom"),t),i[ci[t]]=this.writeBorder(e.getBorder("horizontal"),t),i[hi[t]]=this.writeBorder(e.getBorder("vertical"),t),i},e.writeParagraphFormat=function(i,r,n,o){o=t.isNullOrUndefined(o)?0:o,i[at[o]]=this.writeBorders(n.borders,o),i[_e[o]]=r?n.leftIndent:n.getValue("leftIndent"),i[je[o]]=r?n.rightIndent:n.getValue("rightIndent"),i[Ge[o]]=r?n.firstLineIndent:n.getValue("firstLineIndent"),i[Ke[o]]=r?1==o?this.getTextAlignmentEnumValue(n.textAlignment):n.textAlignment:1==o?this.getTextAlignmentEnumValue(n.getValue("textAlignment")):n.getValue("textAlignment"),i[Xe[o]]=r?n.beforeSpacing:n.getValue("beforeSpacing"),i[Ye[o]]=r?n.afterSpacing:n.getValue("afterSpacing"),i[Ze[o]]=r?e.getBoolInfo(n.spaceBeforeAuto,o):n.getValue("spaceBeforeAuto"),i[Je[o]]=r?e.getBoolInfo(n.spaceAfterAuto,o):n.getValue("spaceAfterAuto"),i[Qe[o]]=r?n.lineSpacing:n.getValue("lineSpacing"),i[$e[o]]=r?1==o?this.getLineSpacingTypeEnumValue(n.lineSpacingType):n.lineSpacingType:1==o?this.getLineSpacingTypeEnumValue(n.getValue("lineSpacingType")):n.getValue("lineSpacingType"),i[Te[o]]=t.isNullOrUndefined(n.baseStyle)?void 0:n.baseStyle.name,i[nt[o]]=r?1==o?this.getOutlineLevelEnumValue(n.outlineLevel):n.outlineLevel:1==o?this.getOutlineLevelEnumValue(n.getValue("outlineLevel")):n.getValue("outlineLevel"),i[Oe[o]]=r?e.getBoolInfo(n.bidi,o):n.getValue("bidi"),i[rt[o]]=r?e.getBoolInfo(n.keepLinesTogether,o):n.getValue("keepLinesTogether"),i[tt[o]]=r?e.getBoolInfo(n.keepWithNext,o):n.getValue("keepWithNext"),i[ot[o]]=r?e.getBoolInfo(n.contextualSpacing,o):n.getValue("contextualSpacing"),i[it[o]]=r?e.getBoolInfo(n.widowControl,o):n.getValue("widowControl")},e.writeCharacterFormat=function(i,r,n,o,a){o=t.isNullOrUndefined(o)?0:o,i[ue[o]]=a?e.getBoolInfo(n.bold,o):r?e.getBoolInfo(n.bold,o):n.getValue("bold"),i[fe[o]]=a?e.getBoolInfo(n.italic,o):r?e.getBoolInfo(n.italic,o):n.getValue("italic"),i[Fe[o]]=a?n.fontSize:r?this.toWriteInline(n,"fontSize"):n.getValue("fontSize"),i[Pe[o]]=a?n.fontFamily:r?this.toWriteInline(n,"fontFamily"):n.getValue("fontFamily"),i[ye[o]]=a?n.underline:r?1==o?e.getUnderlineEnumValue(n.underline):n.underline:1==o?e.getUnderlineEnumValue(n.getValue("underline")):n.getValue("underline"),i[ve[o]]=a?n.underlineColor:r?this.toWriteInline(n,"underlineColor"):n.getValue("underlineColor"),i[We[o]]=a?n.fontHintType:r?1==o?e.getFontHintTypeEnumValue(n.fontHintType):n.fontHintType:1==o?e.getFontHintTypeEnumValue(n.getValue("fontHintType")):n.getValue("fontHintType"),i[xe[o]]=a?n.strikethrough:r?1==o?e.getStrikeThroughEnumValue(n.strikethrough):n.strikethrough:1==o?e.getStrikeThroughEnumValue(n.getValue("strikethrough")):n.getValue("strikethrough"),i[be[o]]=a?n.baselineAlignment:r?1==o?e.getBaselineAlignmentEnumValue(n.baselineAlignment):n.baselineAlignment:1==o?e.getBaselineAlignmentEnumValue(n.getValue("baselineAlignment")):n.getValue("baselineAlignment"),i[we[o]]=a?n.highlightColor:r?1==o?e.getHighlightColorEnumValue(n.highlightColor):n.highlightColor:1==o?e.getHighlightColorEnumValue(n.getValue("highlightColor")):n.getValue("highlightColor"),i[Ce[o]]=a?n.fontColor:r?this.toWriteInline(n,"fontColor"):n.getValue("fontColor"),i[Te[o]]=t.isNullOrUndefined(n.baseCharStyle)?void 0:n.baseCharStyle.name,i[Oe[o]]=a?n.bidi:r?e.getBoolInfo(n.bidi,o):n.getValue("bidi"),i[Se[o]]=a?n.bdo:r?1==o?e.getBiDirectionalOverride(n.bdo):n.bdo:1==o?e.getBiDirectionalOverride(n.getValue("bdo")):n.getValue("bdo"),i[Ae[o]]=a?n.boldBidi:r?e.getBoolInfo(n.boldBidi,o):n.getValue("boldBidi"),i[Le[o]]=a?n.italicBidi:r?e.getBoolInfo(n.italicBidi,o):n.getValue("italicBidi"),i[Ie[o]]=a?n.fontSizeBidi:r?n.fontSizeBidi:n.getValue("fontSizeBidi"),i[ke[o]]=a?n.fontFamilyBidi:r?n.fontFamilyBidi:n.getValue("fontFamilyBidi"),i[Ue[o]]=a?n.allCaps:r?e.getBoolInfo(n.allCaps,o):n.getValue("allCaps"),i[pe[o]]=a?n.localeIdBidi:r?n.localeIdBidi:n.getValue("localeIdBidi"),i[me[o]]=a?n.ligature:r?n.ligature:n.getValue("ligature"),i[ce[o]]=a?n.localeIdBidi:r?n.localeIdAscii:n.getValue("localeIdAscii"),i[ge[o]]=a?n.localeIdFarEast:r?n.localeIdFarEast:n.getValue("localeIdFarEast"),i[Be[o]]=a?n.complexScript:r?e.getBoolInfo(n.complexScript,o):n.getValue("complexScript"),n.hasValue("hidden")&&(i[ts[o]]=a?n.hidden:r?e.getBoolInfo(n.hidden,o):n.getValue("hidden")),n.hasValue("specVanish")&&(i[is[o]]=a?n.specVanish:r?e.getBoolInfo(n.specVanish,o):n.getValue("specVanish")),i[He[o]]=a?n.fontFamilyAscii:r?this.toWriteInline(n,"fontFamilyAscii"):n.getValue("fontFamilyAscii"),i[qe[o]]=a?n.fontFamilyNonFarEast:r?this.toWriteInline(n,"fontFamilyNonFarEast"):n.getValue("fontFamilyNonFarEast"),i[Re[o]]=a?n.fontFamilyFarEast:r?this.toWriteInline(n,"fontFamilyFarEast"):n.getValue("fontFamilyFarEast"),i[Ve[o]]=a?n.characterSpacing:r?this.toWriteInline(n,"characterSpacing"):n.getValue("characterSpacing"),i[De[o]]=a?n.scaling:r?this.toWriteInline(n,"scaling"):n.getValue("scaling"),(n.hasValue("fontFamily")||a)&&(t.isNullOrUndefined(i[He[o]])&&(i[He[o]]=n.fontFamily),t.isNullOrUndefined(i[qe[o]])&&(i[qe[o]]=n.fontFamily))},e.isThemeFont=function(e){return"majorAscii"==e||"majorBidi"==e||"majorEastAsia"==e||"majorHAnsi"==e||"minorAscii"==e||"minorBidi"==e||"minorEastAsia"==e||"minorHAnsi"==e},e.toWriteInline=function(e,i){return!t.isNullOrUndefined(e.ownerBase)&&e.ownerBase instanceof nl?e.hasValue(i)?e[i]:e.getValue(i):e[i]},e.round=function(e,t){for(var i=e,r=0;r<t;r++)i*=10;i=Math.round(i);for(r=0;r<t;r++)i/=10;return i},e.reverseString=function(e){return t.isNullOrUndefined(e)||""===e||(e=e.split("").reverse().join("")),e},e.formatClippedString=function(e){var t="",i="";return this.startsWith(e,"data:image/svg+xml;base64,")?(t=".svg",i=e.replace("data:image/svg+xml;base64,","")):this.startsWith(e,"data:image/svg+xml;utf8,")?(t=".svg",i=e.replace("data:image/svg+xml;utf8,","")):this.startsWith(e,"data:image/bmp;base64,")?(t=".bmp",i=e.replace("data:image/bmp;base64,","")):this.startsWith(e,"data:image/x-emf;base64,")?(t=".emf",i=e.replace("data:image/x-emf;base64,","")):this.startsWith(e,"data:image/exif;base64,")?(t=".exif",i=e.replace("data:image/exif;base64,","")):this.startsWith(e,"data:image/gif;base64,")?(t=".gif",i=e.replace("data:image/gif;base64,","")):this.startsWith(e,"data:image/icon;base64,")?(t=".ico",i=e.replace("data:image/icon;base64,","")):this.startsWith(e,"data:image/jpeg;base64,")?(t=".jpeg",i=e.replace("data:image/jpeg;base64,","")):this.startsWith(e,"data:image/jpg;base64,")?(t=".jpg",i=e.replace("data:image/jpg;base64,","")):this.startsWith(e,"data:image/png;base64,")?(t=".png",i=e.replace("data:image/png;base64,","")):this.startsWith(e,"data:image/tiff;base64,")?(t=".tif",i=e.replace("data:image/tiff;base64,","")):this.startsWith(e,"data:image/x-wmf;base64,")?(t=".wmf",i=e.replace("data:image/x-wmf;base64,","")):t=".jpeg",{extension:t,formatClippedString:i}},e.startsWith=function(e,t){return t.length>0&&e.substring(0,t.length)===t},e.getUtcDate=function(e){return t.isNullOrUndefined(e)&&(e=new Date),new Date(e.getTime()-6e4*e.getTimezoneOffset()).toISOString()},e.splitSpaceInTextElementBox=function(t,i){var r=t.text,n="";if(i)for(;e.startsWith(r," ");)n+=" ",r=r.substring(1);else for(;e.endsWith(r);)n+=" ",r=r.slice(0,-1);if(""!=n){var o=new hl;o.characterFormat.copyFormat(t.characterFormat),o.line=t.line;var a=o.line.children;if(i?(t.text=n,o.text=r):(t.text=r,o.text=n),a.splice(a.indexOf(t)+1,0,o),t.revisionLength>0)for(var s=0;s<t.revisionLength;s++){var l=t.getRevision(s);o.addRevision(l)}}},e.getTextIndexAfterWhitespace=function(e,t){var i=e.length,r=0,n=r=e.indexOf(" ",t)+1;if(0===n||n===i)return n;for(;" "===e[n]&&++n!==i;);return n},e.splitWordByMaxLength=function(t,i,r){for(var n=t.text,o=0,a=n.length,s="",l=t.characterFormat,d=i.children.indexOf(t);o<a;){var h=o+90;h>a&&(h=a);var c=e.getTextIndexAfterWhitespace(n,h);if((0===c||c>a)&&(c=h),s=n.substring(o,c),0===o)t.text=s,t.isWidthUpdated=!1;else{var g=new hl;if(g.text=s,g.line=i,g.characterFormat.copyFormat(l),r?i.children.push(g):(i.children.splice(d+1,0,g),d++),t.revisionLength>0)for(var p=0;p<t.revisionLength;p++)g.addRevision(t.getRevision(p))}o=c}},e}(),xs=function(){function e(e,t){this.xIn=0,this.yIn=0,this.xIn=e,this.yIn=t}return Object.defineProperty(e.prototype,"x",{get:function(){return this.xIn},set:function(e){this.xIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.yIn},set:function(e){this.yIn=e},enumerable:!0,configurable:!0}),e.prototype.copy=function(e){this.xIn=e.xIn,this.yIn=e.yIn},e.prototype.destroy=function(){this.xIn=void 0,this.yIn=void 0},e}(),ws=function(){function e(e,t){this.x=0,this.width=0,this.x=e,this.width=t}return Object.defineProperty(e.prototype,"right",{get:function(){return this.x+this.width},enumerable:!0,configurable:!0}),e}(),Fs=function(){function e(e,t){this.leftIn=0,this.widthIn=0,this.color="",this.leftIn=e,this.widthIn=t}return Object.defineProperty(e.prototype,"left",{get:function(){return this.leftIn},set:function(e){this.leftIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.widthIn},set:function(e){this.widthIn=e},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.widthIn=void 0,this.leftIn=void 0,this.floatingItems=[],this.floatingItems=void 0},e}(),Cs=function(){function e(e,t){this.leftInternal=0,this.widthInternal=0,this.leftInternal=e,this.widthInternal=t}return Object.defineProperty(e.prototype,"left",{get:function(){return this.leftInternal},set:function(e){this.leftInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.widthInternal},set:function(e){this.widthInternal=e},enumerable:!0,configurable:!0}),e}(),Ps=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ts=function(){function e(){}return e}(),Os=function(e){function t(t){var i=e.call(this)||this;return i.ownerBase=t,i.paragraphFormat=new Ls(i),i.characterFormat=new S(i),i}return Ps(t,e),t.prototype.clear=function(){this.characterFormat&&this.characterFormat.clearFormat(),this.paragraphFormat&&this.paragraphFormat.clearFormat()},t.prototype.destroy=function(){this.characterFormat&&(this.characterFormat.destroy(),this.characterFormat=void 0),this.paragraphFormat&&(this.paragraphFormat.destroy(),this.paragraphFormat=void 0),this.ownerBase=void 0,this.name=void 0,this.next=void 0,this.basedOn=void 0,this.link=void 0},t.prototype.copyStyle=function(e){this.name=e.name,this.ownerBase=e.ownerBase,this.type=e.type,this.next=e.next,this.basedOn=e.basedOn,this.link=e.link,this.characterFormat.copyFormat(e.characterFormat),this.paragraphFormat.copyFormat(e.paragraphFormat)},t}(Ts),Ss=function(e){function t(t){var i=e.call(this)||this;return i.ownerBase=t,i.characterFormat=new S(i),i}return Ps(t,e),t.prototype.clear=function(){this.characterFormat&&this.characterFormat.clearFormat()},t.prototype.destroy=function(){this.characterFormat&&(this.characterFormat.destroy(),this.characterFormat=void 0),this.ownerBase=void 0,this.name=void 0,this.next=void 0,this.basedOn=void 0,this.link=void 0},t.prototype.copyStyle=function(e){this.name=e.name,this.ownerBase=e.ownerBase,this.type=e.type,this.next=e.next,this.basedOn=e.basedOn,this.characterFormat.copyFormat(e.characterFormat)},t}(Ts),Ns=function(e){function t(t){var i=e.call(this)||this;return i.ownerBase=t,i}return Ps(t,e),t.prototype.destroy=function(){this.ownerBase=void 0,this.name=void 0,this.next=void 0,this.basedOn=void 0,this.link=void 0},t}(Ts),Is=function(){function e(){this.collection=[]}return Object.defineProperty(e.prototype,"length",{get:function(){return this.collection.length},enumerable:!0,configurable:!0}),e.prototype.remove=function(e){this.collection=this.collection.filter(function(t){return t.name!==e.name})},e.prototype.push=function(e){return null!=e&&void 0!==e&&this.collection.push(e),1},e.prototype.getItem=function(e){return this.collection.length>e?this.collection[parseInt(e.toString(),10)]:null},e.prototype.indexOf=function(e){return this.collection.indexOf(e)},e.prototype.contains=function(e){var t=this.collection.indexOf(e);return t>-1&&t<this.collection.length},e.prototype.clear=function(){if(this.collection&&this.collection.length>0)for(var e=0;e<this.collection.length;e++){var t=this.collection[parseInt(e.toString(),10)];t instanceof Ss?t.clear():t instanceof Os&&t.clear()}this.collection=[]},e.prototype.findByName=function(e,i){for(var r,n=0,o=this.collection;n<o.length;n++){var a=o[n];a.name===e&&(r=a,t.isNullOrUndefined(i)||a.type!==i&&(r=void 0))}return r},e.prototype.getStyleNames=function(e){return this.collection.filter(function(t){return t.type===e}).map(function(e){return e.name})},e.prototype.getStyles=function(e){for(var i=[],r=0,n=this.collection.filter(function(t){return t.type===e}).map(function(e){return e});r<n.length;r++){var o=n[r],a={},s={};"Paragraph"===e&&(s.paragraphFormat={},bs.writeParagraphFormat(s.paragraphFormat,!0,o.paragraphFormat)),"Table"!==e&&(s.characterFormat={},bs.writeCharacterFormat(s.characterFormat,!0,o.characterFormat)),a.name=o.name,a.style=JSON.stringify(s),t.isNullOrUndefined(e)||(a.type=e,"Paragraph"!==a.type||t.isNullOrUndefined(o.link)||(a.type="Linked")),i.push(a)}return i},e.prototype.destroy=function(){if(this.collection&&this.collection.length>0)for(var e=0;e<this.collection.length;e++){var t=this.collection[parseInt(e.toString(),10)];t instanceof Ss?t.destroy():t instanceof Os?t.destroy():t instanceof Ns&&t.destroy()}this.collection=[],this.collection=void 0},e}(),ks=function(){function e(e){this.uniqueListFormat=void 0,this.ownerBase=void 0,this.baseStyle=void 0,this.list=void 0,this.ownerBase=e}return Object.defineProperty(e.prototype,"nsid",{get:function(){return this.getPropertyValue("nsid")},set:function(e){this.setPropertyValue("nsid",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"listId",{get:function(){return this.getPropertyValue("listId")},set:function(e){if(e>=0){if(!t.isNullOrUndefined(this.ownerBase)){var i=this.ownerBase.getDocumentHelperObject();t.isNullOrUndefined(i)||(this.list=i.getListById(e))}}else!t.isNullOrUndefined(this.list)&&e<0&&(this.list=void 0);this.setPropertyValue("listId",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"listLevelNumber",{get:function(){return this.getPropertyValue("listLevelNumber")},set:function(e){this.setPropertyValue("listLevelNumber",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"listLevel",{get:function(){var e=void 0;if(t.isNullOrUndefined(this.list))for(var i=this.baseStyle;!t.isNullOrUndefined(i)&&i instanceof Os;){if(i.paragraphFormat.listFormat.list){e=i.paragraphFormat.listFormat.list;break}i=i.basedOn}else e=this.list;return t.isNullOrUndefined(e)?void 0:e.getListLevel(this.listLevelNumber)},enumerable:!0,configurable:!0}),e.prototype.getPropertyValue=function(i){if(this.hasValue(i)){n=u.getPropertyType(e.uniqueFormatType,i);if(!t.isNullOrUndefined(this.uniqueListFormat)&&this.uniqueListFormat.propertiesHash.containsKey(n))return this.uniqueListFormat.propertiesHash.get(n)}else if(this.baseStyle instanceof Os){for(var r=this.baseStyle;!t.isNullOrUndefined(r)&&!r.paragraphFormat.listFormat.hasValue(i);)r=r.basedOn;if(!t.isNullOrUndefined(r)){var n=u.getPropertyType(e.uniqueFormatType,i);return r.paragraphFormat.listFormat.uniqueListFormat.propertiesHash.get(n)}}return e.getPropertyDefaultValue(i)},e.prototype.setPropertyValue=function(i,r){if((t.isNullOrUndefined(r)||""===r)&&(r=e.getPropertyDefaultValue(i)),t.isNullOrUndefined(this.uniqueListFormat))this.initializeUniqueListFormat(i,r);else{var n=u.getPropertyType(this.uniqueListFormat.uniqueFormatType,i);if(this.uniqueListFormat.propertiesHash.containsKey(n)&&this.uniqueListFormat.propertiesHash.get(n)===r)return;this.uniqueListFormat=e.uniqueListFormats.updateUniqueFormat(this.uniqueListFormat,i,r)}},e.prototype.initializeUniqueListFormat=function(t,i){var r=new p;this.addUniqueListFormat("listId",t,i,r),this.addUniqueListFormat("listLevelNumber",t,i,r),this.addUniqueListFormat("nsid",t,i,r),this.uniqueListFormat=e.uniqueListFormats.addUniqueFormat(r,e.uniqueFormatType)},e.prototype.addUniqueListFormat=function(t,i,r,n){var o=u.getPropertyType(e.uniqueFormatType,t);t===i&&n.add(o,r)},e.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"listId":t=-1;break;case"listLevelNumber":t=0;break;case"nsid":t=-1}return t},e.prototype.copyFormat=function(e){t.isNullOrUndefined(e)||(t.isNullOrUndefined(e.uniqueListFormat)&&(t.isNullOrUndefined(e.baseStyle)||t.isNullOrUndefined(e.baseStyle.paragraphFormat.listFormat)||t.isNullOrUndefined(e.baseStyle.paragraphFormat.listFormat.uniqueListFormat)||!t.isNullOrUndefined(e.list))||(this.listId=e.listId,this.listLevelNumber=e.listLevelNumber,this.nsid=e.nsid),t.isNullOrUndefined(e.baseStyle)||(this.baseStyle=e.baseStyle),t.isNullOrUndefined(e.list)||(this.list=e.list))},e.prototype.hasValue=function(e){if(!t.isNullOrUndefined(this.uniqueListFormat)){var i=u.getPropertyType(this.uniqueListFormat.uniqueFormatType,e);return this.uniqueListFormat.propertiesHash.containsKey(i)}return!1},e.prototype.clearFormat=function(){t.isNullOrUndefined(this.uniqueListFormat)||0!==this.uniqueListFormat.referenceCount||e.uniqueListFormats.remove(this.uniqueListFormat),this.uniqueListFormat=void 0,this.list=void 0},e.prototype.destroy=function(){t.isNullOrUndefined(this.uniqueListFormat)||e.uniqueListFormats.remove(this.uniqueListFormat),this.uniqueListFormat=void 0,this.list=void 0,this.ownerBase=void 0,this.baseStyle=void 0},e.clear=function(){this.uniqueListFormats.clear()},e.prototype.applyStyle=function(e){this.baseStyle=e},e.prototype.getValue=function(e){return this.hasValue(e)?this.getPropertyValue(e):void 0},e.prototype.cloneListFormat=function(){var t=new e(void 0);return t.list=this.list,t.listId=this.listId,t.nsid=this.nsid,t.baseStyle=this.baseStyle,t.listLevelNumber=this.listLevelNumber,t.uniqueListFormat=this.uniqueListFormat,t},e.uniqueListFormats=new f,e.uniqueFormatType=7,e}(),As=function(){function e(){}return Object.defineProperty(e.prototype,"position",{get:function(){return this.positionIn},set:function(e){this.positionIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"deletePosition",{get:function(){return this.deletePositionIn},set:function(e){this.deletePositionIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabJustification",{get:function(){return this.justification},set:function(e){this.justification=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabLeader",{get:function(){return this.leader},set:function(e){this.leader=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.deletePosition=this.deletePosition,t.position=this.position,t.tabJustification=this.tabJustification,t.tabLeader=this.tabLeader,t},e.prototype.equals=function(e){return this.position===e.position&&this.deletePosition===e.deletePosition&&this.tabJustification===e.tabJustification&&this.tabLeader===e.tabLeader},e.prototype.destroy=function(){this.position=void 0,this.deletePosition=void 0,this.tabJustification=void 0,this.leader=void 0},e}(),Ls=function(){function e(e){this.uniqueParagraphFormat=void 0,this.ownerBase=void 0,this.baseStyle=void 0,this.tabs=void 0,this.ownerBase=e,this.listFormat=new ks(this),this.borders=new Us(this),this.tabs=[]}return e.prototype.getUpdatedTabs=function(){for(var e=[],i=new p,r=0,n=this.getTabStopsFromListFormat();r<n.length;r++){c=n[r];i.containsKey(c.position)||i.add(c.position,c)}if(!t.isNullOrUndefined(this.baseStyle)&&this.baseStyle instanceof Os){for(var o=this.baseStyle;!t.isNullOrUndefined(o);){for(var a=0,s=o.paragraphFormat.tabs;a<s.length;a++){var l=s[a];i.containsKey(l.position)||i.add(l.position,l)}o=o.basedOn}var d=[];i.keys.forEach(function(e){d.push(i.get(e))});for(var h=0;h<d.length;h++){var c=d[h];this.isValidTabStop(d,c)||i.remove(c.position)}for(var g=0,u=i.keys;g<u.length;g++){var f=u[g];this.hasTabStop(parseFloat(f.toFixed(4)))||e.push(i.get(f))}}return e=e.concat(this.tabs.filter(function(e){return 0!==e.position&&0===e.deletePosition})),e=e.sort(function(e,t){return e.position-t.position})},e.prototype.getTabStopsFromListFormat=function(){if(this.listFormat.listId>-1&&this.listFormat.listLevelNumber>-1){var e=this.listFormat.listLevel;if(e&&e.paragraphFormat)return e.paragraphFormat.tabs}return[]},e.prototype.isValidTabStop=function(e,i){for(var r=0;r<e.length;r++)if(!t.isNullOrUndefined(e[r].position)&&!t.isNullOrUndefined(e[r].deletePosition)&&!t.isNullOrUndefined(i.position)&&i!=e[r]&&(parseFloat(e[r].position.toFixed(4))===parseFloat(i.position.toFixed(4))||0!==parseFloat(e[r].deletePosition.toFixed(4))&&parseFloat(e[r].deletePosition.toFixed(4))===parseFloat(i.position.toFixed(4))))return!1;return!0},e.prototype.hasTabStop=function(e){for(var i=0;i<this.tabs.length;i++)if(!(t.isNullOrUndefined(this.tabs[i].position)||t.isNullOrUndefined(this.tabs[i].deletePosition)||parseFloat(this.tabs[i].position.toFixed(4))!==e&&parseFloat(this.tabs[i].deletePosition.toFixed(4))!==e))return!0;return!1},Object.defineProperty(e.prototype,"leftIndent",{get:function(){return this.getPropertyValue("leftIndent")},set:function(e){this.setPropertyValue("leftIndent",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightIndent",{get:function(){return this.getPropertyValue("rightIndent")},set:function(e){this.setPropertyValue("rightIndent",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstLineIndent",{get:function(){return this.getPropertyValue("firstLineIndent")},set:function(e){this.setPropertyValue("firstLineIndent",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"beforeSpacing",{get:function(){return this.getPropertyValue("beforeSpacing")},set:function(e){this.setPropertyValue("beforeSpacing",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"afterSpacing",{get:function(){return this.getPropertyValue("afterSpacing")},set:function(e){this.setPropertyValue("afterSpacing",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spaceBeforeAuto",{get:function(){return this.getPropertyValue("spaceBeforeAuto")},set:function(e){this.setPropertyValue("spaceBeforeAuto",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spaceAfterAuto",{get:function(){return this.getPropertyValue("spaceAfterAuto")},set:function(e){this.setPropertyValue("spaceAfterAuto",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineSpacing",{get:function(){return this.getPropertyValue("lineSpacing")},set:function(e){this.setPropertyValue("lineSpacing",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineSpacingType",{get:function(){return this.getPropertyValue("lineSpacingType")},set:function(e){this.setPropertyValue("lineSpacingType",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textAlignment",{get:function(){var e=this.getPropertyValue("textAlignment");return this.bidi&&("Left"===e?e="Right":"Right"===e&&(e="Left")),e},set:function(e){this.setPropertyValue("textAlignment",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"keepWithNext",{get:function(){return this.getPropertyValue("keepWithNext")},set:function(e){this.setPropertyValue("keepWithNext",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"keepLinesTogether",{get:function(){return this.getPropertyValue("keepLinesTogether")},set:function(e){this.setPropertyValue("keepLinesTogether",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widowControl",{get:function(){return this.getPropertyValue("widowControl")},set:function(e){this.setPropertyValue("widowControl",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outlineLevel",{get:function(){return this.getPropertyValue("outlineLevel")},set:function(e){this.setPropertyValue("outlineLevel",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bidi",{get:function(){return this.getPropertyValue("bidi")},set:function(e){this.setPropertyValue("bidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contextualSpacing",{get:function(){return this.getPropertyValue("contextualSpacing")},set:function(e){this.setPropertyValue("contextualSpacing",e)},enumerable:!0,configurable:!0}),e.prototype.getListFormatParagraphFormat=function(i){var r=this.getListPargaraphFormat(i);if(!t.isNullOrUndefined(r))return r.uniqueParagraphFormat.propertiesHash.get(u.getPropertyType(e.uniqueFormatType,i))},e.prototype.getListPargaraphFormat=function(i){if(this.listFormat.hasValue("listId")&&this.listFormat.listId>-1&&this.listFormat.listLevelNumber>-1){var r=this.listFormat.listLevel,n=u.getPropertyType(e.uniqueFormatType,i);return t.isNullOrUndefined(r)||t.isNullOrUndefined(r.paragraphFormat.uniqueParagraphFormat)||!r.paragraphFormat.uniqueParagraphFormat.propertiesHash.containsKey(n)?void 0:r.paragraphFormat}if(this.listFormat.hasValue("listId")&&-1===this.listFormat.listId&&("leftIndent"===i||"firstLineIndent"===i)){var o=new e;return this.hasValue("leftIndent")||(o.leftIndent=0),this.hasValue("firstLineIndent")||(o.firstLineIndent=0),o}},e.prototype.getPropertyValue=function(i){if(this.hasValue(i)){d=u.getPropertyType(e.uniqueFormatType,i);if(!t.isNullOrUndefined(this.uniqueParagraphFormat)&&this.uniqueParagraphFormat.propertiesHash.containsKey(d))return this.uniqueParagraphFormat.propertiesHash.get(d)}else{var r=this.getListFormatParagraphFormat(i),n=this.listFormat.hasValue("listId")&&-1===this.listFormat.listId&&("leftIndent"===i||"firstLineIndent"===i);if(this.baseStyle instanceof Os&&!n){for(var o=this,a=this.baseStyle;!t.isNullOrUndefined(a);){var s=void 0;if(this.listFormat.hasValue("listId")||(s=a.paragraphFormat.getListPargaraphFormat(i)),a.paragraphFormat.hasValue(i)){o=a.paragraphFormat;break}if(!t.isNullOrUndefined(s)&&s.hasValue(i)){if(a.paragraphFormat.listFormat.listLevelNumber!==this.listFormat.listLevelNumber){var l=this.listFormat.listLevel,d=u.getPropertyType(e.uniqueFormatType,i);if(!t.isNullOrUndefined(l)&&!t.isNullOrUndefined(l.paragraphFormat.uniqueParagraphFormat)&&l.paragraphFormat.uniqueParagraphFormat.propertiesHash.containsKey(d)){o=l.paragraphFormat;break}}o=s;break}a=a.basedOn}if(!t.isNullOrUndefined(a)){if(!t.isNullOrUndefined(r)&&this.listFormat.hasValue("listId")&&-1===o.listFormat.listId&&o.listFormat.listLevelNumber<=1||!t.isNullOrUndefined(r)&&this.listFormat.listId!==o.listFormat.listId&&o.listFormat.listLevelNumber<=1)return r;d=u.getPropertyType(e.uniqueFormatType,i);return o.uniqueParagraphFormat.propertiesHash.get(d)}}if(!t.isNullOrUndefined(r))return r}return this.getDefaultValue(i)},e.prototype.getDefaultValue=function(i){var r=u.getPropertyType(e.uniqueFormatType,i),n=this.getDocumentParagraphFormat(),o=n.docParagraphFormat,a=n.editorFormat;if(t.isNullOrUndefined(o)||t.isNullOrUndefined(o.uniqueParagraphFormat))return!t.isNullOrUndefined(a)&&a.hasOwnProperty(i)?a[i]:e.getPropertyDefaultValue(i);var s=this.ownerBase,l=!1;if(s&&s instanceof Qs){var d=s.containerWidget;l=d instanceof Ks||d instanceof Ol||d instanceof il}if(l){var h=o.uniqueParagraphFormat.propertiesHash.get(r);if(!t.isNullOrUndefined(h))return h}return!t.isNullOrUndefined(a)&&a.hasOwnProperty(i)?a[i]:e.getPropertyDefaultValue(i)},e.prototype.getDocumentParagraphFormat=function(){var i,r=new e,n=!1;if(!t.isNullOrUndefined(this.ownerBase)){var o=this.getDocumentHelperObject();t.isNullOrUndefined(o)||(r=o.paragraphFormat,!t.isNullOrUndefined(o)&&o.isEditorModule&&(n=o.editorProperties.isPaste,i=o.editorParagraphFormat))}return{docParagraphFormat:r,editorFormat:i,isPaste:n}},e.prototype.getDocumentHelperObject=function(){var e;if(this.ownerBase instanceof Qs){var i=this.ownerBase.bodyWidget;t.isNullOrUndefined(i)||t.isNullOrUndefined(i.page)||t.isNullOrUndefined(i.page.documentHelper)||(e=i.page.documentHelper)}return e},e.prototype.setPropertyValue=function(i,r,n){if((t.isNullOrUndefined(r)||""===r&&!n)&&(r=e.getPropertyDefaultValue(i)),t.isNullOrUndefined(this.uniqueParagraphFormat)||t.isNullOrUndefined(this.uniqueParagraphFormat.propertiesHash)&&t.isNullOrUndefined(this.uniqueParagraphFormat.uniqueFormatType)&&t.isNullOrUndefined(this.uniqueParagraphFormat.referenceCount))this.initializeUniqueParagraphFormat(i,r);else{var o=u.getPropertyType(this.uniqueParagraphFormat.uniqueFormatType,i);if(this.uniqueParagraphFormat.propertiesHash.containsKey(o)&&this.uniqueParagraphFormat.propertiesHash.get(o)===r)return;this.uniqueParagraphFormat=e.uniqueParagraphFormats.updateUniqueFormat(this.uniqueParagraphFormat,i,r)}},e.prototype.initializeUniqueParagraphFormat=function(t,i){var r=new p;this.addUniqueParaFormat("leftIndent",t,i,r),this.addUniqueParaFormat("rightIndent",t,i,r),this.addUniqueParaFormat("firstLineIndent",t,i,r),this.addUniqueParaFormat("textAlignment",t,i,r),this.addUniqueParaFormat("beforeSpacing",t,i,r),this.addUniqueParaFormat("afterSpacing",t,i,r),this.addUniqueParaFormat("spaceBeforeAuto",t,i,r),this.addUniqueParaFormat("spaceAfterAuto",t,i,r),this.addUniqueParaFormat("lineSpacing",t,i,r),this.addUniqueParaFormat("lineSpacingType",t,i,r),this.addUniqueParaFormat("outlineLevel",t,i,r),this.addUniqueParaFormat("bidi",t,i,r),this.addUniqueParaFormat("contextualSpacing",t,i,r),this.addUniqueParaFormat("keepWithNext",t,i,r),this.addUniqueParaFormat("keepLinesTogether",t,i,r),this.addUniqueParaFormat("widowControl",t,i,r),this.uniqueParagraphFormat=e.uniqueParagraphFormats.addUniqueFormat(r,e.uniqueFormatType)},e.prototype.addUniqueParaFormat=function(t,i,r,n){var o=u.getPropertyType(e.uniqueFormatType,t);t===i&&n.add(o,r)},e.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"leftIndent":case"rightIndent":case"firstLineIndent":t=0;break;case"textAlignment":t="Left";break;case"beforeSpacing":case"afterSpacing":t=0;break;case"spaceBeforeAuto":case"spaceAfterAuto":t=!1;break;case"lineSpacing":t=1;break;case"lineSpacingType":t="Multiple";break;case"styleName":t="Normal";break;case"outlineLevel":t="BodyText";break;case"bidi":case"contextualSpacing":case"keepWithNext":case"keepLinesTogether":t=!1;break;case"widowControl":t=!0}return t},e.prototype.clearIndent=function(){this.clearPropertyValue("leftIndent"),this.clearPropertyValue("firstLineIndent")},e.prototype.clearPropertyValue=function(i){if(this.setPropertyValue(i,void 0,!0),!t.isNullOrUndefined(this.uniqueParagraphFormat)){var r=u.getPropertyType(this.uniqueParagraphFormat.uniqueFormatType,i),n=new u(this.uniqueParagraphFormat.uniqueFormatType),o=e.getPropertyDefaultValue(i);n.cloneItems(this.uniqueParagraphFormat,i,o,this.uniqueParagraphFormat.uniqueFormatType),n.propertiesHash.containsKey(r)&&n.propertiesHash.remove(r),this.uniqueParagraphFormat=n}},e.prototype.clearFormat=function(){t.isNullOrUndefined(this.listFormat)||this.listFormat.clearFormat(),t.isNullOrUndefined(this.borders)||this.borders.clearFormat(),t.isNullOrUndefined(this.uniqueParagraphFormat)||0!==this.uniqueParagraphFormat.referenceCount||e.uniqueParagraphFormats.remove(this.uniqueParagraphFormat),this.uniqueParagraphFormat=void 0,t.isNullOrUndefined(this.getDocumentHelperObject())||(this.baseStyle=this.getDocumentHelperObject().styles.findByName("Normal"))},e.prototype.destroy=function(){if(t.isNullOrUndefined(this.uniqueParagraphFormat)||e.uniqueParagraphFormats.remove(this.uniqueParagraphFormat),this.uniqueParagraphFormat=void 0,t.isNullOrUndefined(this.listFormat)||this.listFormat.destroy(),this.listFormat=void 0,this.tabs&&this.tabs.length>0){for(var i=0;i<this.tabs.length;i++)this.tabs[i].destroy();this.tabs=[],this.tabs=void 0}t.isNullOrUndefined(this.borders)||this.borders.destroy(),this.borders=void 0,this.baseStyle=void 0,this.ownerBase=void 0},e.prototype.copyFormat=function(e){if(!t.isNullOrUndefined(e)&&(t.isNullOrUndefined(e.uniqueParagraphFormat)||this.updateUniqueParagraphFormat(e),t.isNullOrUndefined(e.borders)||(t.isNullOrUndefined(this.borders)&&(this.borders=new Us(this)),this.borders.copyFormat(e.borders)),t.isNullOrUndefined(e.listFormat)||(t.isNullOrUndefined(this.listFormat)&&(this.listFormat=new ks(this)),this.listFormat.copyFormat(e.listFormat)),t.isNullOrUndefined(e.baseStyle)||(this.baseStyle=e.baseStyle),!t.isNullOrUndefined(e.tabs)))for(var i=0;i<e.tabs.length;i++)this.tabs[i]=e.tabs[i]},e.prototype.updateUniqueParagraphFormat=function(i){var r=void 0;this.uniqueParagraphFormat&&(r=this.uniqueParagraphFormat.mergeProperties(i.uniqueParagraphFormat),0===this.uniqueParagraphFormat.referenceCount&&(e.uniqueParagraphFormats.remove(this.uniqueParagraphFormat),this.uniqueParagraphFormat=void 0)),this.uniqueParagraphFormat=new u(e.uniqueFormatType),t.isNullOrUndefined(r)&&(r=this.uniqueParagraphFormat.mergeProperties(i.uniqueParagraphFormat)),this.uniqueParagraphFormat=e.uniqueParagraphFormats.addUniqueFormat(r,e.uniqueFormatType)},e.prototype.cloneFormat=function(){var i=new e(void 0);if(i.uniqueParagraphFormat=this.uniqueParagraphFormat,i.baseStyle=this.baseStyle,t.isNullOrUndefined(this.listFormat)?i.listFormat=void 0:(i.listFormat=this.listFormat.cloneListFormat(),i.listFormat.ownerBase=i),i.borders=t.isNullOrUndefined(this.borders)?void 0:this.borders.cloneFormat(),!t.isNullOrUndefined(this.tabs)&&this.tabs.length>0){i.tabs=[];for(var r=0;r<this.tabs.length;r++)i.tabs.push(this.tabs[r].clone())}return i},e.prototype.hasValue=function(e){if(!t.isNullOrUndefined(this.uniqueParagraphFormat)&&!t.isNullOrUndefined(this.uniqueParagraphFormat.propertiesHash)){var i=u.getPropertyType(this.uniqueParagraphFormat.uniqueFormatType,e);return this.uniqueParagraphFormat.propertiesHash.containsKey(i)}return!1},e.clear=function(){this.uniqueParagraphFormats.clear()},e.prototype.applyStyle=function(e){this.baseStyle=e,this.listFormat.applyStyle(this.baseStyle)},e.prototype.getValue=function(e){return this.hasValue(e)?this.getPropertyValue(e):void 0},e.prototype.assignFormat=function(e,i){i=!t.isNullOrUndefined(i)&&i,e.hasValue("leftIndent")&&(this.leftIndent=e.getValue("leftIndent")),e.hasValue("rightIndent")&&(this.rightIndent=e.getValue("rightIndent")),e.hasValue("firstLineIndent")&&(this.firstLineIndent=e.getValue("firstLineIndent")),e.hasValue("beforeSpacing")&&(this.beforeSpacing=e.getValue("beforeSpacing")),e.hasValue("afterSpacing")&&(this.afterSpacing=e.getValue("afterSpacing")),e.hasValue("spaceBeforeAuto")&&(this.spaceBeforeAuto=e.getValue("spaceBeforeAuto")),e.hasValue("spaceAfterAuto")&&(this.spaceAfterAuto=e.getValue("spaceAfterAuto")),e.hasValue("lineSpacing")&&(this.lineSpacing=e.getValue("lineSpacing")),e.hasValue("lineSpacingType")&&(this.lineSpacingType=e.getValue("lineSpacingType")),e.hasValue("textAlignment")&&(this.textAlignment=e.getValue("textAlignment")),e.hasValue("outlineLevel")&&(this.outlineLevel=e.getValue("outlineLevel")),!i&&e.hasValue("bidi")&&(this.bidi=e.getValue("bidi")),e.hasValue("contextualSpacing")&&(this.contextualSpacing=e.getValue("contextualSpacing")),e.hasValue("keepWithNext")&&(this.keepWithNext=e.getValue("keepWithNext")),e.hasValue("keepLinesTogether")&&(this.keepLinesTogether=e.getValue("keepLinesTogether")),e.hasValue("widowControl")&&(this.widowControl=e.getValue("widowControl"))},e.prototype.isSameFormat=function(e){return this.baseStyle===e.baseStyle&&this.uniqueParagraphFormat===e.uniqueParagraphFormat},e.uniqueParagraphFormats=new f,e.uniqueFormatType=3,e}(),Us=function(){function e(e){this.leftIn=new m(this),this.rightIn=new m(this),this.topIn=new m(this),this.bottomIn=new m(this),this.horizontalIn=new m(this),this.verticalIn=new m(this),this.diagonalUpIn=new m(this),this.diagonalDownIn=new m(this),this.isParsing=!1,this.ownerBase=e}return Object.defineProperty(e.prototype,"left",{get:function(){return this.ownerBase instanceof Ls?this.getPropertyValue("left"):this.leftIn},set:function(e){this.leftIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.ownerBase instanceof Ls?this.getPropertyValue("right"):this.rightIn},set:function(e){this.rightIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.ownerBase instanceof Ls?this.getPropertyValue("top"):this.topIn},set:function(e){this.topIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.ownerBase instanceof Ls?this.getPropertyValue("bottom"):this.bottomIn},set:function(e){this.bottomIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontal",{get:function(){return this.ownerBase instanceof Ls?this.getPropertyValue("horizontal"):this.horizontalIn},set:function(e){this.horizontalIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"vertical",{get:function(){return this.ownerBase instanceof Ls?this.getPropertyValue("vertical"):this.verticalIn},set:function(e){this.verticalIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"diagonalUp",{get:function(){return this.diagonalUpIn},set:function(e){this.diagonalUpIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"diagonalDown",{get:function(){return this.diagonalDownIn},set:function(e){this.diagonalDownIn=e},enumerable:!0,configurable:!0}),e.prototype.getPropertyValue=function(e){var i=this.getBorder(e);if(this.isParsing)return i;if(i.hasValues())return i;var r=this.ownerBase.baseStyle;if(!t.isNullOrUndefined(r)){for(var n=this;!t.isNullOrUndefined(r);){var o=void 0;if(this.ownerBase.listFormat.hasValue("listId")||(o=r.paragraphFormat.getListPargaraphFormat(e)),r.paragraphFormat.borders.getBorder(e).hasValues()){n=r.paragraphFormat.borders;break}if(!t.isNullOrUndefined(o)&&o.borders.getBorder(e).hasValues()){n=o.borders;break}r=r.basedOn}if(!t.isNullOrUndefined(r))return n.getBorder(e)}return this.getDefaultValue(e)},e.prototype.getDefaultValue=function(e){var i,r=this.documentParagraphFormat();return t.isNullOrUndefined(r)||t.isNullOrUndefined(r.borders)||(i=r.borders.getBorder(e)),i},e.prototype.documentParagraphFormat=function(){var e;return this.ownerBase instanceof Ls&&(e=this.ownerBase.getDocumentParagraphFormat().docParagraphFormat),e},e.prototype.getBorder=function(e){switch(e){case"left":return this.leftIn;case"right":return this.rightIn;case"top":return this.topIn;case"bottom":return this.bottomIn;case"vertical":return this.verticalIn;case"horizontal":return this.horizontalIn}},e.prototype.clearFormat=function(){t.isNullOrUndefined(this.leftIn)||this.leftIn.clearFormat(),t.isNullOrUndefined(this.topIn)||this.topIn.clearFormat(),t.isNullOrUndefined(this.bottomIn)||this.bottomIn.clearFormat(),t.isNullOrUndefined(this.rightIn)||this.rightIn.clearFormat(),t.isNullOrUndefined(this.horizontalIn)||this.horizontalIn.clearFormat(),t.isNullOrUndefined(this.verticalIn)||this.verticalIn.clearFormat(),t.isNullOrUndefined(this.diagonalDown)||this.diagonalDown.clearFormat(),t.isNullOrUndefined(this.diagonalUp)||this.diagonalUp.clearFormat()},e.prototype.destroy=function(){t.isNullOrUndefined(this.leftIn)||this.leftIn.destroy(),t.isNullOrUndefined(this.topIn)||this.topIn.destroy(),t.isNullOrUndefined(this.bottomIn)||this.bottomIn.destroy(),t.isNullOrUndefined(this.rightIn)||this.rightIn.destroy(),t.isNullOrUndefined(this.horizontalIn)||this.horizontalIn.destroy(),t.isNullOrUndefined(this.verticalIn)||this.verticalIn.destroy(),t.isNullOrUndefined(this.diagonalDown)||this.diagonalDown.destroy(),t.isNullOrUndefined(this.diagonalUp)||this.diagonalUp.destroy(),this.topIn=void 0,this.bottomIn=void 0,this.leftIn=void 0,this.rightIn=void 0,this.horizontalIn=void 0,this.verticalIn=void 0,this.diagonalDownIn=void 0,this.diagonalUpIn=void 0,this.ownerBase=void 0},e.prototype.cloneFormat=function(){var i=new e(void 0);return i.top=t.isNullOrUndefined(this.topIn)?void 0:this.topIn.cloneFormat(),i.bottom=t.isNullOrUndefined(this.bottomIn)?void 0:this.bottomIn.cloneFormat(),i.left=t.isNullOrUndefined(this.leftIn)?void 0:this.leftIn.cloneFormat(),i.right=t.isNullOrUndefined(this.rightIn)?void 0:this.rightIn.cloneFormat(),i.horizontal=t.isNullOrUndefined(this.horizontalIn)?void 0:this.horizontalIn.cloneFormat(),i.vertical=t.isNullOrUndefined(this.verticalIn)?void 0:this.verticalIn.cloneFormat(),i.diagonalUp=t.isNullOrUndefined(this.diagonalUp)?void 0:this.diagonalUp.cloneFormat(),i.diagonalDown=t.isNullOrUndefined(this.diagonalDown)?void 0:this.diagonalDown.cloneFormat(),i},e.prototype.copyFormat=function(e){if(!t.isNullOrUndefined(e.getBorder("left"))&&e.getBorder("left")instanceof m){var i=new m(this);i.copyFormat(e.getBorder("left")),this.left=i}if(!t.isNullOrUndefined(e.getBorder("right"))&&e.getBorder("right")instanceof m){var r=new m(this);r.copyFormat(e.getBorder("right")),this.right=r}if(!t.isNullOrUndefined(e.getBorder("top"))&&e.getBorder("top")instanceof m){var n=new m(this);n.copyFormat(e.getBorder("top")),this.top=n}if(!t.isNullOrUndefined(e.getBorder("bottom"))&&e.getBorder("bottom")instanceof m){var o=new m(this);o.copyFormat(e.getBorder("bottom")),this.bottom=o}if(!t.isNullOrUndefined(e.getBorder("horizontal"))&&e.getBorder("horizontal")instanceof m){var a=new m(this);a.copyFormat(e.getBorder("horizontal")),this.horizontal=a}if(!t.isNullOrUndefined(e.getBorder("vertical"))&&e.getBorder("vertical")instanceof m){var s=new m(this);s.copyFormat(e.getBorder("vertical")),this.vertical=s}!t.isNullOrUndefined(e.diagonalDown)&&e.diagonalDown instanceof m&&(this.diagonalDown=new m(this),this.diagonalDown.copyFormat(e.diagonalDown)),!t.isNullOrUndefined(e.diagonalUp)&&e.diagonalUp instanceof m&&(this.diagonalUp=new m(this),this.diagonalUp.copyFormat(e.diagonalUp))},e}(),Bs=function(){function e(e){this.uniqueTableFormat=void 0,this.borders=new Us(this),this.shading=new b(this),this._title=void 0,this._description=void 0,this.ownerBase=void 0,this._styleName=void 0,this.isRTFTable=!1,this.ownerBase=e,this.assignTableMarginValue(5.4,0,5.4,0)}return Object.defineProperty(e.prototype,"title",{get:function(){return this._title},set:function(e){this._title=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"description",{get:function(){return this._description},set:function(e){this._description=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowAutoFit",{get:function(){return this.getPropertyValue("allowAutoFit")},set:function(e){this.setPropertyValue("allowAutoFit",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cellSpacing",{get:function(){return this.getPropertyValue("cellSpacing")},set:function(e){if(e<0||e>264.6)throw new RangeError("The measurement must be between 0 px and 264.6 px.");this.setPropertyValue("cellSpacing",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftMargin",{get:function(){return this.getPropertyValue("leftMargin")},set:function(e){this.setPropertyValue("leftMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"topMargin",{get:function(){return this.getPropertyValue("topMargin")},set:function(e){this.setPropertyValue("topMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightMargin",{get:function(){return this.getPropertyValue("rightMargin")},set:function(e){this.setPropertyValue("rightMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottomMargin",{get:function(){return this.getPropertyValue("bottomMargin")},set:function(e){this.setPropertyValue("bottomMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tableAlignment",{get:function(){return this.getPropertyValue("tableAlignment")},set:function(e){this.setPropertyValue("tableAlignment",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftIndent",{get:function(){return this.getPropertyValue("leftIndent")},set:function(e){if(e<-1440||e>1440)throw new RangeError("The measurement must be between -1440 px and 1440 px.");this.setPropertyValue("leftIndent",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"preferredWidth",{get:function(){return this.getPropertyValue("preferredWidth")},set:function(e){this.setPropertyValue("preferredWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"preferredWidthType",{get:function(){return this.getPropertyValue("preferredWidthType")},set:function(e){this.setPropertyValue("preferredWidthType",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bidi",{get:function(){return this.getPropertyValue("bidi")},set:function(e){this.setPropertyValue("bidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontalPositionAbs",{get:function(){return this.getPropertyValue("horizontalPositionAbs")},set:function(e){this.setPropertyValue("horizontalPositionAbs",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontalPosition",{get:function(){return this.getPropertyValue("horizontalPosition")},set:function(e){this.setPropertyValue("horizontalPosition",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"styleName",{get:function(){return this._styleName},set:function(e){this._styleName=e},enumerable:!0,configurable:!0}),e.prototype.getPropertyValue=function(i){if(this.hasValue(i)){var r=u.getPropertyType(e.uniqueFormatType,i);if(!t.isNullOrUndefined(this.uniqueTableFormat)&&this.uniqueTableFormat.propertiesHash.containsKey(r))return this.uniqueTableFormat.propertiesHash.get(r)}return e.getPropertyDefaultValue(i)},e.prototype.setPropertyValue=function(i,r){if((t.isNullOrUndefined(r)||""===r)&&(r=e.getPropertyDefaultValue(i)),t.isNullOrUndefined(this.uniqueTableFormat))this.initializeUniqueTableFormat(i,r);else{var n=u.getPropertyType(this.uniqueTableFormat.uniqueFormatType,i);if(this.uniqueTableFormat.propertiesHash.containsKey(n)&&this.uniqueTableFormat.propertiesHash.get(n)===r)return;this.uniqueTableFormat=e.uniqueTableFormats.updateUniqueFormat(this.uniqueTableFormat,i,r)}},e.prototype.initializeUniqueTableFormat=function(t,i){var r=new p;this.addUniqueTableFormat("allowAutoFit",t,i,r),this.addUniqueTableFormat("cellSpacing",t,i,r),this.addUniqueTableFormat("leftMargin",t,i,r),this.addUniqueTableFormat("topMargin",t,i,r),this.addUniqueTableFormat("bottomMargin",t,i,r),this.addUniqueTableFormat("rightMargin",t,i,r),this.addUniqueTableFormat("leftIndent",t,i,r),this.addUniqueTableFormat("tableAlignment",t,i,r),this.addUniqueTableFormat("preferredWidth",t,i,r),this.addUniqueTableFormat("preferredWidthType",t,i,r),this.addUniqueTableFormat("bidi",t,i,r),this.addUniqueTableFormat("horizontalPositionAbs",t,i,r),this.addUniqueTableFormat("horizontalPosition",t,i,r),this.uniqueTableFormat=e.uniqueTableFormats.addUniqueFormat(r,e.uniqueFormatType)},e.prototype.addUniqueTableFormat=function(t,i,r,n){var o;o=u.getPropertyType(e.uniqueFormatType,t),t===i&&n.add(o,r)},e.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"allowAutoFit":t=!1;break;case"cellSpacing":t=0;break;case"leftMargin":t=5.4;break;case"topMargin":case"bottomMargin":t=0;break;case"rightMargin":t=5.4;break;case"leftIndent":t=0;break;case"tableAlignment":t="Left";break;case"preferredWidth":t=0;break;case"preferredWidthType":t="Point";break;case"bidi":t=!1;break;case"horizontalPositionAbs":t=null;break;case"horizontalPosition":t=0}return t},e.prototype.assignTableMarginValue=function(e,t,i,r){this.leftMargin=e,this.topMargin=t,this.rightMargin=i,this.bottomMargin=r},e.prototype.initializeTableBorders=function(){this.borders.left.lineStyle="Single",this.borders.left.lineWidth=.5,this.borders.right.lineStyle="Single",this.borders.right.lineWidth=.5,this.borders.top.lineStyle="Single",this.borders.top.lineWidth=.5,this.borders.bottom.lineStyle="Single",this.borders.bottom.lineWidth=.5,this.borders.horizontal.lineStyle="Single",this.borders.horizontal.lineWidth=.5,this.borders.vertical.lineStyle="Single",this.borders.vertical.lineWidth=.5},e.prototype.destroy=function(){t.isNullOrUndefined(this.borders)||this.borders.destroy(),t.isNullOrUndefined(this.shading)||this.shading.destroy(),t.isNullOrUndefined(this.uniqueTableFormat)||e.uniqueTableFormats.remove(this.uniqueTableFormat),this.uniqueTableFormat=void 0,this.ownerBase=void 0,this.borders=void 0,this.shading=void 0},e.prototype.cloneFormat=function(){var i=new e(void 0);return i.leftIndent=this.leftIndent,i.tableAlignment=this.tableAlignment,i.cellSpacing=this.cellSpacing,i.leftMargin=this.leftMargin,i.rightMargin=this.rightMargin,i.topMargin=this.topMargin,i.bottomMargin=this.bottomMargin,i.preferredWidth=this.preferredWidth,i.preferredWidthType=this.preferredWidthType,i.horizontalPositionAbs=this.horizontalPositionAbs,i.horizontalPosition=this.horizontalPosition,i.borders=t.isNullOrUndefined(this.borders)?void 0:this.borders.cloneFormat(),i.shading=t.isNullOrUndefined(this.shading)?void 0:this.shading.cloneFormat(),i.bidi=this.bidi,i.allowAutoFit=this.allowAutoFit,i.styleName=this.styleName,i.title=this.title,i.description=this.description,i},e.prototype.hasValue=function(e){if(!t.isNullOrUndefined(this.uniqueTableFormat)){var i=u.getPropertyType(this.uniqueTableFormat.uniqueFormatType,e);return this.uniqueTableFormat.propertiesHash.containsKey(i)}return!1},e.prototype.copyFormat=function(e){t.isNullOrUndefined(e)||(t.isNullOrUndefined(e.uniqueTableFormat)||(this.cellSpacing=e.cellSpacing,this.leftMargin=e.leftMargin,this.topMargin=e.topMargin,this.rightMargin=e.rightMargin,this.bottomMargin=e.bottomMargin,this.leftIndent=e.leftIndent,this.tableAlignment=e.tableAlignment,this.preferredWidth=e.preferredWidth,this.preferredWidthType=e.preferredWidthType,this.bidi=e.bidi,this.allowAutoFit=e.allowAutoFit,this.horizontalPosition=e.horizontalPosition,this.horizontalPositionAbs=e.horizontalPositionAbs,this.styleName=e.styleName),t.isNullOrUndefined(e.borders)||(this.borders=new Us(this),this.borders.copyFormat(e.borders)),t.isNullOrUndefined(e.shading)||(this.shading=new b(this),this.shading.copyFormat(e.shading)),t.isNullOrUndefined(e.title)||(this.title=e.title),t.isNullOrUndefined(e.description)||(this.description=e.description),this.isRTFTable=e.isRTFTable)},e.clear=function(){this.uniqueTableFormats.clear()},e.uniqueTableFormats=new f,e.uniqueFormatType=8,e}();!function(e){e[e.LeftToRight=0]="LeftToRight",e[e.RightToLeft=1]="RightToLeft",e[e.WordSplit=2]="WordSplit",e[e.Number=4]="Number",e[e.Tab=6]="Tab"}(e.CharacterRangeType||(e.CharacterRangeType={})),function(e){e[e.English=0]="English",e[e.Hindi=1]="Hindi",e[e.Korean=2]="Korean",e[e.Chinese=3]="Chinese",e[e.Arabic=4]="Arabic",e[e.Hebrew=5]="Hebrew",e[e.Japanese=6]="Japanese",e[e.Thai=7]="Thai",e[e.SpecialCharacter=8]="SpecialCharacter"}(e.FontScriptType||(e.FontScriptType={})),function(e){e[e.af_ZA=1078]="af_ZA",e[e.sq_AL=1052]="sq_AL",e[e.am_ET=1118]="am_ET",e[e.gsw_FR=1156]="gsw_FR",e[e.ar_DZ=5121]="ar_DZ",e[e.ar_BH=15361]="ar_BH",e[e.ar_EG=3073]="ar_EG",e[e.ar_IQ=2049]="ar_IQ",e[e.ar_JO=11265]="ar_JO",e[e.ar_KW=13313]="ar_KW",e[e.ar_LB=12289]="ar_LB",e[e.ar_LY=4097]="ar_LY",e[e.ar_MA=6145]="ar_MA",e[e.ar_OM=8193]="ar_OM",e[e.ar_QA=16385]="ar_QA",e[e.ar_SA=1025]="ar_SA",e[e.ar_SY=10241]="ar_SY",e[e.ar_TN=7169]="ar_TN",e[e.ar_AE=14337]="ar_AE",e[e.ar_YE=9217]="ar_YE",e[e.hy_AM=1067]="hy_AM",e[e.as_IN=1101]="as_IN",e[e.az_Cyrl_AZ=2092]="az_Cyrl_AZ",e[e.az_Latn_AZ=1068]="az_Latn_AZ",e[e.ba_RU=1133]="ba_RU",e[e.eu_ES=1069]="eu_ES",e[e.be_BY=1059]="be_BY",e[e.bn_BD=2117]="bn_BD",e[e.bn_IN=1093]="bn_IN",e[e.bs_Cyrl_BA=8218]="bs_Cyrl_BA",e[e.bs_Latn_BA=5146]="bs_Latn_BA",e[e.bg_BG=1026]="bg_BG",e[e.br_FR=1150]="br_FR",e[e.my_MM=1109]="my_MM",e[e.ca_ES=1027]="ca_ES",e[e.chr_US=1116]="chr_US",e[e.zh_HK=3076]="zh_HK",e[e.zh_MO=5124]="zh_MO",e[e.zh_CN=2052]="zh_CN",e[e.zh_SG=4100]="zh_SG",e[e.zh_TW=1028]="zh_TW",e[e.co_FR=1155]="co_FR",e[e.hr_BA=4122]="hr_BA",e[e.hr_HR=1050]="hr_HR",e[e.cs_CZ=1029]="cs_CZ",e[e.da_DK=1030]="da_DK",e[e.prs_AF=1164]="prs_AF",e[e.dv_MV=1125]="dv_MV",e[e.nl_BE=2067]="nl_BE",e[e.nl_NL=1043]="nl_NL",e[e.bin_NG=1126]="bin_NG",e[e.et_EE=1061]="et_EE",e[e.en_AU=3081]="en_AU",e[e.en_BZ=10249]="en_BZ",e[e.en_CA=4105]="en_CA",e[e.en_029=9225]="en_029",e[e.en_HK=15369]="en_HK",e[e.en_IN=16393]="en_IN",e[e.en_ID=14345]="en_ID",e[e.en_IE=6153]="en_IE",e[e.en_JM=8201]="en_JM",e[e.en_MY=17417]="en_MY",e[e.en_NZ=5129]="en_NZ",e[e.en_PH=13321]="en_PH",e[e.en_SG=18441]="en_SG",e[e.en_ZA=7177]="en_ZA",e[e.en_TT=11273]="en_TT",e[e.en_GB=2057]="en_GB",e[e.en_US=1033]="en_US",e[e.en_ZW=12297]="en_ZW",e[e.fo_FO=1080]="fo_FO",e[e.fil_PH=1124]="fil_PH",e[e.fi_FI=1035]="fi_FI",e[e.fr_BE=2060]="fr_BE",e[e.fr_CM=11276]="fr_CM",e[e.fr_CA=3084]="fr_CA",e[e.fr_CD=9228]="fr_CD",e[e.fr_CI=12300]="fr_CI",e[e.fr_FR=1036]="fr_FR",e[e.fr_HT=15372]="fr_HT",e[e.fr_LU=5132]="fr_LU",e[e.fr_ML=13324]="fr_ML",e[e.fr_MC=6156]="fr_MC",e[e.fr_MA=14348]="fr_MA",e[e.fr_RE=8204]="fr_RE",e[e.fr_SN=10252]="fr_SN",e[e.fr_CH=4108]="fr_CH",e[e.fy_NL=1122]="fy_NL",e[e.ff_NG=1127]="ff_NG",e[e.gd_GB=1084]="gd_GB",e[e.gl_ES=1110]="gl_ES",e[e.ka_GE=1079]="ka_GE",e[e.de_AT=3079]="de_AT",e[e.de_DE=1031]="de_DE",e[e.de_LI=5127]="de_LI",e[e.de_LU=4103]="de_LU",e[e.de_CH=2055]="de_CH",e[e.el_GR=1032]="el_GR",e[e.gn_PY=1140]="gn_PY",e[e.gu_IN=1095]="gu_IN",e[e.kl_GL=1135]="kl_GL",e[e.ha_Latn_NG=1128]="ha_Latn_NG",e[e.haw_US=1141]="haw_US",e[e.he_IL=1037]="he_IL",e[e.hi_IN=1081]="hi_IN",e[e.hu_HU=1038]="hu_HU",e[e.ibb_NG=1129]="ibb_NG",e[e.is_IS=1039]="is_IS",e[e.ig_NG=1136]="ig_NG",e[e.id_ID=1057]="id_ID",e[e.iu_Latn_CA=2141]="iu_Latn_CA",e[e.iu_Cans_CA=1117]="iu_Cans_CA",e[e.it_IT=1040]="it_IT",e[e.it_CH=2064]="it_CH",e[e.ga_IE=2108]="ga_IE",e[e.xh_ZA=1076]="xh_ZA",e[e.zu_ZA=1077]="zu_ZA",e[e.kn_IN=1099]="kn_IN",e[e.kr_NG=1137]="kr_NG",e[e.ks_Deva=2144]="ks_Deva",e[e.ks_Arab=1120]="ks_Arab",e[e.kk_KZ=1087]="kk_KZ",e[e.km_KH=1107]="km_KH",e[e.kok_IN=1111]="kok_IN",e[e.ko_KR=1042]="ko_KR",e[e.ky_KG=1088]="ky_KG",e[e.qut_GT=1158]="qut_GT",e[e.rw_RW=1159]="rw_RW",e[e.lo_LA=1108]="lo_LA",e[e.la_Latn=1142]="la_Latn",e[e.lv_LV=1062]="lv_LV",e[e.lt_LT=1063]="lt_LT",e[e.dsb_DE=2094]="dsb_DE",e[e.lb_LU=1134]="lb_LU",e[e.mk_MK=1071]="mk_MK",e[e.ms_BN=2110]="ms_BN",e[e.ms_MY=1086]="ms_MY",e[e.ml_IN=1100]="ml_IN",e[e.mt_MT=1082]="mt_MT",e[e.mni_IN=1112]="mni_IN",e[e.mi_NZ=1153]="mi_NZ",e[e.mr_IN=1102]="mr_IN",e[e.arn_CL=1146]="arn_CL",e[e.mn_MN=1104]="mn_MN",e[e.mn_Mong_CN=2128]="mn_Mong_CN",e[e.ne_NP=1121]="ne_NP",e[e.ne_IN=2145]="ne_IN",e[e.nb_NO=1044]="nb_NO",e[e.nn_NO=2068]="nn_NO",e[e.oc_FR=1154]="oc_FR",e[e.or_IN=1096]="or_IN",e[e.om_Ethi_ET=1138]="om_Ethi_ET",e[e.pap_AN=1145]="pap_AN",e[e.ps_AF=1123]="ps_AF",e[e.fa_IR=1065]="fa_IR",e[e.pl_PL=1045]="pl_PL",e[e.pt_BR=1046]="pt_BR",e[e.pt_PT=2070]="pt_PT",e[e.pa_IN=1094]="pa_IN",e[e.pa_PK=2118]="pa_PK",e[e.quz_BO=1131]="quz_BO",e[e.guz_EC=2155]="guz_EC",e[e.guz_PE=3179]="guz_PE",e[e.ro_RO=1048]="ro_RO",e[e.ro_MO=2072]="ro_MO",e[e.rm_CH=1047]="rm_CH",e[e.ru_RU=1049]="ru_RU",e[e.ru_MO=2073]="ru_MO",e[e.smn_FI=9275]="smn_FI",e[e.smj_NO=4155]="smj_NO",e[e.smj_SE=5179]="smj_SE",e[e.se_FI=3131]="se_FI",e[e.se_NO=1083]="se_NO",e[e.se_SE=2107]="se_SE",e[e.sms_FI=8251]="sms_FI",e[e.sma_NO=6203]="sma_NO",e[e.sma_SE=7227]="sma_SE",e[e.sa_IN=1103]="sa_IN",e[e.sr_Cyrl_BA=7194]="sr_Cyrl_BA",e[e.sr_Cyrl_CS=3098]="sr_Cyrl_CS",e[e.sr_Latn_BA=6170]="sr_Latn_BA",e[e.sr_Latn_CS=2074]="sr_Latn_CS",e[e.nso_ZA=1132]="nso_ZA",e[e.tn_ZA=1074]="tn_ZA",e[e.sd_Arab_PK=2137]="sd_Arab_PK",e[e.sd_Deva_IN=1113]="sd_Deva_IN",e[e.si_LK=1115]="si_LK",e[e.sk_SK=1051]="sk_SK",e[e.sl_SI=1060]="sl_SI",e[e.so_SO=1143]="so_SO",e[e.es_AR=11274]="es_AR",e[e.es_BO=16394]="es_BO",e[e.es_CL=13322]="es_CL",e[e.es_CO=9226]="es_CO",e[e.es_CR=5130]="es_CR",e[e.es_DO=7178]="es_DO",e[e.es_EC=12298]="es_EC",e[e.es_SV=17418]="es_SV",e[e.es_GT=4106]="es_GT",e[e.es_HN=18442]="es_HN",e[e.es_MX=2058]="es_MX",e[e.es_NI=19466]="es_NI",e[e.es_PA=6154]="es_PA",e[e.es_PY=15370]="es_PY",e[e.es_PE=10250]="es_PE",e[e.es_PR=20490]="es_PR",e[e.es_ES=3082]="es_ES",e[e.es_ES_tradnl=1034]="es_ES_tradnl",e[e.es_US=21514]="es_US",e[e.es_UY=14346]="es_UY",e[e.es_VE=8202]="es_VE",e[e.st_ZA=1072]="st_ZA",e[e.sw_KE=1089]="sw_KE",e[e.sv_FI=2077]="sv_FI",e[e.sv_SE=1053]="sv_SE",e[e.syr_SY=1114]="syr_SY",e[e.tg_Cyrl_TJ=1064]="tg_Cyrl_TJ",e[e.tzm_Arab_MA=1119]="tzm_Arab_MA",e[e.tzm_Latn_DZ=2143]="tzm_Latn_DZ",e[e.ta_IN=1097]="ta_IN",e[e.tt_RU=1092]="tt_RU",e[e.te_IN=1098]="te_IN",e[e.th_TH=1054]="th_TH",e[e.bo_CN=1105]="bo_CN",e[e.ti_ER=2163]="ti_ER",e[e.ti_ET=1139]="ti_ET",e[e.ts_ZA=1073]="ts_ZA",e[e.tr_TR=1055]="tr_TR",e[e.tk_TM=1090]="tk_TM",e[e.ug_CN=1152]="ug_CN",e[e.uk_UA=1058]="uk_UA",e[e.hsb_DE=1070]="hsb_DE",e[e.ur_PK=1056]="ur_PK",e[e.uz_Cyrl_UZ=2115]="uz_Cyrl_UZ",e[e.uz_Latn_UZ=1091]="uz_Latn_UZ",e[e.ve_ZA=1075]="ve_ZA",e[e.vi_VN=1066]="vi_VN",e[e.cy_GB=1106]="cy_GB",e[e.wo_SN=1160]="wo_SN",e[e.sah_RU=1157]="sah_RU",e[e.ii_CN=1144]="ii_CN",e[e.yi_Hebr=1085]="yi_Hebr",e[e.yo_NG=1130]="yo_NG",e[e.ja_JP=1041]="ja_JP"}(e.LocaleId||(e.LocaleId={})),function(e){e.EvenPage="EvenPage",e.NewPage="NewPage",e.Continuous="NoBreak",e.OddPage="OddPage"}(e.SectionBreakType||(e.SectionBreakType={}));var Hs={Tab:"\t",Paragraph:"\n",LineBreak:"\v",PageBreak:"\f",ColumnBreak:"",Image:"",Table:"",Row:"",Cell:"",Marker_Start:"",Marker_End:"",Field_Separator:"",Section_Break:""},Rs=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),qs=function(){function e(e){this.visiblePages=[],this.padding=new _s(10,10,30,10),this.textWrap=!0,this.containerTop=0,this.containerWidth=0,this.containerLeft=0,this.isWebPrinting=!1,this.documentHelper=e,this.columnLayoutArea=new Vs(this)}return e.prototype.updateClientArea=function(e,i,r){var n;t.isNullOrUndefined(e)||(n=e.sectionFormat,this.columnLayoutArea.setColumns(n));var o=0,a=0;if(this instanceof Ms){(o=(this.documentHelper.visibleBounds.width-4*this.padding.right-2*this.padding.left)/this.documentHelper.zoomFactor)<0&&(o=0),a=Number.POSITIVE_INFINITY,this.clientArea=new zs(this.padding.left/this.documentHelper.zoomFactor,0,o,a),this.clientActiveArea=new zs(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height)}else{var s=0,l=48,d=48,h=bs.convertPointToPixel(n.pageHeight),c=bs.convertPointToPixel(n.bottomMargin);t.isNullOrUndefined(n)||(s=bs.convertPointToPixel(n.topMargin),l=bs.convertPointToPixel(n.headerDistance),d=bs.convertPointToPixel(n.footerDistance));var g=!1;t.isNullOrUndefined(i.headerWidget)||(g=i.headerWidget.isEmpty,s>=0?(!g||g&&this.documentHelper.editorProperties.enableHeaderAndFooter)&&(s="Word2013"===this.documentHelper.compatibilityMode?Math.max(l+i.headerWidget.height,s):Math.min(Math.max(l+i.headerWidget.height,s),h/100*40)):s=Math.abs(s));var p=.667+c;if(!t.isNullOrUndefined(i.footerWidget)){g=i.footerWidget.isEmpty;var u=t.isNullOrUndefined(i.footnoteWidget)?0:i.footnoteWidget.height;u=Math.min(u,(h-s-p)/100*90),p>=0?(!g||g&&this.documentHelper.editorProperties.enableHeaderAndFooter)&&(p=.667+Math.min(h/100*40,Math.max(d+i.footerWidget.height,c))):p=Math.abs(p),p+=u}t.isNullOrUndefined(n)||(o=bs.convertPointToPixel(n.pageWidth-n.leftMargin-n.rightMargin),a=h-s-p),o<0&&(o=0);var f=new zs(bs.convertPointToPixel(n.leftMargin),s,o,h-s-p);if(i.footnoteWidget&&r&&!this.documentHelper.editorProperties.isFootNote&&0!==i.footnoteWidget.y&&this.clientArea.y+this.clientArea.height>i.footnoteWidget.y){var m=this.clientArea.y+this.clientArea.height-i.footnoteWidget.y;this.clientArea.height-=m/2}0!==e.page.bodyWidgets[0].columnIndex&&this.documentHelper.layout.updateColumnIndex(e,!1,!0),this.setClientArea(e,f),this.clientActiveArea=new zs(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height)}},e.prototype.setClientArea=function(e,t){this.clientArea=this.columnLayoutArea.getColumnBoundsByBodyWidget(e,t),e.x=this.clientArea.x,e.width=this.clientArea.width},e.prototype.updateClientAreaTopOrLeft=function(e,t){t&&(this.clientActiveArea.y=this.clientActiveArea.y+e.topBorderWidth,this.clientActiveArea.x=this.clientActiveArea.x+e.leftBorderWidth)},e.prototype.updateClientAreaForTable=function(e){this.clientActiveArea.x=this.clientArea.x=e.x,this.clientActiveArea.width=this.clientArea.width=e.width},e.prototype.updateClientAreaForRow=function(e,t){var i=e.ownerTable;t||(this.clientActiveArea.x=this.clientArea.x=i.x,this.clientActiveArea.width=this.clientArea.width=i.width,this.clientArea=new zs(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height),this.clientActiveArea=new zs(this.clientActiveArea.x,this.clientActiveArea.y,this.clientActiveArea.width,this.clientActiveArea.height))},e.prototype.updateClientAreaForCell=function(e,t){var i=e.ownerRow,r=e;if(t)this.clientActiveArea.x=this.clientArea.x=r.x,this.clientActiveArea.y=r.y,this.clientActiveArea.width=this.clientArea.width=r.width>0?r.width:0,this instanceof Es&&(this.clientActiveArea.height=Number.POSITIVE_INFINITY),this.clientArea=new zs(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height),this.clientActiveArea=new zs(this.clientActiveArea.x,this.clientActiveArea.y,this.clientActiveArea.width,this.clientActiveArea.height);else{if(this.clientActiveArea.x=this.clientArea.x=r.x+r.width+r.margin.right,i.x+i.width-this.clientArea.x<0?this.clientActiveArea.width=this.clientArea.width=0:this.clientActiveArea.width=this.clientArea.width=i.x+i.width-this.clientArea.x,this.clientActiveArea.y=r.y-r.margin.top-bs.convertPointToPixel(e.ownerTable.tableFormat.cellSpacing),!e.ownerTable.isInsideTable&&(this.clientActiveArea.height=this.clientArea.bottom-i.y>0?this.clientArea.bottom-i.y:0,!e.ownerTable.wrapTextAround&&this.documentHelper.layout.existFootnoteHeight>0)){var n=this.clientActiveArea.height-this.documentHelper.layout.existFootnoteHeight;this.clientActiveArea.height=n<0?0:n}this.clientArea=new zs(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height),this.clientActiveArea=new zs(this.clientActiveArea.x,this.clientActiveArea.y,this.clientActiveArea.width,this.clientActiveArea.height)}},e.prototype.updateClientAreaForTextBoxShape=function(e,i,r){if("Inline"===e.textWrappingStyle&&!r&&t.isNullOrUndefined(e.containerShape)&&(e.y=this.clientActiveArea.y,e.x=this.clientActiveArea.x),i){var n=e.textFrame.marginLeft,o=e.textFrame.marginRight,a=e.textFrame.marginTop,s=e.textFrame.marginBottom,l=e.width,d=Number.POSITIVE_INFINITY;this.clientArea=new zs(e.x+n,e.y+a,l-n-o,d-a-s),this.clientActiveArea=new zs(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height)}},e.prototype.updateClientAreaByWidgetFootNote=function(e){this.clientArea.x=e.x,this.clientArea.y=e.y,this.clientActiveArea.x=e.x,this.clientActiveArea.y=e.y},e.prototype.updateClientAreaForTextWrap=function(e){this.clientActiveArea=new zs(e.x,e.y,e.width,e.height)},e.prototype.updateBoundsBasedOnTextWrap=function(e){var t=e-this.clientActiveArea.y;this.clientActiveArea.y=e,this.clientActiveArea.height=this.clientActiveArea.height-t},e.prototype.updateBoundsBasedOnTextWrapTable=function(e){if(e>this.clientArea.bottom)return void(this.clientActiveArea=new zs(this.clientArea.x,e,this.clientArea.width,this.clientArea.bottom-e));var t=e-this.clientArea.y;this.clientArea.y=e,this.clientArea.height=this.clientArea.height-t,this.clientActiveArea=new zs(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height)},e.prototype.updateClientAreaByWidget=function(e){this.clientArea.x=e.x,this.clientArea.y=e.y,this.clientActiveArea.x=e.x,this.clientActiveArea.y=e.y},e.prototype.updateClientAreaLocation=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width},e.prototype.updateClientAreaForBlock=function(e,i,r,n,o){var a=bs.convertPointToPixel(e.leftIndent),s=bs.convertPointToPixel(e.rightIndent),l=e.bidi,d=0;if(i)if(e instanceof el&&r){var h=r[0];e.bodyWidget.sectionFormat.columns.length<=1&&(this.clientActiveArea.x=this.clientArea.x=h.x,this.clientActiveArea.width=this.clientArea.width=h.width,o&&this.documentHelper.getFirstParagraphInFirstCell(e)&&this.updateTableXPositionBasedOnTextWrap(e)),(h=r[r.length-1]).x=this.clientActiveArea.x,h.y=this.clientActiveArea.y}else{if(e instanceof el&&!t.isNullOrUndefined(e.tableFormat)&&(e.isGridUpdated||(e.buildTableColumns(),e.isGridUpdated=!0),"Left"!==(g=this.tableAlignmentForBidi(e,l))&&!t.isNullOrUndefined(this.documentHelper)&&this.documentHelper.isEditorModule&&!this.documentHelper.editorProperties.isAutofitToWindow)){var c=0;c=0===(c=bs.convertPointToPixel(e.tableHolder.getTotalWidth(0)))?0===e.tableHolder.tableWidth?e.getTableClientWidth(e.getOwnerWidth(!1)):e.tableHolder.tableWidth:c,"Center"===g?(this.documentHelper.isRowOrCellResizing||(c=e.getTableCellWidth()),this.documentHelper.viewer instanceof Es&&(a=(this.clientArea.width-c)/2)):a=this.clientArea.width-c,l&&(s=a-=bs.convertPointToPixel(e.leftIndent)),e.isInsideTable,this.documentHelper.tableLefts.push(a)}d=this.clientArea.width-(a+bs.convertPointToPixel(e.rightIndent));p=this.clientArea.x+(l?s:a);d=d>0||e instanceof Qs&&e.paragraphFormat.firstLineIndent<0?d:0,this.clientActiveArea.x=this.clientArea.x=p,this.clientActiveArea.width=this.clientArea.width=d,n&&this.updateParagraphYPositionBasedonTextWrap(e,new zs(this.clientActiveArea.x,this.clientActiveArea.y,this.clientActiveArea.width,this.clientActiveArea.height)),o&&(e instanceof Qs?this.updateParagraphXPositionBasedOnTextWrap(e):this.updateTableXPositionBasedOnTextWrap(e))}else{if(e instanceof el&&!t.isNullOrUndefined(e.tableFormat)){var g=this.tableAlignmentForBidi(e,l);e.isGridUpdated||(e.buildTableColumns(),e.isGridUpdated=!0),"Left"!==g&&this.documentHelper.tableLefts.length>0&&(a=this.documentHelper.tableLefts.pop(),l&&(s=a))}d=this.clientArea.width+a+bs.convertPointToPixel(e.rightIndent);var p=this.clientArea.x-(l?s:a);d=d>0||e instanceof Qs&&e.paragraphFormat.firstLineIndent<0?d:0,this.clientActiveArea.x=this.clientArea.x=p,this.clientActiveArea.width=this.clientArea.width=d}this.clientArea=new zs(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height),this.clientActiveArea=new zs(this.clientActiveArea.x,this.clientActiveArea.y,this.clientActiveArea.width,this.clientActiveArea.height)},e.prototype.updateParagraphYPositionBasedonTextWrap=function(e,i){var r=e.bodyWidget,n=this.clientActiveArea;if(r&&r.floatingElements.length>0&&e instanceof Qs&&!(e.containerWidget instanceof Ol)&&!e.isInsideTable&&!(e.containerWidget instanceof Zs)){var o="Word2013"===this.documentHelper.compatibilityMode,a=e,s=a.isEmpty(),l=a.height;if(0===l&&(l=this.documentHelper.textHelper.getParagraphMarkSize(a.characterFormat).Height),!a.isInHeaderFooter||a.isInsideTable||o)for(var d=i.y,h=!1,c=a.previousRenderedWidget,g=0;g<r.floatingElements.length;g++){var p=r.floatingElements[g],u=!1;if(u=p instanceof Cl?p.paragraph.isInHeaderFooter:p.bodyWidget instanceof Xs,!(a.isInsideTable&&p instanceof el)||p.isInsideTable){var f=this.getTextWrappingBound(p),m=p instanceof el?"Square":p.textWrappingStyle,y=p instanceof el?"Both":p.textWrappingType;if(!(n.x>f.right+24||n.right<f.x-24))if((i.y+(p instanceof el&&!s&&0===a.floatingElements.length?l:a.height)>f.y||h)&&i.y<f.bottom&&"Inline"!==m&&"TopAndBottom"!==m&&"InFrontOfText"!==m&&"Behind"!==m){var v=0,W=bs.convertPointToPixel(a.paragraphFormat.rightIndent),b=bs.convertPointToPixel(a.paragraphFormat.firstLineIndent);if(b=!s&&a.childWidgets[0].isFirstLine()&&b>0?b:0,i.x>=f.x&&"Left"!==y&&(v=W),v=v<0?v:0,p&&p instanceof el&&p.wrapTextAround&&!s&&!a.isContainsShapeAlone()&&o&&i.y<f.bottom&&(i.y=f.bottom),i.x<f.x&&i.x>f.x&&"Left"!==y)i.right>f.x&&(i.width=i.width-(i.right-f.right)),i.width<24?(!o&&p instanceof el&&c===p||(this.updateBoundsBasedOnTextWrap(f.bottom),i=this.clientActiveArea),((!s&&a.childWidgets[0].isFirstLine()||s)&&o||!u)&&(a.y=this.clientActiveArea.y)):i.x=f.right;else if(i.x>=f.x&&i.x<f.right)if(i.width=i.width-(f.right-i.x)-v,i.width<24||h){i.width=this.clientActiveArea.right-f.right-v;var x=!1;if(i.width<24||h){if(this.clientActiveArea.x+24<f.x){var w=this.getIntersectingItemBounds(r.floatingElements,p,d);!t.isNullOrUndefined(w)&&w.bottom<=f.bottom&&(this.updateBoundsBasedOnTextWrap(w.bottom),i=this.clientActiveArea,x=!0,a.x=w.x)}o&&!x&&(p instanceof el&&c===p?this.updateBoundsBasedOnTextWrapTable(f.bottom):this.updateBoundsBasedOnTextWrap(f.bottom),i=this.clientActiveArea),((!s&&a.childWidgets[0].isFirstLine()||s)&&o||!u)&&(a.y=this.clientActiveArea.y)}else i.x=f.right}else i.x=f.right;else f.x>i.x&&i.right>f.x&&(i.width=f.x-i.x,i.width<24&&(i.width=this.clientActiveArea.right-f.right-v,i.width<24?(!o&&p instanceof el&&c===p||(this.updateBoundsBasedOnTextWrap(f.bottom),i=this.clientActiveArea),((!s&&a.childWidgets[0].isFirstLine()||s)&&o||!u)&&(a.y=this.clientActiveArea.y)):i.x=f.right))}else if(r.floatingElements.length>0&&(i.y>=f.y&&i.y<f.bottom||i.y+l>=f.y&&i.y+l<f.bottom)&&"TopAndBottom"===m){if(o||!(p instanceof el&&c===p)){var F=this.documentHelper.textHelper.getParagraphMarkWidth(a.characterFormat);if("Word2007"===this.documentHelper.compatibilityMode&&s&&!a.bidi&&!t.isNullOrUndefined(a.paragraphFormat)&&"Left"!==a.paragraphFormat.textAlignment&&"Center"!==a.paragraphFormat.textAlignment&&this.clientActiveArea.x+F<f.x)continue;this.updateBoundsBasedOnTextWrap(f.bottom),!o&&(!s&&a.childWidgets[0].isFirstLine()||s)&&(h=!0)}((!s&&a.childWidgets[0].isFirstLine()||s)&&o||!u)&&(a.y=this.clientActiveArea.y)}}}}},e.prototype.updateParagraphXPositionBasedOnTextWrap=function(e){var i="Word2013"===this.documentHelper.compatibilityMode,r=e.containerWidget,n=this.clientActiveArea;if(this instanceof Es&&!t.isNullOrUndefined(r)&&e instanceof Qs&&!t.isNullOrUndefined(r.page)&&!t.isNullOrUndefined(r.page.headerWidget)){var o=r.page.headerWidget.floatingElements;if(o.length>0&&(!e.isInHeaderFooter||e.isInsideTable||i)&&!(e.containerWidget instanceof Zs)&&!(e.bodyWidget instanceof Ol))for(var a=e,s=0;s<o.length;s++){var l=o[s];if(!(a.isInsideTable&&l instanceof el)||l.isInsideTable){var d=this.getTextWrappingBound(l),h=l instanceof el?"Square":l.textWrappingStyle;l instanceof el||l.textWrappingType;if(!a.isInsideTable&&!(n.x>d.right+24||n.right<d.x-24)&&o.length>0&&n.y+a.height>d.y&&n.y<d.bottom&&"Inline"!==h&&"TopAndBottom"!==h&&"InFrontOfText"!==h&&"Behind"!==h){var c=bs.convertPointToPixel(a.paragraphFormat.rightIndent);if("Left"!=a.paragraphFormat.textAlignment&&n.x<d.x&&n.x+a.width>d.x)a.x=n.x;else if(n.x>=d.x&&n.x<d.right&&!a.paragraphFormat.bidi)if(n.width=n.width-(d.right-n.x)-c,n.width<24)if(n.width=this.clientActiveArea.right-d.right-c,n.width<24){var g=d.bottom>n.y?d.bottom-n.y:0,p=n.height-g;a.x=n.x,n.width=this.clientArea.width,n.height=p<0?0:p,n.y=d.bottom}else n.x=d.right;else("Word2007"===this.documentHelper.compatibilityMode||n.y<=d.bottom)&&bs.convertPointToPixel(a.paragraphFormat.leftIndent)+bs.convertPointToPixel(a.paragraphFormat.firstLineIndent)+n.x<d.right&&(n.x=d.right);else(d.x-24>n.x&&n.right>d.x||n.x>d.x&&n.x>d.right)&&(a.x=n.x)}}}}},e.prototype.updateTableXPositionBasedOnTextWrap=function(e){var i=bs.convertPointToPixel(e.childWidgets[0].getFirstRowWidth()),r=e.bodyWidget;if(this instanceof Es&&!t.isNullOrUndefined(r)&&!t.isNullOrUndefined(r.page)&&!t.isNullOrUndefined(r.page.headerWidget)){var n=r.page.headerWidget.floatingElements;if(!(!(n.length>0)||e.isInHeaderFooter&&e.isInsideTable&&"Word2013"!==this.documentHelper.compatibilityMode||e.containerWidget instanceof Ol))for(var o=this.clientActiveArea,a=0;a<n.length;a++){var s=n[a],l=this.getTextWrappingBound(s),d=s instanceof el?"Square":s.textWrappingStyle,h=s instanceof el?s.positioning.allowOverlap:s.allowOverlap,c=this.documentHelper.getFirstParagraphInFirstCell(e),g=this.documentHelper.textHelper.getParagraphMarkSize(c.characterFormat).Height,p=e.childWidgets[0]instanceof tl?e.childWidgets[0].height:0;p>g&&(g=p);var u=bs.convertPointToPixel(e.getTableClientWidth(e.getContainerWidth()));if(!(this.clientArea.x>l.right+24||this.clientArea.right<l.x-24)&&this.isFloatingItemIntersect(e,o,l,d,h,g,u)&&o.x>=l.x&&o.x<l.right)if(o.width=o.width-(l.right-o.x),o.width<24||o.width<i&&i>0)if(o.width=this.clientActiveArea.right-l.right,o.width<24||o.width<i&&i>0&&this.clientArea.right<=i+l.right){var f=l.bottom>o.y?l.bottom-o.y:0;o.y=l.bottom,o.width=this.clientArea.width,o.height=o.height-f,this.updateClientAreaForTextWrap(o)}else o.x=l.right,this.updateClientAreaForTextWrap(o);else o.x=l.right,this.updateClientAreaForTextWrap(o)}}},e.prototype.isFloatingItemIntersect=function(e,t,i,r,n,o,a){return(Math.round(t.y+o)>=Math.round(i.y)&&Math.round(t.y)<Math.round(i.bottom)||Math.round(t.y+o)<=Math.round(i.bottom)&&Math.round(t.y+o)>=Math.round(i.y))&&"Inline"!==r&&"TopAndBottom"!==r&&"InFrontOfText"!==r&&"Behind"!==r&&!(n&&null!==e.tableFormat&&e.wrapTextAround&&e.positioning.allowOverlap)},e.prototype.getIntersectingItemBounds=function(e,i,r){var n=this.getMinBottomFloatingItem(e,this.getIntersectingFloatingItems(e,i,r));if(!t.isNullOrUndefined(n))return this.getTextWrappingBound(n)},e.prototype.getMinBottomFloatingItem=function(e,t){var i=-1,r=Number.MAX_VALUE,n=0;e.sort(function(e,t){return e.x-t.x});for(var o=0;o<t.length;o++){var a=e[o],s=this.getTextWrappingBound(a);r>s.bottom&&(a&&t.indexOf(a)+1<t.length?n++:(r=s.bottom,i=t.indexOf(a)))}return i-n==0?t[i]:null},e.prototype.getIntersectingFloatingItems=function(e,t,i){for(var r=[],n=0;n<e.length;n++){var o=e[n],a=this.getTextWrappingBound(o),s=this.getTextWrappingBound(t);i<=a.bottom&&s.bottom>=a.bottom&&a.right>this.clientActiveArea.x&&a.x<s.x&&r.push(o)}return r},e.prototype.getTextWrappingBound=function(e){var t=0,i=0,r=0,n=0,o=0;return e instanceof Cl?(t=e.distanceLeft,i=e.distanceTop,r=e.distanceRight,n=e.distanceBottom,o=e.width):(o=e.getTableCellWidth(),t=e.positioning.distanceLeft,i=e.positioning.distanceTop,r=e.positioning.distanceRight,n=e.positioning.distanceBottom),new zs(e.x-t,e.y-i,o+t+r,e.height+i+n)},e.prototype.tableAlignmentForBidi=function(e,t){var i=e.tableFormat.tableAlignment;return t&&("Left"===i?i="Right":"Right"===i&&(i="Left")),i},e.prototype.cutFromLeft=function(e){e<this.clientActiveArea.x&&(e=this.clientActiveArea.x),e>this.clientActiveArea.right&&this.textWrap&&(e=this.clientActiveArea.right),this.clientActiveArea.width=this.clientActiveArea.right>e?this.clientActiveArea.right-e:0,this.clientActiveArea.x=e},e.prototype.cutFromTop=function(e){e<this.clientActiveArea.y&&(e=this.clientActiveArea.y),e>this.clientActiveArea.bottom&&(e=this.clientActiveArea.bottom),this.clientActiveArea.height=this.clientActiveArea.bottom-e,this.clientActiveArea.x=this.clientArea.x,this.clientActiveArea.width=this.clientArea.width,this.clientActiveArea.y=e},e.prototype.updateClientWidth=function(e){this.clientActiveArea.x-=e,this.clientActiveArea.width+e>0?this.clientActiveArea.width+=e:this.clientActiveArea.width=0},e.prototype.destroy=function(){this.clientArea=void 0,this.clientActiveArea=void 0},e.prototype.componentDestroy=function(){this.clientArea=void 0,this.clientActiveArea=void 0},e}(),Es=function(e){function i(t){var i=e.call(this,t)||this;return i.pageLeft=30,i.owner=t,i}return Rs(i,e),Object.defineProperty(i.prototype,"pageGap",{get:function(){return 20},enumerable:!0,configurable:!0}),i.prototype.createNewPage=function(e,i){var r=this,n=this.pageGap;this.documentHelper.pages.length>0&&(n=this.documentHelper.pages[this.documentHelper.pages.length-1].boundingRectangle.bottom+this.pageGap);var o=new Ql(this.documentHelper);return this.updatePageBoundingRectangle(e,o,n),t.isNullOrUndefined(i)?this.documentHelper.pages.push(o):this.documentHelper.pages.splice(i,0,o),o.bodyWidgets.push(e),o.bodyWidgets[o.bodyWidgets.length-1].page=o,this.updateClientArea(e,o),this.documentHelper.layout.layoutHeaderFooter(e,r,o),this.updateClientArea(e,o),this.documentHelper.layout.footnoteHeight=0,o},i.prototype.updatePageBoundingRectangle=function(e,i,r){var n=t.isNullOrUndefined(e.sectionFormat)?816:bs.convertPointToPixel(e.sectionFormat.pageWidth),o=t.isNullOrUndefined(e.sectionFormat)?1056:bs.convertPointToPixel(e.sectionFormat.pageHeight),a=(this.documentHelper.visibleBounds.width-n*this.documentHelper.zoomFactor)/2;a<this.pageLeft&&(a=this.pageLeft),i.boundingRectangle=new zs(a,r,n,o)},i.prototype.getCurrentPageHeaderFooter=function(e,t){return this.getCurrentHeaderFooter(this.getHeaderFooterType(e,t),e.index)},i.prototype.isFirstPageOfSection=function(e,i){var r=e.previousPage,n=e.bodyWidgets[0].sectionIndex;if(r.bodyWidgets[r.bodyWidgets.length-1].sectionIndex!==n)return!0;if(!i)return!1;var o=this.documentHelper.headersFooters[n];return!(t.isNullOrUndefined(o)||t.isNullOrUndefined(o[this.getHeaderFooter("FirstPageHeader")])&&t.isNullOrUndefined(o[this.getHeaderFooter("FirstPageFooter")]))&&!t.isNullOrUndefined(r.headerWidget)&&"FirstPageHeader"===r.headerWidget.headerFooterType&&r.bodyWidgets[0].sectionIndex!==n},i.prototype.getHeaderFooterType=function(e,i){var r;r=i?"OddHeader":"OddFooter";var n=e.page;return e.sectionFormat.differentFirstPage&&(t.isNullOrUndefined(n.previousPage)||!t.isNullOrUndefined(n.previousPage)&&n.sectionIndex!==n.previousPage.sectionIndex&&this.isFirstPageOfSection(n,i))?r=i?"FirstPageHeader":"FirstPageFooter":e.sectionFormat.differentOddAndEvenPages&&(n.index+1)%2==0&&(r=i?"EvenHeader":"EvenFooter"),r},i.prototype.getCurrentHeaderFooter=function(e,t){if(this.documentHelper.headersFooters[t]){var i=this.getHeaderFooter(e),r=this.documentHelper.headersFooters[t][i];if(!r){for(var n=t>0?t-1:t;!r&&-1!==n;)r=this.documentHelper.headersFooters[n][i],n--;r||((r=this.createHeaderFooterWidget(e)).isEmpty=!0),0==t&&(this.documentHelper.headersFooters[t][i]=r)}return r}if(t>0)return this.getCurrentHeaderFooter(e,t-1)},i.prototype.createHeaderFooterWidget=function(e){var t=new Xs(e),i=new Qs;i.childWidgets.push(new rl(i));var r;return r=-1!==e.indexOf("Header")?this.documentHelper.styles.findByName("Header"):this.documentHelper.styles.findByName("Footer"),i.paragraphFormat.baseStyle=r,i.paragraphFormat.listFormat.baseStyle=r,t.childWidgets.push(i),i.containerWidget=t,t},i.prototype.getHeaderFooter=function(e){switch(e){case"OddHeader":return 0;case"OddFooter":return 1;case"EvenHeader":return 2;case"EvenFooter":return 3;case"FirstPageHeader":return 4;case"FirstPageFooter":return 5}},i.prototype.updateHFClientArea=function(e,t){var i=bs.convertPointToPixel(e.pageWidth-e.leftMargin-e.rightMargin);i<0&&(i=0),this.clientArea=t?new zs(bs.convertPointToPixel(e.leftMargin),bs.convertPointToPixel(e.headerDistance),i,Number.POSITIVE_INFINITY):new zs(bs.convertPointToPixel(e.leftMargin),bs.convertPointToPixel(e.pageHeight-e.footerDistance),i,Number.POSITIVE_INFINITY),this.clientActiveArea=new zs(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height)},i.prototype.updateHeaderFooterClientAreaWithTop=function(e,t,i){this.updateHFClientArea(e,t),t||i.footerWidget.y<this.clientActiveArea.y&&(this.clientActiveArea.y=i.footerWidget.y,this.clientActiveArea.height=Number.POSITIVE_INFINITY)},i.prototype.updateFootnoteClientArea=function(e,t,i,r){var n=bs.convertPointToPixel(e.pageWidth-e.leftMargin-e.rightMargin),o=bs.convertPointToPixel(e.leftMargin),a=bs.convertPointToPixel(e.bottomMargin),s=bs.convertPointToPixel(e.footerDistance),l=bs.convertPointToPixel(e.pageHeight)-Math.max(s+t.page.footerWidget.height,a);this.clientArea=new zs(o,l,n,Number.POSITIVE_INFINITY),this.clientActiveArea=new zs(this.clientArea.x,this.clientArea.y,this.clientArea.width,Number.POSITIVE_INFINITY)},i}(qs),Ms=function(e){function t(t){return e.call(this,t)||this}return Rs(t,e),Object.defineProperty(t.prototype,"pageGap",{get:function(){return 0},enumerable:!0,configurable:!0}),t.prototype.createNewPage=function(e,t){var i,r=0;return this.documentHelper.pages.length>0&&(r=this.documentHelper.pages[this.documentHelper.pages.length-1].boundingRectangle.bottom),i=new Ql(this.documentHelper),0===this.documentHelper.pages.length?i.boundingRectangle=new zs(10,r,this.documentHelper.visibleBounds.width,this.documentHelper.visibleBounds.height):i.boundingRectangle=new zs(10,r-20,this.documentHelper.visibleBounds.width,this.documentHelper.visibleBounds.height),this.documentHelper.pages.push(i),this.updateClientArea(void 0,i),i.bodyWidgets.push(e),i.bodyWidgets[i.bodyWidgets.length-1].page=i,i},t}(qs),Vs=function(){function e(e){this.layoutHelperIn=e,this.clear()}return Object.defineProperty(e.prototype,"currentIndex",{get:function(){return this.currentIndexIn},set:function(e){e>=0&&(this.currentIndexIn=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnCount",{get:function(){var e;return t.isNullOrUndefined(this.columnIn)||(e=this.numberOfColumnsIn),e=e>0?e:1},enumerable:!0,configurable:!0}),e.prototype.setColumns=function(e){if(this.pageWidth=bs.convertPointToPixel(e.pageWidth-e.leftMargin-e.rightMargin),this.numberOfColumnsIn=e.numberOfColumns,!t.isNullOrUndefined(e.columns)){for(var i=e.columns,r=[],n=0;n<e.numberOfColumns;n++){var o=this.defaultSpaceIn,a=0;!t.isNullOrUndefined(i)&&i.length>0&&(o=i[n].space,a=i[n].width);var s=this.getColumnObj(a,o,e.numberOfColumns,e.equalWidth);s.index=n,r.push(s)}this.columnIn=r}},e.prototype.clear=function(){this.currentIndexIn=0,this.defaultSpaceIn=36,this.columnIn=null,this.pageWidth=0},e.prototype.reset=function(){this.currentIndex=0},e.prototype.getColumnBounds=function(e,t){var i=this.currentIndexIn;return this.getColumnBoundsByIndex(i,t)},e.prototype.getColumnBoundsByBodyWidget=function(e,t){var i=e.columnIndex;return this.getColumnBoundsByIndex(i,t)},e.prototype.getNextColumnByBodyWidget=function(e){var t=e.columnIndex;return this.getColumnByIndex(t+1)},e.prototype.getColumnByIndex=function(e){if(e>=0&&e<this.columnCount&&!t.isNullOrUndefined(this.columnIn)&&this.columnIn.length>0)return this.columnIn[e]},e.prototype.getColumnObj=function(e,i,r,n){var o=(r-1)*i,a=new v;return!n&&0!==e||t.isNullOrUndefined(this.pageWidth)||(e=(this.pageWidth-o)/r),a.width=e,a.space=i,a},e.prototype.getColumnBoundsByIndex=function(e,i){var r=new zs(i.x,i.y,i.width,i.height);if(e>=0&&this.columnIn.length>0){var n=void 0,o=void 0;if(!t.isNullOrUndefined(this.columnIn[e])){n=this.getColumnByIndex(e),r.width=n.width;for(var a=0;a<e;a++)o=this.columnIn[a],r.x+=o.width,r.x+=o.space}}return r},e}(),Ds=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),zs=function(){function e(e,t,i,r){this.x=e,this.y=t,this.width=i,this.height=r}return Object.defineProperty(e.prototype,"right",{get:function(){return this.x+this.width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!0,configurable:!0}),e.prototype.isIntersecting=function(e){return!(e.y>this.bottom||this.y>e.bottom||e.x>this.right||this.x>e.right)},e.prototype.isTableIntersecting=function(e){return!(!(e.y+e.height>this.y&&e.y<this.bottom)||e.x>this.right||this.x>e.right)},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e}(),_s=function(){function e(e,t,i,r){this.right=10,this.left=10,this.top=10,this.bottom=10,this.right=e,this.left=t,this.top=i,this.bottom=r}return e}(),js=function(){function e(e,t,i,r){this.left=e,this.top=t,this.right=i,this.bottom=r}return e.prototype.clone=function(){return new e(this.left,this.top,this.right,this.bottom)},e.prototype.destroy=function(){this.left=void 0,this.right=void 0,this.top=void 0,this.bottom=void 0},e}(),Gs=function(){function e(){this.childWidgets=[],this.x=0,this.y=0,this.width=0,this.height=0,this.index=0}return Object.defineProperty(e.prototype,"indexInOwner",{get:function(){return this instanceof Ys&&this.page?this.containerWidget instanceof Zs?this.containerWidget.bodyWidgets.indexOf(this):this.page.bodyWidgets.indexOf(this):this.containerWidget&&this.containerWidget.childWidgets?this.containerWidget.childWidgets.indexOf(this):this instanceof Zs?0:-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstChild",{get:function(){if(this.childWidgets)return this.childWidgets.length>0?this.childWidgets[0]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){if(this.childWidgets)return this.childWidgets.length>0?this.childWidgets[this.childWidgets.length-1]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousWidget",{get:function(){var e=this,t=this.indexInOwner;return e=e instanceof Ys?t>0?e.page.bodyWidgets[t-1]:void 0:t>0?e.containerWidget.childWidgets[t-1]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextWidget",{get:function(){var e=this,t=this.indexInOwner;if(-1!==t)return e=e instanceof Ys?t<e.page.bodyWidgets.length-1?e.page.bodyWidgets[t+1]:void 0:t<e.containerWidget.childWidgets.length-1?e.containerWidget.childWidgets[t+1]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousRenderedWidget",{get:function(){var e=this,i=this.indexInOwner;if(!(i<0)){if(e instanceof Ys)if(i>0&&!(e.containerWidget instanceof Zs))e=e.page.bodyWidgets[i-1];else if(e.containerWidget instanceof Zs&&!e.page.documentHelper.editorProperties.isDeleteOrBackSpace){var r=0===i;e=!("Endnote"===e.containerWidget.footNoteType)||!r||t.isNullOrUndefined(e.page.previousPage)||t.isNullOrUndefined(e.page.previousPage.endnoteWidget)||t.isNullOrUndefined(e.page.previousPage.endnoteWidget.bodyWidgets[e.page.previousPage.endnoteWidget.bodyWidgets.length-1])?i<=0?void 0:e.containerWidget.bodyWidgets[i-1]:e.page.previousPage.endnoteWidget.bodyWidgets[e.page.previousPage.endnoteWidget.bodyWidgets.length-1]}else e=(n=e.page.previousPage)&&n.bodyWidgets.length>0?n.bodyWidgets[n.bodyWidgets.length-1]:void 0;else if(e instanceof Zs)for(var n=e.page;n.previousPage&&(n=n.previousPage,e=n.footnoteWidget,t.isNullOrUndefined(e)););else if(i>0)e=e.containerWidget.childWidgets[i-1];else{var o=void 0;for(e.containerWidget instanceof il?o=e.containerWidget.getPreviousSplitWidget():e.containerWidget&&e.containerWidget.containerWidget instanceof Zs&&"Endnote"===e.containerWidget.containerWidget.footNoteType?o=e.containerWidget.previousWidget?e.containerWidget.previousWidget:e.containerWidget.previousRenderedWidget:e.containerWidget instanceof tl||e.containerWidget instanceof Xs||e.containerWidget&&e.containerWidget.containerWidget instanceof Zs||(o=e.containerWidget.previousRenderedWidget);o&&0===o.childWidgets.length&&(o=o.previousRenderedWidget,!t.isNullOrUndefined(o)););e=o&&o.constructor===e.containerWidget.constructor?o.lastChild:void 0}return e}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextRenderedWidget",{get:function(){var e=this,i=this.indexInOwner;if(!(i<0)){if(e instanceof Ys)if(i<e.page.bodyWidgets.length-1&&!(e.containerWidget instanceof Zs))e=e.page.bodyWidgets[i+1];else if(e.containerWidget instanceof Zs){var r="Endnote"===e.containerWidget.footNoteType,n=i===e.containerWidget.bodyWidgets.length-1;e=!r||!n||t.isNullOrUndefined(e.page.nextPage)||t.isNullOrUndefined(e.page.nextPage.endnoteWidget)||t.isNullOrUndefined(e.page.nextPage.endnoteWidget.bodyWidgets[0])?i>=e.containerWidget.bodyWidgets.length-1&&!e.page.documentHelper.editorProperties.isDeleteOrBackSpace?void 0:e.containerWidget.bodyWidgets[i+1]:e.page.nextPage.endnoteWidget.bodyWidgets[0]}else e=e.page.allowNextPageRendering&&(o=e.page.nextPage)&&o.bodyWidgets.length>0?o.bodyWidgets[0]:void 0;else if(e instanceof Zs)for(var o=e.page;o.allowNextPageRendering&&o.nextPage&&(o=o.nextPage,e=o.footnoteWidget,t.isNullOrUndefined(e)););else if(i<e.containerWidget.childWidgets.length-1)e=e.containerWidget.childWidgets[i+1];else{var a=void 0;for(e.containerWidget instanceof il?a=e.containerWidget.getNextSplitWidget():e.containerWidget&&e.containerWidget.containerWidget instanceof Zs&&"Endnote"===e.containerWidget.containerWidget.footNoteType?a=e.containerWidget.nextWidget?e.containerWidget.nextWidget:e.containerWidget.nextRenderedWidget:e.containerWidget instanceof tl||e.containerWidget instanceof Xs||e.containerWidget&&e.containerWidget.containerWidget instanceof Zs||(a=e.containerWidget.nextRenderedWidget);a&&0===a.childWidgets.length&&!(a instanceof il)&&(a=a.nextRenderedWidget,!t.isNullOrUndefined(a)););e=a&&a.constructor===e.containerWidget.constructor?a.firstChild:void 0}return e}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousSplitWidget",{get:function(){var e=this;if(e instanceof il)return e.getPreviousSplitWidget();var t=e.previousRenderedWidget;if(e instanceof Ys&&t instanceof Ys&&e.equals(t)){if(e.containerWidget instanceof Zs&&"Endnote"===e.containerWidget.footNoteType&&e.index!==t.index)return;return t}return t instanceof Js&&e.index===t.index&&e.equals(t)?t:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextSplitWidget",{get:function(){var e=this;if(e instanceof il)return e.getNextSplitWidget();var t=e.nextRenderedWidget;if(e instanceof Ys&&t instanceof Ys&&e.equals(t)){if(e.containerWidget instanceof Zs&&"Endnote"===e.containerWidget.footNoteType&&e.index!==t.index)return;return t}return t instanceof Js&&e.index===t.index&&e.equals(t)?t:void 0},enumerable:!0,configurable:!0}),e.prototype.getPreviousSplitWidgets=function(){for(var e=[],t=this.previousSplitWidget;t&&(e.unshift(t),!(t=t.previousSplitWidget)||t!=t.previousSplitWidget););return e},e.prototype.getSplitWidgets=function(){for(var e=this.getPreviousSplitWidgets(),t=this;t;)e.push(t),t=t.nextSplitWidget;return e},e.prototype.combineWidget=function(e){var t=this,i=this.getSplitWidgets();if(i.length>1)for(t=i.shift();i.length>0;){var r=i.shift();t.combine(r,e)}return t instanceof el&&t.combineRows(e),t},e.prototype.combine=function(t,i){if(t.childWidgets.length>0){var r=this.lastChild;if(r instanceof el)r.combineWidget(i);else{var n=t.firstChild;!(t instanceof el)&&r instanceof e&&n instanceof e&&r.index===n.index&&r.combine(t.childWidgets.shift(),i)}this.addWidgets(t.childWidgets),t.childWidgets=[]}t.destroyInternal(i)},e.prototype.addWidgets=function(t){for(;t.length>0;){var i=t.shift();if(i instanceof rl&&this instanceof Qs)i.paragraph=this,this.height+=i.height;else if(i instanceof e){var r=this.lastChild;i.containerWidget=this,i.y=r instanceof e?r.y+r.height:this.y,this.height+=i.height}if(i instanceof tl)for(var n=this.childWidgets[this.childWidgets.length-1],o=0;o<n.childWidgets.length;o++){var a=n.childWidgets[o];if(a.cellFormat.rowSpan>1)for(var s=0;s<i.childWidgets.length;s++){var l=i.childWidgets[s];if(l.columnIndex===a.columnIndex&&l.isSplittedCell&&l.cellFormat.rowSpan===a.cellFormat.rowSpan){for(var d=0;d<l.childWidgets.length;d++){var h=l.childWidgets[d];l.childWidgets.splice(h.indexInOwner,1),a.childWidgets.push(h),h.containerWidget=a,d--}l.ownerRow.childWidgets.splice(l.indexInOwner,1),l.containerWidget=void 0,s--}}}this.childWidgets.push(i)}},e.prototype.removeChild=function(e){e>-1&&e<this.childWidgets.length&&this.childWidgets.splice(e,1)},e.prototype.destroy=function(){if(this.childWidgets)for(;this.childWidgets.length>0;){var t=this.childWidgets.pop();(t instanceof rl||t instanceof e)&&t.destroy()}this.childWidgets=void 0,this.containerWidget&&this.containerWidget.removeChild(this.indexInOwner),this.containerWidget=void 0,this.margin=void 0,this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0,this.index=void 0},e.prototype.componentDestroy=function(){if(this.childWidgets)for(;this.childWidgets.length>0;){var t=this.childWidgets.pop();(t instanceof rl||t instanceof e)&&t.componentDestroy()}this.childWidgets=void 0,this.margin&&this.margin.destroy(),this.margin=void 0,this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0,this.index=void 0,this.containerWidget=void 0},e}(),Ks=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.floatingElements=[],t.footNoteReference=void 0,t.sectionFormatIn=void 0,t.columnIndex=0,t.headerSectionIndex=0,t.isWord2010NextColumn=!1,t}return Ds(i,e),Object.defineProperty(i.prototype,"sectionFormat",{get:function(){var e=this;return e instanceof Ys?e.sectionFormatIn:e.page&&!t.isNullOrUndefined(e.page.bodyWidgets)?e.page.bodyWidgets[0].sectionFormat:void 0},set:function(e){this instanceof Ys&&(this.sectionFormatIn=e)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"sectionIndex",{get:function(){var e=this,t=0;return e instanceof Ys?t=e.index:e.page&&(t=e.page.bodyWidgets[0].index),t},enumerable:!0,configurable:!0}),i.prototype.getHierarchicalIndex=function(e){if(t.isNullOrUndefined(this.page))return e;var i=this.page.documentHelper,r=this;if(r instanceof Ys)e=r.index+";"+e;else if(r instanceof Zs)e="Footnote"===r.footNoteType?"FN;"+e:"EN;"+e;else if(i.enableLayout)e=-1!==r.headerFooterType.indexOf("Header")?"H;"+e:"F;"+e;else{var n=this.getHeaderFooterIndex(r).toString();e=-1!==r.headerFooterType.indexOf("Header")?"H;"+n+";"+e:"F;"+n+";"+e}if(!t.isNullOrUndefined(r.page)){if(i.enableLayout)return(o=i.pages.indexOf(this.page))+";"+e;if(r instanceof Xs){var o=r.headerSectionIndex;return o+";"+e}}return e},i.prototype.getHeaderFooterIndex=function(e){for(var t=this.documentHelper.headersFooters,i=0;i<t.length;i++){var r=t[i];for(var n in r)if(r.hasOwnProperty(n)&&r[n]===e)return parseInt(n,10)}return-1},i.prototype.componentDestroy=function(){this.sectionFormatIn&&this.sectionFormatIn.destroy(),this.sectionFormatIn=void 0,this.floatingElements=[],this.removedHeaderFooters=[],this.footNoteReference=void 0,this.page=void 0,e.prototype.componentDestroy.call(this)},i}(Gs),Ys=function(e){function i(){return e.call(this)||this}return Ds(i,e),i.prototype.equals=function(e){return e instanceof i&&e.sectionFormat===this.sectionFormat},i.prototype.getHierarchicalIndex=function(e){var i=this;return i.containerWidget instanceof Zs?(e=i.containerWidget.bodyWidgets.indexOf(i)+";"+e,e="Footnote"===i.containerWidget.footNoteType?"FN;"+e:"EN;"+e):e=this.page&&-1!==this.page.bodyWidgets.indexOf(this)?this.page.bodyWidgets.indexOf(this)+";"+e:i.index+";"+e,t.isNullOrUndefined(i.page)?e:this.page.documentHelper.pages.indexOf(this.page)+";"+e},i.prototype.getTableCellWidget=function(e){for(var t=0;t<this.childWidgets.length;t++)if(this.childWidgets[t]instanceof el){var i=this.childWidgets[t],r=0;if(i.wrapTextAround&&(r=i.getTableCellWidth()),!i.wrapTextAround&&i.y<=e.y&&i.y+i.height>=e.y)return i.getTableCellWidget(e);if(i.wrapTextAround&&i.x<=e.x&&i.x+r>=e.x&&i.y<=e.y&&i.y+i.height>=e.y)return i.getTableCellWidget(e)}var n=void 0;return this.childWidgets.length>0&&(n=this.childWidgets[0].y<=e.y?this.childWidgets[this.childWidgets.length-1].getTableCellWidget(e):this.childWidgets[0].getTableCellWidget(e)),n},i.prototype.destroyInternal=function(e){this.height;if(!t.isNullOrUndefined(this.childWidgets)){for(var i=0;i<this.childWidgets.length;i++){var r=this.childWidgets[i];if(r.destroyInternal(e),t.isNullOrUndefined(this.childWidgets))break;i--}this.childWidgets=void 0}if(!t.isNullOrUndefined(this.page)){var n=this.indexInOwner;this.indexInOwner>-1&&(this.page.bodyWidgets.splice(n,1),0===this.page.bodyWidgets.length?this.page.destroy():this instanceof Xs&&this.page.headerWidget===this?this.page.headerWidget=void 0:this instanceof Xs&&this.page.footerWidget===this&&(this.page.footerWidget=void 0),this.page=void 0)}this.destroy()},i.prototype.destroy=function(){this.sectionFormatIn=void 0,this.page&&this.page.headerWidgetIn&&(this.page.headerWidgetIn.page=void 0),this.page&&this.page.footerWidgetIn&&(this.page.footerWidgetIn.page=void 0),this.page=void 0,e.prototype.destroy.call(this)},i.prototype.componentDestroy=function(){e.prototype.componentDestroy.call(this)},i}(Ks),Xs=function(e){function t(t){var i=e.call(this)||this;return i.isEmpty=!1,i.headerFooterType=t,i}return Ds(t,e),t.prototype.getTableCellWidget=function(e){for(var t=0;t<this.childWidgets.length;t++)if(this.childWidgets[t]instanceof el){var i=this.childWidgets[t],r=0;if(i.wrapTextAround&&(r=i.getTableCellWidth()),!i.wrapTextAround&&i.y<=e.y&&i.y+i.height>=e.y)return i.getTableCellWidget(e);if(i.wrapTextAround&&i.x<=e.x&&i.x+r>=e.x&&i.y<=e.y&&i.y+i.height>=e.y)return i.getTableCellWidget(e)}var n=void 0;return this.childWidgets.length>0&&(n=this.childWidgets[0].y<=e.y?this.childWidgets[this.childWidgets.length-1].getTableCellWidget(e):this.childWidgets[0].getTableCellWidget(e)),n},t.prototype.equals=function(e){return e instanceof t&&e.containerWidget===this.containerWidget},t.prototype.clone=function(){for(var e=new t(this.headerFooterType),i=0;i<this.childWidgets.length;i++){var r=this.childWidgets[i].clone();e.childWidgets.push(r),r.index=i,r.containerWidget=e}return e.isEmpty=this.isEmpty,e.x=this.x,e.y=this.y,e.height=0,e.width=0,e},t.prototype.destroyInternal=function(t){this.page=void 0,e.prototype.destroy.call(this)},t.prototype.componentDestroy=function(){e.prototype.componentDestroy.call(this),this.parentHeaderFooter=void 0},t}(Ks),Js=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.isLayouted=!1,t.isFieldCodeBlock=!1,t.locked=!1,t.lockedBy="",t}return Ds(i,e),Object.defineProperty(i.prototype,"bodyWidget",{get:function(){for(var e=this;e.containerWidget;){if(e.containerWidget instanceof Ol){var i=void 0;if(e.containerWidget.containerShape instanceof Pl){for(var r=e.containerWidget.containerShape;!t.isNullOrUndefined(r.containerShape);)r=r.containerShape;t.isNullOrUndefined(r.line)||(i=r.line.paragraph)}else t.isNullOrUndefined(e.containerWidget.containerShape.line)||(i=e.containerWidget.containerShape.line.paragraph);if(i)return i.bodyWidget}else if(e.containerWidget instanceof Ks)return e.containerWidget;e=e.containerWidget}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"leftIndent",{get:function(){var e=this;return e instanceof Qs&&e.paragraphFormat instanceof Ls?e.paragraphFormat.leftIndent:e instanceof el&&e.tableFormat instanceof Bs?e.tableFormat.leftIndent:0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"rightIndent",{get:function(){var e=this;return e instanceof Qs&&e.paragraphFormat instanceof Ls?e.paragraphFormat.rightIndent:0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isInsideTable",{get:function(){return this.containerWidget instanceof il},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isInHeaderFooter",{get:function(){return this.bodyWidget instanceof Xs},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"associatedCell",{get:function(){if(this.containerWidget instanceof il)return this.containerWidget},enumerable:!0,configurable:!0}),i.prototype.isPageBreak=function(){var e=!1;if(this instanceof Qs){var t=this;null!=t&&1===t.childWidgets.length&&1===t.firstChild.children.length&&(e=t.firstChild.children[0].isPageBreak)}return e},i.prototype.isColumnBreak=function(){var e=!1;if(this instanceof Qs){var t=this;null!=t&&1===t.childWidgets.length&&1===t.firstChild.children.length&&(e=t.firstChild.children[0].isColumnBreak)}return e},i.prototype.getHierarchicalIndex=function(e){var r=this;if(t.isNullOrUndefined(r.containerWidget)||t.isNullOrUndefined(r.containerWidget.childWidgets))return e;if(e=r.containerWidget.childWidgets.indexOf(r)+";"+e,!t.isNullOrUndefined(r.containerWidget)){if(r.containerWidget instanceof Ol)return r.containerWidget.getHierarchicalIndex(e);if(r.containerWidget instanceof i)return r.containerWidget.getHierarchicalIndex(e);r.containerWidget instanceof Ks&&(e=r.containerWidget.getHierarchicalIndex(e))}return e},i.prototype.getIndex=function(){return this instanceof Qs||this instanceof el?this.containerWidget.childWidgets.indexOf(this):this instanceof tl?this.ownerTable.childWidgets.indexOf(this):this instanceof il?this.ownerRow.childWidgets.indexOf(this):0},i.prototype.getContainerWidth=function(){if(this.isInsideTable){var e=this;if(e instanceof el&&"Auto"===e.tableFormat.preferredWidthType&&this.associatedCell.ownerTable.isGridUpdated){for(var i=0,r=this.associatedCell.cellFormat.columnSpan,n=this.associatedCell.columnIndex,o=0;o<r;o++)i+=this.associatedCell.ownerTable.tableHolder.columns[n].preferredWidth,n++;if(i>0)return i}var a=this.associatedCell.getCellWidth(this),s=this.associatedCell,l=t.isNullOrUndefined(s.ownerRow)||t.isNullOrUndefined(s.ownerRow.ownerTable)?0:s.ownerRow.ownerTable.tableFormat.cellSpacing;return e instanceof el&&l>0&&(a-=2*l+e.tableFormat.borders.left.getLineWidth()+(2*l+e.tableFormat.borders.right.getLineWidth())),a}if(this.containerWidget instanceof Ol){var d=this.containerWidget.containerShape;return bs.convertPixelToPoint(d.width)-bs.convertPixelToPoint(d.textFrame.marginLeft)-bs.convertPixelToPoint(d.textFrame.marginRight)}var h=this.bodyWidget,c=h.sectionFormat,g=0;if(!t.isNullOrUndefined(h.page)&&!t.isNullOrUndefined(h.page.documentHelper)&&"Word2013"!==h.page.documentHelper.compatibilityMode&&!this.isInsideTable&&this instanceof el){var p=this.firstChild;g=p.firstChild.leftMargin+p.lastChild.rightMargin}if(h instanceof Ys&&c.columns.length>1){var u=h.columnIndex;return bs.convertPixelToPoint(c.columns[u].width)}return c.pageWidth-(c.leftMargin+c.rightMargin)+g},Object.defineProperty(i.prototype,"bidi",{get:function(){return this instanceof Qs&&this.paragraphFormat instanceof Ls?this.paragraphFormat.bidi:this instanceof el&&this.tableFormat instanceof Bs&&this.tableFormat.bidi},enumerable:!0,configurable:!0}),i.prototype.componentDestroy=function(){e.prototype.componentDestroy.call(this),this.contentControlProperties=void 0},i}(Gs),Zs=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.bodyWidgets=[],t}return Ds(t,e),t.prototype.getMinimumAndMaximumWordWidth=function(e,t,i){throw new Error("Method not implemented.")},t.prototype.getTableCellWidget=function(e){},t.prototype.equals=function(e){return e instanceof t&&e.containerWidget===this.containerWidget},t.prototype.clone=function(){for(var e=new t,i=0;i<this.childWidgets.length;i++){var r=this.childWidgets[i].clone();e.childWidgets.push(r),r.index=i,r.containerWidget=e}return e.block=this.block,e},t.prototype.destroyInternal=function(t){this.block=void 0,e.prototype.destroy.call(this)},t.prototype.componentDestroy=function(){if(this.bodyWidgets&&this.bodyWidgets.length>0){for(var t=0;t<this.bodyWidgets.length;t++)this.bodyWidgets[t].componentDestroy();this.bodyWidgets=[]}this.bodyWidgets=void 0,this.block=void 0,e.prototype.componentDestroy.call(this)},t}(Ks),Qs=function(i){function r(){var e=i.call(this)||this;return e.isSectionBreak=!1,e.isChangeDetected=!1,e.isUpdateBookmarkEnd=!1,e.ischildContentControl=!1,e.textWrapWidth=!1,e.clientX=void 0,e.isRender=!0,e.floatingElements=[],e.paragraphFormat=new Ls(e),e.characterFormat=new S(e),e}return Ds(r,i),Object.defineProperty(r.prototype,"isEndsWithPageBreak",{get:function(){return this.childWidgets.length>0&&this.lastChild.isEndsWithPageBreak},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"isEndsWithColumnBreak",{get:function(){return this.childWidgets.length>0&&this.lastChild.isEndsWithColumnBreak},enumerable:!0,configurable:!0}),r.prototype.getRevisionRange=function(e){for(var i=this.getSplitWidgets(),r=[],n=0;n<i.length;n++)for(var o=i[n],a=0;a<o.childWidgets.length;a++)for(var s=o.childWidgets[a],l=0;l<s.children.length;l++){var d=s.children[l];t.isNullOrUndefined(d.getAllRevision())||-1===d.getAllRevision().indexOf(e)||r.push(d)}return r},r.prototype.getAllRevisions=function(e){for(var t=[],i=0;i<this.childWidgets.length;i++)for(var r=this.childWidgets[i],n=0;n<r.children.length;n++)for(var o=r.children[n],a=0;a<o.revisionLength;a++){var s=o.getRevision(a);-1===t.indexOf(s)&&(t.push(s),e&&(s.ownerNode=this))}for(var l=0;l<this.characterFormat.revisionLength;l++){var d=this.characterFormat.getRevision(l);-1===t.indexOf(d)&&(t.push(d),e&&(d.ownerNode=this.characterFormat))}return t},r.prototype.equals=function(e){return e instanceof r&&e.paragraphFormat===this.paragraphFormat},r.prototype.isContainsShapeAlone=function(){for(var e=!1,t=0;t<this.childWidgets.length;t++)for(var i=this.childWidgets[t],r=0;r<i.children.length;r++){var n=i.children[r];if(!(n instanceof Cl)||n instanceof Cl&&"Inline"===n.textWrappingStyle)return!1;e=!0}return!!e},r.prototype.isEmptyInternal=function(e){if(t.isNullOrUndefined(this.childWidgets)||0===this.childWidgets.length)return!0;for(var i=0;i<this.childWidgets.length;i++)for(var r=this.childWidgets[i],n=0;n<r.children.length;n++){var o=r.children[n];if(0!==o.length&&(!(o instanceof hl&&0!==o.text.length&&this.isZeroWidthText(o.text))&&(o instanceof hl||o instanceof Il||o instanceof ml||o instanceof Al||o instanceof Ll||o instanceof Ul||o instanceof Pl||o instanceof Tl||o instanceof yl||o instanceof Jl&&!e||o instanceof ol&&bs.isLinkedFieldCharacter(o))))return!1}return!0},r.prototype.isZeroWidthText=function(e){for(var t=0,i=0;i<e.length;i++){var r=e.charCodeAt(i);8203!==r&&8204!==r&&8205!==r&&65279!==r||t++}return t===e.length},r.prototype.isEmpty=function(){return this.isEmptyInternal(!1)},r.prototype.getInline=function(e,i){for(var r=void 0,n=0,o=!1,a=this.getSplitWidgets(),s=0;s<a.length;s++)for(var l=a[s],d=0;d<l.childWidgets.length;d++)for(var h=l.childWidgets[d],c=0;c<h.children.length;c++)if(!((r=h.children[c])instanceof kl)){if((!o&&(r instanceof hl||r instanceof Il||r instanceof Pl||r instanceof Tl||r instanceof ml||r instanceof ol&&bs.isLinkedFieldCharacter(r))||r instanceof Ul||r instanceof yl||r instanceof Jl)&&(o=!0),o&&e<=n+r.length)return i=e-n,{element:r,index:i};n+=r.length}return e>n&&(i=t.isNullOrUndefined(r)?e:r.length),{element:r,index:i}},r.prototype.getLength=function(){var e=0;if(t.isNullOrUndefined(this.childWidgets))return e;for(var i=0;i<this.childWidgets.length;i++)for(var r=this.childWidgets[i],n=0;n<r.children.length;n++){var o=r.children[n];o instanceof kl||(e+=o.length)}return e},r.prototype.getTotalLength=function(){for(var e=0,t=this.getSplitWidgets(),i=0;i<t.length;i++)e+=t[i].getLength();return e},r.prototype.getTableCellWidget=function(e){},r.prototype.getMinimumAndMaximumWordWidth=function(e,i,r){if(void 0===r&&(r=0),e=bs.convertPointToPixel(e),i=bs.convertPointToPixel(i),r=bs.convertPointToPixel(r),this.childWidgets.length>0){for(var n=this.childWidgets[0].children[0],o="",a=new p,s=[],l=!1,d=!1,h=!1;;){if(n instanceof hl&&""!==n.text)a.add(n,o.length),o+=n.text;else if(n instanceof ol&&0===n.fieldType){var c=n;t.isNullOrUndefined(c.fieldEnd)||(n=t.isNullOrUndefined(c.fieldSeparator)?c.fieldEnd:c.fieldSeparator)}else n instanceof Il&&s.push(n.width);if(t.isNullOrUndefined(n)||t.isNullOrUndefined(n.nextNode))break;n=n.nextNode}this.isInsideTable&&this.containerWidget instanceof il&&this.containerWidget.ownerTable&&this.containerWidget.ownerTable.bodyWidget&&this.containerWidget.ownerTable.bodyWidget.page&&this.containerWidget.ownerTable.bodyWidget.page.documentHelper&&this.containerWidget.ownerTable.bodyWidget.page.documentHelper.layout&&this.bodyWidget.page.documentHelper.layout.isAllColumnHasAutoWidthType&&(d=!0),this.containerWidget instanceof il&&this.containerWidget.ownerTable&&("Auto"===this.containerWidget.ownerTable.tableFormat.preferredWidthType||"Point"===this.containerWidget.ownerTable.tableFormat.preferredWidthType&&0===this.containerWidget.ownerTable.tableFormat.preferredWidth)&&(l=!0),this.containerWidget instanceof il&&this.containerWidget.ownerTable&&!this.containerWidget.ownerTable.isInsideTable&&this.containerWidget.ownerTable.tableFormat.allowAutoFit&&("Percent"===this.containerWidget.ownerTable.tableFormat.preferredWidthType||"Auto"===this.containerWidget.ownerTable.tableFormat.preferredWidthType&&"Percent"===this.containerWidget.cellFormat.preferredWidthType)&&(h=!0);var g=[],u=void 0;this.bodyWidget.page.documentHelper.textHelper.position=0;do{var f=this.bodyWidget.page.documentHelper.textHelper.position;(u=this.bodyWidget.page.documentHelper.textHelper.readWord(o,a,l,h,d))&&g.push({value:u,index:f})}while(this.bodyWidget.page.documentHelper.textHelper.position<o.length);for(var m=0,y=0;y<g.length;y++){var v=g[y].value,W=g[y].index,b=0;o="";for(var x="",w=0,F=W,C=W,P=0;P<a.keys.length;P++){var T=a.keys[P],O=a.get(T),S=T.length;if(C<=O+S&&(w=C-O,W+v.length<=O+S?F=W+v.length-(O+w):C+=F=S-w,x+=o=T.text.substring(w,w+F)),""!==o&&(b+=this.bodyWidget.page.documentHelper.textHelper.getWidth(o,T.characterFormat,T.scriptType)),x===v)break}0!==b&&((0===e||b>e)&&(e=b),b>m&&(m=b))}var N=0;s.length>0&&(N=Math.max.apply(null,s)),(0===e||N>e)&&(e=N),N>m&&(m=N),m>0&&(m+=(this.leftIndent>0?this.paragraphFormat.firstLineIndent<0?this.leftIndent+this.paragraphFormat.firstLineIndent:this.leftIndent:0)+(this.rightIndent>0?this.rightIndent:0)),m>i&&(i=m);var I=this.measureParagraph();I>r&&(r=I)}var k=0;if(!this.isEmpty()&&0==this.floatingElements.length&&!t.isNullOrUndefined(this.paragraphFormat)&&this.paragraphFormat.leftIndent>0&&!t.isNullOrUndefined(this.associatedCell)&&!t.isNullOrUndefined(this.associatedCell.cellFormat)&&"Point"===this.associatedCell.cellFormat.preferredWidthType){var A=this.paragraphFormat.leftIndent+this.paragraphFormat.firstLineIndent;A+e>this.associatedCell.cellFormat.preferredWidth&&(k=A)}return{maximumWordWidth:bs.convertPixelToPoint(i),minimumWordWidth:bs.convertPixelToPoint(e)+k,maxParaWidth:bs.convertPixelToPoint(r)}},r.prototype.measureParagraph=function(){for(var e=0,i=this.childWidgets[0].children[0];;){if(i instanceof hl&&""!==i.text)i.isWidthUpdated&&" "!==i.text[i.text.length-1]?e+=i.trimEndWidth:e+=this.bodyWidget.page.documentHelper.textHelper.getWidth(i.text,i.characterFormat,i.scriptType);else if(i instanceof ol&&0===i.fieldType){var r=i;null!=r.fieldEnd&&(i=t.isNullOrUndefined(r.fieldSeparator)?r.fieldEnd:r.fieldSeparator)}else i instanceof Il&&(e+=i.width);if(t.isNullOrUndefined(i)||t.isNullOrUndefined(i.nextNode))break;i=i.nextNode}return this.leftIndent>0&&(e+=this.leftIndent),this.rightIndent>0&&(e+=this.rightIndent),e},r.prototype.isArabicChar=function(e){return e>=String.fromCharCode(1536)&&e<=String.fromCharCode(1791)||e>=String.fromCharCode(1872)&&e<=String.fromCharCode(1919)||e>=String.fromCharCode(2208)&&e<=String.fromCharCode(2303)||e>=String.fromCharCode(64336)&&e<=String.fromCharCode(65023)||e>=String.fromCharCode(65136)&&e<=String.fromCharCode(65279)},r.prototype.isHebrewChar=function(e){return e>=String.fromCharCode(1424)&&e<=String.fromCharCode(1535)||e>=String.fromCharCode(64285)&&e<=String.fromCharCode(64335)},r.prototype.isHindiChar=function(e){return e>=String.fromCharCode(2304)&&e<=String.fromCharCode(2431)||e>=String.fromCharCode(43232)&&e<=String.fromCharCode(43263)||e>=String.fromCharCode(7376)&&e<=String.fromCharCode(7423)},r.prototype.isKoreanChar=function(e){return e>=String.fromCharCode(44032)&&e<=String.fromCharCode(55203)||e>=String.fromCharCode(4352)&&e<=String.fromCharCode(4607)||e>=String.fromCharCode(12592)&&e<=String.fromCharCode(12687)||e>=String.fromCharCode(43360)&&e<=String.fromCharCode(43391)||e>=String.fromCharCode(55216)&&e<=String.fromCharCode(55295)||e>=String.fromCharCode(44032)&&e<=String.fromCharCode(55215)},r.prototype.isJapanese=function(e){return e>=String.fromCharCode(12448)&&e<=String.fromCharCode(12543)||e>=String.fromCharCode(12352)&&e<=String.fromCharCode(12447)},r.prototype.isThaiCharacter=function(e){return e>=String.fromCharCode(3584)&&e<=String.fromCharCode(3711)},r.prototype.isChineseChar=function(e){return e>=String.fromCharCode(19968)&&e<=String.fromCharCode(40959)||e>=String.fromCharCode(13312)&&e<=String.fromCharCode(19903)||e>=String.fromCharCode(55360)&&e<=String.fromCharCode(55401)||e>=String.fromCharCode(56320)&&e<=String.fromCharCode(57055)||e>=String.fromCharCode(43360)&&e<=String.fromCharCode(43391)||e>=String.fromCharCode(65280)&&e<=String.fromCharCode(65519)||e>=String.fromCharCode(12288)&&e<=String.fromCharCode(12351)||e>=String.fromCharCode(63744)&&e<=String.fromCharCode(64255)},r.prototype.isSpecialCharacters=function(e){return e>=String.fromCharCode(8192)&&e<=String.fromCharCode(10175)},r.prototype.getFontScriptType=function(t,i){return this.isHindiChar(t)?e.FontScriptType.Hindi:this.isKoreanChar(t)?e.FontScriptType.Korean:this.isJapanese(t)?e.FontScriptType.Japanese:this.isChineseChar(t)?e.FontScriptType.Chinese:this.isArabicChar(t)?e.FontScriptType.Arabic:this.isHebrewChar(t)?e.FontScriptType.Hebrew:this.isThaiCharacter(t)?e.FontScriptType.Thai:this.isSpecialCharacters(t)&&i?e.FontScriptType.SpecialCharacter:e.FontScriptType.English},r.prototype.splitTextByFontScriptType=function(i,r,n){var o=[];if(t.isNullOrUndefined(i)||!t.isNullOrUndefined(i)&&""===i)return o;for(var a="",s=e.FontScriptType.English,l=e.FontScriptType.English,d=/[\uD800-\uDFFF]/,h=0;h<i.length;h++)i[h]==String.fromCharCode(32)||d.test(i[h])||(l=this.getFontScriptType(i[h],n)),""!=a&&l!==s&&(o.push(a),r.push(s),a=""),a+=i[h],s=l;return""!=a&&(o.push(a),r.push(l),a=""),o},r.prototype.splitTextRangeByScriptType=function(e){var t=!1,i=1;if(this.childWidgets.length>0){for(var r=this.childWidgets[e],n=e+1;n<this.childWidgets.length;n++){for(var o=this.childWidgets[n],a=0;a<o.children.length;a++){var s=o.children[a];r.children.push(s),s.line=r}this.childWidgets.splice(n,1),n--}for(n=0;n<r.children.length;n+=i){var l=r.children[n];i=1;var d=void 0;if(l instanceof hl&&(d=l),l instanceof ol&&0==l.fieldType?t=!0:l instanceof ol&&2===l.fieldType&&(t=!1),void 0!=d&&!t){var h="EastAsia"===d.characterFormat.fontHintType&&d.characterFormat.hasValue("fontFamilyFarEast"),c=[],g=this.splitTextByFontScriptType(d.text,c,h);if(g.length>1)for(var p=0;p<g.length;p++){var u=g[p];if(p>0){var f=d.clone();f.text=u,f.scriptType=c[p],r.children.splice(n+p,0,f),f.line=r,i++,d.revisionLength>0&&this.updateTextElementInRevisionRange(d,f)}else d.text=u,d.scriptType=c[p],d.isWidthUpdated=!1}else g.length>0&&(d.scriptType=c[0]);c.length=0}}}},r.prototype.splitLtrAndRtlText=function(e){var t={value:null},i={value:null},r={value:null},n=1,o={value:null},a=[],s=!1,l=this.bodyWidget.page.documentHelper.textHelper;if(this.childWidgets.length>0){for(var d=this.childWidgets[e],h=0;h<d.children.length;h+=n){var c=d.children[h];n=1;var g=void 0;if(c instanceof hl&&(g=c),c instanceof ol&&0==c.fieldType?s=!0:c instanceof ol&&2===c.fieldType&&(s=!1),void 0!=g&&!s){var p=g.text,u=g.characterFormat.bidi,f=!1,m=a.length;u&&(f=l.isRightToLeftLanguage(c.characterFormat.localeIdBidi));var y=l.splitTextByConsecutiveLtrAndRtl(p,u,f,a,t,o,i,r);if(y.length>1)for(var v=0;v<y.length;v++)if(p=y[v],v>0){var W=g.clone();W.text=p,W.characterRange=a[v+m],d.children.splice(h+v,0,W),W.line=d,n++,g.revisionLength>0&&this.updateTextElementInRevisionRange(g,W)}else g.text=p,g.characterRange=a[m];else y.length>0&&(g.characterRange=a[m])}}a.length=0}},r.prototype.updateTextElementInRevisionRange=function(e,t){for(var i=0;i<e.revisionLength;i++){var r=e.getRevision(i);t.addRevision(r),t.removedIds=[]}},r.prototype.combineconsecutiveRTL=function(t){for(var i=!1,r=this.bodyWidget.page.documentHelper,n=r.textHelper,o=t;o<this.childWidgets.length;o++)for(var a=this.childWidgets[o],s=0;s<=a.children.length-2;s++){var l=a.children[s];if(l instanceof ol&&0===l.fieldType?i=!0:l instanceof ol&&2===l.fieldType&&(i=!1),!i&&l instanceof hl&&a.children[s+1]instanceof hl){var d=l,h=a.children[s+1];(d.characterFormat.complexScript&&d.scriptType==h.scriptType||d.characterFormat.bidi&&d.scriptType!==e.FontScriptType.Hebrew&&d.characterRange==e.CharacterRangeType.RightToLeft&&h.characterRange==e.CharacterRangeType.RightToLeft)&&d.text.length>0&&h.text.length>0&&!n.isWordSplitChar(d.text[d.text.length-1])&&!n.isWordSplitChar(h.text[0])&&d.characterFormat.isEqualFormat(h.characterFormat)&&this.compareRevisions(d.getAllRevision(),h.getAllRevision())?(d.text=d.text+h.text,a.children.splice(s+1,1),s--,d.isWidthUpdated=!1):d.characterRange==e.CharacterRangeType.RightToLeft&&h.characterRange==e.CharacterRangeType.RightToLeft&&d.text.length>0&&h.text.length>0&&n.isWordSplitChar(d.text[d.text.length-1])&&n.isWordSplitChar(h.text[0])&&d.characterFormat.isEqualFormat(h.characterFormat)&&this.compareRevisions(d.getAllRevision(),h.getAllRevision())?(d.text=d.text+h.text,a.children.splice(s+1,1),s--,d.isWidthUpdated=!1):"Word2013"!==r.compatibilityMode&&d.characterFormat.bidi&&!n.isRightToLeftLanguage(d.characterFormat.localeIdBidi)&&d.characterRange===e.CharacterRangeType.Number&&this.combineConsecutiveRTLDateFormatText(a,s)}}},r.prototype.combineConsecutiveRTLDateFormatText=function(t,i){var r=t.children[i],n=t.children[i+1];if(n&&r.characterFormat.isEqualFormat(n.characterFormat)&&("/"===n.text||"."===n.text)){for(var o=r.text+n.text,a=1,s=i+2,l=!0;s<t.children.length&&(n=t.children[s],r.characterFormat.isEqualFormat(n.characterFormat)&&(n.characterRange===e.CharacterRangeType.Number||!("/"!==n.text&&"."!==n.text||l)));){l=n.characterRange===e.CharacterRangeType.WordSplit;var d=t.children[s+1];if(!(!l||d&&r.characterFormat.isEqualFormat(d.characterFormat)&&d.characterRange===e.CharacterRangeType.Number))break;o+=n.text,a++,s++}a>1&&(r.text=o,t.children.splice(i+1,a),r.isWidthUpdated=!1)}},r.prototype.compareRevisions=function(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},r.prototype.clone=function(){var e=new r;e.paragraphFormat.copyFormat(this.paragraphFormat),e.characterFormat.copyFormat(this.characterFormat);for(var i=0;i<this.childWidgets.length;i++){var n=this.childWidgets[i].clone();e.childWidgets.push(n);for(var o=0;o<n.children.length;o++){var a=n.children[o];(a instanceof Il&&"Inline"!==a.textWrappingStyle||a instanceof Pl||a instanceof Tl)&&e.floatingElements.push(a)}n.paragraph=e}return e.x=this.x,e.y=this.y,e.height=this.height,e.width=this.width,e.absoluteXPosition=t.isNullOrUndefined(this.absoluteXPosition)?void 0:{width:this.absoluteXPosition.width,x:this.absoluteXPosition.x},this.contentControlProperties&&(e.contentControlProperties=this.contentControlProperties),e},r.prototype.destroyInternal=function(e){var i=this.height;if(!t.isNullOrUndefined(this.childWidgets)){for(var r=0;r<this.childWidgets.length&&(this.childWidgets[r].destroy(),1===this.childWidgets.length&&t.isNullOrUndefined(this.childWidgets[0].children)&&(this.childWidgets=void 0),!t.isNullOrUndefined(this.childWidgets));r++)r--;this.childWidgets=void 0}t.isNullOrUndefined(this.containerWidget)||t.isNullOrUndefined(this.containerWidget.childWidgets)||-1===this.containerWidget.childWidgets.indexOf(this)||(this.containerWidget.childWidgets.splice(this.containerWidget.childWidgets.indexOf(this),1),this.containerWidget.height-=i,this.containerWidget=void 0),this.hasOwnProperty("absoluteXPosition")&&delete this.absoluteXPosition,this.destroy()},r.prototype.destroy=function(){this.paragraphFormat=void 0,this.characterFormat=void 0,i.prototype.destroy.call(this)},r.prototype.componentDestroy=function(){this.paragraphFormat&&this.paragraphFormat.destroy(),this.paragraphFormat=void 0,this.characterFormat&&this.characterFormat.destroy(),this.characterFormat=void 0,i.prototype.componentDestroy.call(this)},r}(Js),$s=function(){function e(){}return e.prototype.clone=function(){var t=new e;return t.allowOverlap=this.allowOverlap,t.distanceTop=this.distanceTop,t.distanceRight=this.distanceRight,t.distanceLeft=this.distanceLeft,t.distanceBottom=this.distanceBottom,t.verticalAlignment=this.verticalAlignment,t.verticalOrigin=this.verticalOrigin,t.verticalPosition=this.verticalPosition,t.horizontalAlignment=this.horizontalAlignment,t.horizontalOrigin=this.horizontalOrigin,t.horizontalPosition=this.horizontalPosition,t},e}(),el=function(e){function i(){var t=e.call(this)||this;return t.flags=0,t.leftMargin=0,t.topMargin=0,t.rightMargin=0,t.bottomMargin=0,t.isDefaultFormatUpdated=!1,t.isContainInsideTable=!1,t.isHeaderNotRepeatForAllPages=!1,t.footnoteElement=[],t.isRender=!0,t.margin=new js(t.leftMargin,t.topMargin,t.rightMargin,t.bottomMargin),t.leftBorderWidth=0,t.rightBorderWidth=0,t.topBorderWidth=0,t.bottomBorderWidth=0,t.tableFormat=new Bs(t),t.tableHolder=new $l,t.spannedRowCollection=new p,t}return Ds(i,e),Object.defineProperty(i.prototype,"isGridUpdated",{get:function(){return(4&this.flags)>>2!=0},set:function(e){this.flags=251&this.flags|(e?1:0)<<2},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"continueHeader",{get:function(){return(2&this.flags)>>1!=0},set:function(e){this.flags=253&this.flags|(e?1:0)<<1},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"header",{get:function(){return 0!=(1&this.flags)},set:function(e){this.flags=254&this.flags|(e?1:0)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isBidiTable",{get:function(){return(16&this.flags)>>4!=0},set:function(e){this.flags=239&this.flags|(e?1:0)<<4},enumerable:!0,configurable:!0}),i.prototype.equals=function(e){return e instanceof i&&e.tableFormat===this.tableFormat},i.prototype.combineRows=function(e){for(var i=0;i<this.childWidgets.length;i++){var r=this.childWidgets[i];if(!t.isNullOrUndefined(r.firstChild)&&0!==r.firstChild.index&&1===r.getSplitWidgets().length)for(var n=0;n<r.childWidgets.length;n++)r.childWidgets[n].index--;0===r.childWidgets.length?(r.destroy(),i--):r.combineCells(e)}},i.prototype.contains=function(e){if(this.equals(e.ownerTable))return!0;for(;!t.isNullOrUndefined(e.ownerTable)&&e.ownerTable.isInsideTable;){if(this.equals(e.ownerTable))return!0;e=e.ownerTable.associatedCell}return this.equals(e.ownerTable)},i.prototype.getOwnerWidth=function(e){var t=this.getContainerWidth();return"Auto"===this.tableFormat.preferredWidthType&&(t=t-this.leftIndent-this.rightIndent),t>=0?t:0},i.prototype.getTableWidth=function(){for(var e=0,t=0;t<this.childWidgets.length;t++){for(var i=0,r=this.childWidgets[t],n=0;n<r.childWidgets.length;n++)i+=r.childWidgets[n].cellFormat.cellWidth;e<i&&(e=i)}return e},i.prototype.getTableCellWidth=function(){for(var e=0,t=0;t<this.childWidgets.length;t++){for(var i=0,r=this.childWidgets[t],n=0;n<r.childWidgets.length;n++){var o=r.childWidgets[n],a=o.width,s=0===a;0===a&&(a=o.cellFormat.cellWidth,"Center"!==this.tableFormat.tableAlignment||this.tableFormat.allowAutoFit||"Percent"===this.tableFormat.preferredWidthType||0===this.tableFormat.preferredWidth||this.tableFormat.preferredWidth!==a||(e=bs.convertPointToPixel(this.tableFormat.preferredWidth)),a>o.cellFormat.preferredWidth&&"Percent"!==this.tableFormat.preferredWidthType&&0!==o.cellFormat.preferredWidth&&"Percent"!==o.cellFormat.preferredWidthType&&(a=o.cellFormat.preferredWidth),a=bs.convertPointToPixel(a-(o.margin.left+o.margin.right))),i+=a+o.margin.left+o.margin.right,s&&n===r.childWidgets.length-1&&"Center"===this.tableFormat.tableAlignment&&"Percent"===this.tableFormat.preferredWidthType&&(i-=bs.convertPointToPixel(this.tableFormat.borders.right.getLineWidth()))}e<i&&(e=i)}return e},i.prototype.getTableClientWidth=function(e){var t=e;return"Point"===this.tableFormat.preferredWidthType&&this.tableFormat.preferredWidth>0?t=this.tableFormat.preferredWidth:"Percent"===this.tableFormat.preferredWidthType&&this.tableFormat.preferredWidth>0&&(t=t*this.tableFormat.preferredWidth/100),t},i.prototype.getCellWidth=function(e,i,r,n){var o=e;return"Percent"===i?o=e*r/100:"Point"===i?o=e:t.isNullOrUndefined(n)||(o=this.getMinimumPreferredWidth(n)),o},i.prototype.getMinimumPreferredWidth=function(e){return 0!==e.cellFormat.preferredWidth||0===e.cellFormat.cellWidth||e.ownerTable&&e.ownerTable.bodyWidget&&e.ownerTable.bodyWidget.page&&e.ownerTable.bodyWidget.page.documentHelper&&e.ownerTable.bodyWidget.page.documentHelper.layout&&this.bodyWidget.page.documentHelper.layout.isAllColumnHasAutoWidthType?e.getMinimumPreferredWidth():e.cellFormat.cellWidth},i.prototype.fitCellsToClientArea=function(e){for(var t=e/this.getTableWidth(),i=0;i<this.childWidgets.length;i++){var r=this.childWidgets[i];r.rowFormat.gridAfterWidth*=t,r.rowFormat.gridBeforeWidth*=t;for(var n=0;n<r.childWidgets.length;n++)r.childWidgets[n].cellFormat.cellWidth*=t,r.childWidgets[n].cellFormat.preferredWidth*=t}},i.prototype.getTableCellWidget=function(e){for(var i=void 0,r=t.isNullOrUndefined(this.bodyWidget)||t.isNullOrUndefined(this.bodyWidget.page)||t.isNullOrUndefined(this.bodyWidget.page.documentHelper)?0:this.bodyWidget.page.documentHelper.resizerBoundaryWidth,n=0;n<this.childWidgets.length;n++)if(this.childWidgets[n].y<=e.y&&this.childWidgets[n].y+this.childWidgets[n].height+this.childWidgets[n].topBorderWidth>=e.y-r){i=this.childWidgets[n].getTableCellWidget(e);break}return i},i.prototype.calculateGrid=function(e,t){var i=[],r=[],n=[],o=this.getOwnerWidth(!0),a=this.getTableClientWidth(o);this.tableCellInfo=new p;for(var s=0;s<this.childWidgets.length;s++){var l=this.childWidgets[s],d=new p,h=l.rowFormat,c=l.rowFormat.gridBefore,g=0;i.indexOf(g)<0&&(i.push(g),r.push(g)),g+=this.getCellWidth(h.gridBeforeWidth,h.gridBeforeWidthType,a,null);var u=parseFloat(g.toFixed(2));i.indexOf(u)<0&&(i.push(u),r.push(g));for(var f=0;f<l.childWidgets.length;f++){for(var m=l.childWidgets[f],y=0,v=0;v<n.length;v++)if(!(n[v].columnIndex<c)){var W=n[v].cellFormat.rowSpan,b=!0;n[v].columnIndex>c?(b=!1,f===l.childWidgets.length-1&&l.rowFormat.gridAfter>0&&(this.updateValidPreferredWidth(n[v]),y+=this.getCellWidth(n[v].cellFormat.preferredWidth,n[v].cellFormat.preferredWidthType,a,null))):(this.updateValidPreferredWidth(n[v]),g+=this.getCellWidth(n[v].cellFormat.preferredWidth,n[v].cellFormat.preferredWidthType,a,null),c=n[v].columnIndex+n[v].cellFormat.columnSpan),b||f!==l.childWidgets.length-1||(b=!0),b&&s-n[v].ownerRow.rowIndex==W-1&&(n.splice(v,1),v--)}if(m.cellFormat.rowSpan>1)if(0===n.length||n[n.length-1].columnIndex<=c)n.push(m);else for(var x=n.length;x>0;x--)n[x-1].columnIndex>c&&n.splice(x-1,0,m);d.containsKey(m.cellIndex)||d.add(m.cellIndex,parseFloat((g-u).toFixed(2))),c+=m.cellFormat.columnSpan,this.updateValidPreferredWidth(m),g+=this.getCellWidth(m.cellFormat.preferredWidth,m.cellFormat.preferredWidthType,a,null);var w=parseFloat(g.toFixed(2));if(i.indexOf(w)<0&&(i.push(w),r.push(g)),y>0){g+=y;var F=parseFloat(g.toFixed(2));i.indexOf(F)<0&&(i.push(F),r.push(g))}f===l.childWidgets.length-1&&h.gridAfter>0&&(g+=this.getCellWidth(h.gridAfterWidth,"Point",a,null),i.indexOf(parseFloat(g.toFixed(2)))<0&&(i.push(parseFloat(g.toFixed(2))),r.push(g)),c+=h.gridAfter),this.tableCellInfo.containsKey(l.rowIndex)||this.tableCellInfo.add(l.rowIndex,d)}}i.sort(function(e,t){return e-t}),r.sort(function(e,t){return e-t}),(this.tableHolder.columns.length>0||e)&&this.updateColumnSpans(i,a,r,t),this.tableCellInfo.clear(),this.tableCellInfo=void 0},i.prototype.updateValidPreferredWidth=function(e){if("Point"===e.cellFormat.preferredWidthType&&e.cellFormat.preferredWidth!==e.cellFormat.cellWidth&&e.cellFormat.preferredWidth<bs.round(e.getMinimumPreferredWidth(),2))if(0===e.indexInOwner)e.cellFormat.preferredWidth=e.ownerColumn.endOffset;else{var t=e.ownerRow.childWidgets[e.indexInOwner-1];t.ownerColumn&&(e.cellFormat.preferredWidth=e.ownerColumn.endOffset-t.ownerColumn.endOffset)}},i.prototype.updateColumnSpans=function(e,t,i,r){for(var n=0;n<this.childWidgets.length;n++){var o=this.childWidgets[n];o.rowFormat.gridBeforeWidth>=0&&(o.rowFormat.gridBefore=o.getGridCount(e,void 0,-1,t,i));for(var a=0;a<o.childWidgets.length;a++){var s=o.childWidgets[a],l=o.getGridCount(e,s,s.getIndex(),t,i);l>0&&s.cellFormat.columnSpan!==l&&!r&&(s.cellFormat.columnSpan=l)}o.rowFormat.gridAfterWidth>=0&&(o.rowFormat.gridAfter=o.getGridCount(e,void 0,o.childWidgets.length,t,i))}},i.prototype.getMinimumAndMaximumWordWidth=function(e,t,i){void 0===i&&(i=0),this.checkTableColumns();var r=this.tableHolder.isAllColumnHasPointWidthType(),n=r?this.tableHolder.getTotalWidth(0):this.tableHolder.getTotalWidth(1);n>e&&(e=n),r||(n=this.tableHolder.getTotalWidth(2)),n>t&&(t=n);var o=r?this.tableHolder.getTotalWidth(0):this.tableHolder.getTotalWidth(4);return o>i&&(i=o),{minimumWordWidth:e,maximumWordWidth:t,maxParaWidth:i}},i.prototype.checkTableColumns=function(){this.isGridUpdated||((this.isAutoFit()||0===this.tableHolder.columns.length)&&this.buildTableColumns(),this.isGridUpdated=!1)},i.prototype.isAutoFit=function(){var e=this.bodyWidget;return!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(e.page)&&e.page.documentHelper.layout.getParentTable(this).tableFormat.allowAutoFit},i.prototype.updateRowSpan=function(){for(var e=this.childWidgets.length,t=0;t<e;t++)for(var i=this.childWidgets[t],r=0;r<i.childWidgets.length;r++){var n=i.childWidgets[r];if(n.cellFormat.rowSpan>1){var o=e-i.rowIndex;n.cellFormat.rowSpan>o&&(n.cellFormat.rowSpan=o)}}},i.prototype.assignCellColumnIndexes=function(){for(var e=[],t=0;t<this.childWidgets.length;t++){for(var i=this.childWidgets[t],r=i.rowFormat?i.rowFormat.gridBefore:0,n=0;n<i.childWidgets.length;n++){for(var o=i.childWidgets[n],a=0;a<e.length;a++){var s=(l=e[a]).columnIndex+l.cellFormat.columnSpan;l.columnIndex<=r&&r<s&&(r=s)}o.columnIndex=r,o.cellFormat.rowSpan>1&&e.push(o),r+=o.cellFormat.columnSpan>0?o.cellFormat.columnSpan:1}for(a=e.length-1;a>=0;a--){var l=e[a];t-l.ownerRow.rowIndex>=l.cellFormat.rowSpan-1&&e.splice(a,1)}}},i.prototype.updateCellFormatPreferredWidth=function(){for(var e=0,t=0;t<this.tableHolder.columns.length;t++){var i=this.tableHolder.columns[t];0===t?e=i.endOffset/i.preferredWidth:i.endOffset<this.tableHolder.columns[t-1].endOffset&&(i.endOffset=this.tableHolder.columns[t-1].endOffset+i.preferredWidth*e)}for(t=0;t<this.childWidgets.length;t++)for(var r=this.childWidgets[t],n=0;n<r.childWidgets.length;n++){var o=r.childWidgets[n];"Point"===o.cellFormat.preferredWidthType&&this.tableHolder&&this.tableHolder.columns&&this.tableHolder.columns.length>0&&this.tableHolder.columns[o.columnIndex+o.cellFormat.columnSpan-1]&&(o.cellFormat.preferredWidth=this.tableHolder.columns[o.columnIndex+o.cellFormat.columnSpan-1].endOffset-(o.columnIndex>0?this.tableHolder.columns[o.columnIndex-1].endOffset:0))}},i.prototype.buildTableColumns=function(){if(!this.isGridUpdated){this.tableHolder.resetColumns();var e=0,i=0,r=[],n=!1,o="Auto"===this.tableFormat.preferredWidthType||"Point"===this.tableFormat.preferredWidthType&&0===this.tableFormat.preferredWidth,a=this.tableFormat.allowAutoFit;!a&&!t.isNullOrUndefined(this.bodyWidget.page)&&this.bodyWidget.page.documentHelper&&this.bodyWidget.page.documentHelper&&this.bodyWidget.page.documentHelper.editorProperties.isTableMarkerDragging&&(o=!0),e=t.isNullOrUndefined(this.bodyWidget.page)||!(this.bodyWidget.page.viewer instanceof Ms)||!a&&"Percent"!==this.tableFormat.preferredWidthType||this.isInsideTable||this.containerWidget instanceof Ol?this.getOwnerWidth(!0):bs.convertPixelToPoint(this.bodyWidget.page.viewer.clientArea.width-3*this.bodyWidget.page.viewer.padding.right),!t.isNullOrUndefined(this.bodyWidget.page)&&this.bodyWidget.page.documentHelper&&this.bodyWidget.page.documentHelper.layout&&(this.bodyWidget.page.documentHelper.layout.isAllColumnHasAutoWidthType=this.bodyWidget.page.documentHelper.layout.isAuto(this)),"Percent"!==this.tableFormat.preferredWidthType&&(e=this.tableFormat.preferredWidth>e?this.tableFormat.preferredWidth:e);var s=o&&0===this.tableFormat.preferredWidth&&!a;i=this.getTableClientWidth(e);var l=this.getContainerWidth();s&&!this.isDefaultFormatUpdated&&a&&this.splitWidthToTableCells(i,s);for(var d=!1,h=!1,c=0;c<this.childWidgets.length;c++){var g=this.childWidgets[c],p=g.rowFormat,u=0,f=0,m=new td,y=0;!(p.gridBefore>0)||0===g.rowFormat.beforeWidth&&0===g.rowFormat.gridBeforeWidth||this.bodyWidget.page.documentHelper.alignTablesRowByRow&&!("Left"===g.ownerTable.tableFormat.tableAlignment||"Word2003"===this.bodyWidget.page.documentHelper.compatibilityMode&&g.ownerTable.firstChild.rowFormat.gridAfter>0)||(n=!0,f=this.getCellWidth(p.gridBeforeWidth,g.rowFormat.gridAfterWidthType,i,null),m.minimumWidth=f,this.tableHolder.addColumns(u,u=p.gridBefore,f,m,y=f,"Point",o));for(var v=0;v<g.childWidgets.length;v++){var W=g.childWidgets[v];(W.cellFormat.rowSpan>1||W.cellFormat.columnSpan>1)&&(d=!0),0===r.length&&(W.columnIndex=u);for(var b=0;b<r.length;b++){var x=r[b];if(x.columnIndex<u)W.columnIndex=u;else{var w=1,F=!0;w=x.cellFormat.rowSpan,x.columnIndex>u?(W.columnIndex=u,F=!1):(m=x.getCellSizeInfo(a),f=this.getCellWidth(x.cellFormat.preferredWidth,x.cellFormat.preferredWidthType,i,x),this.tableHolder.columns.length>0?(this.tableHolder.addColumns(u,u=this.tableHolder.columns.indexOf(x.ownerColumn)+x.cellFormat.columnSpan,f,m,y+=f,W.cellFormat.preferredWidthType,o),W.columnIndex=u):(this.tableHolder.addColumns(u,u=x.columnIndex+x.cellFormat.columnSpan,f,m,y+=f,W.cellFormat.preferredWidthType,o),W.columnIndex=u)),F||v!==g.childWidgets.length-1||(F=!0),F&&c-x.ownerRow.rowIndex==w-1&&(r.splice(b,1),b--)}}if(W.cellFormat.rowSpan>1)if(0===r.length||r[r.length-1].columnIndex<=u)r.push(W);else{for(var C=0,P=r.length;P>0;P--)r[P-1].columnIndex>u&&(C=P-1);r.splice(C,0,W)}m=W.getCellSizeInfo(a),(f=this.getCellWidth(W.cellFormat.preferredWidth,W.cellFormat.preferredWidthType,i,W))<m.minimumWordWidth&&a&&"Point"==W.cellFormat.preferredWidthType&&Math.round(f)<Math.round(W.cellFormat.cellWidth)&&(h=!0),this.tableHolder.addColumns(u,u+=W.cellFormat.columnSpan,f,m,y+=f,W.cellFormat.preferredWidthType,o),v===g.childWidgets.length-1&&p.gridAfterWidth>0&&(f=this.getCellWidth(p.gridAfterWidth,"Point",i,null),m.minimumWordWidth=m.maximumWordWidth=m.minimumWidth=f,m.maxParaWidth=0,this.tableHolder.addColumns(u,u+=p.gridAfter,f,m,y+=f,"Point",o))}}if(d&&h&&"Auto"===this.tableFormat.preferredWidthType&&!this.isContainInsideTable&&!this.isInsideTable&&(d=!1),!t.isNullOrUndefined(this.bodyWidget.page)&&this.bodyWidget.page.documentHelper&&this.bodyWidget.page.documentHelper.layout&&this.bodyWidget.page.documentHelper.layout.isAllColumnHasAutoWidthType&&(this.bodyWidget.page.documentHelper.layout.isAllColumnHasAutoWidthType=!1),s&&!this.isDefaultFormatUpdated&&(this.isDefaultFormatUpdated=!0),this.tableHolder.validateColumnWidths(),a&&this.isAutoTableCellPctWidthExceedsHundred(o,d,e))this.tableHolder.resizeColumnsToWidestParaWidth();else if(a)this.tableHolder.autoFitColumn(e,i,o,this.isInsideTable,a,d,this.bodyWidget.page.viewer.clientArea.width,this.leftIndent+this.rightIndent,l,this.tableFormat.preferredWidthType,n);else{var T=!1;!t.isNullOrUndefined(this.bodyWidget.page)&&this.bodyWidget.page.documentHelper.isRowOrCellResizing&&(T=!0),this.tableHolder.fitColumns(e,i,o,a,this.leftIndent+this.rightIndent,T)}this.setWidthToCells(i,o)}},i.prototype.isAutoTableCellPctWidthExceedsHundred=function(e,t,r){var n=this.tableHolder.columns.length;if(this.isInsideTable||t||!e||"Auto"!==this.tableFormat.preferredWidthType||0!==this.tableFormat.preferredWidth||0===n||this.tableHolder.getTotalWidth(2)>=r)return!1;for(var o=0;o<this.childWidgets.length;o++){var a=this.childWidgets[o];if(a.rowFormat.gridBefore>0||a.rowFormat.gridAfter>0||a.childWidgets.length!==n)return!1;for(var s=0,l=0;l<a.childWidgets.length;l++){var d=a.childWidgets[l];if("Percent"!==d.cellFormat.preferredWidthType||d.childWidgets.some(function(e){return e instanceof i}))return!1;s+=d.cellFormat.preferredWidth}if(s<=100)return!1}return!0},i.prototype.setWidthToCells=function(e,i){var r=!1;this.containerWidget instanceof Ys&&this.containerWidget.page&&this.containerWidget.page.documentHelper&&(this.containerWidget.page.documentHelper.editorProperties.isTableMarkerDragging||this.containerWidget.page.documentHelper.isRowOrCellResizing)&&(r=!0);for(var n=0;n<this.childWidgets.length;n++){var o=this.childWidgets[n],a=o.rowFormat;a.gridBefore>0&&(a.beforeWidth=this.tableHolder.getCellWidth(0,a.gridBefore,e));for(var s=0;s<o.childWidgets.length;s++){var l=o.childWidgets[s];t.isNullOrUndefined(l)||("Auto"===l.cellFormat.preferredWidthType&&(l.cellFormat.initialCellWidth=l.cellFormat.cellWidth),l.cellFormat.cellWidth=this.tableHolder.getCellWidth(l.columnIndex,l.cellFormat.columnSpan,e,r))}if(a.gridAfter>0){var d=this.tableHolder.columns.length-a.gridAfter;a.afterWidth=this.tableHolder.getCellWidth(d,a.gridAfter,e)}}},i.prototype.updateProperties=function(e,t,i){if(e&&(this.tableFormat.allowAutoFit="FixedColumnWidth"!==i),this!==t)return void t.updateProperties(!1,t,i);if("FixedColumnWidth"===i){this.tableFormat.preferredWidth=0,this.tableFormat.preferredWidthType="Auto";for(d=0;d<this.childWidgets.length;d++)for(var r=this.childWidgets[d],n=0;n<r.childWidgets.length;n++){var o=r.childWidgets[n];o.cellFormat.preferredWidthType="Point",o.cellFormat.preferredWidth=o.cellFormat.cellWidth}}else if("FitToWindow"===i){var a=this.tableHolder.getTotalWidth(0);this.tableFormat.leftIndent=0,this.tableFormat.preferredWidth=100,this.tableFormat.preferredWidthType="Percent";for(d=0;d<this.childWidgets.length;d++)for(var s=this.childWidgets[d],l=0;l<s.childWidgets.length;l++)"Percent"!==(h=s.childWidgets[l]).cellFormat.preferredWidthType&&(h.cellFormat.preferredWidthType="Percent",h.cellFormat.preferredWidth=h.cellFormat.cellWidth/a*100)}else{this.tableFormat.preferredWidth=0,this.tableFormat.preferredWidthType="Auto";for(var d=0;d<this.childWidgets.length;d++){(s=this.childWidgets[d]).rowFormat.beforeWidth=0,s.rowFormat.gridBefore=0,s.rowFormat.gridBeforeWidth=0,s.rowFormat.gridBeforeWidthType="Auto",s.rowFormat.afterWidth=0,s.rowFormat.gridAfter=0,s.rowFormat.gridAfterWidth=0,s.rowFormat.gridAfterWidthType="Auto";for(n=0;n<s.childWidgets.length;n++){var h=s.childWidgets[n];h.cellFormat.preferredWidth=0,h.cellFormat.preferredWidthType="Auto"}}}},i.prototype.getMaxRowWidth=function(e){for(var t=0,i=0;i<this.childWidgets.length;i++){for(var r=this.childWidgets[i],n=0,o=0;o<r.childWidgets.length;o++){var a=r.childWidgets[o];n+=this.getCellWidth(a.cellFormat.preferredWidth,a.cellFormat.preferredWidthType,e,a)}t<n&&(t=n)}return t},i.prototype.updateWidth=function(e,i,r){var n=this.tableHolder.getTotalWidth(0),o=this.getOwnerWidth(!0);t.isNullOrUndefined(this.bodyWidget)||t.isNullOrUndefined(this.bodyWidget.page)||!(this.bodyWidget.page.viewer instanceof Ms)||"Percent"!==this.tableFormat.preferredWidthType||this.isInsideTable||this.containerWidget instanceof Ol||(o=bs.convertPixelToPoint(this.bodyWidget.page.viewer.clientArea.width-3*this.bodyWidget.page.viewer.padding.right));var a=this.getTableClientWidth(o);if("Auto"!==this.tableFormat.preferredWidthType)if("Point"===this.tableFormat.preferredWidthType)this.tableFormat.preferredWidth=this.getMaxRowWidth(a);else{var s=(n=this.getMaxRowWidth(a))/o*100;this.tableFormat.preferredWidth=s}r&&i&&"Auto"===this.tableFormat.preferredWidthType&&this.tableFormat.preferredWidth<this.getMaxRowWidth(a)&&(this.tableFormat.preferredWidth=this.getMaxRowWidth(a))},i.prototype.convertPointToPercent=function(e,t){var i=0;return i=e/t*100,i=Math.round(i),i<100?i:100},i.prototype.updateChildWidgetLeft=function(e){for(var t=0;t<this.childWidgets.length;t++){var i=this.childWidgets[t];i.x=e,i.updateChildWidgetLeft(e)}},i.prototype.shiftWidgetsForRtlTable=function(e,t){var i=t.x,r=e.right,n=0;t.tableFormat&&t.tableFormat.cellSpacing>0&&(n=t.tableFormat.cellSpacing);for(var o=0;o<t.childWidgets.length;o++)for(var a=t.childWidgets[o],s=r-(a.x-i),l=0;l<a.childWidgets.length;l++){var d=a.childWidgets[l];s-=d.width+d.margin.left+d.margin.right-d.rightBorderWidth+n,d.updateWidgetLeft(s+d.margin.left)}},i.prototype.clone=function(e){var t=new i;if(t.tableHolder=this.tableHolder.clone(),t.tableFormat.copyFormat(this.tableFormat),this.wrapTextAround&&(t.wrapTextAround=this.wrapTextAround,t.positioning=this.positioning.clone()),!e)for(var r=0;r<this.childWidgets.length;r++){var n=this.childWidgets[r].clone();t.childWidgets.push(n),n.containerWidget=t,n.index=r}return t.x=this.x,t.y=this.y,t.height=this.height,t.width=this.width,t.isBidiTable=this.isBidiTable,t.isGridUpdated=this.isGridUpdated,t.containerWidget=this.containerWidget,this.contentControlProperties&&(t.contentControlProperties=this.contentControlProperties),t},i.getTableOf=function(e){if(e instanceof Us){var r=tl.getRowOf(e);return t.isNullOrUndefined(r)?e.ownerBase instanceof Bs&&e.ownerBase.ownerBase instanceof i?e.ownerBase.ownerBase:void 0:r.ownerTable}},i.prototype.fitChildToClientArea=function(){var e=this.getContainerWidth();Math.round(e)<Math.round(this.getTableWidth())&&this.fitCellsToClientArea(e);for(var t=0;t<this.childWidgets.length;t++)for(var r=this.childWidgets[t],n=0;n<r.childWidgets.length;n++)for(var o=r.childWidgets[n],a=0;a<o.childWidgets.length;a++)o.childWidgets[a]instanceof i&&o.childWidgets[a].fitChildToClientArea()},i.prototype.getColumnCellsForSelection=function(e,t){for(var i=[],r=e.columnIndex,n=t.columnIndex+t.cellFormat.columnSpan,o=0;o<this.childWidgets.length;o++)for(var a=this.childWidgets[o],s=0;s<a.childWidgets.length;s++){var l=a.childWidgets[s],d=l.columnIndex,h=l.cellFormat.columnSpan;d+h>r&&d+h<n||d>r&&d<n?i.indexOf(l)<0&&i.push(l):d>r&&d<n&&d+h<n||d<r&&d+h>n?i.indexOf(l)<0&&i.push(l):d!==r&&d+h!==n||i.indexOf(l)<0&&i.push(l)}return i},i.prototype.splitWidthToTableCells=function(e,t){for(var i=0;i<this.childWidgets.length;i++)this.childWidgets[i].splitWidthToRowCells(e,t)},i.prototype.insertTableRowsInternal=function(e,t,i,r,n){for(var o=e.length-1;o>=0;o--){var a=e.splice(o,1)[0];if(a.containerWidget=this,r)for(var s=0;s<a.childWidgets.length;s++)a.childWidgets[s].cellFormat.initializeCellBorders();this.childWidgets.splice(t,0,a)}this.updateRowIndex(t),this.isGridUpdated=!1,i&&(this.calculateGrid(!0,n),this.buildTableColumns()),this.isGridUpdated=!0},i.prototype.updateRowIndex=function(e){for(var t=e;t<this.childWidgets.length;t++){var i=this.childWidgets[t];i.index=t;for(var r=0;r<i.childWidgets.length;r++)i.childWidgets[r].index=r,i.childWidgets[r].rowIndex=i.rowIndex;e++}},i.prototype.getCellStartOffset=function(e){var t=0;if(e&&this.tableCellInfo&&this.tableCellInfo.containsKey(e.ownerRow.rowIndex)){var i=this.tableCellInfo.get(e.ownerRow.rowIndex);i.containsKey(e.cellIndex)&&(t=i.get(e.cellIndex))}return t},i.prototype.destroyInternal=function(e){var i=this.height;if(!t.isNullOrUndefined(this.childWidgets)){for(var r=0;r<this.childWidgets.length;r++){var n=void 0;if(n=this.childWidgets[r],t.isNullOrUndefined(n)||n.destroyInternal(e),t.isNullOrUndefined(this.childWidgets))break;r--}this.childWidgets=void 0}t.isNullOrUndefined(this.containerWidget)||(this.containerWidget instanceof Ys&&-1!==this.containerWidget.floatingElements.indexOf(this)&&this.containerWidget.floatingElements.splice(this.containerWidget.floatingElements.indexOf(this),1),t.isNullOrUndefined(this.containerWidget.childWidgets)||(-1!==this.containerWidget.childWidgets.indexOf(this)&&this.containerWidget.childWidgets.splice(this.containerWidget.childWidgets.indexOf(this),1),this.containerWidget.height-=i),this.containerWidget=void 0),this.destroy()},i.prototype.destroy=function(){this.tableFormat=void 0,this.spannedRowCollection&&this.spannedRowCollection.destroy(),this.spannedRowCollection=void 0,this.tableHolder=void 0,this.flags=void 0,this.leftMargin=void 0,this.topMargin=void 0,this.rightMargin=void 0,this.bottomMargin=void 0,this.headerHeight=void 0,this.isDefaultFormatUpdated=void 0,e.prototype.destroy.call(this)},i.prototype.componentDestroy=function(){this.tableFormat&&this.tableFormat.destroy(),this.tableFormat=void 0,this.spannedRowCollection&&this.spannedRowCollection.destroy(),this.spannedRowCollection=void 0,this.tableHolder&&this.tableHolder.destroy(),this.tableHolder=void 0,this.flags=void 0,this.leftMargin=void 0,this.topMargin=void 0,this.rightMargin=void 0,this.bottomMargin=void 0,this.headerHeight=void 0,this.isDefaultFormatUpdated=void 0,e.prototype.componentDestroy.call(this)},i}(Js),tl=function(e){function i(){var t=e.call(this)||this;return t.isRenderBookmarkEnd=!1,t.topBorderWidth=0,t.bottomBorderWidth=0,t.rowFormat=new W(t),t.editRangeID=new p,t}return Ds(i,e),Object.defineProperty(i.prototype,"rowIndex",{get:function(){return this.containerWidget?this.containerWidget.childWidgets.indexOf(this):-1},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ownerTable",{get:function(){if(this.containerWidget instanceof el)return this.containerWidget},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"nextRow",{get:function(){var e=this.indexInOwner;if(e>-1&&e<this.ownerTable.childWidgets.length-1)return this.ownerTable.childWidgets[e+1]},enumerable:!0,configurable:!0}),i.prototype.equals=function(e){return e instanceof i&&e.rowFormat===this.rowFormat},i.prototype.combineCells=function(e){for(var i=0;i<this.childWidgets.length;i++){var r=this.childWidgets[i];if(r.combineWidget(e),t.isNullOrUndefined(r.cellFormat)||1!==r.cellFormat.rowSpan)t.isNullOrUndefined(r.cellFormat)&&i--;else{r.height,r.margin.top,r.margin.bottom;this.height-this.ownerTable.tableFormat.cellSpacing<r.height&&(this.height=this.ownerTable.tableFormat.cellSpacing+r.height)}}},i.getRowOf=function(e){if(e instanceof Us){var r=il.getCellOf(e);return t.isNullOrUndefined(r)?e.ownerBase instanceof W&&e.ownerBase.ownerBase instanceof i?e.ownerBase.ownerBase:void 0:r.ownerRow}},i.prototype.getCell=function(e,i,r){for(var n=0;n<this.childWidgets.length;n++){var o=this.childWidgets[n];if(o.rowIndex===e&&(t.isNullOrUndefined(r)?o.columnIndex===i:o.cellIndex===r))return o}},i.prototype.getCellUsingColumnIndex=function(e,i){for(var r,n=0;n<this.childWidgets.length;n++)if((r=this.childWidgets[n]).rowIndex===e&&r.columnIndex===i)return r;if(r=this.getCell(e,i),!t.isNullOrUndefined(r))return r},i.prototype.splitWidthToRowCells=function(e,t){for(var i=this.childWidgets,r=e/i.length,n=0;n<i.length;n++)if(t&&0===i[n].cellFormat.preferredWidth)i[n].cellFormat.preferredWidth=r,this.ownerTable.isDefaultFormatUpdated=!1;else{if(t){this.ownerTable.isDefaultFormatUpdated=!0;break}i[n].cellFormat.preferredWidth=r}},i.prototype.getGridCount=function(e,i,r,n,o){var a=0,s=0,l=this.ownerTable,d=this.rowFormat;-1===r?s=l.getCellWidth(d.gridBeforeWidth,d.gridBeforeWidthType,n,null):(a+=l.getCellWidth(d.gridBeforeWidth,d.gridBeforeWidthType,n,null),r>=0&&(a+=l.getCellStartOffset(i)),s=r<this.childWidgets.length?l.getCellWidth(i.cellFormat.preferredWidth,i.cellFormat.preferredWidthType,n,null):l.getCellWidth(d.gridAfterWidth,d.gridAfterWidthType,n,null));var h=o[e.indexOf(a)],c=this.getOffsetIndex(e,a),g=parseFloat((s+a).toFixed(2));return(parseFloat((s+h).toFixed(2))===g||t.isNullOrUndefined(h)?this.getOffsetIndex(e,a+s):this.getOffsetIndex(e,h+s))-c},i.prototype.getOffsetIndex=function(e,t){t=parseFloat(t.toFixed(2));var i=0;if(e.indexOf(t)>=0)i=e.indexOf(t);else{for(var r=0;r<e.length;r++)if(e[r]>t)return r;i=e.length-1}return i},i.prototype.getCellOffset=function(e,t){for(var i=0,r=this.ownerTable,n=0;n<this.childWidgets.length;n++){var o=this.childWidgets[n].cellFormat;if(n===e)break;i+=r.getCellWidth(o.preferredWidth,o.preferredWidthType,t,null)}return i},i.prototype.updateRowBySpannedCells=function(){for(var e=this.getPreviousRowSpannedCells(),t=this.rowIndex,i=0;i<e.length;i++){var r=e[i];r.ownerRow.rowIndex+r.cellFormat.rowSpan-1>=t&&(r.cellFormat.rowSpan-=1)}},i.prototype.getPreviousRowSpannedCells=function(e){for(var i=[],r=e?this:this.previousWidget;!t.isNullOrUndefined(r);){for(var n=0;n<r.childWidgets.length;n++){var o=r.childWidgets[n];o.cellFormat.rowSpan>1&&i.splice(0,0,o)}r=r.previousWidget}return i},i.prototype.isCellsHaveSameWidthUnit=function(){if(this.childWidgets.length>0)for(var e=this.childWidgets[0].cellFormat.preferredWidthType,t=1;t<this.childWidgets.length;t++)if(e!=this.childWidgets[t].cellFormat.preferredWidthType)return!1;return!0},i.prototype.updateUniformWidthUnitForCells=function(){var e=!1;this.ownerTable&&this.ownerTable.tableHolder&&this.ownerTable.tableHolder.columns&&this.childWidgets.length!==this.ownerTable.tableHolder.columns.length&&this.ownerTable.tableFormat.allowAutoFit&&(e=!0);for(var t=0;t<this.childWidgets.length;t++){var i=this.childWidgets[t];"Point"!==i.cellFormat.preferredWidthType&&("Auto"===i.cellFormat.preferredWidthType&&(i.cellFormat.cellWidth=i.cellFormat.initialCellWidth),i.cellFormat.preferredWidthType="Point",i.cellFormat.preferredWidth=e?i.getMinimumPreferredWidth():i.cellFormat.cellWidth)}},i.prototype.getTableCellWidget=function(e){for(var i=this.ownerTable.isBidiTable,r=t.isNullOrUndefined(this.bodyWidget)||t.isNullOrUndefined(this.bodyWidget.page)||t.isNullOrUndefined(this.bodyWidget.page.documentHelper)?0:this.bodyWidget.page.documentHelper.resizerBoundaryWidth,n=0;n<this.childWidgets.length;n++){var o=Math.round(this.childWidgets[n].x)-r;if(o-this.childWidgets[n].margin.left-1<=e.x&&(i?o+this.childWidgets[n].width+this.childWidgets[n].margin.left+this.childWidgets[n].margin.right>=e.x:o+this.childWidgets[n].width>=e.x))return this.childWidgets[n];if(n===this.childWidgets.length-1&&this.childWidgets[n].x+this.childWidgets[n].width+1<=e.x)return this.childWidgets[n]}var a=void 0;return this.childWidgets.length>0&&(a=this.childWidgets[0].x<=e.x?this.childWidgets[this.childWidgets.length-1].getTableCellWidget(e):this.childWidgets[0].getTableCellWidget(e)),a},i.prototype.getFirstRowWidth=function(){for(var e=0,t=0;t<this.childWidgets.length;t++)e+=this.childWidgets[t].getCellWidth(this.ownerTable);return e},i.prototype.getCellWidget=function(e,t){var i=this.ownerTable.tableHolder.getValidColumnIndex(e);i>e&&(t-=i-e,e=i);var r=0;this.rowFormat.gridBefore>0&&(r+=this.rowFormat.gridBefore);for(var n=0;n<this.childWidgets.length;n++){var o=this.childWidgets[n],a=o.cellFormat.columnSpan;if(r<o.columnIndex&&(r<=e||r<e+t)&&o.columnIndex>e)return null;if((o.columnIndex<=e||o.columnIndex<e+t)&&o.columnIndex+a>e)return o;if(o.columnIndex>e)break;r+=a}return null},i.prototype.getVerticalMergeStartCell=function(e,i){var r=this.ownerTable.tableHolder.columns;if(this.rowFormat.gridBefore>0&&this.rowFormat.gridBefore>e+i)return null;var n=this.getCellWidget(e,i);if(!t.isNullOrUndefined(n))return n;if(e+this.rowFormat.gridAfter===r.length)return null;var o,a=this.previousWidget;return t.isNullOrUndefined(a)||(o=a.getVerticalMergeStartCell(e,i)),!t.isNullOrUndefined(o)&&o.cellFormat.rowSpan>1&&this.index===o.rowIndex+o.cellFormat.rowSpan-1?o:null},i.prototype.getMinimumAndMaximumWordWidth=function(e,t,i){return void 0===i&&(i=0),{minimumWordWidth:e,maximumWordWidth:t,maxParaWidth:i}},i.prototype.destroyInternal=function(e){var i=this.height;if(!t.isNullOrUndefined(this.childWidgets)){for(var r=0;r<this.childWidgets.length&&(this.childWidgets[r].destroyInternal(e),!t.isNullOrUndefined(this.childWidgets));r++)r--;this.childWidgets=void 0}t.isNullOrUndefined(this.containerWidget)||t.isNullOrUndefined(this.containerWidget.childWidgets)||(this.containerWidget.childWidgets.splice(this.containerWidget.childWidgets.indexOf(this),1),(t.isNullOrUndefined(this.containerWidget.childWidgets)||0===this.containerWidget.childWidgets.length)&&this.containerWidget instanceof el?this.containerWidget.destroyInternal(e):this.containerWidget.containerWidget instanceof Ys&&(this.containerWidget.containerWidget.height-=i),this.containerWidget.height-=i),this.destroy()},i.prototype.clone=function(e){var t=new i;t.rowFormat.copyFormat(this.rowFormat),t.topBorderWidth=this.topBorderWidth,t.bottomBorderWidth=this.bottomBorderWidth,t.isRenderBookmarkEnd=this.isRenderBookmarkEnd;for(var r=0;r<this.childWidgets.length;r++){var n=this.childWidgets[r].clone(e);t.childWidgets.push(n),n.containerWidget=t,n.index=r,n.rowIndex=this.rowIndex}return t.x=this.x,t.y=this.y,t.height=this.height,t.width=this.width,this.contentControlProperties&&(t.contentControlProperties=this.contentControlProperties),t},i.prototype.updateChildWidgetLeft=function(e,t){var i=0;this.ownerTable.tableFormat.cellSpacing>0&&(i=this.ownerTable.tableFormat.cellSpacing);for(var r=0;r<this.childWidgets.length;r++){var n=this.childWidgets[r];e+=i+n.margin.left,n.x=e,n.updateChildWidgetLeft(n.x),e+=n.width+n.margin.right}},i.prototype.shiftWidgetForRtlTable=function(){var e=this.ownerTable,i=e.x,r=0,n=0;null!=e.tableFormat&&e.tableFormat.cellSpacing>0&&(r=e.tableFormat.cellSpacing);for(var o=i+(n=bs.convertPointToPixel(e.getTableWidth()))-(this.x-i),a=0,s=0;s<this.childWidgets.length;s++){var l=this.childWidgets[s],d=0;t.isNullOrUndefined(l.previousWidget)||(d=l.previousWidget.columnIndex+l.previousWidget.cellFormat.columnSpan),d<l.columnIndex&&(a+=bs.convertPointToPixel(l.ownerTable.tableHolder.getPreviousSpannedCellWidth(d,l.columnIndex)),0===d&&(a-=r/2)),o-=l.width+l.margin.left+l.margin.right+r,l.updateWidgetLeft(o+l.margin.left-a)}},i.prototype.destroy=function(){this.rowFormat=void 0,this.topBorderWidth=void 0,this.bottomBorderWidth=void 0,e.prototype.destroy.call(this)},i.prototype.componentDestroy=function(){this.rowFormat&&this.rowFormat.destroy(),this.rowFormat=void 0,this.topBorderWidth=void 0,this.bottomBorderWidth=void 0,this.isRenderBookmarkEnd=void 0,e.prototype.componentDestroy.call(this)},i}(Js),il=function(e){function i(){var t=e.call(this)||this;return t.rowIndex=-1,t.sizeInfoInternal=new td,t.updatedTopBorders=[],t.isRenderBookmarkStart=!1,t.isRenderBookmarkEnd=!1,t.isRenderEditRangeStart=!1,t.isRenderEditRangeEnd=!1,t.isSplittedCell=!1,t.margin=new js(t.leftMargin,t.topMargin,t.rightMargin,t.bottomMargin),t.leftBorderWidth=0,t.rightBorderWidth=0,t.cellFormat=new x(t),t}return Ds(i,e),Object.defineProperty(i.prototype,"ownerColumn",{get:function(){return this.ownerTable.tableHolder.columns[this.columnIndex]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"leftMargin",{get:function(){return this.cellFormat&&this.cellFormat.hasValue("leftMargin")?this.cellFormat.leftMargin:!t.isNullOrUndefined(this.ownerRow)&&this.ownerRow.rowFormat.hasValue("leftMargin")?this.ownerRow.rowFormat.leftMargin:t.isNullOrUndefined(this.ownerTable)||t.isNullOrUndefined(this.ownerTable.tableFormat)||!this.ownerTable.tableFormat.hasValue("leftMargin")?0:this.ownerTable.tableFormat.leftMargin},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"topMargin",{get:function(){return this.cellFormat&&this.cellFormat.hasValue("topMargin")?this.cellFormat.topMargin:!t.isNullOrUndefined(this.ownerRow)&&this.ownerRow.rowFormat.hasValue("topMargin")?this.ownerRow.rowFormat.topMargin:t.isNullOrUndefined(this.ownerTable)||t.isNullOrUndefined(this.ownerTable.tableFormat)||!this.ownerTable.tableFormat.hasValue("topMargin")?0:this.ownerTable.tableFormat.topMargin},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"rightMargin",{get:function(){return this.cellFormat&&this.cellFormat.hasValue("rightMargin")?this.cellFormat.rightMargin:!t.isNullOrUndefined(this.ownerRow)&&this.ownerRow.rowFormat.hasValue("rightMargin")?this.ownerRow.rowFormat.rightMargin:t.isNullOrUndefined(this.ownerTable)||t.isNullOrUndefined(this.ownerTable.tableFormat)||!this.ownerTable.tableFormat.hasValue("rightMargin")?0:this.ownerTable.tableFormat.rightMargin},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"bottomMargin",{get:function(){return this.cellFormat&&this.cellFormat.hasValue("bottomMargin")?this.cellFormat.bottomMargin:!t.isNullOrUndefined(this.ownerRow)&&this.ownerRow.rowFormat.hasValue("bottomMargin")?this.ownerRow.rowFormat.bottomMargin:t.isNullOrUndefined(this.ownerTable)||t.isNullOrUndefined(this.ownerTable.tableFormat)||!this.ownerTable.tableFormat.hasValue("bottomMargin")?0:this.ownerTable.tableFormat.bottomMargin},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"cellIndex",{get:function(){return this.ownerRow?this.ownerRow.childWidgets.indexOf(this):-1},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ownerTable",{get:function(){if(this.containerWidget instanceof tl)return this.containerWidget.ownerTable},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ownerRow",{get:function(){return this.containerWidget},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"sizeInfo",{get:function(){return this.sizeInfoInternal},enumerable:!0,configurable:!0}),i.prototype.equals=function(e){return e instanceof i&&e.cellFormat===this.cellFormat},i.prototype.getContainerTable=function(){for(var e=this.ownerTable;e instanceof el&&e.associatedCell instanceof i;)e=e.associatedCell.getContainerTable();return e},i.prototype.getPreviousSplitWidget=function(){if(this.containerWidget instanceof tl){var e=this.containerWidget;do{if(e=e.previousRenderedWidget,t.isNullOrUndefined(e)||e.index<this.rowIndex)break;var i=e.getCell(this.rowIndex,this.columnIndex);if(i&&this.equals(i))return i}while(e)}},i.prototype.isEmpty=function(){if(this.childWidgets.length>1)return!1;var e=this.childWidgets[0];return e instanceof Qs&&e.isEmpty()},i.prototype.getNextSplitWidget=function(){var e=this.cellFormat.rowSpan;if(this.containerWidget instanceof tl){var i=this.containerWidget;do{if(i=i.nextRenderedWidget,t.isNullOrUndefined(i)||i.index>this.rowIndex+e)break;var r=i.getCell(this.rowIndex,this.columnIndex);if(r&&this.equals(r))return r}while(i)}},i.prototype.getTableCellWidget=function(e){for(var t=0;t<this.childWidgets.length;t++)if(this.childWidgets[t].y<=e.y&&this.childWidgets[t].y+this.childWidgets[t].height>=e.y)return this.childWidgets[t].getTableCellWidget(e);var i=void 0;return this.childWidgets.length>0&&(i=this.childWidgets[0].y<=e.y?this.childWidgets[this.childWidgets.length-1].getTableCellWidget(e):this.childWidgets[0].getTableCellWidget(e)),i},i.prototype.updateWidth=function(e){"Point"===this.cellFormat.preferredWidthType?this.cellFormat.preferredWidth=e:"Percent"===this.cellFormat.preferredWidthType&&(this.cellFormat.preferredWidth=this.convertPointToPercent(e)),this.cellFormat.cellWidth=e},i.prototype.getCellWidth=function(e){var i=this.ownerTable,r=i?i.getTableClientWidth(i.getOwnerWidth(!0)):0,n=r,o=t.isNullOrUndefined(this.leftMargin)?0:this.leftMargin,a=t.isNullOrUndefined(this.rightMargin)?0:this.rightMargin;return i&&"Auto"===i.tableFormat.preferredWidthType&&i.tableFormat.allowAutoFit?0===this.cellFormat.preferredWidth?n=r:"Percent"===this.cellFormat.preferredWidthType?n=this.cellFormat.preferredWidth*r/100-o-a:r<(n=this.cellFormat.preferredWidth-o-a)&&(n=r):"Percent"===this.cellFormat.preferredWidthType?n=this.cellFormat.preferredWidth*r/100-o-a:"Point"===this.cellFormat.preferredWidthType?n=e instanceof el&&"Percent"===e.tableFormat.preferredWidthType?this.cellFormat.cellWidth-o-a:this.cellFormat.preferredWidth-o-a:!t.isNullOrUndefined(i)&&"Percent"===i.tableFormat.preferredWidthType&&i.tableFormat.allowAutoFit&&"Auto"===this.cellFormat.preferredWidthType&&e instanceof el&&"Percent"===e.tableFormat.preferredWidthType&&e.tableFormat.allowAutoFit&&(n=this.cellFormat.cellWidth-o-a),n},i.prototype.convertPointToPercent=function(e){var t=0,i=this.ownerTable.getOwnerWidth(!0);return t=e/this.ownerTable.getTableClientWidth(i)*100,t=Math.round(t),t<100?t:100},i.getCellLeftBorder=function(e){var i=void 0,r=e.cellFormat.borders,n=t.isNullOrUndefined(e.ownerRow)?void 0:e.ownerRow.rowFormat.borders,o=t.isNullOrUndefined(e.ownerTable)?void 0:e.ownerTable.tableFormat.borders;if(t.isNullOrUndefined(r.left)||(i=r.left),t.isNullOrUndefined(i)&&(i=e.getLeftBorderToRenderByHierarchy(i,n,o)),e.ownerTable.tableFormat.cellSpacing>0)i=e.getLeftBorderToRenderByHierarchy(i,n,o);else{var a=this.getPreviousCell(e);i=e.getPreviousCellLeftBorder(i,a)}return t.isNullOrUndefined(i)&&(i=new m(e.cellFormat.borders)),i},i.getPreviousCell=function(e){var i=void 0;if(!t.isNullOrUndefined(e.previousWidget)){var r=e.previousWidget;r.columnIndex+r.cellFormat.columnSpan===e.columnIndex&&(i=r)}return i},i.prototype.getLeftBorderWidth=function(){var e=0;return null!==this.cellFormat&&null!==this.cellFormat.borders&&(e=i.getCellLeftBorder(this).getLineWidth()),e},i.prototype.getRightBorderWidth=function(){var e=0;this.ownerTable;return null!==this.cellFormat&&null!==this.cellFormat.borders&&(e=i.getCellRightBorder(this).getLineWidth()),e},i.prototype.getCellSpacing=function(){var e=this.ownerTable&&this.ownerTable.tableFormat?this.ownerTable.tableFormat.cellSpacing:0;return 1===this.ownerRow.childWidgets.length?2*e:0===this.cellIndex||this.cellIndex===this.ownerRow.childWidgets.length-1?e+e/2:e},i.prototype.getCellSizeInfo=function(e){var i=!0,r=void 0;if(t.isNullOrUndefined(this.bodyWidget)||t.isNullOrUndefined(this.bodyWidget.page)||t.isNullOrUndefined(this.bodyWidget.page.documentHelper)||(r=this.bodyWidget.page.documentHelper.layout),t.isNullOrUndefined(r)||t.isNullOrUndefined(r.currentCell)||(i=!1,this===r.currentCell&&(i=!0)),i&&!this.sizeInfo.hasMinimumWidth&&(this.sizeInfo.minimumWidth=this.getMinimumPreferredWidth()),e&&i&&!this.sizeInfo.hasMinimumWordWidth){var n=this.getMinimumAndMaximumWordWidth(0,0);this.sizeInfo.minimumWordWidth=n.minimumWordWidth+this.sizeInfo.minimumWidth,this.sizeInfo.maximumWordWidth=n.maximumWordWidth+this.sizeInfo.minimumWidth,this.sizeInfo.maxParaWidth=n.maxParaWidth+this.sizeInfo.minimumWidth,"Point"===this.cellFormat.preferredWidthType&&this.cellFormat.preferredWidth>0&&this.sizeInfo.minimumWordWidth>this.cellFormat.preferredWidth&&this.childWidgets.some(function(e){return e instanceof el})&&bs.round(n.minimumWordWidth+this.leftMargin+this.rightMargin,2)===bs.round(this.cellFormat.preferredWidth,2)&&(this.sizeInfo.minimumWordWidth-=this.getLeftBorderWidth()+this.getRightBorderWidth())}var o=new td;return o.minimumWidth=this.sizeInfo.minimumWidth,o.minimumWordWidth=this.sizeInfo.minimumWordWidth,o.maximumWordWidth=this.sizeInfo.maximumWordWidth,o.maxParaWidth=this.sizeInfo.maxParaWidth,o},i.prototype.getMinimumPreferredWidth=function(){return this.leftMargin+this.rightMargin+this.getLeftBorderWidth()+this.getRightBorderWidth()+this.getCellSpacing()},i.prototype.getPreviousCellLeftBorder=function(e,i){var r=!1;if((t.isNullOrUndefined(i)||!t.isNullOrUndefined(e)&&"None"===e.lineStyle&&!e.hasNoneStyle)&&(t.isNullOrUndefined(e)||e.ownerBase.ownerBase instanceof Bs||(e=this.getLeftBorderToRenderByHierarchy(e,tl.getRowOf(e.ownerBase).rowFormat.borders,el.getTableOf(e.ownerBase).tableFormat.borders),r=!0)),t.isNullOrUndefined(i))return e;var n=void 0;return t.isNullOrUndefined(i.cellFormat.borders)||t.isNullOrUndefined(i.cellFormat.borders.right)||"None"===i.cellFormat.borders.right.lineStyle||(n=i.cellFormat.borders.right),t.isNullOrUndefined(n)||"None"===n.lineStyle?t.isNullOrUndefined(e)||e.ownerBase.ownerBase instanceof Bs||r?e:this.getLeftBorderToRenderByHierarchy(e,tl.getRowOf(e.ownerBase).rowFormat.borders,el.getTableOf(e.ownerBase).tableFormat.borders):this.getBorderBasedOnPriority(n,e)},i.prototype.getBorderBasedOnPriority=function(e,i){if(t.isNullOrUndefined(e))return i;if(t.isNullOrUndefined(i))return e;var r=e.getBorderWeight(),n=i.getBorderWeight();if(r===n){var o=e.getPrecedence(),a=i.getPrecedence();if(o===a){var s=bs.convertHexToRgb(e.color),l=s.r,d=s.g,h=s.b,c=bs.convertHexToRgb(i.color),g=c.r,p=c.g,u=c.b,f=l+h+2*d,m=g+u+2*p;return f===m?(f=h+2*d,m=u+2*p,f===m?d===p?e:d>p?i:e:f>m?i:e):f>m?i:e}return o>a?e:i}return r>n?e:i},i.prototype.getLeftBorderToRenderByHierarchy=function(e,r,n){var o=i.getCellOf(e.ownerBase);if(!t.isNullOrUndefined(o)){var a=!1;(0===o.columnIndex||0===o.cellIndex&&o.ownerRow.rowFormat.gridBefore>0)&&(a=!0);var s=!1,l=!1;a&&!t.isNullOrUndefined(r.left)?l=r.left.hasNoneStyle:a||t.isNullOrUndefined(r.vertical)||(l=r.vertical.hasNoneStyle),t.isNullOrUndefined(r.left)||"None"===r.left.lineStyle||!r.left.isBorderDefined||l||t.isNullOrUndefined(e)||"None"!==e.lineStyle||!e.isBorderDefined||e.hasValue("color")||(s=!0),(!t.isNullOrUndefined(e)&&"None"===e.lineStyle&&(!e.isBorderDefined&&!l||s)||t.isNullOrUndefined(e))&&(a?(e=r.left,(!t.isNullOrUndefined(e)&&"None"===e.lineStyle||t.isNullOrUndefined(e))&&(e=n.left)):(e=r.vertical,(!t.isNullOrUndefined(e)&&"None"===e.lineStyle||t.isNullOrUndefined(e))&&(e=n.vertical)))}return e},i.getCellRightBorder=function(e){var i=void 0,r=e.cellFormat.borders,n=t.isNullOrUndefined(e.ownerRow)?void 0:e.ownerRow.rowFormat.borders,o=t.isNullOrUndefined(e.ownerTable)?void 0:e.ownerTable.tableFormat.borders;if(t.isNullOrUndefined(r.right)||(i=r.right),t.isNullOrUndefined(i)&&(i=e.getRightBorderToRenderByHierarchy(i,n,o)),e.ownerTable.tableFormat.cellSpacing>0)i=e.getRightBorderToRenderByHierarchy(i,n,o);else{var a=this.getNextCell(e);i=e.getAdjacentCellRightBorder(i,a)}return t.isNullOrUndefined(i)&&(i=new m(e.cellFormat.borders)),i},i.getNextCell=function(e){var i=void 0,r=e.cellFormat.columnSpan;if(!t.isNullOrUndefined(e.nextWidget)){var n=e.nextWidget;e.columnIndex+r===n.columnIndex&&(i=n)}return i},i.prototype.getAdjacentCellRightBorder=function(e,i){var r=!1;if((t.isNullOrUndefined(i)||!t.isNullOrUndefined(e)&&"None"===e.lineStyle&&!e.hasNoneStyle)&&(t.isNullOrUndefined(e)||e.ownerBase.ownerBase instanceof Bs||(e=this.getRightBorderToRenderByHierarchy(e,tl.getRowOf(e.ownerBase).rowFormat.borders,el.getTableOf(e.ownerBase).tableFormat.borders),r=!0)),t.isNullOrUndefined(i))return e;var n=void 0;return t.isNullOrUndefined(i.cellFormat.borders)||t.isNullOrUndefined(i.cellFormat.borders.left)||"None"===i.cellFormat.borders.left.lineStyle||(n=i.cellFormat.borders.left),t.isNullOrUndefined(n)||"None"===n.lineStyle?t.isNullOrUndefined(e)||e.ownerBase.ownerBase instanceof Bs||r?e:this.getRightBorderToRenderByHierarchy(e,tl.getRowOf(e.ownerBase).rowFormat.borders,el.getTableOf(e.ownerBase).tableFormat.borders):this.getBorderBasedOnPriority(e,n)},i.prototype.getRightBorderToRenderByHierarchy=function(e,r,n){var o=i.getCellOf(e.ownerBase);if(!t.isNullOrUndefined(o)){var a=!1;(o.columnIndex+o.cellFormat.columnSpan===o.ownerTable.tableHolder.columns.length||o.cellIndex===o.ownerRow.childWidgets.length-1&&o.ownerRow.rowFormat.gridAfter>0&&o.columnIndex+o.cellFormat.columnSpan+o.ownerRow.rowFormat.gridAfter===o.ownerTable.tableHolder.columns.length)&&(a=!0);var s=!1,l=!1;a&&!t.isNullOrUndefined(r.right)?l=r.right.hasNoneStyle:a||t.isNullOrUndefined(r.vertical)||(l=r.vertical.hasNoneStyle),t.isNullOrUndefined(r.right)||"None"===r.right.lineStyle||!r.right.isBorderDefined||l||t.isNullOrUndefined(e)||"None"!==e.lineStyle||!e.isBorderDefined||e.hasValue("color")||(s=!0),(!t.isNullOrUndefined(e)&&"None"===e.lineStyle&&(!e.isBorderDefined&&!l||s)||t.isNullOrUndefined(e))&&(a?(e=r.right,(!t.isNullOrUndefined(e)&&"None"===e.lineStyle||t.isNullOrUndefined(e))&&(e=n.right)):(e=r.vertical,(!t.isNullOrUndefined(e)&&"None"===e.lineStyle||t.isNullOrUndefined(e))&&(e=n.vertical)))}return e},i.getCellTopBorder=function(e){var i=void 0,r=e.cellFormat.borders,n=t.isNullOrUndefined(e.ownerRow)?void 0:e.ownerRow.rowFormat.borders,o=t.isNullOrUndefined(e.ownerTable)?void 0:e.ownerTable.tableFormat.borders;if(t.isNullOrUndefined(r.top)||(i=r.top),t.isNullOrUndefined(i)&&(i=e.getTopBorderToRenderByHierarchy(i,n,o)),e.ownerTable.tableFormat.cellSpacing>0)i=e.getTopBorderToRenderByHierarchy(i,n,o);else{var a=e.getTopAdjacentCell();i=e.getPreviousCellTopBorder(i,a)}return t.isNullOrUndefined(i)&&(i=new m(e.cellFormat.borders)),i},i.prototype.getTopAdjacentCell=function(){var e=this.ownerRow.previousWidget;this.ownerTable.previousSplitWidget&&this.ownerTable.bodyWidget&&this.ownerTable.bodyWidget.page&&this.ownerTable.bodyWidget.page.repeatHeaderRowTableWidget&&!this.ownerRow.previousWidget&&(e=this.ownerTable.bodyWidget.page.documentHelper.layout.getHeader(this.ownerTable));var i;return t.isNullOrUndefined(e)||(i=e.getVerticalMergeStartCell(this.columnIndex,this.cellFormat.columnSpan)),i},i.prototype.getPreviousCellTopBorder=function(e,i){var r=!1;if((t.isNullOrUndefined(i)||!t.isNullOrUndefined(e)&&"None"===e.lineStyle&&!e.hasNoneStyle)&&(t.isNullOrUndefined(e)||e.ownerBase.ownerBase instanceof Bs||(e=this.getTopBorderToRenderByHierarchy(e,tl.getRowOf(e.ownerBase).rowFormat.borders,el.getTableOf(e.ownerBase).tableFormat.borders),r=!0)),t.isNullOrUndefined(i))return e;var n=void 0;return t.isNullOrUndefined(i.cellFormat.borders)||t.isNullOrUndefined(i.cellFormat.borders.bottom)||(n=this.getBottomBorderToRenderByHierarchy(i.cellFormat.borders.bottom,i.ownerRow.rowFormat.borders,i.ownerTable.tableFormat.borders)),t.isNullOrUndefined(n)||"None"===n.lineStyle?t.isNullOrUndefined(e)||e.ownerBase.ownerBase instanceof Bs||r?e:this.getTopBorderToRenderByHierarchy(e,tl.getRowOf(e.ownerBase).rowFormat.borders,el.getTableOf(e.ownerBase).tableFormat.borders):this.getBorderBasedOnPriority(e,n)},i.prototype.getTopBorderToRenderByHierarchy=function(e,r,n){var o=i.getCellOf(e.ownerBase);if(!t.isNullOrUndefined(o)){var a=t.isNullOrUndefined(o.ownerRow.previousWidget),s=!1,l=!1;a&&!t.isNullOrUndefined(r.top)?l=r.top.hasNoneStyle:a||t.isNullOrUndefined(r.horizontal)||(l=r.horizontal.hasNoneStyle),t.isNullOrUndefined(r.top)||"None"===r.top.lineStyle||!r.top.isBorderDefined||l||t.isNullOrUndefined(e)||"None"!==e.lineStyle||!e.isBorderDefined||e.hasValue("color")||(s=!0),(!t.isNullOrUndefined(e)&&"None"===e.lineStyle&&(!e.isBorderDefined&&!l||s)||t.isNullOrUndefined(e))&&(a?(e=r.top,(!t.isNullOrUndefined(e)&&"None"===e.lineStyle||t.isNullOrUndefined(e))&&(e=n.top)):(e=r.horizontal,(!t.isNullOrUndefined(e)&&"None"===e.lineStyle||t.isNullOrUndefined(e))&&(e=n.horizontal)))}return e},i.getCellBottomBorder=function(e){var i=void 0,r=e.cellFormat.borders,n=t.isNullOrUndefined(e.ownerRow)?void 0:e.ownerRow.rowFormat.borders,o=t.isNullOrUndefined(e.ownerTable)?void 0:e.ownerTable.tableFormat.borders;if(t.isNullOrUndefined(r.bottom)||(i=r.bottom),t.isNullOrUndefined(i)&&(i=e.getBottomBorderToRenderByHierarchy(i,n,o)),e.ownerTable.tableFormat.cellSpacing>0)i=e.getBottomBorderToRenderByHierarchy(i,n,o);else{var a=void 0,s=void 0,l=e.cellFormat.rowSpan;if(1===l)s=e.ownerRow.nextWidget;else if(l>1){var d=e.containerWidget;do{if(d=d.nextWidget,t.isNullOrUndefined(d))break;if(d.index===e.rowIndex+l){s=d;break}}while(d)}t.isNullOrUndefined(s)||(a=s.getCellWidget(e.columnIndex,e.cellFormat.columnSpan)),i=e.getAdjacentCellBottomBorder(i,a)}return t.isNullOrUndefined(i)&&(i=new m(e.cellFormat.borders)),i},i.prototype.getAdjacentCellBottomBorder=function(e,i){var r=!1;if((t.isNullOrUndefined(i)||!t.isNullOrUndefined(e)&&"None"===e.lineStyle&&!e.hasNoneStyle)&&(t.isNullOrUndefined(e)||e.ownerBase.ownerBase instanceof Bs||(e=this.getBottomBorderToRenderByHierarchy(e,tl.getRowOf(e.ownerBase).rowFormat.borders,el.getTableOf(e.ownerBase).tableFormat.borders),r=!0)),t.isNullOrUndefined(i))return e;var n=void 0;return t.isNullOrUndefined(i.cellFormat.borders)||t.isNullOrUndefined(i.cellFormat.borders.top)||"None"===i.cellFormat.borders.top.lineStyle||(n=i.cellFormat.borders.top),t.isNullOrUndefined(n)||"None"===n.lineStyle?t.isNullOrUndefined(e)||e.ownerBase.ownerBase instanceof Bs||r?e:this.getBottomBorderToRenderByHierarchy(e,tl.getRowOf(e.ownerBase).rowFormat.borders,el.getTableOf(e.ownerBase).tableFormat.borders):this.getBorderBasedOnPriority(e,n)},i.prototype.getBottomBorderToRenderByHierarchy=function(e,r,n){var o=i.getCellOf(e.ownerBase);if(!t.isNullOrUndefined(o)){var a=t.isNullOrUndefined(o.ownerRow.nextWidget),s=!1,l=!1;a&&!t.isNullOrUndefined(r.bottom)?l=r.bottom.hasNoneStyle:a||t.isNullOrUndefined(r.horizontal)||(l=r.horizontal.hasNoneStyle),t.isNullOrUndefined(r.bottom)||"None"===r.bottom.lineStyle||!r.bottom.isBorderDefined||l||t.isNullOrUndefined(e)||"None"!==e.lineStyle||!e.isBorderDefined||e.hasValue("color")||(s=!0),(!t.isNullOrUndefined(e)&&"None"===e.lineStyle&&(!e.isBorderDefined&&!l||s)||t.isNullOrUndefined(e))&&(a?(e=r.bottom,(!t.isNullOrUndefined(e)&&"None"===e.lineStyle||t.isNullOrUndefined(e))&&(e=n.bottom)):(e=r.horizontal,(!t.isNullOrUndefined(e)&&"None"===e.lineStyle||t.isNullOrUndefined(e))&&(e=n.horizontal)))}return e},i.getCellOf=function(e){if(e instanceof Us)return e.ownerBase instanceof x&&e.ownerBase.ownerBase instanceof i?e.ownerBase.ownerBase:void 0},i.prototype.updateWidgetLeft=function(e){this.x=e,this.updateChildWidgetLeft(e)},i.prototype.updateChildWidgetLeft=function(e){for(var t=0;t<this.childWidgets.length;t++){var i=this.childWidgets[t];if(i.x=e,i instanceof Qs){var r=bs.convertPointToPixel(i.leftIndent),n=bs.convertPointToPixel(i.rightIndent);if(i.isInsideTable&&i.associatedCell.ownerTable.isBidiTable&&this.bodyWidget.page.documentHelper.layout.isNeedToUpdateXPositionForEmptyParagraph(i)){var o=i.associatedCell.width,a=this.bodyWidget.page.documentHelper.textHelper.getParagraphMarkWidth(i.characterFormat);i.x+=o-a-r}else i.x=e+(i.bidi?n:r)}if(i instanceof el){var s=i;if(s.updateChildWidgetLeft(e),s.isBidiTable){var l=new zs(s.x,s.y,s.width,s.height);s.shiftWidgetsForRtlTable(l,s)}}}},i.prototype.getMinimumAndMaximumWordWidth=function(e,t,i){void 0===i&&(i=0);for(var r=0;r<this.childWidgets.length;r++){var n=this.childWidgets[r].getMinimumAndMaximumWordWidth(e,t,i);e=n.minimumWordWidth,t=n.maximumWordWidth,i=n.maxParaWidth}return{minimumWordWidth:e,maximumWordWidth:t,maxParaWidth:i}},i.prototype.destroyInternal=function(e){if(!t.isNullOrUndefined(this.childWidgets)){for(var i=0;i<this.childWidgets.length;i++){var r=this.childWidgets[i];r.destroyInternal(e),i--}this.childWidgets=void 0,t.isNullOrUndefined(e.documentHelper)||e.documentHelper.editorProperties.selectedWidgets.containsKey(this)&&e.documentHelper.editorProperties.selectedWidgets.remove(this)}this.destroy()},i.prototype.clone=function(e){var t=new i;t.cellFormat.copyFormat(this.cellFormat);for(var r=0,n=0;n<this.childWidgets.length&&!(e&&r>this.height);n++){var o=this.childWidgets[n].clone();t.childWidgets.push(o),o.containerWidget=t,o.index=n,r+=o.height}return t.leftBorderWidth=this.leftBorderWidth,t.rightBorderWidth=this.rightBorderWidth,t.isRenderBookmarkEnd=this.isRenderBookmarkEnd,t.isRenderBookmarkStart=this.isRenderBookmarkStart,this.margin&&(t.margin=this.margin.clone()),t.columnIndex=this.columnIndex,t.x=this.x,t.y=this.y,t.height=this.height,t.width=this.width,this.contentControlProperties&&(t.contentControlProperties=this.contentControlProperties),t},i.prototype.destroy=function(){this.cellFormat=void 0,this.rowIndex=void 0,this.columnIndex=void 0,this.isSplittedCell=void 0,e.prototype.destroy.call(this)},i.prototype.componentDestroy=function(){this.cellFormat&&this.cellFormat.destroy(),this.cellFormat=void 0,this.contentControlProperties=void 0,this.rowIndex=void 0,this.columnIndex=void 0,this.isRenderBookmarkStart=void 0,this.isRenderBookmarkEnd=void 0,e.prototype.componentDestroy.call(this)},i}(Js),rl=function(){function e(e){this.children=[],this.x=0,this.y=0,this.width=0,this.height=0,this.marginTop=0,this.maxBaseLine=0,this.skipClipImage=!1,this.paragraph=e}return Object.defineProperty(e.prototype,"renderedElements",{get:function(){return t.isNullOrUndefined(this.layoutedElements)?this.children:this.layoutedElements},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"indexInOwner",{get:function(){return this.paragraph&&this.paragraph.childWidgets?this.paragraph.childWidgets.indexOf(this):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextLine",{get:function(){var t=this.paragraph,i=this.indexInOwner;if(i<=t.childWidgets.length-2)return t.childWidgets[i+1];if(t.nextSplitWidget){var r=t.nextSplitWidget.firstChild;if(r instanceof e&&r.paragraph.equals(this.paragraph))return r}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousLine",{get:function(){var t=this.paragraph,i=this.indexInOwner,r=t.previousSplitWidget;if(i>0)return t.childWidgets[i-1];if(r instanceof Qs){var n=r.lastChild;if(n instanceof e&&n.paragraph.equals(this.paragraph))return n}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEndsWithPageBreak",{get:function(){if(this.children.length>0){var e=this.children[this.children.length-1];if(e instanceof hl)return e.isPageBreak;for(var t=this.children.length-1;t>=0;t--)if(this.children[t]instanceof hl)return this.children[t].isPageBreak}return!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEndsWithColumnBreak",{get:function(){if(this.children.length>0){var e=this.children[this.children.length-1];if(e instanceof hl)return e.isColumnBreak}return!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEndsWithLineBreak",{get:function(){if(this.children.length>0){var e=this.children[this.children.length-1];if(e instanceof hl)return"\v"===e.text}return!1},enumerable:!0,configurable:!0}),e.prototype.isFirstLine=function(){var e=this.indexInOwner,t=this.paragraph.previousSplitWidget;return!!(e>-1&&(void 0===t||t instanceof Qs&&(t.isEndsWithColumnBreak||t.isEndsWithPageBreak)))&&0===e},e.prototype.isLastLine=function(){var e=this.indexInOwner;return e>-1&&void 0===this.paragraph.nextSplitWidget&&e===this.paragraph.childWidgets.length-1},e.prototype.getOffset=function(e,i){if(t.isNullOrUndefined(e))return i;for(var r=i,n=e.line,o=0;o<n.children.length;o++){var a=n.children[o];if(e===a)break;a instanceof kl||(r+=a.length)}return r},e.prototype.getEndOffset=function(){for(var e=0,t=0,i=0;i<this.children.length;i++){var r=this.children[i];0!==r.length&&(r instanceof kl||(r.characterFormat.hidden?t+=r.length:((r instanceof hl||r instanceof Jl||r instanceof Ll||r instanceof Il||r instanceof Al||r instanceof ml||r instanceof yl||r instanceof ol&&bs.isLinkedFieldCharacter(r))&&(e=t+r.length),t+=r.length)))}return e},e.prototype.getInline=function(e,i,r,n){t.isNullOrUndefined(r)&&!t.isNullOrUndefined(this.paragraph)&&(r=this.paragraph.bidi);var o=void 0,a=0,s=!1;if(0===this.children.length&&this.previousLine){var l=this.previousLine.children[this.previousLine.children.length-1];if(l instanceof hl&&"\v"===l.text)return o=this.previousLine.children[this.previousLine.children.length-1],i=1,{element:o,index:i}}for(var d=0;d<this.children.length;d++)if(!((o=this.children[d])instanceof kl)){if(!s&&(o instanceof hl||o instanceof Il||o instanceof Pl||o instanceof yl||o instanceof Tl||o instanceof ml||o instanceof Al||o instanceof Ll||o instanceof Jl||o instanceof ol&&bs.isLinkedFieldCharacter(o))&&(s=!0),s&&e<=a+o.length){if(o instanceof hl&&" "===o.text&&0===o.revisionLength&&n){var h=this.getNextTextElement(this,d+1);return o=t.isNullOrUndefined(h)?o:h,i=t.isNullOrUndefined(h)?e-a:0,{element:o,index:i}}return e===o.length&&this.children[d+1]instanceof gl?{element:this.children[d+1],index:i}:(i=e-a,{element:o,index:i})}a+=o.length}return e>a&&(i=t.isNullOrUndefined(o)?e:o.length),{element:o,index:i}},e.prototype.isEndnoteLineWidget=function(){return!t.isNullOrUndefined(this.paragraph.containerWidget)&&this.paragraph.containerWidget.containerWidget instanceof Zs&&"Endnote"===this.paragraph.containerWidget.containerWidget.footNoteType},e.prototype.getNextTextElement=function(e,t){return t<e.children.length-1&&e.children[t]?e.children[t]:null},e.prototype.getHierarchicalIndex=function(e){var i=this;return t.isNullOrUndefined(i.paragraph)||t.isNullOrUndefined(i.paragraph.childWidgets)?e:(e=i.paragraph.childWidgets.indexOf(i)+";"+e,i.paragraph instanceof Js?i.paragraph.getHierarchicalIndex(e):e)},e.prototype.clone=function(){for(var i=new e(void 0),r=0;r<this.children.length;r++){var n=this.children[r].clone();i.children.push(n),n.line=i,n instanceof Tl&&this.updateLineForGroupChildren(n,i)}return i.width=this.width,i.height=this.height,t.isNullOrUndefined(this.margin)||(i.margin=this.margin.clone()),i},e.prototype.updateLineForGroupChildren=function(e,t){for(var i=0;i<e.childWidgets.length;i++){var r=e.childWidgets[i];r.line=t,r instanceof Tl&&this.updateLineForGroupChildren(r,t)}},e.prototype.destroy=function(){if(!t.isNullOrUndefined(this.children)){for(var e=0;e<this.children.length;e++)this.children[e].destroy();this.children=[]}this.children=void 0,this.paragraph&&this.paragraph.removeChild(this.indexInOwner),this.paragraph=void 0,this.x=void 0,this.y=void 0,this.width=void 0},e.prototype.componentDestroy=function(){if(!t.isNullOrUndefined(this.children)){for(var e=0;e<this.children.length;e++)this.children[e].componentDestroy();this.children=[]}this.children=void 0,this.paragraph=void 0,this.layoutedElements=[],this.layoutedElements=void 0,this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0},e}(),nl=function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0,this.isWidthUpdated=!1,this.isWrappedBreak=!1,this.margin=new js(0,0,0,0),this.padding=new js(0,0,0,0),this.characterFormat=void 0,this.isRightToLeft=!1,this.canTrigger=!1,this.isChangeDetected=!1,this.isVisible=!1,this.isSpellChecked=!1,this.isSpellCheckTriggered=!1,this.revisions=[],this.canTrack=!1,this.removedIds=[],this.skipformFieldLength=!1,this.characterRange=void 0,this.currentUser=void 0,this.characterFormat=new S(this),this.margin=new js(0,0,0,0)}return Object.defineProperty(e.prototype,"isPageBreak",{get:function(){return this instanceof hl&&"\f"===this.text},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isColumnBreak",{get:function(){return this instanceof hl&&this.text===String.fromCharCode(14)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isValidNodeForTracking",{get:function(){return!(this instanceof ml||this instanceof Jl||this instanceof Ll||this instanceof Al||this instanceof yl)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCheckBoxElement",{get:function(){var e=this;return e instanceof hl&&!t.isNullOrUndefined(e.text)&&(e.text===String.fromCharCode(9746)||e.text===String.fromCharCode(9745)||e.text===String.fromCharCode(9744))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"revisionLength",{get:function(){return t.isNullOrUndefined(this.revisions)?0:this.revisions.length},enumerable:!0,configurable:!0}),e.prototype.getRevision=function(e){if(!t.isNullOrUndefined(this.revisions))return this.revisions[e]},e.prototype.addRevision=function(e){-1===this.revisions.indexOf(e)&&this.revisions.push(e),e.hasChanges=!0},e.prototype.insertRevisionAt=function(e,t){this.revisions.splice(e,0,t),t.hasChanges=!0},e.prototype.removeRevision=function(e){this.revisions.splice(e,1)[0].hasChanges=!0},e.prototype.getAllRevision=function(){return this.revisions},e.prototype.setRevision=function(e,t){this.revisions&&(this.revisions[e]=t)},e.prototype.clearRevision=function(){this.revisions=[]},e.prototype.linkFieldCharacter=function(e){if(this instanceof ol)if(0===this.fieldType){var i=this;t.isNullOrUndefined(i.fieldEnd)&&(this.linkFieldTraversingForward(this.line,i,i),-1===e.fields.indexOf(i)&&e.fields.push(i),t.isNullOrUndefined(i.formFieldData)||-1!==e.formFields.indexOf(i)||e.layout.isInsertFormField||e.formFields.push(i))}else if(2===this.fieldType){var r=this;t.isNullOrUndefined(r.fieldBegin)&&this.linkFieldTraversingBackwardSeparator(this.line,r,r),t.isNullOrUndefined(r.fieldBegin)||(r.fieldBegin.fieldSeparator=r,t.isNullOrUndefined(r.fieldEnd)&&this.linkFieldTraversingForward(this.line,r.fieldBegin,r)&&(r.fieldEnd=r.fieldBegin.fieldEnd),r.fieldEnd&&(r.fieldEnd.fieldSeparator=r))}else{var n=this;t.isNullOrUndefined(n.fieldBegin)&&this.linkFieldTraversingBackward(this.line,n,n)}},e.prototype.linkFieldTraversingBackward=function(e,i,r){var n=e.children.length-1;e.children.indexOf(r)>-1&&(n=e.children.indexOf(r)-1);for(var o=n;o>=0;o--){var a=e.children[o];if(a instanceof ol)if(0===a.fieldType){if(t.isNullOrUndefined(a.fieldEnd))return i.fieldBegin=a,t.isNullOrUndefined(a.fieldEnd)&&(a.fieldEnd=i),i.fieldSeparator&&t.isNullOrUndefined(i.fieldSeparator.fieldBegin)&&(i.fieldSeparator.fieldBegin=a,t.isNullOrUndefined(a.fieldSeparator)&&(a.fieldSeparator=i.fieldSeparator)),!t.isNullOrUndefined(i.fieldBegin)}else 2===a.fieldType&&t.isNullOrUndefined(a.fieldEnd)&&(i.fieldSeparator=a,a.fieldEnd=i,t.isNullOrUndefined(a.fieldBegin)||(i.fieldBegin=a.fieldBegin,i&&t.isNullOrUndefined(i.fieldBegin.fieldEnd)&&(i.fieldBegin.fieldEnd=i)))}if(e.previousLine)this.linkFieldTraversingBackward(e.previousLine,i,this);else if(e.paragraph.previousRenderedWidget instanceof Qs&&e.paragraph.previousRenderedWidget.childWidgets.length>0){var s=e.paragraph.previousRenderedWidget;this.linkFieldTraversingBackward(s.childWidgets[s.childWidgets.length-1],i,this)}return!0},e.prototype.linkFieldTraversingForward=function(e,i,r,n){var o=0;t.isNullOrUndefined(n)&&(n=0),e.children.indexOf(r)>-1&&(o=e.children.indexOf(r)+1);for(var a=o;a<e.children.length;a++){var s=e.children[a];if(s instanceof ol){if(0===s.fieldType&&n++,1===s.fieldType){if(0!==n){n--;continue}return t.isNullOrUndefined(s.fieldBegin)&&(i.fieldEnd=s),i.fieldEnd&&t.isNullOrUndefined(i.fieldEnd.fieldBegin)&&(i.fieldEnd.fieldBegin=i),!0}if(t.isNullOrUndefined(i.fieldSeparator)){if(2!==s.fieldType||!t.isNullOrUndefined(s.fieldBegin))return!1;if(i.fieldSeparator=s,i.fieldSeparator&&t.isNullOrUndefined(i.fieldSeparator.fieldBegin)&&(i.fieldSeparator.fieldBegin=i),!t.isNullOrUndefined(s.fieldEnd))return i.fieldEnd=s.fieldEnd,i.fieldSeparator.fieldEnd=i.fieldEnd,!0}}}if(e.nextLine)this.linkFieldTraversingForward(e.nextLine,i,this,n);else if(e.paragraph.nextRenderedWidget instanceof Qs&&e.paragraph.nextRenderedWidget.childWidgets.length>0)this.linkFieldTraversingForward(e.paragraph.nextRenderedWidget.childWidgets[0],i,this,n);else if(e.paragraph.nextRenderedWidget instanceof el){var l=e.paragraph.nextRenderedWidget;l=l.getSplitWidgets().pop(),!t.isNullOrUndefined(l.nextRenderedWidget)&&l.nextRenderedWidget instanceof Qs&&l.nextRenderedWidget.childWidgets.length>0&&this.linkFieldTraversingForward(l.nextRenderedWidget.childWidgets[0],i,this,n)}return!0},e.prototype.linkFieldTraversingBackwardSeparator=function(e,i,r){var n=e.children.length-1;e.children.indexOf(r)>-1&&(n=e.children.indexOf(r)-1);for(var o=n;o>=0;o--){var a=e.children[o];if(a instanceof ol&&a instanceof ol&&0===a.fieldType)return t.isNullOrUndefined(a.fieldSeparator)&&(i.fieldBegin=a),!t.isNullOrUndefined(i.fieldBegin)}if(e.previousLine)this.linkFieldTraversingBackwardSeparator(e.previousLine,i,this);else{if(!(e.paragraph.previousRenderedWidget instanceof Qs&&e.paragraph.previousRenderedWidget.childWidgets.length>0))return!0;e=e.paragraph.previousRenderedWidget.childWidgets[e.paragraph.previousRenderedWidget.childWidgets.length-1],this.linkFieldTraversingBackwardSeparator(e,i,this)}return!0},Object.defineProperty(e.prototype,"length",{get:function(){return this.getLength()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"indexInOwner",{get:function(){return(this instanceof Pl||this instanceof Tl||this instanceof Il||this instanceof Ul)&&this.containerShape?this.containerShape.childWidgets.indexOf(this):this.line instanceof rl&&this.line.children?this.line.children.indexOf(this):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousElement",{get:function(){var e=this.indexInOwner;return(this instanceof Pl||this instanceof Tl||this instanceof Il||this instanceof Ul)&&this.containerShape?e>0&&e<this.containerShape.childWidgets.length?this.containerShape.childWidgets[e-1]:void 0:e>0&&e<this.line.children.length?this.line.children[e-1]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextElement",{get:function(){var e=this.indexInOwner;return(this instanceof Pl||this instanceof Tl||this instanceof Il||this instanceof Ul)&&this.containerShape?e>-1&&e<this.containerShape.childWidgets.length-1?this.containerShape.childWidgets[e+1]:void 0:e>-1&&e<this.line.children.length-1?this.line.children[e+1]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextNode",{get:function(){if((this instanceof Pl||this instanceof Tl||this instanceof Il||this instanceof Ul)&&this.containerShape)return(e=this.containerShape.childWidgets.indexOf(this))<this.containerShape.childWidgets.length-1?this.containerShape.childWidgets[e+1]:void 0;if(!t.isNullOrUndefined(this.line)&&!t.isNullOrUndefined(this.line.paragraph)){var e=this.line.children.indexOf(this),i=this.line.paragraph.childWidgets.indexOf(this.line);if(e<this.line.children.length-1)return this.line.children[e+1];if(i<this.line.paragraph.childWidgets.length-1){var r=this.line.paragraph.childWidgets[i+1];if(!t.isNullOrUndefined(r)&&!t.isNullOrUndefined(r.children)&&r.children.length>0)return r.children[0]}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextValidNodeForTracking",{get:function(){for(var e=this;!t.isNullOrUndefined(e)&&(e instanceof ml||e instanceof Jl||e instanceof Ll||e instanceof Al);)e=e.nextNode;return e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousValidNodeForTracking",{get:function(){for(var e=this;!t.isNullOrUndefined(e)&&(e instanceof ml||e instanceof Jl||e instanceof Ll||e instanceof Al);)e=e.previousNode;return e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousNode",{get:function(){if((this instanceof Pl||this instanceof Tl||this instanceof Il||this instanceof Ul)&&this.containerShape)return(e=this.containerShape.childWidgets.indexOf(this))>0?this.containerShape.childWidgets[e-1]:void 0;var e=this.line.children.indexOf(this),t=this.line.paragraph.childWidgets.indexOf(this.line);if(e>0)return this.line.children[e-1];if(t>0){var i=this.line.paragraph.childWidgets[t-1];return i.children[i.children.length-1]}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paragraph",{get:function(){if(this.line)return this.line.paragraph},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){if(!t.isNullOrUndefined(this.line)&&this.line.children&&this.line.children.indexOf(this)>-1){var e=this.line.children.indexOf(this);this.line.children.splice(e,1)}this.line=void 0,this.characterFormat&&this.characterFormat.destroy(),this.characterFormat=void 0,this.margin&&this.margin.destroy(),this.margin=void 0,this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0},e.prototype.componentDestroy=function(){this.characterFormat&&this.characterFormat.destroy(),this.characterFormat=void 0,this.margin&&this.margin.destroy(),this.margin=void 0,this.padding&&this.padding.destroy(),this.padding=void 0,this.contentControlProperties=void 0,this.line=void 0,this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0},e.objectCharacter=String.fromCharCode(65532),e}(),ol=function(e){function i(t){var i=e.call(this)||this;return i.fieldType=0,i.fieldCodeType="",i.hasFieldEnd=!1,i.fieldBeginInternal=void 0,i.fieldSeparatorInternal=void 0,i.fieldEndInternal=void 0,i.fieldType=t,i}return Ds(i,e),Object.defineProperty(i.prototype,"fieldBegin",{get:function(){return this.fieldBeginInternal},set:function(e){this.fieldBeginInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fieldSeparator",{get:function(){return this.fieldSeparatorInternal},set:function(e){this.fieldSeparatorInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fieldEnd",{get:function(){return this.fieldEndInternal},set:function(e){this.fieldEndInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"resultText",{get:function(){if(!t.isNullOrUndefined(this.formFieldData)&&0===this.fieldType&&!t.isNullOrUndefined(this.fieldSeparator)&&!t.isNullOrUndefined(this.fieldEnd)){var e=this.fieldSeparator.nextElement,i="";do{if(e instanceof hl&&(i+=e.text),(e=e.nextNode)===this.fieldEnd)break}while(e);return i}},enumerable:!0,configurable:!0}),i.prototype.getLength=function(){return 1},i.prototype.clone=function(){var e=new i(this.fieldType);return 0!==this.fieldType||t.isNullOrUndefined(this.formFieldData)||(e.formFieldData=this.formFieldData.clone()),e.characterFormat.copyFormat(this.characterFormat),this.margin&&(e.margin=this.margin.clone()),e.width=this.width,e.height=this.height,this.revisionLength>0?(e.removedIds=F.cloneRevisions(this.getAllRevision()),this.fieldEnd&&(e.hasFieldEnd=this.hasFieldEnd)):(e.removedIds=this.removedIds.slice(),!t.isNullOrUndefined(this.paragraph)&&this.paragraph.isInHeaderFooter||t.isNullOrUndefined(this.fieldEnd)||t.isNullOrUndefined(this.fieldEnd.paragraph)||this.fieldEnd.paragraph.containerWidget instanceof il||(e.hasFieldEnd=this.hasFieldEnd)),e.fieldCodeType=this.fieldCodeType,e},i.prototype.destroy=function(){this.fieldType=void 0,this.hasFieldEnd=void 0,this.fieldBeginInternal=void 0,this.fieldEndInternal=void 0,this.fieldSeparatorInternal=void 0,e.prototype.destroy.call(this)},i.prototype.componentDestroy=function(){this.formFieldData&&this.formFieldData.destroy(),this.formFieldData=void 0,this.fieldCodeType=void 0,this.fieldBeginInternal=void 0,this.fieldEndInternal=void 0,this.fieldSeparatorInternal=void 0,e.prototype.componentDestroy.call(this)},i}(nl),al=function(){function e(){this.name="",this.enabled=!0,this.helpText="",this.statusText=""}return e.prototype.destroy=function(){this.name=void 0,this.helpText=void 0,this.statusText=void 0},e}(),sl=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="Text",t.maxLength=0,t.defaultValue="",t.format="",t}return Ds(i,e),i.prototype.clone=function(){var e=new i;return e.type=this.type,e.name=this.name,e.enabled=this.enabled,e.helpText=this.helpText,e.statusText=this.statusText,e.maxLength=this.maxLength,e.defaultValue=this.defaultValue,e.format=this.format,e},i.prototype.getFormFieldInfo=function(){return{defaultValue:this.defaultValue,enabled:this.enabled,format:this.format,helpText:this.helpText,maxLength:this.maxLength,type:this.type,name:this.name}},i.prototype.copyFieldInfo=function(e){t.isNullOrUndefined(e.defaultValue)||(this.defaultValue=e.defaultValue),t.isNullOrUndefined(e.enabled)||(this.enabled=e.enabled),t.isNullOrUndefined(e.format)||(this.format=e.format),t.isNullOrUndefined(e.helpText)||(this.helpText=e.helpText),t.isNullOrUndefined(e.maxLength)||(this.maxLength=e.maxLength),t.isNullOrUndefined(e.type)||(this.type=e.type)},i.prototype.destroy=function(){this.format=void 0,this.defaultValue=void 0,e.prototype.destroy.call(this)},i}(al),ll=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.sizeType="Auto",t.size=11,t.defaultValue=!1,t.checked=!1,t}return Ds(i,e),i.prototype.clone=function(){var e=new i;return e.name=this.name,e.enabled=this.enabled,e.helpText=this.helpText,e.statusText=this.statusText,e.sizeType=this.sizeType,e.size=this.size,e.defaultValue=this.defaultValue,e.checked=this.checked,e},i.prototype.getFormFieldInfo=function(){return{defaultValue:this.defaultValue,enabled:this.enabled,helpText:this.helpText,size:this.size,sizeType:this.sizeType,name:this.name}},i.prototype.copyFieldInfo=function(e){t.isNullOrUndefined(e.defaultValue)||(this.defaultValue=e.defaultValue,this.checked=e.defaultValue),t.isNullOrUndefined(e.enabled)||(this.enabled=e.enabled),t.isNullOrUndefined(e.size)||(this.size=e.size),t.isNullOrUndefined(e.helpText)||(this.helpText=e.helpText),t.isNullOrUndefined(e.sizeType)||(this.sizeType=e.sizeType)},i.prototype.destroy=function(){e.prototype.destroy.call(this)},i}(al),dl=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.dropdownItems=[],t.selectedIndex=0,t}return Ds(i,e),i.prototype.clone=function(){var e=new i;return e.name=this.name,e.enabled=this.enabled,e.helpText=this.helpText,e.statusText=this.statusText,e.dropdownItems=this.dropdownItems.slice(),e.selectedIndex=this.selectedIndex,e},i.prototype.getFormFieldInfo=function(){return{dropdownItems:this.dropdownItems.slice(),enabled:this.enabled,helpText:this.helpText,name:this.name}},i.prototype.copyFieldInfo=function(e){t.isNullOrUndefined(e.dropdownItems)||(this.dropdownItems=e.dropdownItems),t.isNullOrUndefined(e.enabled)||(this.enabled=e.enabled),t.isNullOrUndefined(e.helpText)||(this.helpText=e.helpText)},i.prototype.destroy=function(){this.dropdownItems=[],this.dropdownItems=void 0,e.prototype.destroy.call(this)},i}(al),hl=function(i){function r(){var t=i.call(this)||this;return t.baselineOffset=0,t.text="",t.trimEndWidth=0,t.ignoreOnceItems=[],t.istextCombined=!1,t.scriptType=e.FontScriptType.English,t.isCombinedRTLText=!1,t.renderedFontFamily=void 0,t.errorCollection=[],t}return Ds(r,i),r.prototype.getLength=function(){return this.text?this.text.length:0},r.prototype.clone=function(){var e=new r;if(e.characterFormat.copyFormat(this.characterFormat),e.text=this.text,this.margin&&(e.margin=this.margin.clone()),!t.isNullOrUndefined(this.paragraph)&&this.paragraph.isInHeaderFooter){for(var i=0;i<this.ignoreOnceItems.length;i++)e.ignoreOnceItems.push(this.ignoreOnceItems[i]);e.isChangeDetected=this.isChangeDetected}return e.baselineOffset=this.baselineOffset,this.paragraph&&this.paragraph.isInsideTable&&this.paragraph.containerWidget instanceof il&&this.paragraph.containerWidget.ownerRow.rowFormat.isHeader?e.revisions=this.revisions:this.revisionLength>0?e.removedIds=F.cloneRevisions(this.getAllRevision()):e.removedIds=this.removedIds.slice(),e.width=this.width,e.height=this.height,e.errorCollection=this.errorCollection,this.contentControlProperties&&(e.contentControlProperties=this.contentControlProperties),e},r.prototype.destroy=function(){this.text=void 0,i.prototype.destroy.call(this)},r.prototype.componentDestroy=function(){this.text=void 0,i.prototype.componentDestroy.call(this)},r}(nl),cl=function(){function e(){this.separator=[],this.continuationNotice=[],this.continuationSeparator=[]}return e.prototype.clear=function(){if(this.separator){for(e=0;e<this.separator.length;e++)(t=this.separator[e]).destroy();this.separator=[]}if(this.continuationSeparator){for(e=0;e<this.continuationSeparator.length;e++)(t=this.continuationSeparator[e]).destroy();this.continuationSeparator=[]}if(this.continuationNotice){for(var e=0;e<this.continuationNotice.length;e++){var t=this.continuationNotice[e];t.destroy()}this.continuationNotice=[]}},e.prototype.destroy=function(){this.separator=[],this.continuationSeparator=[],this.continuationNotice=[]},e.prototype.componentDestroy=function(){if(this.separator){for(e=0;e<this.separator.length;e++)(t=this.separator[e]).componentDestroy();this.separator=[]}if(this.separator=void 0,this.continuationSeparator){for(e=0;e<this.continuationSeparator.length;e++)(t=this.continuationSeparator[e]).componentDestroy();this.continuationSeparator=[]}if(this.continuationSeparator=void 0,this.continuationNotice){for(var e=0;e<this.continuationNotice.length;e++){var t=this.continuationNotice[e];t.componentDestroy()}this.continuationNotice=[]}this.continuationNotice=void 0},e}(),gl=function(e){function t(){var t=e.call(this)||this;return t.isLayout=!1,t.bodyWidget=new Ys,t.bodyWidget.footNoteReference=t,t}return Ds(t,e),t.prototype.clone=function(){var e=new t;e.text=this.text,e.characterFormat.copyFormat(this.characterFormat),e.height=this.height,e.footnoteType=this.footnoteType,e.width=this.width,e.symbolCode=this.symbolCode;for(var i=0;i<this.bodyWidget.childWidgets.length;i++){var r=this.bodyWidget.childWidgets[i];r instanceof Qs?r=this.bodyWidget.childWidgets[i].clone():r instanceof el&&(r=this.bodyWidget.childWidgets[i].clone()),e.bodyWidget.childWidgets.push(r)}return e.bodyWidget.page=this.bodyWidget.page,this.revisionLength>0?e.removedIds=F.cloneRevisions(this.getAllRevision()):e.removedIds=this.removedIds.slice(),this.margin&&(e.margin=this.margin.clone()),e},t.prototype.getLength=function(){return 1},t.prototype.destroy=function(){this.symbolCode="",this.symbolFontName="",this.customMarker=""},t.prototype.componentDestroy=function(){this.characterFormat&&(this.characterFormat.destroy(),this.characterFormat=void 0),this.symbolCode="",this.symbolFontName="",this.customMarker="",this.bodyWidget&&this.bodyWidget.componentDestroy(),this.bodyWidget=void 0,e.prototype.componentDestroy.call(this)},t}(hl),pl=function(e){function t(){var t=e.call(this)||this;return t.startIn=void 0,t.endIn=void 0,t}return Ds(t,e),Object.defineProperty(t.prototype,"start",{get:function(){return this.startIn},set:function(e){this.startIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"end",{get:function(){return this.endIn},set:function(e){this.endIn=e},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){this.start=void 0,this.end=void 0},t.prototype.componentDestroy=function(){this.startIn&&this.startIn.destroy(),this.startIn=void 0,this.endIn&&this.endIn.destroy(),this.endIn=void 0,e.prototype.componentDestroy.call(this)},t}(hl),ul=function(e){function t(){var t=e.call(this)||this;return t.fieldText="",t.isRtlPageNumber=!1,t}return Ds(t,e),Object.defineProperty(t.prototype,"text",{get:function(){return this.fieldText},set:function(e){this.fieldText=e},enumerable:!0,configurable:!0}),t.prototype.clone=function(){var e=new t;return e.characterFormat.copyFormat(this.characterFormat),e.fieldBegin=this.fieldBegin,e.text=this.text,this.margin&&(e.margin=this.margin.clone()),this.revisionLength>0?e.removedIds=F.cloneRevisions(this.getAllRevision()):e.removedIds=this.removedIds.slice(),e.width=this.width,e.height=this.height,e},t.prototype.componentDestroy=function(){this.fieldText=void 0,this.fieldBegin=void 0,e.prototype.componentDestroy.call(this)},t}(hl),fl=function(e){function t(){var t=e.call(this)||this;return t.tabText="",t.tabLeader="None",t}return Ds(t,e),t.prototype.destroy=function(){this.tabText=void 0,this.tabLeader=void 0},t.prototype.componentDestroy=function(){this.tabText=void 0,this.tabLeader=void 0,e.prototype.componentDestroy.call(this)},t.prototype.clone=function(){var e=new t;return e.characterFormat.copyFormat(this.characterFormat),e.tabText=this.tabText,e.tabLeader=this.tabLeader,e.text=this.text,this.margin&&(e.margin=this.margin.clone()),e.width=this.width,e.height=this.height,this.revisionLength>0?e.removedIds=F.cloneRevisions(this.getAllRevision()):e.removedIds=this.removedIds.slice(),e},t}(hl),ml=function(e){function t(t){var i=e.call(this)||this;return i.bookmarkTypeIn=0,i.refereneceIn=void 0,i.nameIn="",i.bookmarkTypeIn=t,i}return Ds(t,e),Object.defineProperty(t.prototype,"bookmarkType",{get:function(){return this.bookmarkTypeIn},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"properties",{get:function(){return this.propertiesIn},set:function(e){this.propertiesIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.nameIn},set:function(e){this.nameIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"reference",{get:function(){return this.refereneceIn},set:function(e){this.refereneceIn=e},enumerable:!0,configurable:!0}),t.prototype.getLength=function(){return 1},t.prototype.destroy=function(){this.name=void 0,this.reference=void 0,this.bookmarkTypeIn=void 0},t.prototype.componentDestroy=function(){this.name=void 0,this.reference=void 0,this.bookmarkTypeIn=void 0,e.prototype.componentDestroy.call(this)},t.prototype.clone=function(){var e=new t(this.bookmarkType);return e.name=this.name,e.reference=this.reference,e.properties=this.properties,this.margin&&(e.margin=this.margin.clone()),this.revisionLength>0?e.removedIds=F.cloneRevisions(this.getAllRevision()):e.removedIds=this.removedIds.slice(),e.width=this.width,e.height=this.height,this.contentControlProperties&&(e.contentControlProperties=this.contentControlProperties),e},t}(nl),yl=function(e){function t(t){var i=e.call(this)||this;return i.isInsertRevision=!1,i.isDeleteRevision=!1,i.authorName="",i.revDateTime="",i.contentControlWidgetType=t,i.contentControlProperties=new vl(t),i}return Ds(t,e),t.prototype.getLength=function(){return 1},t.prototype.clone=function(){var e=new t(this.contentControlWidgetType);return e.characterFormat.copyFormat(this.characterFormat),e.contentControlProperties=this.contentControlProperties,e.contentControlWidgetType=this.contentControlWidgetType,this.margin&&(e.margin=this.margin.clone()),this.revisionLength>0?e.removedIds=F.cloneRevisions(this.getAllRevision()):e.removedIds=this.removedIds.slice(),e.type=this.type,e.width=this.width,e.height=this.height,e.reference=this.reference,e},t.prototype.destroy=function(){this.contentControlProperties=void 0,this.contentControlWidgetType=void 0,e.prototype.destroy.call(this)},t.prototype.componentDestroy=function(){this.contentControlProperties&&(this.contentControlProperties.destroy(),this.contentControlProperties=void 0),this.contentControlWidgetType=void 0,e.prototype.componentDestroy.call(this)},t}(nl),vl=function(){function e(e){this.contentControlListItems=[],this.contentControlWidgetType=e,this.characterFormat=new S}return e.prototype.destroy=function(){this.characterFormat&&(this.characterFormat.destroy(),this.characterFormat=void 0),this.xmlMapping&&(this.xmlMapping.destroy(),this.xmlMapping=void 0),this.lockContentControl=void 0,this.lockContents=void 0,this.tag=void 0,this.color=void 0,this.title=void 0,this.appearance=void 0,this.type=void 0,this.hasPlaceHolderText=void 0,this.multiline=void 0,this.isTemporary=void 0,this.isChecked=void 0,this.dateCalendarType=void 0,this.dateStorageFormat=void 0,this.dateDisplayLocale=void 0,this.dateDisplayFormat=void 0},e.prototype.clone=function(){var t=new e(this.contentControlWidgetType);if(t.lockContentControl=this.lockContentControl,t.lockContents=this.lockContents,t.tag=this.tag,t.color=this.color,t.title=this.title,t.appearance=this.appearance,t.type=this.type,t.hasPlaceHolderText=this.hasPlaceHolderText,t.multiline=this.multiline,t.isTemporary=this.isTemporary,t.isChecked=this.isChecked,t.dateCalendarType=this.dateCalendarType,t.dateStorageFormat=this.dateStorageFormat,t.dateDisplayLocale=this.dateDisplayLocale,t.dateDisplayFormat=this.dateDisplayFormat,this.contentControlListItems.length>0)for(var i=0;i<this.contentControlListItems.length;i++)t.contentControlListItems.push(this.contentControlListItems[i].clone());return this.checkedState&&(t.checkedState=this.checkedState.clone()),this.uncheckedState&&(t.uncheckedState=this.uncheckedState.clone()),this.xmlMapping&&(t.xmlMapping=this.xmlMapping.clone()),t},e}(),Wl=function(){function e(){}return e.prototype.destroy=function(){this.displayText=void 0,this.value=void 0},e.prototype.clone=function(){var t=new e;return t.displayText=this.displayText,t.value=this.value,t},e}(),bl=function(){function e(){}return e.prototype.destroy=function(){this.font=void 0,this.value=void 0},e.prototype.clone=function(){var t=new e;return t.font=this.font,t.value=this.value,t},e}(),xl=function(){function e(){}return e.prototype.destroy=function(){this.isMapped=void 0,this.isWordMl=void 0,this.prefixMapping=void 0,this.xPath=void 0,this.storeItemId=void 0,this.customXmlPart=void 0},e.prototype.clone=function(){var t=new e;return t.isMapped=this.isMapped,t.isWordMl=this.isWordMl,t.prefixMapping=this.prefixMapping,t.xPath=this.xPath,t.storeItemId=this.storeItemId,this.customXmlPart&&(t.customXmlPart=this.customXmlPart.clone()),t},e}(),wl=function(){function e(){}return e.prototype.destroy=function(){this.id=void 0,this.xml=void 0},e.prototype.clone=function(){var t=new e;return t.id=this.id,t.xml=this.xml,t},e}(),Fl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.name="",t.alternateText="",t.title="",t}return Ds(t,e),t.prototype.getLength=function(){return 1},t.prototype.clone=function(){return this instanceof Tl?new Tl:new Pl},t}(nl),Cl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.topMargin=0,t.leftMargin=0,t.coordinateSize="",t.coordinateXOrigin=0,t.coordinateYOrigin=0,t.is2007Shape=!1,t.lineFromXPosition=0,t.lineFromYPosition=0,t.lineToXPosition=0,t.lineToYPosition=0,t.verticalPosition=0,t.horizontalPosition=0,t.textWrappingStyle="Inline",t.distanceBottom=0,t.distanceLeft=0,t.distanceRight=0,t.distanceTop=0,t}return Ds(t,e),t}(Fl),Pl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ds(t,e),t.prototype.clone=function(){var e=new t;return e.characterFormat.copyFormat(this.characterFormat),e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e.leftMargin=this.leftMargin,e.topMargin=this.topMargin,e.coordinateSize=this.coordinateSize,e.coordinateXOrigin=this.coordinateXOrigin,e.coordinateYOrigin=this.coordinateYOrigin,e.is2007Shape=this.is2007Shape,e.shapeId=this.shapeId,e.name=this.name,e.alternateText=this.alternateText,e.title=this.title,e.widthScale=this.widthScale,e.heightScale=this.heightScale,e.visible=this.visible,e.verticalPosition=this.verticalPosition,e.verticalAlignment=this.verticalAlignment,e.verticalOrigin=this.verticalOrigin,e.verticalRelativePercent=this.verticalRelativePercent,e.horizontalPosition=this.horizontalPosition,e.horizontalAlignment=this.horizontalAlignment,e.horizontalOrigin=this.horizontalOrigin,e.horizontalRelativePercent=this.horizontalRelativePercent,e.heightRelativePercent=this.heightRelativePercent,e.isHorizontalRule=this.isHorizontalRule,e.widthRelativePercent=this.widthRelativePercent,e.zOrderPosition=this.zOrderPosition,e.allowOverlap=this.allowOverlap,e.textWrappingStyle=this.textWrappingStyle,e.textWrappingType=this.textWrappingType,e.distanceBottom=this.distanceBottom,e.distanceLeft=this.distanceLeft,e.distanceRight=this.distanceRight,e.distanceTop=this.distanceTop,e.editingPoints=this.editingPoints,e.layoutInCell=this.layoutInCell,e.lockAnchor=this.lockAnchor,e.autoShapeType=this.autoShapeType,e.shapeX=this.shapeX,e.shapeY=this.shapeY,e.shapeHeight=this.shapeHeight,e.shapeWidth=this.shapeWidth,this.lineFormat&&(e.lineFormat=this.lineFormat.clone()),this.fillFormat&&(e.fillFormat=this.fillFormat.clone()),this.textFrame&&(e.textFrame=this.textFrame.clone(),e.textFrame.containerShape=e),this.margin&&(e.margin=this.margin.clone()),this.revisionLength>0?e.removedIds=F.cloneRevisions(this.getAllRevision()):e.removedIds=this.removedIds.slice(),e},t}(Cl),Tl=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.childWidgets=[],t}return Ds(i,e),i.prototype.clone=function(){var e=new i;if(e.characterFormat.copyFormat(this.characterFormat),e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e.leftMargin=this.leftMargin,e.topMargin=this.topMargin,e.coordinateSize=this.coordinateSize,e.coordinateXOrigin=this.coordinateXOrigin,e.coordinateYOrigin=this.coordinateYOrigin,e.is2007Shape=this.is2007Shape,e.shapeId=this.shapeId,e.name=this.name,e.alternateText=this.alternateText,e.title=this.title,e.widthScale=this.widthScale,e.heightScale=this.heightScale,e.visible=this.visible,e.verticalPosition=this.verticalPosition,e.verticalAlignment=this.verticalAlignment,e.verticalOrigin=this.verticalOrigin,e.verticalRelativePercent=this.verticalRelativePercent,e.horizontalPosition=this.horizontalPosition,e.horizontalAlignment=this.horizontalAlignment,e.horizontalOrigin=this.horizontalOrigin,e.horizontalRelativePercent=this.horizontalRelativePercent,e.heightRelativePercent=this.heightRelativePercent,e.widthRelativePercent=this.widthRelativePercent,e.zOrderPosition=this.zOrderPosition,e.allowOverlap=this.allowOverlap,e.textWrappingStyle=this.textWrappingStyle,e.textWrappingType=this.textWrappingType,e.distanceBottom=this.distanceBottom,e.distanceLeft=this.distanceLeft,e.distanceRight=this.distanceRight,e.distanceTop=this.distanceTop,e.editingPoints=this.editingPoints,e.layoutInCell=this.layoutInCell,e.lockAnchor=this.lockAnchor,e.isZeroHeight=this.isZeroHeight,e.autoShapeType=this.autoShapeType,e.offsetXValue=this.offsetXValue,e.offsetYValue=this.offsetYValue,e.extentXValue=this.extentXValue,e.extentYValue=this.extentYValue,e.shapeX=this.shapeX,e.shapeY=this.shapeY,e.shapeHeight=this.shapeHeight,e.shapeWidth=this.shapeWidth,this.lineFormat&&(e.lineFormat=this.lineFormat.clone()),this.fillFormat&&(e.fillFormat=this.fillFormat.clone()),this.margin&&(e.margin=this.margin.clone()),!t.isNullOrUndefined(this.paragraph)&&this.paragraph.isInHeaderFooter){if(this.revisions.length>0)for(n=0;n<this.revisions.length;n++){var r=this.revisions[n];e.revisions.push(r.clone())}}else this.revisions.length>0?e.removedIds=F.cloneRevisions(this.revisions):e.removedIds=this.removedIds.slice();for(var n=0;n<this.childWidgets.length;n++){var o=this.childWidgets[n];o=o.clone(),t.isNullOrUndefined(o.line)&&(o.line=this.line),o.containerShape=e,e.childWidgets.push(o)}return e},i.prototype.destroy=function(){this.isZeroHeight=void 0,this.autoShapeType=void 0,this.childWidgets=void 0,this.offsetXValue=void 0,this.offsetYValue=void 0,this.extentXValue=void 0,this.extentYValue=void 0,e.prototype.destroy.call(this)},i}(Cl),Ol=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.marginLeft=0,t.marginRight=0,t.marginTop=0,t.marginBottom=0,t}return Ds(t,e),t.prototype.equals=function(){return!1},t.prototype.destroyInternal=function(){},t.prototype.getHierarchicalIndex=function(e){var t=this.containerShape.line,i=t.getOffset(this.containerShape,0).toString();return t.getHierarchicalIndex(i)},t.prototype.getTableCellWidget=function(){},t.prototype.clone=function(){var e=new t;e.textVerticalAlignment=this.textVerticalAlignment,e.marginBottom=this.marginBottom,e.marginLeft=this.marginLeft,e.marginRight=this.marginRight,e.marginTop=this.marginTop;for(var i=0;i<this.childWidgets.length;i++){var r=this.childWidgets[i].clone();e.childWidgets.push(r),r.index=i,r.containerWidget=e}return e},t}(Gs),Sl=function(){function e(){}return e.prototype.clone=function(){var t=new e;return t.lineFormatType=this.lineFormatType,t.color=this.color,t.weight=this.weight,t.dashStyle=this.dashStyle,t.line=this.line,t},e}(),Nl=function(){function e(){}return e.prototype.clone=function(){var t=new e;return t.color=this.color,t.fill=this.fill,t.isDefaultFill=this.isDefaultFill,t.foreColor=this.foreColor,t.fillType=this.fillType,t},e}(),Il=function(e){function i(t){var i=e.call(this)||this;return i.imageStr="",i.imgElement=void 0,i.isInlineImageIn=!0,i.crop=!1,i.left=0,i.top=0,i.right=0,i.bottom=0,i.isMetaFile=!1,i.isCompressed=!1,i.isInlineImageIn=t,i}return Ds(i,e),Object.defineProperty(i.prototype,"isCrop",{get:function(){return this.crop},set:function(e){if(this.crop=e,e){var t=0,i=0;0!==this.left?this.cropX=this.left*this.cropWidthScale/100:this.cropX=0,0!==this.top?this.cropY=this.top*this.cropHeightScale/100:this.cropY=0,0!==this.right&&(t=this.right*this.cropWidthScale/100),0!==this.bottom&&(i=this.bottom*this.cropHeightScale/100),this.cropWidth=this.cropWidthScale-(this.cropX+t),this.cropHeight=this.cropHeightScale-(this.cropY+i)}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isInlineImage",{get:function(){return this.isInlineImageIn},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"element",{get:function(){return t.isNullOrUndefined(this.imgElement)&&(this.imgElement=document.createElement("img")),this.imgElement},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"length",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"imageString",{get:function(){return this.imageStr},set:function(e){this.imageStr=e},enumerable:!0,configurable:!0}),i.prototype.getLength=function(){return 1},i.prototype.clone=function(){var e=new i(this.isInlineImage);return e.characterFormat.copyFormat(this.characterFormat),e.imageString=this.imageString,e.element.src=this.element.src,e.isMetaFile=this.isMetaFile,e.isCompressed=this.isCompressed,e.metaFileImageString=this.metaFileImageString,e.width=this.width,e.height=this.height,e.top=this.top,e.left=this.left,e.bottom=this.bottom,e.right=this.right,e.cropHeightScale=this.cropHeightScale,e.cropWidthScale=this.cropWidthScale,e.cropX=this.cropX,e.cropY=this.cropY,e.isCrop=this.isCrop,e.x=this.x,e.y=this.y,e.shapeX=this.shapeX,e.shapeY=this.shapeY,e.shapeHeight=this.shapeHeight,e.shapeWidth=this.shapeWidth,e.is2007Shape=this.is2007Shape,e.coordinateSize=this.coordinateSize,e.coordinateXOrigin=this.coordinateXOrigin,e.coordinateYOrigin=this.coordinateYOrigin,e.distanceBottom=this.distanceBottom,e.distanceLeft=this.distanceLeft,e.distanceRight=this.distanceRight,e.distanceTop=this.distanceTop,e.leftMargin=this.leftMargin,e.topMargin=this.topMargin,this.margin&&(e.margin=this.margin.clone()),this.revisionLength>0?e.removedIds=F.cloneRevisions(this.getAllRevision()):e.removedIds=this.removedIds.slice(),e.name=this.name,e.alternateText=this.alternateText,e.title=this.title,e.visible=this.visible,e.widthScale=this.widthScale,e.heightScale=this.heightScale,e.verticalPosition=this.verticalPosition,e.verticalOrigin=this.verticalOrigin,e.verticalAlignment=this.verticalAlignment,e.horizontalPosition=this.horizontalPosition,e.horizontalOrigin=this.horizontalOrigin,e.horizontalAlignment=this.horizontalAlignment,e.allowOverlap=this.allowOverlap,e.textWrappingStyle=this.textWrappingStyle,e.textWrappingType=this.textWrappingType,e.layoutInCell=this.layoutInCell,e.zOrderPosition=this.zOrderPosition,e},i.prototype.destroy=function(){this.imgElement=void 0,this.imageString=void 0,this.isInlineImageIn=void 0,e.prototype.destroy.call(this)},i}(Cl),kl=function(e){function t(t,i){var r=e.call(this)||this;return r.baselineOffset=0,r.trimEndWidth=0,r.isFollowCharacter=!1,r.alignmentShift=0,r.listLevel=t,r.isFollowCharacter=i,r}return Ds(t,e),t.prototype.getLength=function(){return this.text?this.text.length:0},t.prototype.clone=function(){var e=new t(this.listLevel,this.isFollowCharacter);return e.text=this.text,e.baselineOffset=this.baselineOffset,e.alignmentShift=this.alignmentShift,this.margin&&(e.margin=this.margin.clone()),e.width=this.width,e.height=this.height,e},t.prototype.destroy=function(){this.text=void 0,e.prototype.destroy.call(this)},t}(nl),Al=function(e){function t(){var t=e.call(this)||this;return t.editRangeStart=void 0,t.editRangeId=-1,t}return Ds(t,e),t.prototype.getLength=function(){return 1},t.prototype.destroy=function(){this.editRangeStart=void 0},t.prototype.clone=function(){var e=new t;return this.editRangeStart&&(this.editRangeStart.editRangeEnd=e),e.editRangeStart=this.editRangeStart,e.editRangeId=this.editRangeId,e},t}(nl),Ll=function(e){function t(){var t=e.call(this)||this;return t.columnFirst=-1,t.columnLast=-1,t.user="",t.group="",t.editRangeId=-1,t}return Ds(t,e),t.prototype.getLength=function(){return 1},t.prototype.removeEditRangeMark=function(){this.editRangeMark&&(this.editRangeMark.parentElement.removeChild(this.editRangeMark),this.editRangeMark=void 0)},t.prototype.destroy=function(){this.user=void 0,this.columnFirst=void 0,this.columnLast=void 0},t.prototype.clone=function(){var e=new t;return e.columnFirst=this.columnFirst,e.columnLast=this.columnLast,e.user=this.user,e.group=this.group,this.editRangeEnd&&(this.editRangeEnd.editRangeStart=e),e.editRangeEnd=this.editRangeEnd,e.editRangeId=this.editRangeId,e},t}(nl),Ul=function(e){function i(){var t=e.call(this)||this;return t.chartTitle="",t.chartType="",t.chartElement=void 0,t.chartCategory=[],t.chartSeries=[],t.chartArea=new Bl,t.chartPlotArea=new Bl,t.chartTitleArea=new _l,t.chartLegend=new ql,t.chartPrimaryCategoryAxis=new Yl,t.chartPrimaryValueAxis=new Yl,t.chartDataTable=new Xl,t}return Ds(i,e),i.prototype.getLength=function(){return 1},Object.defineProperty(i.prototype,"title",{get:function(){return this.chartTitle},set:function(e){this.chartTitle=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"type",{get:function(){return this.chartType},set:function(e){this.chartType=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"chartGapWidth",{get:function(){return this.gapWidth},set:function(e){this.gapWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"chartOverlap",{get:function(){return this.overlap},set:function(e){this.overlap=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"targetElement",{get:function(){return t.isNullOrUndefined(this.div)&&(this.div=t.createElement("div")),this.div},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"officeChart",{get:function(){return this.officeChartInternal},set:function(e){e&&(this.officeChartInternal=e,this.officeChartInternal.chart.loaded=this.onChartLoaded.bind(this))},enumerable:!0,configurable:!0}),i.prototype.onChartLoaded=function(){var e=this;t.isNullOrUndefined(this.officeChart.chart)||t.isNullOrUndefined(this.width)||t.isNullOrUndefined(this.height)||this.officeChart.convertChartToImage(this.officeChart.chart,this.width,this.height).then(function(t){e.imageString=t,e.element.src=t})},i.prototype.clone=function(){var e=new i;e.x=this.x,e.y=this.y,e.chartTitle=this.chartTitle,e.chartType=this.chartType,e.height=this.height,e.width=this.width,e.gapWidth=this.gapWidth,e.overlap=this.overlap,e.imageString=this.imageString,e.element.src=this.imageString,e.officeChart=this.officeChart,e.shapeX=this.shapeX,e.shapeY=this.shapeY,e.shapeHeight=this.shapeHeight,e.shapeWidth=this.shapeWidth;for(r=0;r<this.chartCategory.length;r++){var t=this.chartCategory[r].clone();e.chartCategory.push(t)}for(var r=0;r<this.chartSeries.length;r++){var n=this.chartSeries[r].clone();e.chartSeries.push(n)}return e.chartArea=this.chartArea.clone(),e.chartPlotArea=this.chartPlotArea.clone(),e.chartLegend=this.chartLegend.clone(),e.chartTitleArea=this.chartTitleArea.clone(),e.chartPrimaryCategoryAxis=this.chartPrimaryCategoryAxis.clone(),e.chartPrimaryValueAxis=this.chartPrimaryValueAxis.clone(),e.chartDataTable=this.chartDataTable.clone(),e},i.prototype.destroy=function(){e.prototype.destroy.call(this),t.isNullOrUndefined(this.officeChartInternal)||(this.officeChartInternal.chart.loaded=void 0,this.officeChartInternal.destroy(),this.officeChartInternal=void 0),this.div&&(this.div=void 0),this.chartTitle=void 0,this.chartType=void 0,this.chartArea=void 0,this.chartPlotArea=void 0,this.chartCategory=[],this.chartSeries=[],this.chartTitleArea=void 0,this.chartLegend=void 0,this.chartPrimaryCategoryAxis=void 0,this.chartPrimaryValueAxis=void 0,this.chartDataTable=void 0,this.chartElement=void 0},i}(Il),Bl=function(){function e(){}return Object.defineProperty(e.prototype,"chartForeColor",{get:function(){return this.foreColor},set:function(e){this.foreColor=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.foreColor=this.foreColor,t},e.prototype.destroy=function(){this.foreColor=void 0},e}(),Hl=function(){function e(){this.categoryXName="",this.chartData=[]}return Object.defineProperty(e.prototype,"xName",{get:function(){return this.categoryXName},set:function(e){this.categoryXName=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;t.categoryXName=this.categoryXName;for(var i=0;i<this.chartData.length;i++){var r=this.chartData[i].clone();t.chartData.push(r)}return t},e.prototype.destroy=function(){this.categoryXName=void 0,this.chartData=[]},e}(),Rl=function(){function e(){}return Object.defineProperty(e.prototype,"yAxisValue",{get:function(){return this.yValue},set:function(e){this.yValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"xAxisValue",{get:function(){return this.xValue},set:function(e){this.xValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bubbleSize",{get:function(){return this.size},set:function(e){this.size=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.yValue=this.yValue,t.xValue=this.xValue,t.size=this.size,t},e.prototype.destroy=function(){this.xValue=void 0,this.yValue=void 0,this.size=void 0},e}(),ql=function(){function e(){this.chartTitleArea=new _l}return Object.defineProperty(e.prototype,"chartLegendPostion",{get:function(){return this.legendPostion},set:function(e){this.legendPostion=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.legendPostion=this.legendPostion,t.chartTitleArea=this.chartTitleArea.clone(),t},e.prototype.destroy=function(){this.legendPostion=void 0,this.chartTitleArea=void 0},e}(),El=function(){function e(){this.chartDataFormat=[],this.trendLines=[],this.errorBar=new Ml,this.dataLabels=new Dl,this.seriesFormat=new Vl}return Object.defineProperty(e.prototype,"seriesName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstSliceAngle",{get:function(){return this.sliceAngle},set:function(e){this.sliceAngle=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"doughnutHoleSize",{get:function(){return this.holeSize},set:function(e){this.holeSize=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;t.name=this.name,t.sliceAngle=this.sliceAngle,t.holeSize=this.holeSize,t.errorBar=this.errorBar.clone(),t.dataLabels=this.dataLabels.clone(),t.seriesFormat=this.seriesFormat.clone();for(r=0;r<this.chartDataFormat.length;r++){var i=this.chartDataFormat[r].clone();t.chartDataFormat.push(i)}for(var r=0;r<this.trendLines.length;r++){var n=this.trendLines[r].clone();t.trendLines.push(n)}return t},e.prototype.destroy=function(){this.name=void 0,this.errorBar=void 0,this.trendLines=void 0,this.chartDataFormat=[]},e}(),Ml=function(){function e(){}return Object.defineProperty(e.prototype,"errorType",{get:function(){return this.type},set:function(e){this.type=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"errorDirection",{get:function(){return this.direction},set:function(e){this.direction=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"errorEndStyle",{get:function(){return this.endStyle},set:function(e){this.endStyle=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numberValue",{get:function(){return this.errorValue},set:function(e){this.errorValue=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.type=this.type,t.errorDirection=this.errorDirection,t.endStyle=this.endStyle,t.errorValue=this.errorValue,t},e.prototype.destroy=function(){this.type=void 0,this.errorDirection=void 0,this.endStyle=void 0},e}(),Vl=function(){function e(){}return Object.defineProperty(e.prototype,"markerStyle",{get:function(){return this.style},set:function(e){this.style=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"markerColor",{get:function(){return this.color},set:function(e){this.color=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numberValue",{get:function(){return this.size},set:function(e){this.size=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.style=this.style,t.color=this.color,t.size=this.size,t},e.prototype.destroy=function(){this.style=void 0,this.color=void 0,this.size=void 0},e}(),Dl=function(){function e(){}return Object.defineProperty(e.prototype,"labelPosition",{get:function(){return this.position},set:function(e){this.position=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontColor",{get:function(){return this.color},set:function(e){this.color=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontSize",{get:function(){return this.size},set:function(e){this.size=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLegendKey",{get:function(){return this.isLegend},set:function(e){this.isLegend=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isBubbleSize",{get:function(){return this.isBubble},set:function(e){this.isBubble=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCategoryName",{get:function(){return this.isCategory},set:function(e){this.isCategory=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSeriesName",{get:function(){return this.isSeries},set:function(e){this.isSeries=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isValue",{get:function(){return this.isValueEnabled},set:function(e){this.isValueEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isPercentage",{get:function(){return this.isPercentageEnabled},set:function(e){this.isPercentageEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLeaderLines",{get:function(){return this.showLeaderLines},set:function(e){this.showLeaderLines=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.position=this.position,t.name=this.name,t.color=this.color,t.size=this.size,t.isBubble=this.isBubble,t.isLegend=this.isLegend,t.isCategory=this.isCategory,t.isSeries=this.isSeries,t.isValueEnabled=this.isValueEnabled,t.isPercentageEnabled=this.isPercentageEnabled,t.showLeaderLines=this.showLeaderLines,t},e.prototype.destroy=function(){this.position=void 0},e}(),zl=function(){function e(){}return Object.defineProperty(e.prototype,"trendLineType",{get:function(){return this.type},set:function(e){this.type=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trendLineName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"interceptValue",{get:function(){return this.intercept},set:function(e){this.intercept=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"forwardValue",{get:function(){return this.forward},set:function(e){this.forward=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"backwardValue",{get:function(){return this.backward},set:function(e){this.backward=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisplayRSquared",{get:function(){return this.displayRSquared},set:function(e){this.displayRSquared=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisplayEquation",{get:function(){return this.displayEquation},set:function(e){this.displayEquation=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.type=this.type,t.name=this.name,t.forward=this.forward,t.backward=this.backward,t.intercept=this.intercept,t.displayEquation=this.displayEquation,t.displayRSquared=this.displayRSquared,t},e.prototype.destroy=function(){this.type=void 0,this.name=void 0,this.forward=void 0,this.backward=void 0},e}(),_l=function(){function e(){this.dataFormat=new jl,this.layout=new Kl}return Object.defineProperty(e.prototype,"chartfontName",{get:function(){return this.fontName},set:function(e){this.fontName=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"chartFontSize",{get:function(){return this.fontSize},set:function(e){this.fontSize=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.fontName=this.fontName,t.fontSize=this.fontSize,t.dataFormat=this.dataFormat.clone(),t.layout=this.layout.clone(),t},e.prototype.destroy=function(){this.fontName=void 0,this.fontSize=void 0,this.dataFormat=void 0,this.layout=void 0},e}(),jl=function(){function e(){this.fill=new Gl,this.line=new Gl}return e.prototype.clone=function(){var t=new e;return t.fill=this.fill.clone(),t.line=this.line.clone(),t},e.prototype.destroy=function(){this.fill=void 0,this.line=void 0},e}(),Gl=function(){function e(){}return Object.defineProperty(e.prototype,"color",{get:function(){return this.fillColor},set:function(e){this.fillColor=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rgb",{get:function(){return this.fillRGB},set:function(e){this.fillRGB=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.fillColor=this.fillColor,t.fillRGB=this.fillRGB,t},e.prototype.destroy=function(){this.fillColor=void 0,this.fillRGB=void 0},e}(),Kl=function(){function e(){}return Object.defineProperty(e.prototype,"chartLayoutLeft",{get:function(){return this.layoutX},set:function(e){this.layoutX=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"chartLayoutTop",{get:function(){return this.layoutY},set:function(e){this.layoutY=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.layoutX=this.layoutX,t.layoutY=this.layoutY,t},e.prototype.destroy=function(){this.layoutX=void 0,this.layoutY=void 0},e}(),Yl=function(){function e(){this.chartTitleArea=new _l}return Object.defineProperty(e.prototype,"majorTick",{get:function(){return this.majorTickMark},set:function(e){this.majorTickMark=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minorTick",{get:function(){return this.minorTickMark},set:function(e){this.minorTickMark=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tickPosition",{get:function(){return this.tickLabelPostion},set:function(e){this.tickLabelPostion=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minorGridLines",{get:function(){return this.hasMinorGridLines},set:function(e){this.hasMinorGridLines=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"majorGridLines",{get:function(){return this.hasMajorGridLines},set:function(e){this.hasMajorGridLines=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"interval",{get:function(){return this.majorUnit},set:function(e){this.majorUnit=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAutoInternal",{get:function(){return this.isAutoMajor},set:function(e){this.isAutoMajor=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"max",{get:function(){return this.maximumValue},set:function(e){this.maximumValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"min",{get:function(){return this.minimumValue},set:function(e){this.minimumValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"categoryAxisTitle",{get:function(){return this.title},set:function(e){this.title=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"categoryAxisType",{get:function(){return this.categoryType},set:function(e){this.categoryType=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"categoryNumberFormat",{get:function(){return this.numberFormat},set:function(e){this.numberFormat=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"axisFontSize",{get:function(){return this.fontSize},set:function(e){this.fontSize=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"axisFontName",{get:function(){return this.fontName},set:function(e){this.fontName=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.title=this.title,t.categoryType=this.categoryType,t.numberFormat=this.numberFormat,t.fontSize=this.fontSize,t.fontName=this.fontName,t.hasMajorGridLines=this.hasMajorGridLines,t.hasMinorGridLines=this.hasMinorGridLines,t.minimumValue=this.minimumValue,t.maximumValue=this.maximumValue,t.majorUnit=this.majorUnit,t.isAutoMajor=this.isAutoMajor,t.majorTickMark=this.majorTickMark,t.minorTickMark=this.minorTickMark,t.tickLabelPostion=this.tickLabelPostion,t.chartTitleArea=this.chartTitleArea.clone(),t},e.prototype.destroy=function(){this.title=void 0,this.categoryType=void 0,this.numberFormat=void 0,this.chartTitleArea=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.fontSize=void 0,this.fontName=void 0,this.majorUnit=void 0,this.majorTickMark=void 0,this.minorTickMark=void 0,this.tickLabelPostion=void 0},e}(),Xl=function(){function e(){}return Object.defineProperty(e.prototype,"showSeriesKeys",{get:function(){return this.isSeriesKeys},set:function(e){this.isSeriesKeys=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasHorzBorder",{get:function(){return this.isHorzBorder},set:function(e){this.isHorzBorder=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasVertBorder",{get:function(){return this.isVertBorder},set:function(e){this.isVertBorder=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasBorders",{get:function(){return this.isBorders},set:function(e){this.isBorders=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.isSeriesKeys=this.isSeriesKeys,t.isHorzBorder=this.isHorzBorder,t.isVertBorder=this.isVertBorder,t.isBorders=this.isBorders,t},e.prototype.destroy=function(){this.isSeriesKeys=void 0,this.isHorzBorder=void 0,this.isVertBorder=void 0,this.isBorders=void 0},e}(),Jl=function(e){function i(t){var i=e.call(this)||this;return i.commentType=0,i.commentId="",i.commentType=t,i}return Ds(i,e),Object.defineProperty(i.prototype,"comment",{get:function(){return this.commentInternal},set:function(e){this.commentInternal=e},enumerable:!0,configurable:!0}),i.prototype.getLength=function(){return 1},i.prototype.clone=function(){var e=new i(this.commentType);return e.commentId=this.commentId,e.commentType=this.commentType,t.isNullOrUndefined(this.commentInternal)||(e.commentInternal=this.commentInternal.clone()),e},i.prototype.renderCommentMark=function(e,i){var r=this,n=this.line.paragraph.bodyWidget.page.documentHelper,o=n.render.commentMarkDictionary;if(0===this.commentType&&t.isNullOrUndefined(this.commentMark)){this.commentMark=document.createElement("div"),this.commentMark.style.display="none",this.commentMark.classList.add("e-de-cmt-mark");var a=document.createElement("span");if(a.classList.add("e-icons"),a.classList.add("e-de-cmt-mark-icon"),this.commentMarkSpan=a,this.commentMark.appendChild(a),n.documentEditorSettings.commentSettings&&n.documentEditorSettings.commentSettings.highlightCommentsByAuthor){var s=this.getFirstCommentInLine(),l=s&&s.comment?s.comment.author:this.comment.author,d=n.getAuthorColor(l);this.commentMarkSpan.style.color=n.convertColorToRGBA(d,.6),this.onCommentMarkMouseEnter=function(){r.getFirstCommentInLine().updateCommentMarkColorOnHover()},this.onCommentMarkMouseLeave=function(){r.getFirstCommentInLine().updateCommentMarkColorOnUnhover()},this.commentMarkSpan.addEventListener("mouseenter",this.onCommentMarkMouseEnter),this.commentMarkSpan.addEventListener("mouseleave",this.onCommentMarkMouseLeave)}}n.documentEditorSettings.commentSettings&&n.documentEditorSettings.commentSettings.highlightCommentsByAuthor&&0===this.commentType&&this.commentMarkSpan&&!t.isNullOrUndefined(this.commentMark)&&this.refreshCommentMarkAppearance(n,o),this.line&&t.isNullOrUndefined(this.commentMark.parentElement)&&(n.pageContainer.appendChild(this.commentMark),this.commentMark.addEventListener("click",this.selectComment.bind(this)));for(var h,c=!1,g=0;g<o.length;g++)if(this.elementsOverlap(o.keys[g],e,i)){c=!0,h=o.keys[g];break}if(c){for(var p=!0,g=0;g<o.get(h).length;g++)if(o.get(h)[g]===this){p=!1;break}p&&(o.get(h).push(this),n.documentEditorSettings.commentSettings&&n.documentEditorSettings.commentSettings.highlightCommentsByAuthor&&this.commentMarkSpan&&(this.commentMarkSpan.style.color="transparent",this.commentMarkSpan.style.textShadow=""))}else o.add(this.commentMark,[this]);for(g=0;g<o.length;g++){var u=o.keys[g];if(1==o.get(u).length&&o.get(u)[0].commentMark&&(o.get(u)[0].commentMark.firstElementChild.classList.contains("e-de-multi-cmt-mark")?t.classList(o.get(u)[0].commentMark.firstElementChild,["e-de-cmt-mark-icon"],["e-de-multi-cmt-mark"]):o.get(u)[0].commentInternal.isResolved&&o.get(u)[0].commentMark.firstElementChild.classList.contains("e-de-cmt-mark-icon")?t.classList(o.get(u)[0].commentMark.firstElementChild,["e-de-cmt-resolve-icon"],["e-de-cmt-mark-icon"]):!o.get(u)[0].commentInternal.isResolved&&o.get(u)[0].commentMark.firstElementChild.classList.contains("e-de-cmt-resolve-icon")&&t.classList(o.get(u)[0].commentMark.firstElementChild,["e-de-cmt-mark-icon"],["e-de-cmt-resolve-icon"])),o.get(u).length>1)for(var f=0;f<o.get(u).length;f++){for(var m=!0,y=0;y<o.get(u).length;y++)if(o.get(u)[y].commentInternal&&!o.get(u)[y].commentInternal.isResolved){m=!1;break}o.get(u)[f].commentMark&&(o.get(u)[f].commentMark.firstElementChild.classList.contains("e-de-cmt-mark-icon")?t.classList(o.get(u)[f].commentMark.firstElementChild,["e-de-multi-cmt-mark"],["e-de-cmt-mark-icon"]):!m&&o.get(u)[f].commentMark.firstElementChild.classList.contains("e-de-multi-cmt-resolve")?t.classList(o.get(u)[f].commentMark.firstElementChild,["e-de-multi-cmt-mark"],["e-de-multi-cmt-resolve"]):m&&t.classList(o.get(u)[f].commentMark.firstElementChild,["e-de-multi-cmt-resolve"],["e-de-multi-cmt-mark"]))}}},i.prototype.elementsOverlap=function(e,t,i){var r=e.offsetWidth,n=e.offsetHeight,o=parseFloat(e.style.top),a=parseFloat(e.style.left),s=o+n,l=a+r,d=parseFloat(t),h=parseFloat(i),c=h+r;return!(o>d+n||l<h||s<d||a>c)},i.prototype.getFirstCommentInLine=function(){if(t.isNullOrUndefined(this.line)||t.isNullOrUndefined(this.line.children))return this;for(var e=0;e<this.line.children.length;e++){var r=this.line.children[e];if(r instanceof i&&0===r.commentType)return r}return this},i.prototype.refreshCommentMarkAppearance=function(e,t){for(var i,r=e.editorProperties.currentSelectedComment,n=this.getFirstCommentInLine(),o=n&&n.comment?n.comment.author:this.comment.author,a=e.getAuthorColor(o),s=this.commentMark.style.top,l=this.commentMark.style.left,d=[],h=0;h<t.length;h++)if(this.elementsOverlap(t.keys[h],s,l)){i=t.keys[h],d=t.get(i);break}if(d.length>1)if(d[0]===this){var c=!1;if(r)for(var g=0;g<d.length;g++)if(d[g].comment===r){c=!0;break}if(c){p=e.getAuthorColor(r.author);this.commentMarkSpan.style.color=p,this.commentMarkSpan.style.textShadow="0 0 2px "+p}else this.commentMarkSpan.style.color=e.convertColorToRGBA(a,.6),this.commentMarkSpan.style.textShadow=""}else this.commentMarkSpan.style.color="transparent",this.commentMarkSpan.style.textShadow="";else if(this.commentMark.classList.contains("e-de-cmt-mark-selected")&&r&&r===this.comment){var p=e.getAuthorColor(r.author);this.commentMarkSpan.style.color=p,this.commentMarkSpan.style.textShadow="0 0 2px "+p}else this.commentMarkSpan.style.color=e.convertColorToRGBA(a,.6),this.commentMarkSpan.style.textShadow=""},i.prototype.updateCommentMarkColorOnHover=function(){var e=this.line.paragraph.bodyWidget.page.documentHelper,t=e.render.commentMarkDictionary.get(this.commentMark);if(t&&0!==t.length){var i=t[0],r=e.editorProperties.currentSelectedComment,n=e.getAuthorColor(i.comment.author);if(r){var o=r.commentStart.getFirstCommentInLine();o&&o.comment===i.comment&&(n=e.getAuthorColor(r.author))}t[0]&&t[0].commentMarkSpan&&(t[0].commentMarkSpan.style.color=n,t[0].commentMarkSpan.style.textShadow="0 0 2px "+n);for(var a=1;a<t.length;a++){var s=t[a];s&&s.commentMarkSpan&&(s.commentMarkSpan.style.color="transparent",s.commentMarkSpan.style.textShadow="")}}},i.prototype.updateCommentMarkColorOnUnhover=function(){var e=this.line.paragraph.bodyWidget.page.documentHelper,t=e.render.commentMarkDictionary.get(this.commentMark);if(t&&0!==t.length){var i=t[0],r=e.editorProperties.currentSelectedComment,n=e.getAuthorColor(i.comment.author),o=!1;if(r){var a=r.commentStart.getFirstCommentInLine();o=(a?a.comment:null)===i.comment}if(t[0]&&t[0].commentMarkSpan)if(o){var s=e.getAuthorColor(r.author);t[0].commentMarkSpan.style.color=s,t[0].commentMarkSpan.style.textShadow="0 0 2px "+s}else t[0].commentMarkSpan.style.color=e.convertColorToRGBA(n,.6),t[0].commentMarkSpan.style.textShadow="";for(var l=1;l<t.length;l++){var d=t[l];d&&d.commentMarkSpan&&(d.commentMarkSpan.style.color="transparent",d.commentMarkSpan.style.textShadow="")}}},i.prototype.selectComment=function(){for(var e=this.line.paragraph.bodyWidget.page.documentHelper,t=e.render.commentMarkDictionary,i=this.commentMark.style.top,r=this.commentMark.style.left,n=0,o=[],a=0;a<t.keys.length;a++)if(this.elementsOverlap(t.keys[a],i,r)){o=t.get(t.keys[a]);break}if(e.editorProperties.currentSelectedComment){for(a=0;a<o.length;a++)if(o[a].comment===e.editorProperties.currentSelectedComment){n=a;break}n<o.length-1?n+=1:n=0}else n=0;if(e&&o.length>0){var s=o[n].comment;e.hooks.onCommentSelected&&e.hooks.onCommentSelected(s)}},i.prototype.removeCommentMark=function(){this.commentMark&&this.commentMark.parentElement&&(this.commentMark.removeEventListener("click",this.selectComment.bind(this)),this.commentMark.parentElement.removeChild(this.commentMark))},i.prototype.destroy=function(){this.commentMarkSpan&&(this.onCommentMarkMouseEnter&&this.commentMarkSpan.removeEventListener("mouseenter",this.onCommentMarkMouseEnter),this.onCommentMarkMouseLeave&&this.commentMarkSpan.removeEventListener("mouseleave",this.onCommentMarkMouseLeave)),this.commentMark&&this.removeCommentMark(),this.commentMark=void 0,this.commentInternal=void 0,this.commentId=void 0,e.prototype.componentDestroy.call(this)},i}(nl),Zl=function(e){function t(t){var i=e.call(this,0)||this;return i.authorIn="",i.initialIn="",i.done=!1,i.posted=!1,i.textIn="",i.isReply=!1,i.ownerComment=void 0,i.mentionsIn=[],i.createdDate=t,i.replyComments=[],i}return Ds(t,e),Object.defineProperty(t.prototype,"commentStart",{get:function(){return this.commentStartIn},set:function(e){this.commentStartIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"commentEnd",{get:function(){return this.commentEndIn},set:function(e){this.commentEndIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"author",{get:function(){return this.authorIn},set:function(e){this.authorIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"initial",{get:function(){return this.initialIn},set:function(e){this.initialIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isResolved",{get:function(){return this.done},set:function(e){this.done=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"date",{get:function(){return this.createdDate},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this.textIn},set:function(e){this.textIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mentions",{get:function(){return this.mentionsIn},set:function(e){this.mentionsIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isPosted",{get:function(){return this.posted},set:function(e){this.posted=e},enumerable:!0,configurable:!0}),t.prototype.getLength=function(){return 1},t.prototype.clone=function(){var e=new t(this.date);return e.author=this.author,e.initial=this.initial,e.commentId=this.commentId,e.replyComments=this.replyComments,e.isResolved=this.isResolved,e.text=this.text,e},t.prototype.destroy=function(){if(this.replyComments&&this.replyComments.length>0){for(var t=0;t<this.replyComments.length;t++)this.replyComments[t].destroy();this.replyComments=[]}this.replyComments=void 0,this.commentStartIn&&(this.commentStartIn.destroy(),this.commentStartIn=void 0),this.commentEndIn&&(this.commentEndIn.destroy(),this.commentEndIn=void 0),this.commentId=void 0,this.createdDate=void 0,this.initialIn=void 0,this.textIn=void 0,this.authorIn=void 0,this.ownerComment=void 0,e.prototype.destroy.call(this)},t}(Jl),Ql=function(){function e(e){this.boundingRectangle=new zs(96,96,816,1056),this.repeatHeaderRowTableWidget=!1,this.bodyWidgets=[],this.headerWidgetIn=void 0,this.footerWidgetIn=void 0,this.footnoteWidget=void 0,this.endnoteWidget=void 0,this.currentPageNum=1,this.allowNextPageRendering=!0,this.documentHelper=e}return Object.defineProperty(e.prototype,"headerWidget",{get:function(){return!t.isNullOrUndefined(this.headerWidgetIn)&&this.headerWidgetIn.parentHeaderFooter?this.headerWidgetIn.parentHeaderFooter:this.headerWidgetIn},set:function(e){this.headerWidgetIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"footerWidget",{get:function(){return!t.isNullOrUndefined(this.footerWidgetIn)&&this.footerWidgetIn.parentHeaderFooter?this.footerWidgetIn.parentHeaderFooter:this.footerWidgetIn},set:function(e){this.footerWidgetIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"index",{get:function(){return this.documentHelper?this.documentHelper.pages.indexOf(this):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousPage",{get:function(){var e=this.index;if(e>0)return this.documentHelper.pages[e-1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextPage",{get:function(){var e=this.index;if(e<this.documentHelper.pages.length-1)return this.documentHelper.pages[e+1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sectionIndex",{get:function(){return this.bodyWidgets.length>0?this.bodyWidgets[0].index:-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"viewer",{get:function(){return this.documentHelper.viewer},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.headerWidget&&this.headerWidget.page===this&&(this.headerWidget.page=void 0),this.footerWidget&&this.footerWidget.page===this&&(this.footerWidget.page=void 0),this.headerWidgetIn&&!t.isNullOrUndefined(this.headerWidgetIn.parentHeaderFooter)&&(t.isNullOrUndefined(this.documentHelper)||t.isNullOrUndefined(this.documentHelper.pages)||(this.documentHelper.editorProperties.removeFieldInWidget(this.headerWidgetIn),this.documentHelper.editorProperties.removeFieldInWidget(this.headerWidgetIn,!1,!0)),this.headerWidgetIn.destroy(),this.headerWidget=void 0),this.footerWidgetIn&&!t.isNullOrUndefined(this.footerWidgetIn.parentHeaderFooter)&&(t.isNullOrUndefined(this.documentHelper)||t.isNullOrUndefined(this.documentHelper.pages)||(this.documentHelper.editorProperties.removeFieldInWidget(this.footerWidgetIn),this.documentHelper.editorProperties.removeFieldInWidget(this.footerWidgetIn,!1,!0)),this.footerWidgetIn.destroy(),this.footerWidgetIn=void 0),this.bodyWidgets=[],this.bodyWidgets=void 0,t.isNullOrUndefined(this.documentHelper)||t.isNullOrUndefined(this.documentHelper.pages)||this.documentHelper.removePage(this),this.documentHelper=void 0},e.prototype.componentDestroy=function(){if(this.headerWidgetIn&&(this.headerWidgetIn.componentDestroy(),this.headerWidgetIn=void 0),this.footerWidgetIn&&(this.footerWidgetIn.componentDestroy(),this.footerWidgetIn=void 0),this.bodyWidgets){for(var e=0;e<this.bodyWidgets.length;e++)this.bodyWidgets[e].componentDestroy();this.bodyWidgets=[],this.bodyWidgets=void 0}this.documentHelper=void 0},e}(),$l=function(){function e(){this.tableColumns=[],this.tableWidth=0}return Object.defineProperty(e.prototype,"columns",{get:function(){return this.tableColumns},enumerable:!0,configurable:!0}),e.prototype.resetColumns=function(){for(var e=0;e<this.tableColumns.length;e++)this.tableColumns[e].destroy();this.tableColumns=[]},e.prototype.getPreviousSpannedCellWidth=function(e,t){for(var i=0,r=e;r<t;r++)i+=this.tableColumns[r].preferredWidth;return i},e.prototype.addColumns=function(e,t,i,r,n,o,a){for(var s=this.columns.length;s<t;s++)this.columns.push(new ed);for(var l=0,d=e;d<t;d++)l+=this.columns[d].preferredWidth;var h=t-e,c=!(a&&h>1&&"Auto"!==o);!(h>1)&&l<i&&(this.columns[t-1].preferredWidth+=i-l);var g=0,p=0,u=0;if(h>1)for(var f=e;f<t-1;f++)g+=this.columns[f].minimumWordWidth,p+=this.columns[f].maximumWordWidth,u+=this.columns[f].maxParaWidth;c&&r.minimumWordWidth-g>this.columns[t-1].minimumWordWidth&&(this.columns[t-1].minimumWordWidth=r.minimumWordWidth-g),c&&r.maximumWordWidth-p>this.columns[t-1].maximumWordWidth&&(this.columns[t-1].maximumWordWidth=r.maximumWordWidth-p),c&&r.maxParaWidth-u>this.columns[t-1].maxParaWidth&&(this.columns[t-1].maxParaWidth=r.maxParaWidth-u),r.minimumWidth>this.columns[t-1].minimumWidth&&(this.columns[t-1].minimumWidth=r.minimumWidth),n>this.columns[t-1].endOffset&&(this.columns[t-1].endOffset=n),this.columns[t-1].widthType=o},e.prototype.getTotalWidth=function(e){for(var t=0,i=0;i<this.columns.length;i++){var r=this.columns[i];t+=0===e?r.preferredWidth:1===e?r.minimumWordWidth:2===e?r.maximumWordWidth:4===e?r.maxParaWidth:r.minimumWidth}return t},e.prototype.isFitColumns=function(e,t,i){var r=this.getTotalWidth(0);if(this.tableWidth=i&&t>r?r:t,r!==this.tableWidth){var n=this.tableWidth/r;n=isNaN(n)||n===1/0?1:n;for(var o=0;o<this.columns.length;o++){var a=this.columns[o];if(n*a.preferredWidth<a.minWidth)return!1}return!0}return!0},e.prototype.isAllColumnHasPointWidthType=function(){for(var e=!0,t=0;t<this.columns.length;t++)"Point"!=this.columns[t].widthType&&(e=!1);return e},e.prototype.autoFitColumn=function(e,i,r,n,o,a,s,l,d,h,c){for(var g=this,p=0,u=0,f=0,m=this.columns.every(function(e){return"Point"===e.widthType}),y=!r&&"Percent"===h,v=0,W=[],b=0;b<this.columns.length;b++)this.columns[b].maxParaWidth>this.columns[b].maximumWordWidth&&(this.columns[b].maximumWordWidth=this.columns[b].maxParaWidth);for(var x=this.getTotalWidth(0),w=!r&&"Point"===h&&m&&!a&&bs.round(i,2)<bs.round(x,2),b=0;b<this.columns.length;b++){0===(G=this.columns[b]).minimumWordWidth&&0===G.maximumWordWidth&&0===G.minWidth&&(m?(G.minimumWordWidth=G.minimumWidth>G.preferredWidth?G.minimumWidth:G.preferredWidth,G.maximumWordWidth=G.minimumWidth>G.preferredWidth?G.minimumWidth:G.preferredWidth,G.minWidth=G.minimumWidth>G.preferredWidth?G.minimumWidth:G.preferredWidth):(G.minimumWordWidth=G.minimumWidth>0?G.minimumWidth:G.preferredWidth,G.maximumWordWidth=G.minimumWidth>0?G.minimumWidth:G.preferredWidth,G.minWidth=G.minimumWidth>0?G.minimumWidth:G.preferredWidth)),w&&(this.columns[b].preferredWidth=this.columns[b].preferredWidth/x*i);var F=0;p+=G.preferredWidth>G.maximumWordWidth?G.preferredWidth:G.maximumWordWidth,u+=G.preferredWidth>G.minimumWordWidth?G.preferredWidth:G.minimumWordWidth;var C=0===G.preferredWidth?G.minimumWordWidth:G.preferredWidth>G.minimumWordWidth?G.preferredWidth:G.minimumWordWidth;f+=(F=G.maximumWordWidth-C)>0?F:0,G.preferredWidth<G.minimumWordWidth?v+=G.minimumWordWidth-G.preferredWidth:W.push(b)}if(y&&!a&&!n&&this.columns.length>1&&this.columns.every(function(e){return"Auto"===e.widthType&&e.maximumWordWidth>0&&bs.round(e.preferredWidth,2)===bs.round(g.columns[0].preferredWidth,2)})&&this.columns.reduce(function(e,t){return e+t.maximumWordWidth},0)<=.85*i&&Math.max.apply(Math,this.columns.map(function(e){return e.maximumWordWidth}))>=.5*this.columns.reduce(function(e,t){return e+t.maximumWordWidth},0)){for(b=0;b<this.columns.length;b++)this.columns[b].preferredWidth=this.columns[b].maximumWordWidth;return this.fitColumns(e,i,r,o),void(this.tableWidth=this.getTotalWidth(0))}if(p<=i){for(b=0;b<this.columns.length;b++)"Point"!==(G=this.columns[b]).widthType?G.preferredWidth<G.maximumWordWidth&&(G.preferredWidth=G.maximumWordWidth):G.preferredWidth<G.minimumWordWidth&&(G.preferredWidth=G.minimumWordWidth);r||this.fitColumns(e,i,r,o)}else{var P=this.getTotalWidth(0);if(m&&!a&&u>e&&(e>P&&(v-=e-P),W.length>0&&v>0)){for(var T=v/this.columns.length,b=0;b<this.columns.length;b++){G=this.columns[b];-1===W.indexOf(b)?P>G.minimumWordWidth&&(G.preferredWidth=G.minimumWordWidth):(G.preferredWidth=G.preferredWidth-T,G.preferredWidth<G.minimumWordWidth&&(G.preferredWidth=G.minimumWordWidth))}w=!r&&"Point"===h&&bs.round(i,2)<=bs.round(x,2),P=this.getTotalWidth(0)}if(!r){var O=i<u&&u+(t.isNullOrUndefined(l)?0:l)<e;if(O&&a&&m&&"Point"===h&&bs.round(x,2)===bs.round(i,2)&&(O=!1),w&&O){if(u>i&&v>0){i>P&&(v-=i-P);for(var T=v/W.length,b=0;b<this.columns.length;b++){G=this.columns[b];-1===W.indexOf(b)?G.preferredWidth=G.minimumWordWidth:G.preferredWidth=G.preferredWidth-T}P=this.getTotalWidth(0)}return}if(this.fitColumns(e,O?u:i,r,o),y&&!a&&!n){for(var S=0,N=0,I=[],k=[],b=0;b<this.columns.length;b++)(G=this.columns[b]).preferredWidth<G.minimumWordWidth?(S+=G.minimumWordWidth-G.preferredWidth,I.push(b)):G.preferredWidth>G.minimumWordWidth&&(N+=G.preferredWidth-G.minimumWordWidth,k.push(b));if(Math.floor(S)>0&&N>=S){for(b=0;b<I.length;b++){var A=this.columns[I[b]];A.preferredWidth=A.minimumWordWidth}for(b=0;b<k.length;b++){var L=this.columns[k[b]],U=S*(L.preferredWidth-L.minimumWordWidth)/N;L.preferredWidth=Math.max(L.minimumWordWidth,L.preferredWidth-U)}}}return void(this.tableWidth=this.getTotalWidth(0))}if(u<=i||u<=e){E=e>i?e:i;E-=u;for(b=0;b<this.columns.length;b++)if("Point"!==(G=this.columns[b]).widthType){0===G.preferredWidth?G.preferredWidth=G.minimumWordWidth:G.preferredWidth<G.minimumWordWidth&&(G.preferredWidth=G.minimumWordWidth);K=E*((F=(F=G.maximumWordWidth-G.preferredWidth)>0?F:0)/f);G.preferredWidth+=isNaN(K)?0:K}}else{var B=this.getTotalWidth(1),H=this.getTotalWidth(3),R=this.getTotalWidth(2);if(H>2112)for(var q=2112/this.columns.length,b=0;b<this.columns.length;b++)this.columns[b].preferredWidth=q;else{var E=0;if(H<e&&e-H>=1&&!m||m&&!a&&B>e||a&&Math.round(P)>Math.round(e)&&R>s||a&&r&&B>P&&Math.round(e)>Math.round(P)&&!c&&B<s)if(!n&&a&&m){if(B<=i||B<=e)for(var M=(e>i?e:i)-B,V=Math.abs(P-B),b=0;b<this.columns.length;b++){0===(G=this.columns[b]).preferredWidth?G.preferredWidth=G.minimumWordWidth:G.preferredWidth<G.minimumWordWidth&&(G.preferredWidth=G.minimumWordWidth);K=M*(G.preferredWidth-G.minimumWordWidth)/V;K=isNaN(K)?0:K,G.preferredWidth=G.minimumWordWidth+K}else if(P>e||P<B){E=e-H;for(var D=[],z=0,b=0;b<this.columns.length;b++){var _=this.columns[b],j=_.minimumWordWidth-_.minimumWidth==0?_.minimumWidth:Math.abs(_.minimumWordWidth-_.minimumWidth);D[b]=j,z+=j}for(b=0;b<this.columns.length;b++){var G=this.columns[b],K=E*D[b]/z;K=isNaN(K)?0:K,G.preferredWidth=(0==G.minimumWidth?1:G.minimumWidth)+K}}}else{E=e-H;for(b=0;b<this.columns.length;b++){K=E*(G=this.columns[b]).minimumWordWidth/B;K=isNaN(K)?0:K,G.preferredWidth=(0==G.minimumWidth?1:G.minimumWidth)+K}}else if(P>e)for(var K=e/P,b=0;b<this.columns.length;b++)(G=this.columns[b]).preferredWidth=G.preferredWidth*K}}}this.tableWidth=this.getTotalWidth(0)},e.prototype.resizeColumnsToWidestParaWidth=function(){for(var e=this.columns[0],t=0;t<this.columns.length;t++){var i=this.columns[t];i.preferredWidth=i.maximumWordWidth,i.maxParaWidth>e.maxParaWidth&&(e=i)}for(var r=0,t=0;t<this.columns.length;t++)this.columns[t]!==e&&(r+=this.columns[t].preferredWidth);var n=e.maxParaWidth-r;n>e.preferredWidth&&(e.preferredWidth=n),this.tableWidth=this.getTotalWidth(0)},e.prototype.getValidColumnIndex=function(e){for(var t=0,i=0;i<this.columns.length;i++){var r=this.columns[i];if(i<e)t=r.endOffset;else{if(t!==r.endOffset)break;e++}}return e},e.prototype.fitColumns=function(e,i,r,n,o,a){t.isNullOrUndefined(o)&&(o=0);var s=this.getTotalWidth(0);if(r&&(s-=o),this.tableWidth=r?s:a&&s>i?s:i,s!==this.tableWidth){var l=this.tableWidth/s;l=isNaN(l)||l===1/0?1:l;for(var d=0;d<this.columns.length;d++){var h=this.columns[d];if("Percent"===h.widthType&&!r&&!n&&s>this.tableWidth){if(0!==d&&bs.round(h.endOffset,2)>bs.round(this.tableWidth,2)){var c=this.getCellWidth(0,d+1,i);c>this.tableWidth&&(h.preferredWidth-=c-this.tableWidth,(0===h.preferredWidth||h.preferredWidth<h.minimumWidth)&&(h.preferredWidth=h.minimumWidth>0?h.minimumWidth:1,this.columns[0].preferredWidth-=h.preferredWidth))}}else h.preferredWidth=l*h.preferredWidth}}},e.prototype.getCellWidth=function(e,i,r,n){for(var o=0,a=0;a<i;a++)t.isNullOrUndefined(this.tableColumns[a+e])||(o+=n?bs.round(this.tableColumns[a+e].preferredWidth,2):this.tableColumns[a+e].preferredWidth);return o},e.prototype.validateColumnWidths=function(){for(var e=0;e<this.columns.length;e++)0===e?this.columns[e].preferredWidth!==this.columns[e].endOffset&&(this.columns[e].preferredWidth=this.columns[e].endOffset):this.columns[e-1].endOffset+this.columns[e].preferredWidth<this.columns[e].endOffset&&(0===this.columns[e-1].endOffset?this.columns[e].preferredWidth=this.columns[e].endOffset-this.getPreviousValidOffset(e-2):this.columns[e].preferredWidth=this.columns[e].endOffset-this.columns[e-1].endOffset)},e.prototype.getPreviousValidOffset=function(e){for(var t=e;t>=0;t--)if(0!==this.columns[t].endOffset)return this.columns[t].endOffset;return 0},e.prototype.clone=function(){var t=new e;t.tableWidth=this.tableWidth;for(var i=0;i<this.columns.length;i++)t.columns.push(this.columns[i].clone());return t},e.prototype.destroy=function(){if(!t.isNullOrUndefined(this.tableColumns))for(var e=0;e<this.tableColumns.length;e++)this.tableColumns[e].destroy();this.tableColumns=[],this.tableColumns=void 0,this.tableWidth=void 0},e}(),ed=function(){function e(){this.preferredWidth=0,this.minWidth=0,this.maxWidth=0,this.endOffset=0,this.minimumWordWidth=0,this.maximumWordWidth=0,this.maxParaWidth=0,this.minimumWidth=0}return e.prototype.clone=function(){var t=new e;return t.preferredWidth=this.preferredWidth,t.minWidth=this.minWidth,t.maxWidth=this.maxWidth,t},e.prototype.destroy=function(){this.preferredWidth=void 0,this.minWidth=void 0,this.maxWidth=void 0},e}(),td=function(){function e(){this.minimumWordWidth=0,this.maximumWordWidth=0,this.maxParaWidth=0,this.minimumWidth=0,this.hasMinimumWidth=!1,this.hasMinimumWordWidth=!1,this.hasMaximumWordWidth=!1}return e}(),id=function(){function e(){}return e}(),rd=function(){function e(){}return e}(),nd=function(e){function t(){return e.call(this)||this}return Ds(t,e),t.prototype.clone=function(){var t=e.prototype.clone.call(this);return t.breakClearType=this.breakClearType,t},t.prototype.destroy=function(){this.breakClearType=void 0,e.prototype.destroy.call(this)},t.prototype.componentDestroy=function(){this.breakClearType=void 0,e.prototype.componentDestroy.call(this)},t}(hl),od=function(){function e(){}return e}(),ad=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ds(t,e),t.prototype.getLength=function(){return 1},t.prototype.clone=function(){var e=new t;return e.characterFormat.copyFormat(this.characterFormat),e.text=this.text,this.margin&&(e.margin=this.margin.clone()),e.baselineOffset=this.baselineOffset,this.revisionLength>0?e.removedIds=F.cloneRevisions(this.getAllRevision()):e.removedIds=this.removedIds.slice(),e.width=this.width,e.height=this.height,this.contentControlProperties&&(e.contentControlProperties=this.contentControlProperties),e},t}(hl),sd=function(){function e(){this.abstractListIdIn=-1,this.nsid=-1,this.levels=[],this.nsid=parseInt(e.generateNsid(),16)}return e.generateNsid=function(){return(Math.floor(373e7*Math.random())+27e7).toString(16).toUpperCase()},Object.defineProperty(e.prototype,"abstractListId",{get:function(){return this.abstractListIdIn},set:function(e){this.abstractListIdIn=e},enumerable:!0,configurable:!0}),e.prototype.clear=function(){if(!t.isNullOrUndefined(this.levels)){for(var e=0;e<this.levels.length;e++){var i=this.levels[parseInt(e.toString(),10)];i.clearFormat(),this.levels.splice(this.levels.indexOf(i),1),e--}this.levels=[]}},e.prototype.destroy=function(){if(!t.isNullOrUndefined(this.levels)){for(var e=0;e<this.levels.length;e++){var i=this.levels[parseInt(e.toString(),10)];i.destroy(),this.levels.splice(this.levels.indexOf(i),1),e--}this.levels=[]}this.levels=void 0},e.prototype.clone=function(){for(var t=new e,i=0;i<this.levels.length;i++)t.levels.push(this.levels[parseInt(i.toString(),10)].clone(t));return t},e}(),ld=function(){function e(e){this.uniqueListLevel=void 0,this.paragraphFormat=void 0,this.characterFormat=void 0,this.ownerBase=e,this.characterFormat=new S(void 0),this.paragraphFormat=new Ls(void 0)}return Object.defineProperty(e.prototype,"listLevelPattern",{get:function(){return this.getPropertyValue("listLevelPattern")},set:function(e){this.setPropertyValue("listLevelPattern",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"followCharacter",{get:function(){return this.getPropertyValue("followCharacter")},set:function(e){this.setPropertyValue("followCharacter",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numberAlignment",{get:function(){return this.getPropertyValue("numberAlignment")},set:function(e){this.setPropertyValue("numberAlignment",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"startAt",{get:function(){return this.getPropertyValue("startAt")},set:function(e){this.setPropertyValue("startAt",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numberFormat",{get:function(){return this.getPropertyValue("numberFormat")},set:function(e){this.setPropertyValue("numberFormat",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paraStyleName",{get:function(){return this.getPropertyValue("paraStyleName")},set:function(e){this.setPropertyValue("paraStyleName",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"restartLevel",{get:function(){return this.getPropertyValue("restartLevel")},set:function(e){this.setPropertyValue("restartLevel",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLegalStyleNumbering",{get:function(){return this.getPropertyValue("isLegalStyleNumbering")},set:function(e){this.setPropertyValue("isLegalStyleNumbering",e)},enumerable:!0,configurable:!0}),e.prototype.getPropertyValue=function(i){var r=u.getPropertyType(e.uniqueFormatType,i);return!t.isNullOrUndefined(this.uniqueListLevel)&&this.uniqueListLevel.propertiesHash.containsKey(r)?this.uniqueListLevel.propertiesHash.get(r):e.getPropertyDefaultValue(i)},e.prototype.setPropertyValue=function(i,r){if((t.isNullOrUndefined(r)||""===r)&&(r=e.getPropertyDefaultValue(i)),t.isNullOrUndefined(this.uniqueListLevel))this.initializeUniqueWListLevel(i,r);else{var n=u.getPropertyType(this.uniqueListLevel.uniqueFormatType,i);if(this.uniqueListLevel.propertiesHash.containsKey(n)&&this.uniqueListLevel.propertiesHash.get(n)===r)return;this.uniqueListLevel=e.uniqueListLevels.updateUniqueFormat(this.uniqueListLevel,i,r)}},e.prototype.initializeUniqueWListLevel=function(t,i){var r=new p;this.addUniqueWListLevel("listLevelPattern",t,i,r),this.addUniqueWListLevel("startAt",t,i,r),this.addUniqueWListLevel("followCharacter",t,i,r),this.addUniqueWListLevel("numberFormat",t,i,r),this.addUniqueWListLevel("paraStyleName",t,i,r),this.addUniqueWListLevel("restartLevel",t,i,r),this.addUniqueWListLevel("isLegalStyleNumbering",t,i,r),this.addUniqueWListLevel("numberAlignment",t,i,r),this.uniqueListLevel=e.uniqueListLevels.addUniqueFormat(r,e.uniqueFormatType)},e.prototype.addUniqueWListLevel=function(t,i,r,n){var o;o=u.getPropertyType(e.uniqueFormatType,t),t===i?n.add(o,r):n.add(o,e.getPropertyDefaultValue(t))},e.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"listLevelPattern":t="Arabic";break;case"startAt":t=0;break;case"followCharacter":t="Tab";break;case"numberAlignment":t="Left";break;case"paraStyleName":case"numberFormat":t="";break;case"restartLevel":t=0;break;case"isLegalStyleNumbering":t=!1}return t},e.prototype.destroy=function(){t.isNullOrUndefined(this.uniqueListLevel)||e.uniqueListLevels.remove(this.uniqueListLevel),this.uniqueListLevel=void 0,t.isNullOrUndefined(this.characterFormat)||(this.characterFormat.destroy(),this.characterFormat=void 0),t.isNullOrUndefined(this.paragraphFormat)||(this.paragraphFormat.destroy(),this.paragraphFormat=void 0)},e.prototype.clearFormat=function(){t.isNullOrUndefined(this.uniqueListLevel)||e.uniqueListLevels.remove(this.uniqueListLevel),this.uniqueListLevel=void 0,this.characterFormat&&this.characterFormat.clearFormat(),this.characterFormat=void 0,this.paragraphFormat&&this.paragraphFormat.clearFormat(),this.paragraphFormat=void 0},e.clear=function(){this.uniqueListLevels.clear()},e.prototype.clone=function(t){var i=new e(t);return i.paragraphFormat=this.paragraphFormat.cloneFormat(),i.characterFormat=this.characterFormat.cloneFormat(),this.uniqueListLevel&&(i.uniqueListLevel=this.uniqueListLevel,i.uniqueListLevel.referenceCount++),i},e.dotBullet=String.fromCharCode(61623),e.squareBullet=String.fromCharCode(61607),e.arrowBullet=String.fromCharCode(10148),e.circleBullet=String.fromCharCode(61551)+String.fromCharCode(32),e.uniqueListLevels=new f,e.uniqueFormatType=9,e}(),dd=function(){return(dd=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)},hd=function(){function i(e){this.paragraphMarkInfo={},this._position=0,this.documentHelper=e;var t=document.createElement("canvas").getContext("2d");if(!t)throw new Error("Failed to get 2D context");this.context=t}return Object.defineProperty(i.prototype,"position",{get:function(){return this._position},set:function(e){this._position=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"paragraphMark",{get:function(){return"¶"},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"lineBreakMark",{get:function(){return"↲"},enumerable:!0,configurable:!0}),i.prototype.getEnSpaceCharacter=function(){return String.fromCharCode(8194)},i.prototype.repeatChar=function(e,t){for(var i="",r=0;r<t;r++)i+=e;return i},i.prototype.getParagraphMarkWidth=function(e){return this.getParagraphMarkSize(e).Width},i.prototype.getParagraphMarkSize=function(e){var t=this.getFormatText(e);if(this.paragraphMarkInfo[""+t])return this.paragraphMarkInfo[""+t];var i=this.getWidth(this.paragraphMark,e),r=this.getHeight(e),n={Width:i,Height:r.Height,BaselineOffset:r.BaselineOffset};return e.hidden?n:this.paragraphMarkInfo[""+t]=n},i.prototype.getTextSize=function(t,i){var r=0,n=i.bidi||this.isRTLText(t.text),o=this.setText(t.text,n,i.bdo);"\r"===o&&(o=String.fromCharCode(182));var a=t.nextElement;a&&t.scriptType!==e.FontScriptType.Hebrew&&this.documentHelper.layout.checkFormatToCombineText(t.characterFormat,a.characterFormat)&&!bs.startsWith(t.text," ")&&!bs.endsWith(a.text)&&t.characterFormat.bidi&&a.characterFormat.bidi&&t.characterRange===e.CharacterRangeType.RightToLeft&&a.characterRange===e.CharacterRangeType.RightToLeft?(o+="",r=this.getWidthWithZWJ(o,"",a.text,i,t.scriptType)):r=this.getWidth(o,i,t.scriptType),t.width=r;var s=this.getHeight(i,t.scriptType);return"Word2003"===this.documentHelper.compatibilityMode&&t.isColumnBreak||(t.height=s.Height),t.baselineOffset=s.BaselineOffset," "===t.text[t.text.length-1]&&(r=this.getWidth(bs.trimEnd(t.text),i,t.scriptType)),t.trimEndWidth=r,r},i.prototype.getHeight=function(e,i){var r=this.getFontNameToRender(i,e),n=this.getFormatText(e,r);if(!t.isNullOrUndefined(this.documentHelper.heightInfoCollection[""+n])){if(e.hidden){var o=dd({},this.documentHelper.heightInfoCollection[""+n]);return o.Height&&(o.Height=0),o}return this.documentHelper.heightInfoCollection[""+n]}var a=this.documentHelper.textMeasureHelper.getHeightInternal(e,r);return this.documentHelper.heightInfoCollection[""+n]=dd({},a),e.hidden&&(a.Height=0),a},i.prototype.getFormatText=function(e,i){var r="";r=t.isNullOrUndefined(i)?e.fontFamily.toLocaleLowerCase():i.toLocaleLowerCase();var n=e.bidi||e.complexScript,o=n?e.fontSizeBidi:e.fontSize,a=n?e.boldBidi:e.bold,s=n?e.italicBidi:e.italic;return r+=";"+o,a&&(r+=";bold"),s&&(r+=";italic"),r},i.prototype.measureTextExcludingSpaceAtEnd=function(e,t,i){return this.getWidth(bs.trimEnd(e),t,i)},i.prototype.getWidth=function(e,t,i){if(t.hidden)return 0;e.match("\v")&&e.replace("\v",this.lineBreakMark);var r="",n="",o="",a=t.bidi||t.complexScript,s=a?t.fontSizeBidi:t.fontSize;r=a?t.boldBidi?"bold":"":t.bold?"bold":"",n=a?t.italicBidi?"italic":"":t.italic?"italic":"",o=this.getFontNameToRender(i,t),s=0===s?.5:s/("Normal"===t.baselineAlignment?1:1.5),this.context.font=r+" "+n+" "+s+'pt "'+o+'"',this.context.letterSpacing=t.characterSpacing+"pt";var l=/(?:AV|VA|AW|WA|To|Ta|Te|Ty|Yo)/;this.context.fontKerning="auto",!t.isKernFont&&l.test(e)&&(this.context.fontKerning="none");var d=t.scaling/100;return t.allCaps&&(e=e.toUpperCase()),"̶"===e&&(e+="A"),Math.abs(this.context.measureText(e).width*d)},i.prototype.getWidthWithZWJ=function(e,t,i,r,n){return r.hidden?0:this.getWidth(e+t+i,r,n)-this.getWidth(i,r,n)},i.prototype.setText=function(e,i,r,n){if(t.isNullOrUndefined(n)&&(n=!1),!t.isNullOrUndefined(e)&&0===e.length)return"";var o=i;if(!o&&"RTL"===r||o&&"LTR"===r)e=bs.reverseString(e);else if(n&&o&&bs.endsWith(e)){var a=e.length-bs.trimEnd(e).length;e=bs.addSpace(a)+bs.trimEnd(e)}return e},i.prototype.measureText=function(e,t,i){var r=this.getWidth(e,t,i),n=this.getHeight(t,i);return{Width:r,Height:n.Height,BaselineOffset:n.BaselineOffset}},i.prototype.updateTextSize=function(e,t){if(!e.characterFormat.hidden||0!==t.height){var i=new S(void 0,this.documentHelper),r=e.listLevel.characterFormat,n=t.characterFormat;i.fontSize=r.hasValue("fontSize")?r.fontSize:n.fontSize,i.fontFamily=r.hasValue("fontFamily")?r.fontFamily:n.fontFamily;var o="",a="",s="Normal"===r.baselineAlignment?n.baselineAlignment:r.baselineAlignment;o=r.hasValue("bold")?r.bold?"bold":"":n.bold?"bold":"",a=r.hasValue("italic")?r.italic?"italic":"":n.italic?"italic":"",i.baselineAlignment=s,o&&(i.bold=!0),a&&(i.italic=!0);var l=i.bidi||this.isRTLText(e.text),d=this.setText(e.text,l,i.bdo);e.width=this.getWidth(d,i);var h=this.getHeight(i);e.height=h.Height,e.baselineOffset=h.BaselineOffset,i.destroy()}},i.prototype.containsSpecialCharAlone=function(e){for(var t="*|.:[]{}-`;()@&$#%!~?, '",i=0;i<e.length;i++)if(-1===t.indexOf(e.charAt(i)))return!1;return!0},i.prototype.containsNumberAlone=function(e){if(""===e)return!1;for(var t=0;t<e.length;t++)if(-1==="0123456789".indexOf(e.charAt(t)))return!1;return!0},i.prototype.containsCombinationText=function(e){return!(!e.text.match(/^[0-9]+$/)||!e.paragraph.bidi)},i.prototype.inverseCharacter=function(e){if(t.isNullOrUndefined(e)||0===e.length)return e;if(1===e.length)switch(e){case"(":return")";case")":return"(";case"<":return">";case">":return"<";case"{":return"}";case"}":return"{";case"[":return"]";case"]":return"[";default:return e}for(var i=!0,r=0;r<e.length;r++)if(!this.isWordSplitChar(e[r])){i=!1;break}if(!i)return e;for(var n="",r=e.length-1;r>=0;r--)n+=this.inverseCharacter(e[r]);return n},i.prototype.containsSpecialChar=function(e){for(var t="*|.:[]{}-`;()@&$#%!~? ",i=0;i<e.length;i++)if(-1!==t.indexOf(e.charAt(i)))return!0;return!1},i.prototype.isRTLText=function(e){var i=!1;if(!t.isNullOrUndefined(e))for(var r=0;r<e.length;r++){var n=e[r];if(n>=String.fromCharCode(1424)&&n<=String.fromCharCode(1535)||n>=String.fromCharCode(64285)&&n<=String.fromCharCode(64335)||n>=String.fromCharCode(1536)&&n<=String.fromCharCode(1791)||n>=String.fromCharCode(1872)&&n<=String.fromCharCode(1919)||n>=String.fromCharCode(2208)&&n<=String.fromCharCode(2303)||n>=String.fromCharCode(64336)&&n<=String.fromCharCode(65023)||n>=String.fromCharCode(65136)&&n<=String.fromCharCode(65279)||n>=String.fromCharCode(43392)&&n<=String.fromCharCode(43487)||n>=String.fromCharCode(1792)&&n<=String.fromCharCode(1871)||n>=String.fromCharCode(1920)&&n<=String.fromCharCode(1983)||n>=String.fromCharCode(2112)&&n<=String.fromCharCode(2143)||n>=String.fromCharCode(1984)&&n<=String.fromCharCode(2047)||n>=String.fromCharCode(2048)&&n<=String.fromCharCode(2111)||n>=String.fromCharCode(11568)&&n<=String.fromCharCode(11647)){i=!0;break}}return i},i.prototype.isUnicodeText=function(e,i,r){void 0===r&&(r=!1);var n=!1;if(!t.isNullOrUndefined(e))for(var o=0;o<e.length;o++){var a=e[o];if((a>=" "&&a<="ヿ"||a>=""&&a<=""||a>="一"&&a<="龯"||a>="㐀"&&a<="䶿"||a>="가"&&a<=""&&!(a>="ﹰ"&&a<="\ufeff")||a>=""&&a<=""||r&&(a>=""&&a<=""||a>="Ѐ"&&a<="ӿ"||a>="À"&&a<="ÿ"||a>="Ā"&&a<="ſ"||a>="ƀ"&&a<="ɏ"||a>="Ḁ"&&a<="ỿ"||a>=""&&a<=""||a>=""&&a<="ۿ"))&&(r||0!==i)){n=!0;break}}return n},i.prototype.readWord=function(e,t,i,r,n){for(var o=this._position,a=e.length,s="";o<a;){var l=!1,d=(s=e[o]).charCodeAt(0);switch((" "===s||""===s||" "===s&&!i||n&&d>=19968&&d<=40959)&&(l=!0),"/"!==s&&"."!==s&&","!==s&&"="!==s&&"*"!==s&&"«"!==s&&"»"!==s&&"?"!==s&&">"!==s&&"<"!==s||n||r||(l=!0),s){case" ":case"\t":case"\n":case"\r":case"\v":case"\f":case"\\":case":":case"-":l=!0}if(l){if(" "===s&&o<bs.trimEnd(e).length&&this.isTextContainsNonBreakingSpaceCharacter(e)&&this.isNonBreakingCharacterCombinedWithSpace(e,o)){o++;continue}o!==this._position&&"-"!==s||o++;var h=e.substring(this._position,o);return this._position=o,h}var c=this.getElementBoxOfChar(o,t);if(this.isUnicodeText(s,c.scriptType,!n)&&(o===this._position&&o++,o>this._position)){var g=e.substring(this._position,o);return this._position=o,g}o++}if(o>this._position){var p=e.substring(this._position,o);return this._position=o,p}return""},i.prototype.getElementBoxOfChar=function(e,t){for(var i=t.keys,r=t.values,n=0,o=r.length-1;n<=o;){var a=Math.floor((n+o)/2),s=r[a],l=i[a];if(e>=s&&e<s+l.text.length)return l;e<s?o=a-1:n=a+1}},i.prototype.isTextContainsNonBreakingSpaceCharacter=function(e){return("Word2013"===this.documentHelper.compatibilityMode||"Word2010"===this.documentHelper.compatibilityMode)&&e.indexOf(" ")>=0},i.prototype.isNonBreakingCharacterCombinedWithSpace=function(e,t){for(i=t+1;i<e.length;i++){if(" "==e[i])return!0;if(" "!=e[i])break}for(var i=t-1;i>=0;i--){if(" "==e[i])return!0;if(" "!=e[i])return!1}return!1},i.prototype.getRtlLanguage=function(e){return t.isNullOrUndefined(e)||""===e?{isRtl:!1,id:0}:e>=String.fromCharCode(1424)&&e<=String.fromCharCode(1535)?{isRtl:!0,id:1}:e>=String.fromCharCode(1536)&&e<=String.fromCharCode(1791)||e>=String.fromCharCode(1872)&&e<=String.fromCharCode(1919)||e>=String.fromCharCode(2208)&&e<=String.fromCharCode(2303)||e>=String.fromCharCode(64336)&&e<=String.fromCharCode(65023)||e>=String.fromCharCode(65136)&&e<=String.fromCharCode(65279)?{isRtl:!0,id:2}:e>=String.fromCharCode(43392)&&e<=String.fromCharCode(43487)?{isRtl:!0,id:3}:e>=String.fromCharCode(1792)&&e<=String.fromCharCode(1871)?{isRtl:!0,id:4}:e>=String.fromCharCode(1920)&&e<=String.fromCharCode(1983)?{isRtl:!0,id:5}:e>=String.fromCharCode(2112)&&e<=String.fromCharCode(2143)?{isRtl:!0,id:6}:e>=String.fromCharCode(1984)&&e<=String.fromCharCode(2047)?{isRtl:!0,id:7}:e>=String.fromCharCode(2048)&&e<=String.fromCharCode(2111)?{isRtl:!0,id:8}:e>=String.fromCharCode(11568)&&e<=String.fromCharCode(11647)?{isRtl:!0,id:9}:{isRtl:!1,id:0}},i.prototype.splitTextByConsecutiveLtrAndRtl=function(r,n,o,a,s,l,d,h){var c=a.length,g=[];if(t.isNullOrUndefined(r)||""===r)return g;for(var p=-1,u="",f="",m="",y="",v=!t.isNullOrUndefined(h)&&h.value,W=function(e){return v&&"-"===e},b=!t.isNullOrUndefined(s.value)&&s.value&&n&&/^\d+(\.\d+)+$/.test(r),x=0;x<r.length;x++){var w=0,F=!1;(t.isNullOrUndefined(s.value)?n:!s.value||!t.isNullOrUndefined(d.value)&&!d.value&&n&&!b)&&this.isNumber(r[x])?(y+=r[x],w=4):this.isWordSplitChar(r[x])?(w=2,F=n||32==r.charCodeAt(x)&&""==m,m+=r[x]):this.isRTLText(r[x])&&!this.isNumber(r[x])?(s.value=!1,l.value=!0,t.isNullOrUndefined(h)||(h.value=/[\u0590-\u05FF\uFB1D-\uFB4F]/.test(r[x])),f+=r[x],w=1):(s.value=!0,d.value=n,u+=r[x]),""!=y&&4!=w&&(g.push(y),a.push(e.CharacterRangeType.Number),y=""),""!=f&&1!=w&&(g.push(f),a.push(e.CharacterRangeType.RightToLeft),f=""),""!=u&&0!=w&&(g.push(u),p=g.length-1,a.push(e.CharacterRangeType.LeftToRight),u=""),""==m||2==w&&!F||(g.push(m),a.push(e.CharacterRangeType.WordSplit),m="")}if(""!=y?(g.push(y),a.push(e.CharacterRangeType.Number)):""!=f?(g.push(f),a.push(e.CharacterRangeType.RightToLeft)):""!=u?(g.push(u),p=g.length-1,a.push(e.CharacterRangeType.LeftToRight)):""!=m&&(g.push(m),a.push(e.CharacterRangeType.WordSplit)),l.value||!t.isNullOrUndefined(s.value)&&!s.value)for(x=1;x<g.length;x++)(P=a[x+c])==e.CharacterRangeType.WordSplit&&1==g[x].length&&x+c+1<a.length&&a[x+c-1]!=e.CharacterRangeType.WordSplit&&(a[x+c-1]!=e.CharacterRangeType.Number||i.isNumberNonReversingCharacter(g[x],n)||W(g[x]))&&a[x+c-1]==a[x+c+1]&&(g[x-1]=g[x-1]+g[x]+g[x+1],g.splice(x,1),g.splice(x,1),a.splice(x+c,1),a.splice(x+c,1),x--);else if(-1!=p)if(n){for(x=1;x<p;x++)if((P=a[x+c])==e.CharacterRangeType.WordSplit&&x<p&&a[x+c-1]==e.CharacterRangeType.LeftToRight){u="";for(var C=x+1;C<=p;C++)u+=g[C],g.splice(C,1),a.splice(C+c,1),C--,p--;g[x-1]=g[x-1]+g[x]+u,g.splice(x,1),a.splice(x+c,1),x--,p--}}else g.length=0,g.push(r);else n||(g.length=0,g.push(r));if(n)for(x=1;x<g.length;x++){var P=a[x+c];P==e.CharacterRangeType.WordSplit&&1==g[x].length&&x+c+1<a.length&&a[x+c-1]!=e.CharacterRangeType.WordSplit&&(a[x+c-1]!=e.CharacterRangeType.Number||i.isNumberNonReversingCharacter(g[x],n)||!o||W(g[x]))&&a[x+c-1]==a[x+c+1]?(g[x-1]=g[x-1]+g[x]+g[x+1],g.splice(x,1),g.splice(x,1),a.splice(x+c,1),a.splice(x+c,1),x--):P==e.CharacterRangeType.WordSplit&&a[x+c-1]==e.CharacterRangeType.Number&&this.isNonWordSplitCharacter(g[x])&&!o?(g[x-1]=g[x-1]+g[x],g.splice(x,1),a.splice(x+c,1),x--):P!=e.CharacterRangeType.LeftToRight||v&&/\d-\d$/.test(g[x-1])||a[x+c-1]!=e.CharacterRangeType.Number&&a[x+c-1]!=e.CharacterRangeType.LeftToRight||(g[x-1]=g[x-1]+g[x],a[x+c-1]=e.CharacterRangeType.LeftToRight,g.splice(x,1),a.splice(x+c,1),x--)}return g},i.prototype.isRightToLeftLanguage=function(e){return 14337==e||15361==e||5121==e||3073==e||2049==e||11265==e||13313==e||12289==e||4097==e||8193==e||16385==e||1025==e||10241==e||7169==e||9217==e||10655==e},i.prototype.isNumber=function(e){return!isNaN(parseInt(e,10))||(e>=String.fromCharCode(1632)&&e<=String.fromCharCode(1641)||e>=String.fromCharCode(1776)&&e<=String.fromCharCode(1785))},i.prototype.isWordSplitChar=function(e){for(var t=0;t<i.wordSplitCharacters.length;t++)if(i.wordSplitCharacters[t]===e)return!0;return!1},i.isNumberNonReversingCharacter=function(e,t){for(var r=0;r<i.numberNonReversingCharacters.length;r++){var n=i.numberNonReversingCharacters[r];if(e[0]==n&&(47!=n.charCodeAt(0)||!t))return!0}return!1},i.prototype.isNonWordSplitCharacter=function(e){for(var t=!1,i=0;i<e.length;i++){var r=e.charCodeAt(i);if(35!=r&&36!=r&&37!=r){t=!1;break}t=!0}return t},i.prototype.getFontNameToRender=function(i,r){return t.isNullOrUndefined(i)?r.fontFamily:r.bidi||r.complexScript?this.getFontNameBidiToRender(i,r):(this.isEastAsiaScript(i)||"EastAsia"===r.fontHintType&&i===e.FontScriptType.SpecialCharacter)&&!t.isNullOrUndefined(r.fontFamilyFarEast)?this.getFontNameEAToRender(i,r):this.getFontNameAsciiToRender(i,r)},i.prototype.isEastAsiaScript=function(t){return t==e.FontScriptType.Japanese||t==e.FontScriptType.Korean||t==e.FontScriptType.Chinese},i.prototype.getFontNameEAToRender=function(e,i){var r=i.fontFamilyFarEast;return t.isNullOrUndefined(r)||bs.isThemeFont(r)?this.getFontNameFromTheme(i,r,e,"EastAsia"):r},i.prototype.getFontNameAsciiToRender=function(e,t){var i=t.fontFamilyAscii;return bs.isThemeFont(i)?this.getFontNameFromTheme(t,i,e,"Default"):t.fontFamily},i.prototype.getFontNameBidiToRender=function(e,i){var r=i.fontFamilyBidi;return!t.isNullOrUndefined(r)||bs.isThemeFont(r)?this.getFontNameFromTheme(i,r,e,"CS"):r},i.prototype.getFontNameFromTheme=function(e,i,r,n){var o;if(!this.documentHelper.hasThemes||t.isNullOrUndefined(this.documentHelper.themes)||t.isUndefined(this.documentHelper.themes.fontScheme)||(o=this.documentHelper.themes.fontScheme),"majorAscii"==i||"majorBidi"==i||"majorEastAsia"==i||"majorHAnsi"==i){var a=void 0;null!=o&&null!=o.majorFontScheme&&(a=o.majorFontScheme),i=this.updateFontNameFromTheme(e,a,r,i,n)}else if("minorAscii"==i||"minorBidi"==i||"minorEastAsia"==i||"minorHAnsi"==i){var s=void 0;null!=o&&null!=o.majorFontScheme&&(s=o.minorFontScheme),i=this.updateFontNameFromTheme(e,s,r,i,n)}return(t.isNullOrUndefined(i)||bs.isThemeFont(i))&&(i="Times New Roman"),i},i.prototype.updateFontNameFromTheme=function(e,i,r,n,o){var a="";if(null!=i&&null!=i.fontSchemeList&&i.fontSchemeList.length>0&&i.fontSchemeList.forEach(function(e){("cs"!=e.name||"majorBidi"!=n&&"minorBidi"!=n)&&("ea"!=e.name||"majorEastAsia"!=n&&"minorEastAsia"!=n)?"latin"!=e.name||"majorAscii"!=n&&"majorHAnsi"!=n&&"minorAscii"!=n&&"minorHAnsi"!=n||(a=e.typeface):a=e.typeface}),null!=i&&null!=i.fontTypeface)if("CS"==o)(e.complexScript||e.bidi||"majorAscii"!==n&&"majorHAnsi"!==n&&"minorAscii"!==n&&"minorHAnsi"!==n)&&(!e.bidi||"majorHAnsi"!==n&&"minorHAnsi"!==n)?i.fontTypeface.containsKey("Arab")&&(a=i.fontTypeface.get("Arab")):n=a;else if("EastAsia"==o)t.isNullOrUndefined(this.documentHelper.themeFontLanguage)||(n=this.getFontNameWithFontScript(i,this.documentHelper.themeFontLanguage.localeIdFarEast,o),t.isNullOrUndefined(n)||(a=n));else if(t.isNullOrUndefined(a)&&!t.isNullOrUndefined(this.documentHelper.themeFontLanguage)&&("minorBidi"===n||"majorBidi"===n))return n=this.getFontNameWithFontScript(i,this.documentHelper.themeFontLanguage.localeIdBidi,o);return t.isNullOrUndefined(a)&&(a="Times New Roman"),n=a},i.prototype.getFontNameWithFontScript=function(e,t,i){var r=null,n=t.toString(),o=e.fontTypeface;return("gu_IN"!=n&&1095!=t||!o.containsKey("Gujr"))&&("hi_IN"!=n&&"mr_IN"!=n&&1081!=t&&1102!=t||!o.containsKey("Deva"))&&("ko_KR"!=n&&1042!=t||!o.containsKey("Hang"))?"zh_CN"!=n&&"zh_SG"!=n&&2052!=t||!o.containsKey("Hans")?("zh_TW"!=n&&"zh_HK"!=n&&"zh_MO"!=n||!o.containsKey("Hant"))&&!(("ja_JP"==n||1041==t)&&o.containsKey("Jpan")||("ta_IN"==n||1097==t)&&o.containsKey("Taml")||("te_IN"==n||1098==t)&&o.containsKey("Telu")||("he_IL"==n||"yi_Hebr"==n||1037==t)&&o.containsKey("Hebr"))?"th_TH"!=n&&1054!=t||!o.containsKey("Thai")?"CS"==i&&o.containsKey("Arab")&&(r=o.get("Arab")):r=o.get("Thai"):r=o.get("Arab"):r=o.get("Hans"):r=o.get("Arab"),r},i.prototype.destroy=function(){this.documentHelper=void 0,this.context=void 0,this.paragraphMarkInfo={},this.paragraphMarkInfo=void 0},i.wordSplitCharacters=[String.fromCharCode(32),String.fromCharCode(33),String.fromCharCode(34),String.fromCharCode(35),String.fromCharCode(36),String.fromCharCode(37),String.fromCharCode(38),String.fromCharCode(39),String.fromCharCode(40),String.fromCharCode(41),String.fromCharCode(42),String.fromCharCode(43),String.fromCharCode(44),String.fromCharCode(45),String.fromCharCode(46),String.fromCharCode(47),String.fromCharCode(58),String.fromCharCode(59),String.fromCharCode(60),String.fromCharCode(61),String.fromCharCode(62),String.fromCharCode(63),String.fromCharCode(64),String.fromCharCode(91),String.fromCharCode(92),String.fromCharCode(93),String.fromCharCode(94),String.fromCharCode(95),String.fromCharCode(96),String.fromCharCode(123),String.fromCharCode(124),String.fromCharCode(125),String.fromCharCode(126),String.fromCharCode(1548),String.fromCharCode(1563),String.fromCharCode(8211),String.fromCharCode(8212),String.fromCharCode(8216),String.fromCharCode(8217),String.fromCharCode(8221),String.fromCharCode(12288),String.fromCharCode(8207),String.fromCharCode(169),String.fromCharCode(160)],i.numberNonReversingCharacters=[String.fromCharCode(44),String.fromCharCode(46),String.fromCharCode(47),String.fromCharCode(58),String.fromCharCode(1548)],i}(),cd=function(e,t,i,r){return new(i||(i=Promise))(function(n,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){e.done?n(e.value):new i(function(t){t(e.value)}).then(a,s)}l((r=r.apply(e,t||[])).next())})},gd=function(e,t){function i(e){return function(t){return r([e,t])}}function r(i){if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,o&&(a=2&i[0]?o.return:i[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,i[1])).done)return a;switch(o=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return l.label++,{value:i[1],done:!1};case 5:l.label++,o=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(a=l.trys,!(a=a.length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){l.label=i[1];break}if(6===i[0]&&l.label<a[1]){l.label=a[1],a=i;break}if(a&&l.label<a[2]){l.label=a[2],l.ops.push(i);break}a[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}catch(e){i=[6,e],o=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}var n,o,a,s,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s},pd=1.4,ud=function(){function i(e){this.islayoutFootnote=!1,this.isMultiColumnDoc=!1,this.allowLayout=!0,this.isReplaceAll=!1,this.isTextFormat=!1,this.isSectionBreakCont=!1,this.isReplacingAll=!1,this.footHeight=0,this.existFootnoteHeight=0,this.isfootMove=!1,this.footnoteHeight=0,this.isTableFootNote=!1,this.isRelayout=!1,this.isRelayoutneed=!1,this.isOverlapFloatTable=!1,this.isInitialLoad=!0,this.isInsertFormField=!1,this.fieldBegin=void 0,this.maxTextHeight=0,this.maxBaseline=0,this.maxTextBaseline=0,this.isFieldCode=!1,this.isRtlFieldCode=!1,this.isRTLLayout=!1,this.isSkipFirstLineIndent=!1,this.currentCell=void 0,this.isFootnoteContentChanged=!1,this.isEndnoteContentChanged=!1,this.keepWithNext=!1,this.effectiveJustifyWidth=0,this.mergedParagraphOffset=0,this.is2013Justification=!1,this.nextElementToLayout=void 0,this.endNoteHeight=0,this.isMultiColumnSplit=!1,this.isMultiColumnLayout=!1,this.skipUpdateContainerWidget=!1,this.isIFfield=!1,this.skip2003=!1,this.textWrappingBottom=0,this.istableYpositionChange=!1,this.isLayoutWhole=!1,this.isBidiReLayout=!1,this.defaultTabWidthPixel=48,this.isRelayoutFootnote=!1,this.isRelayoutOverlap=!1,this.skipRelayoutOverlap=!1,this.isWrapText=!1,this.isYPositionUpdated=!1,this.isXPositionUpdated=!1,this.hasFloatingElement=!1,this.isFootNoteLayoutStart=!1,this.wrapPosition=[],this.isRtlShapeWrapAtStart=!1,this.shiftedFloatingItemsFromTable=[],this.isDocumentContainsRtl=!1,this.isPastingContent=!1,this.layoutedFootnoteElement=[],this.lastScrollUpdatePageIndex=-1,this.isAllColumnHasAutoWidthType=!1,this.isLayoutSwitch=!1,this.documentHelper=e}return Object.defineProperty(i.prototype,"owner",{get:function(){if(this.documentHelper)return this.documentHelper},enumerable:!0,configurable:!0}),i.prototype.isSameStyle=function(e,i){var r=void 0;if(i?e.nextWidget instanceof Qs&&(r=e.nextWidget):e.previousWidget instanceof Qs&&(r=e.previousWidget),t.isNullOrUndefined(r)){if(e.paragraphFormat.contextualSpacing&&e.isInsideTable&&(!this.documentHelper.allowSpaceOfSameStyleInTable||"Word2013"===this.documentHelper.compatibilityMode))if(0===e.index)r=this.updateFirstParagraphSpacingBasedOnContextualSpacing(e,i);else if(e.index===e.associatedCell.childWidgets.length-1&&(r=this.updateLastParagraphSpacingBasedOnContextualSpacing(e))===e)return!0;if(t.isNullOrUndefined(r))return!1}if(r instanceof Qs&&e.paragraphFormat.baseStyle===r.paragraphFormat.baseStyle&&(!e.isInsideTable||!this.documentHelper.allowSpaceOfSameStyleInTable)){if(e.paragraphFormat.listFormat.listId>=0&&r.paragraphFormat.listFormat.listId>=0&&!e.paragraphFormat.contextualSpacing){if(i&&e.paragraphFormat.spaceAfterAuto)return!0;if(!i&&e.paragraphFormat.spaceBeforeAuto)return!0}return e.paragraphFormat.contextualSpacing}return!1},i.prototype.updateFirstParagraphSpacingBasedOnContextualSpacing=function(e,i){var r,n=e.associatedCell,o=n.ownerRow,a=o.ownerTable;if(i){if(r=t.isNullOrUndefined(e.nextRenderedWidget)?t.isNullOrUndefined(n.nextRenderedWidget)?void 0:n.nextRenderedWidget.firstChild:e.nextRenderedWidget,n.index===o.childWidgets.length-1&&e.index===n.childWidgets.length-1&&"Normal"===e.paragraphFormat.baseStyle.name&&e.paragraphFormat.listFormat.listId<0)return e}else r=t.isNullOrUndefined(e.previousRenderedWidget)?t.isNullOrUndefined(n.previousRenderedWidget)?void 0:n.previousRenderedWidget.firstChild:e.previousRenderedWidget;if(0===n.index&&0===e.index){if(0!==o.index)return t.isNullOrUndefined(r)&&"Normal"===e.paragraphFormat.baseStyle.name&&e.paragraphFormat.listFormat.listId<0?e:r;if(!a.isInsideTable||0!=a.index)return t.isNullOrUndefined(e.nextRenderedWidget)&&!t.isNullOrUndefined(n.nextRenderedWidget)&&n.nextRenderedWidget.childWidgets.length>0&&n.nextRenderedWidget.firstChild instanceof Qs?n.nextRenderedWidget.firstChild:n.index===o.childWidgets.length-1&&e.index===n.childWidgets.length-1&&"Normal"===e.paragraphFormat.baseStyle.name&&e.paragraphFormat.listFormat.listId<0?e:a.previousRenderedWidget;r=this.checkOwnerTablePrevItem(a,e)}else if(0===e.index&&!i){var s=o.childWidgets[n.index-1];if(s.childWidgets[s.childWidgets.length-1]instanceof el&&"Normal"===e.paragraphFormat.baseStyle.name&&e.paragraphFormat.listFormat.listId<0)return e}return r},i.prototype.updateLastParagraphSpacingBasedOnContextualSpacing=function(e){var i,r=e.associatedCell,n=r.ownerRow;if(r.index===n.childWidgets.length-1&&e.index===r.childWidgets.length-1){if("Normal"===e.paragraphFormat.baseStyle.name&&e.paragraphFormat.listFormat.listId<0)return e}else if(e.index===r.childWidgets.length-1){var o=n.childWidgets[r.index+1];for(t.isNullOrUndefined(o)||t.isNullOrUndefined(o.firstChild)||(i=o.firstChild);i instanceof el;)i=i.childWidgets[0].childWidgets[0].childWidgets[0]}return i},i.prototype.checkOwnerTablePrevItem=function(e,t){var i=e.associatedCell.ownerRow;if(i.index>0){if("Normal"===t.paragraphFormat.baseStyle.name&&t.paragraphFormat.listFormat.listId<0)return t}else{if(!i.ownerTable.isInsideTable||0!==i.ownerTable.index)return i.ownerTable.previousRenderedWidget;this.checkOwnerTablePrevItem(i.ownerTable,t)}},Object.defineProperty(i.prototype,"viewer",{get:function(){return this.documentHelper.viewer},enumerable:!0,configurable:!0}),i.prototype.layout=function(){},i.prototype.destroy=function(){this.documentHelper=void 0,this.value=void 0,this.allowLayout=void 0,this.isInitialLoad=void 0,this.fieldBegin=void 0,this.maxTextHeight=void 0,this.maxBaseline=void 0,this.maxTextBaseline=void 0,this.isSkipFirstLineIndent=void 0,this.isFieldCode=void 0,this.footnoteHeight=void 0,this.isMultiColumnDoc=void 0,this.isIFfield=void 0,this.isPastingContent=void 0},i.prototype.layoutItems=function(e,i,r,n){var o=this,a=function(){return cd(o,void 0,void 0,function(){var i,o,a,s,l,d,h,c,g,p,u,f,m,y,v,W,b,x,w,F,C,P,T,O,S,N,I,k,A,L;return gd(this,function(U){switch(U.label){case 0:o=0,a=0,L=0,U.label=1;case 1:if(!(L<e.length))return[3,6];if(s=e[L],this.documentHelper.enableLayout)return[3,2];if(this.viewer.createNewPage(s),l=this.documentHelper.headersFooters[s.index])for(d in l)l.hasOwnProperty(d)&&((h=l[d]).page=s.page,h.headerSectionIndex=s.index);return[3,5];case 2:if(s.sectionFormat.numberOfColumns>1&&(this.isMultiColumnDoc=!0),c=e[L+1],this.viewer.columnLayoutArea.setColumns(s.sectionFormat),g=this.documentHelper.pages[this.documentHelper.pages.length-1],p=void 0,t.isNullOrUndefined(g)||t.isNullOrUndefined(g.bodyWidgets[g.bodyWidgets.length-1])||0!==g.bodyWidgets[g.bodyWidgets.length-1].childWidgets.length||t.isNullOrUndefined(g.bodyWidgets[g.bodyWidgets.length-1].previousSplitWidget)||(p=g.bodyWidgets[g.bodyWidgets.length-1].previousSplitWidget),!(L>0)||t.isNullOrUndefined(p)||t.isNullOrUndefined(p.lastChild)||p.lastChild instanceof el||(u=p.lastChild,x=u.previousRenderedWidget,u instanceof Qs&&u.isSectionBreak&&x instanceof Qs&&x.isEndsWithPageBreak&&(u=x),"Word2013"===this.documentHelper.compatibilityMode&&(u.isEndsWithPageBreak||u.isEndsWithColumnBreak)&&0===g.bodyWidgets[0].childWidgets.length&&((f=this.documentHelper.pages.splice(this.documentHelper.pages.length-1,1))[0].destroy(),g=this.documentHelper.pages[this.documentHelper.pages.length-1])),m=s.sectionFormat.breakCode,y=void 0,0!==L&&"Word2010"===this.documentHelper.compatibilityMode&&"NewColumn"===m&&(v=e[L-1].getSplitWidgets(),(y=v[v.length-1]).sectionFormat.columns.length>1&&s.sectionFormat.columns.length>1&&y.sectionFormat.columns.length===s.sectionFormat.columns.length&&y.sectionFormat.columns.length-1!==y.columnIndex&&!(y.lastChild instanceof Qs&&y.lastChild.isEndsWithPageBreak)&&(W=this.viewer.columnLayoutArea.getNextColumnByBodyWidget(y),t.isNullOrUndefined(W)||(s.columnIndex=W.index,s.isWord2010NextColumn=!0,s.y=y.y,this.viewer.clientActiveArea.height-=s.y-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=s.y))),s.isWord2010NextColumn||"NoBreak"===m||(m="NewPage"),b=void 0,0!==L&&(b=g.bodyWidgets[g.bodyWidgets.length-1].lastChild)&&(x=b.previousRenderedWidget,b instanceof Qs&&b.isSectionBreak&&x instanceof Qs&&(b=x)),0===L&&!r||0!==L&&!s.isWord2010NextColumn&&(t.isNullOrUndefined(m)||"NewPage"===m||o!==s.sectionFormat.pageHeight||a!==s.sectionFormat.pageWidth||!t.isNullOrUndefined(b)&&b.isEndsWithPageBreak)?i=this.viewer.createNewPage(s):(w=this.documentHelper.viewer.clientActiveArea.y,F=this.documentHelper.viewer.clientActiveArea.height,r&&(C=this.getBodyWidget(g.bodyWidgets[g.bodyWidgets.length-1],!0),P=this.getNextWidgetHeight(C),this.viewer.updateClientArea(C,C.page),F=this.viewer.clientActiveArea.height-(P-this.viewer.clientActiveArea.y),w=P,r=!1),(i=g).bodyWidgets.push(s),i.bodyWidgets[i.bodyWidgets.length-1].page=i,this.documentHelper.viewer.updateClientArea(s,i),this.documentHelper.viewer.clientActiveArea.y=w,this.documentHelper.viewer.clientActiveArea.height=F),o=s.sectionFormat.pageHeight,a=s.sectionFormat.pageWidth,this.addBodyWidget(this.viewer.clientActiveArea,s),this.documentHelper.pages.length>1){for(T=0,O=0;O<this.documentHelper.pages.length&&(S=this.documentHelper.pages[O],N=S.sectionIndex,I=s.index,!(N>I||S===i));O++)T++;T<this.documentHelper.pages.length-1&&this.documentHelper.insertPage(T,i)}return k=this.layoutSection(s,0,c,n),k instanceof Promise?[4,k]:[3,4];case 3:U.sent(),U.label=4;case 4:s.isWord2010NextColumn&&!t.isNullOrUndefined(y)&&(A=this.getNextWidgetHeight(y),this.viewer.clientActiveArea.y<A&&(this.viewer.updateClientArea(y,y.page),this.viewer.clientActiveArea.height=this.viewer.clientActiveArea.height-(A-this.viewer.clientActiveArea.y),this.viewer.clientActiveArea.y=A)),U.label=5;case 5:return L++,[3,1];case 6:if(this.documentHelper.enableLayout)this.updateFieldElements();else if("Pages"===this.documentHelper.layoutType)for(L=0;L<this.documentHelper.footnoteCollection.length;L++)this.layoutFootEndNoteElement(this.documentHelper.footnoteCollection[L]);return"Pages"===this.documentHelper.layoutType&&this.layoutEndNoteElement(),[2]}})})};return n?a():void a()},i.prototype.shouldScrollUpdateIn=function(){var e=this.documentHelper.pages.length,i=this.owner.documentEditorSettings.openAsyncSettings,r=t.isNullOrUndefined(i.initialPageLoadCount)||i.initialPageLoadCount<0?3:i.initialPageLoadCount,n=t.isNullOrUndefined(i.incrementalPageLoadCount)||i.incrementalPageLoadCount<0?5:i.incrementalPageLoadCount;return(e===r||e>r&&(e-r)%n==0)&&e!==this.lastScrollUpdatePageIndex&&(this.lastScrollUpdatePageIndex=e,!0)},i.prototype.layoutSection=function(e,i,r,n){var o,a=this,s=e.firstChild,l=function(){return cd(a,void 0,void 0,function(){var a,l,d,h,c,g,p,u=this;return gd(this,function(f){switch(f.label){case 0:return s?(!this.isLayoutWhole&&s instanceof el&&"Auto"===s.tableFormat.preferredWidthType&&!s.tableFormat.allowAutoFit&&s.calculateGrid(),t.isNullOrUndefined(s)?[3,4]:(this.viewer.updateClientAreaForBlock(s,!0,void 0,!0,!0),a=this.layoutBlock(s,i,void 0,n),a instanceof Promise?[4,a]:[3,2])):[3,7];case 1:return o=f.sent(),[3,3];case 2:o=a,f.label=3;case 3:i=0,this.viewer.updateClientAreaForBlock(s,!1),s=o,f.label=4;case 4:return n&&(l=this.shouldScrollUpdateIn())?(this.documentHelper.hooks.onProcessAsyncPageUpdate&&this.documentHelper.hooks.onProcessAsyncPageUpdate(e),this.documentHelper.isUpdatedWhileLoadAsync||(this.documentHelper.hooks.onPerformUpdateAfterLoad&&this.documentHelper.hooks.onPerformUpdateAfterLoad(!0),this.documentHelper.isUpdatedWhileLoadAsync=!0),[4,new Promise(function(e){var t=setTimeout(e,0);u.documentHelper.currentDocumentLoadId&&u.documentHelper.storeTimeoutId(u.documentHelper.currentDocumentLoadId,t)})]):[3,6];case 5:f.sent(),f.label=6;case 6:return[3,0];case 7:for(s=e.firstChild,this.viewer instanceof Es&&e.sectionFormat.numberOfColumns>1&&!t.isNullOrUndefined(r)&&"NoBreak"===r.sectionFormat.breakCode&&("NoBreak"===e.sectionFormat.breakCode||e.sectionIndex===e.page.bodyWidgets[0].sectionIndex)&&(this.getColumnBreak(e)?(d=e.getSplitWidgets(),h=d[d.length-1],t.isNullOrUndefined(e.page.nextPage)?(c=this.getBodyWidget(h,!0),this.viewer.updateClientArea(c,c.page),g=this.getNextWidgetHeight(c),this.viewer.clientActiveArea.height-=g-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=g):this.splitBodyWidgetBasedOnColumn(h)):(t.isNullOrUndefined(e.page.nextPage)||(e=this.documentHelper.pages[this.documentHelper.pages.length-1].bodyWidgets[0]),this.splitBodyWidgetBasedOnColumn(e))),s&&s.bodyWidget&&s.bodyWidget.page&&(p=s.bodyWidget.page);p;)p.footnoteWidget&&this.layoutfootNote(p.footnoteWidget),p=p.nextPage;return[2]}})})};return n?new Promise(function(e){return cd(a,void 0,void 0,function(){return gd(this,function(t){switch(t.label){case 0:return[4,l()];case 1:return t.sent(),e(),[2]}})})}):void l()},i.prototype.reLayoutMultiColumn=function(e,i,r){this.isInitialLoad=!0,e=e.getSplitWidgets()[0],this.combineMultiColumnForRelayout(e),e.sectionFormat.numberOfColumns>1&&(this.isMultiColumnDoc=!0),this.isMultiColumnSplit=!1;var n=e.previousRenderedWidget,o=e.nextRenderedWidget,a=!1;if(!i&&!t.isNullOrUndefined(e.firstChild)&&e.firstChild instanceof Qs&&e.y!==e.firstChild.y&&(e.y=e.firstChild.y),i&&o&&e.page!==o.page&&e.firstChild instanceof Qs){var s=0;if((c=e.firstChild).isEmpty())s=this.documentHelper.textHelper.getParagraphMarkSize(c.characterFormat).Height;else{var l=c.childWidgets[0];s=this.getMaxElementHeight(l)}var d=c.previousRenderedWidget;e.y===this.viewer.clientActiveArea.y&&s>this.viewer.clientActiveArea.height&&(d=t.isNullOrUndefined(d)?c:d,this.moveBlocksToNextPage(d),this.viewer.columnLayoutArea.setColumns(e.sectionFormat),this.viewer.updateClientArea(e,e.page),a=!0)}else if(!t.isNullOrUndefined(n)&&n.page!==e.page&&e.firstChild instanceof Qs&&n.lastChild instanceof Qs){var h=n.lastChild,c=e.firstChild;if(e instanceof Ys&&n.lastChild&&h instanceof Qs&&"NoBreak"===n.sectionFormat.breakCode&&e.page.index!==n.page.index&&e.index!==n.index){var g=n;g.sectionFormat.columns.length>1&&(g=this.getBodyWidget(g,!0));var p=bs.round(this.getNextWidgetHeight(g)+c.height,2);if(!n.lastChild.isEndsWithPageBreak&&!n.lastChild.isEndsWithColumnBreak&&p<=bs.round(this.viewer.clientActiveArea.bottom,2)){for(var u=n.page,f=e.page,m=0;m<f.bodyWidgets.length;m++){var y=f.bodyWidgets[m];f.bodyWidgets.splice(f.bodyWidgets.indexOf(y),1),u.bodyWidgets.splice(u.bodyWidgets.length,0,y),y.page=u,m--}e.y=this.viewer.clientActiveArea.y,this.documentHelper.removeEmptyPages()}}}a||(this.viewer.columnLayoutArea.setColumns(e.sectionFormat),this.viewer.updateClientArea(e,e.page),this.viewer.clientActiveArea.height-=e.y-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=e.y),this.addBodyWidget(this.viewer.clientActiveArea,e),this.clearBlockWidget(e.childWidgets,!0,!0,!0),this.isMultiColumnLayout=!0,this.reLayoutMultiColumnBlock(e,o,r),this.isMultiColumnLayout=!1,this.isInitialLoad=!1;var v=e.getSplitWidgets(),W=v[v.length-1],b=this.getBodyWidget(W,!0);this.viewer.updateClientArea(b,b.page);var x=this.getNextWidgetHeight(b);if(this.viewer.clientActiveArea.height-=x-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=x,!t.isNullOrUndefined(W)&&!t.isNullOrUndefined(W.nextRenderedWidget)){o=W.nextRenderedWidget;var w=this.documentHelper.viewer.clientActiveArea.y,F=this.documentHelper.viewer.clientActiveArea.height;this.documentHelper.viewer.updateClientArea(o,o.page),this.documentHelper.viewer.clientActiveArea.y=w,this.documentHelper.viewer.clientActiveArea.height=F,this.documentHelper.blockToShift=o.firstChild}(t.isNullOrUndefined(W.nextRenderedWidget)||!t.isNullOrUndefined(W.nextRenderedWidget)&&"NoBreak"!==W.sectionFormat.breakCode&&W.nextRenderedWidget.sectionFormat.pageHeight!==W.sectionFormat.pageHeight&&W.nextRenderedWidget.sectionFormat.pageWidth!==W.sectionFormat.pageWidth)&&(this.documentHelper.blockToShift=void 0)},i.prototype.combineMultiColumnForRelayout=function(e){var i=e.getSplitWidgets(),r=i[0];for(e=i[i.length-1];e!==r;){for(var n=e.previousRenderedWidget,o=!1,a=0;a<e.childWidgets.length;a++)e.childWidgets[a]instanceof Js&&!t.isNullOrUndefined(e.childWidgets[a].previousSplitWidget)&&!t.isNullOrUndefined(e.childWidgets[a].previousSplitWidget.previousSplitWidget)&&e.childWidgets[a].previousSplitWidget.bodyWidget.page!==e.childWidgets[a].previousSplitWidget.previousSplitWidget.bodyWidget.page&&(o=!0),e.childWidgets[a]instanceof Js&&!t.isNullOrUndefined(e.childWidgets[a].previousSplitWidget)&&e.childWidgets[a].previousSplitWidget.bodyWidget.page===e.childWidgets[a].bodyWidget.page&&!o?(e.childWidgets[a].combineWidget(this.viewer),n.lastChild instanceof el&&this.updateCellHeightInCombinedTable(n.lastChild),a--):(n.childWidgets.push(e.childWidgets[a]),e.childWidgets[a].containerWidget=n,e.childWidgets[a].containerWidget.page=n.page,e.childWidgets.splice(0,1),a--);e=e.previousRenderedWidget}this.documentHelper.removeEmptyPages()},i.prototype.reLayoutMultiColumnBlock=function(e,i,r){var n,o=e.firstChild;do{o instanceof el&&"Auto"===o.tableFormat.preferredWidthType&&!o.tableFormat.allowAutoFit&&o.calculateGrid(),t.isNullOrUndefined(o)||(this.viewer.updateClientAreaForBlock(o,!0,void 0,!0),n=this.layoutBlock(o,0,o.index<r),this.viewer.updateClientAreaForBlock(o,!1),o=n)}while(o&&-1!==e.getSplitWidgets().indexOf(o.bodyWidget));if(o=e.firstChild,this.viewer instanceof Es&&e.sectionFormat.numberOfColumns>1&&!t.isNullOrUndefined(i)&&"NoBreak"===i.sectionFormat.breakCode&&("NoBreak"===e.sectionFormat.breakCode||e.sectionIndex===e.page.bodyWidgets[0].sectionIndex)){var a=e.getSplitWidgets(),s=a[a.length-1];if(this.getColumnBreak(e))if(e.page!==s.page)this.splitBodyWidgetBasedOnColumn(s);else{var l=this.getBodyWidget(s,!0);this.viewer.updateClientArea(l,l.page);var d=this.getNextWidgetHeight(l);this.viewer.clientActiveArea.height-=d-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=d}else t.isNullOrUndefined(e.page.nextPage)||this.splitBodyWidgetBasedOnColumn(s)}},i.prototype.splitBodyWidgetBasedOnColumn=function(e){var i=e=this.getBodyWidget(e,!0);if(this.isMultiColumnSplit=!0,!this.isInitialLoad&&e.sectionFormat.equalWidth&&this.documentHelper.hooks.getSelectionOffsets&&this.documentHelper.hooks.selectRange){var r=this.documentHelper.hooks.getSelectionOffsets();this.combineMultiColumn(e),this.layoutMultiColumnBody(e,!1);var n=this.documentHelper.hooks.getSelectionOffsets();r.start!==n.start&&this.documentHelper.hooks.selectRange(r.start,r.end)}this.combineMultiColumn(e);for(var o=this.getCountOrLine(e,void 0,void 0,!0).lineCount,a=Math.round(o/e.sectionFormat.numberOfColumns);e;){var s=this.getCountOrLine(e,a,!0,!1),l=s.lineWidget,d=s.lineCount;if(!t.isNullOrUndefined(l)){if(l.paragraph.containerWidget instanceof Ys)this.moveToNextLine(l,!0,l.indexInOwner);else if(l.paragraph.containerWidget instanceof il){var h=[l.paragraph.containerWidget.ownerTable],c=[l.paragraph.containerWidget.ownerRow],g=l.paragraph.containerWidget.index;h[h.length-1].isInsideTable&&(h[h.length-1]=this.getParentTable(h[h.length-1]),c[c.length-1]=this.getParentRow(c[c.length-1])),this.updateWidgetsToTable(h,c,c[c.length-1],!1,d,g,!0);for(var p=h[h.length-1],u=c[c.length-1].nextRenderedWidget;u;)this.clearRowWidget(u,!0,!0,!1),u=(u=this.layoutRow(h,u)).nextRenderedWidget;!t.isNullOrUndefined(p.nextRenderedWidget)&&e.sectionFormat.equalWidth&&(this.documentHelper.blockToShift=p.nextRenderedWidget,this.documentHelper.layout.shiftLayoutedItems(!1))}var f=this.getBodyWidget(l.paragraph.bodyWidget,!0),m=this.getBodyWidget(f,!1);if(!f.sectionFormat.equalWidth&&m.sectionFormat.numberOfColumns-1===m.columnIndex&&t.isNullOrUndefined(m.nextSplitWidget)){var y=f,v=this.getCountOrLine(f).lineCount;this.layoutMultiColumnBody(y,!0),v!==this.getCountOrLine(f).lineCount&&this.splitBodyWidgetBasedOnColumn(f)}if(t.isNullOrUndefined(m.nextSplitWidget)){this.viewer.updateClientArea(f,f.page);var W=this.getNextWidgetHeight(f);this.viewer.clientActiveArea.height-=W-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=W,this.viewer.clientArea.y=this.viewer.clientActiveArea.y,this.viewer.clientArea.height=this.viewer.clientActiveArea.height}}if(e=e.nextRenderedWidget,!t.isNullOrUndefined(e)&&e.columnIndex===e.sectionFormat.numberOfColumns-1)break}this.isMultiColumnSplit=!1,this.isInitialLoad||(e=this.getBodyWidget(i,!1),t.isNullOrUndefined(e.nextRenderedWidget)||(this.documentHelper.blockToShift=e.nextRenderedWidget.firstChild))},i.prototype.getColumnBreak=function(e){var i=this.getBodyWidget(e,!0);if(i.sectionFormat.numberOfColumns<=1)return!1;for(;i;){if(i.lastChild instanceof Qs&&i.lastChild.isEndsWithColumnBreak)return!0;if(t.isNullOrUndefined(i.nextRenderedWidget)||i.index!==i.nextRenderedWidget.index)break;i=i.nextRenderedWidget}return!1},i.prototype.layoutMultiColumnBody=function(e,i){for(var r=!1;e;){r||(this.viewer.updateClientArea(e,e.page),this.viewer.clientActiveArea.height-=e.y-this.viewer.clientActiveArea.y,e instanceof Zs?(this.viewer.clientArea.height=Number.POSITIVE_INFINITY,this.viewer.clientActiveArea.height=Number.POSITIVE_INFINITY):this.viewer.clientActiveArea.y=e.y),r=!i;for(var n=0;n<e.childWidgets.length;n++){var o=e.childWidgets[n];o instanceof el&&this.clearTableWidget(o,!0,!0,!0),this.viewer.updateClientAreaForBlock(o,!0);var a=!1;o instanceof Qs&&!t.isNullOrUndefined(o.paragraphFormat)&&-1!==o.paragraphFormat.listFormat.listId&&(a=0===o.paragraphFormat.listFormat.listLevelNumber),this.layoutBlock(o,0,a),this.viewer.updateClientAreaForBlock(o,!1)}if(e.columnIndex===e.sectionFormat.numberOfColumns-1||!t.isNullOrUndefined(e.nextRenderedWidget)&&e.sectionIndex!==e.nextRenderedWidget.sectionIndex)break;e=e.nextRenderedWidget}},i.prototype.getNextWidgetHeight=function(e){for(var i=0,r=0;e&&e.childWidgets.length>0;){var n=e.lastChild;if(n instanceof Qs&&n.isSectionBreak&&n.previousRenderedWidget instanceof el&&"Word2013"!==this.documentHelper.compatibilityMode&&(n=n.previousRenderedWidget),n instanceof Qs&&this.isFirstElementWithPageBreak(n)&&n.isEndsWithColumnBreak){var o=n.previousWidget;o instanceof Qs&&0===r&&"Word2013"!==this.documentHelper.compatibilityMode?n=o:o instanceof el&&o.wrapTextAround&&o.previousWidget instanceof Qs&&(n=o.previousWidget)}if(i=n.height,n instanceof el&&(i=this.getHeight(n)),(i+=n.y)>r&&(r=i),!t.isNullOrUndefined(e)&&e.columnIndex===e.sectionFormat.numberOfColumns-1||0===e.sectionFormat.numberOfColumns||!t.isNullOrUndefined(e.nextRenderedWidget)&&e.sectionIndex!==e.nextRenderedWidget.sectionIndex)break;e=e.nextRenderedWidget}return r},i.prototype.getHeight=function(e){for(var t=0,i=0;i<e.childWidgets.length;i++)t+=e.childWidgets[i].height;return t},i.prototype.getBookmarkMargin=function(e){for(var i=0,r=0;r<e.children.length;r++){var n=e.children[r];if(!t.isNullOrUndefined(n.margin)&&n instanceof ml){i=n.margin.top+n.margin.bottom;break}}return i},i.prototype.getCountOrLine=function(e,i,r,n){for(var o,a,s=0,l=!1,d=0,h=0,c=0;e;){for(var g=0;g<e.childWidgets.length;g++){var p=e.childWidgets[g];if(p instanceof Qs){if(p.isSectionBreak)continue;for(var u=0;u<p.childWidgets.length;u++){var f=p.childWidgets[u];if(c=0,t.isNullOrUndefined(f.margin)||(c=f.margin.top+f.margin.bottom+this.getBookmarkMargin(f)),r){if(d+=f.height-c,Math.round(i)<Math.round(d)){o=p.childWidgets[u],l=!0;break}}else s++,d+=f.height-c}}else p instanceof el&&(a=this.getCountOrLineTable(p,i,r,d,!1,n),n?d+=a.lineCount:r?t.isNullOrUndefined(a.lineWidget)?d=a.lineCount:(o=a.lineWidget,h=a.lineCount,l=!0):s+=a.lineCount);if(l&&r)break}if(l&&r)break;if(!t.isNullOrUndefined(e.nextRenderedWidget)&&e.index!==e.nextRenderedWidget.index)break;e=e.nextRenderedWidget}return n?{lineWidget:void 0,lineCount:d}:r?{lineWidget:o,lineCount:h}:{lineWidget:void 0,lineCount:s}},i.prototype.getCountOrLineTable=function(e,i,r,n,o,a){for(var s,l,d=0,h=!1,c=0,g=0,p=0,u=0,f=0,m=0,y=0;y<e.childWidgets.length;y++){var v=e.childWidgets[y],W=void 0,b=void 0;p=0,u=0,f=0,m=0;for(O=0;O<v.childWidgets.length;O++){for(var x=v.childWidgets[O],w=0;w<x.childWidgets.length;w++)if((T=x.childWidgets[w])instanceof Qs&&T.childWidgets.length>0)for(var F=0;F<T.childWidgets.length;F++)p++,W=x,f+=T.childWidgets[F].height;else p+=(l=this.getCountOrLineTable(T,i,r,n,!0,a)).lineCount,f+=l.lineCount;u<p&&(u=p),m<f&&(m=f,b=W),p=0,f=0}if(!r||o)c+=u,g+=m;else for(var C=0,P=0;P<b.childWidgets.length;P++){var T=b.childWidgets[P];if(T instanceof Qs)for(var O=0;O<T.childWidgets.length;O++){if(n+=T.childWidgets[O].height,Math.round(i)<Math.round(n)){s=T.childWidgets[O],h=!0,n=0,d=C;break}if(C++,h&&r)break}else{if(l=this.getCountOrLineTable(T,i,r,n,!1,a),!t.isNullOrUndefined(l.lineWidget)){h=!0,n=0,s=l.lineWidget,d=C+=l.lineCount;break}C+=l.lineCount,n+=T.height}if(h&&r)break}if(u=0,h&&r)break}return a?{lineWidget:void 0,lineCount:g}:r?r&&t.isNullOrUndefined(s)&&o?{lineWidget:void 0,lineCount:c}:r&&t.isNullOrUndefined(s)&&!o?{lineWidget:void 0,lineCount:n}:{lineWidget:s,lineCount:d}:{lineWidget:void 0,lineCount:c}},i.prototype.combineMultiColumn=function(e){for(e=this.getBodyWidget(e,!1);e&&0!==e.columnIndex;){var i=e.previousRenderedWidget;if(i.lastChild instanceof Qs&&i.lastChild.isEndsWithColumnBreak)break;for(var r=!1,n=0;n<e.childWidgets.length;n++)if(e.childWidgets[n]instanceof Js&&!t.isNullOrUndefined(e.childWidgets[n].previousSplitWidget)&&!t.isNullOrUndefined(e.childWidgets[n].previousSplitWidget.previousSplitWidget)&&e.childWidgets[n].previousSplitWidget.bodyWidget.page!==e.childWidgets[n].previousSplitWidget.previousSplitWidget.bodyWidget.page){if(r=!0,e.childWidgets[n]instanceof el&&i.lastChild instanceof el)for(var o=e.childWidgets[n],a=i.lastChild,s=a.childWidgets[a.childWidgets.length-1].index,l=0;l<o.childWidgets.length;l++){var d=o.childWidgets[l];d.index!==s?(a.childWidgets.push(d),d.containerWidget=a):o.combineRows(this.viewer)}else if(e.childWidgets[n]instanceof Qs&&i.lastChild instanceof Qs){var h=e.childWidgets[n],c=i.lastChild;if(h.index==c.index)for(l=0;l<h.childWidgets.length;l++){var g=h.childWidgets[l];c.childWidgets.push(g),g.paragraph=c}}e.childWidgets.splice(n,1),n--}else e.childWidgets[n]instanceof Js&&!t.isNullOrUndefined(e.childWidgets[n].previousSplitWidget)&&e.childWidgets[n].previousSplitWidget.bodyWidget.page===e.childWidgets[n].bodyWidget.page&&!r?(e.childWidgets[n].combineWidget(this.viewer),i.lastChild instanceof el&&this.updateCellHeightInCombinedTable(i.lastChild),n--):(i.childWidgets.push(e.childWidgets[n]),e.childWidgets[n].containerWidget=i,e.childWidgets[n].containerWidget.page=i.page,e.childWidgets.splice(0,1),n--);e=e.previousRenderedWidget}this.documentHelper.removeEmptyPages()},i.prototype.updateCellHeightInCombinedTable=function(e){for(var t=0,i=0,r=0;r<e.childWidgets.length;r++){for(var n=e.childWidgets[r],o=0;o<n.childWidgets.length;o++){for(var a=n.childWidgets[o],s=0;s<a.childWidgets.length;s++)i+=a.childWidgets[s].height;i>t&&(t=i),i=0;for(var l=0;l<n.childWidgets.length;l++)n.childWidgets[l].height=t}t=0}},i.prototype.layoutHeaderFooter=function(e,t,i){var r=this.documentHelper.renderedLists,n=this.documentHelper.renderedLevelOverrides;this.documentHelper.renderedLists=new p,this.documentHelper.renderedLevelOverrides=[];try{this.layoutHeaderFooterInternal(e,t,i)}finally{this.documentHelper.renderedLists=r,this.documentHelper.renderedLevelOverrides=n}},i.prototype.layoutHeaderFooterInternal=function(e,i,r){var n=i.getCurrentPageHeaderFooter(e,!0);if(n){a=n;t.isNullOrUndefined(n.page)&&(n.page=r,n.height=0,this.clearBlockWidget(n.childWidgets,!0,!0,!0),i.updateHFClientArea(e.sectionFormat,!0),this.layoutHeaderFooterItems(i,n),this.skip2003=!1,e.sectionFormat.topMargin<r.boundingRectangle.bottom&&n.floatingElements.length>0&&"Behind"!==n.floatingElements[0].textWrappingStyle&&n.floatingElements.some(function(e){return"TopMargin"===e.verticalOrigin&&"Bottom"===e.verticalAlignment})&&this.shiftItemsForVerticalAlignment(n)),(n=a.clone()).parentHeaderFooter=a,this.clearBlockWidget(n.childWidgets,!0,!0,!0);var o=n;o.page=r,o.height=0,this.updateRevisionsToHeaderFooter(o,r),i.updateHFClientArea(e.sectionFormat,!0),r.headerWidget=this.layoutHeaderFooterItems(i,o),this.skip2003=!1,e.sectionFormat.topMargin<r.boundingRectangle.bottom&&r.headerWidget.floatingElements.length>0&&"Behind"!==r.headerWidget.floatingElements[0].textWrappingStyle&&(r.headerWidget=this.shiftItemsForVerticalAlignment(o))}if(n=i.getCurrentPageHeaderFooter(e,!1)){var a=n;t.isNullOrUndefined(n.page)&&(n.page=r,n.height=0,this.clearBlockWidget(n.childWidgets,!0,!0,!0),i.updateHFClientArea(e.sectionFormat,!1),this.layoutHeaderFooterItems(i,n),this.skip2003=!1),(n=a.clone()).parentHeaderFooter=a,this.clearBlockWidget(n.childWidgets,!0,!0,!0);var s=n;s.page=r,s.height=0,i.updateHFClientArea(e.sectionFormat,!1),this.updateRevisionsToHeaderFooter(s,r),r.footerWidget=this.layoutHeaderFooterItems(i,s),this.skip2003=!1}},i.prototype.shiftItemsForVerticalAlignment=function(e){for(var t=e.floatingElements,i=0;i<t.length;i++){var r=t[i],n=r.verticalOrigin,o=r.paragraph;if("Margin"!==n||o.isInsideTable){if("TopMargin"===n&&"Bottom"===r.verticalAlignment&&!o.isInsideTable){var a=e.y+e.height-r.height;a>r.y&&(r.y=a,r instanceof Pl&&this.updateChildLocationForCellOrShape(r.y+r.textFrame.marginTop,r))}}else if(0!=(a=r.verticalPosition)){var s=(a+=this.viewer.clientActiveArea.y)-r.y;if(r.y=a,r instanceof Pl)for(var l=0;l<r.textFrame.childWidgets.length;l++){var d=r.textFrame.childWidgets[l];d instanceof Qs&&(d.y=d.y+s)}}}return e},i.prototype.updateHeaderFooterToParent=function(e){var t=e.page.sectionIndex,i=this.viewer.getHeaderFooter(e.headerFooterType),r=e.clone();this.documentHelper.headersFooters[t][i]=r;for(var n=0;n<r.childWidgets.length;n++){var o=r.childWidgets[n];o instanceof el&&this.clearTableWidget(o,!1,!0)}return r},i.prototype.updateRevisionsToHeaderFooter=function(e,t){var i=e.childWidgets;if(e instanceof Xs&&i.length>0)for(var r=0;r<i.length;r++)i[r]instanceof Qs?this.updateRevisionsToHeaderFooterParagraph(i[r],t):i[r]instanceof el&&this.updateRevisionsToHeaderFooterTable(i[r],t)},i.prototype.updateRevisionRange=function(e,i){for(var r=0;r<e.getRange().length;r++){var n=e.getRange()[r];n instanceof nl&&!t.isNullOrUndefined(n.line.paragraph.bodyWidget)&&!t.isNullOrUndefined(n.line.paragraph.bodyWidget.page)?n.line.paragraph.bodyWidget.page=i:n instanceof S&&!t.isNullOrUndefined(n.ownerBase.bodyWidget)&&!t.isNullOrUndefined(n.ownerBase.bodyWidget.page)?n.ownerBase.bodyWidget.page=i:n instanceof W&&!t.isNullOrUndefined(n.ownerBase.bodyWidget)&&!t.isNullOrUndefined(n.ownerBase.bodyWidget.page)&&(n.ownerBase.bodyWidget.page=i)}},i.prototype.updateRevisionsToHeaderFooterParagraph=function(e,t){if(e.childWidgets.length>0)for(s=0;s<e.childWidgets.length;s++)for(var i=e.childWidgets[s],r=0;r<i.children.length;r++){var n=i.children[r];if(n.removedIds.length>0)for(var o=n.removedIds,a=0;a<o.length;a++){l=this.documentHelper.revisionsInternal.get(o[a]);n.insertRevisionAt(a,l),o.splice(a,1),a--,this.updateRevisionRange(l,t)}}if(e.characterFormat.removedIds.length>0)for(var o=e.characterFormat.removedIds,s=0;s<o.length;s++){var l=this.documentHelper.revisionsInternal.get(o[s]);e.characterFormat.insertRevisionAt(s,l),o.splice(s,1),s--,this.updateRevisionRange(l,t)}},i.prototype.updateRevisionsToHeaderFooterTable=function(e,t){for(var i=0;i<e.childWidgets.length;i++){for(var r=e.childWidgets[i],n=0;n<r.childWidgets.length;n++)for(var o=r.childWidgets[n],a=0;a<o.childWidgets.length;a++)o.childWidgets[a]instanceof Qs?this.updateRevisionsToHeaderFooterParagraph(o.childWidgets[a],t):o.childWidgets[a]instanceof el&&this.updateRevisionsToHeaderFooterTable(o.childWidgets[a],t);if(r.rowFormat.removedIds.length>0)for(var s=r.rowFormat.removedIds,l=0;l<s.length;l++){var d=this.documentHelper.revisionsInternal.get(s[l]);r.rowFormat.insertRevisionAt(l,d),s.splice(l,1),l--,this.updateRevisionRange(d,t)}}},i.prototype.linkFieldInHeaderFooter=function(e){var t=e.firstChild;do{t instanceof Qs?this.linkFieldInParagraph(t):this.linkFieldInTable(t)}while(t=t.nextWidget)},i.prototype.linkFieldInParagraph=function(e){for(var i=0;i<e.childWidgets.length;i++)for(var r=e.childWidgets[i],n=0;n<r.children.length;n++){var o=r.children[n];if(o instanceof ol&&(0!==o.fieldType||0===o.fieldType&&-1===this.documentHelper.fields.indexOf(o))&&o.linkFieldCharacter(this.documentHelper),o instanceof ul&&!t.isNullOrUndefined(o.previousElement)&&o.previousElement instanceof ol&&o.fieldBegin!==o.previousElement.fieldBegin&&(o.fieldBegin=o.previousElement.fieldBegin),o instanceof Pl){var a=o.textFrame.firstChild;if(a)do{a instanceof Qs?this.linkFieldInParagraph(a):this.linkFieldInTable(a)}while(a=a.nextWidget)}else if(o instanceof Jl){var s=this.getCommentById(this.documentHelper.comments,o.commentId);t.isNullOrUndefined(s)||(0===o.commentType?s.commentStart=o:s.commentEnd=o,o.comment=s)}}},i.prototype.getCommentById=function(e,t){for(var i=0;i<e.length;i++){var r=e[i];if(r.commentId===t)return r}},i.prototype.linkFieldInTable=function(e){for(var t=0;t<e.childWidgets.length;t++)for(var i=e.childWidgets[t],r=0;r<i.childWidgets.length;r++)for(var n=i.childWidgets[r],o=0;o<n.childWidgets.length;o++){var a=n.childWidgets[o];a instanceof Qs?this.linkFieldInParagraph(a):this.linkFieldInTable(a)}},i.prototype.layoutHeaderFooterItems=function(e,t){if(this.viewer.updateClientAreaLocation(t,e.clientActiveArea),0===t.childWidgets.length){var i=new Qs,r=new rl(i);i.childWidgets.push(r),t.childWidgets.push(i),i.containerWidget=t}this.linkFieldInHeaderFooter(t);for(var n=0;n<t.childWidgets.length;n++){var o=t.childWidgets[n];o instanceof el&&"Auto"===o.tableFormat.preferredWidthType&&!o.tableFormat.allowAutoFit&&!o.isGridUpdated&&o.calculateGrid(),e.updateClientAreaForBlock(o,!0),this.layoutBlock(o,0),e.updateClientAreaForBlock(o,!1)}var a=t.headerFooterType;return this.skip2003=!1,"OddFooter"!==a&&"EvenFooter"!==a&&"FirstPageFooter"!==a||this.shiftChildLocation(e.clientArea.y-e.clientActiveArea.y,t),t},i.prototype.shiftChildLocation=function(e,t){var i=t.y+e,r=t.page.boundingRectangle.height-t.page.boundingRectangle.height/100*40;"Word2003"===this.documentHelper.compatibilityMode&&(r=t.page.boundingRectangle.height-t.page.boundingRectangle.height/100*50),e=(i=Math.max(i,r))-t.y;for(var n=t.y=i,o=0;o<t.childWidgets.length;o++){var a=t.childWidgets[o];if(a instanceof Qs){a.x=a.x,a.y=a.y+e,n+=a.height;for(var s=0;s<a.childWidgets.length;s++)for(var l=a.childWidgets[s],d=0;d<l.children.length;d++){var h=l.children[d];if(h instanceof Cl&&"Inline"!==h.textWrappingStyle){if("Paragraph"===h.verticalOrigin||"Line"===h.verticalOrigin){if("Word2013"===this.documentHelper.compatibilityMode&&a.y+a.height-h.y!==Math.abs(h.verticalPosition)?h.y+=e:h.y=a.y+h.verticalPosition,"Paragraph"===h.verticalOrigin&&"TopAndBottom"==h.textWrappingStyle){var c=new zs(h.x,h.y,h.width,h.height),g=new zs(a.x,a.y,a.width,a.height);c.isIntersecting(g)&&(h.y=a.y-h.height)}}else{var p=this.getFloatingItemPoints(h);h.y=p.y}if(h instanceof Pl){u=h.textFrame.marginTop;this.updateChildLocationForCellOrShape(h.y+u,h)}}else if(h instanceof Pl&&"Inline"===h.textWrappingStyle){h.y+=e;var u=h.textFrame.marginTop;this.updateChildLocationForCellOrShape(h.y+u,h)}}}else this.shiftChildLocationForTableWidget(a,e),n+=a.height}return e},i.prototype.shiftChildLocationForTableWidget=function(e,t){e.y=e.y+t;for(var i=0;i<e.childWidgets.length;i++){var r=e.childWidgets[i];r instanceof tl&&this.shiftChildLocationForTableRowWidget(r,t)}},i.prototype.shiftChildLocationForTableRowWidget=function(e,t){e.y=e.y+t;for(var i=0;i<e.childWidgets.length;i++)this.shiftChildLocationForTableCellWidget(e.childWidgets[i],t)},i.prototype.shiftChildLocationForTableCellWidget=function(e,i){e.y=e.y+i;for(var r=0;r<e.childWidgets.length;r++)if(e.childWidgets[r]instanceof Qs){e.childWidgets[r].x=e.childWidgets[r].x,e.childWidgets[r].y=e.childWidgets[r].y+i;var n=e.childWidgets[r].floatingElements;if(!t.isNullOrUndefined(n)&&n.length>0)for(var o=0;o<n.length;o++)"Inline"===n[o].textWrappingStyle&&n[o]instanceof Pl&&(n[o].y+=i,this.updateChildLocationForCellOrShape(n[o].y,n[o]))}else this.shiftChildLocationForTableWidget(e.childWidgets[r],i)},i.prototype.layoutBlock=function(e,t,i,r){var n,o=this;if(e instanceof Qs){if((this.isInitialLoad||!this.isRelayout||e.paragraphFormat.bidi||"Justify"===e.paragraphFormat.textAlignment&&this.isRelayout||this.isDocumentContainsRtl)&&(e.splitTextRangeByScriptType(0),e.splitLtrAndRtlText(0),e.combineconsecutiveRTL(0)),(s=this.layoutParagraph(e,t,i,r))instanceof Promise)return s.then(function(t){n=t;var i=o.checkAndRelayoutPreviousOverlappingBlock(e);return i&&(n=i),n.nextRenderedWidget});n=s;var a=this.checkAndRelayoutPreviousOverlappingBlock(e);a&&(n=a)}else{var s=this.layoutTable(e,t,r);if(s instanceof Promise)return s.then(function(t){return n=t,o.checkAndRelayoutPreviousOverlappingBlock(e),o.updateTableYPositionBasedonTextWrap(n),n.nextRenderedWidget});n=s,this.checkAndRelayoutPreviousOverlappingBlock(e),this.isFloatTableSplitOnPageThatFits(e)&&(n=this.layoutFloatTableOnNextPage(e)),this.updateTableYPositionBasedonTextWrap(n)}return n.nextRenderedWidget},i.prototype.updateTableYPositionBasedonTextWrap=function(e){var i=this;if(!(t.isNullOrUndefined(e.bodyWidget)||e.containerWidget instanceof Ol)){var r=e.y,n=new zs(e.x,e.y,e.width,e.height);e.bodyWidget.floatingElements.forEach(function(t){if(t instanceof Pl&&!t.paragraph.isInsideTable){if(i.isRelayout&&("Paragraph"===t.verticalOrigin||"Line"===t.verticalOrigin)&&i.documentHelper.hooks.isBlockExistAfter(t.paragraph,e))return;var o=new zs(t.x,t.y,t.width,t.height);if(("TopAndBottom"===t.textWrappingStyle||"Square"===t.textWrappingStyle)&&n.isIntersecting(o)){e.y=t.y+t.height+t.distanceBottom,i.updateChildLocationForTable(e.y,e);var a=e.y-r;i.viewer.cutFromTop(i.viewer.clientActiveArea.y+a)}}})}},i.prototype.shiftWrapStyle=function(e){return"InFrontOfText"===e.textWrappingStyle||"Behind"===e.textWrappingStyle||"Inline"===e.textWrappingStyle},i.prototype.checkAndRelayoutPreviousOverlappingBlock=function(e){if(!(e.containerWidget instanceof Ol||this.isRelayoutOverlap)){var t=e.previousWidget;if(e instanceof Qs){if(e.floatingElements.length>0)for(var i=0,r=0;r<e.floatingElements.length;r++){var n=e.floatingElements[r];if(!this.shiftWrapStyle(n)){for(var o=new zs(n.x,n.y,n.width,n.height);t;){if(e.isInsideTable&&i>this.viewer.clientArea.height){this.startOverlapWidget=void 0,this.endOverlapWidget=void 0;break}if(t instanceof Qs){var a=new zs(t.x,t.y,t.width,t.height);o.isIntersecting(a)&&this.startOverlapWidget!==t&&(this.startOverlapWidget=t,this.endOverlapWidget=e)}i+=t.height,t=t.previousWidget}t=e.previousWidget}}else if(y=e.getSplitWidgets())return y[y.length-1]}else{var s=e;if(!s.wrapTextAround||s.isFieldCodeBlock)return s;for(var l=s.positioning?new zs(s.x-s.positioning.distanceLeft,s.y-s.positioning.distanceTop,s.getTableCellWidth()+s.positioning.distanceLeft+s.positioning.distanceRight,s.height+s.positioning.distanceTop+s.positioning.distanceBottom):new zs(s.x,s.y,s.getTableCellWidth(),s.height);t;){if(t instanceof Qs){var d=bs.convertPointToPixel(t.paragraphFormat.afterSpacing),h=t.paragraphFormat.lineSpacing>0?bs.convertPointToPixel(t.paragraphFormat.lineSpacing):0,c=new zs(t.x,t.y,t.width,t.height-(d+h));l.isTableIntersecting(c)&&this.startOverlapWidget!==t&&(this.startOverlapWidget=t,this.endOverlapWidget=e)}t=t.previousWidget}t=e.previousWidget}if(e instanceof Qs&&e.containerWidget instanceof Ys&&e.floatingElements.length>0&&!this.shiftWrapStyle(e.floatingElements[0])&&e.containerWidget.firstChild!=e&&e.y+e.floatingElements[0].height>this.viewer.clientArea.bottom){var g=e.previousWidget;g&&g instanceof Qs&&g.y+g.height+this.getLineHeigth(e,e.floatingElements[0].line)+e.floatingElements[0].height>this.viewer.clientArea.bottom&&(this.moveToNextPage(this.viewer,e.floatingElements[0].line,!1,!1,!0),this.startOverlapWidget=e,this.endOverlapWidget=e)}if(this.startOverlapWidget){var p=!1;if(e instanceof el&&e.wrapTextAround&&!e.isInsideTable){var u=e.positioning?e.positioning.distanceBottom:0,f=e.positioning?e.positioning.distanceTop:0;e.y+e.height+u+f>this.viewer.clientArea.bottom&&(this.moveBlocksToNextPage(e.previousRenderedWidget),this.reLayoutTable(e),p=!0)}if(!p){this.isRelayoutOverlap=!0,this.skipRelayoutOverlap=!0;var m=e instanceof Qs&&e.isInsideTable;m&&this.viewer.updateClientAreaForBlock(e,!1),this.layoutStartEndBlocks(this.startOverlapWidget,e),m&&this.viewer.updateClientAreaForBlock(e,!0),this.isRelayoutOverlap=!1,this.skipRelayoutOverlap=!1}}this.startOverlapWidget=void 0,this.endOverlapWidget=void 0}if(e instanceof Qs&&e.isEndsWithColumnBreak){var y=e.getSplitWidgets();return y?y[y.length-1]:e}return e},i.prototype.getLineHeigth=function(e,t){for(var i=0,r=0;r<e.childWidgets.length;r++)t!=e.childWidgets[r]&&(i+=e.childWidgets[r].height);return i},i.prototype.addParagraphWidget=function(e,i){if(this.isNeedToUpdateXPositionForEmptyParagraph(i))this.updateXPositionForEmptyParagraph(e,i),i.y=e.y;else{this.viewer.clientActiveArea.width<=0&&this.viewer instanceof Ms?i.x=this.previousPara:(i.x=e.x,this.previousPara=i.x),i.width=e.width,i.y=e.y;var r=0;if(this.viewer instanceof Ms&&!t.isNullOrUndefined(i.previousWidget)&&i.previousWidget instanceof Qs&&i.previousWidget.isEndsWithPageBreak&&!i.previousWidget.isInsideTable&&i.bodyWidget.floatingElements.length>0){for(var n=0;n<i.bodyWidget.floatingElements.length;n++)r<i.bodyWidget.floatingElements[n].height+i.bodyWidget.floatingElements[n].y&&(r=i.bodyWidget.floatingElements[n].height+i.bodyWidget.floatingElements[n].y);i.y<r&&(i.y=r,e.y=r)}i.clientX=void 0,i.hasOwnProperty("absoluteXPosition")&&delete i.absoluteXPosition}return i},i.prototype.isNeedToUpdateXPositionForEmptyParagraph=function(e){return e.isEmpty()&&!t.isNullOrUndefined(e.paragraphFormat)&&("Center"===e.paragraphFormat.textAlignment||"Right"===e.paragraphFormat.textAlignment||"Justify"===e.paragraphFormat.textAlignment&&e.paragraphFormat.bidi)&&-1===e.paragraphFormat.listFormat.listId},i.prototype.updateXPositionForEmptyParagraph=function(e,i){if(i.isEmpty()&&!t.isNullOrUndefined(i.paragraphFormat)){var r=this.documentHelper.textHelper.getParagraphMarkWidth(i.characterFormat);i.clientX=e.x;var n=e.x;i.absoluteXPosition={width:e.width,x:e.x},"Center"===i.paragraphFormat.textAlignment?n+=(e.width-r)/2:"Right"!==i.paragraphFormat.textAlignment||i.bidi?n+=e.width-r:n+=e.width,i.width=r,i.x=n}},i.prototype.addLineWidget=function(e){var t=void 0;return t=new rl(e),t.width=e.width,e.childWidgets.push(t),t.paragraph=e,t},i.prototype.isFirstElementWithPageBreak=function(e){var t=!1;if(this.viewer instanceof Es){var i=e.childWidgets[0];if(i)for(var r=i.children[0];r;){if(!(r instanceof ml&&r.name.indexOf("_")>=0)){r instanceof hl&&("\f"===r.text||r.text===String.fromCharCode(14))&&(t=!0);break}r=r.nextElement}}return t},i.prototype.layoutfootNote=function(e){if("Pages"===this.documentHelper.layoutType){var i=e.page.index,r=this.viewer.clientActiveArea.clone(),n=this.viewer.clientArea.clone();"Footnote"===e.footNoteType&&e.sectionFormat.columns.length>1&&!this.isInitialLoad&&(this.updateColumnIndex(e.bodyWidgets[0],!1),this.layoutMultiColumnBody(e.bodyWidgets[0],!0)),"Endnote"===e.footNoteType&&e.bodyWidgets[0].sectionFormat.numberOfColumns>1&&(this.isInitialLoad||this.updateColumnIndex(e.bodyWidgets[0],!1),this.layoutMultiColumnBody(e.bodyWidgets[0],!0),this.viewer.clientActiveArea=r);var o=0;e.sectionFormat.columns.length>1&&"Footnote"===e.footNoteType&&(this.viewer.updateClientArea(e,e.page),o=this.viewer.clientActiveArea.width),"Footnote"===e.footNoteType&&(this.viewer.updateFootnoteClientArea(e.sectionFormat,e),e.sectionFormat.columns.length>1&&(this.viewer.clientActiveArea.width=o,this.viewer.clientArea.width=o)),e.height=0;var a=void 0,s=0;this.isRelayoutFootnote=!1;var l=0;this.viewer instanceof Es&&e.bodyWidgets.length>0&&("Footnote"===e.footNoteType&&e.sectionFormat.columns.length>1||"Endnote"===e.footNoteType&&e.bodyWidgets[0].sectionFormat.columns.length>1)&&(this.isLayoutWhole&&this.updateColumnIndex(e.bodyWidgets[0],!1),this.splitFootNoteWidgetBasedOnColumn(e.bodyWidgets[0]));for(var d=e.bodyWidgets[0],h=0,c=0;c<e.bodyWidgets.length;c++){if(e.bodyWidgets[c].columnIndex!==d.columnIndex&&("Footnote"===e.footNoteType&&e.sectionFormat.columns.length>1||"Endnote"===e.footNoteType&&e.bodyWidgets[c].sectionFormat.columns.length>1)&&(this.viewer.updateClientArea(e.bodyWidgets[c],e.bodyWidgets[c].page),o=this.viewer.clientActiveArea.width,h=this.viewer.clientActiveArea.x,"Footnote"===e.footNoteType&&this.viewer.updateFootnoteClientArea(e.sectionFormat,e),this.viewer.clientActiveArea.x=h,this.viewer.clientArea.x=h,this.viewer.clientActiveArea.width=o,this.viewer.clientArea.width=o,this.viewer.cutFromTop(e.y+s)),0===c){var g=new Qs;g.characterFormat=new S(void 0,this.documentHelper),g.paragraphFormat=new Ls,g.index=0;var p=new rl(g);g.childWidgets.push(p),s=this.documentHelper.textHelper.getParagraphMarkSize(g.characterFormat).Height,e.height+=s,e.y=this.viewer.clientActiveArea.y,"Endnote"===e.footNoteType&&this.viewer.updateClientArea(e.bodyWidgets[c],e.bodyWidgets[c].page,!0),this.viewer.cutFromTop(e.y+s),e.margin=new js(0,s,0,0)}l="Endnote"===e.footNoteType?0:l;for(var u=0;u<e.bodyWidgets[c].childWidgets.length&&(a=e.bodyWidgets[c].childWidgets[u],"Footnote"!==e.footNoteType&&1!==e.bodyWidgets[c].getSplitWidgets().length||(a.index=l,l++),a.containerWidget=e.bodyWidgets[c],a.containerWidget.page=e.page,a.containerWidget.containerWidget=e,this.viewer.updateClientAreaForBlock(a,!0),a instanceof el&&(this.clearTableWidget(a,!0,!0,!0),this.isRelayoutFootnote=!0,"Footnote"===e.footNoteType&&(this.viewer.clientArea.height=Number.POSITIVE_INFINITY,this.viewer.clientActiveArea.height=Number.POSITIVE_INFINITY)),this.layoutBlock(a,0),!t.isNullOrUndefined(e.bodyWidgets[c]));u++)e.bodyWidgets[c].columnIndex===d.columnIndex&&(e.height+=a.height),this.viewer.updateClientAreaForBlock(a,!1);d=e.bodyWidgets[c]}if(e.sectionFormat.columns.length>1){var f=this.getFootNoteBodyHeight(e.bodyWidgets[0]);e.height=f+s}if("Footnote"===e.footNoteType&&this.shiftChildWidgetInFootnote(e),"Footnote"===e.footNoteType&&e.sectionFormat.columns.length>1&&e.page.bodyWidgets[e.page.bodyWidgets.length-1].sectionFormat.columns.length>1){var m=this.getBodyWidget(e.page.bodyWidgets[e.page.bodyWidgets.length-1],!0);if(this.getNextWidgetHeight(m)>e.y){this.footnoteHeight=e.height;var y=this.isLayoutWhole;this.isLayoutWhole=!1,this.layoutMultiColumnBody(m,!0),this.isLayoutWhole=y}}if(this.viewer.clientActiveArea=r,this.viewer.clientArea=n,!this.islayoutFootnote&&this.viewer.clientActiveArea.y+this.viewer.clientActiveArea.height>e.y){this.viewer.clientActiveArea.height-=e.height;var v=this.viewer.clientActiveArea.y+this.viewer.clientActiveArea.height-e.y;this.viewer.clientActiveArea.height-=v}if("Endnote"===e.footNoteType){var W=void 0;if(t.isNullOrUndefined(e.page.nextPage)||t.isNullOrUndefined(e.page.nextPage.endnoteWidget)?e.page.index!==i&&(W=e):W=e.page.nextPage.endnoteWidget,!t.isNullOrUndefined(W)){var b=this.getBodyWidget(W.page.bodyWidgets[W.page.bodyWidgets.length-1],!0);this.viewer.updateClientArea(b,b.page),this.layoutfootNote(W)}}}return this.footnoteHeight=0,e},i.prototype.getFootNoteBodyHeight=function(e){for(var t=0;e&&0===e.columnIndex;){for(var i=0;i<e.childWidgets.length;i++)t+=e.childWidgets[i].height;e=e.nextRenderedWidget}return t},i.prototype.splitFootNoteWidgetBasedOnColumn=function(e){for(var i=this.getCountOrLine(e,void 0,void 0,!0).lineCount,r=Math.round(i/e.sectionFormat.numberOfColumns);e;){var n=this.getCountOrLine(e,r,!0,!1),o=this.viewer.clientActiveArea.clone(),a=this.viewer.clientArea.clone();if(0===n.lineWidget.paragraph.indexInOwner&&0===n.lineWidget.indexInOwner)this.updateColumnIndex(n.lineWidget.paragraph.bodyWidget,!0);else{this.splitParagraph(n.lineWidget.paragraph,n.lineWidget.indexInOwner,void 0);var s=this.moveBlocksToNextPage(n.lineWidget.paragraph.previousRenderedWidget);this.viewer.clientActiveArea=o,this.viewer.clientArea=a,t.isNullOrUndefined(s.nextRenderedWidget)||this.updateColumnIndex(s.nextRenderedWidget,!0)}if(n.lineWidget.paragraph.bodyWidget.columnIndex===n.lineWidget.paragraph.bodyWidget.sectionFormat.numberOfColumns-1)break;e=e.nextRenderedWidget}},i.prototype.updateColumnIndex=function(e,i,r){if(r){var n=e;do{if(!i&&0===n.columnIndex)break;if(i?n.columnIndex++:n.columnIndex--,!t.isNullOrUndefined(n.nextRenderedWidget)&&n.sectionIndex!==n.nextRenderedWidget.sectionIndex)break;n=n.nextRenderedWidget}while(n)}else for(;e;)i?e.columnIndex++:e.columnIndex=0,e=e.nextRenderedWidget},i.prototype.shiftChildWidgetInFootnote=function(e){var t=e.page,i=e.y-e.height;if(1===t.bodyWidgets[0].childWidgets.length&&t.bodyWidgets[0].firstChild){var r=t.bodyWidgets[0].firstChild.y,n=this.getBodyWidgetHeight(t.bodyWidgets[0]);i<r+n&&(i=r+n)}e.y=i;for(var o=i+=e.margin.top,a=e.bodyWidgets[0],s=0;s<e.bodyWidgets.length;s++){e.bodyWidgets[s].columnIndex!==a.columnIndex&&(i=o),a=e.bodyWidgets[s];for(var l=0;l<e.bodyWidgets[s].childWidgets.length;l++){var d=e.bodyWidgets[s].childWidgets[l];d instanceof Qs?(d.y=i,i+=d.height):(this.shiftChildLocationForTableWidget(d,i-d.y),i+=d.height)}}},i.prototype.getBodyWidgetHeight=function(e){for(var t=0,i=0;i<e.childWidgets.length;i++)t+=e.childWidgets[i].height;return t},i.prototype.checkBlockHasField=function(e){if(!(e instanceof Qs))return this.checkTableHasField(e);for(var t=0,i=e.childWidgets;t<i.length;t++)for(var r=0,n=i[t].children;r<n.length;r++){var o=n[r];if(o instanceof ol&&(2===o.fieldType||1===o.fieldType)&&this.documentHelper.fieldStacks.length>0&&o.fieldBegin===this.documentHelper.fieldStacks[this.documentHelper.fieldStacks.length-1])return!0}return!1},i.prototype.checkTableHasField=function(e){for(var t=0,i=e.childWidgets;t<i.length;t++)for(var r=0,n=i[t].childWidgets;r<n.length;r++)for(var o=0,a=n[r].childWidgets;o<a.length;o++){var s=a[o];if(this.checkBlockHasField(s))return!0}return!1},i.prototype.layoutParagraph=function(e,i,r,n){var o=this;if(!this.documentHelper.enableLayout)return null;if(this.isFieldCode&&!this.checkBlockHasField(e))return 0===e.childWidgets.length&&this.addLineWidget(e),e.isFieldCodeBlock=!0,e;if(e.isSectionBreak&&e.previousRenderedWidget instanceof el&&"Word2013"!==this.documentHelper.compatibilityMode)return 0===e.childWidgets.length&&this.addLineWidget(e),e;e.x=0,e.textWrapWidth=!1,this.addParagraphWidget(this.viewer.clientActiveArea,e);var a=e.previousWidget;if(0===i&&a instanceof Qs&&this.isMergedWithNextParagraph(a)){var s=Math.max(0,this.getMergedParagraphOffset(e));e.x+=s,this.mergedParagraph=e,this.mergedParagraphOffset=s,this.viewer.updateClientWidth(-s)}var l=!0;this.isFirstElementWithPageBreak(e)||(this.layoutListItems(e,r),l=!1);var d=i<e.childWidgets.length?e.childWidgets[i]:void 0,h=function(){return o.normalizeBookmarkEndForParagraph(e),o.updateWidgetToPage(o.viewer,e),o.isMergedWithNextParagraph(e)&&(e.height=0,o.viewer.clientActiveArea.y=e.y),e.isLayouted=!0,e.isFieldCodeBlock=!1,e};if(e.isEmptyInternal(!0)&&!this.checkIsFieldParagraph(e))return this.layoutEmptyLineWidget(e,!0),h();this.isRelayoutOverlap||e.containerWidget instanceof Ol||this.layoutFloatElements(e);var c=function(){if(t.isNullOrUndefined(d))return!1;if(e!==d.paragraph&&0===d.indexInOwner&&l&&(d.previousLine.isEndsWithColumnBreak?(o.viewer.updateClientAreaForBlock(e,!0),o.layoutListItems(d.paragraph),o.viewer.updateClientAreaForBlock(e,!1)):o.layoutListItems(d.paragraph)),d.isFirstLine()&&t.isNullOrUndefined(o.fieldBegin)&&!t.isNullOrUndefined(e.paragraphFormat)){var i=-bs.convertPointToPixel(e.paragraphFormat.firstLineIndent);o.viewer.updateClientWidth(i)}return d.marginTop=0,0===(d=o.layoutLine(d,0)).height&&!d.paragraph.characterFormat.hidden&&o.checkIsHiddenElement(d)&&o.layoutEmptyLineWidget(d.paragraph,!1,d),e=d.paragraph,d=d.nextLine,!0};if(n)return new Promise(function(t){var i=function(){if(!c())return void t(h());if(o.shouldScrollUpdateIn()){var r=void 0;e.bodyWidget instanceof Ys&&(r=e.bodyWidget.getSplitWidgets()[0]),o.documentHelper.hooks.onProcessAsyncPageUpdate&&o.documentHelper.hooks.onProcessAsyncPageUpdate(r),o.documentHelper.isUpdatedWhileLoadAsync||(o.documentHelper.hooks.onPerformUpdateAfterLoad&&o.documentHelper.hooks.onPerformUpdateAfterLoad(!0),o.documentHelper.isUpdatedWhileLoadAsync=!0);var n=setTimeout(i,0);o.documentHelper.currentDocumentLoadId&&o.documentHelper.storeTimeoutId(o.documentHelper.currentDocumentLoadId,n)}else i()};i()});for(;c(););return h()},i.prototype.normalizeBookmarkEndForParagraph=function(e){if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(e.childWidgets)&&0!==e.childWidgets.length){var i=e.childWidgets[0];if(!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(i.children)&&0!==i.children.length){var r=i.children[0];if(r instanceof ml&&1===r.bookmarkType&&t.isNullOrUndefined(r.properties)&&!t.isNullOrUndefined(r.line)&&!t.isNullOrUndefined(r.line.paragraph)&&-1!=i.children.indexOf(r)&&0===i.children.indexOf(r)&&!bs.startsWith(r.name,"_")){var n=r.reference;if(!t.isNullOrUndefined(n)&&!t.isNullOrUndefined(n.line)&&!t.isNullOrUndefined(n.line.paragraph)){var o=n.line.paragraph;if(o!==r.line.paragraph&&(t.isNullOrUndefined(o.bodyWidget)||t.isNullOrUndefined(o.bodyWidget.page)))return}var a=r.line.paragraph.previousRenderedWidget;if(!t.isNullOrUndefined(a)){var s,l;if(a instanceof el?(s=this.documentHelper.getLastParagraphInLastCell(a),l="isAfterRowMark"):a instanceof Qs&&(s=a,l="isAfterParagraphMark"),!t.isNullOrUndefined(s)){var d=s.lastChild;if(!t.isNullOrUndefined(d)){var h=r.line,c=h.children.indexOf(r);if(-1!==c){if(!t.isNullOrUndefined(r.margin)&&r.margin.left>0){var g=r.margin.left;if(c+1<h.children.length){var p=h.children[c+1];t.isNullOrUndefined(p)||(t.isNullOrUndefined(p.margin)&&(p.margin=new js(0,0,0,0)),p.margin.left=g)}r.margin.left=0}h.children.splice(c,1),d.children.push(r),r.line=d,r.properties={},r.properties="isAfterRowMark"===l?{isAfterRowMark:!0}:{isAfterParagraphMark:!0}}}}}}}}},i.prototype.checkIsFieldParagraph=function(e){if(t.isNullOrUndefined(e.childWidgets)||0===e.childWidgets.length)return!1;for(var i=0;i<e.childWidgets.length;i++)for(var r=e.childWidgets[i],n=0;n<r.children.length;n++){var o=r.children[n];if(o instanceof ol&&o.hasFieldEnd)return!0}return!1},i.prototype.checkIsHiddenElement=function(e){if(t.isNullOrUndefined(e.children)||0===e.children.length)return!1;for(var i=0;i<e.children.length;i++){var r=e.children[i];if(r instanceof hl&&r.characterFormat.hidden)return!0}return!1},i.prototype.clearLineMeasures=function(){this.maxBaseline=0,this.maxTextBaseline=0,this.maxTextHeight=0},i.prototype.layoutFloatElements=function(e){var t=this;e.floatingElements.forEach(function(e){e instanceof Cl&&"Inline"!==e.textWrappingStyle&&(t.isRelayoutOverlap||t.layoutShape(e))})},i.prototype.layoutShape=function(e,i){if(!(e instanceof Tl&&e.childWidgets&&e.childWidgets.length<=0)){if("Inline"!==e.textWrappingStyle){if(i){var r=e.paragraph,n=r.bodyWidget;e.x=n.x,e.y=r.y}else{var o=this.getFloatingItemPoints(e);e.x=o.x,e.y=o.y}!t.isNullOrUndefined(e.paragraph)&&!e.paragraph.isInsideTable&&0!==e.paragraph.indexInOwner&&e.verticalPosition>=0&&Math.round(e.paragraph.y)>=Math.round(e.y)&&this.viewer.clientArea.bottom<=e.y+e.height&&("Line"==e.verticalOrigin||"Paragraph"==e.verticalOrigin)&&"InFrontOfText"!==e.textWrappingStyle&&"Behind"!==e.textWrappingStyle&&(this.moveToNextPage(this.viewer,e.line),this.updateShapeBaseLocation(e.line.paragraph));var a=e.paragraph?e.paragraph.bodyWidget:void 0;if(!t.isNullOrUndefined(a)&&-1===a.floatingElements.indexOf(e)){if(a.floatingElements.push(e),a.floatingElements.sort(function(e,t){return e.y-t.y}),!t.isNullOrUndefined(e.paragraph)&&e.paragraph.containerWidget instanceof il){var s=e.paragraph.containerWidget.ownerTable,l=void 0;if(!t.isNullOrUndefined(s.previousSplitWidget)&&s.previousSplitWidget instanceof el&&!t.isNullOrUndefined(s.previousSplitWidget.bodyWidget)&&(l=s.previousSplitWidget.bodyWidget.floatingElements),!t.isNullOrUndefined(l)&&l.indexOf(e)>-1){var d=e.paragraph.containerWidget.bodyWidget.previousSplitWidget;t.isNullOrUndefined(d)||-1===d.floatingElements.indexOf(e)||d.floatingElements.splice(d.floatingElements.indexOf(e),1),t.isNullOrUndefined(l)||-1===l.indexOf(e)||l.splice(l.indexOf(e),1)}}if(!t.isNullOrUndefined(a.nextRenderedWidget)){var h=a.nextRenderedWidget;if(!t.isNullOrUndefined(h.floatingElements)){var c=h.floatingElements.indexOf(e);-1!==c&&h.floatingElements.splice(c,1)}}}-1===e.paragraph.floatingElements.indexOf(e)&&e.paragraph.floatingElements.push(e)}else if(0===e.width&&0!==e.widthScale){var g=bs.convertPointToPixel(e.line.paragraph.getContainerWidth());e.width=g/100*e.widthScale}var p=this.viewer.clientArea,u=this.viewer.clientActiveArea;if(e instanceof Pl){var f=e.textFrame.childWidgets;this.viewer.updateClientAreaForTextBoxShape(e,!0);for(var m=0;m<f.length;m++){var y=f[m];this.viewer.updateClientAreaForBlock(y,!0),y instanceof el&&this.clearTableWidget(y,!0,!0),this.layoutBlock(y,0),this.viewer.updateClientAreaForBlock(y,!1)}}else e instanceof Tl&&this.layoutGroupShape(e);this.viewer.clientActiveArea=u,this.viewer.clientArea=p}},i.prototype.layoutGroupShape=function(e){var t=this.viewer.clientArea,i=this.viewer.clientActiveArea;"Inline"===e.textWrappingStyle&&(e.y=this.viewer.clientActiveArea.y,e.x=this.viewer.clientActiveArea.x);for(var r=e.childWidgets,n=0;n<r.length;n++)this.updateChildShapePosition(e,r[n]),r[n]instanceof Tl&&this.updateNestedShapePosition(r[n]);this.updateShapeTextPosition(e),this.viewer.clientActiveArea=i,this.viewer.clientArea=t},i.prototype.getExtentXValue=function(e){for(var t=0,i=e.coordinateXOrigin,r=e.childWidgets,n=0;n<r.length;n++)if(r[n]instanceof Pl||r[n]instanceof Il){var o=r[n].leftMargin-i+r[n].shapeWidth;t<o&&(t=o)}return t},i.prototype.getExtentYValue=function(e){for(var t=0,i=e.coordinateYOrigin,r=e.childWidgets,n=0;n<r.length;n++)if(r[n]instanceof Pl||r[n]instanceof Il){var o=r[n].topMargin-i+r[n].shapeHeight;t<o&&(t=o)}return t},i.prototype.updateShapeTextPosition=function(e){for(var t=0;t<e.childWidgets.length;t++){var i=e.childWidgets[t];if(i instanceof Pl){this.viewer.updateClientAreaForTextBoxShape(i,!0);for(var r=i.textFrame.childWidgets,n=0;n<r.length;n++){var o=r[n];o instanceof Qs?this.linkFieldInParagraph(o):o instanceof el&&this.linkFieldInTable(o),this.viewer.updateClientAreaForBlock(o,!0),o instanceof el&&this.clearTableWidget(o,!0,!0),this.layoutBlock(o,0),this.viewer.updateClientAreaForBlock(o,!1)}}else i instanceof Tl&&this.updateShapeTextPosition(i)}},i.prototype.updateChildShapePosition=function(e,t){var i=0,r=0;t.is2007Shape?(i=t.leftMargin-e.coordinateXOrigin,r=t.topMargin-e.coordinateYOrigin):t instanceof Tl?(i=t.offsetXValue-e.shapeX,r=t.offsetYValue-e.shapeY):(i=t.shapeX-e.shapeX,r=t.shapeY-e.shapeY),e.extentXValue=e.is2007Shape?this.getExtentXValue(e):e.extentXValue,e.extentYValue=e.is2007Shape?this.getExtentYValue(e):e.extentYValue;var n=e.height/e.extentYValue,o=e.width/e.extentXValue;t.x=e.x+i*o,t.y=e.y+r*n,t.height=t.shapeHeight*n,t.width=t.shapeWidth*o},i.prototype.updateNestedShapePosition=function(e){for(var t=0;t<e.childWidgets.length;t++)if(e.childWidgets[t]instanceof Tl)this.updateChildShapePosition(e,e.childWidgets[t]),this.updateNestedShapePosition(e.childWidgets[t]);else for(var i=0;i<e.childWidgets.length;i++)this.updateChildShapePosition(e,e.childWidgets[i])},i.prototype.splitFirstWordFromElement=function(e,t,i){var r=i.text,n=r.indexOf(" "),o=r.substring(0,n),a=r[n],s=r.substring(n+1),l=new hl;l.text=o,l.characterFormat.copyFormat(i.characterFormat),l.height=i.height,l.baselineOffset=i.baselineOffset,l.characterRange=i.characterRange,l.scriptType=i.scriptType,l.width=this.documentHelper.textHelper.getWidth(o,i.characterFormat,i.scriptType),l.trimEndWidth=l.width;var d=new hl;d.text=a,d.characterFormat.copyFormat(i.characterFormat),d.height=i.height,d.baselineOffset=i.baselineOffset,d.characterRange=i.characterRange,d.scriptType=i.scriptType,d.width=this.documentHelper.textHelper.getWidth(a,i.characterFormat,i.scriptType),d.trimEndWidth=0,0===s.length?t.children.splice(0,0,d):(i.text=s,i.width=this.documentHelper.textHelper.getWidth(s,i.characterFormat,i.scriptType)," "===s[s.length-1]?i.trimEndWidth=this.documentHelper.textHelper.getWidth(bs.trimEnd(s),i.characterFormat,i.scriptType):i.trimEndWidth=i.width),l.line=e,e.children.push(l),d.line=e,e.children.push(d)},i.prototype.moveElementFromNextLine=function(e){var t=e.nextLine,i=e.paragraph.bodyWidget;for(t&&!i.sectionFormat.equalWidth&&i.columnIndex!==t.paragraph.bodyWidget.columnIndex&&(t=void 0);t instanceof rl;)if(t.children.length>0){t.layoutedElements=void 0;for(var r=t.children[0],n=!0;n;){if(r instanceof hl&&"Justify"===t.paragraph.paragraphFormat.textAlignment&&r.characterFormat.bidi&&r.text.indexOf(" ")>0&&r.text.trim().length>0){this.splitFirstWordFromElement(e,t,r),n=!1;break}t.children.splice(0,1),e.children.push(r),r.line=e,n=!1,r.nextNode&&r.nextNode instanceof hl&&t.paragraph.bidi&&0!==r.nextNode.text.indexOf(" ")&&r.nextNode.text.trim().length>0&&(n=!0,r=r.nextNode)}if(!n)break}else 1===t.paragraph.childWidgets.length?t.paragraph.destroy():(t.paragraph.childWidgets.splice(t.paragraph.childWidgets.indexOf(t),1),this.documentHelper.editorProperties&&this.documentHelper.editorProperties.selectedWidgets.containsKey(t)&&t.indexInOwner<0&&this.documentHelper.editorProperties.selectedWidgets.remove(t)),t=e.nextLine},i.prototype.layoutLine=function(e,i){var r=e.paragraph;0===e.children.length&&this.moveElementFromNextLine(e);var n=e.children[i],o=!0;if(n instanceof ol&&e.children[e.children.length-1]instanceof ol){o=!1;for(var a=0;a<e.children.length;a++)if(2==e.children[a].fieldType&&void 0!=e.children[a].nextElement&&!(e.children[a].nextElement instanceof ol)){o=!0;break}}for(this.clearLineMeasures(),e.marginTop=0;n instanceof nl;){if(n instanceof kl||(n.padding.left=0),o?this.layoutElement(n,r):(this.layoutElement(n,r,!0),o=!0),e=n.line,n instanceof hl){var s=n,l=this.owner.editorProperties.enableSpellCheck;if((!l||l&&!this.owner.editorProperties.skipChangeDetection)&&!t.isNullOrUndefined(s.errorCollection)&&s.errorCollection.length>0&&(s.isChangeDetected=!0),l&&!t.isNullOrUndefined(s.errorCollection)&&s.errorCollection.length>0)for(var d=0;d<s.errorCollection.length;d++)-1===s.errorCollection[d].start.currentWidget.indexInOwner&&(s.errorCollection[d].start.currentWidget=e),-1===s.errorCollection[d].end.currentWidget.indexInOwner&&(s.errorCollection[d].end.currentWidget=e)}if(this.isRTLLayout)n=void 0,this.isRTLLayout=!1;else{var h=r.childWidgets.indexOf(n.line);if(h>0&&this.hasFloatingElement)this.hasFloatingElement=!1,r.bodyWidget.floatingElements.length>0&&n instanceof hl&&!(r.containerWidget instanceof il)&&(n=r.childWidgets[h].children[0]);else{if(this.hasFloatingElement=!1,!this.is2013Justification||t.isNullOrUndefined(this.nextElementToLayout)||!t.isNullOrUndefined(n.paragraph.containerWidget.containerShape)&&n.paragraph.containerWidget.containerShape===this.nextElementToLayout){if((n=n.nextElement)instanceof hl&&0==n.text.indexOf(" ")&&n.text.length>2&&t.isNullOrUndefined(n.nextElement)&&n.text.trim().length>0){n.text=n.text.substring(1,n.text.length),n.isWidthUpdated=!1;var c=n.line.children.indexOf(n);if(n.line.children.splice(c,1),(s=new hl).text=" ",s.line=n.line,s.characterFormat.copyFormat(n.characterFormat),n.revisionLength>0)for(var g=0;g<n.revisionLength;g++){var p=n.getRevision(g);s.addRevision(p)}n.line.children.splice(c,0,s),n.line.children.splice(c+1,0,n),n=s}}else n=this.nextElementToLayout;this.nextElementToLayout=void 0}}}return e},i.prototype.checkFormatToCombineText=function(e,t){return e.fontSize===t.fontSize&&e.fontFamily===t.fontFamily&&e.bold===t.bold&&e.italic===t.italic&&e.baselineAlignment===t.baselineAlignment&&e.bidi===t.bidi&&e.bdo===t.bdo&&e.allCaps===t.allCaps&&e.complexScript===t.complexScript&&e.fontFamilyAscii===t.fontFamilyAscii&&e.fontFamilyBidi===t.fontFamilyBidi&&e.fontFamilyFarEast===t.fontFamilyFarEast&&e.characterSpacing===t.characterSpacing&&e.scaling===t.scaling&&e.fontFamilyNonFarEast===t.fontFamilyNonFarEast&&e.hidden===t.hidden},i.prototype.getWholeTextWidth=function(e,i){for(var r=e.nextNode,n=e.width;!t.isNullOrUndefined(r)&&r instanceof hl&&(e.characterFormat.isEqualFormat(r.characterFormat)||this.documentHelper.textHelper.isWordSplitChar(r.text)&&this.checkFormatToCombineText(e.characterFormat,r.characterFormat));)r.text.includes(" ")?r=void 0:i?(r.isCombinedRTLText=!0,n+=r.isWidthUpdated?r.width:this.documentHelper.textHelper.getTextSize(r,r.characterFormat),r=r.nextNode):(r.isCombinedRTLText=!1,r=r.nextNode);return n},i.prototype.layoutElement=function(e,i,r){if(!e.isColumnBreak&&!e.isPageBreak||!i.isInHeaderFooter){var n=e.line,o="",a=e.indexInOwner;if(this.documentHelper.editorProperties.isRedoing&&!t.isNullOrUndefined(e.paragraph)&&!t.isNullOrUndefined(e.paragraph.containerWidget.footNoteReference)&&this.documentHelper.enableTrackChanges&&e.removedIds.length>0&&this.documentHelper.editorProperties.constructRevisionFromID(e),e instanceof ol){if(0===e.fieldType&&(-1===this.documentHelper.fields.indexOf(e)&&this.documentHelper.fields.push(e),t.isNullOrUndefined(e.formFieldData)||-1!==this.documentHelper.formFields.indexOf(e)||this.isInsertFormField||this.documentHelper.formFields.push(e)),this.layoutFieldCharacters(e),e.line.isLastLine()&&t.isNullOrUndefined(e.nextNode)&&!this.isFieldCode)!t.isNullOrUndefined(i.containerWidget)&&i.floatingElements.length>0&&!(i.containerWidget instanceof Ol)&&this.isConsiderAsEmptyLineWidget(e.line)&&this.layoutEmptyLineWidget(i,!1,e.line),this.moveToNextLine(n);else if(t.isNullOrUndefined(e.nextElement)&&this.viewer.clientActiveArea.width>0&&!e.line.isLastLine())this.moveElementFromNextLine(n),e.line.isLastLine()&&t.isNullOrUndefined(e.nextNode)&&!this.isFieldCode&&(2!==e.fieldType&&t.isNullOrUndefined(e.fieldSeparator)&&this.layoutEmptyLineWidget(i,!1,e.line),this.moveToNextLine(n));else if(t.isNullOrUndefined(e.nextElement)&&0===this.viewer.clientActiveArea.width)this.moveToNextLine(n),n.paragraph.lastChild===n&&!t.isNullOrUndefined(n.nextLine)&&this.viewer.clientActiveArea.height>=0&&this.moveFromNextPage(n);else if(r){var s=this.documentHelper.textHelper.getHeight(i.characterFormat);e.height=s.Height}}else{if(e instanceof kl||this.isFieldCode||e instanceof ml||e instanceof Al||e instanceof Ll||e instanceof yl||e instanceof Cl&&"Inline"!==e.textWrappingStyle){if(!this.isInitialLoad&&e instanceof yl&&0===e.type&&"Block"===e.contentControlWidgetType&&!t.isNullOrUndefined(e.paragraph)&&e.paragraph.firstChild.children[0]===e&&!t.isNullOrUndefined(e.reference)&&!t.isNullOrUndefined(e.reference.paragraph)&&e.reference.paragraph.lastChild.children[e.reference.paragraph.lastChild.children.length-1]!==e.reference){e.contentControlWidgetType="Inline",e.reference.contentControlWidgetType="Inline",e.contentControlProperties.contentControlWidgetType="Inline";var l=e.paragraph;for(l===e.reference.paragraph&&e.reference.paragraph.contentControlProperties&&(e.reference.paragraph.contentControlProperties=void 0);l instanceof Qs&&l&&l.contentControlProperties&&l!==e.reference.paragraph;)l.contentControlProperties=void 0,l=l.nextRenderedWidget}if(e instanceof ml)if(0===e.bookmarkType){if(!this.isInitialLoad&&this.documentHelper.isEditorModule?this.documentHelper.hooks.onUpdateBookmarkCollection(e.name,e):this.documentHelper.bookmarks.containsKey(e.name)||this.documentHelper.bookmarks.add(e.name,e),!t.isNullOrUndefined(e.properties)){u=parseInt(e.properties.columnFirst);if(e.paragraph.isInsideTable){W=(v=e.paragraph.associatedCell.ownerRow).getCellUsingColumnIndex(v.rowIndex,u);t.isNullOrUndefined(W)||(W.isRenderBookmarkStart=!0)}}}else if(1===e.bookmarkType&&this.documentHelper.bookmarks.containsKey(e.name)){var d=this.documentHelper.bookmarks.get(e.name);if((t.isNullOrUndefined(d.reference)||t.isNullOrUndefined(d.reference.paragraph)||t.isNullOrUndefined(d.reference.paragraph.bodyWidget))&&(d.reference=e,e.reference=d),t.isNullOrUndefined(d.properties)){if(!t.isNullOrUndefined(this.documentHelper)){W=d.reference.paragraph.associatedCell;t.isNullOrUndefined(W)||(W.isRenderBookmarkEnd=!1,this.documentHelper.editorProperties.isRenderBookmarkAtEnd(d.reference)&&(W.isRenderBookmarkEnd=!0))}}else if(!t.isNullOrUndefined(e.paragraph.associatedCell)&&!t.isNullOrUndefined(this.documentHelper)){k=this.documentHelper.editorProperties.getLastParagraph(e.paragraph.associatedCell).lastChild;if(!t.isNullOrUndefined(k)&&k.children[k.children.length-1]==e){for(var h=parseInt(e.reference.properties.columnLast),c=e.paragraph.associatedCell.ownerRow,g=void 0,p=h;t.isNullOrUndefined(g)&&p>-1;)g=c.getCellUsingColumnIndex(e.paragraph.associatedCell.rowIndex,p),t.isNullOrUndefined(g)&&p--;t.isNullOrUndefined(g)||(c.isRenderBookmarkEnd=!0)}}}else if(0===e.bookmarkType&&this.documentHelper.bookmarks.containsKey(e.name)&&(t.isNullOrUndefined(e.reference)&&this.documentHelper.bookmarks.remove(e.name),!t.isNullOrUndefined(e.properties))){var u=parseInt(e.properties.columnFirst);if(e.paragraph.isInsideTable){W=(v=e.paragraph.associatedCell.ownerRow).getCellUsingColumnIndex(v.rowIndex,u);t.isNullOrUndefined(W)||(W.isRenderBookmarkStart=!0)}}if(e instanceof Ll||e instanceof Al){if(e instanceof Ll){var f=""!==e.user?e.user:e.group;if(this.documentHelper.editRanges.containsKey(f)){var m=this.documentHelper.editRanges.get(f);-1===m.indexOf(e)&&m.push(e)}else{var y=[];y.push(e),this.documentHelper.editRanges.add(f,y)}}if(e instanceof Ll&&(this.documentHelper.editorProperties.currentUser===e.user||"Everyone"===e.group&&""===e.user)){if(-1!=e.columnFirst&&-1!=e.columnLast){W=(v=e.paragraph.associatedCell.ownerRow).getCellUsingColumnIndex(v.rowIndex,e.columnFirst);t.isNullOrUndefined(W)||(W.isRenderEditRangeStart=!0,v.editRangeID.add(e.editRangeId,e))}}else if(e instanceof Al&&!t.isNullOrUndefined(e.editRangeStart)&&(this.documentHelper.editorProperties.currentUser===e.editRangeStart.user||"Everyone"===e.editRangeStart.group&&""===e.editRangeStart.user)&&-1!=e.editRangeStart.columnFirst&&-1!=e.editRangeStart.columnLast){var v=e.paragraph.associatedCell.ownerRow;if(v.editRangeID.containsKey(e.editRangeStart.editRangeId)){var W=v.getCellUsingColumnIndex(v.rowIndex,e.editRangeStart.columnFirst);t.isNullOrUndefined(W)||W.isRenderEditRangeStart&&(W.isRenderEditRangeEnd=!0)}else for(var b=e.paragraph.associatedCell.ownerTable,x=v.rowIndex-1;x>=0;x--){var w=b.childWidgets[x];if(w.editRangeID.containsKey(e.editRangeStart.editRangeId)){var F=w.getCellUsingColumnIndex(w.rowIndex,e.editRangeStart.columnFirst);if(!t.isNullOrUndefined(F)&&F.isRenderEditRangeStart){F.isRenderEditRangeEnd=!0;break}}}}}if(e instanceof Cl&&"Inline"!==e.textWrappingStyle&&-1==i.floatingElements.indexOf(e)&&(e instanceof Pl||e instanceof Tl)&&(-1===i.floatingElements.indexOf(e)&&i.floatingElements.push(e),-1===i.bodyWidget.floatingElements.indexOf(e)&&i.bodyWidget.floatingElements.push(e),!this.documentHelper.isEditorModule&&this.documentHelper.editorProperties.isPaste&&0===e.x&&0===e.y&&this.layoutShape(e,!0)),e instanceof yl&&-1===this.documentHelper.contentControlCollection.indexOf(e)){var C=!1;if(e.paragraph.isInHeaderFooter){var P=e.paragraph.containerWidget,T=P instanceof il?this.documentHelper.editorProperties.getContainerWidget(P):P;t.isNullOrUndefined(T.parentHeaderFooter)||(C=!0)}if(!C){if(0===e.type)this.isInitialLoad?this.documentHelper.contentControlCollection.push(e):this.documentHelper.hooks.onInsertContentControl&&this.documentHelper.hooks.onInsertContentControl(e);else if(1===e.type)for(var O=e.paragraph.bodyWidget.page,x=0;x<this.documentHelper.contentControlCollection.length;x++){var S=this.documentHelper.contentControlCollection[x],N=S.line.paragraph.isInHeaderFooter;N&&e.contentControlProperties===S.contentControlProperties&&O===S.line.paragraph.bodyWidget.page?(e.reference=S,S.reference=e):N||e.contentControlProperties!==S.contentControlProperties||(e.reference=S,S.reference=e)}e instanceof yl&&i.bodyWidget.floatingElements.length>0&&this.adjustPosition(e,e.line.paragraph.bodyWidget)}}return t.isNullOrUndefined(e.nextElement)&&this.viewer.clientActiveArea.width>0&&!e.line.isLastLine()&&this.moveElementFromNextLine(n),e.line.isLastLine()&&t.isNullOrUndefined(e.nextElement)?this.hasValidElement(n.paragraph)&&!i.isContainsShapeAlone()?this.moveToNextLine(n):this.isInitialLoad||this.hasValidElement(n.paragraph)||!n.paragraph.paragraphFormat.bidi||-1===n.paragraph.paragraphFormat.listFormat.listId?this.layoutEmptyLineWidget(n.paragraph,!1,n,!1):this.moveToNextLine(n):t.isNullOrUndefined(e.nextElement)&&0===this.viewer.clientActiveArea.width&&(this.moveToNextLine(n),n.paragraph.lastChild===n&&!t.isNullOrUndefined(n.nextLine)&&this.viewer.clientActiveArea.height>=0&&this.moveFromNextPage(n)),void(e.nextElement&&e.nextElement instanceof Pl&&"Inline"===e.nextElement.textWrappingStyle&&e instanceof Pl&&this.layoutShape(e))}if(e instanceof hl&&"NoColor"!=e.characterFormat.highlightColor&&""!=e.text.trim()&&e.text!=e.text.trim()){var I=i.firstChild,k=i.lastChild;!t.isNullOrUndefined(I)&&I instanceof rl&&I.children.length>0&&e===I.children[0]&&bs.splitSpaceInTextElementBox(e,!0),!t.isNullOrUndefined(k)&&k instanceof rl&&k.children.length>0&&e===k.children[k.children.length-1]&&bs.splitSpaceInTextElementBox(e,!1)}var A=e.width;e instanceof ul&&!this.isTocField(e.fieldBegin)?""===(o=this.documentHelper.getFieldResult(e.fieldBegin,e.paragraph.bodyWidget.page))||""===e.text&&e.nextNode instanceof ul?o=e.text:e.text=o:e instanceof gl?""!==(o=this.startAt(e,o))&&(e.text=o):e instanceof hl&&(!t.isNullOrUndefined(e.paragraph)&&!t.isNullOrUndefined(e.paragraph.containerWidget.footNoteReference)&&e.line.isFirstLine()&&0===e.paragraph.index&&0===e.indexInOwner&&!t.isNullOrUndefined(this.documentHelper.isEditorModule)&&!this.documentHelper.editorProperties.handledEnter&&e instanceof ad&&(e.text=e.paragraph.containerWidget.footNoteReference.text),this.checkAndSplitTabOrLineBreakCharacter(e.text,e),o=e.text),e instanceof hl&&(!e.isWidthUpdated||0===e.width||this.isInitialLoad||this.documentHelper.isEditorModule&&this.documentHelper.editorProperties.isMeasureParaWidth?(A=this.documentHelper.textHelper.getTextSize(e,e.characterFormat),e.isWidthUpdated=!0):A=e.trimEndWidth,"\t"===e.text?(A=this.getTabWidth(i,this.viewer,a,n,e),e.width=A):e.text!==String.fromCharCode(31)&&e.text!==String.fromCharCode(14)||(e.width=A=0));var L,U=i.bodyWidget;U.floatingElements.length>0?L=U.floatingElements:U instanceof Ys&&this.getPriorColumnFloatingTables(U).length>0?L=this.getPriorColumnFloatingTables(U):!t.isNullOrUndefined(U.page)&&!t.isNullOrUndefined(U.page.headerWidget)&&U.page.headerWidget.floatingElements.length>0&&!i.paragraphFormat.bidi&&(L=U.page.headerWidget.floatingElements);var B=!1;if(this.isFirstElementWithPageBreak(i)&&i.isEndsWithColumnBreak){var H=i.previousWidget;H instanceof el&&H.wrapTextAround&&H.previousWidget instanceof Qs&&(B=!0)}t.isNullOrUndefined(i.containerWidget)||t.isNullOrUndefined(L)||!(L.length>0)||B||(e instanceof Pl||e instanceof Tl)&&"Inline"==e.textWrappingStyle||i.containerWidget instanceof Ol||e instanceof Jl||i.containerWidget instanceof il&&i.containerWidget.ownerTable.containerWidget instanceof Ol||(this.adjustPosition(e,e.line.paragraph.bodyWidget),L.sort(function(e,t){return e.y-t.y}),i.textWrapWidth&&(i.x-=e.padding.left,i.textWrapWidth=!1));var R=0;if(n.isFirstLine())for(x=0;x<n.children.length;x++){var q=n.children[x];if(q.width>0&&!(q instanceof kl)){q===e&&(R=this.getBeforeSpacing(i));break}}if(this.viewer instanceof Es&&((e instanceof Pl||e instanceof Tl)&&"Inline"===e.textWrappingStyle||!(e instanceof Pl||e instanceof Tl))&&this.viewer.clientActiveArea.height<R+e.height&&this.viewer.clientActiveArea.y!==this.viewer.clientArea.y&&(!(e instanceof hl&&("\f"!==e.text&&e.text!==String.fromCharCode(14)||"\f"===e.text&&i.isPageBreak()&&"Word2013"===this.documentHelper.compatibilityMode))&&e instanceof hl||this.moveToNextPage(this.viewer,n),e instanceof ul&&this.updateFieldText(e),!e.previousElement||this.hasPreviousListElement(e)&&e.paragraph.paragraphFormat.firstLineIndent<0||(!(e.previousElement instanceof Pl||e.previousElement instanceof Tl)||"Inline"!==e.previousElement.textWrappingStyle)&&(e.previousElement instanceof Pl||e.previousElement instanceof Tl)||this.cutClientWidth(e.previousElement,void 0,e instanceof hl&&"\f"===e.text||e instanceof Il)),e instanceof Pl&&"Inline"===e.textWrappingStyle&&e.isHorizontalRule&&e.previousElement){this.splitElementForClientArea(i,e),this.checkLineWidgetWithClientArea(n,e);E=this.is2013Justification;this.layoutShape(e),this.is2013Justification=E}else e.previousElement instanceof Pl&&"Inline"===e.previousElement.textWrappingStyle&&e.previousElement.isHorizontalRule&&(this.splitElementForClientArea(i,e),this.checkLineWidgetWithClientArea(n,e));if((e instanceof Pl||e instanceof Tl)&&"Inline"===e.textWrappingStyle&&(!e.isHorizontalRule||t.isNullOrUndefined(e.previousElement))){-1===i.floatingElements.indexOf(e)&&i.floatingElements.push(e),e.width>this.viewer.clientActiveArea.width&&(this.splitElementForClientArea(i,e),this.checkLineWidgetWithClientArea(n,e));E=this.is2013Justification;this.layoutShape(e),this.is2013Justification=E}if(e instanceof gl&&(!e.isLayout||this.isLayoutWhole)&&"Pages"===this.documentHelper.layoutType){var E=this.is2013Justification,M=this.nextElementToLayout;this.layoutFootEndNoteElement(e),this.is2013Justification=E,this.nextElementToLayout=M}if(e instanceof gl&&(this.isfootMove&&(this.moveToNextPage(this.viewer,e.line),e.previousElement&&((e.previousElement instanceof Pl||e.previousElement instanceof Tl)&&"Inline"===e.previousElement.textWrappingStyle||!(e.previousElement instanceof Pl||e.previousElement instanceof Tl))&&this.cutClientWidth(e.previousElement),this.isfootMove=!1),i.paragraphFormat.keepWithNext&&i.paragraphFormat.keepLinesTogether&&e.isLayout&&!this.isLayoutWhole&&!t.isNullOrUndefined(i.bodyWidget.page.footnoteWidget)&&0!==i.bodyWidget.page.footnoteWidget.y&&i.bodyWidget.page.footnoteWidget.y<this.viewer.clientActiveArea.y+this.viewer.clientActiveArea.height)){var V=this.viewer.clientActiveArea.y+this.viewer.clientActiveArea.height-i.bodyWidget.page.footnoteWidget.y;this.viewer.clientActiveArea.height-=V}if(parseFloat(A.toFixed(4))<=parseFloat(this.viewer.clientActiveArea.width.toFixed(4))||parseFloat(A.toFixed(3))<=parseFloat(this.viewer.clientActiveArea.width.toFixed(3))&&i.isInsideTable||!this.viewer.textWrap||e instanceof hl&&"\v"===e.text||this.isTextAfterTabToRetainInLine(e)){if("Justify"===i.paragraphFormat.textAlignment&&e instanceof hl&&e.characterFormat.bidi&&!e.isCombinedRTLText&&""!==e.text.trim()){var D=this.getWholeTextWidth(e,!0),z=!1;if(parseFloat(D.toFixed(4))>parseFloat(this.viewer.clientActiveArea.width.toFixed(4))&&(z=this.isWordFittedByJustification(e,D,!0)),!z){this.getWholeTextWidth(e,!1);this.effectiveJustifyWidth=0}}if(this.addElementToLine(i,e),t.isNullOrUndefined(e.nextElement)&&!e.line.isLastLine()){var _=e.line.nextLine.children[0];_ instanceof hl&&0==_.text.indexOf(" ")&&this.moveElementFromNextLine(n)}t.isNullOrUndefined(e.nextElement)&&this.viewer.clientActiveArea.width>0&&!e.line.isLastLine()?this.moveElementFromNextLine(n):!e.line.isLastLine()&&t.isNullOrUndefined(e.nextElement)&&0===this.viewer.clientActiveArea.width&&(this.moveToNextLine(n),n.paragraph.lastChild===n&&this.viewer.clientActiveArea.height>=0&&this.moveFromNextPage(n))}else if(e instanceof hl){if("\t"===e.text){var j=e.line,G=!1;if(0!==e.indexInOwner&&e instanceof fl?(G=!0,this.addSplittedLineWidget(j,j.children.indexOf(e)-1)):(this.isWrapText&&this.viewer.clientActiveArea.x+this.viewer.clientActiveArea.width===this.viewer.clientActiveArea.right&&(this.isWrapText=!1),this.addSplittedLineWidget(j,j.children.indexOf(e))),this.moveToNextLine(j,void 0,void 0,!0),j.paragraph.bodyWidget.floatingElements.length>0&&G)return this.nextElementToLayout=e,void(this.hasFloatingElement=!0);e.width=this.getTabWidth(i,this.viewer,a,e.line,e),G&&(this.addElementToLine(i,e),t.isNullOrUndefined(e.nextElement)&&this.viewer.clientActiveArea.width>0&&!e.line.isLastLine()&&this.moveElementFromNextLine(e.line))}else do{if(n=e.line,e.previousElement instanceof ol&&2==e.previousElement.fieldType&&!t.isNullOrUndefined(e.previousElement.fieldBeginInternal)&&e.previousElement.fieldBeginInternal.formFieldData instanceof dl||this.splitTextForClientArea(n,e,e.text,e.trimEndWidth,e.characterFormat),this.checkLineWidgetWithClientArea(n,e),e instanceof ul&&!this.isInitialLoad&&this.updateFieldText(e),e.line!==n&&!t.isNullOrUndefined(this.nextElementToLayout)&&this.is2013Justification)return}while(e.line!==n&&this.cutClientWidth(e))}else do{n=e.line,this.splitElementForClientArea(i,e),this.checkLineWidgetWithClientArea(n,e),e instanceof ul&&this.updateFieldText(e)}while(e.line!==n&&this.cutClientWidth(e,!0));var K;if("\f"===o&&!t.isNullOrUndefined(e.nextNode)&&e.nextNode instanceof yl&&(K=e.nextNode),("\v"===o||"\f"===o||"\r"===o||o===String.fromCharCode(14))&&!K){var Y=n.children.indexOf(e);Y>-1&&("\v"!==o||!e.isWrappedBreak)&&this.addSplittedLineWidget(n,Y)}if(e.line.isLastLine()&&t.isNullOrUndefined(e.nextElement)||"\v"===o||"\f"===o||"\r"===o||o===String.fromCharCode(14)){if(this.isXPositionUpdated)return void(this.isXPositionUpdated=!1);if("\v"===o&&e.isWrappedBreak||this.moveToNextLine(e.line),e.isWrappedBreak=!1,"\v"===o&&t.isNullOrUndefined(e.nextNode))this.layoutEmptyLineWidget(n.paragraph,!0,n,!0);else if(("\f"===o||o===String.fromCharCode(14))&&this.viewer instanceof Es&&!(e.line.paragraph.containerWidget instanceof il)){var X=this.isRTLLayout;if(this.isRTLLayout=!1,t.isNullOrUndefined(e.nextNode)||e.nextNode instanceof yl)if(o===String.fromCharCode(14))this.moveToNextPage(this.viewer,e.line.nextLine,!1),this.layoutEmptyLineWidget(e.line.nextLine.paragraph,!1,e.line.nextLine,!0);else{var J=i.nextWidget;"\f"===o&&J instanceof Qs&&J.isSectionBreak||this.moveToNextPage(this.viewer,e.line,!0)}else t.isNullOrUndefined(e.line.nextLine)||this.moveToNextPage(this.viewer,e.line.nextLine,!1);this.isRTLLayout=X}}this.isXPositionUpdated=!1,this.documentHelper.isEditorModule&&!t.isNullOrUndefined(this.documentHelper.editorProperties.isPaste)&&this.documentHelper.editorProperties.isPaste&&(e.line.paragraph.containerWidget instanceof Ys||e.line.paragraph.containerWidget instanceof Xs)&&e instanceof hl&&"\v"!==e.text&&"\t"!==e.text&&"\f"!==e.text&&(this.documentHelper.editorProperties.lastElementForPasteIcon=e)}}},i.prototype.hasPreviousListElement=function(e){for(var t=e.previousElement;t instanceof ml||t instanceof Al||t instanceof Ll;)t=t.previousElement;return t instanceof kl},i.prototype.adjustPosition=function(e,i,r){var n=this.viewer.clientActiveArea,o=this.viewer.clientActiveArea.x,a=this.viewer.clientActiveArea.y,s=this.viewer.clientActiveArea.width,l=this.adjustClientAreaBasedOnTextWrap(e,new zs(n.x,n.y,n.width,n.height),r);this.viewer.clientActiveArea.width=l.width;var d=this.viewer.clientActiveArea.x-o;if(e.line.isFirstLine()&&this.getFirstElement(e.line)===e&&d>0&&!this.isSkipFirstLineIndent){var h=e.line.paragraph.paragraphFormat.firstLineIndent;d+=bs.convertPointToPixel(h>0?h:0)}this.isSkipFirstLineIndent=!1,e.padding.left=d>0?d:0;var c=this.isRtlShapeWrapAtStart&&e.line.paragraph.bidi&&0===d;if(this.isRtlShapeWrapAtStart=!1,s!==this.viewer.clientActiveArea.width&&!c){var g=new ws(this.viewer.clientActiveArea.x,this.viewer.clientActiveArea.width);this.updateWrapPosition(g)}if(0===this.viewer.clientActiveArea.width&&(this.isWrapText=!1),this.isYPositionUpdated){if(e.line.isFirstLine()){if(!t.isNullOrUndefined(e.line.paragraph.associatedCell)){var p=e.line.paragraph.previousRenderedWidget;t.isNullOrUndefined(p)?e.line.paragraph.associatedCell.height+=this.viewer.clientActiveArea.y-a:e.line.paragraph.associatedCell.height+=this.viewer.clientActiveArea.y-p.y+p.height}e.line.paragraph.y=this.viewer.clientActiveArea.y,this.isXPositionUpdated&&(e.line.paragraph.x=this.viewer.clientActiveArea.x,this.isXPositionUpdated=!1)}else this.isContinuationAtColumnStart(e.line)?e.line.paragraph.y=this.viewer.clientActiveArea.y:e.line.children[0]===e&&(e.line.marginTop+=this.viewer.clientActiveArea.y-a);if(e.line.paragraph.containerWidget instanceof Xs){var u=!1;if(!this.skipRelayoutOverlap)for(var f=0;f<e.line.paragraph.containerWidget.floatingElements.length;f++){var m=e.line.paragraph.containerWidget.floatingElements[f];if(m instanceof Cl&&"TopAndBottom"===m.textWrappingStyle)for(var y=e.line.paragraph.previousWidget,v=new zs(m.x,m.y,m.width,m.height);y;){if(y instanceof Qs&&!y.isInsideTable){var W=new zs(y.x,y.y,y.width,y.height);if(v.isIntersecting(W)){u=!0;break}}y=y.previousWidget}}if(!u&&e.line.isFirstLine()){var b=e.line.paragraph.containerWidget;(!this.skipRelayoutOverlap||this.viewer.clientActiveArea.y>b.y+b.height)&&(b.height+=this.viewer.clientActiveArea.y-a)}}e instanceof kl||(this.isYPositionUpdated=!1)}},i.prototype.hasPrecedingContentInLine=function(e){for(var t=e.line.children,i=0;i<t.length&&t[i]!==e;i++){var r=t[i];if(!(r instanceof Cl&&"Inline"!==r.textWrappingStyle)&&r.width>0)return!0}return!1},i.prototype.getFirstElement=function(e){for(var t=0;t<e.children.length;t++){var i=e.children[t];if(!(i instanceof Cl&&"Inline"!==i.textWrappingStyle))return i}},i.prototype.updateWrapPosition=function(e){for(var t=0;t<this.wrapPosition.length;t++){var i=this.wrapPosition[t];if(!(Math.abs(i.right-e.right)>1))return}this.wrapPosition.push(e)},i.prototype.isFirstitemInPage=function(e,t){return!e.line.paragraph.isInHeaderFooter&&Math.round(t)===this.viewer.clientArea.y},i.prototype.isNeedToWrapParaMarkToRightSide=function(e,t,i,r,n,o,a){return!(!t||t.isInsideTable||"Both"!==o||n.right<=i.x||n.x>=i.x||i.right>=n.right-a||i.x-n.x<a||e instanceof nd)&&(i.y<=r&&i.bottom>=n.y)},i.prototype.isTextFitBelow=function(e,t,i){return!1},i.prototype.isNeedToWrapForTopAndBottom=function(e,i,r,n,o,a,s,l,d,h,c,g,p){if(e.isInsideTable&&"TopAndBottom"===o&&!(d instanceof el)){var u=d.paragraph;if(!t.isNullOrUndefined(u)&&!t.isNullOrUndefined(u.associatedCell)){var f=u.isInsideTable,m=u.associatedCell,y=e.associatedCell;if(!t.isNullOrUndefined(m)&&!t.isNullOrUndefined(y)&&m!==y||!f&&"Word2013"!==this.documentHelper.compatibilityMode)return!1}}return r!==l&&n!==l&&"TopAndBottom"===o&&(c.y>=a.y&&c.y<a.bottom||(c.y+p>bs.round(a.y,0)||this.isTextFitBelow(a,c.y+p,d))&&c.y+p<a.bottom||c.y<a.y&&c.y+p>a.bottom&&a.height>0)&&!(s&&(h||i instanceof Il&&"Inline"!==i.textWrappingStyle&&i.allowOverlap))},i.prototype.isNeedToWrapForSquareTightAndThrough=function(e,i,r,n,o,a,s,l,d,h,c,g,p){var u;return e.floatingElements.length>0?u=e.floatingElements:e instanceof Ys&&this.getPriorColumnFloatingTables(e).length>0?u=this.getPriorColumnFloatingTables(e):!t.isNullOrUndefined(e.page)&&!t.isNullOrUndefined(e.page.headerWidget)&&e.page.headerWidget.floatingElements.length>0&&(u=e.page.headerWidget.floatingElements),u.length>0&&r!==l&&n!==l&&"Inline"!==o&&"Behind"!==o&&"TopAndBottom"!==o&&"InFrontOfText"!==o&&(Math.round(c.y+p)>Math.round(a.y)||this.isTextFitBelow(a,c.y+p,d))&&Math.round(c.y)<Math.round(a.y+a.height)&&!(s&&(h||i instanceof Il&&"Inline"!==i.textWrappingStyle&&i.allowOverlap))},i.prototype.isNeedToWrapForSquareTightAndThroughForTable=function(e,i,r,n,o,a,s,l,d,h,c,g,p){var u;return e.floatingElements.length>0?u=e.floatingElements:!t.isNullOrUndefined(e.page)&&!t.isNullOrUndefined(e.page.headerWidget)&&e.page.headerWidget.floatingElements.length>0&&(u=e.page.headerWidget.floatingElements),u.length>0&&r!==l&&n!==l&&"Inline"!==o&&"Behind"!==o&&"TopAndBottom"!==o&&"InFrontOfText"!==o&&(Math.round(c.y+p)>=Math.round(a.y)&&Math.round(c.y)<Math.round(a.bottom)||Math.round(c.y+p)<=Math.round(a.bottom)&&Math.round(c.y+p)>=Math.round(a.y))&&!(s&&h)},i.prototype.isContinuationAtColumnStart=function(e){var i=e.paragraph,r=i.containerWidget;return 0===e.indexInOwner&&!t.isNullOrUndefined(i.previousSplitWidget)&&r instanceof Ys&&r.columnIndex>0&&0===r.floatingElements.length&&r.firstChild===i},i.prototype.getPriorColumnFloatingTables=function(e){var i=[];if(!(e instanceof Ys)||t.isNullOrUndefined(e.page)||t.isNullOrUndefined(e.sectionFormat)||e.sectionFormat.numberOfColumns<2)return i;for(var r=e.page.bodyWidgets,n=0;n<r.length&&r[n]!==e;n++)if(r[n].sectionIndex===e.sectionIndex)for(var o=0;o<r[n].floatingElements.length;o++){var a=r[n].floatingElements[o];a instanceof el&&a.x+a.getTableCellWidth()>e.x&&i.push(a)}return i},i.prototype.isNeedToWrapLeafWidget=function(e,i){var r=[],n=e.bodyWidget;return r=n.floatingElements.length>0?r.concat(n.floatingElements):r.concat(this.getPriorColumnFloatingTables(n)),n instanceof Xs||t.isNullOrUndefined(n.page)||t.isNullOrUndefined(n.page.headerWidget)||!(n.page.headerWidget.floatingElements.length>0)||(r=r.concat(n.page.headerWidget.floatingElements)),!t.isNullOrUndefined(r)&&r.length>0&&!0&&!(i instanceof Cl&&("InFrontOfText"===i.textWrappingStyle||"Behind"===i.textWrappingStyle))},i.prototype.getMinWidth=function(e,t,i,r){var n=e.text,o=n.split(" ");""!==n&&""===n.trim()&&e&&e.line.paragraph&&e.previousNode&&e.nextNode&&e.line.paragraph.isEmpty&&(o=[""]);var a=this.documentHelper.textHelper.measureText(o[0],e.characterFormat,e.scriptType).Width,s=this.getNextSibling(e);if(1===o.length&&s){var l=s.text;a+=this.getNextTextRangeWidth(s,l,t,i,r)}return a},i.prototype.getNextTextRangeWidth=function(e,t,i,r,n){for(var o=e,a=new zs(0,0,0,0),s=this.isNextSibligSizeNeedToBeMeasure(a,e,n,i,r);s&&this.isLeafWidgetNextSiblingIsTextRange(o)&&i+a.width<n.width&&(o=this.getNextSibling(o),this.isNextSibligSizeNeedToBeMeasure(a,o,n,i,r));)t+=o.text;return a.width},i.prototype.isLeafWidgetNextSiblingIsTextRange=function(e){var t=this.getNextSibling(e);return!!(t&&t instanceof hl)},i.prototype.isNextSibligSizeNeedToBeMeasure=function(e,t,i,r,n){var o=null,a=t;if(a){if(-1!==(o=a.text).indexOf(" ")||-1!==o.indexOf("-")||-1!==o.indexOf("_")&&r+e.width+this.documentHelper.textHelper.measureText(o.split("-")[0],a.characterFormat,a.scriptType).Width<i.width||"\t"===a.text){var s=a.width;return o!==o.split(" ")[0]&&(s=this.documentHelper.textHelper.measureText(o.split(" ")[0],a.characterFormat,a.scriptType).Width),r+e.width+s>i.width&&o.indexOf("-")&&o!==o.split("-")[0]+"-"&&(s=this.documentHelper.textHelper.measureText(o.split("-")[0]+"-",a.characterFormat,a.scriptType).Width),e.width+=s,!1}if(a.text.length>0){var l=this.documentHelper.textHelper.measureText(a.text,a.characterFormat,a.scriptType);e.height+=l.Height,e.width+=l.Width}}return!0},i.prototype.isNeedDoIntermediateWrapping=function(e,t,i,r,n,o,a,s,l){return e>l&&((Math.round(i.width)<=Math.round(s)||i.width<r&&a.paragraph.isInsideTable)&&"Left"!==t&&"Largest"!==t||"Right"===t||i.width<e&&"Largest"===t)||(Math.round(o.x-n.x+n.leftIndent)<l||a instanceof hl&&this.isFloatingItemOnLeft(i,s,o))&&("Left"!==t||e<l)},i.prototype.isFloatingItemOnLeft=function(e,t,i){return!1},i.prototype.getNextSibling=function(e){for(var t=e.nextNode,i=!1;t;){if(t instanceof ol||t instanceof ml||i||t instanceof kl)t instanceof ol&&(0===t.fieldType?i=!0:2===t.fieldType&&(i=!1));else if(t instanceof hl)break;t=t.nextNode}return t},i.prototype.getIntersectingSquareItemBounds=function(e,t,i){for(var r=[],n=0,o=0,a=0,s=0,l=0;l<t.length;l++){var d=t[l];if(d instanceof Cl?(n=d.distanceLeft,o=d.distanceTop,a=d.distanceRight,s=d.distanceBottom):(n=d.positioning.distanceLeft,o=d.positioning.distanceTop,a=d.positioning.distanceRight,s=d.positioning.distanceBottom),!(d===e||d instanceof Cl&&"Square"!==d.textWrappingStyle)){var h=new zs(d.x-n,d.y-o,d.width+n+a,d.height+o+s);h.y<=i.y&&h.bottom>=i.y&&r.push(h)}}return r},i.prototype.getXPositionOfIntersectionFloatingItemBasedOnHorizontally=function(e,t){for(var i=Number.POSITIVE_INFINITY,r=0;r<e.length;r++)e[r].x>=t&&(i=Math.min(i,e[r].x));return i},i.prototype.getBottomPositionOfIntersectionFloatingItemBasedOnHorizontally=function(e){return Math.min.apply(Math,e.map(function(e){return e.bottom}))},i.prototype.adjustClientAreaBasedOnTextWrap=function(e,i,r){var n=e.line.paragraph,o=n.bodyWidget,a=this.viewer,s=i.y;this.isFirstitemInPage(e,s);if(t.isNullOrUndefined(n.previousWidget),this.isNeedToWrapLeafWidget(n,e)){var l=a.clientArea,d=[];if(o.floatingElements.length>0||this.getPriorColumnFloatingTables(o).length>0)for(var h=o.page,c=0;c<h.bodyWidgets.length;c++){if(!(o instanceof Ys&&h.bodyWidgets[c]!==o)){o.floatingElements.sort(function(e,t){return e.y-t.y}),o.floatingElements.sort(function(e,t){return e.x-t.x}),d=d.concat(o.floatingElements);break}d=d.concat(h.bodyWidgets[c].floatingElements)}o instanceof Xs||t.isNullOrUndefined(o.page)||t.isNullOrUndefined(o.page.headerWidget)||!(o.page.headerWidget.floatingElements.length>0)||(o.page.headerWidget.floatingElements.sort(function(e,t){return e.y-t.y}),o.page.headerWidget.floatingElements.sort(function(e,t){return e.x-t.x}),d=d.concat(o.page.headerWidget.floatingElements));for(c=0;c<d.length;c++){var g=d[c],p=!1;if(p=g instanceof Cl?g.allowOverlap:g.positioning.allowOverlap,!(n.isInsideTable&&g instanceof el)||g.isInsideTable){var u=g instanceof el?g:g.line.paragraph;if(!(this.isRelayout&&this.documentHelper.hooks.isBlockExistAfter&&(!this.isRelayoutOverlap&&this.documentHelper.hooks.isBlockExistAfter(u,e.line.paragraph)||this.isRelayoutOverlap&&this.documentHelper.hooks.isBlockExistAfter(u,this.endOverlapWidget))||n.isInsideTable&&g instanceof Cl&&"Paragraph"===g.verticalOrigin&&g.verticalPosition>=0&&g.paragraph!==n&&g.paragraph.containerWidget===n.containerWidget&&n.indexInOwner<g.paragraph.indexInOwner)){g.x;var f=0,m=0,y=0,v=0,W=0;g instanceof Cl?(f=g.distanceLeft,m=g.distanceTop,y=g.distanceRight,v=g.distanceBottom,W=g.width):(W=g.getTableCellWidth(),f=g.positioning.distanceLeft,m=g.positioning.distanceTop,y=g.positioning.distanceRight,v=g.positioning.distanceBottom);var b=new zs(g.x-f,g.y-m,W+f+y,g.height+m+v),x=g instanceof el?"Square":g.textWrappingStyle,w=g instanceof el?"Both":g.textWrappingType,F=24,C=a.clientArea.y+g.height;if(!(l.x>b.right+F||l.right<b.x-F)){if("Word2003"===this.documentHelper.compatibilityMode&&!t.isNullOrUndefined(o.page)&&n.isInHeaderFooter&&(g instanceof el&&!g.isInsideTable||g instanceof Pl&&!g.paragraph.isInsideTable))continue;if(this.isNeedToWrapForSquareTightAndThrough(o,e,-1,-1,x,b,p,1,g,!1,i,e.width,e.height)){e instanceof hl&&"\v"===e.text&&this.isNeedToWrapParaMarkToRightSide(e,n,b,C,i,w,F)&&(e.isWrappedBreak=!0,i.width-=b.right-i.x,i.x=b.right,this.viewer.updateClientAreaForTextWrap(i));var P=0,T=0,O=0,S=bs.convertPointToPixel(e.paragraph.paragraphFormat.firstLineIndent),N=bs.convertPointToPixel(n.paragraphFormat.leftIndent),I=bs.convertPointToPixel(n.paragraphFormat.rightIndent);S=e.line.isFirstLine()&&S>0?S:0;var k=e instanceof hl||e instanceof kl?e:null,A=g instanceof el?g.containerWidget:g.line.paragraph.containerWidget,L=!1;if(e.line.paragraph){i.x>=b.x&&"Left"!==w&&I>0&&(P=I),i.x<b.x&&"Right"!==w&&(T=N);var U=n.paragraphFormat.listFormat,B=this.getListLevel(U.list,U.listLevelNumber);i.x===l.x+N&&U&&U.baseStyle&&B&&0!==B.paragraphFormat.leftIndent&&(O=N,L=!0)}var H=0,R=!1,q=void 0,E=0,M=void 0;g instanceof el&&(q=g,M=g.positioning.horizontalAlignment,H=this.getMaximumRightCellBorderWidth(g),R=this.getDefaultBorderSpacingValue(H,R,M),E=g.tableFormat.borders.left.lineWidth/2);var V=n.bidi&&!n.isInsideTable&&g instanceof Cl&&"Square"===x&&"Both"===w&&b.x<=l.x;if(i.x+E>=b.x&&i.x<=b.right&&"Left"!==w){i.width=i.width-(b.right-i.x)-P,this.isWrapText=!0;if(t.isNullOrUndefined(q)||(F=this.getMinimumWidthRequiredForTable(R,M,H)),Math.round(i.width)<F||i.width<e.width&&"\t"===e.text||b.x<n.x+N){i.width=this.viewer.clientArea.right-b.right-(L?O:0);Y=0;if(Y=t.isNullOrUndefined(k)?e.width:this.getMinWidth(e,e.width,e.height,i),Math.round(i.width)<F||i.width<Y){if(b.x-(n.x+n.leftIndent)>F&&n.x+o.width-I-b.right>F)i.width=0;else{Q=0;"Word2013"===this.documentHelper.compatibilityMode&&"Square"===x&&e instanceof hl&&this.hasPrecedingContentInLine(e)&&Y>0&&i.width<Y&&e.text.trim().length>0&&b.right+Y>this.viewer.clientArea.right&&!t.isNullOrUndefined(o)&&1===o.sectionFormat.numberOfColumns?i.width=0:(this.isYPositionUpdated=!0,i.width=this.viewer.clientArea.width,i.height-=b.bottom+Q-i.y,i.y=b.bottom+Q,this.viewer.clientArea.x+this.viewer.clientArea.width-i.x<Y&&(i.x=this.viewer.clientArea.x,this.isXPositionUpdated=!0))}this.viewer.updateClientAreaForTextWrap(i),this.isWrapText=!1}else{j=i.x;if(V?(i.width=this.viewer.clientArea.right-b.right,this.isRtlShapeWrapAtStart=!0):(i.x=b.right+(L?O:0)+S,i.width-=S,this.isSkipFirstLineIndent=!0),"Square"===x&&g instanceof Cl){var D=this.getIntersectingSquareItemBounds(g,d,i);if(1==D.length){var z=this.getXPositionOfIntersectionFloatingItemBasedOnHorizontally(D,b.right);if(z!==Number.POSITIVE_INFINITY&&z-b.right<F&&i.right-D[0].right<F){var _=this.getBottomPositionOfIntersectionFloatingItemBasedOnHorizontally(D);this.isYPositionUpdated=!0,i.height-=_-i.y,i.y=_,i.width=this.viewer.clientArea.right-i.x}}}if("Square"===x&&i.width<0&&e.width>0){Q=0;this.isYPositionUpdated=!0,i.width=this.viewer.clientArea.width,i.height-=b.bottom+Q-i.y,i.y=b.bottom+Q,i.x=j}this.viewer.updateClientAreaForTextWrap(i)}}else{var j=i.x;if(V?(i.width=this.viewer.clientArea.right-b.right,this.isRtlShapeWrapAtStart=!0):(i.x=b.right+(L?O:0)+S,i.width=this.viewer.clientArea.right-b.right-(L?O:0)-S,this.isSkipFirstLineIndent=!0),"Square"===x&&i.width<0&&e.width>0){Q=0;this.isYPositionUpdated=!0,i.width=this.viewer.clientArea.width,i.height-=b.bottom+Q-i.y,i.y=b.bottom+Q,i.x=j}this.isWrapText=!0,this.viewer.updateClientAreaForTextWrap(i)}}else if(b.x>=i.x&&i.right>b.x){i.width=b.x-i.x-P;var G=this.viewer.clientArea.right-b.right;G=G>0?G:0,this.isWrapText=!0;var K=!1,Y=0;if(Y=t.isNullOrUndefined(k)?e.width:this.getMinWidth(k,e.width,e.height,i),t.isNullOrUndefined(q)||(F=this.getMinimumWidthRequiredForTable(R,M,H)),this.isNeedDoIntermediateWrapping(G,w,i,e.width,e.paragraph,b,e,Y,F)){if(i.width=G,this.isWrapText=!0,(i.x+Y>b.x||"Right"===w||l.x>b.x-24)&&(i.x=b.right,i.width>Y||"Right"===w?this.viewer.updateClientAreaForTextWrap(i):i.width<Y&&e.line.children[0]!==e&&"Both"===w&&g instanceof Cl&&(this.viewer.updateClientAreaForTextWrap(i),K=!0)),i.width<F&&!(Y<G&&"Tight"===x)||i.width<Y&&Math.round(i.right)===Math.round(this.viewer.clientArea.right)&&"Both"===w){var X=b;if(Math.round(i.x)===Math.round(o.sectionFormat.leftMargin+n.paragraphFormat.leftIndent)){Q=0;i.y=X.bottom+Q,this.isYPositionUpdated=!0,i.width=this.viewer.clientArea.width,i.height=i.height-(X.height+Q),this.viewer.updateClientAreaForTextWrap(i),this.isWrapText=!1}else if(!K&&Math.round(i.right)>=Math.round(this.viewer.clientArea.right)&&"Both"===w){Q=0;i.y=X.bottom+Q,i.width=this.viewer.clientArea.width,i.height=i.height-(X.height+Q),i.x=this.viewer.clientArea.x+T,this.viewer.updateClientAreaForTextWrap(i),this.isYPositionUpdated=!0,this.isWrapText=!1}else i.width=0,this.viewer.updateClientAreaForTextWrap(i)}}else(e.line.isFirstLine()&&0===e.indexInOwner||0===G&&e.line.children[0]===e)&&"Square"===x&&Math.round(i.width)<=Math.round(Y)&&n.containerWidget===A?(i.x=l.x,i.y=b.bottom,i.width=l.width,i.height-=b.bottom-i.y,this.isYPositionUpdated=!0):Math.round(i.width)<=Math.round(Y)&&Math.round(i.x-T)!==Math.round(this.viewer.clientArea.x)&&(i.width=0),this.viewer.updateClientAreaForTextWrap(i)}else if("Left"===w&&i.x+E>=b.x&&i.x<=b.right){var J=i.width-(b.right-i.x)-P,Y=0;if(Y=t.isNullOrUndefined(k)?e.width:this.getMinWidth(e,e.width,e.height,i),Math.round(J)<F||J<Y){Q=0;this.isYPositionUpdated=!0,i.height-=b.bottom+Q-i.y,i.y=b.bottom+Q,this.viewer.updateClientAreaForTextWrap(i)}}"Both"!==w&&(this.isWrapText=!1)}else if(this.isNeedToWrapForTopAndBottom(n,e,-1,-1,x,b,p,1,g,!1,i,e.width,e.height)){var Z=this.documentHelper.textHelper.getParagraphMarkWidth(n.characterFormat);if("Word2007"===this.documentHelper.compatibilityMode&&r&&!n.bidi&&!t.isNullOrUndefined(n.paragraphFormat)&&"Right"!==n.paragraphFormat.textAlignment&&"Center"!==n.paragraphFormat.textAlignment&&n.x+e.margin.left+Z<b.x)continue;var Q=0,$=i.y;i.y=b.bottom+Q,this.isYPositionUpdated=!0,i.height=i.height-(b.bottom-$+Q),i.y!==s&&e instanceof hl&&!(g instanceof el)&&e.line.isFirstLine()&&(i.y+=e.margin.top,s=i.y),this.viewer.updateClientAreaForTextWrap(i)}}}}}}return i},i.prototype.isShapeInsideTable=function(e,t){for(var i=e.line?e.line.paragraph:void 0;i&&!(i instanceof Ks);){if(i===t)return!0;i=i.containerWidget}return!1},i.prototype.adjustClientAreaBasedOnTextWrapForTable=function(e,i){if(t.isNullOrUndefined(e.containerWidget)||t.isNullOrUndefined(e.bodyWidget))return i;var r=e.bodyWidget,n=this.viewer,o=(i.y,t.isNullOrUndefined(e.previousWidget),[]);if(r.floatingElements.length>0&&(o=o.concat(r.floatingElements)),r instanceof Xs||t.isNullOrUndefined(r.page)||t.isNullOrUndefined(r.page.headerWidget)||!(r.page.headerWidget.floatingElements.length>0)||(o=o.concat(r.page.headerWidget.floatingElements)),!t.isNullOrUndefined(o)&&o.length>0){var a=n.clientActiveArea;o.sort(function(e,t){return e.y-t.y}),o.sort(function(e,t){return e.x-t.x});for(var s=0;s<o.length;s++){var l=o[s];if(!(l instanceof el&&l.wrapTextAround&&-1!==e.getSplitWidgets().indexOf(l))&&!(l instanceof Cl&&this.isShapeInsideTable(l,e))){var d=!1;if(d=l instanceof Cl?l.allowOverlap:l.positioning.allowOverlap,(!(e.isInsideTable&&l instanceof el)||l.isInsideTable)&&!(l instanceof el&&l.wrapTextAround&&l.positioning.allowOverlap&&e.wrapTextAround&&e.positioning.allowOverlap)){var h=e.getTableCellWidth(),c=l instanceof Cl,g=c?l.distanceLeft:l.positioning.distanceLeft,p=c?l.distanceTop:l.positioning.distanceTop,u=c?l.distanceRight:l.positioning.distanceRight,f=c?l.distanceBottom:l.positioning.distanceBottom,m=c?l.width:l.getTableCellWidth(),y=new zs(l.x-g,l.y-p,m+g+u,l.height+p+f),v=l instanceof el?"Square":l.textWrappingStyle,W=l instanceof el?"Both":l.textWrappingType,b=e.childWidgets.length>0?e.childWidgets[0].rowFormat.height:0,x=this.getNestedTable(e).firstChild.firstChild.firstChild.characterFormat,w=this.documentHelper.textHelper.measureText(" ",x);if(b<w.Height&&(b=w.Height),!(a.x>y.right+24||a.right<y.x-24)&&this.isNeedToWrapForSquareTightAndThroughForTable(r,e,-1,-1,v,y,d,1,l,!1,i,h,b)&&!(this.isRelayout&&l instanceof el&&"Paragraph"===l.positioning.verticalOrigin&&e.index<l.index))if(i.x>=y.x&&i.x<y.right&&"Left"!==W){i.width=i.width-(y.right-i.x),this.isWrapText=!0;if(Math.round(i.width)<24||i.width<h||y.x<e.x){i.width=this.viewer.clientArea.right-y.right;var F=h;if(Math.round(i.width)<24||i.width<F){if(y.x-e.x>24&&this.viewer.clientArea.right-y.right>24)i.width=0;else{P=0;this.isYPositionUpdated=!0,i.width=this.viewer.clientArea.width,i.height-=y.bottom+P-i.y,this.istableYpositionChange||"Word2003"!==this.documentHelper.compatibilityMode||(this.textWrappingBottom=i.y,this.istableYpositionChange=!0),i.y=y.bottom+P}this.viewer.updateClientAreaForTextWrap(i),this.isWrapText=!1}else{C=i.x;if(i.x=y.right,"Square"===v&&i.width<0&&h>0){this.isYPositionUpdated=!0,i.height-=y.bottom+0-i.y,i.width=this.viewer.clientArea.width,i.y=y.bottom+0,i.x=C}this.viewer.updateClientAreaForTextWrap(i)}}else{var C=i.x;if(i.x=y.right+e.firstChild.firstChild.leftMargin,i.width=this.viewer.clientArea.right-y.right,"Square"===v&&i.width<0&&h>0){var P=0;this.isYPositionUpdated=!0,i.width=this.viewer.clientArea.width,i.height-=y.bottom+P-i.y,i.y=y.bottom+P,i.x=C}this.viewer.updateClientAreaForTextWrap(i)}}else if(y.x>i.x&&i.right>y.x&&y.bottom>i.y&&!e.wrapTextAround){var T=this.getTableWidth(e);if(e.x+T<y.x)continue;var O=y.bottom>i.y?y.bottom-i.y:0;i.y=y.bottom,i.height=i.height-O,this.viewer.updateClientAreaForTextWrap(i)}}}}}return i},i.prototype.getNestedTable=function(e){for(var t=e;t.firstChild.firstChild.firstChild instanceof el;)t=t.firstChild.firstChild.firstChild;return t},i.prototype.startAt=function(e,t){return"Footnote"===e.footnoteType?(this.startat=e.paragraph.bodyWidget.sectionFormat.initialFootNoteNumber,t=this.getFootEndNote(e.paragraph.bodyWidget.sectionFormat.footNoteNumberFormat,this.documentHelper.footnoteCollection.indexOf(e)+this.startat)):(this.startat=e.paragraph.bodyWidget.sectionFormat.initialEndNoteNumber,t=this.getFootEndNote(e.paragraph.bodyWidget.sectionFormat.endnoteNumberFormat,this.documentHelper.endnoteCollection.indexOf(e)+this.startat)),t},i.prototype.layoutFootEndNoteElement=function(e){this.isFootnoteContentChanged=!0;var i,r=!1,n=this.documentHelper.footnoteCollection.indexOf(e),o=1;this.islayoutFootnote=!0;var a,s=new zs(this.viewer.clientArea.x,this.viewer.clientArea.y,this.viewer.clientArea.width,this.viewer.clientArea.height),l=new zs(this.viewer.clientActiveArea.x,this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.width,this.viewer.clientActiveArea.height),d=e.paragraph.bodyWidget,h=!1,c=0;if(d.page.footnoteWidget)for(var g=0;g<d.page.footnoteWidget.bodyWidgets.length;g++){o=d.page.footnoteWidget.bodyWidgets.length;var p=this.documentHelper.footnoteCollection.indexOf(d.page.footnoteWidget.bodyWidgets[g].footNoteReference);if(p>n&&p-n==1){o=g,r=!0;break}}if(e.isLayout=!0,"Footnote"===e.footnoteType){if(d.page.footnoteWidget&&d.page.footnoteWidget instanceof Zs)i=d.page.footnoteWidget;else{h=!0,(i=new Zs).footNoteType="Footnote",i.page=d.page;var u=new Qs;u.characterFormat=new S(void 0,this.documentHelper),u.paragraphFormat=new Ls,u.index=0;var f=new rl(u);u.childWidgets.push(f),c=this.documentHelper.textHelper.getParagraphMarkSize(u.characterFormat).Height,i.margin=new js(0,c,0,0)}this.isFootNoteLayoutStart=!0,h&&(d.page.footnoteWidget=i);var m=e.bodyWidget;this.viewer.updateClientArea(i,i.page),this.viewer.clientArea.y=s.y,this.viewer.clientActiveArea.y=l.y;for(var y=0;y<e.bodyWidget.childWidgets.length;y++){var v=e.bodyWidget.childWidgets[y];v.containerWidget=m,m.page=d.page,m.sectionFormat=i.sectionFormat,v.containerWidget.containerWidget=i,this.viewer.updateClientAreaForBlock(v,!0),v instanceof el&&this.clearTableWidget(v,!0,!0),this.layoutBlock(v,0),c+=v.height,v.y=0,this.viewer.updateClientAreaForBlock(v,!1),m.height+=v.height}if(i.sectionFormat.columns.length>1&&!(0===i.bodyWidgets.length&&m.childWidgets.length<=1&&m.childWidgets[0].childWidgets.length<=1)&&(c/=i.sectionFormat.numberOfColumns),this.isFootNoteLayoutStart=!1,a=!1,c>=l.height&&(this.isfootMove=!0),r?i.bodyWidgets.splice(o,0,m):i.bodyWidgets.push(m),e.line.paragraph.isInsideTable){var W=this.getParentTable(e.line.paragraph.associatedCell.ownerTable);if(t.isNullOrUndefined(W.footnoteElement)&&(W.footnoteElement=[]),-1==W.footnoteElement.indexOf(e)){W.footnoteElement.push(e),this.layoutedFootnoteElement.push(e);var b=e.line.paragraph.containerWidget.ownerTable;-1==b.footnoteElement.indexOf(e)&&b.footnoteElement.push(e)}}i.height+=c,a=!0,this.viewer.clientActiveArea=l,this.viewer.clientActiveArea.height-=c,this.footnoteHeight+=c,this.viewer.clientArea=s}return a},i.prototype.layoutEndNoteElement=function(){var e=this.documentHelper.pages.length;if(this.documentHelper.endnoteCollection.length>0){var i=void 0,r=void 0,n=void 0,o=this.documentHelper.pages[e-1],a=o.bodyWidgets[0],s=o.bodyWidgets[o.bodyWidgets.length-1];if(this.viewer instanceof Es&&s.sectionFormat.numberOfColumns>1){var l=this.getBodyWidget(s,!0);this.splitBodyWidgetBasedOnColumn(l)}for(var d=0;d<this.documentHelper.endnoteCollection.length;d++){i=this.documentHelper.endnoteCollection[d],a.page.endnoteWidget instanceof Zs&&"Endnote"===a.page.endnoteWidget.footNoteType?r=a.page.endnoteWidget:(n=!0,(r=new Zs).footNoteType="Endnote",r.page=a.page);var h=i.bodyWidget;h.page=r.page;for(var c=0;c<i.bodyWidget.childWidgets.length;c++){var g=i.bodyWidget.childWidgets[c];g.containerWidget=h,g.containerWidget.containerWidget=r}-1===r.bodyWidgets.indexOf(h)&&(h.index=r.bodyWidgets.length,r.bodyWidgets.push(h),h.sectionFormat=r.page.bodyWidgets[r.page.bodyWidgets.length-1].sectionFormat),n&&(a.page.endnoteWidget=r)}if(t.isNullOrUndefined(r)||t.isNullOrUndefined(r.page))this.layoutfootNote(r);else{var p=this.viewer.clientActiveArea.clone(),u=this.getBodyWidget(r.page.bodyWidgets[r.page.bodyWidgets.length-1],!0);this.viewer.updateClientArea(u,u.page);var f=this.getNextWidgetHeight(u);f>0&&(this.viewer.clientActiveArea.height-=f-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=f),this.layoutfootNote(r),this.viewer.clientActiveArea=p}}},i.prototype.hasValidElement=function(e){var i=e.firstChild;if(i)for(var r=i.children[0];r;){if(r instanceof ol&&(r=this.documentHelper.getNextValidElementForField(r),!t.isNullOrUndefined(r)&&!r.line.paragraph.equals(e)))return!1;if(r instanceof hl||r instanceof Il)return!0;t.isNullOrUndefined(r)||(r=r.nextNode)}return!1},i.prototype.isConsiderAsEmptyLineWidget=function(e){for(var t=0;t<e.children.length;t++){var i=e.children[t];if(!(i instanceof Cl&&"Inline"!==i.textWrappingStyle)&&i.width>0)return!1}return!0},i.prototype.updateFieldText=function(e){var t=this.documentHelper.getFieldResult(e.fieldBegin,e.paragraph.bodyWidget.page);""!==t&&(e.text=t,this.documentHelper.textHelper.getTextSize(e,e.characterFormat))},i.prototype.checkLineWidgetWithClientArea=function(e,i){var r=!1;if(e!==i.line||i.line===e&&t.isNullOrUndefined(i.nextElement)&&!i.line.isLastLine()){if(r=this.is2013Justification&&this.viewer.clientActiveArea.width>0,this.moveToNextLine(e),"Word2013"!==this.documentHelper.compatibilityMode&&this.isOverlapFloatTable){var n=void 0;i.line.paragraph.previousRenderedWidget instanceof el&&i.line.paragraph.previousRenderedWidget.wrapTextAround&&(n=i.line.paragraph.previousRenderedWidget,this.viewer.clientActiveArea.x=this.viewer.clientActiveArea.x-bs.convertPointToPixel(n.firstChild.firstChild.leftMargin)),this.viewer.clientActiveArea.x+=e.paragraph.leftIndent,this.isOverlapFloatTable=!1}e!==i.line&&(this.isRTLLayout=!1)}i.line!==e&&this.viewer instanceof Es&&this.viewer.clientActiveArea.height<i.height&&this.viewer.clientActiveArea.y!==this.viewer.clientArea.y?(this.moveToNextPage(this.viewer,i.line),this.viewer.clientActiveArea.height<i.height&&this.viewer.clientActiveArea.y!==this.viewer.clientArea.y&&this.moveToNextPage(this.viewer,i.line)):r&&t.isNullOrUndefined(i.nextElement)&&"Exactly"===i.line.paragraph.paragraphFormat.lineSpacingType&&!t.isNullOrUndefined(i.line.nextLine)&&this.viewer.clientActiveArea.height<i.line.height&&this.viewer instanceof Es&&this.viewer.clientActiveArea.y!==this.viewer.clientArea.y?this.moveToNextPage(this.viewer,i.line.nextLine):i.line===e&&t.isNullOrUndefined(i.nextElement)&&e.paragraph.lastChild===e&&!e.isLastLine()&&this.viewer.clientActiveArea.height>=0&&this.moveFromNextPage(e)},i.prototype.checkAndSplitTabOrLineBreakCharacter=function(e,t){var i=["\t","\v","\f"],r=bs.indexOfAny(e,i);if(r>-1){var n=e[r];("\t"===n&&"\t"!==e||"\v"===n&&"\v"!==e||"\f"===n&&"\f"!==e)&&this.splitByLineBreakOrTab(this.viewer,t,r,n)}},i.prototype.moveFromNextPage=function(e){var t=e.nextLine;if(t&&-1===e.paragraph.childWidgets.indexOf(t)){var i=t.paragraph;t.paragraph.childWidgets.splice(t.indexInOwner,1),e.paragraph.childWidgets.push(t),t.paragraph=e.paragraph,0===i.childWidgets.length&&i.destroy()}},i.prototype.cutClientWidth=function(e,i,r){if(this.is2013Justification)return!1;this.clearLineMeasures();var n=e.line;n.marginTop=0;for(var o=0,a=0;a<n.children.length;a++){var s=n.children[a];if(i&&(s instanceof Pl||s instanceof Tl)&&"Inline"===s.textWrappingStyle&&this.layoutShape(s),!this.isRelayoutOverlap&&s instanceof fl&&"\t"===s.text&&(s.width=this.getTabWidth(n.paragraph,this.viewer,0,n,s)),o+=s.width,e===s)break}var l=this.viewer.clientActiveArea.width-o<0,d=e.line.paragraph.bodyWidget;return d&&d.floatingElements.length>0?(this.hasFloatingElement=!0,r||(this.isXPositionUpdated=!0),!1):(l?e.previousElement&&this.cutClientWidth(e.previousElement):(this.viewer.cutFromLeft(this.viewer.clientActiveArea.x+o),"Justify"===e.line.paragraph.paragraphFormat.textAlignment&&e instanceof hl&&this.splitTextElementWordByWord(e),t.isNullOrUndefined(e.nextElement)&&this.viewer.clientActiveArea.width>0&&!e.line.isLastLine()&&this.moveElementFromNextLine(n)),l)},i.prototype.layoutFieldCharacters=function(e){if(0===e.fieldType){if(!t.isNullOrUndefined(e.formFieldData)&&this.isInitialLoad&&this.checkAndUpdateFieldData(e),!this.isFieldCode&&(!t.isNullOrUndefined(e.fieldEnd)||e.hasFieldEnd)){if(-1===this.documentHelper.fieldStacks.indexOf(e)&&this.documentHelper.fieldStacks.push(e),this.isRelayout){var i=bs.trimEnd(this.documentHelper.editorProperties.getFieldCode(e));this.isIFfield=bs.startsWith(i,"IF")}this.isFieldCode=!0,e.hasFieldEnd=!0}}else if(this.documentHelper.fieldStacks.length>0)if(2===e.fieldType)(r=this.documentHelper.fieldStacks[this.documentHelper.fieldStacks.length-1]).fieldSeparator!==e||t.isNullOrUndefined(r.fieldEnd)&&!r.hasFieldEnd||(this.isFieldCode=!1);else{var r=this.documentHelper.fieldStacks[this.documentHelper.fieldStacks.length-1];e===r.fieldEnd&&(this.documentHelper.fieldStacks.pop(),this.isFieldCode=!1,this.isIFfield=!1)}},i.prototype.getCheckBoxText=function(){return"Cross"===this.owner.documentEditorSettings.defaultCheckBoxOption?String.fromCharCode(9746):String.fromCharCode(9745)},i.prototype.checkAndUpdateFieldData=function(e){if(e.hasFieldEnd&&!t.isNullOrUndefined(e.fieldEnd)){if(t.isNullOrUndefined(e.fieldSeparator)){var i=new ol(2);i.fieldBegin=e,i.fieldEnd=e.fieldEnd,i.line=e.line,e.line.children.splice(e.fieldEnd.indexInOwner,0,i),e.fieldSeparator=i,e.fieldEnd.fieldSeparator=i}var r=e.fieldEnd.previousNode;if(r instanceof ol&&2===r.fieldType){var n=e.formFieldData;if(n instanceof ll){var o=new hl;o.skipformFieldLength=!0,o.line=e.line;s=e.line.children.indexOf(e.fieldEnd);e.line.children.splice(s,0,o),o.characterFormat.copyFormat(e.characterFormat),n.checked?o.text=this.getCheckBoxText():o.text=String.fromCharCode(9744),this.setCheckBoxFontSize(n,o.characterFormat)}else if(n instanceof dl){var a=new hl;a.characterFormat.copyFormat(e.characterFormat),a.skipformFieldLength=!0,a.line=e.line,n.dropdownItems.length>0?t.isNullOrUndefined(n.selectedIndex)?a.text=n.dropdownItems[0]:a.text=n.dropdownItems[n.selectedIndex]:a.text=this.documentHelper.textHelper.repeatChar(this.documentHelper.textHelper.getEnSpaceCharacter(),5);var s=e.line.children.indexOf(e.fieldEnd);e.line.children.splice(s,0,a)}}}},i.prototype.setCheckBoxFontSize=function(e,i){i.ownerBase instanceof hl&&(i.ownerBase.paragraph&&i.ownerBase.paragraph.isInsideTable||t.isNullOrUndefined(i.ownerBase.paragraph))&&(pd=1.35),"Auto"!==e.sizeType?i.fontSize=e.size*pd:i.fontSize=i.fontSize*pd,pd=1.4},i.prototype.layoutEmptyLineWidget=function(e,i,r,n){this.clearLineMeasures();var o=e.paragraphFormat,a=0,s=0;n=!t.isNullOrUndefined(n)&&n;var l,d=o.borders,h=this.documentHelper.canRenderBorder(e),c=this.documentHelper.textHelper.getParagraphMarkSize(e.characterFormat).Height,g=0;if(e.childWidgets.length>0&&!n){if(this.isUpdateMarginForCurrentLine(r),(l=e.childWidgets[e.childWidgets.length-1]).children.length>0){(o.bidi||this.isContainsRtl(l))&&this.shiftElementsForRTLLayouting(l,o.bidi);var p=l.isFirstLine(),u=l.isLastLine(),f=0;if(p&&(g=this.getBeforeSpacing(e),f=bs.convertPointToPixel(o.firstLineIndent)),"Left"!==(O=o.textAlignment)&&this.viewer.textWrap&&("Justify"!==O||!u||"Justify"===O&&o.bidi)){var m=this.getSubWidth(l,"Justify"===O,s,f,u);a=m[0].subWidth,s=m[0].spaceCount}}}else l=i?this.addLineWidget(e):r;if(l.isFirstLine()&&(g=this.getBeforeSpacing(e)),!(t.isNullOrUndefined(e.containerWidget)||!(e.bodyWidget.floatingElements.length>0)||e.containerWidget instanceof Ol||e.containerWidget instanceof il&&e.containerWidget.ownerTable.containerWidget instanceof Ol)){var y=new hl;y.line=l,l.children.push(y),y.text="¶",y.characterFormat=e.characterFormat,y.width=this.documentHelper.textHelper.getTextSize(y,y.characterFormat),this.adjustPosition(y,e.bodyWidget,!0),n||(e.x+=y.padding.left),0!==y.padding.left&&(e.textWrapWidth=!0),i&&this.checkInbetweenShapeOverlap(l),l.children.splice(y.indexInOwner,1)}!(this.viewer instanceof Es&&this.viewer.clientActiveArea.height<g+c&&this.viewer.clientActiveArea.y!==this.viewer.clientArea.y)||l.isFirstLine()&&t.isNullOrUndefined(l.paragraph.previousWidget)&&!l.isEndnoteLineWidget()||e.isSectionBreak||e.bodyWidget instanceof Xs||this.moveToNextPage(this.viewer,l);var v=this.getLineSpacing(e,c);"Word2003"===this.documentHelper.compatibilityMode&&v<0&&"Exactly"===e.paragraphFormat.lineSpacingType&&(v=Math.abs(v)),!isNaN(this.maxTextHeight)&&c<this.maxTextHeight&&(c=this.maxTextHeight);var W=0,b=0,x=0,w=c,F=e.paragraphFormat.lineSpacingType;"Multiple"===F?v>c?b+=v-c:W+=v-c:"Exactly"===F?W+=v-(W+w+b):v>W+w+b&&(W+=v-(W+w+b)),W+=g,b+=bs.convertPointToPixel(this.getAfterSpacing(e)),"Multiple"!==F||!e.isEmpty()||t.isNullOrUndefined(e.bodyWidget)||this.viewer.clientActiveArea.y!==this.viewer.clientArea.y||0===e.bodyWidget.page.index||e.bodyWidget instanceof Xs||e.isSectionBreak||0!==e.bodyWidget.columnIndex||t.isNullOrUndefined(e.bodyWidget.previousSplitWidget)||(W-=g),"None"!=d.top.lineStyle&&l.isFirstLine()&&!h.skipTopBorder&&(W+=bs.convertPointToPixel(d.top.lineWidth+d.top.space)),"None"!=d.bottom.lineStyle&&l.isLastLine()&&!h.skipBottomBorder&&(b+=bs.convertPointToPixel(d.bottom.lineWidth+d.bottom.space));for(var C=l.renderedElements,P=0;P<C.length;P++){var T=C[P];if(T instanceof kl||e.paragraphFormat.bidi&&C[C.length-1]instanceof kl){x=0;var O=e.paragraphFormat.textAlignment;"Right"===O&&0===P?x=a:"Center"===O&&0===P&&(x=a/2),T.margin=new js(x,W,0,b),T.line=l,l.height=W+w+b}}l.margin=new js(0,W,0,b),l.height=W+w+b,this.adjustPositionBasedOnTopAndBottom(l);var S=bs.convertPointToPixel(this.getAfterSpacing(e));S>0&&n&&!t.isNullOrUndefined(r)&&i&&l.isLastLine()&&(r.margin.bottom=Math.max(0,r.margin.bottom-S),r.height=Math.max(0,r.height-S),this.viewer.clientActiveArea.y-=S,this.viewer.clientActiveArea.height+=S),(t.isNullOrUndefined(e.nextRenderedWidget)&&e.isInsideTable&&e.previousRenderedWidget instanceof el&&1==e.childWidgets.length||e.characterFormat.hidden)&&(l.height=0);var N=e.previousRenderedWidget;if(e.isSectionBreak&&N instanceof Qs&&e.index>0)this.layoutSectionBreakParagraph(e,N),N.isEndsWithPageBreak&&this.moveToNextPage(this.viewer,l,!0);else{this.viewer.cutFromTop(this.viewer.clientActiveArea.y+l.height);var I=e.previousRenderedWidget;if(I){var k=I.getSplitWidgets();e.isSectionBreak&&k.length>0&&k[k.length-1]instanceof el&&k[k.length-1].wrapTextAround&&this.viewer.cutFromTop(k[k.length-1].y+k[k.length-1].height)}}this.wrapPosition=[]},i.prototype.layoutSectionBreakParagraph=function(e,t){var i=t.lastChild,r=e.firstChild;i.margin&&(r.margin=new js(0,i.margin.top,0,i.margin.bottom)),r.height=i.height,e.height=i.height,e.y=this.getLineYPosition(t),e.width=t.width,e.x=this.getLineXPosition(t)},i.prototype.getLineYPosition=function(e){for(var t=e.y,i=0;i<e.childWidgets.length-1;i++)t+=e.childWidgets[i].height;return t},i.prototype.hasVisibleElement=function(e){for(var t=0;t<e.children.length;t++)if(e.children[t]instanceof hl&&!e.children[t].characterFormat.hidden)return!0;return!1},i.prototype.getMergedParagraphOffset=function(e){var t=e.previousWidget,i=t.x+bs.convertPointToPixel(t.paragraphFormat.firstLineIndent),r=e.x+bs.convertPointToPixel(e.paragraphFormat.firstLineIndent);return i+this.getLineWidth(t.lastChild)+this.getHiddenParagraphMarkWidth(t)-r},i.prototype.getHiddenParagraphMarkWidth=function(e){for(var t=e.lastChild,i=t.children.length-1;i>=0;i--){var r=t.children[i];if(r instanceof hl){var n=r.characterFormat,o=n.hidden;n.hidden=!1;var a=this.documentHelper.textHelper.getParagraphMarkSize(n).Width;return n.hidden=o,a}}return 0},i.prototype.isMergedWithNextParagraph=function(e){var t=e.nextWidget;return e.characterFormat.hidden&&e.characterFormat.specVanish&&!e.isInsideTable&&1===e.childWidgets.length&&!e.isEmpty()&&this.hasVisibleElement(e.childWidgets[0])&&!e.isEndsWithPageBreak&&!e.isEndsWithColumnBreak&&t instanceof Qs&&!t.isSectionBreak&&!t.isEmpty()},i.prototype.getLineXPosition=function(e){var t=e.lastChild,i=this.documentHelper.textHelper.getParagraphMarkSize(e.characterFormat);return e.x+this.getLineWidth(t)+i.Width},i.prototype.getLineWidth=function(e){for(var t=0,i=0;i<e.children.length;i++)e.children[i]instanceof Pl||(t+=e.children[i].width);return t},i.prototype.isUpdateMarginForCurrentLine=function(e){var i=!0;if(!t.isNullOrUndefined(e)&&!e.isFirstLine()){for(var r=0;r<e.children.length;r++)if(!(e.children[r]instanceof Ll||e.children[r]instanceof Al)){i=!1;break}i&&(e.margin=new js(0,0,0,0))}},i.prototype.adjustPositionBasedOnTopAndBottom=function(e){!t.isNullOrUndefined(e.paragraph.bodyWidget)&&!t.isNullOrUndefined(e.paragraph.bodyWidget.page.headerWidget)&&e.paragraph.bodyWidget.page.headerWidget.floatingElements.length>0&&e.paragraph===e.paragraph.bodyWidget.childWidgets[0]&&0===e.indexInOwner&&this.checkInbetweenShapeOverlap(e,e.paragraph.bodyWidget.page.headerWidget.floatingElements)},i.prototype.layoutListItems=function(e,i){this.isFieldCode||(!t.isNullOrUndefined(e.paragraphFormat)&&!t.isNullOrUndefined(e.paragraphFormat.listFormat)&&!t.isNullOrUndefined(this.documentHelper.getListById(e.paragraphFormat.listFormat.listId))&&e.paragraphFormat.listFormat.listLevelNumber>=0&&e.paragraphFormat.listFormat.listLevelNumber<9&&!i?(this.clearListElementBox(e),this.layoutList(e,this.documentHelper)):e.paragraphFormat.listFormat&&-1===e.paragraphFormat.listFormat.listId&&this.clearListElementBox(e))},i.prototype.layoutList=function(e,i){var r=i.getListById(e.paragraphFormat.listFormat.listId),n=e.paragraphFormat.listFormat.listLevelNumber,o=this.getListLevel(r,n);if(!t.isNullOrUndefined(o)&&!t.isNullOrUndefined(o.numberFormat)){var a=e.childWidgets[0];t.isNullOrUndefined(a)&&(a=new rl(e),e.childWidgets.push(a));var s=new kl(o,!1),l=!1;if(e.characterFormat.hidden){if(e.isEmpty())l=!0;else for(var d=a.children[0];d;){if(d.isValidNodeForTracking&&!d.characterFormat.hidden){l=!1;break}l=!0,d=d.nextNode}l&&(s.characterFormat.hidden=!0)}s.line=a,"Bullet"===o.listLevelPattern?(s.text=o.numberFormat,this.updateListValues(r,n)):s.text=this.getListNumber(e);var h="None"!==o.listLevelPattern&&0!==e.paragraphFormat.firstLineIndent&&"None"!==o.followCharacter;if(""!==o.numberFormat||h){if(this.viewer.updateClientWidth(-bs.convertPointToPixel(e.paragraphFormat.firstLineIndent)),this.documentHelper.isIosDevice||this.documentHelper.isLinuxOS){var c=s.text;(c=c===String.fromCharCode(61623)?String.fromCharCode(9679):c===String.fromCharCode(61551)+String.fromCharCode(32)?String.fromCharCode(9675):c)!==s.text&&(s.text=c)}if(i.textHelper.updateTextSize(s,e),s.text&&s.text.indexOf("")>-1){var g=s.text.split("");if(2===g.length){var p=i.textHelper.getWidth(g[0],e.characterFormat),u=i.textHelper.getWidth(g[1],e.characterFormat);s.dualWidths={w1:p,w2:u},s.width=p+u}}else s.dualWidths=void 0;this.applyListNumberAlignment(s,o,e);var f;this.viewer instanceof Es&&this.viewer.clientActiveArea.height<s.height&&this.viewer.clientActiveArea.y!==this.viewer.clientArea.y&&(f=!0),this.viewer.cutFromLeft(this.viewer.clientActiveArea.x+s.width);var m=s;if(a.children.splice(0,0,s),"None"!==o.followCharacter){if(s=new kl(o,!0),l&&(s.characterFormat.hidden=!0),"Tab"===o.followCharacter){s.text="\t";var y=a.children.indexOf(s),v=this.getTabWidth(e,this.viewer,y,a,s);"Right"!==o.numberAlignment||0!==e.paragraphFormat.firstLineIndent||e.paragraphFormat.bidi||"Word2003"===i.compatibilityMode||(v=0),i.textHelper.updateTextSize(s,e),l||(s.width=v)}else s.text=" ",i.textHelper.updateTextSize(s,e);this.viewer.cutFromLeft(this.viewer.clientActiveArea.x+s.width),a.children.splice(1,0,s),s.line=a}if(t.isNullOrUndefined(e.containerWidget)||!(e.bodyWidget.floatingElements.length>0)||m instanceof Pl||e.containerWidget instanceof Ol||(this.adjustPosition(m,m.line.paragraph.bodyWidget),m instanceof kl&&m.padding&&m.padding.left>0&&e.paragraphFormat.firstLineIndent<0&&(m.padding.left-=bs.convertPointToPixel(m.line.paragraph.paragraphFormat.firstLineIndent)),this.isYPositionUpdated&&(this.viewer.clientActiveArea.width>m.width+s.width&&(this.viewer.clientActiveArea.width-=m.width+s.width),this.isYPositionUpdated=!1)),f)return this.moveToNextPage(this.viewer,a,void 0,!0),this.cutClientWidth(s),this.hasFloatingElement=!1,void(this.isXPositionUpdated=!1);"None"!==o.followCharacter&&this.viewer.updateClientWidth(bs.convertPointToPixel(e.paragraphFormat.firstLineIndent))}}},i.prototype.applyListNumberAlignment=function(e,t,i){if(e.alignmentShift=0,"Left"!==t.numberAlignment&&!i.paragraphFormat.bidi&&e.width>0){var r="Center"===t.numberAlignment?e.width/2:0;e.alignmentShift=e.width-r,e.width=r}},i.prototype.addBodyWidget=function(e,t){var i;return i=t||new Ys,i.width=e.width,i.x=e.x,i.y=e.y,i},i.prototype.addListLevels=function(e){for(var t=e.levels.length;t<9;t++){var i=new ld(e),r=t%3;"Bullet"===e.levels[0].listLevelPattern?(i.listLevelPattern="Bullet",i.numberFormat=0===r?String.fromCharCode(61623):1===r?String.fromCharCode(61551)+String.fromCharCode(32):String.fromCharCode(61607),i.characterFormat.fontFamily=i.numberFormat===String.fromCharCode(61607)?"Wingdings":"Symbol"):(i.listLevelPattern=this.getListLevelPattern(r),i.numberFormat="%"+(t+1).toString()+".",i.startAt=1,i.restartLevel=t),i.paragraphFormat=new Ls(void 0),i.paragraphFormat.leftIndent=48*(t+1),i.paragraphFormat.firstLineIndent=-24,e.levels.push(i)}},i.prototype.addSplittedLineWidget=function(e,i,r){var n=i;if(this.isWrapText)return void(t.isNullOrUndefined(r)||(e.children.splice(n+1,0,r),r.line=e));var o=!1,a=e.paragraph,s=[],l=a.childWidgets.indexOf(e);t.isNullOrUndefined(r)||s.push(r);var d=void 0,h=e.children[n];if(t.isNullOrUndefined(h))return void(t.isNullOrUndefined(r)||(e.children.splice(e.children.length,0,r),r.line=e));h instanceof Jl&&0===h.commentType&&0!=n?n-=1:h.isColumnBreak&&t.isNullOrUndefined(h.nextNode)&&(o=!0);for(var c=e.children[n];n>0&&c instanceof ml&&0===c.bookmarkType&&t.isNullOrUndefined(c.properties);)n--,c=e.children[n];for(var g=n+1;g<e.children.length;g++)s.push(e.children[g]);if(s.length>0||o){d=l===a.childWidgets.length-1?new rl(a):a.childWidgets[l+1];for(var p=0;p<s.length;p++)s[p].line=d;s.length>0&&(e.children.splice(n+1,e.children.length-1),!t.isNullOrUndefined(e.layoutedElements)&&e.layoutedElements.length>0&&e.layoutedElements.splice(n+1,e.layoutedElements.length-1),d.children=s.concat(d.children)),-1===a.childWidgets.indexOf(d)&&a.childWidgets.splice(l+1,0,d)}},i.prototype.addElementToLine=function(e,t){t instanceof Cl&&"Inline"!==t.textWrappingStyle||(this.isWrapText&&(this.isWrapText=!1,this.viewer.clientActiveArea.width=this.viewer.clientArea.right-this.viewer.clientActiveArea.x),this.viewer.cutFromLeft(this.viewer.clientActiveArea.x+t.width)),"Justify"===e.paragraphFormat.textAlignment&&t instanceof hl&&this.splitTextElementWordByWord(t),t instanceof Il&&(t.line.skipClipImage=!t.isInlineImage)},i.prototype.splitElementForClientArea=function(e,t){if(t.line.children.length>0){var i=t.previousElement,r=t.indexInOwner;t.line.children.length>1&&i&&this.viewer.clientActiveArea.x!==this.viewer.clientArea.x&&(r-=1),this.addSplittedLineWidget(t.line,r)}},i.prototype.splitByWord=function(t,i,r,n,o,a){var s=this.getSplitIndexByWord(this.viewer.clientActiveArea.width,n,o,a,r.scriptType);if(s>0&&s<r.length){var l=t.children.indexOf(r),d=new hl;if(n=n.substring(s),d.text=n," "===n[0]&&(s+=n.length-(n=bs.trimStart(n)).length),d.characterFormat.copyFormat(r.characterFormat),d.width=this.documentHelper.textHelper.getWidth(d.text,a,d.scriptType)," "===d.text[d.text.length-1]?d.trimEndWidth=this.documentHelper.textHelper.getWidth(bs.trimEnd(d.text),a,d.scriptType):d.trimEndWidth=d.width,d.characterRange=r.characterRange,d.scriptType=r.scriptType,r.text=r.text.substr(0,s)," "!==r.text&&bs.endsWith(r.text)&&a.bidi&&r.characterRange===e.CharacterRangeType.RightToLeft&&!this.isWrapText){var h=this.spitTextElementByWhitespace(r,a);l=t.children.indexOf(h)}r.width=this.documentHelper.textHelper.getWidth(r.text,r.characterFormat,r.scriptType)," "===r.text[r.text.length-1]?r.trimEndWidth=this.documentHelper.textHelper.getWidth(bs.trimEnd(r.text),r.characterFormat,r.scriptType):r.trimEndWidth=r.width,r.revisionLength>0&&this.updateRevisionForSplittedElement(r,d,!0),d.height=r.height,d.baselineOffset=r.baselineOffset,this.splitErrorCollection(r,d),this.addSplittedLineWidget(t,l,d),this.addElementToLine(i,r),0===r.width&&t.children.splice(l,1)}},i.prototype.spitTextElementByWhitespace=function(t,i){var r=t.line,n=r.children.indexOf(t),o=t.text,a=new hl,s=o.length-1;return t.text=o.substring(0,s),a.text=o.substring(s),a.characterFormat.copyFormat(t.characterFormat),a.line=r,a.characterRange=e.CharacterRangeType.WordSplit,a.scriptType=t.scriptType,a.height=t.height,a.baselineOffset=t.baselineOffset,a.width=this.documentHelper.textHelper.getWidth(a.text,i,a.scriptType),r.children.splice(n+1,0,a),t.revisionLength>0&&this.updateRevisionForSplittedElement(t,a,s>0,!0),a},i.prototype.splitErrorCollection=function(e,t){if(e.errorCollection.length>0){for(var i=[],r=e.ignoreOnceItems,n=0;n<e.errorCollection.length;n++)i.push(e.errorCollection[n]);for(var o=0;o<e.errorCollection.length;o++){var a=e.text.indexOf(e.errorCollection[o].text),s=e.errorCollection[o];a<0?(i.splice(0,1),t.errorCollection.push(s)):t.text.indexOf(s.text)>0&&t.errorCollection.push(s)}t.ignoreOnceItems=r,e.ignoreOnceItems=[],e.errorCollection=i}},i.prototype.splitByCharacter=function(e,i,r,n,o){var a=e.paragraph,s="AtLeast"===a.paragraphFormat.lineSpacingType?a.paragraphFormat.afterSpacing:0,l=this.getTextSplitIndexByCharacter(this.viewer.clientArea.width,this.viewer.clientActiveArea.width,r,n,o,i.scriptType);if(!(0===l&&i.previousNode instanceof Il&&"Right"===i.previousNode.textWrappingType)){0===l&&!t.isNullOrUndefined(i)&&i.length>0&&Math.max(i.height,s)<=this.viewer.clientArea.height&&0===this.viewer.clientActiveArea.width&&0===e.children.indexOf(i)&&(l=1);var d=0;if(l<i.length&&(d=this.documentHelper.textHelper.measureTextExcludingSpaceAtEnd(r.substring(0,l),o,i.scriptType),r=r.substring(l)),d>this.viewer.clientActiveArea.width&&i.indexInOwner>0)return void this.addSplittedLineWidget(e,i.indexInOwner-1);var h=e.children.indexOf(i);if(l<i.length){var c=new hl;c.text=r,c.errorCollection=i.errorCollection,c.canTrigger=i.canTrigger,c.scriptType=i.scriptType,i.text=i.text.substr(0,l),c.characterFormat.copyFormat(i.characterFormat),c.width=this.documentHelper.textHelper.getWidth(c.text,o,c.scriptType)," "===c.text[c.text.length-1]?c.trimEndWidth=this.documentHelper.textHelper.getWidth(bs.trimEnd(c.text),o,c.scriptType):c.trimEndWidth=c.width,c.characterRange=i.characterRange,i.width=this.documentHelper.textHelper.getWidth(i.text,o,i.scriptType)," "===i.text[i.text.length-1]?i.trimEndWidth=this.documentHelper.textHelper.getWidth(bs.trimEnd(i.text),o,i.scriptType):i.trimEndWidth=i.width,c.height=i.height,c.baselineOffset=i.baselineOffset,e.children.splice(i.indexInOwner+1,0,c),i.revisionLength>0&&this.updateRevisionForSplittedElement(i,c,l>0),this.addElementToLine(a,i),this.addSplittedLineWidget(e,h),0===i.width&&e.children.splice(h,1)}else this.addSplittedLineWidget(e,h),this.addElementToLine(a,i)}},i.prototype.updateRevisionForSplittedElement=function(e,t,i,r){if(e.revisionLength>0)for(var n=0;n<e.revisionLength;n++){var o=e.getRevision(n);t.addRevision(o)}},i.prototype.splitTextElementWordByWord=function(t){var i=t.line,r=i.children.indexOf(t),n=r,o=t.padding.left;t.padding.left=0;var a,s=t.text;if(s.trim().indexOf(" ")>=0){i.children.splice(r,1),a=t.characterFormat;for(var l=t.length-bs.trimStart(s).length;l<t.length&&0!==(l=this.getTextIndexAfterSpace(s,l))&&l!==t.length;)if(l<t.length){var d=new hl,h=s.substring(0,l);if(" "===(s=s.substring(l)).substring(0,1)&&(l+=s.length-bs.trimStart(s).length),d.text=h,d.characterFormat.copyFormat(t.characterFormat),d.line=i,d.height=t.height,d.baselineOffset=t.baselineOffset,d.characterRange=t.characterRange,d.scriptType=t.scriptType,i.children.splice(r,0,d),t.revisionLength>0&&this.updateRevisionForSplittedElement(t,d,l>0,!0)," "!==d.text&&bs.endsWith(d.text)&&a.bidi&&d.characterRange===e.CharacterRangeType.RightToLeft){var c=this.spitTextElementByWhitespace(d,a);r=i.children.indexOf(c)}d.width=this.documentHelper.textHelper.getWidth(d.text,a,d.scriptType)," "===d.text[d.text.length-1]?d.trimEndWidth=this.documentHelper.textHelper.getWidth(bs.trimEnd(d.text),a,d.scriptType):d.trimEndWidth=d.width,t.text=s,t.width=this.documentHelper.textHelper.getWidth(t.text,t.characterFormat,t.scriptType)," "===t.text[t.text.length-1]?t.trimEndWidth=this.documentHelper.textHelper.getWidth(bs.trimEnd(t.text),t.characterFormat,t.scriptType):t.trimEndWidth=t.width,0===t.width&&-1!==i.children.indexOf(t)&&i.children.splice(i.children.indexOf(t),1),l=0,r++}t.text=s,i.children.splice(r,0,t)}i.children[n].padding.left=o},i.prototype.isSplitByHyphen=function(e,i){if(!t.isNullOrUndefined(e.previousElement)&&(e.previousElement instanceof hl||e.previousElement instanceof kl)){var r=e.previousElement.text;return"-"===i.substring(0,1)&&" "!==r.substring(r.length-1,r.length)}return"-"===i.substring(0,1)},i.prototype.splitTextForClientArea=function(e,t,i,r,n){var o=e.paragraph,a=!0,s=-1;if(" "===i.substring(0,1)||this.isSplitByHyphen(t,i))s=1;else{var l=r,d=0,h=bs.trimEnd(i),c=h.indexOf(" "),g=h.indexOf("-");if(d=-1!==c&&-1!==g?Math.min(c,g)+1:-1!==c?c+1:-1!==g?g+1:0,(s=d)>0&&(l=this.documentHelper.textHelper.measureTextExcludingSpaceAtEnd(i.slice(0,s),n,t.scriptType)),bs.round(this.viewer.clientActiveArea.width,4)<bs.round(l,4)&&!this.documentHelper.textHelper.isUnicodeText(i,t.scriptType)&&!this.isWordFittedByJustification(t,l,!1)&&(a=this.checkPreviousElement(e,e.children.indexOf(t))))return}var p=!0;this.documentHelper.textHelper.isUnicodeText(i,t.scriptType)&&3===t.scriptType&&i.length-1===i.indexOf(" ")&&(p=!1),this.documentHelper.textHelper.isUnicodeText(i,t.scriptType)&&"Word2013"===this.documentHelper.compatibilityMode&&"Justify"!==t.paragraph.paragraphFormat.textAlignment&&(a=!1);var u=!0;r>this.viewer.clientActiveArea.width&&i.length>1&&/^-+$/.test(i)&&0===this.getSplitIndexByWord(this.viewer.clientActiveArea.width,i,r,n,t.scriptType)&&(u=!1),r<=this.viewer.clientActiveArea.width?this.addElementToLine(o,t):a&&(s>0||-1!==i.indexOf(" ")&&p||-1!==i.indexOf("-"))&&u?this.splitByWord(e,o,t,i,r,n):this.isRtlNonBreakableNumeric(t,i)?this.addSplittedLineWidget(e,e.children.indexOf(t)-1):this.splitByCharacter(e,t,i,r,n)},i.prototype.isRtlNonBreakableNumeric=function(e,t){var i=/^(?!.*\\).*?\d+(?:[./-]\d*)+(?:[a-zA-Z]+)?\b.*$/.test(t);return"Word2013"!==this.documentHelper.compatibilityMode&&e.characterFormat.bidi&&!this.documentHelper.textHelper.isRightToLeftLanguage(e.characterFormat.localeIdBidi)&&i},i.prototype.splitByLineBreakOrTab=function(e,t,i,r){var n=t.line.children.indexOf(t),o=t.text,a=o.substring(i),s="\t"===r?new fl:new hl;if(s.line=t.line,this.updateRevisionForSplittedElement(t,s,!0),s.characterFormat.copyFormat(t.characterFormat),s.characterRange=t.characterRange,t.line.children.splice(n+1,0,s),t.isWidthUpdated=!1,i>0&&1===a.length)s.text=o.substring(i),t.text=o.substring(0,i);else if(i>0){s.text=r;var l=new hl;l.line=t.line,l.text=o.substring(i+1),this.updateRevisionForSplittedElement(t,l,!0),l.characterFormat.copyFormat(t.characterFormat),l.characterRange=t.characterRange,t.line.children.splice(n+2,0,l),t.text=o.substring(0,i)}else""!==a&&(s.text=o.substring(i+1),t.text=r)},i.prototype.updateMargin=function(e){var i=e.paragraph,r=i.paragraphFormat,n=e.isFirstLine(),o=e.isLastLine(),a=0,s=0,l=0,d=0,h=0,c=0,g=r.borders;this.clearLineMeasures(),this.updateLineWidget(e,r),s=(a=this.maxTextHeight)-this.maxTextBaseline;var p=0,u=this.documentHelper.canRenderBorder(i);if(!i.bodyWidget||i.bodyWidget instanceof Xs||(p=this.documentHelper.pages.indexOf(i.bodyWidget.page)),n&&(d=this.getBeforeSpacing(i,!0),c=bs.convertPointToPixel(r.firstLineIndent)),o&&(l=bs.convertPointToPixel(this.getAfterSpacing(i))),(r.bidi||this.isContainsRtl(e))&&(this.shiftElementsForRTLLayouting(e,r.bidi),this.isRTLLayout=!0),isNaN(this.maxTextHeight)){var f=this.documentHelper.textHelper.measureText("a",i.characterFormat);s=(a=f.Height)-f.BaselineOffset}else s=(a=this.maxTextHeight)-this.maxTextBaseline;h=this.getLineSpacing(i,a),0===a&&"Multiple"===r.lineSpacingType&&this.isImageOnlyLine(e)&&(a=this.documentHelper.textHelper.measureText("a",i.characterFormat).Height,h=this.getLineSpacing(i,a)),(e.skipClipImage||i.paragraphFormat.lineSpacing>=14||h<0)&&"Exactly"===r.lineSpacingType&&h<s+this.maxBaseline&&(h=s+this.maxBaseline);var m,y=0,v=0,W=r.textAlignment;"Left"!==W&&this.viewer.textWrap&&("Justify"!==W||!o||"Justify"===W&&r.bidi||this.is2013Justification&&o)&&(y=(m=this.getSubWidth(e,"Justify"===W,v,c,o))[0].subWidth,v=m[0].spaceCount,m[0].totalSpaceCount,m[0].trimmedSpaceWidth,e.isEndsWithPageBreak||e.isEndsWithColumnBreak||e.isEndsWithLineBreak||e.paragraph.bidi||this.isRTLLayout);for(var b=!1,x=0,w=r.lineSpacingType,F=!1,C=e.renderedElements,P=this.viewer.clientArea.x,T=!0,O=0;O<C.length;O++){var S=0,N=0,I=C[O];if(T&&!I.characterFormat.hidden&&(T=!1),!t.isNullOrUndefined(m)&&F&&I.padding.left>0&&m.length>x+1){var k=y;"Justify"===W?k=y*m[x].spaceCount:"Center"===W&&(k=y/2),I.padding.left=I.padding.left-k;var A=m[++x];y=A.subWidth,v=A.spaceCount}if(!(I instanceof Cl&&"Inline"!==I.textWrappingStyle)){F=!0;var L=this.alignLineElements(I,S,N,s,b,y,W,v,O===C.length-1);if("Justify"===W&&I instanceof Cl&&"Inline"===I.textWrappingStyle&&0!==y&&(I.x=P,I instanceof Pl))for(var U=0;U<I.textFrame.childWidgets.length;U++){var B=I.textFrame.childWidgets[U],H=B.bidi?B.rightIndent:B.leftIndent;B.x=P+bs.convertPointToPixel(H+I.textFrame.marginLeft)}P+=I.width,e.maxBaseLine=this.maxBaseline,S=L.topMargin,N=L.bottomMargin,b=L.addSubWidth,v=L.whiteSpaceCount,"Multiple"===w?h>a?N+=h-a:S+=h-a:"Exactly"===w?S+=h-(S+I.height+N):h>S+I.height+N&&(S+=h-(S+I.height+N)),p>0&&i===i.bodyWidget.childWidgets[0]&&this.documentHelper.pages[p].sectionIndex===this.documentHelper.pages[p-1].sectionIndex?S+=0:S+=d,"None"!=g.top.lineStyle&&e.isFirstLine()&&!u.skipTopBorder&&(S+=bs.convertPointToPixel(g.top.lineWidth+g.top.space)),"None"!=g.bottom.lineStyle&&e.isLastLine()&&!u.skipBottomBorder&&(N+=bs.convertPointToPixel(g.bottom.lineWidth+g.bottom.space)),N+=l,I.margin=new js(0,S,0,N),I.line=e}}},i.prototype.moveToNextLine=function(e,i,r,n){var o=e.paragraph,a=o.paragraphFormat,s=e.isFirstLine(),l=e.isLastLine(),d=0,h=0,c=0,g=0,p=0,u=0,f=a.borders;this.updateLineWidget(e,a),h=(d=this.maxTextHeight)-this.maxTextBaseline;var m=0,y=!1,v=this.documentHelper.canRenderBorder(o);if(!o.bodyWidget||o.bodyWidget instanceof Xs||(m=this.documentHelper.pages.indexOf(o.bodyWidget.page)),s&&(g=this.getBeforeSpacing(o,!0),u=bs.convertPointToPixel(a.firstLineIndent)),l&&(c=bs.convertPointToPixel(this.getAfterSpacing(o))),(a.bidi||this.isContainsRtl(e))&&(this.shiftElementsForRTLLayouting(e,a.bidi),this.isRTLLayout=!0),isNaN(this.maxTextHeight)){var W=this.documentHelper.textHelper.measureText("a",o.characterFormat);h=(d=W.Height)-W.BaselineOffset}else h=(d=this.maxTextHeight)-this.maxTextBaseline;p=this.getLineSpacing(o,d),0===d&&"Multiple"===a.lineSpacingType&&this.isImageOnlyLine(e)&&(d=this.documentHelper.textHelper.measureText("a",o.characterFormat).Height,p=this.getLineSpacing(o,d)),(e.skipClipImage||o.paragraphFormat.lineSpacing>=14||p<0)&&"Exactly"===a.lineSpacingType&&p<h+this.maxBaseline&&(p=h+this.maxBaseline);var b,x=0,w=0,F=a.textAlignment,C=0,P=0;if("Left"!==F&&this.viewer.textWrap&&("Justify"!==F||!l||"Justify"===F&&(a.bidi||e.isEndsWithLineBreak)||this.is2013Justification&&l)&&(x=(b=this.getSubWidth(e,"Justify"===F,w,u,l))[0].subWidth,w=b[0].spaceCount,C=b[0].totalSpaceCount,P=b[0].trimmedSpaceWidth,y=e.isEndsWithPageBreak||e.isEndsWithColumnBreak||e.isEndsWithLineBreak||e.paragraph.bidi||this.isRTLLayout),!n&&!y&&b&&1===b.length&&this.viewer.clientActiveArea.width>0&&!l&&!this.is2013Justification&&"Justify"===F&&"Word2013"===this.documentHelper.compatibilityMode){var T=this.viewer.clientActiveArea.width,O=this.getTotalSpaceWidth(e),S=0;return S=T/C/(O/C)*100<=33?O/8:O/4,this.viewer.clientActiveArea.x-=S,this.viewer.clientActiveArea.width+=S,this.is2013Justification=!0,void(i?this.splitParagraphForMultiColumn(e,r):(this.moveElementFromNextLine(e),this.nextElementToLayout=e.children[e.children.length-1]))}this.is2013Justification&&l&&x>0&&(x=0,w=0),this.is2013Justification=!1,this.nextElementToLayout=void 0;for(var N=!1,I=0,k=a.lineSpacingType,A=!1,L=e.renderedElements,U=0,B=0,H=0,R=this.viewer.clientArea.x,q=!0,E=0;E<L.length;E++){var M=0,V=0,D=0,z=L[E];if(q&&!z.characterFormat.hidden&&(q=!1),!t.isNullOrUndefined(b)&&A&&z.padding.left>0&&b.length>I+1){var _=x;"Justify"===F?_=x*b[I].spaceCount:"Center"===F&&(_=x/2),z.padding.left=z.padding.left-_;var j=b[++I];x=j.subWidth,w=j.spaceCount}if(!(z instanceof Cl&&"Inline"!==z.textWrappingStyle)){A=!0;var G=this.alignLineElements(z,M,V,h,N,x,F,w,E===L.length-1);if("Justify"===F&&z instanceof Cl&&"Inline"===z.textWrappingStyle&&0!==x&&(z.x=R,e.paragraph.firstChild===e&&e.paragraph.paragraphFormat.firstLineIndent<0&&(z.x+=bs.convertPointToPixel(e.paragraph.paragraphFormat.firstLineIndent)),z instanceof Pl))for(var K=0;K<z.textFrame.childWidgets.length;K++){var Y=($=z.textFrame.childWidgets[K]).bidi?$.rightIndent:$.leftIndent;$.x=z.x+bs.convertPointToPixel(Y+z.textFrame.marginLeft)}R+=z.width,e.maxBaseLine=this.maxBaseline,M=G.topMargin,V=G.bottomMargin,N=G.addSubWidth,w=G.whiteSpaceCount,"Multiple"===k?p>d?V+=p-d:M+=p-d:"Exactly"===k?M+=p-(M+z.height+V):p>M+z.height+V&&(M+=p-(M+z.height+V)),m>0&&o===o.bodyWidget.childWidgets[0]&&this.documentHelper.pages[m].sectionIndex===this.documentHelper.pages[m-1].sectionIndex?M+=0:M+=g,"None"!=f.top.lineStyle&&e.isFirstLine()&&!v.skipTopBorder&&(M+=bs.convertPointToPixel(f.top.lineWidth+f.top.space)),"None"!=f.bottom.lineStyle&&e.isLastLine()&&!v.skipBottomBorder&&(V+=bs.convertPointToPixel(f.bottom.lineWidth+f.bottom.space)),V+=c;var X=E>0?L[E-1]:void 0;if((0===E||!(z instanceof Cl&&"Inline"!==z.textWrappingStyle)&&X instanceof Cl&&"Inline"!==X.textWrappingStyle&&X.indexInOwner<z.indexInOwner&&this.checkPrevElementTextWrappingStyle(e,E)||z.padding.left>0)&&(e.height=M+z.height+V,"Right"===F||"Justify"===F&&a.bidi&&(l||P<0)?D=P<0?P:x:"Center"===F&&(D=x<0?x:x/2)),z.margin=new js(D,M,0,V),z.line=e,U<z.height&&(U=z.height,B=z.margin.bottom,H=z.margin.top),(z instanceof Pl||z instanceof Tl)&&"Inline"===z.textWrappingStyle){if(0!==E||z.margin.left>0){var J=L[0].margin.left;if(z.x+=J,z instanceof Tl)this.updateNestedGroupShapeX(z,J);else for(var Z=z.textFrame.childWidgets,Q=0;Q<Z.length;Q++){var $=Z[Q];$ instanceof el?$.updateChildWidgetLeft($.x+J):$.x+=J}}this.updateShapeYPosition(z)}}}if(q&&(e.height=0),e.margin=new js(0,H,0,B),this.adjustPositionBasedOnTopAndBottom(e),this.checkInbetweenShapeOverlap(e),!i&&e.isLastLine()&&0===e.indexInOwner&&e.paragraph.paragraphFormat.widowControl){var ee=e.paragraph.previousSplitWidget;if(!t.isNullOrUndefined(ee)&&!ee.isEndsWithPageBreak&&!ee.isEndsWithColumnBreak&&0!==ee.indexInOwner){var te=ee.childWidgets.length-1;2===ee.childWidgets.length&&(te=0),this.splitParagraph(ee,te,e.paragraph),this.updateClientAreaForNextBlock(e,e.paragraph)}}else i&&this.splitParagraphForMultiColumn(e,r);i||this.viewer.cutFromTop(this.viewer.clientActiveArea.y+e.height),this.wrapPosition=[]},i.prototype.isImageOnlyLine=function(e){for(var t=!1,i=0;i<e.children.length;i++){var r=e.children[i];if(r instanceof Il&&"Inline"===r.textWrappingStyle)t=!0;else if(!(r instanceof hl&&0===r.text.length))return!1}return t},i.prototype.checkPrevElementTextWrappingStyle=function(e,t){for(var i=t-1;i>=0;i--){var r=e.children[i];if(!(r instanceof Cl&&"Inline"!==r.textWrappingStyle))return!1}return!0},i.prototype.updateNestedGroupShapeX=function(e,t){for(var i=e.childWidgets,r=0;r<i.length;r++){var n=i[r];if(n.x+=t,n instanceof Pl)for(var o=0;o<n.textFrame.childWidgets.length;o++){var a=n.textFrame.childWidgets[o];a instanceof el?a.updateChildWidgetLeft(a.x+t):a.x+=t}else n instanceof Tl&&this.updateNestedGroupShapeX(n,t)}},i.prototype.updateNestedGroupShapeY=function(e,t){for(var i=e.childWidgets,r=0;r<i.length;r++){var n=i[r];if(n.y+=t,n instanceof Pl)for(var o=0;o<n.textFrame.childWidgets.length;o++){var a=n.textFrame.childWidgets[o];a.y+=t,a instanceof el&&(this.updateChildLocationForTable(a.y,a),this.updateWidgetsToPage([a],[],a,!0))}else n instanceof Tl&&this.updateNestedGroupShapeY(n,t)}},i.prototype.updateShapeYPosition=function(e){if(e.y+=e.margin.top,e instanceof Tl)return void this.updateNestedGroupShapeY(e,e.margin.top);for(var t=e.textFrame.childWidgets,i=0;i<t.length;i++){var r=t[i];r.y+=e.margin.top,r instanceof el&&(this.updateChildLocationForTable(r.y,r),this.updateWidgetsToPage([r],[],r,!0))}},i.prototype.getBodyWidget=function(e,i){if(i)for(;e&&0!==e.columnIndex;)e=e.previousRenderedWidget;else for(;e&&!t.isNullOrUndefined(e.nextRenderedWidget)&&e.columnIndex!==e.sectionFormat.numberOfColumns-1&&e.index===e.nextRenderedWidget.index;)e=e.nextRenderedWidget;return e},i.prototype.splitParagraphForMultiColumn=function(e,i){this.splitParagraph(e.paragraph,i,void 0),t.isNullOrUndefined(e.paragraph.previousRenderedWidget)&&0==i||!t.isNullOrUndefined(e.paragraph.previousRenderedWidget)&&e.paragraph.previousRenderedWidget.bodyWidget.sectionIndex!==e.paragraph.bodyWidget.sectionIndex?this.moveBlocksToNextPage(e.paragraph):this.moveBlocksToNextPage(e.paragraph.previousRenderedWidget);var r=this.viewer.clientActiveArea.height;if(this.viewer.updateClientArea(e.paragraph.bodyWidget,e.paragraph.bodyWidget.page),this.viewer.clientActiveArea.y=e.paragraph.bodyWidget.y,this.viewer.clientActiveArea.height=r,e.paragraph.bodyWidget.sectionFormat.equalWidth||e.paragraph.bodyWidget.sectionFormat.numberOfColumns-1===e.paragraph.bodyWidget.columnIndex){var n=e.paragraph;this.documentHelper.blockToShift=n,this.shiftLayoutedItems(!1,!0)}},i.prototype.checkInbetweenShapeOverlap=function(e,i){var r=this;if(!(e.paragraph.containerWidget instanceof Ol)&&e.paragraph.bodyWidget){var n,o=this.getLineY(e),a=e.paragraph.isInsideTable,s=e.paragraph.y,l=!0;t.isNullOrUndefined(i)&&(l=!1,i=e.paragraph.bodyWidget.floatingElements),i.sort(function(e,t){return e.y-t.y}),i.forEach(function(i){if(!(a&&i.line&&!i.line.paragraph.isInsideTable||t.isNullOrUndefined(i.line))){var d;d="TopAndBottom"===i.textWrappingStyle&&i instanceof Il&&!e.paragraph.isEmpty()?new zs(e.paragraph.x,r.viewer.clientActiveArea.y,e.paragraph.width,e.children[0].height):new zs(e.paragraph.x,r.viewer.clientActiveArea.y,e.paragraph.width,e.height);var h=new zs(i.x,i.y-i.distanceTop,i.width,i.height);if(!(i.line&&r.isRelayout&&r.documentHelper.hooks.isBlockExistAfter&&(!r.isRelayoutOverlap&&r.documentHelper.hooks.isBlockExistAfter(i.line.paragraph,e.paragraph)||r.isRelayoutOverlap&&r.documentHelper.hooks.isBlockExistAfter(i.line.paragraph,r.endOverlapWidget)))){var c="TopAndBottom"===i.textWrappingStyle,g=i.y+i.height+i.distanceBottom-o;n&&c&&n.y+n.height+n.distanceBottom+e.height>i.y-i.distanceTop&&n.y-n.distanceTop<i.y-i.distanceTop&&i.y+i.height+i.distanceBottom>n.y+n.height+n.distanceBottom?(n=i,e.paragraph.isEmpty()&&l?(e.paragraph.y=s,e.paragraph.y+=g):e.marginTop=g):c&&!n&&d.isIntersecting(h)&&(n=i,e.paragraph.isEmpty()&&l?e.paragraph.y+=g:e.marginTop=g)}}}),n?this.viewer.cutFromTop(n.y+n.height+n.distanceBottom):!this.isRelayoutOverlap||e.paragraph.containerWidget instanceof Xs&&e.marginTop>0||(e.marginTop=0)}},i.prototype.getLineY=function(e){var i=e.paragraph,r=i.y;if(!i.isEmpty())for(var n=i.firstChild;!t.isNullOrUndefined(n)&&n!==e;)r=r+n.height+n.marginTop,n=n.nextLine;return r},i.prototype.isFormFieldCheckBox=function(e){if(!e.isCheckBoxElement)return!1;var t=e.previousNode;return!!(t instanceof ol&&2===t.fieldType&&t.fieldBegin&&t.fieldBegin.formFieldData instanceof ll)},i.prototype.updateLineWidget=function(e,i){for(var r=0,n=0,o=!1,a=!1,s=0;s<e.children.length;s++){var l=e.children[s];if(l instanceof ol&&2===l.fieldType&&(a=!1),!(a||l.characterFormat.hidden||(l instanceof ol&&0===l.fieldType&&(a=!0),l instanceof Cl&&"Inline"!==l.textWrappingStyle)))if(l instanceof hl&&0===l.text.replace(/\s+/g,"").length&&l.text!==String.fromCharCode(160))r<l.height&&(r=l.height,n=l.baselineOffset);else if(l instanceof hl||l instanceof kl){var d=l.height,h=l.baselineOffset,c=!1;l instanceof hl&&l.isCheckBoxElement&&!t.isNullOrUndefined(l.previousNode)&&l.previousNode instanceof yl&&("Cell"===l.previousNode.contentControlWidgetType||"Inline"===l.previousNode.contentControlWidgetType)&&(c=!0),l instanceof hl&&l.isCheckBoxElement&&!c&&this.isFormFieldCheckBox(l)&&(l.paragraph.isInsideTable&&(pd=1.35),d/=pd,h/=pd,pd=1.4),this.maxTextHeight<d&&(this.maxTextHeight=d,this.maxTextBaseline=h),this.maxBaseline<this.maxTextBaseline&&(this.maxBaseline=this.maxTextBaseline)}else if(this.maxBaseline<l.height){if(l instanceof Il&&"Exactly"===i.lineSpacingType&&i.lineSpacing>0){var g=this.getLineSpacing(e.paragraph,l.height);this.maxBaseline<g&&(this.maxBaseline=g)}else this.maxBaseline=l.height;l instanceof Il&&(o=!0)}}if(0===this.maxTextHeight&&0!==r)if(o)this.maxTextHeight=0,this.maxTextBaseline=0;else{if(e.isLastLine()){var p=this.getParagraphMarkSize(e.paragraph,0,0);this.maxTextHeight=p.height,this.maxTextBaseline=n}else this.maxTextHeight=r,this.maxTextBaseline=n;this.maxBaseline<this.maxTextBaseline&&(this.maxBaseline=this.maxTextBaseline)}if(bs.containsUnderlinedImage(e)){var u=this.documentHelper.textHelper.measureText("a",e.paragraph.characterFormat);this.maxTextHeight=u.Height,this.maxTextBaseline=u.BaselineOffset}},i.prototype.reLayoutEndnote=function(){var e=this.documentHelper.pages[this.documentHelper.pages.length-1];if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(e.endnoteWidget)){var i=this.viewer.clientActiveArea.clone(),r=this.getBodyWidget(e.bodyWidgets[e.bodyWidgets.length-1],!0);this.viewer.updateClientArea(r,r.page);var n=this.getNextWidgetHeight(r);n>0&&(this.viewer.clientActiveArea.height-=n-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=n),this.layoutfootNote(e.endnoteWidget),this.viewer.clientActiveArea=i}},i.prototype.moveEndnoteToNextPage=function(e,i,r,n){if(r){var o=this.createSplitBody(i),a=this.viewer.createNewPage(o);this.viewer.updateClientArea(o,o.page),o.y=i.y=this.viewer.clientActiveArea.y;for(d=0;d<e.bodyWidgets.length;d++)e.bodyWidgets[d].page=a,e.bodyWidgets[d].containerWidget=e;e.page.endnoteWidget=void 0,a.endnoteWidget=e,e.page=a}else{var s=i.page;if(t.isNullOrUndefined(s.endnoteWidget)){var l=new Zs;l.footNoteType="Endnote",l.page=s,l.bodyWidgets.push(i),i.containerWidget=l;for(d=n+1;d<e.bodyWidgets.length;d++){h=e.bodyWidgets[d];e.bodyWidgets.splice(d,1),l.bodyWidgets.push(h),h.containerWidget=l,h.page=s,d--}s.endnoteWidget=l}else{-1===s.endnoteWidget.bodyWidgets.indexOf(i)&&(s.endnoteWidget.bodyWidgets.splice(0,0,i),i.containerWidget=s.endnoteWidget);for(var d=e.bodyWidgets.length-1;d>n;d--){var h=e.bodyWidgets[d];s.endnoteWidget.bodyWidgets.unshift(h),h.containerWidget=s.endnoteWidget,h.page=s,e.bodyWidgets.splice(d,1)}}}},i.prototype.moveToNextPage=function(e,i,r,n,o){if(!this.isFootNoteLayoutStart){var a,s=i.paragraph,l=!1,d=!1,h=!1,c=0;if(s&&(t.isNullOrUndefined(s.containerWidget)||t.isNullOrUndefined(s.containerWidget.containerWidget)||!(s.containerWidget.containerWidget instanceof Zs)||"Footnote"!==s.containerWidget.containerWidget.footNoteType)){var g=0;if(s instanceof Zs)return;if(!t.isNullOrUndefined(s.containerWidget)&&!t.isNullOrUndefined(s.containerWidget.containerWidget)&&s.containerWidget.containerWidget instanceof Zs&&"Endnote"===s.containerWidget.containerWidget.footNoteType&&(h=!0),!t.isNullOrUndefined(i)&&(0!==(g=s.childWidgets.indexOf(i))&&(!s.paragraphFormat.keepLinesTogether||t.isNullOrUndefined(s.previousWidget)||i.previousLine.isEndsWithColumnBreak||i.previousLine.isEndsWithPageBreak?1!=g||i.previousLine.isEndsWithPageBreak||i.previousLine.isEndsWithColumnBreak||!s.paragraphFormat.widowControl||t.isNullOrUndefined(s.previousWidget)||(g=0,l=!0):(g=0,l=!0)),(g>0||r)&&(s.height=e.clientActiveArea.y-s.y),0===g&&!s.isEndsWithPageBreak&&!s.isEndsWithColumnBreak)){var p=this.alignBlockElement(s);t.isNullOrUndefined(p.node)||(g=(a=p.node instanceof tl?this.splitRow(p.node):p.node)instanceof el?0:parseInt(p.position.index,10),l=!1,d=!0,(s=a)instanceof Qs?!this.documentHelper.editorProperties.isDocumentLoaded||s.paragraphFormat.keepWithNext||n||this.updateWholeListItems(s):this.documentHelper.editorProperties.isDocumentLoaded&&!n&&this.updateWholeListItems(s))}if(t.isNullOrUndefined(s.bodyWidget)||t.isNullOrUndefined(s.bodyWidget.containerWidget)||s.bodyWidget.containerWidget instanceof Zs||void 0===s.bodyWidget.page.footnoteWidget||this.layoutfootNote(s.bodyWidget.page.footnoteWidget),this.isMultiColumnSplit){var u=this.viewer.columnLayoutArea.getNextColumnByBodyWidget(s.bodyWidget);if(t.isNullOrUndefined(u))return}var f=s.bodyWidget.page;if(r&&0===g&&!t.isNullOrUndefined(s.bodyWidget.lastChild)&&s===s.bodyWidget.lastChild&&this.endOverlapWidget&&(this.isRelayoutOverlap=!1),h&&t.isNullOrUndefined(f.nextPage)&&0===s.bodyWidget.index&&0===s.index&&0===g){var m=s.containerWidget.containerWidget;return void this.moveEndnoteToNextPage(m,s.bodyWidget,!0)}var y=this.moveBlocksToNextPage(s,0===g,g,!1,h,void 0,r);if(h){var v=(m=s.containerWidget.containerWidget).bodyWidgets.indexOf(s.bodyWidget);y.footNoteReference=s.bodyWidget.footNoteReference,this.moveEndnoteToNextPage(m,y,!1,v)}f!==y.page&&this.viewer.updateClientArea(y,y.page),this.viewer.updateClientAreaForBlock(s,!0);var W=!0;0===s.indexInOwner&&0===s.bodyWidget.indexInOwner&&0===g&&t.isNullOrUndefined(s.previousRenderedWidget)&&(W=!1);var b=!1;if(g>0){if(i.isLastLine()&&r)return;var x=void 0;x=y.firstChild instanceof Qs&&y.firstChild.equals(s)?y.firstChild:new Qs,(x=this.moveChildsToParagraph(s,g,x)).containerWidget=y;for(var w=0;w<x.floatingElements.length;w++)(O=x.floatingElements[w]).line.paragraph.bodyWidget!==s.bodyWidget&&"Inline"!==O.textWrappingStyle&&s.bodyWidget.floatingElements.splice(s.bodyWidget.floatingElements.indexOf(O),1);var F=this.getFootNoteWidgetsOf(x);this.moveFootNotesToPage(F,s.bodyWidget,y),s=x,this.viewer.clientActiveArea.height-=this.getFootNoteHeight(F)}else if(!r&&W){if(s.containerWidget instanceof Ys&&s instanceof Qs&&!this.isImagePresent(s,!1)&&t.isNullOrUndefined(s.bodyWidget.containerWidget)&&s===s.containerWidget.lastChild&&s.bodyWidget.getSplitWidgets()[0].previousRenderedWidget&&s.bodyWidget.getSplitWidgets()[0].sectionIndex!==s.bodyWidget.getSplitWidgets()[0].previousRenderedWidget.sectionIndex){T=this.getBeforeSpacing(s,!0);s.childWidgets[0].height-=T,s.childWidgets[0].margin&&(s.childWidgets[0].margin.top-=T);for(var C=s.childWidgets[0].children,P=0;P<C.length;P++)(O=C[P]).margin.top-=T;b=!0}s.containerWidget.removeChild(s.indexInOwner),s instanceof Qs&&s.floatingElements.length>0&&this.addRemoveFloatElementsFromBody(s,s.containerWidget,!1),h&&0===s.containerWidget.childWidgets.length&&!t.isNullOrUndefined(s.containerWidget.containerWidget)&&s.containerWidget.containerWidget instanceof Zs&&((m=s.containerWidget.containerWidget).bodyWidgets.splice(m.bodyWidgets.indexOf(s.containerWidget),1),y.footNoteReference.bodyWidget=y,t.isNullOrUndefined(m.page.endnoteWidget)||0!==m.page.endnoteWidget.bodyWidgets.length||(m.page.endnoteWidget=void 0))}if(!r&&W){if(-1===y.childWidgets.indexOf(s)&&(y.childWidgets.splice(0,0,s),s instanceof Qs&&s.floatingElements.length>0&&this.addRemoveFloatElementsFromBody(s,y,!0)),s.containerWidget=y,b){var T=this.getBeforeSpacing(s,!0);s.childWidgets[0].height+=T,s.childWidgets[0].margin&&(s.childWidgets[0].margin.top+=T);for(var C=s.childWidgets[0].children,P=0;P<C.length;P++){var O=C[P];O.margin.top+=T}}if(s instanceof Qs?this.viewer.updateParagraphXPositionBasedOnTextWrap(s):this.viewer.updateTableXPositionBasedOnTextWrap(s),this.viewer.updateClientAreaLocation(s,this.viewer.clientActiveArea),l||d){s.bodyWidget.page.footnoteWidget&&this.layoutfootNote(s.bodyWidget.page.footnoteWidget),(i.paragraph!==s||s.paragraphFormat.widowControl&&this.isImagePresent(s,!0))&&(s instanceof el&&this.clearTableWidget(s,!0,!0,!1),this.layoutBlock(s,0,!0),e.updateClientAreaForBlock(s,!1));var S=i.paragraph;if(d&&s!==S){var N=s.nextWidget;if(!t.isNullOrUndefined(N))do{if(e.updateClientAreaForBlock(N,!0),N===S){this.viewer.updateClientAreaLocation(N,this.viewer.clientActiveArea);break}N instanceof el&&this.clearTableWidget(N,!0,!0,!1),this.layoutBlock(N,0,!0),e.updateClientAreaForBlock(N,!1),N=N.nextWidget}while(N)}this.updateClientAreaForNextBlock(i,S)}!i.isFirstLine()||0!==i.indexInOwner||i.children[0]instanceof kl||o||(c=-bs.convertPointToPixel(i.paragraph.paragraphFormat.firstLineIndent),this.viewer.updateClientWidth(c))}}if(r||this.updateShapeBaseLocation(s),o&&this.viewer.updateClientWidth(c),this.isRelayoutOverlap&&this.endOverlapWidget&&(!this.skipRelayoutOverlap||this.endOverlapWidget instanceof el&&this.endOverlapWidget.wrapTextAround)){var I=this.endOverlapWidget.previousRenderedWidget,k=i.paragraph;for(this.startOverlapWidget=k,k=(i=this.endOverlapWidget.childWidgets[0]).paragraph;k;)k.floatingElements.forEach(function(e){-1!==I.bodyWidget.floatingElements.indexOf(e)&&"Inline"!==e.textWrappingStyle&&(I.bodyWidget.floatingElements.splice(I.bodyWidget.floatingElements.indexOf(e),1),i.paragraph.bodyWidget.floatingElements.push(e))}),k=k!==this.endOverlapWidget?k.nextWidget:void 0;this.layoutStartEndBlocks(this.startOverlapWidget,this.endOverlapWidget),this.startOverlapWidget=void 0,this.viewer.clientActiveArea.height=this.viewer.clientActiveArea.bottom-this.endOverlapWidget.y,this.viewer.clientActiveArea.y=this.endOverlapWidget.y}}},i.prototype.isImagePresent=function(e,t){for(var i=0;i<e.childWidgets.length;i++)for(var r=e.childWidgets[i],n=0;n<r.children.length;n++)if(r.children[n]instanceof Il&&(!t||"Inline"!==r.children[n].textWrappingStyle))return!0;return!1},i.prototype.updateShapeBaseLocation=function(e){if(e instanceof Qs&&e.floatingElements.length>0)for(var t=0;t<e.floatingElements.length;t++){var i=e.floatingElements[t],r=this.getFloatingItemPoints(i);i.y=r.y,i.x=r.x,(i instanceof Pl||i instanceof Tl)&&this.updateChildLocationForCellOrShape(i.y,i)}},i.prototype.moveChildsToParagraph=function(e,t,i){i=this.addParagraphWidget(this.viewer.clientActiveArea,i);for(var r=0,n=t;n<e.childWidgets.length;n++)if(e!==i){var o=e.childWidgets[n];o.paragraph=i,i.childWidgets.splice(r,0,o),o.paragraph=i,r++}i.paragraphFormat=e.paragraphFormat,i.characterFormat=e.characterFormat,i.index=e.index,e.childWidgets.splice(t);for(n=0;n<e.floatingElements.length;n++){var a=e.floatingElements[n];a.line.paragraph!==e&&(i.floatingElements.push(a),e.floatingElements.splice(e.floatingElements.indexOf(a),1),n--)}return i},i.prototype.addRemoveFloatElementsFromBody=function(e,t,i){if(e.floatingElements.length>0)for(var r=0;r<e.floatingElements.length;r++)i?-1===t.floatingElements.indexOf(e.floatingElements[r])&&"Inline"!==e.floatingElements[r].textWrappingStyle&&t.floatingElements.push(e.floatingElements[r]):-1!==t.floatingElements.indexOf(e.floatingElements[r])&&t.floatingElements.splice(t.floatingElements.indexOf(e.floatingElements[r]),1)},i.prototype.alignBlockElement=function(e){if(e instanceof Qs&&(e.isEndsWithPageBreak||e.isEndsWithColumnBreak))return{node:void 0,position:{index:""}};for(var i,r=0,n=this.getPreviousBlock(e);n;){if(n instanceof Qs){if(!n.paragraphFormat.keepWithNext||n.isEndsWithPageBreak||n.isEndsWithColumnBreak)break;if(i=n,n.paragraphFormat.keepLinesTogether)t.isNullOrUndefined(this.getPreviousBlock(n))?i=void 0:r=0;else if(t.isNullOrUndefined(this.getPreviousBlock(n))&&1===n.childWidgets.length)i=void 0;else if(n.paragraphFormat.widowControl){if((1===(r=n.lastChild.indexInOwner-1)||r<0)&&(r=0),0!==r)break}else if(0!==(r=n.lastChild.indexInOwner))break}else if(n instanceof tl){var o=n.childWidgets[0];if(!(o.childWidgets.length>0))break;var a=!1;o.columnIndex>0&&(a=!0);var s=this.documentHelper.getFirstParagraphInCell(o);if(!t.isNullOrUndefined(s)&&s.paragraphFormat.keepWithNext&&0===o.columnIndex||a&&o.cellFormat&&o.cellFormat.verticallyMergedCellsKeepWithNext)t.isNullOrUndefined(this.getPreviousBlock(n))?i=void 0:r=(i=n).indexInOwner;else{if(!(e instanceof tl&&n.rowFormat.isHeader&&"Word2013"===this.documentHelper.compatibilityMode)||t.isNullOrUndefined(n.ownerTable.previousWidget))break;t.isNullOrUndefined(this.getPreviousBlock(n))?i=void 0:r=(i=n).indexInOwner}}n=this.getPreviousBlock(n)}return!t.isNullOrUndefined(i)&&i instanceof Qs&&0===i.indexInOwner&&i.paragraphFormat.keepWithNext&&i.paragraphFormat.widowControl&&(i=e,r=0),{node:i,position:{index:r.toString()}}},i.prototype.getPreviousBlock=function(e){var i;return e instanceof Qs?(i=e.previousWidget,!this.isInitialLoad&&t.isNullOrUndefined(i)&&e.containerWidget instanceof Ys&&!t.isNullOrUndefined(e.containerWidget.previousRenderedWidget)&&e.containerWidget.sectionIndex===e.containerWidget.previousRenderedWidget.sectionIndex&&!t.isNullOrUndefined(e.previousRenderedWidget)&&e.previousRenderedWidget instanceof Qs&&(i=e.previousRenderedWidget)):e instanceof tl&&(i=e.previousWidget,t.isNullOrUndefined(i)&&(i=e.ownerTable.previousWidget)),i instanceof el&&(i=i.lastChild),i},i.prototype.splitRow=function(e){var t=e.ownerTable;if(0===e.indexInOwner)return t;for(var i=this.createTableWidget(t),r=e.indexInOwner;r<t.childWidgets.length;){var n=t.childWidgets.splice(r,1)[0];i.childWidgets.push(n),n.containerWidget=i,t.height-=n.height,i.height+=n.height}return t.containerWidget.childWidgets.splice(t.indexInOwner+1,0,i),i.containerWidget=t.containerWidget,i},i.prototype.splitParagraph=function(e,i,r){if(0===i&&t.isNullOrUndefined(r))return e;var n=!1;if(t.isNullOrUndefined(r))(r=new Qs).containerWidget=e.containerWidget,e.containerWidget.childWidgets.splice(e.indexInOwner+1,0,r),r.paragraphFormat=e.paragraphFormat,r.characterFormat=e.characterFormat,r.index=e.index;else if(0===i){n=!0;var o=e;e=r,r=o}for(var a=0,s=i;s<e.childWidgets.length;s++){var l=e.childWidgets[s];l.paragraph=r,n?r.childWidgets.push(l):r.childWidgets.splice(a,0,l),r.height+=l.height,e.height-=l.height,l.paragraph=r,a++}return r.width=e.width,n?(r.containerWidget.childWidgets.splice(r.indexInOwner,1),r.y=e.y,r.x=e.x,r.containerWidget=e.containerWidget,e.containerWidget.childWidgets.unshift(r)):e.childWidgets.splice(i),(0===e.childWidgets.length||n)&&e.containerWidget.childWidgets.splice(e.indexInOwner,1),r},i.prototype.updateClientPositionForBlock=function(e,i){var r=e instanceof tl?e.ownerTable:e,n=!1;do{if(r instanceof Qs){if(i instanceof Qs&&i.equals(r)){n=!0;break}this.viewer.updateClientAreaForBlock(r,!0),this.addParagraphWidget(this.viewer.clientActiveArea,r),this.viewer.cutFromTop(this.viewer.clientActiveArea.y+r.height),this.viewer.updateClientAreaForBlock(r,!1)}else if(r instanceof el){this.viewer.updateClientAreaForBlock(r,!0),"Word2013"===this.documentHelper.compatibilityMode||r.isInsideTable||(this.viewer.clientActiveArea.x=this.viewer.clientActiveArea.x-bs.convertPointToPixel(r.firstChild.firstChild.leftMargin)),this.addTableWidget(this.viewer.clientActiveArea,[r]);var o=r.firstChild;if(i instanceof tl&&r.equals(i.ownerTable)&&!t.isNullOrUndefined(o))do{if(o.equals(i)){n=!0;break}this.addTableRowWidget(this.viewer.clientActiveArea,[o]),this.updateChildLocationForRow(this.viewer.clientActiveArea.y,o),this.viewer.cutFromTop(this.viewer.clientActiveArea.y+o.height),r.height+=o.height,o=o.nextWidget}while(o);else this.updateChildLocationForTable(r.y,r),this.viewer.cutFromTop(this.viewer.clientActiveArea.y+r.height),this.viewer.updateClientAreaForBlock(r,!1)}r=r.nextWidget}while(r&&!n)},i.prototype.updateClientAreaForNextBlock=function(e,t){for(var i=0;i<t.childWidgets.length;i++){var r=t.childWidgets[i];if(e===r)break;this.updateShapeBaseLocation(t),this.checkInbetweenShapeOverlap(r),this.viewer.cutFromTop(this.viewer.clientActiveArea.y+r.height)}},i.prototype.layoutStartEndBlocks=function(e,i){var r=e;this.isOverlapFloatTable=!0,this.viewer.clientActiveArea.height=this.viewer.clientActiveArea.bottom-e.y,this.viewer.clientActiveArea.y=e.y;var n;for(n=e instanceof el?this.documentHelper.getFirstParagraphInFirstCell(e):e,this.documentHelper.editorProperties.isDocumentLoaded&&this.updateWholeListItems(n);r;){this.viewer.updateClientAreaForBlock(r,!0),r instanceof Qs?this.layoutParagraph(r,0):(this.clearTableWidget(r,!0,!0,!0),this.layoutTable(r,0)),this.viewer.updateClientAreaForBlock(r,!1);var o=!t.isNullOrUndefined(r.nextWidget)&&r.nextWidget instanceof el&&r.nextWidget===i&&"Paragraph"===r.nextWidget.positioning.verticalOrigin;r=r===i||o?void 0:r.nextWidget}},i.prototype.isTextFollowWithtab=function(e){var t=e.indexInOwner;if(t>=0)for(var i=t;i<e.line.children.length;i++)if(e.line.children[i]instanceof fl)return!0;return!1},i.prototype.alignLineElements=function(e,i,r,n,o,a,s,l,d){if((e.width>0||e instanceof kl&&e.alignmentShift>0)&&(e instanceof hl||e instanceof kl)){var h=e instanceof hl?e:void 0,c=e instanceof hl?h.baselineOffset:e.baselineOffset;if(i+=this.maxBaseline-c,r+=n-(e.height-c),!t.isNullOrUndefined(h)&&"Justify"===s&&l>0&&(!this.isTextFollowWithtab(e)||e.line.paragraph.paragraphFormat.bidi)){h.isWidthUpdated=!1;var g=h.width,p=h.text;if(o||(o=(p=bs.trimStart(p)).length>0),o){var u=p.length-bs.removeSpace(p).length;d&&(u-=p.length-bs.trimEnd(p).length),l<u&&(g=this.documentHelper.textHelper.measureTextExcludingSpaceAtEnd(p,h.characterFormat,h.scriptType),u=l),u>0&&(h.width=g+a*u,l-=u)}}}else o=!0,i+=this.maxBaseline-e.height,r+=n;return{topMargin:i,bottomMargin:r,addSubWidth:o,whiteSpaceCount:l}},i.prototype.updateWidgetToPage=function(e,i,r){if(i.isInsideTable){var n=i.associatedCell;if(i.height=e.clientActiveArea.y-i.y,t.isNullOrUndefined(i.associatedCell)||t.isNullOrUndefined(i.associatedCell.ownerRow)||t.isNullOrUndefined(i.associatedCell.ownerRow.rowFormat))return;var o=i.associatedCell.ownerRow.rowFormat.heightType;if(i.associatedCell.cellFormat.rowSpan>1&&i.associatedCell.ownerTable&&i.associatedCell.ownerRow){var a=i.associatedCell.ownerTable.childWidgets[i.associatedCell.ownerRow.index+i.associatedCell.cellFormat.rowSpan-1];t.isNullOrUndefined(a)||(o=a.rowFormat.heightType)}"Exactly"===o?n.height=bs.convertPointToPixel(i.associatedCell.ownerRow.rowFormat.height):[n].length<=1&&"AtLeast"===o&&!r?this.documentHelper.isRowOrCellResizing&&0!==this.documentHelper.editorProperties.resizeNode&&this.documentHelper.editorProperties.resizingRowFormat===i.associatedCell.ownerRow.rowFormat?n.height=Math.max(i.associatedCell.ownerRow.rowFormat.height,this.getCellContentHeight(n,!1,i.indexInOwner)):n.height=Math.max(bs.convertPointToPixel(i.associatedCell.ownerRow.rowFormat.height),this.getCellContentHeight(n,!1,i.indexInOwner)):n.height=n.height+i.height,i.containerWidget=n}else(!i.isEndsWithPageBreak&&!i.isEndsWithColumnBreak||e instanceof Ms)&&(i.height=e.clientActiveArea.y-i.y);if(this.isRelayoutFootnote&&i.bodyWidget instanceof Zs&&(i.isInsideTable||(i.containerWidget.height+=i.height),this.shiftFootnoteChildLocation(i.bodyWidget,this.viewer)),i.bodyWidget instanceof Xs){if(!i.isInsideTable&&(!this.skipRelayoutOverlap||this.endOverlapWidget instanceof el&&this.endOverlapWidget.wrapTextAround))if(i.containerWidget instanceof Xs&&this.documentHelper&&"Word2003"===this.documentHelper.compatibilityMode){var s=i.containerWidget,l=.5*(s&&s.page?s.page.boundingRectangle.height:s.height);s.height+i.height<=l&&!this.skip2003||i.containerWidget.firstChild===i?(s.height+=i.height,i.isRender=!0):(this.viewer.clientActiveArea.y-=i.height,this.skip2003=!0,i.isRender=!1)}else i.containerWidget.height+=i.height;this.documentHelper.editorProperties.enableHeaderAndFooter&&-1!==i.bodyWidget.headerFooterType.indexOf("Footer")&&(this.skip2003=!1,this.shiftFooterChildLocation(i.bodyWidget,this.viewer))}var d=i.y+i.height,h=0;if(e instanceof Ms&&i.containerWidget instanceof Ys){if(i.isEndsWithPageBreak&&i.bodyWidget.floatingElements.length>0&&!i.isInsideTable)for(var c=0;c<i.bodyWidget.floatingElements.length;c++)d<i.bodyWidget.floatingElements[c].height+i.bodyWidget.floatingElements[c].y&&(d=i.bodyWidget.floatingElements[c].height+i.bodyWidget.floatingElements[c].y,h=i.bodyWidget.floatingElements[c].height+i.bodyWidget.floatingElements[c].y-(i.y+i.height));i.containerWidget.height+=h,i.containerWidget.height+=i.height}},i.prototype.shiftFooterChildLocation=function(e,i){var r=e.page.bodyWidgets[0].sectionFormat.pageHeight;if(-1!==e.headerFooterType.indexOf("Footer")){var n,o=e.page.bodyWidgets[0].sectionFormat.footerDistance,a=bs.convertPointToPixel(r-o);e.y+e.height>a?n=a-(e.y+e.height):e.y+e.height<a&&(n=e.y+e.height-a),t.isNullOrUndefined(n)||(n=a-(e.y+e.height),n=this.shiftChildLocation(n,e),i.clientActiveArea.y+=n)}},i.prototype.shiftFootnoteChildLocation=function(e,i){var r,n=e.page.bodyWidgets[0].sectionFormat.pageHeight,o=(e.page.bodyWidgets[0].sectionFormat.footerDistance,e.page.bodyWidgets[0].sectionFormat.bottomMargin),a=bs.convertPointToPixel(n-o);e.y+e.height>a?r=a-(e.y+e.height):e.y+e.height<a&&(r=e.y+e.height-a),t.isNullOrUndefined(r)||(r=a-(e.y+e.height),this.shiftChildLocation(r,e),i.clientActiveArea.y+=r)},i.prototype.checkPreviousElement=function(e,i){for(var r=e.paragraph,n=!1,o=0,a="Justify"===r.paragraphFormat.textAlignment,s=i-1;s>=0;s--){var l=e.children[s];if(l instanceof hl&&(l.width>0||!a&&"\t"===l.text)){var d=l.text;if(o=s,d.length>0&&(" "===d[d.length-1]||"-"===d[d.length-1])){if(s===i-1)return this.isWrapText&&this.viewer.clientActiveArea.x+this.viewer.clientActiveArea.width===this.viewer.clientActiveArea.right&&(this.isWrapText=!1),this.addSplittedLineWidget(e,i-1),!0;n=!0;break}if(!this.isRelayoutOverlap&&!a&&l instanceof fl&&"\t"===d&&0!==o){o--,n=!0;break}if("\t"===d||this.documentHelper.textHelper.isUnicodeText(d,l.scriptType))return!1;if(d.indexOf(" ")>=0){n=!0;var h=d.lastIndexOf(" ")+1,c=new hl;c.text=d.substr(h),c.characterFormat.copyFormat(l.characterFormat),c.characterRange=l.characterRange,l.revisionLength>0&&this.updateRevisionForSplittedElement(l,c,h>0),l.text=d.substr(0,h),this.documentHelper.textHelper.getTextSize(c,l.characterFormat),l.width-=c.width," "===l.text[l.text.length-1]?l.trimEndWidth=this.documentHelper.textHelper.getWidth(bs.trimEnd(l.text),l.characterFormat,l.scriptType):l.trimEndWidth=l.width,l.height=c.height,0===l.width&&(e.children.splice(s,1),!t.isNullOrUndefined(e.layoutedElements)&&e.layoutedElements.length>0&&e.layoutedElements.splice(s,1)),e.children.splice(s+1,0,c),t.isNullOrUndefined(e.layoutedElements)||e.layoutedElements.splice(s+1,0,c);break}}else if(!(l instanceof kl||l instanceof ol||l instanceof hl&&0===l.width||l instanceof Jl||l instanceof yl)){o=s,n=!0;break}}if(n&&++o<e.children.length){for(var g=0,s=o;s<e.children.length;s++)g+=e.children[s].width,this.addSplittedLineWidget(e,s-1);"Justify"===r.paragraphFormat.textAlignment&&"Word2013"===this.documentHelper.compatibilityMode||this.viewer.updateClientWidth(g)}return n},i.prototype.clearListElementBox=function(e){if(0!==e.childWidgets.length){var i=e.childWidgets[0];if(!t.isNullOrUndefined(i.children)){for(r=i.children.length-1;r>0&&i.children[r]instanceof kl;r--)i.children.splice(r,1);for(var r=0;r<i.children.length&&i.children[r]instanceof kl;r++)i.children.splice(r,1),r--}}},i.prototype.clearInvalidList=function(e){e&&(-1===e.abstractListId&&-1!==this.documentHelper.abstractLists.indexOf(e.abstractList)&&this.documentHelper.abstractLists.splice(this.documentHelper.abstractLists.indexOf(e.abstractList),1),-1===e.listId&&-1!==this.documentHelper.lists.indexOf(e)&&this.documentHelper.lists.splice(this.documentHelper.lists.indexOf(e),1))},i.prototype.getListNumber=function(e,i){var r=e.paragraphFormat.listFormat,n=this.documentHelper.getListById(r.listId),o=r.listLevelNumber,a=this.getListLevel(n,r.listLevelNumber),s=t.isNullOrUndefined(n.levelOverrides)?void 0:n.levelOverrides[o];if(!t.isNullOrUndefined(s)&&-1===this.documentHelper.renderedLevelOverrides.indexOf(n)&&t.isNullOrUndefined(s.overrideListLevel)){this.documentHelper.renderedLevelOverrides.push(n);var l=this.documentHelper.getAbstractListById(n.abstractListId);if(this.documentHelper.renderedLists.containsKey(l)){var d=this.documentHelper.renderedLists.get(l);d.containsKey(o)&&(d.remove(o),this.ClearSubListLevelValues(n,l,o))}}return t.isNullOrUndefined(i)&&this.updateListValues(n,o,e.characterFormat.getAllRevision()),this.getListText(n,o,a,e.characterFormat.localeIdAscii,e.characterFormat.getAllRevision())},i.prototype.ClearSubListLevelValues=function(e,t,i){for(var r=this.documentHelper.renderedLists.get(t),n=i+1;n<t.levels.length;){var o=this.getListLevel(e,n);r.containsKey(n)&&o.restartLevel>i&&r.remove(n),n++}},i.prototype.getListStartValue=function(e,i){var r=t.isNullOrUndefined(i.levelOverrides)?void 0:i.levelOverrides[e];if(!t.isNullOrUndefined(r)&&t.isNullOrUndefined(r.overrideListLevel))return r.startAt;var n=this.getListLevel(i,e);return t.isNullOrUndefined(n)?0:n.startAt},i.prototype.getListValues=function(e,t,i){var r=e,n=e;return t&&i?(r--,n--):t&&!i?r--:!t&&i&&n--,[r,n]},i.prototype.updateListValues=function(e,i,r){var n=this.documentHelper.getAbstractListById(e.abstractListId),o=this.getListLevel(e,i),a=!1,s=!1;if(!t.isNullOrUndefined(r)&&r.length>0)for(var l=0,d=r;l<d.length;l++){var h=d[l];"Insertion"===h.revisionType?a=!0:"Deletion"===h.revisionType&&(s=!0)}if(this.documentHelper.renderedLists.containsKey(n)){var c=this.documentHelper.renderedLists.get(n);if(c.containsKey(i)){var g=c.get(i);a||s?a&&!s?g.second++:!a&&s&&g.first++:(g.first++,g.second++),c.set(i,g);for(u=i+1;u<this.documentHelper.getAbstractListById(e.abstractListId).levels.length;){f=this.getListLevel(e,u);c.containsKey(u)&&(f.restartLevel>i||"Bullet"===o.listLevelPattern)&&c.remove(u),u++}}else{for(var u=i;!c.containsKey(u-1)&&u>0;){var f=this.getListLevel(e,u-1),m=this.getListStartValue(u-1,e);c.add(u-1,{first:m,second:m}),u--}var y=this.getListStartValue(i,e),v=this.getListValues(y,a,s);c.add(i,{first:v[0],second:v[1]})}}else{var W=new p;this.documentHelper.renderedLists.add(n,W);for(var f=this.getListLevel(e,i),b=0;b<=i;b++){var m=this.getListStartValue(b,e),v=this.getListValues(m,a,s);W.add(b,{first:v[0],second:v[1]})}}},i.prototype.getListText=function(e,i,r,n,o){var a=!1,s=!1;if(!t.isNullOrUndefined(o)&&o.length>0)for(var l=0,d=o;l<d.length;l++){var h=d[l];"Insertion"===h.revisionType?a=!0:"Deletion"===h.revisionType&&(s=!0)}var c=r.numberFormat;if(a&&s)return"";var g=c,p=c,u=!1;if(this.documentHelper.renderedLists.containsKey(this.documentHelper.getAbstractListById(e.abstractListId)))for(var f=this.documentHelper.renderedLists.get(this.documentHelper.getAbstractListById(e.abstractListId)),m=f.keys,y=0;y<m.length;y++){var v=m[y],W="%"+(v+1).toString(),b=this.getListLevel(e,v),x=y<i?"LeadingZero"!==b.listLevelPattern?"Arabic":b.listLevelPattern:void 0;if(g.match(W)){if(v>i)return"";if(f.containsKey(v)&&!t.isNullOrUndefined(b)){var w=f.get(v),F=void 0;if(a&&!s){F=w.second;C=this.getListTextListLevel(b,F,n,r.isLegalStyleNumbering?x:void 0);g=g.replace(W,C),p=p.replace(W,C)}else if(!a&&s){F=w.first;C=this.getListTextListLevel(b,F,n,r.isLegalStyleNumbering?x:void 0);g=g.replace(W,C),p=p.replace(W,C)}else if(w.first===w.second){F=w.first;var C=this.getListTextListLevel(b,F,n,r.isLegalStyleNumbering?x:void 0);g=g.replace(W,C),p=p.replace(W,C)}else u=!0,g=g.replace(W,this.getListTextListLevel(b,w.first,n,r.isLegalStyleNumbering?x:void 0)),p=p.replace(W,this.getListTextListLevel(b,w.second,n,r.isLegalStyleNumbering?x:void 0))}else g=g.replace(W,"0"),p=p.replace(W,"0")}}return u?g+""+p:g},i.prototype.getAsLetter=function(e){var t=e/26,i=e%26;0===i&&(i=26,t--);for(var r=String.fromCharCode(64+i),n="";t>=0;)n+=r.toString(),t--;return n},i.prototype.getListTextListLevel=function(e,i,r,n){switch(t.isNullOrUndefined(n)?e.listLevelPattern:n){case"UpRoman":return this.getAsRoman(i).toUpperCase();case"LowRoman":return this.getAsRoman(i).toLowerCase();case"UpLetter":return this.getAsLetter(i).toUpperCase();case"LowLetter":return this.getAsLetter(i).toLowerCase();case"Arabic":return i.toString();case"LeadingZero":return this.getAsLeadingZero(i);case"Number":return i.toString();case"OrdinalText":return 3082===e.characterFormat.localeIdAscii||3082===r?this.getOrdinalTextInSpanish(!0,i.toString()).toUpperCase():this.getOrdinalText(!0,i.toString()).toUpperCase();case"Ordinal":return this.getAsOrdinal(i,e.characterFormat).toString();case"FarEast":case"Special":return i.toString();case"Hebrew1":return this.getAsHebrewNumber(i);case"Hebrew2":return this.getAsAlphabet(i,"אבגדהוזחטיכלמנסעפצקרשת");case"Arabic1":return this.getAsAlphabet(i,"أبتثجحخدذرزسشصضطظعغفقكلمنهوي");case"Arabic2":return this.getAsAlphabet(i,"أبجدهوزحطيكلمنسعفصقرشتثخذضظغ");default:return""}},i.prototype.getAsAlphabet=function(e,t){if(e<=0)return"";for(var i=Math.floor((e-1)/t.length)+1,r=t.charAt((e-1)%t.length),n="",o=0;o<i;o++)n+=r;return n},i.prototype.getAsHebrewNumber=function(e){if(e<=0)return"";for(var t=["","א","ב","ג","ד","ה","ו","ז","ח","ט"],i=["","י","כ","ל","מ","נ","ס","ע","פ","צ"],r=["","ק","ר","ש","ת"],n="",o=e;o>=400;)n+="ת",o-=400;return n+=r[Math.floor(o/100)],o%=100,15===o||16===o?n+"ט"+(15===o?"ו":"ז"):n+i[Math.floor(o/10)]+t[o%10]},i.prototype.getFootEndNote=function(e,t){switch(e){case"UpperCaseRoman":return this.getAsRoman(t).toUpperCase();case"LowerCaseRoman":return this.getAsRoman(t).toLowerCase();case"UpperCaseLetter":return this.getAsLetter(t).toUpperCase();case"LowerCaseLetter":return this.getAsLetter(t).toLowerCase();default:return t.toString()}},i.prototype.generateNumber=function(e,t,i){for(var r="";e>=t;)e-=t,r+=i,this.value=e;return r.toString()},i.prototype.getAsLeadingZero=function(e){return e<10?"0"+e.toString():e.toString()},i.prototype.getAsRoman=function(e){var t="";return this.value=e,t+=this.generateNumber(this.value,1e3,"M"),t+=this.generateNumber(this.value,900,"CM"),t+=this.generateNumber(this.value,500,"D"),t+=this.generateNumber(this.value,400,"CD"),t+=this.generateNumber(this.value,100,"C"),t+=this.generateNumber(this.value,90,"XC"),t+=this.generateNumber(this.value,50,"L"),t+=this.generateNumber(this.value,40,"XL"),t+=this.generateNumber(this.value,10,"X"),t+=this.generateNumber(this.value,9,"IX"),t+=this.generateNumber(this.value,5,"V"),t+=this.generateNumber(this.value,4,"IV"),(t+=this.generateNumber(this.value,1,"I")).toString()},i.prototype.getOrdinalText=function(e,t){if(e){t=t.trim();for(var i=0;i<t.length;i++)if(/[a-zA-Z]/.test(t.charAt(i))){e=!1;break}e&&(t=this.numberToWords(parseInt(t),!1))}return t},i.prototype.numberToWords=function(e,t){if(0===e)return"zero";var i="";if(Math.floor(e/1e6)>0&&(i+=this.numberToWords(Math.floor(e/1e6),t)+" million ",t||e%10!=0||(i+="th "),e%=1e6),Math.floor(e/1e3)>0&&(i+=this.numberToWords(Math.floor(e/1e3),t)+" thousand ",t||e%10!=0||(i+="th "),e%=1e3),Math.floor(e/100)>0&&(i+=this.numberToWords(Math.floor(e/100),t)+" hundred ",t||e%10!=0||(i+="th "),e%=100),e>0){""!==i&&t&&(i+="and ");var r=null;r=t?["","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"]:["","first","second","third","fourth","fifth","sixth","seventh","eighth","ninth","tenth","eleventh","twelfth","thirteenth","fourteenth","fifteenth","sixteenth","seventeenth","eighteenth","nineteenth"];var n=["","ten","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"],o=["","tenth","twentieth","thirtieth","fortieth","fiftieth","sixtieth","seventieth","eightieth","ninetieth"];e<20?i+=r[e]:((t||e%10>0)&&(i+=n[Math.floor(e/10)]),e%10!=0||t?e%10>0&&(i+="-"+r[e%10]):i+=o[Math.floor(e/10)])}return i},i.prototype.getOrdinalTextInSpanish=function(e,t){if(e){t=t.trim();for(var i=0;i<t.length;i++)if(/[a-zA-Z]/.test(t.charAt(i))){e=!1;break}e&&(t=this.numberToSpanishWords(parseInt(t),!1))}return t},i.prototype.numberToSpanishWords=function(e,t){if(0===e&&t)return"cero";var i="";if(Math.floor(e/1e3)>0&&e<=1e4){var r=["","mil","dos mil","tres mil","cuatro mil","cinco mil","seis mil","siete mil","ocho mil","nueve mil","diez mil"],n=["","milésimo","dosmilésimo","tresmilésimo","cuatromilésimo","cincomilésimo","seismilésimo","sietemilésimo","ochomilésimo","nuevemilésimo","diezmilésimo"];i+=t?r[Math.floor(e/1e3)]:n[Math.floor(e/1e3)],e%=1e3}if(Math.floor(e/100)>0){""!==i&&(i+=" ");var o=["","ciento","doscientos","trescientos","cuatrocientos","quinientos","seiscientos","setecientos","ochocientos","novecientos"],a=["","centésimo","ducentésimo","tricentésimo","cuadringentésimo","quingentésimo","sexcentésimo","septingentésimo","octingentésimo","noningentésimo"];i+=t?o[Math.floor(e/100)]:a[Math.floor(e/100)],e%=100}if(e>0&&e<100){""!==i&&(i+=" ");var s=null;s=t?["","uno","dos","tres","cuatro","cinco","seis","siete","ocho","nueve","diez","once","doce","trece","catorce","quince","dieciséis","diecisiete","dieciocho","diecinueve"]:["","primero","segundo","tercero","cuarto","quinto","sexto","séptimo","octavo","noveno","décimo","undécimo","duodécimo","decimotercero","decimocuarto","decimoquinto","decimosexto","decimoséptimo","decimoctavo","decimonoveno"];var l=["","diez","veinte","treinta","cuarenta","cincuenta","sesenta","setenta","ochenta","noventa"],d=["","décimo","vigésimo","trigésimo","cuadragésimo","quincuagésimo","sexagésimo","septuagésimo","octogésimo","nonagésimo"],h=["","veintiuno","veintidós","veintitrés","veinticuatro","veinticinco","veintiséis","veintisiete","veintiocho","veintinueve"];e<20?i+=s[e]:e>20&&e<30&&t?i+=h[e%10]:(t&&e%10>0?i+=l[Math.floor(e/10)]:t&&e%10==0&&(i+=l[Math.floor(e/10)]),e%10>0&&!t&&(i+=d[Math.floor(e/10)]),e%10!=0||t?e%10>0&&(i+=t?" y "+s[e%10]:" "+s[e%10]):i+=d[Math.floor(e/10)])}return i},i.prototype.isHighestTabStopReachesClientArea=function(e){var t=e.paragraphFormat.getUpdatedTabs();if(0===t.length||this.documentHelper.editorProperties.isTocStyle(e))return!1;var i=bs.convertPointToPixel(e.paragraphFormat.leftIndent),r=this.viewer.clientArea.right-(this.viewer.clientArea.x-i);return bs.convertPointToPixel(t[t.length-1].position)>=r-.01},i.prototype.isTabStopBeyondRightMargin=function(e,t,i){for(var r=i.paragraphFormat.getUpdatedTabs(),n=bs.convertPointToPixel(i.paragraphFormat.leftIndent),o=0,a=0;a<t;a++)o+=e[a].width;e[t].line.isFirstLine()&&(o+=bs.convertPointToPixel(i.paragraphFormat.firstLineIndent)),o+=n;for(var s=0;s<r.length;s++){var l=bs.convertPointToPixel(r[s].position);if(l>o)return l>=this.viewer.clientArea.right-(this.viewer.clientArea.x-n)}return!1},i.prototype.isTextAfterTabToRetainInLine=function(e){if(!(e instanceof hl&&"Word2013"!==this.documentHelper.compatibilityMode&&this.isHighestTabStopReachesClientArea(e.paragraph)))return!1;if("\t"===e.text)return e instanceof fl&&e.indexInOwner>0;if(this.viewer.clientActiveArea.width>1)return!1;if(-1!==e.text.trim().indexOf(" "))return!1;for(var t=e.line.children,i=t.indexOf(e)-1;i>=0;i--)if(t[i]instanceof fl&&this.isTabStopBeyondRightMargin(t,i,e.paragraph))return!0;return!1},i.prototype.getAsOrdinal=function(e,t){switch(t.localeIdAscii){case 1069:case 8218:case 5146:case 4122:case 1050:case 1029:case 1061:case 1035:case 3079:case 1031:case 5127:case 4103:case 2055:case 1038:case 1060:case 1055:case 1044:case 2068:case 1045:case 6170:case 2074:return e.toString()+".";case 2060:case 11276:case 3084:case 9228:case 12300:case 1036:case 15372:case 5132:case 13324:case 6156:case 14348:case 8204:case 10252:case 4108:return 1==e?e.toString()+"er":e.toString()+"e";case 2067:case 1043:return e.toString()+"e";case 1032:return e.toString()+"o";case 1040:case 2064:return e.toString()+String.fromCharCode(176);case 5130:case 7178:case 12298:case 17418:case 4106:case 1046:case 2070:case 11274:case 16394:case 13322:case 9226:case 18442:case 2058:case 19466:case 6154:case 15370:case 10250:case 20490:case 3082:case 1034:case 21514:case 14346:case 8202:return e.toString()+String.fromCharCode(186);case 1049:case 2073:return e.toString()+"-"+String.fromCharCode(1081);case 2077:case 1053:return this.getOrdinalInSwedish(e);case 1027:return this.getOrdinalInCatalan(e);case 1030:return this.getOrdinalInDanish(e);default:return this.getOrdinalInEnglish(e)}},i.prototype.getOrdinalInEnglish=function(e){switch(e%100){case 11:case 12:case 13:return e.toString()+"th"}switch(e%10){case 1:return e.toString()+"st";case 2:return e.toString()+"nd";case 3:return e.toString()+"rd";default:return e.toString()+"th"}},i.prototype.getOrdinalInSwedish=function(e){return 11==e||12==e?e.toString()+":e":e%10==1||e%10==2?e.toString()+":a":e.toString()+":e"},i.prototype.getOrdinalInCatalan=function(e){switch(e){case 1:return e.toString()+".";case 2:return e.toString()+"n";case 3:return e.toString()+"r";case 4:return e.toString()+"t";case 14:return e.toString()+String.fromCharCode(232)+"h";default:return e.toString()+String.fromCharCode(232)}},i.prototype.getOrdinalInDanish=function(e){if(0==e)return e.toString()+"te";switch(e%100){case 0:return e.toString()+"ende";case 1:return e.toString()+"ste";case 2:return e.toString()+"nden";case 3:return e.toString()+"dje";case 4:return e.toString()+"rde";case 5:case 6:case 11:case 12:case 30:return e.toString()+"te";default:return e.toString()+"nde"}},i.prototype.getListLevel=function(e,i){if(!t.isNullOrUndefined(e)){var r=this.documentHelper.getAbstractListById(e.abstractListId);!t.isNullOrUndefined(e)&&r.levels.length<=i&&i>=0&&i<9&&this.addListLevels(r);var n=void 0;if(!t.isNullOrUndefined(e.levelOverrides)&&!t.isNullOrUndefined(n=this.getOverrideListLevel(e.levelOverrides,i))&&!t.isNullOrUndefined(n.overrideListLevel))return t.isNullOrUndefined(n.startAt)&&(n.overrideListLevel.startAt=r.levels[i].startAt),n.overrideListLevel;if(!t.isNullOrUndefined(r)&&i>=0&&i<r.levels.length)return r.levels[i]}},i.prototype.getOverrideListLevel=function(e,t){for(var i=0;i<e.length;i++)if(e[i].levelNumber==t)return e[i]},i.prototype.isNeedToConsiderTabStopPosition=function(e,t,i){return!(e.paragraphFormat.firstLineIndent<0&&0!==t.length&&(1!==t.length||0!==t[0].position)&&t[0].position<Math.abs(e.paragraphFormat.firstLineIndent)&&i)},i.prototype.getTabWidth=function(e,i,r,n,o){if(o.characterFormat.hidden)return 0;var a=0,s=!1,l=e.paragraphFormat.getUpdatedTabs(),d=!1,h=e.bodyWidget.sectionFormat,c=bs.convertPointToPixel(h.leftMargin),g=!1;if(!t.isNullOrUndefined(e.paragraphFormat.listFormat.listLevel)&&!t.isNullOrUndefined(e.paragraphFormat.listFormat.listLevel.paragraphFormat)){var p=e.paragraphFormat.listFormat.listLevel.paragraphFormat;e.paragraphFormat.leftIndent===p.leftIndent&&e.paragraphFormat.firstLineIndent===p.firstLineIndent||(d=!0)}var u=0,f=i.clientActiveArea.x,m=bs.convertPointToPixel(e.paragraphFormat.firstLineIndent),y=bs.convertPointToPixel(e.paragraphFormat.leftIndent);if(!t.isNullOrUndefined(o)&&n.isFirstLine()?(u=this.viewer.clientArea.x+m,d&&(f+=m)):u=this.viewer.clientArea.x,f<u&&this.isNeedToConsiderTabStopPosition(e,l,d))return i.clientArea.x-i.clientActiveArea.x;for(var v=i.clientActiveArea.x-(i.clientArea.x-bs.convertPointToPixel(e.paragraphFormat.leftIndent)),W=0;W<l.length;W++){var b=l[W],x=bs.convertPointToPixel(b.position);x<y&&(g=parseFloat(v.toFixed(2))<parseFloat(x.toFixed(2)))}if(n.isFirstLine()&&y>0&&m<0&&(o instanceof kl||!g)){if(i.clientArea.x-i.clientActiveArea.x>0&&this.isNeedToConsiderTabStopPosition(e,l,d))return i.clientArea.x-i.clientActiveArea.x;0===l.length&&e.paragraphFormat.listFormat&&e.paragraphFormat.listFormat.listLevel&&(l=e.paragraphFormat.listFormat.listLevel.paragraphFormat.tabs)}m=e.paragraphFormat.firstLineIndent<0?e.paragraphFormat.leftIndent:0;var w=bs.convertPointToPixel(this.documentHelper.defaultTabWidth);if(0===l.length&&(v>0&&w>Math.round(v)&&d||w===this.defaultTabWidthPixel&&w>Math.round(v)&&v>0))return w-v;if(e.paragraphFormat.firstLineIndent<0&&0===y&&this.viewer.clientActiveArea.x-c<m&&!(l.length>0&&e.paragraphFormat.firstLineIndent<0&&0===l[0].position&&m>0&&this.viewer.clientActiveArea.x<c)){var F=m-(this.viewer.clientActiveArea.x-c);return"Word2013"!==this.documentHelper.compatibilityMode&&l.length>0&&F<bs.convertPointToPixel(l[0].position)&&(F+=bs.convertPointToPixel(l[0].position)),e.paragraphFormat.firstLineIndent<0&&n.isFirstLine()&&y<0&&e.containerWidget instanceof Ys&&(F+=e.margin.left),F}var C=!1;if(l.length>0){for(W=l.length-1;W>-1;W--){var b=l[W],P=bs.convertPointToPixel(b.position);if(!(parseFloat(P.toFixed(2))>parseFloat(v.toFixed(2)))){if(W>0&&bs.convertPointToPixel(l[W-1].position)>parseFloat(v.toFixed(2)))continue;if(W!=l.length-1){var T=this.getJustificationTabWidth(l[W+1],o,n,e,w,v,a);w=T.defaultTabWidth,a=T.fPosition,v=T.position,s=!0}C=!0;break}}if(!C){var O=this.getJustificationTabWidth(l[0],o,n,e,w,v,a);w=O.defaultTabWidth,a=O.fPosition,v=O.position,s=!0}}if(!s){var S=parseFloat((100*v%(100*w)/100).toFixed(2));S<0&&d&&(S+=w),a=((v-S)/w+1)*w}return parseFloat(a.toFixed(1))===parseFloat(v.toFixed(1))?w:a-v>0?a-v:w},i.prototype.getJustificationTabWidth=function(e,i,r,n,o,a,s){var l=i?this.documentHelper.textHelper.getTextSize(i,i.characterFormat):0;if("Left"===e.tabJustification||"List"===e.tabJustification)s=bs.convertPointToPixel(e.position),i instanceof fl&&(i.tabLeader=e.tabLeader,i.tabText="");else{var d=bs.convertPointToPixel(e.position)-a,h=this.getRightTabWidth(i.indexInOwner+1,r,n);if(h<d&&"Decimal"!=e.tabJustification)if("Right"===e.tabJustification){o=d-h;var c=bs.convertPointToPixel(n.rightIndent),g=this.viewer.clientActiveArea.width+c-o;this.viewer.clientActiveArea.width+=c,g<0?o+=g-h:h>g&&(o-=h-g)}else o=d-h/2;else if("Center"===e.tabJustification&&h/2<d)o=d-h/2;else if("Decimal"===e.tabJustification)if(!t.isNullOrUndefined(i.nextElement)&&i.nextElement instanceof hl){var p=i.nextElement;if(-1!=p.text.indexOf(".")){var u=p.text.indexOf("."),f=p.text.substring(0,u);o=d-this.documentHelper.textHelper.getWidth(f,p.characterFormat,p.scriptType)}else o=h<d?d-h:d}else o=d;else o="Right"===e.tabJustification?0:l;s=a,i instanceof fl&&(i.tabLeader=e.tabLeader,i.tabText="")}return{defaultTabWidth:o,fPosition:s,position:a}},i.prototype.getRightTabWidth=function(e,t,i){for(var r=0,n=!1,o=t.children[e];o;){if(o instanceof ol||o instanceof ml||n)o instanceof ol&&(0===o.fieldType?n=!0:2===o.fieldType&&(n=!1)),o.width=0;else{if(o instanceof ul&&!this.isTocField(o.fieldBegin)){var a=this.documentHelper.getFieldResult(o.fieldBegin,o.paragraph.bodyWidget.page);""!==a&&(o.text=a)}o instanceof hl&&this.documentHelper.textHelper.getTextSize(o,o.characterFormat)}if(o instanceof hl&&"\t"===o.text)return r;r=o instanceof Pl&&"Inline"!==o.textWrappingStyle?r:r+o.width,o=o.nextNode}return r},i.prototype.getSplitIndexByWord=function(e,t,i,r,n){for(var o=0,a=t.length;o<a;){var s=this.getTextIndexAfterSpace(t,o);0!==s&&s!==a||(s=a-1);var l=i;if((s<a-1||s===a-1&&" "===t[s-1])&&o!==s&&(l=this.documentHelper.textHelper.measureTextExcludingSpaceAtEnd(t.slice(0,s),r,n)),!(bs.round(l,4)<=bs.round(e,4))){0===o&&" "===t[0]&&(o=this.getTextIndexAfterSpace(t,0));break}o=s}return o},i.prototype.getTextSplitIndexByCharacter=function(e,t,i,r,n,o){for(var a=i.length,s=0;s<a;s++){var l=r;if(s+1<a&&(l=this.documentHelper.textHelper.measureTextExcludingSpaceAtEnd(i.substring(0,s+1),n,o)),l>t)return 0===s&&l>e?a>1&&" "===i[1]?this.getTextIndexAfterSpace(i,1):1:" "===i[s]?this.getTextIndexAfterSpace(i,s):s}return 0},i.prototype.getSubWidth=function(e,t,i,r,n){var o=0,a=!0,s="",l=0,d=e.paragraph.paragraphFormat.bidi;if(this.wrapPosition.length>0&&!(e.paragraph.containerWidget instanceof Ol)){var h=this.getSubWidthBasedOnTextWrap(e,t,i,r,n);if(h.length>0)return h}for(var c=e.renderedElements,g=c.length-1;g>=0;g--){var p=c[g];if(p.width>0&&p instanceof hl&&(this.isInitialLoad||!p.characterFormat.bidi||p.isWidthUpdated)){var u=p.text;if(t&&this.isTextFollowWithtab(p)&&!d||(s=u+s),t&&d&&(a=" "===u&&g-1>=0&&" "===c[g-1].text),!a||""===u.trim()&&"\t"!==u)a?l+=p.width:o+=p.width;else{if(bs.endsWith(u)){var f=this.documentHelper.textHelper.measureTextExcludingSpaceAtEnd(u,p.characterFormat,p.scriptType);o+=f,l+=p.width-f}else o+=p.width;a=!1}}else{if(s="a"+s,a=!1,p instanceof Cl&&"Inline"!==p.textWrappingStyle)continue;o+=p.width}}t||(o=Math.round(o));var m=s.length-bs.removeSpace(s).length;i=(s=s.trim()).length-bs.removeSpace(s).length;var y=e.paragraph===this.mergedParagraph&&e.isFirstLine()?this.mergedParagraphOffset:0,v=this.viewer.clientArea.width-y-r-o,W=this.viewer.clientArea.width-y-r-(o+l);return d&&t&&(W<0?l=-l:v=W),d&&!t&&v<0&&"Right"===e.paragraph.paragraphFormat.textAlignment&&0===l&&this.isOverflowOnlyByTrailingSpaces(e,o,r)?(v=this.viewer.clientArea.width-r-this.getUnroundedLineWidth(e),i=0):v<=0&&!this.is2013Justification||0===i&&t&&!d?(i=0,v=0):t?(!n||e.isEndsWithLineBreak)&&i>0||n&&this.is2013Justification&&i>0?v/=i:i=0:l>0&&d&&n&&(v-=l),[{trimmedSpaceWidth:l,subWidth:v,spaceCount:i,totalSpaceCount:m}]},i.prototype.getUnroundedLineWidth=function(e){for(var t=0,i=0;i<e.children.length;i++){var r=e.children[i];r instanceof Cl&&"Inline"!==r.textWrappingStyle||(t+=r.width)}return t},i.prototype.isOverflowOnlyByTrailingSpaces=function(e,t,i){for(var r=0,n=0,o=e.children.length-1;o>=0;o--){var a=e.children[o];if(a instanceof hl&&a.text.length>0&&""===a.text.trim())r+=a.width,n+=a.text.length;else if(!(a instanceof hl)||a.text.length>0)break}return n>1&&t-r<=this.viewer.clientArea.width-i},i.prototype.getSubWidthBasedOnTextWrap=function(e,i,r,n,o){for(var a=[],s=0,l="",d=this.wrapPosition.length-1,h=!0,c=e.children.length-1;c>=0;c--){var g=e.children[c];if(g.width>0&&g instanceof hl){var p=g.text;l=p+l,!h||""===p.trim()&&"\t"!==p?h||(s+=g.width):(bs.endsWith(p)?s+=this.documentHelper.textHelper.measureTextExcludingSpaceAtEnd(p,g.characterFormat,g.scriptType):s+=g.width,h=!1)}else l="a"+l,h=!1,g instanceof Cl&&"Inline"!==g.textWrappingStyle||(s+=g.width);if((g.padding.left>0||0===c)&&d>=0){for(var u=this.wrapPosition[d--];u.width<=0&&d>=0;)u=this.wrapPosition[d--];var f=this.getSubWidthInfo(e,u.width,s,l,r,i,o);t.isNullOrUndefined(f)||(s=0,l="",a.unshift(f))}}return a},i.prototype.isWordFittedByJustification=function(e,i,r){var n=e.line,o=n.paragraph,a=o.paragraphFormat,s=a.textAlignment;a.bidi&&(t.isNullOrUndefined(e.nextElement)||o.isInsideTable)&&o.splitTextRangeByScriptType(n.indexInOwner);var l=n.isLastLine(),d=0;n.isFirstLine()&&(d=bs.convertPointToPixel(a.firstLineIndent));var h=this.viewer.clientActiveArea.width;if(!r&&e.characterFormat.bidi&&e.isCombinedRTLText&&h<i/2&&(h+=this.effectiveJustifyWidth,this.viewer.clientActiveArea.width=h),e.isCombinedRTLText=!1,this.effectiveJustifyWidth=0,0!=i&&h>=i/2){var c=0,g=void 0,p=0;if("Left"!==s&&this.viewer.textWrap&&("Justify"!==s||!l||"Justify"===s&&a.bidi||this.is2013Justification&&l)&&(c=(g=this.getSubWidth(n,"Justify"===s,c,d,l))[0].spaceCount,p=g[0].totalSpaceCount),!t.isNullOrUndefined(g)&&1==g.length&&h>0&&"Justify"===s&&"Word2013"===this.documentHelper.compatibilityMode&&!this.is2013Justification&&0===a.rightIndent&&0===a.leftIndent){var u=0,f=this.getTotalSpaceWidth(n,p),m=f/p;if(u=((h+f)/p-m)/m*100<=33?f/8:f/4,h+u>=i)return r||(this.viewer.clientActiveArea.x-=u,this.viewer.clientActiveArea.width+=u,this.is2013Justification=!0),this.effectiveJustifyWidth=r?u:0,!0}}return!1},i.prototype.getTotalSpaceWidth=function(e,i){for(var r=0,n=0,o=-1,a=e.children.length-1;a>=0;a--)if(e.children[a]instanceof fl){o=a;break}var s=-1!==o?o+1:0;if(e)for(a=s;a<e.children.length;a++){var l=e.children[a];if(l instanceof hl){var d=l.text.length-bs.removeSpace(l.text).length;d>0&&(r+=d*this.documentHelper.textHelper.getWidth(" ",l.characterFormat,l.scriptType),n+=d)}if(!t.isNullOrUndefined(i)&&n>=i)break}return r},i.prototype.getSubWidthInfo=function(e,t,i,r,n,o,a){if(t>0){var s=t-i;n=(r=r.trim()).length-bs.removeSpace(r).length;var l=s;return l<=0||0===n&&o&&!e.paragraph.paragraphFormat.bidi?(n=0,l=0):o&&(!a&&n>0?l/=n:n=0),{trimmedSpaceWidth:0,subWidth:l,spaceCount:n,totalSpaceCount:n}}},i.prototype.getBeforeSpacing=function(e,i){var r=0;if(this.documentHelper.dontUseHtmlParagraphAutoSpacing)r=e.paragraphFormat.beforeSpacing;else{var n=e.previousWidget;if(n instanceof Qs){var o=this.getAfterSpacing(n),a=e.paragraphFormat.beforeSpacing;e.paragraphFormat.spaceBeforeAuto&&(a=14),o<a&&(r=a-o)}else if(n instanceof el)r=e.paragraphFormat.spaceBeforeAuto?14:e.paragraphFormat.beforeSpacing;else if(i&&e.bodyWidget instanceof Ys&&t.isNullOrUndefined(e.bodyWidget.containerWidget)&&e===e.bodyWidget.childWidgets[0]&&t.isNullOrUndefined(e.bodyWidget.childWidgets[0].previousSplitWidget)){var s=e.bodyWidget,l=s.previousRenderedWidget;if(t.isNullOrUndefined(l)||t.isNullOrUndefined(l.lastChild))r=e.paragraphFormat.spaceBeforeAuto?0:e.paragraphFormat.beforeSpacing;else{var d=s.sectionIndex===l.sectionIndex&&s.columnIndex!==l.columnIndex&&s.getSplitWidgets()[0].previousRenderedWidget&&s.sectionIndex!==s.getSplitWidgets()[0].previousRenderedWidget.sectionIndex&&this.documentHelper.pages.indexOf(s.page)===this.documentHelper.pages.indexOf(s.getSplitWidgets()[0].previousRenderedWidget.page);if(s.sectionIndex!==l.sectionIndex||d){var h=l.lastChild;if(h instanceof Qs){var o=this.getAfterSpacing(h),a=e.paragraphFormat.beforeSpacing;e.paragraphFormat.spaceBeforeAuto&&(a=14),o<a&&(r=a-o)}else h instanceof el&&(r=e.paragraphFormat.spaceBeforeAuto?14:e.paragraphFormat.beforeSpacing)}}}else r=e.paragraphFormat.spaceBeforeAuto?0:e.paragraphFormat.beforeSpacing}return this.isSameStyle(e,!1)||"Word2013"===this.documentHelper.compatibilityMode&&this.isFirstElementWithPageBreak(e)?0:bs.convertPointToPixel(r)},i.prototype.getAfterSpacing=function(e){var i=e.paragraphFormat.afterSpacing;return!this.documentHelper.dontUseHtmlParagraphAutoSpacing&&e.paragraphFormat.spaceAfterAuto&&(i=t.isNullOrUndefined(e.nextWidget)&&e.isInsideTable&&-1===e.paragraphFormat.listFormat.listId?0:14),this.isSameStyle(e,!0)?0:i},i.prototype.getLineSpacing=function(e,i,r){if(t.isNullOrUndefined(e.paragraphFormat))return 0;var n=0;switch(e.paragraphFormat.lineSpacingType){case"AtLeast":case"Exactly":n=bs.convertPointToPixel(e.paragraphFormat.lineSpacing);break;default:n=e.paragraphFormat.lineSpacing,r&&(n-=1),n*=i}return n},i.prototype.isParagraphFirstLine=function(e,i){var r=e;return!(!t.isNullOrUndefined(r.childWidgets)&&0!==r.childWidgets.indexOf(i))&&(!(i.children.length>0&&!t.isNullOrUndefined(e.previousWidget)&&e.previousWidget instanceof Qs)||i.paragraph.index!==e.previousWidget.index)},i.prototype.isParagraphLastLine=function(e){var t=e.line.paragraph,i=t.childWidgets[t.childWidgets.length-1],r=i.children[i.children.length-1];return e===r&&(r instanceof ol||!(r instanceof hl&&"\v"===r.text))},i.prototype.getTextIndexAfterSpace=function(e,t){var i=e.length,r=0,n=0;r=e.indexOf(" ",t)+1,1==(n=e.indexOf("-",t)+1)&&(n=e.indexOf("-",n+1)+1,"-"==e[0]&&(0==n||r>0&&n>r)&&(n=1)),n>0&&r>0?r=Math.min(r,n):n>0&&0==r&&(r=n);var o=r;if(0===o||o===i)return o;for(;" "===e[o]&&++o!==i;);return o},i.prototype.moveNextWidgetsToTable=function(e,t,i){var r=t.indexInOwner,n=e[e.length-1];i&&(r+=1);for(var o=t.containerWidget.childWidgets.splice(r),a=0;a<o.length;a++)n.childWidgets.push(o[a]),o[a].containerWidget=n},i.prototype.addTableCellWidget=function(e,i,r,n){var o=0,a=0,s=0,l=r,d=0,h=n;if(t.isNullOrUndefined(e.cellFormat)||(e.cellFormat.containsMargins()?(s=t.isNullOrUndefined(e.cellFormat.leftMargin)?bs.convertPointToPixel(e.ownerTable.tableFormat.leftMargin):bs.convertPointToPixel(e.cellFormat.leftMargin),d=t.isNullOrUndefined(e.cellFormat.rightMargin)?bs.convertPointToPixel(e.ownerTable.tableFormat.rightMargin):bs.convertPointToPixel(e.cellFormat.rightMargin)):(s=0===e.columnIndex&&e.ownerRow.rowFormat.hasValue("leftMargin")?bs.convertPointToPixel(e.ownerRow.rowFormat.leftMargin):bs.convertPointToPixel(e.ownerTable.tableFormat.leftMargin),d=e.columnIndex===e.ownerTable.tableHolder.columns.length-1&&e.ownerRow.rowFormat.hasValue("rightMargin")?bs.convertPointToPixel(e.ownerRow.rowFormat.rightMargin):bs.convertPointToPixel(e.ownerTable.tableFormat.rightMargin))),0===(a=t.isNullOrUndefined(e.ownerTable)||t.isNullOrUndefined(e.ownerTable.tableFormat)?0:bs.convertPointToPixel(e.ownerTable.tableFormat.cellSpacing))&&e.ownerTable.isContainInsideTable&&!e.ownerTable.header){var c=il.getCellTopBorder(e);0===e.topMargin&&.75===c.lineWidth&&(l+=bs.convertPointToPixel(.5));var g=il.getCellLeftBorder(e);e.leftMargin<=.5&&.75===g.lineWidth&&(s+=bs.convertPointToPixel(.8))}e.margin=new js(s,l,d,h);e.ownerTable.tableFormat.allowAutoFit;var p=e.cellFormat.cellWidth;if("Percent"===e.cellFormat.preferredWidthType&&0!==e.cellFormat.preferredWidth&&p<=0){var u=bs.convertPointToPixel(e.ownerTable.getTableClientWidth(e.ownerTable.getContainerWidth()));p=e.ownerTable.getCellWidth(e.cellFormat.preferredWidth,e.cellFormat.preferredWidthType,u,e)}e.width=bs.convertPointToPixel(p),t.isNullOrUndefined(e.previousWidget)||(o=e.previousWidget.columnIndex+e.previousWidget.cellFormat.columnSpan);var f=0;o<e.columnIndex&&(f=bs.convertPointToPixel(e.ownerTable.tableHolder.getPreviousSpannedCellWidth(o,e.columnIndex)),0===o&&(f-=a/2)),e.x=i.x+f+e.margin.left,e.y=i.y+e.margin.top+a,e.width=e.width-e.margin.left-e.margin.right,a>0&&(e.x+=a,1===e.ownerTable.tableHolder.columns.length?e.width-=2*a:0===e.columnIndex||e.columnIndex===e.ownerTable.tableHolder.columns.length-1?e.width-=2*a-a/2:e.width-=a);var m=bs.convertPointToPixel(il.getCellLeftBorder(e).getLineWidth()),y=bs.convertPointToPixel(il.getCellRightBorder(e).getLineWidth()),v=!1;e.leftBorderWidth=e.ownerTable.isBidiTable?y:m;var W="None"===e.cellFormat.borders.left.lineStyle,b="None"===e.cellFormat.borders.right.lineStyle;e.x+=W?e.leftBorderWidth>0?0:e.leftBorderWidth:0,e.width-=W?e.leftBorderWidth>0?0:e.leftBorderWidth:0;e.ownerTable.isBidiTable?e.cellIndex:(e.cellIndex,e.ownerRow.childWidgets.length);return(a>0||e.columnIndex===e.ownerTable.tableHolder.columns.length-1||e.index===e.containerWidget.childWidgets.length-1)&&(e.rightBorderWidth=e.ownerTable.isBidiTable?m:y,e.ownerTable.tableFormat.allowAutoFit||(e.width-=e.rightBorderWidth),this.isInsertTable()||(v=this.checkPreviousMargins(e.ownerTable))),e.margin.right+=b&&!v||e.ownerTable.tableFormat.cellSpacing>0&&e.ownerTable.tableFormat.allowAutoFit||e.ownerTable.tableFormat.isRTFTable?0:e.rightBorderWidth,e},i.prototype.checkPreviousMargins=function(e){for(var t=0;t<e.childWidgets.length;t++)for(var i=e.childWidgets[t],r=0;r<i.childWidgets.length;r++)if("None"!==i.childWidgets[i.childWidgets.length-1].cellFormat.borders.right.lineStyle)return!0;return!1},i.prototype.addWidgetToTable=function(e,i,r,n,o,a,s,l,d){var h=i[0],c=h.childWidgets.length,g=void 0,p=r.indexOf(n),u=[];if(p>0?g=r[p-1]:n.previousRenderedWidget instanceof tl&&n.previousRenderedWidget.ownerTable.equals(n.ownerTable)&&(g=n.previousRenderedWidget),!t.isNullOrUndefined(g)){if(h=g.containerWidget,c=h.childWidgets.indexOf(g)+1,Math.round(n.y)!==Math.round(g.y+g.height)){var f=i.indexOf(h);f+1>=i.length&&(this.addTableWidget(e.clientActiveArea,i,!0).containerWidget=h.containerWidget),c=(h=i[f+1]).childWidgets.length}p>0&&(c=0)}if(this.updateRowHeightBySpannedCell(h,n,c),this.updateRowHeightByCellSpacing(i,n,e),0!==p&&(n.containerWidget&&n.containerWidget!==h&&-1!==n.containerWidget.childWidgets.indexOf(n)&&n.containerWidget.childWidgets.splice(n.containerWidget.childWidgets.indexOf(n),1),-1===h.childWidgets.indexOf(n)&&(h.childWidgets.splice(c,0,n),d&&(h.bodyWidget.page.repeatHeaderRowTableWidget=!0)),n.containerWidget=h),!n.ownerTable.isInsideTable){if(o.length>0)t.isNullOrUndefined(o)||(u=this.getFootnoteBody(o));else if(!t.isNullOrUndefined(n))for(var m=0;m<n.childWidgets.length;m++)for(var y=n.childWidgets[m],v=0;v<y.childWidgets.length;v++)for(var W=this.getFootNoteWidgetsOf(y.childWidgets[v],!0),b=0;b<W.length;b++)u.splice(u.length,0,W[b]);u.length>0&&t.isNullOrUndefined(u[0].containerWidget)?this.layoutFootnoteInSplittedRow(n,u):!t.isNullOrUndefined(u)&&u.length>0&&void 0!==n.bodyWidget.previousRenderedWidget&&l!==n.bodyWidget.page.index&&u[0].containerWidget.page.index!==n.bodyWidget.page.index?this.moveFootNotesToPage(u,u[0].containerWidget.page.bodyWidgets[0],n.bodyWidget):u.length>0&&!this.isInitialLoad&&!t.isNullOrUndefined(n.bodyWidget.page.footnoteWidget)&&this.layoutfootNote(n.bodyWidget.page.footnoteWidget),o.length=0}this.updateRowHeightByFloatingElements(n),h.height=h.height+n.height,this.viewer instanceof Es&&(t.isNullOrUndefined(h.containerWidget)||!(h.containerWidget.childWidgets.indexOf(h)>=0)||h.containerWidget instanceof Xs||(h.containerWidget.height+=n.height)),this.updateHeightForRowWidget(e,!1,i,r,n,!1,a,s),e.cutFromTop(n.y+n.height),this.viewer.clientActiveArea.height-=this.getFootNoteHeight(u),n.ownerTable.isInsideTable||(this.existFootnoteHeight=0)},i.prototype.updateRowHeightByFloatingElements=function(e){if("Exactly"!==e.rowFormat.heightType&&!e.ownerTable.isInsideTable&&!t.isNullOrUndefined(e.ownerTable.previousSplitWidget)){for(var i=0,r=0;r<e.childWidgets.length;r++){var n=e.childWidgets[r];if(!(n.cellFormat.rowSpan>1))for(var o=0;o<n.childWidgets.length;o++){var a=n.childWidgets[o];if(a instanceof Qs)for(var s=0;s<a.floatingElements.length;s++){var l=a.floatingElements[s],d=l.textWrappingStyle;"InFrontOfText"===d||"Behind"===d||"Inline"===d||"Word2013"!==this.documentHelper.compatibilityMode&&!l.layoutInCell||(i=Math.max(i,l.y+l.height+n.margin.bottom-(e.y+e.height)))}}}i>0&&(e.height+=i)}},i.prototype.layoutFootnoteInSplittedRow=function(e,i){if(i&&i.length>0){t.isNullOrUndefined(e.ownerTable.bodyWidget.page.footnoteWidget)&&this.addEmptyFootNoteToBody(e.ownerTable.bodyWidget);var r=e.ownerTable.bodyWidget.page.footnoteWidget;if(r){for(var n=0;n<i.length;n++)r.bodyWidgets.push(i[n]),i[n].containerWidget=r;this.layoutfootNote(r)}}},i.prototype.getFootNoteHeight=function(e){var t=0;if(Array.isArray(e))for(var i=0;i<e.length;i++)t+=this.getFootnoteHeightInternal(e[i],i);else t=this.getFootnoteHeightInternal(e,0);return t},i.prototype.getFootnoteHeightInternal=function(e,t){for(var i=0,r=0;r<e.childWidgets.length;r++)i+=e.childWidgets[r].height,(0===e.indexInOwner||-1!==e.indexInOwner&&e.containerWidget&&0===this.existFootnoteHeight&&0===t)&&0===r&&(i+=e.containerWidget.margin.top);return i},i.prototype.updateRowHeightBySpannedCell=function(e,i,r){var n=1;if(0===e.childWidgets.length||0===r)return void this.updateRowHeight(i,i);for(a=0;a<i.childWidgets.length;a++){var o=i.childWidgets[a];n=t.isNullOrUndefined(o)||t.isNullOrUndefined(o.cellFormat)?n:o.cellFormat.rowSpan,this.updateSpannedRowCollection(n,i,o)}if(!t.isNullOrUndefined(i.ownerTable))for(var a=0;a<i.ownerTable.spannedRowCollection.length;a++)if(i.ownerTable.spannedRowCollection.keys[a]===i.index){for(var s=0;s<r;s++){var l=e.childWidgets[s];this.updateRowHeight(l,i)}i.ownerTable.spannedRowCollection.remove(i.ownerTable.spannedRowCollection.keys[a]);break}},i.prototype.updateRowHeight=function(e,i){for(var r=i.index,n=1,o=0;o<e.childWidgets.length;o++){var a=e.childWidgets[o];if(n=t.isNullOrUndefined(a)||t.isNullOrUndefined(a.cellFormat)?n:a.cellFormat.rowSpan,this.updateSpannedRowCollection(n,i,a),r-a.rowIndex==n-1){var s=a.y+a.height+a.margin.bottom-i.y;("Exactly"!==i.rowFormat.heightType||"Exactly"===i.rowFormat.heightType&&i.rowFormat.height>s)&&i.height<s&&(i.height=s)}}},i.prototype.updateSpannedRowCollection=function(e,i,r){e>1&&!t.isNullOrUndefined(i.ownerTable)&&(i.ownerTable.spannedRowCollection.containsKey(r.rowIndex+e-1)||i.ownerTable.spannedRowCollection.add(r.rowIndex+e-1,r.rowIndex))},i.prototype.updateRowHeightByCellSpacing=function(e,t,i){t.ownerTable.tableFormat.cellSpacing>0&&e.length>1&&t.y===i.clientArea.y&&i instanceof Es&&(t.height=t.height-bs.convertPointToPixel(t.ownerTable.tableFormat.cellSpacing)/2)},i.prototype.removeStaleSplittedCellWidgets=function(e){if(!e.ownerTable.isInsideTable)for(var i=this.documentHelper.splittedCellWidgets,r=i.length-1;r>=0;r--){var n=i[r].ownerTable;t.isNullOrUndefined(n)||n.equals(e.ownerTable)||i.splice(r,1)}},i.prototype.isRowSpanEnd=function(e,i){for(var r=e.index,n=1,o=0;o<this.documentHelper.splittedCellWidgets.length;o++){var a=this.documentHelper.splittedCellWidgets[o];if(n=t.isNullOrUndefined(a)||t.isNullOrUndefined(a.cellFormat)?n:a.cellFormat.rowSpan,r-a.rowIndex==n-1)return!0}return!1},i.prototype.isVerticalMergedCellContinue=function(e){for(var t=0,i=0;i<e.childWidgets.length;i++){var r=e.childWidgets[i];if(t<r.columnIndex)return!0;t+=r.cellFormat.columnSpan}return t<e.ownerTable.tableHolder.columns.length},i.prototype.splitWidgets=function(e,i,r,n,o,a,s,l,d,h,c){if((!h||0!==l)&&this.isFirstLineFitForRow(i.clientArea.bottom,e)&&e.childWidgets.length>0){if(o=this.getSplittedWidgetForRow(i.clientArea.bottom,r,n,e,s,l,h,void 0,c),s=[],this.documentHelper.splittedCellWidgets.length>0||o!==e){if(a&&!t.isNullOrUndefined(o))for(var g=0;g<o.childWidgets.length;g++)o.childWidgets[g].rowIndex!==o.index&&(o.childWidgets.splice(g,1),g--);this.insertSplittedCellWidgets(i,r,o,e.index-1)}}else this.insertSplittedCellWidgets(i,r,o,e.index-1);return o},i.prototype.getSplittedWidgetForRow=function(e,i,r,n,o,a,s,l,d){var h=void 0,c=n.index;this.isRelayoutneed=!1;for(var g=!1,p=n.height,u=p,f=0,m=0;m<n.childWidgets.length;m++){var y=n.childWidgets[m];if(0===m&&y.childWidgets.length>0&&0===y.columnIndex&&1===y.cellFormat.rowSpan&&"Word2013"===this.documentHelper.compatibilityMode&&0===this.documentHelper.splittedCellWidgets.length&&1===r.length){var v=this.documentHelper.getFirstParagraphInCell(y);if((!t.isNullOrUndefined(v)&&v.paragraphFormat.keepWithNext||n.rowFormat.isHeader)&&!t.isNullOrUndefined(this.getPreviousBlock(n)))return n}var W=this.getSplittedWidget(e,!0,i,r,y,o,a,s,l);if(s&&!t.isNullOrUndefined(W)&&0!==W.childWidgets.length&&p>y.height&&(p=y.height),!t.isNullOrUndefined(o)&&o.length>0)for(var b=0;b<o.length;b++)-1===o[b].paragraph.containerWidget.indexInOwner&&o.splice(b,1);if(t.isNullOrUndefined(W)&&y===n.childWidgets[n.childWidgets.length-1]&&this.isRowSpanEnd(n,this.viewer)&&this.documentHelper.splittedCellWidgets.length>0&&d&&(h=this.getSplittedWidgetForSpannedRow(e,n,i,r,o),W=void 0),y.height>f&&!y.ownerTable.isInsideTable&&(f=y.height),!t.isNullOrUndefined(W)){if(W===y)return r.length>1&&this.combineSplittedRowWidgets(r,u),n;var x=0;if(y.ownerTable.isInsideTable)for(var w=0;w<y.childWidgets.length;w++)x+=y.childWidgets[w].height;y.ownerTable.isInsideTable&&f<x&&(f=x),-1!==n.childWidgets.indexOf(W)&&n.childWidgets.splice(n.childWidgets.indexOf(W),1),n.height-=W.height,(0===m||n.height<f+y.margin.top+y.margin.bottom)&&(n.height=f+y.margin.top+y.margin.bottom),t.isNullOrUndefined(h)&&((h=new tl).containerWidget=n.containerWidget,h.index=n.index,h.rowFormat=n.rowFormat,h.isRenderBookmarkEnd=n.isRenderBookmarkEnd,this.updateWidgetLocation(n,h),r.push(h));var F=1;F=t.isNullOrUndefined(W)||t.isNullOrUndefined(W.cellFormat)?F:W.cellFormat.rowSpan,c-W.rowIndex==F-1&&h.height<W.height+W.margin.top+W.margin.bottom?h.height=W.height+W.margin.top+W.margin.bottom:("Exactly"===n.rowFormat.heightType||"AtLeast"===n.rowFormat.heightType&&h.height<n.rowFormat.height)&&(h.height=n.rowFormat.height),h.childWidgets.push(W),W.containerWidget=h,this.isRelayoutneed=!0;for(var C=m;C>0&&!g;){var P=n.childWidgets[C-1];W=this.getSplittedWidget(e,!0,i,r,P,o),h.childWidgets.splice(0,0,W),W.containerWidget=h,C--}g=!0}}if(s&&p!==u){for(m=0;m<n.childWidgets.length;m++)n.childWidgets[m].height=p;n.height=p}return h},i.prototype.combineSplittedRowWidgets=function(e,i){for(var r=e[0],n=1;n<e.length;n++){for(var o=e[n],a=0;a<o.childWidgets.length;a++){var s=r.childWidgets[a],l=o.childWidgets[a];if(l.childWidgets.length>0)for(var d=0;d<l.childWidgets.length;d++){var h=l.childWidgets[d];if(h instanceof Qs){var c=s.childWidgets[d];if(t.isNullOrUndefined(c)||c.index!==h.index)s.childWidgets.push(h),h.containerWidget=s;else{var g=h;if(g.childWidgets.length>0)for(var p=0;p<g.childWidgets.length;p++){var u=g.childWidgets[p];c.childWidgets.push(u),u.paragraph=c,c.height+=u.height}}s.height+=h.height}else h instanceof el&&(s.childWidgets.push(h),h.containerWidget=s,s.height+=h.height)}}e.splice(n,1)}r.height=i},i.prototype.getSplittedWidgetForSpannedRow=function(e,i,r,n,o){for(var a=void 0,s=void 0,l=!1,d=!1,h=0;h<this.documentHelper.splittedCellWidgets.length;h++){s=this.documentHelper.splittedCellWidgets[h];for(var c=this.documentHelper.splittedCellWidgets[h+1],g=t.isNullOrUndefined(c)?0:c.columnIndex,p=this.documentHelper.splittedCellWidgets[h].columnIndex,u=this.documentHelper.splittedCellWidgets[h];u&&u.cellFormat.rowSpan===this.documentHelper.splittedCellWidgets[h].cellFormat.rowSpan&&p>0&&!l;)p=u.columnIndex,u=(m=u.containerWidget).getCell(m.rowIndex,p-1);var f=this.documentHelper.splittedCellWidgets[h].columnIndex;for(u=this.documentHelper.splittedCellWidgets[h];u&&u.cellFormat.rowSpan===this.documentHelper.splittedCellWidgets[h].cellFormat.rowSpan&&f<u.containerWidget.childWidgets.length-1&&(!l||d);){f=u.columnIndex;var m=u.containerWidget;u=m.getCell(m.rowIndex,f+1)}for(t.isNullOrUndefined(a)&&((a=new tl).containerWidget=i.containerWidget,a.index=i.index,a.rowFormat=i.rowFormat,a.isRenderBookmarkEnd=i.isRenderBookmarkEnd,this.updateWidgetLocation(i,a),n.push(a)),a.childWidgets.push(s),s.containerWidget=a,this.isRelayoutneed=!0;p>0&&!l;){y=i.getCell(i.index,p-1);t.isNullOrUndefined(y)?p--:(s=this.getSplittedWidget(e,!0,r,n,y,o),a.childWidgets.splice(0,0,s),s.index===s.containerWidget.childWidgets.length-1&&(s.width+=s.rightBorderWidth),s.rightBorderWidth=0,s.containerWidget=a,p--)}for(;f<i.childWidgets[i.childWidgets.length-1].columnIndex&&(!l||d);){var y=i.getCell(i.index,f+1);if(t.isNullOrUndefined(y))f++;else{if(c&&y.columnIndex>g){d=!0;break}s=this.getSplittedWidget(e,!0,r,n,y,o),a.childWidgets.push(s),s.containerWidget=a,f++}}l=!0}return a},i.prototype.getFootNoteHeightInLine=function(e){for(var t=0,i=0;i<e.children.length;i++){var r=e.children[i];r instanceof gl&&(t+=this.getFootNoteHeight(r.bodyWidget))}return t},i.prototype.getFootnoteFromLine=function(e,t){for(var i=0;i<e.children.length;i++)e.children[i]instanceof gl&&t.push(e.children[i])},i.prototype.updateWidgetsToTable=function(e,i,r,n,o,a,s){var l=this,d=r.bodyWidget.page.index,h=this.getRowHeight(r,[r]),c=this.viewer,g=r.rowFormat.isHeader,p=void 0,u=r.rowFormat.allowBreakAcrossPages,f=r.rowFormat.heightType,m=0,y=0,v=r,W=!1,b=this.layoutedFootnoteElement,x=!1;void 0!==v.bodyWidget.page.footnoteWidget?(this.footHeight=this.getFootNoteHeight(v.bodyWidget.page.footnoteWidget.bodyWidgets),0===this.footnoteHeight&&(this.footnoteHeight=this.footHeight)):this.footHeight=0,r.ownerTable.continueHeader&&!g&&(r.ownerTable.continueHeader=!1);var w=r.ownerTable.isInsideTable,F=!1,C=function(){return l.documentHelper.splittedCellWidgets.length>0&&(r.ownerTable.isInsideTable||l.documentHelper.splittedCellWidgets.some(function(e){return e.ownerTable.equals(r.ownerTable)}))};for(m=t.isNullOrUndefined(r.ownerTable)||t.isNullOrUndefined(r.ownerTable.tableFormat)?0:bs.convertPointToPixel(r.ownerTable.tableFormat.cellSpacing);y<i.length;){if(y=i.length,this.removeStaleSplittedCellWidgets(r),this.isRowSpanEnd(r,c)&&"Exactly"===r.rowFormat.heightType&&1===this.documentHelper.splittedCellWidgets.length&&(this.documentHelper.splittedCellWidgets=[]),!s&&(r.ownerTable.isInsideTable||r.bodyWidget instanceof Xs||!C()&&v.y+v.height+m+this.footHeight<=c.clientArea.bottom)){r.ownerTable.isHeaderNotRepeatForAllPages=!1,!this.isVerticalMergedCellContinue(r)||v.y!==c.clientArea.y&&v.y!==this.viewer.clientArea.y+v.ownerTable.headerHeight||this.insertSplittedCellWidgets(c,e,v,v.index-1),this.addWidgetToTable(c,e,i,v,b,void 0,w,d,x);var P=!(!(this.documentHelper.splittedCellWidgets.length>0&&r.ownerTable.isInsideTable)||r.ownerTable.equals(this.documentHelper.splittedCellWidgets[0].ownerTable));!t.isNullOrUndefined(r.bodyWidget)&&r.bodyWidget instanceof Ys&&C()&&!P&&t.isNullOrUndefined(i[i.length-1].nextRow)?(y--,F=!0):!t.isNullOrUndefined(r.bodyWidget)&&r.bodyWidget instanceof Ys&&C()&&!P&&!t.isNullOrUndefined(i[i.length-1].nextRow)&&!this.isRowSpanEnd(i[i.length-1].nextRow,c)&&y--,w=!1}else{if(b=[],w=!1,this.documentHelper.splittedCellWidgets.length>0&&v.y+v.height+this.footHeight<=c.clientArea.bottom&&!this.isRowSpanEnd(r,c)){this.isVerticalMergedCellContinue(r)&&(v.y===c.clientArea.y||v.y===this.viewer.clientArea.y+v.ownerTable.headerHeight&&!g)&&(this.insertSplittedCellWidgets(c,e,v,v.index-1,!0),this.updateChildLocationForRow(v.y,v)),this.addWidgetToTable(c,e,i,v,b);continue}var T=v,O=e[e.length-1];if(s||h+v.y+this.footHeight>c.clientArea.bottom)if(!u||g&&r.ownerTable.continueHeader||"AtLeast"===f&&bs.convertPointToPixel(r.rowFormat.height)<c.clientArea.bottom){var S=!u&&t.isNullOrUndefined(v.previousWidget)&&e.length>1;"AtLeast"===f&&bs.convertPointToPixel(r.rowFormat.height)<c.clientActiveArea.height&&(u||S)||"Exactly"!==f&&v.y===c.clientArea.y||"Auto"===f&&u?(T=this.splitWidgets(v,c,e,i,T,F,b,o,a,s),t.isNullOrUndefined(T)&&v.y===c.clientArea.y?this.addWidgetToTable(c,e,i,v,b):t.isNullOrUndefined(T)&&"AtLeast"===f&&v.containerWidget.lastChild!==v&&(T=v)):"AtLeast"===f&&bs.convertPointToPixel(r.rowFormat.height)>c.clientActiveArea.height&&this.documentHelper.splittedCellWidgets.length>0&&this.isRowSpanEnd(r,c)&&this.insertSplittedCellWidgets(c,e,v,v.index-1),"Exactly"===f&&v.y===c.clientArea.y&&(this.addWidgetToTable(c,e,i,v,b),y++),this.updateHeader(r,g,c)}else if("Auto"!==f&&"AtLeast"!==f||!u){if("Exactly"===f&&v.y===c.clientArea.y){this.addWidgetToTable(c,e,i,v,b),y++;continue}}else if(bs.convertPointToPixel(r.rowFormat.height)>c.clientArea.bottom&&v.y!==c.clientArea.y){if("AtLeast"===f&&bs.convertPointToPixel(r.rowFormat.height)>c.clientArea.bottom&&v.ownerTable.wrapTextAround&&v.y-bs.convertPointToPixel(v.ownerTable.positioning.verticalPosition)===c.clientArea.y&&v.bodyWidget.firstChild===v.ownerTable&&(T=this.splitWidgets(v,c,e,i,T,F,b,o,a,s),t.isNullOrUndefined(T))){this.addWidgetToTable(c,e,i,v,b),y++;continue}}else T=this.splitWidgets(v,c,e,i,T,F,b,o,a,s),t.isNullOrUndefined(T)&&v.y===c.clientArea.y&&this.addWidgetToTable(c,e,i,v,b);else{var N=!1,I=0;if(t.isNullOrUndefined(v.ownerTable.headerHeight)||(I=v.ownerTable.headerHeight),this.isVerticalMergedCellContinue(r)&&(u||(N=v.y===c.clientArea.y||v.y===this.viewer.clientArea.y+I)))if(!(N&&v.height+v.y+this.footHeight<c.clientArea.bottom)||g&&t.isNullOrUndefined(v.previousWidget)){if(T=this.splitWidgets(v,c,e,i,T,F,b,void 0,void 0,void 0,!0),t.isNullOrUndefined(T)){if(N=v.y===c.clientArea.y||v.y===this.viewer.clientArea.y+I){this.insertSplittedCellWidgets(c,e,v,v.indexInOwner-1),y--;continue}this.isRowSpanEnd(r,c)&&(T=v)}}else this.insertSplittedCellWidgets(c,e,T,v.indexInOwner-1);else F&&!u?T=this.splitWidgets(v,c,e,i,T,F,b):this.isRowSpanEnd(r,c)&&!u?("AtLeast"===f&&r.ownerTable.spannedRowCollection.keys.length>0&&(T=this.splitWidgets(v,c,e,i,T,F,b,o,a,s,!0)),t.isNullOrUndefined(T)&&this.addWidgetToTable(c,e,i,v,b)):v.y===c.clientArea.y&&v.height+v.y+this.footHeight>c.clientArea.bottom&&u?T=this.splitWidgets(v,c,e,i,T,F,b):"Exactly"===f&&v.y===c.clientArea.y&&v.height+v.y+this.footHeight>c.clientArea.bottom&&v.height>c.clientActiveArea.height&&!t.isNullOrUndefined(T)&&(T=!u&&t.isNullOrUndefined(v.previousWidget)&&e.length>1?this.splitWidgets(v,c,e,i,T,F,b):T,t.isNullOrUndefined(T)&&this.addWidgetToTable(c,e,i,v,b));this.updateHeader(r,g,c)}if(!(t.isNullOrUndefined(T)||this.documentHelper.editorProperties.isTableInsert||T.bodyWidget.containerWidget instanceof Zs)){if(O.isHeaderNotRepeatForAllPages=!1,T!==v)this.addWidgetToTable(c,e,i,v,b,v.nextRow,void 0,void 0,x),this.updateWidgetsToPage(e,i,r.ownerTable,n,v.nextRow),e.indexOf(v.containerWidget)+1>=e.length&&this.addTableWidget(c.clientActiveArea,e,!0),v=T;else{if(r.index>0)if(this.updateWidgetsToPage(e,i,r.ownerTable,n,r),r.previousRenderedWidget instanceof tl){var k=r.previousRenderedWidget;bs.round(v.y,2)===bs.round(k.y+k.height,2)?e.indexOf(k.containerWidget)+1>=e.length&&this.addTableWidget(c.clientActiveArea,e,!0):this.addTableWidget(c.clientActiveArea,e,!0)}else this.addTableWidget(c.clientActiveArea,e,!0);else if("Exactly"===f&&h+v.y+this.footHeight<c.clientArea.bottom&&v.y>=c.clientArea.y){this.addWidgetToTable(c,e,i,v,b),y++;continue}W=!0,y--}O=e[e.length-1];var A=r,L=!1,U=(r.ownerTable.containerWidget.index,!1),B=void 0,H=void 0;H=W&&1===e.length?e[e.length-1]:e[e.length-2];var R=!0;if(W&&1===i.length){var q=this.alignBlockElement(r);if(!t.isNullOrUndefined(q.node)){var E=q.node;E instanceof tl&&0===E.indexInOwner?e.length>1&&0===e[e.length-1].childWidgets.length&&(e.pop(),(O=e[e.length-1]).height=0):q.node instanceof Qs&&(H=this.splitParagraph(q.node,parseInt(q.position.index,10)),e.length>1&&0===e[e.length-1].childWidgets.length&&(e.pop(),O=e[e.length-1]),R=!1),E instanceof tl&&(U=0===E.indexInOwner,(A=E).ownerTable.equals(r.ownerTable)||(H=A.ownerTable,R=!1)),L=!0}}B=this.moveBlocksToNextPage(H instanceof Qs?H.previousWidget:L&&U?t.isNullOrUndefined(H.previousWidget)?H:H.previousWidget:H,L,void 0,void 0,void 0,!0);var M=e[e.length-1];if(W&&R&&(0===A.index||1===e.length&&0===A.indexInOwner)&&M.containerWidget&&-1!==M.containerWidget.childWidgets.indexOf(M)&&M.containerWidget.childWidgets.splice(M.containerWidget.childWidgets.indexOf(M),1),R&&(-1!==B.childWidgets.indexOf(M)&&B.childWidgets.splice(B.childWidgets.indexOf(M),1),B.childWidgets.unshift(M),this.shiftFloatingItemsFromTable(M,B)),M.containerWidget=B,W&&A.index>0||i.length>1){var V=W?i[i.length-1]:i[i.length-2];L&&(V=A),bs.convertPointToPixel(V.rowFormat.height)+O.headerHeight>this.viewer.clientArea.height?O.isHeaderNotRepeatForAllPages=!0:O.isHeaderNotRepeatForAllPages=!1,this.moveNextWidgetsToTable(e,V,!W),A=r}B.firstChild instanceof Qs&&this.updateParaOnBeforeSpacing(B.firstChild,B,!0),L&&this.updateClientPositionForBlock(R?M:H,r),W=!1;var D=!1,z=this.documentHelper.viewer.clientArea.bottom-v.bottomBorderWidth-m;if(A.ownerTable.header&&(T.x=T.x,T.y=this.viewer.clientArea.y+O.headerHeight,this.updateChildLocationForRow(T.y,T),D=this.isFirstLineFitForRow(z,T)),!D||!A.ownerTable.header||L||"Word2013"===this.documentHelper.compatibilityMode&&O.isHeaderNotRepeatForAllPages){if(c.updateClientAreaForBlock(A.ownerTable,!0,e,void 0,!0),T.bodyWidget.sectionFormat.columns.length>1){var _=new zs(this.viewer.clientArea.x,this.viewer.clientArea.y,this.viewer.clientArea.width,this.viewer.clientArea.height),j=new zs(this.viewer.clientActiveArea.x,this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.width,this.viewer.clientActiveArea.height);T.x=this.viewer.clientActiveArea.x,T.y=this.viewer.clientActiveArea.y;for(var G=this.getMaxTopCellMargin(T),K=this.getMaxBottomCellMargin(T),Y=0;Y<T.childWidgets.length;Y++){var X=T.childWidgets[Y];X.height=0,this.addTableCellWidget(X,this.viewer.clientActiveArea,G+T.topBorderWidth,K+T.bottomBorderWidth),this.viewer.updateClientAreaForCell(X,!0);for(var J=0;J<X.childWidgets.length;J++){var Z=X.childWidgets[J];c.updateClientAreaForBlock(Z,!0),Z.containerWidget=X,this.layoutBlock(Z,0),c.updateClientAreaForBlock(Z,!1)}this.viewer.updateClientAreaForCell(X,!1)}this.viewer.clientActiveArea=j,this.viewer.clientArea=_}T.x=T.x,T.y=O.y;var Q=m/2;this.updateChildLocationForRow(O.y-Q,T,O.containerWidget,!0)}else{c instanceof Es&&(B.page.repeatHeaderRowTableWidget=!0,x=!0),c.updateClientAreaForBlock(A.ownerTable,!0,e);var $=T.bodyWidget.sectionFormat.columns.length>1?O.x-T.x:0;T.y=O.y+A.ownerTable.headerHeight,this.updateChildLocationForRow(O.y+A.ownerTable.headerHeight,T,O.containerWidget),0!==$&&this.shiftXPosition(T,$)}if(R&&this.shiftedFloatingItemsFromTable.length>0){for(Y=0;Y<this.shiftedFloatingItemsFromTable.length;Y++){var ee=this.shiftedFloatingItemsFromTable[Y],te=this.getFloatingItemPoints(ee);ee.y=te.y,ee.x=te.x,(ee instanceof Pl||ee instanceof Tl)&&this.updateChildLocationForCellOrShape(ee.y,ee)}this.shiftedFloatingItemsFromTable=[]}}F=!1}if(g&&(r.ownerTable.continueHeader&&(r.ownerTable.header=!0,r.ownerTable.headerHeight=h+r.ownerTable.headerHeight),p=this.getHeader(r.ownerTable),!t.isNullOrUndefined(p)&&r.index===p.index&&(((I=this.getHeaderHeight(r.ownerTable,r,i))>r.ownerTable.headerHeight||I>r.ownerTable.headerHeight)&&(r.ownerTable.headerHeight=I),r.ownerTable.headerHeight>c.clientArea.height))){r.ownerTable.header=!1,r.ownerTable.continueHeader=!1,r.ownerTable.headerHeight=0;for(var ie=this.documentHelper.pages,Y=0;Y<ie.length;Y++)ie[Y].repeatHeaderRowTableWidget&&(ie[Y].repeatHeaderRowTableWidget=!1)}s=!1,e.length>2&&r.ownerTable.header&&v.height<c.clientActiveArea.bottom&&!c.documentHelper.currentRenderingPage.repeatHeaderRowTableWidget&&(c.documentHelper.currentRenderingPage.repeatHeaderRowTableWidget=!0)}},i.prototype.updateHeader=function(e,i,r){if(i&&e.ownerTable.continueHeader){e.ownerTable.header=!1,e.ownerTable.headerHeight=0;var n=void 0;if(r instanceof Es&&(n=this.documentHelper.pages),!t.isNullOrUndefined(n))for(var o=0;o<n.length;o++)!n[o].repeatHeaderRowTableWidget||t.isNullOrUndefined(n[o].bodyWidgets[0].firstChild)||n[o].bodyWidgets[0].firstChild instanceof el&&n[o].bodyWidgets[0].firstChild.header||(n[o].repeatHeaderRowTableWidget=!1,e.ownerTable.continueHeader=!1)}},i.prototype.getHeader=function(e){var t=void 0,i=!0;e=e.getSplitWidgets()[0];for(var r=0;r<e.childWidgets.length;r++){var n=e.childWidgets[r];if(n.rowFormat.isHeader?t=n:i=!1,!i)break}return t},i.prototype.getHeaderHeight=function(e,t,i){var r=0;if(t.ownerTable.childWidgets.length>0&&e.childWidgets[0].rowFormat.isHeader)for(var n=0;n<e.childWidgets.length;n++){var o=e.childWidgets[n];if(!o.rowFormat.isHeader)break;r+=o.height}return r},i.prototype.getHeaderHeightForSpannedRow=function(e){for(var i=0,r=1,n=this.getHeader(e),o=0;o<e.childWidgets.length;o++){var a=e.childWidgets[o];if(a.rowFormat.isHeader&&(i+=a.height,a==n)){for(var s=0;s<n.childWidgets.length;s++){var l=n.childWidgets[s];r=Math.max(r,l.cellFormat.rowSpan)}if(r>1&&o+r<e.childWidgets.length)for(var d=1;d<r;d++){var h=e.childWidgets[o+d];t.isNullOrUndefined(h)||(i+=h.height)}}}return i},i.prototype.updateWidgetToRow=function(e){var i=e.ownerRow;if(e.containerWidget=i,!t.isNullOrUndefined(e.ownerRow)&&"Exactly"!==e.ownerRow.rowFormat.heightType&&bs.convertPointToPixel(e.ownerRow.rowFormat.height)>0&&0===e.cellIndex&&(this.documentHelper.isRowOrCellResizing&&0!==this.documentHelper.editorProperties.resizeNode&&this.documentHelper.editorProperties.resizingRowFormat===e.ownerRow.rowFormat?i.height=i.height+e.ownerRow.rowFormat.height:i.height=i.height+bs.convertPointToPixel(e.ownerRow.rowFormat.height)),1===e.cellFormat.rowSpan){var r=void 0;r="Exactly"===i.rowFormat.heightType?e.height+e.margin.bottom:e.height+e.margin.top+e.margin.bottom,i.height-bs.convertPointToPixel(e.ownerTable.tableFormat.cellSpacing)<r&&(i.height=r+bs.convertPointToPixel(e.ownerTable.tableFormat.cellSpacing))}},i.prototype.updateHeightForRowWidget=function(e,i,r,n,o,a,s,l){for(var d=0;d<o.childWidgets.length;d++){var h=0,c=void 0,g=1;if(g=(c=o.childWidgets[d]).cellFormat.rowSpan,h=bs.convertPointToPixel(c.ownerTable.tableFormat.cellSpacing),g>1){var p=o.containerWidget.childWidgets.indexOf(o),u=p+g-1-(o.index-c.rowIndex);if(!t.isNullOrUndefined(o.rowFormat)&&o.rowFormat.isHeader&&!t.isNullOrUndefined(o.ownerTable)&&!t.isNullOrUndefined(o.ownerTable.previousWidget)&&e.clientArea.bottom<c.y+c.height+c.margin.bottom){var f=void 0,m=!1,y=!1;f=r[r.length-1];var v=this.alignBlockElement(o);if(!t.isNullOrUndefined(v.node)){var W=v.node;if(W instanceof tl&&0===W.indexInOwner&&r.length>1&&0===r[r.length-1].childWidgets.length&&(r.pop(),r[r.length-1].height=0),W instanceof tl){m=0===W.indexInOwner;var b=W;t.isNullOrUndefined(b.ownerTable)||b.ownerTable.equals(o.ownerTable)||(f=b.ownerTable)}y=!0}this.moveBlocksToNextPage(f instanceof Qs?f.previousWidget:y&&m?t.isNullOrUndefined(f.previousWidget)?f:f.previousWidget:f,y,void 0,void 0,void 0,!0),this.updateClientPositionForBlock(f,o),this.addTableRowWidget(this.viewer.clientActiveArea,[o]),this.updateChildLocationForRow(this.viewer.clientActiveArea.y,o)}if(!l&&(e.clientArea.bottom<c.y+c.height+c.margin.bottom||u>=p+1)&&(1===n.length||n.length>=1&&o===n[n.length-1])){var x=this.footHeight;this.footHeight=this.existFootnoteHeight=t.isNullOrUndefined(o.bodyWidget.page.footnoteWidget)?0:o.bodyWidget.page.footnoteWidget.height,this.splitSpannedCellWidget(c,r,n,e),this.footHeight=this.existFootnoteHeight=x}var w=o;if(u>0)if(u<o.containerWidget.childWidgets.length){var F=o.containerWidget.childWidgets[u];F instanceof tl&&(w=F)===s&&(w=o)}else w=o.containerWidget.childWidgets[o.containerWidget.childWidgets.length-1];c.y+c.height+c.margin.bottom<w.y+w.height?c.height=w.y+w.height-w.bottomBorderWidth-c.y-c.margin.bottom:a&&w&&0!==w.y&&0!==w.height&&c.y+c.height+c.margin.bottom>w.y+w.height&&("Exactly"!==w.rowFormat.heightType||"Exactly"===w.rowFormat.heightType&&w.rowFormat.height>c.y+c.height+c.margin.bottom-w.y?w.height=c.y+c.height+c.margin.bottom-w.y:c.height=w.y-c.y+w.height)}else h>0&&!o.rowFormat.isHeader&&r.length>1&&o.y===e.clientArea.y&&e instanceof Es&&(h/=2),c.height=o.height-c.margin.top-c.margin.bottom-h;this.updateHeightForCellWidget(e,r,n,c);for(var C=o.containerWidget;C.containerWidget instanceof Gs;)C=C.containerWidget;var P=void 0;C instanceof Ys&&(P=C.page),(e instanceof Es&&-1!==e.visiblePages.indexOf(P)||i)&&this.updateCellVerticalPosition(c,!1,c.ownerTable.isInsideTable)}},i.prototype.updateHeightForCellWidget=function(e,t,i,r){for(var n=0;n<r.childWidgets.length;n++)r.childWidgets[n]instanceof el&&this.updateHeightForTableWidget(t,i,r.childWidgets[n])},i.prototype.getRowHeight=function(e,t){var i=0;if("Exactly"===e.rowFormat.heightType)i=e.rowFormat.height;else{for(var r=0;r<t.length;r++)t[r]instanceof tl&&(i=t[r].height+i);i=Math.max(i,e.rowFormat.height)}return i},i.prototype.splitSpannedCellWidget=function(e,i,r,n){var o=this.getSplittedWidget(n.clientArea.bottom,!1,i,r,e,void 0,void 0,void 0,void 0,!0);if(!t.isNullOrUndefined(o)&&(this.documentHelper.splittedCellWidgets.push(o),o.isSplittedCell=!0,!t.isNullOrUndefined(o.ownerTable)&&o.ownerTable.isInsideTable&&!t.isNullOrUndefined(o.ownerTable.nextSplitWidget))){var a=o.ownerTable.nextSplitWidget;if(!t.isNullOrUndefined(a.firstChild)){var s=a.firstChild;this.insertSplittedCellWidgets(n,[a],s,s.index-1,!0)}}},i.prototype.insertSplittedCellWidgets=function(e,i,r,n,o){if(!t.isNullOrUndefined(r)){var a=r.x,s=0,l=0,d=!1;s=bs.convertPointToPixel(r.ownerTable.tableHolder.tableWidth);for(var h=0;h<r.childWidgets.length;h++){var c=r.childWidgets[h],g="None"===c.cellFormat.borders.right.lineStyle;if(l=t.isNullOrUndefined(c.ownerTable)||t.isNullOrUndefined(c.ownerTable.tableFormat)?0:bs.convertPointToPixel(c.ownerTable.tableFormat.cellSpacing),Math.round(a)<Math.round(c.x-c.margin.left-l)){if(this.insertRowSpannedWidget(r,e,a,h,o)){h--;continue}if(1===i.length&&0===this.documentHelper.splittedCellWidgets.length)break;var p=r.childWidgets.length;if(this.insertEmptySplittedCellWidget(r,i,a,h,n),p<r.childWidgets.length){h--;continue}}if(a+=c.margin.left+c.width+c.margin.right,l>0||c.columnIndex===c.ownerTable.tableHolder.columns.length-1||c.index===c.containerWidget.childWidgets.length-1){if(!c.ownerTable.tableFormat.allowAutoFit){var u=bs.convertPointToPixel(il.getCellLeftBorder(c).getLineWidth()),f=bs.convertPointToPixel(il.getCellRightBorder(c).getLineWidth());c.rightBorderWidth=c.ownerTable.isBidiTable?u:f,a+=c.rightBorderWidth}this.isInsertTable()||(d=this.checkPreviousMargins(c.ownerTable))}if(a-=g&&!d?0:c.rightBorderWidth,h===r.childWidgets.length-1&&Math.round(a)<Math.round(r.x+s)){if(this.insertRowSpannedWidget(r,e,a,h+1))continue;this.insertEmptySplittedCellWidget(r,i,a,h+1,n)}else;}if((t.isNullOrUndefined(r.childWidgets)||0===r.childWidgets.length)&&this.documentHelper.splittedCellWidgets.length>0)for(var m=0;m<this.documentHelper.splittedCellWidgets.length;m++){var y=this.documentHelper.splittedCellWidgets[m];if(Math.round(a)<=Math.round(y.x-y.margin.left)){if(this.insertRowSpannedWidget(r,e,a,m)){m--;continue}var v=r.childWidgets.length;if(this.insertEmptySplittedCellWidget(r,i,a,m,n),v<r.childWidgets.length){m--;continue}}if(a+=y.margin.left+y.width+y.margin.right,m===r.childWidgets.length-1&&Math.round(a)<Math.round(r.x+s)){if(this.insertRowSpannedWidget(r,e,a,m+1))continue;this.insertEmptySplittedCellWidget(r,i,a,m+1,n)}else;}this.documentHelper.splittedCellWidgets.length>0&&(this.documentHelper.splittedCellWidgets=[])}},i.prototype.insertRowSpannedWidget=function(e,t,i,r,n){var o=0;e.ownerTable.tableFormat.cellSpacing>0&&(o=bs.convertPointToPixel(e.ownerTable.tableFormat.cellSpacing));for(var a=0;a<this.documentHelper.splittedCellWidgets.length;a++){var s=this.documentHelper.splittedCellWidgets[a];if(Math.round(i)===Math.round(s.x-s.margin.left))return e.childWidgets.splice(r,0,s),s.containerWidget=e,!n&&s.height>e.height&&(e.height=s.height),s.y!==e.y+s.margin.top+o&&this.updateChildLocationForRow(e.y,e),this.documentHelper.splittedCellWidgets.splice(a,1),!0}return!1},i.prototype.insertEmptySplittedCellWidget=function(e,i,r,n,o){for(var a,s=i[i.length-1],l=i.length-1;l>=0;l--)for(var d=i[l],h=d.childWidgets.length-1;h>=0;h--){var c=d.childWidgets[h];if(c.index===o){a=c;break}}a&&(s=a.ownerTable,o=a.indexInOwner);for(var g=o;g>=0;g--)for(var p=s.childWidgets[g],u=p.x,l=0;l<p.childWidgets.length;l++){var f=1,m=p.childWidgets[l],y=t.isNullOrUndefined(m.ownerTable)||t.isNullOrUndefined(m.ownerTable.tableFormat)?0:bs.convertPointToPixel(m.ownerTable.tableFormat.cellSpacing);if(Math.round(u)!==Math.round(m.x-m.margin.left-y)&&(u=m.x-m.margin.left-y),(Math.round(r)===Math.round(u)||e.lastChild.x+e.lastChild.width===m.x&&Math.abs(r-u)<=5)&&(f=t.isNullOrUndefined(m)||t.isNullOrUndefined(m.cellFormat)?f:m.cellFormat.rowSpan)>1&&!this.isColumnExistsInCurrentRow(e,m.columnIndex)){if(this.isVerticalMergedCellContinue(e)&&"Exactly"!==e.rowFormat.heightType&&!t.isNullOrUndefined(e.previousRenderedWidget)&&e.previousRenderedWidget instanceof tl&&e.previousRenderedWidget.y+e.previousRenderedWidget.height<m.y+m.height){this.isRelayoutneed=!0;var v=this.getSplittedWidget(e.previousRenderedWidget.y+e.previousRenderedWidget.height,!0,i,void 0,m,void 0,void 0,void 0,void 0,!0);return this.isRelayoutneed=!1,e.childWidgets.splice(n,0,v),v.containerWidget=e,void this.updateChildLocationForRow(e.y,e)}var W=this.createCellWidget(m);return e.childWidgets.splice(n,0,W),W.containerWidget=e,void this.updateChildLocationForRow(e.y,e)}u+=m.margin.left+m.width+m.margin.right}},i.prototype.isColumnExistsInCurrentRow=function(e,t){for(var i=0;i<e.childWidgets.length;i++)if(e.childWidgets[i].columnIndex===t)return!0;return!1},i.prototype.getSplittedWidget=function(e,i,r,n,o,a,s,l,d,h){var c=void 0;if(l||o.y+o.height>e-this.footHeight-o.margin.bottom){var g=0;o.ownerTable.isInsideTable&&(g=d);for(var p=!1,u=0;u<o.childWidgets.length;u++)if(o.childWidgets[u]instanceof Qs){var f=o.childWidgets[u],m=f;if(p||(m=this.getSplittedWidgetForPara(e-o.margin.bottom,f,a,s,l,g)),l&&(g+=f.childWidgets.length),!t.isNullOrUndefined(m)){if(p=!0,0===u&&m===f&&!h)return o;-1!==o.childWidgets.indexOf(m)&&(o.childWidgets.splice(o.childWidgets.indexOf(m),1),u--),o.height-=m.height,t.isNullOrUndefined(c)&&(c=this.createCellWidget(o)),c.height+=m.height,c.childWidgets.push(m),m.containerWidget=c}}else{var y=o.childWidgets[u],v=[y],W=0;if(!t.isNullOrUndefined(y.footnoteElement))for(F=0;F<y.footnoteElement.length;F++)W+=this.getFootNoteHeight(y.footnoteElement[F].bodyWidget);var b=this.existFootnoteHeight+W;if(!t.isNullOrUndefined(a))for(F=0;F<a.length;F++)b+=this.getFootNoteHeight(a[F].bodyWidget);if(l||e-o.margin.bottom<y.y+y.height+b){var x=y.height,w=void 0;if(w=p?y:this.getSplittedWidgetForTable(e-o.margin.bottom,v,y,a,s,l,g),t.isNullOrUndefined(w)&&!y.childWidgets[0].rowFormat.allowBreakAcrossPages&&(w=y),!t.isNullOrUndefined(w)){if(0===u&&w===y)return o;-1!==o.childWidgets.indexOf(w)?(o.childWidgets.splice(o.childWidgets.indexOf(w),1),u--,o.height-=w.height):o.height-=x-y.height,t.isNullOrUndefined(c)&&(c=this.createCellWidget(o)),c.height+=w.height,c.childWidgets.push(w),w.containerWidget=c}}else if(y.footnoteElement.length>0)for(var F=0;F<y.footnoteElement.length;F++)a.push(y.footnoteElement[F])}}else this.updateFootHeight(o,a);return t.isNullOrUndefined(c)&&i&&this.isRelayoutneed&&(c=this.createCellWidget(o)),c},i.prototype.getNextFootNoteHeight=function(e,i){var r=0;if(!t.isNullOrUndefined(e.ownerTable.footnoteElement)&&e.ownerTable.footnoteElement.length>0){for(var n=e.indexInOwner+1;n<e.ownerRow.childWidgets.length;n++)for(var o=e.ownerRow.childWidgets[n],a=0;a<o.childWidgets.length;a++)if(o.childWidgets[a]instanceof Qs)r+=this.getFootHeightFromPara(o.childWidgets[a],i);else if(o.childWidgets[a]instanceof el){var s=o.childWidgets[a];r+=this.getFootHeightFromTable(s,i)}e.ownerTable.isInsideTable&&(r+=this.getNextFootNoteHeight(e.ownerTable.containerWidget,i))}return r},i.prototype.getFootHeightFromTable=function(e,t){for(var i=0,r=0;r<e.childWidgets.length;r++)for(var n=e.childWidgets[r],o=0;o<n.childWidgets.length;o++)for(var a=n.childWidgets[o],s=0;s<a.childWidgets.length;s++)a.childWidgets[s]instanceof Qs?i+=this.getFootHeightFromPara(a.childWidgets[s],t):a.childWidgets[s]instanceof el&&(i+=this.getFootHeightFromTable(a.childWidgets[s],t));return i},i.prototype.getFootHeightFromPara=function(e,t){for(var i=0,r=0;r<e.childWidgets.length;r++){var n=e.childWidgets[r],o=this.getFootNoteHeightInLine(n);t>n.height+e.y&&(i+=o)}return i},i.prototype.updateFootHeight=function(e,i){if(!t.isNullOrUndefined(i))for(var r=0;r<e.childWidgets.length;r++)if(e.childWidgets[r]instanceof Qs)for(var n=e.childWidgets[r],o=0;o<n.childWidgets.length;o++)this.getFootnoteFromLine(n.childWidgets[o],i);else e.childWidgets[r]instanceof el&&this.updateFootHeightForTable(e.childWidgets[r],i)},i.prototype.updateFootHeightForTable=function(e,t){for(var i=0;i<e.childWidgets.length;i++)for(var r=e.childWidgets[i],n=0;n<r.childWidgets.length;n++){var o=r.childWidgets[n];this.updateFootHeight(o,t)}},i.prototype.getListLevelPattern=function(e){switch(e){case 0:return"Arabic";case 1:return"LowLetter";case 2:return"LowRoman";case 3:return"UpLetter";case 4:return"UpRoman";case 5:return"Ordinal";case 6:return"Number";case 7:return"OrdinalText";case 8:return"LeadingZero";case 9:return"Bullet";case 10:return"FarEast";case 11:return"Special";default:return"None"}},i.prototype.createCellWidget=function(e){var t=new il;return t.cellFormat=e.cellFormat,t.index=e.index,t.rowIndex=e.rowIndex,t.columnIndex=e.columnIndex,t.containerWidget=e.containerWidget,this.updateWidgetLocation(e,t),t.margin=e.margin,t.leftBorderWidth=e.leftBorderWidth,t.rightBorderWidth=e.rightBorderWidth,t},i.prototype.createTableWidget=function(e){var t=new el;if(e.header){t.header=e.header;var i=this.getHeaderHeightForSpannedRow(e);t.headerHeight=i>e.headerHeight?i:e.headerHeight}return t.index=e.index,t.tableFormat=e.tableFormat,t.tableHolder=e.tableHolder,t.footnoteElement=e.footnoteElement,t.isGridUpdated=e.isGridUpdated,t.wrapTextAround=e.wrapTextAround,t.positioning=e.positioning,t.isContainInsideTable=e.isContainInsideTable,t.isBidiTable=e.isBidiTable,t},i.prototype.getSplittedWidgetForPara=function(e,i,r,n,o,a){for(var s=i.y,l=void 0,d=!1,h=!1,c=0,g=0;g<i.childWidgets.length;g++){var p=this.getNextFootNoteHeight(i.containerWidget,i.y+c),u=i.childWidgets[g],f=this.getFootNoteHeightInLine(u);if(f+=this.existFootnoteHeight+p,!t.isNullOrUndefined(r))for(var m=0;m<r.length;m++)f+=this.getFootNoteHeight(r[m].bodyWidget);var y=0;if(y=u.children[0]instanceof Cl?u.children[0].height:u.height,c+=y,o&&a>=n||e<s+f+y){if(i.paragraphFormat.keepLinesTogether&&(0!==i.index||0===i.index&&!t.isNullOrUndefined(i.associatedCell.ownerRow.previousWidget)))d=!0,g=0,u=i.childWidgets[0];else if(i.paragraphFormat.widowControl){if(!t.isNullOrUndefined(i.associatedCell)&&1===g&&e<s+y&&!h){var v=i.associatedCell.ownerRow.containerWidget,W=i.height-i.childWidgets[0].height;if(!(v.indexInOwner<=0&&i.associatedCell.ownerRow.indexInOwner<=0&&(i.indexInOwner<=0||W>e)||"Word2013"!==this.documentHelper.compatibilityMode))return i;h=!0}1!==g||h?"Word2013"===this.documentHelper.compatibilityMode&&3===g&&g+1===i.childWidgets.length&&t.isNullOrUndefined(l)&&(u=i.childWidgets[g-1],g--):(d=!0,g=0,u=i.childWidgets[0])}if(0===g){if(u.paragraph.containerWidget instanceof il&&!d&&!o&&0===i.indexInOwner&&s+y>e&&u.paragraph.associatedCell.ownerRow.y===this.viewer.clientArea.y){s+=u.height;continue}l=i;break}-1!==i.childWidgets.indexOf(u)&&(i.childWidgets.splice(i.childWidgets.indexOf(u),1),g--),i.height-=u.height,t.isNullOrUndefined(l)?((l=new Qs).characterFormat=i.characterFormat,l.paragraphFormat=i.paragraphFormat,l.index=i.index,this.updateWidgetLocation(i,l),l.height=u.height):l.height+=u.height,l.childWidgets.push(u),u.paragraph=l}this.getFootnoteFromLine(u,r),s+=u.height,a++}return l},i.prototype.getSplittedWidgetForTable=function(e,i,r,n,o,a,s){for(var l=r.y,d=void 0,h=0;h<r.childWidgets.length;h++){var c=void 0,g=(c=r.childWidgets[h]).height,p=g,u=this.existFootnoteHeight;if(e>l+g+u&&t.isNullOrUndefined(d))for(var f=0;f<c.childWidgets.length;f++)this.updateFootHeight(c.childWidgets[f],n);if(!t.isNullOrUndefined(n))for(var m=0;m<n.length;m++)u+=this.getFootNoteHeight(n[m].bodyWidget);for(var y=0,v=c.childWidgets;y<v.length;y++){var W=v[y],b=W.cellFormat.rowSpan;if(!t.isNullOrUndefined(W.cellFormat)&&b>1){for(var x=g,w=0,F=r.childWidgets.slice(h+1,Math.min(h+b,r.childWidgets.length));w<F.length;w++)x+=F[w].height;x>p&&(p=x)}}if(a||e<l+p+u||!t.isNullOrUndefined(d)){var C=void 0,P=!0;if(t.isNullOrUndefined(c)||t.isNullOrUndefined(c.rowFormat)||(P=c.rowFormat.allowBreakAcrossPages),C=P?t.isNullOrUndefined(d)&&this.isFirstLineFitForRow(e,c)?this.getSplittedWidgetForRow(e,i,[c],c,n,o,a,s):c:t.isNullOrUndefined(r.containerWidget.containerWidget.previousWidget)&&this.isFirstLineFitForRow(e,c)||r.isInsideTable&&!r.containerWidget.containerWidget.rowFormat.allowBreakAcrossPages?this.getSplittedWidgetForRow(e,i,[c],c,n,o,a,s):c,!t.isNullOrUndefined(C)){if(0===h&&C===c)return r;-1!==r.childWidgets.indexOf(C)?(r.childWidgets.splice(r.childWidgets.indexOf(C),1),h--,r.height-=C.height):r.height-=g-c.height,t.isNullOrUndefined(d)?(d=this.createTableWidget(r),this.updateWidgetLocation(r,d),d.height=C.height):d.height+=C.height,d.childWidgets.push(C),C.containerWidget=d}}l+=c.height}return d},i.prototype.isFirstLineFitForPara=function(e,t){var i=t.childWidgets[0],r=i.height,n=this.getFootNoteHeightInLine(i);r+=n+=this.existFootnoteHeight;var o=i.paragraph.containerWidget;if(t.paragraphFormat.keepLinesTogether&&Math.floor(o.containerWidget.y)!==this.viewer.clientArea.y&&(r=t.height),this.documentHelper.isFirstLineFitInShiftWidgets){if(this.viewer.clientActiveArea.y===this.viewer.clientArea.y&&t.y+r>=e)return!0}else if(!o.ownerTable.isInsideTable&&o.containerWidget.y===this.viewer.clientArea.y&&t.y+r>=e)return!0;return t.y+r<=e},i.prototype.isFirstLineFitForTable=function(e,i){var r=void 0,n=!1;return r=i.childWidgets[0],t.isNullOrUndefined(r)||(n=this.isFirstLineFitForRow(e,r)),n},i.prototype.isFirstLineFitForRow=function(e,t){for(var i=0;i<t.childWidgets.length;i++){var r=t.childWidgets[i];if(!this.isFirstLineFitForCell(e,r))return!1}return!0},i.prototype.isFirstLineFitForCell=function(e,t){if(0===t.childWidgets.length)return!0;if(t.childWidgets[0]instanceof Qs){var i=t.childWidgets[0];return this.isFirstLineFitForPara(e-t.margin.bottom,i)}var r=t.childWidgets[0];return this.isFirstLineFitForTable(e-t.margin.bottom,r)},i.prototype.updateWidgetLocation=function(e,t){t.x=e.x,t.y=e.y,t.width=e.width},i.prototype.updateChildLocationForTable=function(e,t,i,r,n){for(var o=0;o<t.childWidgets.length;o++){var a=t.childWidgets[o];a.x=n?t.x:a.x,a.y=e,this.updateChildLocationForRow(e,a,i,r,n),e+=a.height}},i.prototype.shiftXPosition=function(e,t){e.x+=t;for(var i=0;i<e.childWidgets.length;i++){var r=e.childWidgets[i];r instanceof rl||this.shiftXPosition(r,t)}},i.prototype.updateChildLocationForRow=function(e,t,i,r,n){var o=0;t.ownerTable.tableFormat.cellSpacing>0&&(o=bs.convertPointToPixel(t.ownerTable.tableFormat.cellSpacing));for(var a=t.x+(n&&t.childWidgets.length>0?t.childWidgets[0].margin.left:0),s=0;s<t.childWidgets.length;s++){var l=t.childWidgets[s];l.x=n?a:l.x,l.index=l.cellIndex,l.y=e+l.margin.top+o,this.updateChildLocationForCellOrShape(l.y,l,i,r,n),a=a+l.width+l.margin.right+ +o+l.margin.left}},i.prototype.updateChildLocationForCellOrShape=function(e,i,r,n,o){if(i instanceof Tl)this.layoutGroupShape(i);else{var a=i;i instanceof Pl&&(a=i.textFrame);for(var s=0;s<a.childWidgets.length;s++){var l=!1;if(a.childWidgets[s]instanceof el&&a.childWidgets[s].wrapTextAround&&!t.isNullOrUndefined(a.childWidgets[s+1])&&a.childWidgets[s+1].y>a.childWidgets[s].y&&a.childWidgets[s+1].y<a.childWidgets[s].y+a.childWidgets[s].height&&(l=!0),!t.isNullOrUndefined(a.childWidgets[s].floatingElements)&&a.childWidgets[s].floatingElements.length>0&&n&&(this.viewer.clientActiveArea.height=this.viewer.clientActiveArea.bottom-e,this.viewer.clientActiveArea.y=e),a.childWidgets[s].x=a.childWidgets[s].x,a.childWidgets[s].y=e,i instanceof Pl&&"Inline"==i.textWrappingStyle&&o&&this.updateShapeYPosition(i),i instanceof Tl&&"Inline"==i.textWrappingStyle&&o&&this.layoutGroupShape(i),!t.isNullOrUndefined(r)&&i instanceof il&&a.childWidgets[s]instanceof Qs){var d=a.childWidgets[s],h=i.ownerTable.bodyWidget.floatingElements,c=!1;if(i.ownerTable.bodyWidget!==r||t.isNullOrUndefined(i.ownerTable.previousSplitWidget)||(h=i.ownerTable.previousSplitWidget.bodyWidget.floatingElements,c=!0),d.floatingElements.length>0)for(var g=0;g<d.floatingElements.length;g++){var p=d.floatingElements[g],u=this.viewer.clientActiveArea.x;if(this.viewer.clientActiveArea.x=p.x,this.layoutShape(p),this.viewer.clientActiveArea.x=u,!t.isNullOrUndefined(d.firstChild))for(var f=d.childWidgets[0],m=0;m<f.children.length;m++){var y=f.children[m];y instanceof Cl&&"Inline"==y.textWrappingStyle&&(this.adjustPosition(y,i.ownerTable.bodyWidget),e=d.y)}if(h.indexOf(p)>-1&&"Inline"!==p.textWrappingStyle){if(!c){r.floatingElements.push(p);var v=r.previousSplitWidget;t.isNullOrUndefined(v)||-1===v.floatingElements.indexOf(p)||v.floatingElements.splice(v.floatingElements.indexOf(p),1)}-1!==h.indexOf(p)&&h.splice(h.indexOf(p),1)}}}a.childWidgets[s]instanceof el&&this.updateChildLocationForTable(e,a.childWidgets[s],r,n),l||(e+=a.childWidgets[s].height)}}},i.prototype.updateCellVerticalPosition=function(e,t,i){var r=e.ownerTable.containerWidget,n=0;if(r instanceof Ks||r instanceof Ol||i){var o=this.getDisplacement(e,t);r instanceof il&&(n=this.getDisplacement(r,t)),this.updateCellContentVerticalPosition(e,o,n,t)}},i.prototype.updateCellContentVerticalPosition=function(e,t,i,r){if(0!==i||0!==t)for(var n=e.y+t,o=0;o<e.childWidgets.length;o++){if(e.childWidgets[o]instanceof Qs){var a=e.childWidgets[o];a.y=n,this.updateShapeInsideCell(a,t)}else this.updateTableWidgetLocation(e.childWidgets[o],n,r);n+=e.childWidgets[o].height}},i.prototype.updateShapeInsideCell=function(e,t){for(var i=0;i<e.floatingElements.length;i++){var r=e.floatingElements[i];r.y+=t,(r instanceof Pl||r instanceof Tl)&&this.updateChildLocationForCellOrShape(r.y,r)}},i.prototype.updateTableWidgetLocation=function(e,t,i){e.y=t+=e.topBorderWidth;for(var r=0;r<e.childWidgets.length;r++){var n=e.childWidgets[r];n.y=t;for(var o=0;o<n.childWidgets.length;o++){var a=n.childWidgets[o];a.y=t+a.margin.top+0,this.updateCellVerticalPosition(a,i,!0)}t+=n.height}return t},i.prototype.getDisplacement=function(e,i){var r=0,n=e.containerWidget,o=e.margin.top+e.margin.bottom;r=!t.isNullOrUndefined(e.cellFormat)&&e.cellFormat.rowSpan>1?e.height:(t.isNullOrUndefined(n)?0:n.height)-o;var a=this.getCellContentHeight(e,!0),s=0;return r>a&&r<=this.viewer.clientArea.height&&!e.isSplittedCell&&(s=r-a,"Center"===e.cellFormat.verticalAlignment?s/=2:("Top"===e.cellFormat.verticalAlignment||i)&&(s=0)),s},i.prototype.getCellContentHeight=function(e,i,r){if(t.isNullOrUndefined(e.childWidgets))return 0;for(var n=0,o=e.y,a=0,s=0,l=!1,d=!1,h=0;h<e.childWidgets.length;h++)if(e.childWidgets[h]instanceof Qs){var c=e.childWidgets[h],g=c.y+c.height,p=e.childWidgets[e.childWidgets.length-1],u=p.y+p.height;(g>s||s<u||c.isInHeaderFooter)&&(n+=e.childWidgets[h].height),!i&&c.floatingElements.length>0&&r===c.indexInOwner&&(n+=this.getFloatingItemsHeight(c,e));for(var f=0;f<c.floatingElements.length;f++){l=!0;var m=c.floatingElements[f],y=m.textWrappingStyle,v=m.y+m.height,W=c.y+c.height;o+(e.height>e.containerWidget.height&&e.cellFormat.rowSpan>1?e.height:e.containerWidget.height)>v&&v>s?(a=Math.abs(o-v),s=v,d=!1):v>u&&c.x+c.width>m.x&&v>s&&"InFrontOfText"!==y&&"Behind"!==y&&("Word2013"===this.documentHelper.compatibilityMode||c.floatingElements[f].layoutInCell)?(n+=0===s?v-W:v-s,s=v):d=!0}}else this.considerPositionTableHeight(e,e.childWidgets[h])&&(n+=e.childWidgets[h].height);return o+n>s&&(l=!1),i&&l?a:i&&d?e.ownerRow.height:n},i.prototype.getFloatingItemsHeight=function(e,t){for(var i=0,r=0,n=0;n<e.floatingElements.length;n++){var o=e.floatingElements[n],a=o.textWrappingStyle,s=o.y+o.height,l=e.y+e.height;s<this.viewer.clientArea.bottom&&o.y!==e.y&&l>s&&e.x+e.width>o.x&&s>i&&"InFrontOfText"!==a&&"Behind"!==a&&"Inline"!==a&&("Word2013"===this.documentHelper.compatibilityMode||e.floatingElements[n].layoutInCell)&&(r+=0===i?s-t.y:s-i,i=s)}return r},i.prototype.considerPositionTableHeight=function(e,t){var i=!0;if(t.isLayouted&&t.wrapTextAround){for(var r=0;r<e.childWidgets.length;r++){var n=e.childWidgets[r];t!==n&&(n.y===t.y||n.y+n.height<t.y)&&(i=!1)}t.nextWidget&&t.nextWidget.y+t.nextWidget.height>t.y+t.height&&(i=!0)}return i},i.prototype.getTableLeftBorder=function(e){if(t.isNullOrUndefined(e.left)){var i=new m(e);return i.lineStyle="Single",i.lineWidth=.66,i}return e.left},i.prototype.getTableRightBorder=function(e){if(t.isNullOrUndefined(e.right)){var i=new m(e);return i.lineStyle="Single",i.lineWidth=.66,i}return e.right},i.prototype.getTableTopBorder=function(e){if(t.isNullOrUndefined(e.top)){var i=new m(e);return i.lineStyle="Single",i.lineWidth=.66,i}return e.top},i.prototype.getTableBottomBorder=function(e){if(t.isNullOrUndefined(e.bottom)){var i=new m(e);return i.lineStyle="Single",i.lineWidth=.66,i}return e.bottom},i.prototype.getCellDiagonalUpBorder=function(e){var t=void 0;return t=e.cellFormat.borders,t.diagonalUp},i.prototype.getCellDiagonalDownBorder=function(e){var t=void 0;return t=e.cellFormat.borders,t.diagonalDown},i.prototype.getTableWidth=function(e){for(var t=0,i=0;i<e.childWidgets.length;i++){for(var r=e.childWidgets[i],n=0,o=0;o<r.childWidgets.length;o++){var a=r.childWidgets[o];n+=bs.convertPointToPixel(a.cellFormat.cellWidth)}t<n&&(t=n)}return t},i.prototype.layoutNextItemsBlock=function(e,i,r,n){var o=e.bodyWidget.sectionIndex,a=e,s=a.getSplitWidgets(),l=s[s.length-1].nextRenderedWidget;(t.isNullOrUndefined(l)||this.documentHelper.blockToShift===a)&&(this.documentHelper.blockToShift=void 0);for(var d=!0;l instanceof Js&&(l.bodyWidget.sectionIndex===o||"NoBreak"===l.bodyWidget.sectionFormat.breakCode&&a.bodyWidget.sectionFormat.pageWidth===l.bodyWidget.sectionFormat.pageWidth&&a.bodyWidget.sectionFormat.pageHeight===l.bodyWidget.sectionFormat.pageHeight)&&(t.isNullOrUndefined(r)||!r||l.isLayouted||!this.isInitialLoad);){var h=void 0,c=a.getSplitWidgets();h=c[c.length-1],a=l,this.documentHelper.blockToShift===a&&(this.documentHelper.blockToShift=void 0),d=!1;var g=void 0;if(g=a.getSplitWidgets()[0],0===this.documentHelper.fieldStacks.length&&!t.isNullOrUndefined(g)&&h.containerWidget===g.containerWidget&&!this.documentHelper.isFollowedListLayoutRequired&&bs.round(g.y,2)===bs.round(h.y+h.height,2)){if(!t.isNullOrUndefined(this.documentHelper.blockToShift)||this.documentHelper.editorProperties.isFootnoteElementRemoved)this.documentHelper.blockToShift=a;else if(g.bodyWidget){var p=g.bodyWidget.floatingElements.length;p>0&&this.owner.isShiftingEnabled||0===p&&t.isNullOrUndefined(this.documentHelper.blockToShift)&&n?this.documentHelper.blockToShift=a:t.isNullOrUndefined(this.documentHelper.blockToShift)&&l.nextRenderedWidget&&l.nextRenderedWidget.containerWidget===l.containerWidget&&this.documentHelper.isShiftingEnabled&&bs.round(l.nextRenderedWidget.y,2)!==bs.round(l.y+l.height,2)&&(this.documentHelper.blockToShift=l)}break}if(d=!0,this.documentHelper.isShiftingEnabled&&!this.documentHelper.isFollowedListLayoutRequired&&(0===this.documentHelper.fieldStacks.length||this.documentHelper.editorProperties.isInsertingTOC)||this.isIFfield&&!this.checkBlockHasField(a)){if(!a.isFieldCodeBlock){this.documentHelper.blockToShift=a;break}}else this.documentHelper.editorProperties.isInsertingTOC||(a=a.combineWidget(this.viewer),h.containerWidget!==a.containerWidget&&(h instanceof Qs&&(!(h instanceof Qs)||h.isEndsWithPageBreak||h.isEndsWithColumnBreak||h.containerWidget.page===a.containerWidget.page||a.bodyWidget instanceof Ys&&"NoBreak"===a.bodyWidget.sectionFormat.breakCode)||this.updateContainerWidget(a,h.containerWidget,h.indexInOwner+1,!1)),a instanceof el&&(this.clearTableWidget(a,!0,!0),a.isGridUpdated=!1),i.updateClientAreaForBlock(a,!0),(this.viewer instanceof Ms||a.bodyWidget instanceof Xs)&&(a.containerWidget.height-=a.height),this.documentHelper.layout.layoutBlock(a,0),i.updateClientAreaForBlock(a,!1));l=(s=l.getSplitWidgets())[s.length-1].nextRenderedWidget}this.documentHelper.isShiftingEnabled&&this.documentHelper.blockToShift===a||this.isPastingContent||this.documentHelper.isFollowedListLayoutRequired||this.updateListItemsTillEnd(a,d),this.documentHelper.isFollowedListLayoutRequired=!1},i.prototype.updateClientAreaForLine=function(e){e.marginTop=0;var t=this.documentHelper.editorProperties.getTop(e),i=this.viewer.clientArea.x;this.viewer.cutFromTop(t),this.viewer.cutFromLeft(i)},i.prototype.isAuto=function(e){var t=!1;if("Auto"!==e.tableFormat.preferredWidthType||0!==e.tableFormat.preferredWidth||!e.tableFormat.allowAutoFit)return!1;for(var i=0;i<e.childWidgets.length;i++)for(var r=e.childWidgets[i],n=0;n<r.childWidgets.length;n++){var o=r.childWidgets[n];if("Auto"!==o.cellFormat.preferredWidthType||0!==o.cellFormat.preferredWidth)return!1;t=!0}return t&&e.isInsideTable&&e.containerWidget instanceof il&&(t=this.isAuto(e.containerWidget.ownerTable)),t},i.prototype.getParentTable=function(e){for(var t=e;t.containerWidget;){if(t.containerWidget instanceof Ks||t.containerWidget instanceof Ol)return t;t=t.containerWidget}},i.prototype.reLayoutParagraph=function(e,i,r,n,o,a){if(!(this.isReplaceAll||this.documentHelper.isEditorModule&&this.documentHelper.editorProperties.restrictLayout)&&this.documentHelper.enableLayout){this.isRelayout=!0,e.containerWidget instanceof Ol&&"Inline"===e.containerWidget.containerShape.textWrappingStyle&&t.isNullOrUndefined(e.containerWidget.containerShape.containerShape)&&(i=e.containerWidget.containerShape.line.indexInOwner,e=e.containerWidget.containerShape.paragraph),n=!t.isNullOrUndefined(n)&&n,this.isRelayout=!0;var s=!1;this.documentHelper.blockToShift===e?(this.layoutBodyWidgetCollection(e.index,e.containerWidget,e,!1),this.isBidiReLayout=!0,s=!0):this.isBidiReLayout&&(this.isBidiReLayout=!1);var l=!1;if(!s)if(e.isInsideTable){this.isBidiReLayout=!0,a&&(l=!0);var d=this.getParentTable(e),h=d.containerWidget;if(!this.isReplacingAll&&l&&h instanceof Ys&&t.isNullOrUndefined(h.containerWidget)){var c=d.tableHolder.clone(),g=!0;if(d.tableFormat.allowAutoFit){e=e.getSplitWidgets()[0];var p=d;if(p=p.combineWidget(this.viewer),p.isGridUpdated=!1,p.buildTableColumns(),p.isGridUpdated=!0,c.columns.length===p.tableHolder.columns.length){for(var u=0;u<p.tableHolder.columns.length;u++)if(p.tableHolder.columns[u].preferredWidth!==c.columns[u].preferredWidth){g=!1;break}}else g=!1}if(g){e.associatedCell.ownerTable.footnoteElement&&e.associatedCell.ownerTable.footnoteElement.length>0&&this.clearFootnoteReference(e.associatedCell.ownerTable,!0),this.viewer.updateClientAreaForCell(e.associatedCell,!0),this.viewer.updateClientAreaForBlock(e,!0),this.documentHelper.editorProperties.isDocumentLoaded&&this.updateWholeListItems(e),this.layoutParagraph(e,0),this.viewer.updateClientAreaForBlock(e,!1);var f=this.getParentTable(e),m=0;f.containerWidget instanceof Ys&&(m=(F=(w=f.getSplitWidgets())[w.length-1]).containerWidget.page.index);var y=f.combineWidget(this.viewer),v=y.containerWidget;if(this.viewer instanceof Ms&&(v.height-=y.height),this.viewer.updateClientArea(v,v.page),this.documentHelper.editorProperties.isDocumentLoaded){var W=this.documentHelper.getFirstParagraphInFirstCell(y);this.updateWholeListItems(W)}this.viewer.updateClientAreaForBlock(y,!0),y.x-=y.leftBorderWidth,y.y-=y.topBorderWidth;var b=this.getYPosition(y);this.viewer.cutFromTop(b),this.clearTableWidget(y,!0,!0,!1,!0,!0),this.shiftTableWidget(y,this.viewer),this.viewer.updateClientAreaForBlock(y,!1);var x=0;if(y.containerWidget instanceof Ys){var w=y.getSplitWidgets(),F=w[w.length-1];x=F.containerWidget.page.index}this.documentHelper.editorProperties.isDocumentLoaded&&y.nextRenderedWidget&&this.updateWholeListItems(y.nextRenderedWidget),this.layoutNextItemsBlock(y,this.viewer,void 0,m!==x)}else this.isReplacingAll||this.reLayoutTable(e)}else this.isReplacingAll||this.reLayoutTable(e);if(this.isFootnoteContentChanged&&!t.isNullOrUndefined(e.bodyWidget)&&!t.isNullOrUndefined(e.bodyWidget.page.footnoteWidget)){var C=e.bodyWidget.page.footnoteWidget;this.layoutfootNote(C)}this.isBidiReLayout=!1}else this.reLayoutLine(e,i,n,o,void 0,r);e.bodyWidget instanceof Xs&&-1!==e.bodyWidget.headerFooterType.indexOf("Footer")&&this.shiftFooterChildLocation(e.bodyWidget,this.viewer),this.normalizeBookmarkEndForParagraph(e)}},i.prototype.getParentRow=function(e){return this.getParentCell(e).ownerRow},i.prototype.getParentCell=function(e){for(var t=e;null!==t.ownerTable&&t.ownerTable.isInsideTable;)t=t.ownerTable.associatedCell;return t},i.prototype.reLayoutRow=function(e){e instanceof Qs&&(e=e.associatedCell);var i=this.getParentRow(e).getSplitWidgets()[0];if(t.isNullOrUndefined(i)||i.ownerTable.tableFormat.allowAutoFit)this.currentCell=e,this.reLayoutTable(e),this.currentCell=void 0;else{for(var r=i.ownerTable.getSplitWidgets()[0].combineWidget(this.viewer),n=i;this.isVerticalMergedCellContinue(n);){var o=n.previousWidget;if(t.isNullOrUndefined(o))break;n=o}var a=r.containerWidget;this.viewer instanceof Ms&&(a.height-=r.height),!this.documentHelper.editorProperties.enableHeaderAndFooter&&!e.isInHeaderFooter||a instanceof Ol?a instanceof Ol?this.viewer.updateClientAreaForTextBoxShape(a.containerShape,!0):this.viewer.updateClientArea(a,a.page):(e.bodyWidget.isEmpty=!1,a.height-=r.height,this.viewer.updateHeaderFooterClientAreaWithTop(r.bodyWidget.sectionFormat,this.documentHelper.isBlockInHeader(r),a.page));var s=new zs(this.viewer.clientArea.x,this.viewer.clientArea.y,this.viewer.clientArea.width,this.viewer.clientArea.height),l=new zs(s.x,s.y,s.width,s.height);if(this.documentHelper.editorProperties.isDocumentLoaded){var d=this.documentHelper.getFirstParagraphInFirstCell(r);this.updateWholeListItems(d)}this.viewer.updateClientAreaForBlock(r,!0),this.viewer.cutFromTop(n.y),this.viewer.clientActiveArea.height=Number.POSITIVE_INFINITY,r.height=0;do{if(this.clearRowWidget(i,!0,!0,!0),this.layoutRow([r],i,!0),n===i)break;n=n.nextRow}while(n&&n!==i);this.updateChildLocationForTable(r.y,r),this.viewer.clientArea=l,this.viewer.clientActiveArea=new zs(l.x,l.y,l.width,l.height),this.viewer.updateClientAreaForBlock(r,!0),r.x-=r.leftBorderWidth,r.y-=r.topBorderWidth,this.viewer.cutFromTop(r.y),this.shiftTableWidget(r,this.viewer,!0),this.layoutNextItemsBlock(r,this.viewer)}},i.prototype.reLayoutTable=function(e,t){if(this.documentHelper.enableLayout){var i=this.getParentTable(e);if(i.header)for(var r=i.getSplitWidgets(),n=1;n<r.length;n++)r[n].bodyWidget.page.repeatHeaderRowTableWidget=!1;var o=0;i.containerWidget instanceof Ys&&(o=(g=(c=i.getSplitWidgets())[c.length-1]).containerWidget.page.index);var a=i.combineWidget(this.viewer),s=a.containerWidget;if(this.viewer instanceof Ms&&(s.height-=a.height),!this.documentHelper.editorProperties.enableHeaderAndFooter&&!e.isInHeaderFooter||s instanceof Ol?s instanceof Ol?(this.viewer.clientActiveArea.y=s.containerShape.y,this.viewer.clientActiveArea.x=s.containerShape.x,this.viewer.updateClientAreaForTextBoxShape(s.containerShape,!0)):this.viewer.updateClientArea(s,s.page):(e.bodyWidget.isEmpty=!1,s.height-=a.height,this.viewer.updateHeaderFooterClientAreaWithTop(i.bodyWidget.sectionFormat,this.documentHelper.isBlockInHeader(i),s.page)),this.documentHelper.editorProperties.isDocumentLoaded){var l=this.documentHelper.getFirstParagraphInFirstCell(a);this.updateWholeListItems(l)}this.viewer.updateClientAreaForBlock(a,!0),a.x-=a.leftBorderWidth,a.y-=a.topBorderWidth;var d=this.getYPosition(a);this.viewer.cutFromTop(d),this.clearTableWidget(a,!0,!0,!0,!0),this.isBidiReLayout=!0,this.isRelayout=!0,this.layoutBlock(a,0),this.isRelayout=!1,this.viewer.updateClientAreaForBlock(a,!1);var h=0;if(a.containerWidget instanceof Ys){var c=a.getSplitWidgets(),g=c[c.length-1];h=g.containerWidget.page.index}this.layoutNextItemsBlock(a,this.viewer,t,o!==h)}},i.prototype.getYPosition=function(e){if(e.wrapTextAround){for(var t=e.previousWidget;t;){if(t.y>e.y)return e.y;if(t instanceof Qs)return t.y+t.height;if(t instanceof el){if(!t.wrapTextAround)return t.y+t.height;t=t.previousWidget}}return this.viewer.clientActiveArea.y}return e.y},i.prototype.clearFootnoteReference=function(e,t){if(e.footnoteElement&&e.footnoteElement.length>0){for(var i=e.bodyWidget.page,r=e.footnoteElement.length-1;r>=0;r--){var n=e.footnoteElement[r];n.isLayout=!1;var o=n.bodyWidget.containerWidget;if(o&&-1!==o.bodyWidgets.indexOf(n.bodyWidget)){var a=this.getFootNoteHeight(n.bodyWidget);o.height-=a,o.bodyWidgets.splice(n.bodyWidget.indexInOwner,1),t&&o.page===i&&(this.viewer.clientActiveArea.height+=a,this.viewer.clientArea.height+=a)}o&&0===o.bodyWidgets.length&&o.page&&(o.page.footnoteWidget=void 0),n.bodyWidget.containerWidget=void 0}e.footnoteElement=[]}},i.prototype.clearTableWidget=function(e,t,i,r,n,o){e.height=0,this.isLayoutSwitch&&(e.width=0),r&&(e.isGridUpdated=!1),t&&(e.y=0,e.x=0,e.footnoteElement&&e.footnoteElement.length>0&&this.clearFootnoteReference(e,n)),e.leftBorderWidth=0,e.rightBorderWidth=0,e.topBorderWidth=0,e.bottomBorderWidth=0;for(var a=0;a<e.childWidgets.length;a++){var s=e.childWidgets[a];this.clearRowWidget(s,t,i,r,o)}},i.prototype.clearRowWidget=function(e,t,i,r,n){e.height=0,this.isLayoutSwitch&&(e.width=0),t&&(e.y=0,e.x=0),e.topBorderWidth=0,e.bottomBorderWidth=0;for(var o=0;o<e.childWidgets.length;o++){var a=e.childWidgets[o];this.clearCellWidget(a,t,i,r,n)}},i.prototype.clearCellWidget=function(e,t,i,r,n){e.height=0,this.isLayoutSwitch&&(e.width=0),t&&(e.y=0,e.x=0),e.leftBorderWidth=0,e.rightBorderWidth=0,this.clearBlockWidget(e.childWidgets,t,i,r,n)},i.prototype.clearBlockWidget=function(e,t,i,r,n){for(var o=0;o<e.length;o++){var a=e[o];a instanceof Qs?(t&&!n&&(a.y=0,a.x=0),i&&!n&&(a.height=0)):this.clearTableWidget(a,t,i,r,void 0,n)}},i.prototype.layoutBodyWidgetCollection=function(e,i,r,n,o,a){if(t.isNullOrUndefined(r)||!r.isFieldCodeBlock){if(!t.isNullOrUndefined(this.documentHelper)&&this.documentHelper.isLayoutEnabled){if(this.documentHelper.isEditorModule&&this.documentHelper.editorProperties.restrictLayout||!this.documentHelper.enableLayout)return;if(i instanceof Ks||i instanceof Ol){var s=this.checkAndGetBlock(i,e);if(i instanceof Ys&&t.isNullOrUndefined(s)&&!t.isNullOrUndefined(i.nextRenderedWidget)&&"NoBreak"===i.nextRenderedWidget.sectionFormat.breakCode&&(s=i.nextRenderedWidget.firstChild,i=i.nextRenderedWidget),t.isNullOrUndefined(s))return;if(this.viewer instanceof Ms&&(s.containerWidget.height-=s.height),i instanceof Xs)i.isEmpty=!1,this.viewer.updateHeaderFooterClientAreaWithTop(i.sectionFormat,-1!==i.headerFooterType.indexOf("Header"),i.page),s.containerWidget.height-=s.height;else if(i instanceof Ol)this.viewer.updateClientAreaForTextBoxShape(i.containerShape,!0,!n);else if(!t.isNullOrUndefined(i.containerWidget)&&i.containerWidget instanceof Zs){if(this.viewer.updateClientArea(i,i.page,!0),"Footnote"!==i.containerWidget.footNoteType)return this.viewer.cutFromTop(i.containerWidget.y),void this.layoutfootNote(i.containerWidget);this.isRelayoutFootnote=!0,this.viewer.clientArea.height=Number.POSITIVE_INFINITY,this.viewer.clientActiveArea.height=Number.POSITIVE_INFINITY,this.viewer.clientActiveArea.y=s.containerWidget.containerWidget.y}else t.isNullOrUndefined(i.page.footnoteWidget)?this.viewer.updateClientArea(i,i.page,!0):(i.page.footnoteWidget.footNoteType,this.viewer.updateClientArea(i,i.page,!0));var l=0,d=0;if(s.containerWidget instanceof Ys&&(l=(P=(C=s.getSplitWidgets())[C.length-1]).containerWidget.page.index),e>0||"NoBreak"===s.bodyWidget.sectionFormat.breakCode&&0!==s.bodyWidget.index&&s===i.firstChild){var h=s.nextSplitWidget;if(!t.isNullOrUndefined(h)){var c=h.containerWidget,g=this.getFootNoteWidgetsOf(h);g&&g.length>0&&this.moveFootNotesToPage(g,c,s.containerWidget)}var p=(s=s.combineWidget(this.viewer)).getSplitWidgets()[0].previousRenderedWidget;for(!t.isNullOrUndefined(p)&&p.wrapTextAround&&!t.isNullOrUndefined(p.getSplitWidgets()[0].previousRenderedWidget)&&p.bodyWidget.index===p.getSplitWidgets()[0].previousRenderedWidget.bodyWidget.index&&p.bodyWidget.page.index===p.getSplitWidgets()[0].previousRenderedWidget.bodyWidget.page.index&&p.y<p.getSplitWidgets()[0].previousRenderedWidget.y&&(p=p.getSplitWidgets()[0].previousRenderedWidget);p instanceof Js&&p.isFieldCodeBlock;)p=p.getSplitWidgets()[0].previousRenderedWidget;if(!(t.isNullOrUndefined(p)||p instanceof Qs)||p instanceof Qs&&!p.isEndsWithPageBreak&&!p.isEndsWithColumnBreak)if(o||s.containerWidget===p.containerWidget){if(p instanceof Qs&&p.height<=0&&this.isMultiColumnDoc){var u=p;this.viewer.updateClientAreaForBlock(u,!0),this.layoutParagraph(u,0),this.viewer.updateClientArea(u.bodyWidget,u.bodyWidget.page,!0)}this.viewer.cutFromTop(p.y+p.height)}else{var f=s.containerWidget,m=p.containerWidget,y=this.getFootNoteWidgetsOf(s);if(this.moveFootNotesToPage(y,f,m),"NoBreak"!==s.bodyWidget.sectionFormat.breakCode||s.bodyWidget.index===p.bodyWidget.index)this.viewer.updateClientArea(p.bodyWidget,p.bodyWidget.page,!0),this.viewer.cutFromTop(p.y+p.height),this.updateContainerWidget(s,m,p.indexInOwner+1,!1);else if(s.bodyWidget.sectionIndex!==p.bodyWidget.sectionIndex&&p.bodyWidget.sectionFormat.numberOfColumns>1&&s.bodyWidget.page===p.bodyWidget.page){var v=this.getBodyWidget(p.bodyWidget,!0),W=this.getNextWidgetHeight(v);this.viewer.clientActiveArea.height-=W-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=W,this.viewer.clientArea.y=this.viewer.clientActiveArea.y,this.viewer.clientArea.height=this.viewer.clientActiveArea.height}else this.viewer.updateClientArea(s.bodyWidget,s.bodyWidget.page,!0),this.viewer.cutFromTop(p.y+p.height)}else p instanceof Qs&&(p.isEndsWithPageBreak||p.isEndsWithColumnBreak)&&p.containerWidget===s.containerWidget&&this.moveBlocksToNextPage(p,!1)}var b=void 0;(s=s.combineWidget(this.viewer))instanceof el?(this.clearTableWidget(s,!0,!0),s.isGridUpdated=!1,b=this.documentHelper.getFirstParagraphInFirstCell(s)):b=s,this.documentHelper.editorProperties.isDocumentLoaded&&this.updateWholeListItems(b),this.viewer.updateClientAreaForBlock(s,!0,void 0,!1,!0),this.isRelayout=!0,this.documentHelper.layout.layoutBlock(s,0),this.isRelayout=!1,this.viewer.updateClientAreaForBlock(s,!1),!t.isNullOrUndefined(i.containerWidget)&&i.containerWidget instanceof Zs&&"Footnote"===i.containerWidget.footNoteType&&this.layoutfootNote(i.containerWidget);var x=i;if(t.isNullOrUndefined(i.containerWidget)&&!(i instanceof Ol)&&!t.isNullOrUndefined(x.page)){y=this.getFootNoteWidgetsOf(s);if(t.isNullOrUndefined(x.page.footnoteWidget)||"Footnote"!==x.page.footnoteWidget.footNoteType){if(y.length>0){var w=s.getSplitWidgets(),F=w[w.length-1].nextRenderedWidget;this.moveFootNotesToPage(y,F.containerWidget,s.bodyWidget)}}else this.layoutfootNote(x.page.footnoteWidget),this.layoutfootNote(x.page.footnoteWidget)}if(s.containerWidget instanceof Ys){var C=s.getSplitWidgets(),P=C[C.length-1];d=P.containerWidget.page.index}n?this.shiftNextWidgets(s):this.layoutNextItemsBlock(s,this.viewer,void 0,l!==d)}else i instanceof il&&!a&&this.reLayoutTable(i.ownerTable)}this.isRelayoutFootnote=!1}},i.prototype.checkAndGetBlock=function(e,t){if(e instanceof Ol)return e.childWidgets[t];var i=e.indexInOwner;if(e.page.bodyWidgets.length<=1)for(;e&&e.indexInOwner===i;){if(e.childWidgets.length>0&&e.firstChild.index<=t&&e.lastChild.index>=t)for(r=0;r<e.childWidgets.length;r++)if((n=e.childWidgets[r]).index===t)return n;if(!(e instanceof Ys))break;e=e.nextRenderedWidget}else for(;e;){if(e.childWidgets.length>0)for(var r=0;r<e.childWidgets.length;r++){var n=e.childWidgets[r];if(n.index===t)return n}if(!(e instanceof Ys))break;e=e.nextRenderedWidget}},i.prototype.layoutTable=function(e,i,r){var n=this;if(e.tableFormat.borders=e.tableFormat.isRTFTable?e.firstChild.rowFormat.borders:e.tableFormat.borders,this.isFieldCode&&!this.checkTableHasField(e)&&!this.isRelayout)return e.isFieldCodeBlock=!0,e;!t.isNullOrUndefined(e.previousWidget)&&this.viewer.clientActiveArea.height<0&&!e.wrapTextAround&&this.moveBlocksToNextPage(e.previousWidget,!1),e.isBidiTable=e.bidi,e.isGridUpdated||(e.buildTableColumns(),e.isGridUpdated=!0),"Word2013"===this.documentHelper.compatibilityMode||e.isInsideTable||t.isNullOrUndefined(e.firstChild.firstChild.leftMargin)||(this.viewer.clientActiveArea.x=this.viewer.clientActiveArea.x-bs.convertPointToPixel(e.firstChild.firstChild.leftMargin));var o=[e];this.addTableWidget(this.viewer.clientActiveArea,o),this.viewer.updateClientAreaTopOrLeft(e,!0);var a,s,l=0;if(e.wrapTextAround?(a=this.viewer.clientActiveArea.clone(),s=this.viewer.clientArea.clone(),this.updateClientAreaForWrapTable(o,e,!0,a,s)):e.containerWidget instanceof Ol||(this.adjustClientAreaBasedOnTextWrapForTable(e,this.viewer.clientActiveArea),this.isWrapText&&(l=this.viewer.clientActiveArea.x-this.viewer.clientArea.x,this.isWrapText=!1,e.x=this.viewer.clientActiveArea.x)),e.childWidgets.length>0){var d=e.childWidgets[0].rowFormat.isHeader;e.header=d,e.continueHeader=d,e.headerHeight=0}var h=e.childWidgets[i];this.updateFootnoteHeight(e,!0);var c=function(){return n.updateFootnoteHeight(e,!1),n.documentHelper.viewer instanceof Es&&e.wrapTextAround&&("Bottom"===e.positioning.verticalAlignment||"Center"===e.positioning.verticalAlignment||"Outside"===e.positioning.verticalAlignment)&&(n.updateTableFloatPoints(e),n.updateChildLocationForTable(e.y,e)),n.updateWidgetsToPage(o,[],e,!0),l>0&&(n.viewer.clientArea.x-=l),e.wrapTextAround&&n.updateClientAreaForWrapTable(o,e,!1,a,s),o[o.length-1].isLayouted=!0,o[o.length-1].isFieldCodeBlock=!1,"Word2013"===n.documentHelper.compatibilityMode||e.isInsideTable||e.wrapTextAround||t.isNullOrUndefined(e.firstChild.firstChild.leftMargin)||(n.viewer.clientArea.x+=bs.convertPointToPixel(e.firstChild.firstChild.leftMargin)),o[o.length-1]},g=function(){h=n.layoutRow(o,h),h=h.nextRow};if(r)return new Promise(function(i){var r=function(){if(t.isNullOrUndefined(h))return void i(c());if(g(),n.shouldScrollUpdateIn()){var o=void 0;e.bodyWidget instanceof Ys&&(o=e.bodyWidget.getSplitWidgets()[0]),n.documentHelper.hooks.onProcessAsyncPageUpdate&&n.documentHelper.hooks.onProcessAsyncPageUpdate(o),n.documentHelper.isUpdatedWhileLoadAsync||(n.documentHelper.hooks.onPerformUpdateAfterLoad&&n.documentHelper.hooks.onPerformUpdateAfterLoad(!0),n.documentHelper.isUpdatedWhileLoadAsync=!0);var a=setTimeout(r,0);n.documentHelper.currentDocumentLoadId&&n.documentHelper.storeTimeoutId(n.documentHelper.currentDocumentLoadId,a)}else r()};r()});for(;h;)g();return c()},i.prototype.isFloatTableSplitOnPageThatFits=function(e){if(!e.wrapTextAround||e.isInsideTable||t.isNullOrUndefined(e.previousWidget)||!(e.containerWidget instanceof Ys)||!(this.viewer instanceof Es))return!1;var i=e.getSplitWidgets();if(i.length<2)return!1;for(var r=0,n=!1,o=0;o<i.length;o++){r+=i[o].height;for(var a=o+1;a<i.length;a++)i[o].containerWidget===i[a].containerWidget&&(n=!0)}return n&&r<=this.viewer.clientArea.height},i.prototype.layoutFloatTableOnNextPage=function(e){var t=e.previousWidget,i=e.combineWidget(this.viewer),r=i.containerWidget,n=r.childWidgets.indexOf(i);-1!==n&&r.childWidgets.splice(n,1);var o=r.floatingElements.indexOf(i);-1!==o&&r.floatingElements.splice(o,1);var a=r.childWidgets.indexOf(t);return r.childWidgets.splice(a+1,0,i),i.containerWidget=r,this.viewer.updateClientArea(r,r.page),t.y=this.viewer.clientActiveArea.y,this.clearTableWidget(i,!0,!0,!0),this.layoutStartEndBlocks(t,i),i.isLayouted||(this.viewer.updateClientAreaForBlock(i,!0),this.layoutTable(i,0),this.viewer.updateClientAreaForBlock(i,!1)),i.getSplitWidgets().pop()},i.prototype.updateFootnoteHeight=function(e,i,r){if((!this.isInitialLoad||r)&&!e.isInsideTable&&!t.isNullOrUndefined(e.bodyWidget)&&!t.isNullOrUndefined(e.bodyWidget.page.footnoteWidget)&&"Footnote"===e.bodyWidget.page.footnoteWidget.footNoteType){var n=e.bodyWidget.page,o=n.bodyWidgets[0],a=bs.convertPointToPixel(o.sectionFormat.pageHeight),s=bs.convertPointToPixel(o.sectionFormat.topMargin),l=bs.convertPointToPixel(o.sectionFormat.bottomMargin),d=.667+l,h=!1,c=48,g=48;if(t.isNullOrUndefined(o.sectionFormat)||(s=bs.convertPointToPixel(o.sectionFormat.topMargin),c=bs.convertPointToPixel(o.sectionFormat.headerDistance),g=bs.convertPointToPixel(o.sectionFormat.footerDistance)),t.isNullOrUndefined(n.headerWidget)||(h=n.headerWidget.isEmpty,s>=0?(!h||h&&this.documentHelper.editorProperties.enableHeaderAndFooter)&&(s=Math.min(Math.max(c+n.headerWidget.height,s),a/100*40)):s=Math.abs(s)),!t.isNullOrUndefined(n.footerWidget)){h=n.footerWidget.isEmpty;p=t.isNullOrUndefined(n.footnoteWidget)?0:n.footnoteWidget.height;p=Math.min(p,(a-s-d)/100*90),d>=0?(!h||h&&this.documentHelper.editorProperties.enableHeaderAndFooter)&&(d=.667+Math.min(a/100*40,Math.max(g+n.footerWidget.height,l))):d=Math.abs(d),r||(d+=p)}if(!t.isNullOrUndefined(n.footnoteWidget)){var p=t.isNullOrUndefined(n.footnoteWidget)?0:n.footnoteWidget.height,u=a-s-d;if(r)return u+this.viewer.clientArea.y;i&&u===this.viewer.clientArea.height?this.viewer.clientArea.height+=p:u+p===this.viewer.clientArea.height&&(this.viewer.clientArea.height-=p)}}return 0},i.prototype.updateClientAreaForWrapTable=function(e,i,r,n,o){if(r){if(i.wrapTextAround){this.updateTableFloatPoints(i);var a=this.viewer.clientActiveArea.clone(),s=this.adjustClientAreaBasedOnTextWrapForTable(i,this.viewer.clientActiveArea);a.x!==s.x&&(i.x=this.viewer.clientActiveArea.x),a.y!==s.y&&(i.y=this.viewer.clientActiveArea.y)}}else if(i.wrapTextAround&&i.bodyWidget)if(1==e.length){if(!t.isNullOrUndefined(i.previousRenderedWidget)&&i.previousRenderedWidget.bodyWidget.page===i.bodyWidget.page||i.isInHeaderFooter||i.isInsideTable){var l=n.clone(),d=o.clone();if(i.bodyWidget.lastChild!==e[e.length-1]&&(this.viewer.clientActiveArea=l,this.viewer.clientArea=d),!i.isLayouted&&l.height<i.height&&i.width>=l.width){var h=this.moveBlocksToNextPage(i,!1),c=i;c.containerWidget&&-1!==c.containerWidget.childWidgets.indexOf(c)&&c.containerWidget.childWidgets.splice(c.containerWidget.childWidgets.indexOf(c),1),-1!==h.childWidgets.indexOf(c)&&h.childWidgets.splice(h.childWidgets.indexOf(c),1),h.childWidgets.unshift(c),this.shiftFloatingItemsFromTable(c,h),c.containerWidget=h}}else this.documentHelper.tableLefts.pop(),this.viewer.updateClientArea(i.bodyWidget,i.bodyWidget.page);-1===i.bodyWidget.floatingElements.indexOf(i)&&i.bodyWidget.floatingElements.push(i)}else{if(!t.isNullOrUndefined(i.previousWidget)&&!i.isLayouted&&n.height<i.height&&i.width>=n.width){var g=i;do{this.moveBlocksToNextPage(g.previousWidget,!1),g=g.nextSplitWidget}while(g)}this.documentHelper.tableLefts.pop(),this.viewer.updateClientArea(i.bodyWidget,i.bodyWidget.page);for(var p=0;p<e.length;p++){h=e[p].bodyWidget;t.isNullOrUndefined(h)||-1!==h.floatingElements.indexOf(e[p])||h.floatingElements.push(e[p])}var u=e[e.length-1];this.viewer.cutFromTop(this.viewer.clientActiveArea.y+u.height+u.tableFormat.borders.bottom.lineWidth)}},i.prototype.addTableWidget=function(e,t,i){var r=t[t.length-1];return i&&(r=this.createTableWidget(r),t.push(r)),r.width=e.width,r.x=e.x,r.y=e.y,r.tableFormat.cellSpacing>0&&(r.height=r.height+bs.convertPointToPixel(r.tableFormat.cellSpacing),r.isBidiTable?(r.leftBorderWidth=bs.convertPointToPixel(this.getTableRightBorder(r.tableFormat.borders).getLineWidth()),r.rightBorderWidth=bs.convertPointToPixel(this.getTableLeftBorder(r.tableFormat.borders).getLineWidth())):(r.leftBorderWidth=bs.convertPointToPixel(this.getTableLeftBorder(r.tableFormat.borders).getLineWidth()),r.rightBorderWidth=bs.convertPointToPixel(this.getTableRightBorder(r.tableFormat.borders).getLineWidth())),r.topBorderWidth=bs.convertPointToPixel(this.getTableTopBorder(r.tableFormat.borders).getLineWidth()),r.bottomBorderWidth=bs.convertPointToPixel(this.getTableBottomBorder(r.tableFormat.borders).getLineWidth()),r.x+=r.leftBorderWidth,r.y+=r.topBorderWidth,r.width-=r.leftBorderWidth,r.width-=r.rightBorderWidth,r.height+=r.bottomBorderWidth),r},i.prototype.updateWidgetsToPage=function(e,t,i,r,n){var o=this.viewer,a=e[e.length-1];if(!i.isInsideTable){for(s=0;s<e.length;s++)this.updateHeightForTableWidget(e,t,e[s],n);a.childWidgets.length>0&&a.y!==a.childWidgets[0].y&&(a.y=a.childWidgets[0].y)}if(i.isBidiTable&&r)for(var s=0;s<e.length;s++)for(var l=e[s],d=0;d<l.childWidgets.length;d++)l.childWidgets[d].shiftWidgetForRtlTable();if(i.tableFormat.cellSpacing>0&&(a.y+a.height+bs.convertPointToPixel(i.tableFormat.cellSpacing)>o.clientArea.bottom&&o instanceof Ms&&(a.height=a.height-bs.convertPointToPixel(i.tableFormat.cellSpacing)/2),o.cutFromTop(a.y+a.height)),this.viewer instanceof Ms&&(i.containerWidget.height+=i.height),i.bodyWidget instanceof Xs&&!i.wrapTextAround){var h=i.containerWidget;if(h&&h instanceof Xs&&this.documentHelper&&"Word2003"===this.documentHelper.compatibilityMode){var c=i.containerWidget,g=.5*(c&&c.page?c.page.boundingRectangle.height:c.height);c.height+i.height<=g&&!this.skip2003||i.containerWidget.firstChild===i?(c.height+=i.height,i.isRender=!0):(this.viewer.clientActiveArea.y-=i.height,this.skip2003=!0,i.isRender=!1,this.istableYpositionChange&&(this.viewer.clientActiveArea.y=this.textWrappingBottom,this.istableYpositionChange=!1))}else i.containerWidget.height+=i.height;this.documentHelper.editorProperties.enableHeaderAndFooter&&-1!==i.bodyWidget.headerFooterType.indexOf("Footer")&&(this.skip2003=!1,this.shiftFooterChildLocation(i.bodyWidget,this.viewer))}},i.prototype.updateHeightForTableWidget=function(e,t,i,r){for(var n=0;n<i.childWidgets.length;n++){var o=i.childWidgets[n];if(o===r)break;this.updateHeightForRowWidget(this.viewer,!0,e,t,o,!1,r)}},i.prototype.layoutRow=function(e,t,i){var r=t.ownerTable.isInsideTable;r||this.updateExistingFootnoteHeight(t);var n=this.viewer,o=[t];this.addTableRowWidget(n.clientActiveArea,o),n.updateClientAreaForRow(t,!0);for(var a=this.getMaxTopCellMargin(t),s=this.getMaxBottomCellMargin(t),l=0;l<t.childWidgets.length;l++){var d=t.childWidgets[l];this.layoutCell(d,a+t.topBorderWidth,s+t.bottomBorderWidth)}n.updateClientAreaForRow(t,!1);var h=[t];return i||this.updateWidgetsToTable(e,h,t,!1),r||(this.layoutedFootnoteElement=[]),h[h.length-1]},i.prototype.updateExistingFootnoteHeight=function(e){this.layoutedFootnoteElement=[],t.isNullOrUndefined(e.bodyWidget.page.footnoteWidget)||0===e.bodyWidget.page.footnoteWidget.bodyWidgets.length?this.existFootnoteHeight=0:this.existFootnoteHeight=e.bodyWidget.page.footnoteWidget.height},i.prototype.isIntersecting=function(e,t,i,r){return(bs.round(i,2)<=bs.round(e,2)||bs.round(i,2)<bs.round(t,2))&&bs.round(r,2)>bs.round(e,2)},i.prototype.getAdjacentRowCell=function(e,i,r,n){var o=[],a=e.ownerTable.tableHolder.columns.length,s=e.ownerTable.childWidgets[n];if(t.isNullOrUndefined(s))return o;var l=0,d=0,h=e.cellFormat.columnSpan,c=e.columnIndex;if(s.rowFormat.gridBefore>0){if(s.rowFormat.gridBefore>c+h)return o;l=s.rowFormat.beforeWidth,d=s.rowFormat.gridBefore}for(var g=0;g<s.childWidgets.length;g++){var p=s.childWidgets[g],u=p.x-p.margin.left,f=p.x+p.width+p.margin.right,m=p.columnIndex+p.cellFormat.columnSpan;if(g==s.childWidgets.length-1||bs.round(u,2)>bs.round(l,2)&&bs.round(u,2)>bs.round(i,2)){if(g==s.childWidgets.length-1&&s.rowFormat.gridAfter>0&&m+s.rowFormat.gridAfter===a)return o;if(this.isIntersecting(i,r,l,u))for(;h>0;){var y=s.getVerticalMergeStartCell(c,h),v=0;if(t.isNullOrUndefined(y))break;var W=y.cellFormat.columnSpan;if(o.push(y),v=y.x+y.width+y.margin.right,i=v,d=y.columnIndex+W,h-=d-c,c=d,bs.round(v,2)>=bs.round(r,2))break}}if(this.isIntersecting(i,r,u,f)&&(o.push(p),i=f,h-=m-c,c=m),bs.round(f,2)>=bs.round(r,2))break;l=f,d=m}return o},i.prototype.addTableRowWidget=function(e,i){var r=i[i.length-1];0===r.rowFormat.beforeWidth&&0===r.rowFormat.gridBeforeWidth||this.documentHelper.alignTablesRowByRow&&"Left"!==r.ownerTable.tableFormat.tableAlignment?r.x=e.x:r.x+=0!==r.rowFormat.beforeWidth?r.rowFormat.beforeWidth:r.rowFormat.gridBeforeWidth,r.y=e.y,r.width=e.width;var n=0;if(!t.isNullOrUndefined(r.ownerTable)&&!t.isNullOrUndefined(r.ownerTable.tableFormat)&&r.ownerTable.tableFormat.cellSpacing>0){r.height=r.height>0?r.height:r.height+bs.convertPointToPixel(r.ownerTable.tableFormat.cellSpacing);for(var o=0;o<r.childWidgets.length;o++)if(!t.isNullOrUndefined(r.childWidgets[o].cellFormat)&&!t.isNullOrUndefined(r.childWidgets[o].cellFormat.borders)){var a=il.getCellBottomBorder(r.childWidgets[o]).getLineWidth();a>n&&(n=a)}if(r.bottomBorderWidth=bs.convertPointToPixel(n),r.index>0&&!t.isNullOrUndefined(r.previousWidget)){var s=r.previousWidget;n=0;for(h=0;h<s.childWidgets.length;h++)if(!t.isNullOrUndefined(s.childWidgets[h].cellFormat)&&!t.isNullOrUndefined(s.childWidgets[h].cellFormat.borders)){var l=il.getCellBottomBorder(s.childWidgets[h]).getLineWidth();l>n&&(n=l)}r.topBorderWidth=bs.convertPointToPixel(n)}}if(!t.isNullOrUndefined(r.childWidgets))for(h=0;h<r.childWidgets.length;h++)if(!t.isNullOrUndefined(r.childWidgets[h].cellFormat)&&!t.isNullOrUndefined(r.childWidgets[h].cellFormat.borders)){var d=il.getCellTopBorder(r.childWidgets[h]).getLineWidth();d>n&&(n=d)}if(r.topBorderWidth=bs.convertPointToPixel(n),!t.isNullOrUndefined(r.ownerTable)&&!t.isNullOrUndefined(r.ownerTable.tableFormat)&&r.ownerTable.tableFormat.cellSpacing<=0&&r.rowIndex===r.ownerTable.childWidgets.length-1){for(var h=0;h<r.childWidgets.length;h++)if(!t.isNullOrUndefined(r.childWidgets[h].cellFormat)&&!t.isNullOrUndefined(r.childWidgets[h].cellFormat.borders)){var c=il.getCellBottomBorder(r.childWidgets[h]).getLineWidth();c>n&&(n=c)}r.bottomBorderWidth=bs.convertPointToPixel(n)}return r},i.prototype.getMaxTopCellMargin=function(e){if(t.isNullOrUndefined(e.childWidgets))return 0;for(var i=0,r=0;r<e.childWidgets.length;r++){var n=e.childWidgets[r],o=0;(o=n.cellFormat.hasValue("topMargin")?bs.convertPointToPixel(n.cellFormat.topMargin):e.rowFormat.hasValue("topMargin")?bs.convertPointToPixel(e.rowFormat.topMargin):bs.convertPointToPixel(e.ownerTable.tableFormat.topMargin))>i&&(i=o)}return e.rowFormat.hasValue("verticallyMergedCellsTopMargin")&&(i=Math.max(i,bs.convertPointToPixel(e.rowFormat.verticallyMergedCellsTopMargin))),i},i.prototype.getMaxBottomCellMargin=function(e){if(t.isNullOrUndefined(e.childWidgets))return 0;for(var i=0,r=0;r<e.childWidgets.length;r++){var n=e.childWidgets[r],o=0;(o=n.cellFormat.hasValue("bottomMargin")?bs.convertPointToPixel(n.cellFormat.bottomMargin):e.rowFormat.hasValue("bottomMargin")?bs.convertPointToPixel(e.rowFormat.bottomMargin):bs.convertPointToPixel(e.ownerTable.tableFormat.bottomMargin))>i&&(i=o)}return e.rowFormat.hasValue("verticallyMergedCellsBottomMargin")&&(i=Math.max(i,bs.convertPointToPixel(e.rowFormat.verticallyMergedCellsBottomMargin))),i},i.prototype.layoutCell=function(e,t,i){var r=this.viewer;if(this.addTableCellWidget(e,r.clientActiveArea,t,i),this.updateTopBorders(e),r.updateClientAreaForCell(e,!0),0===e.childWidgets.length){var n=new Qs;n.characterFormat=new S(void 0,this.documentHelper),n.paragraphFormat=new Ls,n.index=0;var o=new rl(n);n.childWidgets.push(o),e.childWidgets.push(n),n.paragraphFormat.borders=new Us}for(var a=0;a<e.childWidgets.length;a++){var s=e.childWidgets[a];r.updateClientAreaForBlock(s,!0),s.containerWidget=e,this.layoutBlock(s,0),r.updateClientAreaForBlock(s,!1)}this.updateWidgetToRow(e),r.updateClientAreaForCell(e,!1)},i.prototype.isInsertTable=function(){return"InsertTable"===this.owner.editorProperties.action},i.prototype.updateTopBorders=function(e){if(e.updatedTopBorders=[],0===e.ownerTable.tableFormat.cellSpacing){var t=e.cellFormat.borders.top;(!t.isBorderDefined||t.isBorderDefined&&"None"===t.lineStyle&&0===t.lineWidth&&t.hasValue("color"))&&(t=e.ownerRow.rowFormat.borders.horizontal),t.isBorderDefined||(t=e.ownerRow.ownerTable.tableFormat.borders.horizontal);for(var i=e.x-e.margin.left,r=e.x+e.width+e.margin.right,n=this.getAdjacentRowCell(e,i,r,e.ownerRow.indexInOwner-1),o=0;o<n.length;o++){var a=n[o],s=a.cellFormat.borders.bottom;(!s.isBorderDefined||s.isBorderDefined&&"None"===s.lineStyle&&0===s.lineWidth&&s.hasValue("color"))&&(s=a.ownerRow.rowFormat.borders.horizontal),s.isBorderDefined||(s=a.ownerRow.ownerTable.tableFormat.borders.horizontal);var l=void 0;l="None"===t.lineStyle||"Cleared"===t.lineStyle?s:"Cleared"===s.lineStyle||"None"===s.lineStyle?t:e.getBorderBasedOnPriority(t,s);var d=a.x-a.margin.left,h=a.x+a.width+a.margin.right;if(0===o&&i<d&&e.updatedTopBorders.push({border:t,width:d-i}),l){var c=0;(c=bs.round(h,2)===bs.round(r,2)&&bs.round(d,2)===bs.round(i,2)?r-i:bs.round(d,2)>=bs.round(i,2)&&bs.round(h,2)>=bs.round(r,2)?r-d:bs.round(d,2)>=bs.round(i,2)&&bs.round(h,2)<=bs.round(r,2)?h-d:bs.round(d,2)<=bs.round(i,2)&&bs.round(h,2)<=bs.round(r,2)?h-i:(bs.round(d,2)<=bs.round(i,2)&&(bs.round(h,2),bs.round(r,2)),r-i))<0&&(c=0),e.updatedTopBorders.push({border:l,width:c})}o===n.length-1&&r>h&&e.updatedTopBorders.push({border:t,width:r-h})}}},i.prototype.isMultiColumnStartUnchanged=function(e,i){var r=i.bodyWidget,n=e.getSplitWidgets(),o=n[n.length-1];return this.viewer instanceof Es&&r.sectionFormat.columns.length>1&&0===r.columnIndex&&i===r.firstChild&&t.isNullOrUndefined(i.previousSplitWidget)&&t.isNullOrUndefined(r.previousSplitWidget)&&o.bodyWidget instanceof Ys&&o.bodyWidget.page===r.page&&bs.round(r.y,2)===bs.round(this.viewer.clientActiveArea.y,2)},i.prototype.shiftLayoutedItems=function(e,i,r){if(t.isNullOrUndefined(this.documentHelper.blockToShift)||t.isNullOrUndefined(this.documentHelper.blockToShift.containerWidget)||this.documentHelper.isEditorModule&&this.documentHelper.editorProperties.restrictLayout||!this.documentHelper.enableLayout)return this.documentHelper.blockToShift=void 0,this.checkAndShiftEndnote(),void(e||this.documentHelper.removeEmptyPages());var n=this.documentHelper.blockToShift,o=this.getColumnBreak(n.bodyWidget);if(!o&&this.viewer instanceof Es&&!this.isMultiColumnSplit&&n===n.bodyWidget.firstChild&&!t.isNullOrUndefined(n.bodyWidget.previousRenderedWidget)&&n.bodyWidget.sectionIndex!==n.bodyWidget.previousRenderedWidget.sectionIndex&&n.bodyWidget.previousRenderedWidget.sectionFormat.columns.length>1){var a=n.bodyWidget.previousRenderedWidget,s=this.getBodyWidget(a,!1);t.isNullOrUndefined(s.nextRenderedWidget)||s.page!==s.nextRenderedWidget.page||this.splitBodyWidgetBasedOnColumn(a)}var l=!1,d=this.documentHelper.pages[this.documentHelper.pages.length-1];d.bodyWidgets[d.bodyWidgets.length-1];if((!o||e&&this.isSectionEndsWithColumnBreak(n.bodyWidget))&&this.viewer instanceof Es&&!this.isMultiColumnSplit&&n.bodyWidget.sectionFormat.columns.length>1){if(0!==n.bodyWidget.columnIndex||n!==n.bodyWidget.firstChild||t.isNullOrUndefined(n.previousRenderedWidget)||n.bodyWidget.page!==n.previousRenderedWidget.bodyWidget.page||(n.bodyWidget.y=this.viewer.clientActiveArea.y),l=n===n.bodyWidget.firstChild,this.reLayoutMultiColumn(n.bodyWidget,l,n.index),t.isNullOrUndefined(this.documentHelper.blockToShift))return void this.documentHelper.hooks.onUpdateScrollBars();n=this.documentHelper.blockToShift}var h=n.bodyWidget.index;this.reLayoutOrShiftWidgets(n,this.viewer,i);for(var c=!0,g=n.getSplitWidgets(),p=g[g.length-1].nextRenderedWidget,u=[],f=[n];p instanceof Js&&(p.bodyWidget.index===h||"NoBreak"===p.bodyWidget.sectionFormat.breakCode&&n.bodyWidget.sectionFormat.pageWidth===p.bodyWidget.sectionFormat.pageWidth&&n.bodyWidget.sectionFormat.pageHeight===p.bodyWidget.sectionFormat.pageHeight)&&-1===f.indexOf(p);){if(f.push(p),i&&0===p.bodyWidget.sectionFormat.columns.length)return;if(o=this.getColumnBreak(p.bodyWidget),!this.isMultiColumnSplit&&!this.documentHelper.editorProperties.isFootnoteElementRemoved&&this.isMultiColumnStartUnchanged(n,p))break;if((!o||e&&this.isSectionEndsWithColumnBreak(p.bodyWidget))&&this.viewer instanceof Es&&!this.isMultiColumnSplit&&p.bodyWidget.sectionFormat.columns.length>1){if(0!==p.bodyWidget.columnIndex||p!==p.bodyWidget.firstChild||t.isNullOrUndefined(p.previousRenderedWidget)||p.bodyWidget.page!==p.previousRenderedWidget.bodyWidget.page||(p.bodyWidget.y=this.viewer.clientActiveArea.y),l=p===p.bodyWidget.firstChild,this.reLayoutMultiColumn(p.bodyWidget,l,p.index),t.isNullOrUndefined(this.documentHelper.blockToShift))return;p=this.documentHelper.blockToShift}var m=void 0,y=n.getSplitWidgets();m=y[y.length-1],c=!1;var v=void 0;y=(n=p).getSplitWidgets(),n instanceof Qs?v=y[0]:n instanceof el&&(v=y[0]);var W=!1;if(v instanceof Qs&&v.isEmpty()&&!v.isInsideTable&&v.previousWidget instanceof Qs&&v.nextRenderedWidget instanceof Js&&v===v.bodyWidget.lastChild&&v.bodyWidget.index!==v.nextRenderedWidget.bodyWidget.index&&v.nextRenderedWidget.bodyWidget.page===v.bodyWidget.page&&(W=!0),!this.documentHelper.editorProperties.isFootnoteElementRemoved&&m.containerWidget===v.containerWidget&&bs.round(v.y,2)===bs.round(this.viewer.clientActiveArea.y,2)&&t.isNullOrUndefined(v.nextWidget)&&!W)break;if(t.isNullOrUndefined(m.floatingElements),c=!0,n.isFieldCodeBlock||this.reLayoutOrShiftWidgets(n,this.viewer,i,u),this.keepWithNext&&(n=this.documentHelper.blockToShift,this.keepWithNext=!1),!this.isMultiColumnSplit&&o&&n.bodyWidget.sectionFormat.numberOfColumns>1&&n.bodyWidget.nextWidget&&n.nextRenderedWidget&&n.bodyWidget.index!==n.nextRenderedWidget.bodyWidget.index){var b=this.viewer.clientActiveArea.y,x=this.viewer.clientActiveArea.height;this.viewer.updateClientArea(n.bodyWidget.nextWidget,n.bodyWidget.nextWidget.page),this.viewer.clientActiveArea.height=x,this.viewer.clientActiveArea.y=b}if(this.isMultiColumnSplit&&n.bodyWidget.sectionFormat.numberOfColumns>1&&n===n.bodyWidget.lastChild&&!t.isNullOrUndefined(n.bodyWidget.nextRenderedWidget)&&n.bodyWidget.sectionIndex!==n.bodyWidget.nextRenderedWidget.sectionIndex&&n.bodyWidget.page===n.bodyWidget.nextRenderedWidget.page)return;p=(g=n.getSplitWidgets())[g.length-1].nextRenderedWidget}this.updateListItemsTillEnd(n,c),this.documentHelper.blockToShift=void 0;this.viewer;if(this.documentHelper.editorProperties.isFootnoteElementRemoved){var w=this.documentHelper.pages[this.documentHelper.pages.length-1],F=w.bodyWidgets[w.bodyWidgets.length-1],C=w.endnoteWidget;if(!t.isNullOrUndefined(C)){var P=this.viewer.clientArea.clone(),T=this.viewer.clientActiveArea.clone(),O=F.y;if(F.childWidgets.length>0){var S=F.childWidgets[F.childWidgets.length-1];O=S.y+S.height}this.viewer.clientActiveArea.height=this.viewer.clientActiveArea.bottom-O,this.viewer.clientActiveArea.x=this.viewer.clientArea.x,this.viewer.clientActiveArea.width=this.viewer.clientArea.width,this.viewer.clientActiveArea.y=O,this.layoutfootNote(C),this.viewer.clientArea=P,this.viewer.clientActiveArea=T}}this.documentHelper.removeEmptyPages(),this.updateFieldElements(e);var N=this.documentHelper.pages[0];if(N.bodyWidgets[0].sectionIndex>0){var I=N;do{this.documentHelper.layout.layoutHeaderFooter(I.bodyWidgets[0],this.viewer,I),I=I.nextPage}while(I);for(;N.bodyWidgets[0].sectionIndex>0;)this.updateSectionIndex(void 0,N.bodyWidgets[0],!1)}n.bodyWidget instanceof Zs||this.isRelayoutFootnote||!n.bodyWidget.page.endnoteWidget||this.checkAndShiftEndnote(!0),(this.documentHelper.enableLockAndEdit||this.documentHelper.editorProperties.enableHeaderAndFooter)&&e||this.isMultiColumnSplit||r||this.documentHelper.hooks.onUpdateScrollBars()},i.prototype.updateSectionIndex=function(e,t,i){var r=t.sectionIndex,n=t;do{n.index===r&&e&&(n.sectionFormat=e),i?n.index++:n.index--,n=n.nextRenderedWidget}while(n)},i.prototype.isSectionEndsWithColumnBreak=function(e){return!t.isNullOrUndefined(e)&&e.childWidgets.length>0&&e.lastChild instanceof Qs&&e.lastChild.isEndsWithColumnBreak},i.prototype.checkAndShiftEndnote=function(e){var i=this.documentHelper.selectionEndParagraph;if(!t.isNullOrUndefined(i))if(i.isInsideTable&&(i=this.getParentTable(i)),!i||i.isInHeaderFooter||i.bodyWidget.containerWidget instanceof Zs||!t.isNullOrUndefined(i.nextRenderedWidget)&&!e)(this.isEndnoteContentChanged&&e&&!this.isRelayoutFootnote||i.bodyWidget.containerWidget instanceof Zs&&"Footnote"===i.bodyWidget.containerWidget.footNoteType)&&this.reLayoutEndnote();else if(!(i.bodyWidget instanceof Zs||this.isRelayoutFootnote)){var r=this.documentHelper.pages[this.documentHelper.pages.length-1];if(r&&r.endnoteWidget){var n=this.viewer.clientActiveArea.clone(),o=this.getBodyWidget(r.bodyWidgets[r.bodyWidgets.length-1],!0);this.viewer.updateClientArea(o,o.page);var a=this.getNextWidgetHeight(o);a>0&&(this.viewer.clientActiveArea.height-=a-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=a),this.layoutfootNote(r.endnoteWidget),this.viewer.clientActiveArea=n}}},i.prototype.updateFieldElements=function(e){for(var i=0;i<this.documentHelper.fields.length;i++){var r=this.documentHelper.fields[i];if((this.viewer instanceof Es||this.viewer instanceof Ms&&!(r.line.paragraph.containerWidget instanceof Ol||r.line.paragraph.bodyWidget instanceof Xs))&&!t.isNullOrUndefined(this.documentHelper)){var n=this.documentHelper.editorProperties.getFieldCode(r),o=/^(?!.*\bhyperlink\b)(?!.*\bnumpages\b).*\bpage\b.*$/;if(!t.isNullOrUndefined(n)&&(n.toLowerCase().match("numpages")||n.toLowerCase().match("sectionpages")||o.test(n.toLowerCase())&&e)&&!t.isNullOrUndefined(r.fieldSeparator)){var a=r.fieldSeparator.nextNode;if(!t.isNullOrUndefined(a)){var s=a.text,l=r.line.paragraph;if(!t.isNullOrUndefined(l.containerWidget)&&l.containerWidget instanceof Ys&&-1===l.containerWidget.indexInOwner)continue;var d=l.bodyWidget;if(!t.isNullOrUndefined(d)&&!t.isNullOrUndefined(d.page)&&-1!==d.page.index){if(o.test(n.toLowerCase())){var h=l.bodyWidget.page.index+1;a.text!==h.toString()?a.text=this.documentHelper.getFieldResult(r,d.page):a.text=h.toString()}else a.text=this.documentHelper.pages.length.toString();if(s!==a.text){a.isWidthUpdated=!1;var c=l.childWidgets.indexOf(r.line),g=r.line.children.indexOf(a);l.isInsideTable?this.reLayoutParagraph(l,c,g):this.reLayoutLine(l,c,!1,!1,!0)}}}}}}},i.prototype.reLayoutOrShiftWidgets=function(e,t,i,r){var n=e,o=!1;if(this.isNeedToRelayout(e.bodyWidget)||this.isPageBreakInsideContentControl(e)||e instanceof Qs&&e.floatingElements.length>0?(this.isMultiColumnSplit||this.updateContainerForTable(n,t),n instanceof el&&(n=n.combineWidget(this.viewer),this.clearTableWidget(n,!0,!0,!0)),t.updateClientAreaForBlock(n,!0,void 0,!1,!0),n.wrapTextAround&&(n.isLayouted=!1),this.isRelayout=!0,this.layoutBlock(n,0),this.isRelayout=!1,t.updateClientAreaForBlock(n,!1),o=!0):this.shiftWidgetsBlock(n,t,r),this.documentHelper.pages.indexOf(n.bodyWidget.page)>0&&n===n.bodyWidget.childWidgets[0]&&n instanceof Qs)for(var a=n.bodyWidget.childWidgets[0].childWidgets[0].children,s=0;s<a.length;s++){var l=a[s];l.margin.top>0&&l.margin.top===this.getBeforeSpacing(l.paragraph)&&(l.margin.top-=this.getBeforeSpacing(l.paragraph))}o||i||this.updateRenderedListItems(n),!this.isRelayoutFootnote&&n.bodyWidget.page.footnoteWidget&&(this.islayoutFootnote=!0,this.layoutfootNote(n.bodyWidget.page.footnoteWidget))},i.prototype.isNeedToRelayout=function(e){for(var t=0;t<e.floatingElements.length;t++){var i=e.floatingElements[t];if(i instanceof el||i instanceof Cl&&("Square"===i.textWrappingStyle||"TopAndBottom"===i.textWrappingStyle))return!0}return!1},i.prototype.updateParaOnBeforeSpacing=function(e,i,r){if(!(e.bodyWidget instanceof Xs||e instanceof el||t.isNullOrUndefined(e.firstChild)||t.isNullOrUndefined(e.firstChild.margin))){var n=e,o=0,a=!t.isNullOrUndefined(n.previousRenderedWidget)&&n.previousRenderedWidget instanceof Qs;a&&n.previousRenderedWidget.paragraphFormat.afterSpacing<=n.paragraphFormat.beforeSpacing&&(o=n.paragraphFormat.beforeSpacing-n.previousRenderedWidget.paragraphFormat.afterSpacing),a||(o=n.paragraphFormat.beforeSpacing),o=bs.convertPointToPixel(o);var s=n.firstChild;if(r){if(t.isNullOrUndefined(n.previousSplitWidget)&&0===i.indexInOwner&&i.page.index>0&&0===n.indexInOwner&&s.margin.top>0){n.height-=o,s.height-=o;for(h=0;h<s.children.length;h++){var l=s.children[h],d=bs.convertPointToPixel(n.paragraphFormat.beforeSpacing);s.paragraph.paragraphFormat.lineSpacing>0&&s.paragraph.paragraphFormat.beforeSpacing>0&&l.margin.top>d?(l.margin.top-=d,0===h&&(s.margin.top-=d)):s.paragraph.paragraphFormat.beforeSpacing>0&&(l.margin.top=0,0===h&&(s.margin.top=0))}}}else if(t.isNullOrUndefined(n.previousSplitWidget)&&o>0&&0===s.margin.top){n.height+=o,s.height+=o,s.margin.top=o;for(var h=0;h<s.children.length;h++)(l=s.children[h]).margin.top=o}}},i.prototype.shiftWidgetsBlock=function(e,i,r){e instanceof Qs?this.shiftWidgetsForPara(e,i,r):e instanceof el&&(!t.isNullOrUndefined(r)&&r.length>0&&e.previousRenderedWidget&&e.previousRenderedWidget.y+e.previousRenderedWidget.height+e.height>this.viewer.clientArea.bottom&&(r.length=0),this.shiftWidgetsForTable(e,i))},i.prototype.shiftWidgetsForPara=function(e,i,r){if(!(e.height>i.clientArea.height+i.clientArea.y)||this.documentHelper.editorProperties.enableHeaderAndFooter){e.bodyWidget;for(var n=this.getBodyWidgetOfPreviousBlock(e,0),o=n.bodyWidget,a=n.index,s=void 0,l=!1,d=!0,h=0;h<e.getSplitWidgets().length;h++){var c=e.getSplitWidgets()[h],g=c instanceof Qs&&c.isEmpty()&&!0===c.isSectionBreak,p=this.getBodyWidget(c.bodyWidget,!0);if(!this.isMultiColumnSplit||c===e){if(d&&!t.isNullOrUndefined(s)){var u=!!s.lastChild&&s.lastChild.isEndsWithPageBreak,f=!!s.lastChild&&s.lastChild.isEndsWithColumnBreak;if(this.shiftToPreviousWidget(c,i,s,u,f),this.updateFloatingElementPosition(s),(t.isNullOrUndefined(c.childWidgets)||0===c.childWidgets.length)&&!u&&!f){h--;continue}o!==c.containerWidget&&(o=c.containerWidget,u&&s!==c.previousSplitWidget&&i.updateClientAreaByWidget(c)),s=void 0}var m=[];l||(m=this.getFootNoteWidgetsOf(c));var y=0,v=!1;if(!this.isMultiColumnSplit&&!c.isInsideTable&&!t.isNullOrUndefined(r)&&r.length>0&&this.isFitInClientArea(c,i,m)&&c.previousRenderedWidget&&c.bodyWidget.page===c.previousRenderedWidget.bodyWidget.page){y=this.getFootNoteHeight(r);w=this.updateFootnoteHeight(c,!1,!0);c.previousRenderedWidget.y+c.previousRenderedWidget.height+y+c.firstChild.height>w&&this.viewer.clientArea.bottom<=w&&(v=!0)}if(l=!1,this.viewer.clientActiveArea.y===this.viewer.clientArea.y&&0===c.indexInOwner||this.updateParaOnBeforeSpacing(c,c.bodyWidget,!1),this.isFitInClientArea(c,i,m)&&!v||i.clientActiveArea.height<c.firstChild.height&&this.viewer.clientActiveArea.y===this.viewer.clientArea.y||this.isMultiColumnSplit&&c.bodyWidget.sectionFormat.numberOfColumns-1!==c.bodyWidget.columnIndex){if(!t.isNullOrUndefined(r)&&!t.isNullOrUndefined(m)&&m.length>0)for(F=0;F<m.length;F++)r.push(m[F]);if(this.keepWithNext&&(this.updateClientPositionForBlock(c.containerWidget.firstChild,c),this.keepWithNext=!1),s=c,i.updateClientAreaForBlock(c,!0,void 0,!1,!0),this.isNeedToUpdateXPositionForEmptyParagraph(c))this.updateXPositionForEmptyParagraph(i.clientActiveArea,c);else{c.x=i.clientActiveArea.x;var W=c.previousWidget;!c.previousSplitWidget&&W instanceof Qs&&this.isMergedWithNextParagraph(W)&&(c.x+=Math.max(0,this.getMergedParagraphOffset(c)))}if(i.updateClientAreaForBlock(c,!1),c.y=i.clientActiveArea.y,this.updateFloatingElementPosition(c),!g||t.isNullOrUndefined(c.previousRenderedWidget)||c.previousRenderedWidget instanceof el?i.cutFromTop(i.clientActiveArea.y+c.height):i.cutFromTop(i.clientActiveArea.y),t.isNullOrUndefined(o)||o===c.containerWidget||this.isMultiColumnSplit){if(c.containerWidget instanceof Ys&&c.containerWidget.firstChild===c&&c.previousRenderedWidget&&c.previousRenderedWidget instanceof Qs&&c.containerWidget.page.index!==c.previousRenderedWidget.containerWidget.page.index&&c.containerWidget.index!==c.previousRenderedWidget.containerWidget.index){var b=c.previousRenderedWidget.bodyWidget,x=b.sectionFormat.breakCode;b.sectionFormat.columns.length>1&&(b=this.getBodyWidget(b,!0)),t.isNullOrUndefined(b.previousRenderedWidget)||"NoBreak"!==b.sectionFormat.breakCode||"NewPage"!==b.previousRenderedWidget.sectionFormat.breakCode||b.page.index!==b.previousRenderedWidget.page.index?"NewPage"===b.sectionFormat.breakCode&&"NoBreak"===c.containerWidget.sectionFormat.breakCode&&(x=c.containerWidget.sectionFormat.breakCode):x=b.previousRenderedWidget.sectionFormat.breakCode;var w=bs.round(this.getNextWidgetHeight(b)+c.height,2);this.shiftBodyWidget(c,w,x)}}else if(a++,o.lastChild.isEndsWithPageBreak||o.lastChild.isEndsWithColumnBreak||this.isPageBreakInsideContentControl(o.lastChild)||this.updateContainerWidget(c,o,a,!0,m),m.length>0&&o.page.footnoteWidget)for(var F=0;F<m.length;F++)-1===o.page.footnoteWidget.bodyWidgets.indexOf(m[F])&&c.bodyWidget.page.index!=m[F].page.index&&(o.page.footnoteWidget.bodyWidgets.push(m[F]),o.page.footnoteWidget.height+=m[F].height);if(!this.isInitialLoad&&d&&c.bodyWidget.sectionFormat.columns.length>1&&c===c.bodyWidget.firstChild&&!t.isNullOrUndefined(p.previousWidget)&&p.page===p.previousWidget.page){this.viewer.updateClientArea(c.bodyWidget,c.bodyWidget.page),p=this.getBodyWidget(p.previousWidget,!0);var C=this.getNextWidgetHeight(p);c.bodyWidget.y=C,this.viewer.clientActiveArea.height-=C-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=C,d=!1,h--}if((c.isEndsWithPageBreak&&!this.isPageBreakInsideField(c)||c.isEndsWithColumnBreak||this.isPageBreakInsideContentControl(c))&&this.viewer instanceof Es){var P=this.createOrGetNextBodyWidget(o,this.viewer);P=this.moveBlocksToNextPage(c,!0,void 0,void 0,void 0,void 0,c.isEndsWithPageBreak),i.updateClientArea(P,P.page)}}else{t.isNullOrUndefined(r)||(r.length=0);var T=c.previousRenderedWidget,u=!1,f=!1;T instanceof Qs&&T.isEndsWithPageBreak&&this.viewer instanceof Es&&(u=!0),T instanceof Qs&&T.isEndsWithColumnBreak&&this.viewer instanceof Es&&(f=!0);var O=!1;if(g||(O=this.splitWidget(c,i,o,a+1,u,m,f,v?y:0)),c.containerWidget instanceof Ys&&c.containerWidget.firstChild===c&&c.previousRenderedWidget&&c.previousRenderedWidget instanceof Qs&&c.previousRenderedWidget.containerWidget instanceof Ys&&"NewPage"===c.previousRenderedWidget.containerWidget.sectionFormat.breakCode&&c.containerWidget.page.index!==c.previousRenderedWidget.containerWidget.page.index&&c.containerWidget.index!==c.previousRenderedWidget.containerWidget.index){var S=bs.round(this.getNextWidgetHeight(c.previousRenderedWidget.bodyWidget)+c.height,2);this.shiftBodyWidget(c,S,c.containerWidget.sectionFormat.breakCode)}this.updateFloatingElementPosition(c),s=void 0,o!==c.containerWidget&&(o=c.containerWidget,h--,m.length>0&&(l=!0)),0===(a=o.childWidgets.indexOf(c))&&this.updateParaOnBeforeSpacing(c,c.bodyWidget,!0),O&&(o=e.getSplitWidgets()[h+1].containerWidget)}}}if(this.skipUpdateContainerWidget=!1,e.isEmpty()){var N=e.previousRenderedWidget;if(e.isSectionBreak&&e.index>0){if(N instanceof Qs)return this.layoutSectionBreakParagraph(e,N),void(!N.isEndsWithPageBreak&&this.viewer.clientActiveArea.y<=e.y&&this.viewer.cutFromTop(e.y+e.height));if(N instanceof el&&"Word2013"!==this.documentHelper.compatibilityMode)return}}}},i.prototype.shiftBodyWidget=function(e,t,i){if(!e.previousRenderedWidget.containerWidget.lastChild.isEndsWithPageBreak&&!e.previousRenderedWidget.containerWidget.lastChild.isEndsWithColumnBreak&&t<=bs.round(this.viewer.clientArea.bottom,2)&&"NoBreak"===i){for(var r=e.previousRenderedWidget.bodyWidget.page,n=e.containerWidget.page,o=0;o<n.bodyWidgets.length;o++){var a=n.bodyWidgets[o];n.bodyWidgets.splice(n.bodyWidgets.indexOf(a),1),r.bodyWidgets.splice(r.bodyWidgets.length,0,a),a.page=r,o--}e.containerWidget.y=this.viewer.clientActiveArea.y,this.documentHelper.removeEmptyPages()}},i.prototype.updateFloatingElementPosition=function(e){if(e.floatingElements.length>0)for(var i=0;i<e.floatingElements.length;i++){var r=e.floatingElements[i],n=0;if(r instanceof Pl&&"Inline"===r.textWrappingStyle){var o=r.line.indexInOwner,a=0;n=bs.convertPointToPixel(r.textFrame.marginTop);for(var s=0;s<o;s++)t.isNullOrUndefined(e.childWidgets[s])||(a+=e.childWidgets[s].height);r.y=e.y+a}else{var l=this.getFloatingItemPoints(r);r.y=l.y,r.x=l.x}(r instanceof Pl||r instanceof Tl)&&this.updateChildLocationForCellOrShape(r.y+n,r,void 0,!1,!0)}},i.prototype.isPageBreakInsideField=function(e){for(var t=!1,i=!1,r=0,n=0;n<e.childWidgets.length;n++){var o=e.childWidgets[n];r+=o.height;for(var a=0;a<o.children.length;a++){var s=o.children[a];s instanceof ol&&(0===s.fieldType?i=!0:2!==s.fieldType&&1!==s.fieldType||(i=!1)),t=!(!i&&"\f"===s.text)}}return t&&0===e.height&&this.viewer.cutFromTop(this.viewer.clientActiveArea.y+r),t},i.prototype.isPageBreakInsideContentControl=function(e){var i=!1;if(e instanceof Qs&&e.childWidgets.length>0){var r=e.childWidgets[e.childWidgets.length-1];if(r.children.length>0){var n=r.children[r.children.length-1];n instanceof yl&&"Block"===n.contentControlWidgetType&&!t.isNullOrUndefined(n.previousElement)&&n.previousElement instanceof hl&&"\f"===n.previousElement.text&&(i=!0)}}return i},i.prototype.getFootNotesOfBlock=function(e,i){if(t.isNullOrUndefined(i)&&(i=[]),e.childWidgets.length>0)for(var r=0;r<this.documentHelper.footnoteCollection.length;r++)this.documentHelper.footnoteCollection[r].line.paragraph===e&&i.push(this.documentHelper.footnoteCollection[r]);return i},i.prototype.getFootnoteElementsOfParagraph=function(e){var i=[],r=e.childWidgets;if(t.isNullOrUndefined(r)||0===r.length)return i;for(var n=0;n<r.length;n++)for(var o=r[n],a=0;a<o.children.length;a++){var s=o.children[a];s instanceof gl&&i.push(s)}return i},i.prototype.getFootNotesWidgetsInLine=function(e){for(var t=[],i=0;i<e.children.length;i++){var r=e.children[i];r instanceof gl&&t.push(r)}return this.getFootNoteWidgetsBy(e.paragraph,t)},i.prototype.getFootNoteWidgetsBy=function(e,i){var r=[];if(e.bodyWidget.page.footnoteWidget)for(n=0;n<e.bodyWidget.page.footnoteWidget.bodyWidgets.length;n++)for(o=0;o<i.length;o++)e.bodyWidget.page.footnoteWidget.bodyWidgets[n].footNoteReference===i[o]&&r.push(e.bodyWidget.page.footnoteWidget.bodyWidgets[n]);if(0===r.length&&!t.isNullOrUndefined(e.previousRenderedWidget)&&e.previousRenderedWidget.bodyWidget.page.footnoteWidget)for(n=0;n<e.previousRenderedWidget.bodyWidget.page.footnoteWidget.bodyWidgets.length;n++)for(o=0;o<i.length;o++)e.previousRenderedWidget.bodyWidget.page.footnoteWidget.bodyWidgets[n].footNoteReference===i[o]&&r.push(e.previousRenderedWidget.bodyWidget.page.footnoteWidget.bodyWidgets[n]);if(0===r.length&&!t.isNullOrUndefined(e.bodyWidget.previousRenderedWidget)&&e.bodyWidget.previousRenderedWidget.page.footnoteWidget)for(n=0;n<e.bodyWidget.previousRenderedWidget.page.footnoteWidget.bodyWidgets.length;n++)for(o=0;o<i.length;o++)e.bodyWidget.previousRenderedWidget.page.footnoteWidget.bodyWidgets[n].footNoteReference===i[o]&&r.push(e.bodyWidget.previousRenderedWidget.page.footnoteWidget.bodyWidgets[n]);if(0===r.length&&!t.isNullOrUndefined(e.bodyWidget.nextRenderedWidget)&&e.bodyWidget.nextRenderedWidget.page.footnoteWidget)for(var n=0;n<e.bodyWidget.nextRenderedWidget.page.footnoteWidget.bodyWidgets.length;n++)for(var o=0;o<i.length;o++)e.bodyWidget.nextRenderedWidget.page.footnoteWidget.bodyWidgets[n].footNoteReference===i[o]&&r.push(e.bodyWidget.nextRenderedWidget.page.footnoteWidget.bodyWidgets[n]);return r},i.prototype.getFootNoteWidgetsOf=function(e,t){var i=[],r=[];if(e instanceof el)for(var n=0;n<e.childWidgets.length;n++)for(var o=e.childWidgets[n],a=0;a<o.childWidgets.length;a++)for(var s=o.childWidgets[a],l=0;l<s.childWidgets.length;l++){var d=s.childWidgets[l];if(d instanceof el)for(var h=this.getFootNoteWidgetsOf(d,t),c=0;c<h.length;c++)-1===i.indexOf(h[c])&&i.push(h[c]);else r=this.getFootNotesOfBlock(d,r);if(r.length>0){var g=this.getFootNoteWidgetsBy(d,r);if(t&&0===g.length)for(var p=0;p<r.length;p++)-1===i.indexOf(r[p].bodyWidget)&&i.push(r[p].bodyWidget);else for(c=0;c<g.length;c++)-1===i.indexOf(g[c])&&i.push(g[c])}}else if((r=this.getFootNotesOfBlock(e)).length>0&&(i=this.getFootNoteWidgetsBy(e,r)),t&&0===i.length)for(var u=0;u<r.length;u++)i.push(r[u].bodyWidget);return i},i.prototype.getFootNodeWidgetsToShiftToPage=function(e){for(var t,i=e.getSplitWidgets(),r=[],n=e.containerWidget,o=0;o<i.length;o++)for(var a=this.getFootNoteWidgetsOf(i[o]),s=0;s<a.length;s++)n!==(t=a[s].containerWidget)&&r.push(a[s]);return{footNoteWidgets:r,fromBodyWidget:t,toBodyWidget:n}},i.prototype.shiftTableWidget=function(e,i,r){void 0===r&&(r=!1),e.isBidiTable=e.bidi,"Word2013"===this.documentHelper.compatibilityMode||e.isInsideTable||t.isNullOrUndefined(e.firstChild.firstChild.leftMargin)||(this.viewer.clientActiveArea.x=this.viewer.clientActiveArea.x-bs.convertPointToPixel(e.firstChild.firstChild.leftMargin));var n=[e];this.addTableWidget(this.viewer.clientActiveArea,n),this.viewer.updateClientAreaTopOrLeft(e,!0);var o,a,s=0;if(e.wrapTextAround?(o=this.viewer.clientActiveArea.clone(),a=this.viewer.clientArea.clone(),this.updateClientAreaForWrapTable(n,e,!0,o,a)):e.containerWidget instanceof Ol||(this.adjustClientAreaBasedOnTextWrapForTable(e,this.viewer.clientActiveArea),this.isWrapText&&(s=this.viewer.clientActiveArea.x-this.viewer.clientArea.x,this.isWrapText=!1,e.x=this.viewer.clientActiveArea.x)),e.childWidgets.length>0){var l=e.childWidgets[0].rowFormat.isHeader;e.header=l,e.continueHeader=l,e.headerHeight=0}var d=e.childWidgets[0];for(this.updateFootnoteHeight(e,!0),this.documentHelper.viewer instanceof Es&&e.wrapTextAround&&("Bottom"===e.positioning.verticalAlignment||"Center"===e.positioning.verticalAlignment||"Outside"===e.positioning.verticalAlignment)&&(this.updateTableFloatPoints(e),this.updateChildLocationForTable(e.y,e));d;)d=(d=this.shiftRowWidget(n,d,r)).nextRow;return this.updateFootnoteHeight(e,!1),this.updateWidgetsToPage(n,[],e,!0),s>0&&(this.viewer.clientArea.x=this.viewer.clientArea.x-s),e.wrapTextAround&&this.updateClientAreaForWrapTable(n,e,!1,o,a),"Word2013"===this.documentHelper.compatibilityMode||e.isInsideTable||e.wrapTextAround||t.isNullOrUndefined(e.firstChild.firstChild.leftMargin)||(this.viewer.clientArea.x=this.viewer.clientArea.x+bs.convertPointToPixel(e.firstChild.firstChild.leftMargin)),n[n.length-1]},i.prototype.shiftRowWidget=function(e,t,i){void 0===i&&(i=!1);var r=this.viewer;i&&(t.height=0);var n=t.ownerTable.isInsideTable;n||this.updateExistingFootnoteHeight(t);var o=[t];this.addTableRowWidget(r.clientActiveArea,o),r.updateClientAreaForRow(t,!0);for(var a=0;a<t.childWidgets.length;a++){var s=t.childWidgets[a];i&&(s.height=0),this.shiftCellWidget(s,this.getMaxTopCellMargin(t)+t.topBorderWidth,this.getMaxBottomCellMargin(t)+t.bottomBorderWidth,i)}if(r.updateClientAreaForRow(t,!1),!n){var l=this.footnoteHeight;this.updateFootnoteToBody(t,this.layoutedFootnoteElement),this.footnoteHeight=l}return this.updateWidgetsToTable(e,o,t,!1),n||(this.layoutedFootnoteElement=[]),o[o.length-1]},i.prototype.updateFootnoteToBody=function(e,i){this.layoutFootnoteInSplittedRow(e,this.getFootnoteBody(i)),t.isNullOrUndefined(e.ownerTable.footnoteElement)&&(e.ownerTable.footnoteElement=[]);for(var r=0;r<i.length;r++)e.ownerTable.footnoteElement.push(i[r])},i.prototype.getFootnoteBody=function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i].bodyWidget);return t},i.prototype.shiftCellWidget=function(e,i,r,n){t.isNullOrUndefined(n)&&(n=!1);var o=this.viewer;this.addTableCellWidget(e,o.clientActiveArea,i,r);var a=this.viewer.clientActiveArea.height;o.updateClientAreaForCell(e,!0);for(var s=0;s<e.childWidgets.length;s++){var l=e.childWidgets[s],d=s!==e.childWidgets.length-1;o.updateClientAreaForBlock(l,!0),l instanceof Qs?this.shiftParagraphWidget(l,d):this.shiftTableWidget(l,o,n),o.updateClientAreaForBlock(l,!1)}this.updateWidgetToRow(e),o.updateClientAreaForCell(e,!1),e.ownerTable.isInsideTable||(this.viewer.clientActiveArea.height=a)},i.prototype.shiftParagraphWidget=function(e,t){this.addParagraphWidget(this.viewer.clientActiveArea,e);var i=e.previousWidget;if(i instanceof Qs&&!e.previousSplitWidget&&this.isMergedWithNextParagraph(i)&&(e.x+=Math.max(0,this.getMergedParagraphOffset(e))),e.floatingElements.length>0)for(var r=0;r<e.floatingElements.length;r++){var n=e.floatingElements[r],o=0;if(n instanceof Pl&&"Inline"===n.textWrappingStyle){var a=n.line.indexInOwner,s=0;o=bs.convertPointToPixel(n.textFrame.marginTop);for(var l=0;l<a;l++)s+=e.childWidgets[l].height;n.y=e.y+s}else{var d=this.getFloatingItemPoints(n);n.y=d.y,n.x=d.x}(n instanceof Pl||n instanceof Tl)&&this.updateChildLocationForCellOrShape(n.y+o,n,void 0,!1,!0)}this.viewer.cutFromTop(this.viewer.clientActiveArea.y+e.height);for(var h=this.getFootNoteWidgetsOf(e,!0),c=0;c<h.length;c++)this.layoutedFootnoteElement.push(h[c].footNoteReference);this.footnoteHeight+=this.getFootNoteHeight(h),this.updateWidgetToPage(this.viewer,e,t)},i.prototype.updateContainerForTable=function(e,i){var r=this.getBodyWidgetOfPreviousBlock(e,0),n=r.bodyWidget,o=r.index,a=!t.isNullOrUndefined(n.lastChild)&&!t.isNullOrUndefined(n.lastChild.lastChild)&&n.lastChild.lastChild.isEndsWithPageBreak,s=!t.isNullOrUndefined(n.lastChild)&&!t.isNullOrUndefined(n.lastChild.lastChild)&&n.lastChild.lastChild.isEndsWithColumnBreak;n!==e.containerWidget&&(a||s?i.updateClientArea(e.bodyWidget,e.bodyWidget.page):this.updateContainerWidget(e,n,o+1,!0)),(e.isInHeaderFooter||this.viewer instanceof Ms)&&(e.containerWidget.height-=e.height)},i.prototype.shiftWidgetsForTable=function(e,t){this.updateContainerForTable(e,t),this.viewer.updateClientAreaForBlock(e,!0,void 0,!1,!0),this.updateVerticalPositionToTop(e,!0);var i=e.combineWidget(this.viewer);if(this.documentHelper.layout.updateChildLocationForTable(i.y,i),this.clearTableWidget(i,!0,!1,!1,!0),this.shiftTableWidget(i,this.viewer),i.containerWidget instanceof Ys&&i.containerWidget.firstChild===i&&i.previousRenderedWidget&&i.previousRenderedWidget instanceof Qs&&i.previousRenderedWidget.containerWidget instanceof Ys&&i.containerWidget.page.index!==i.previousRenderedWidget.containerWidget.page.index&&i.containerWidget.index!==i.previousRenderedWidget.containerWidget.index){var r=bs.round(this.getNextWidgetHeight(i.previousRenderedWidget.bodyWidget)+i.height,2);this.shiftBodyWidget(i,r,i.containerWidget.sectionFormat.breakCode)}this.updateVerticalPositionToTop(e,!1),this.viewer.updateClientAreaForBlock(e,!1)},i.prototype.updateVerticalPositionToTop=function(e,t){for(var i=0;i<e.getSplitWidgets().length;i++)for(var r=e.getSplitWidgets()[i],n=0;n<r.childWidgets.length;n++)for(var o=r.childWidgets[n],a=0;a<o.childWidgets.length;a++){var s=o.childWidgets[a];this.documentHelper.layout.updateCellVerticalPosition(s,t,!1)}},i.prototype.splitWidget=function(e,i,r,n,o,a,s,l){var d=e.childWidgets[0],h=e.paragraphFormat.keepLinesTogether&&this.viewer.clientActiveArea.y!==this.viewer.clientArea.y?e.height:this.getMaxElementHeight(d),c=e.getSplitWidgets(),g=e.containerWidget;h=this.getMaximumLineHeightToSplit(e,h,i);var p=this.getFootNotesWidgetsInLine(d);if(t.isNullOrUndefined(e.previousWidget)&&p.length>0)for(v=0;v<p.length;v++)for(var u=0;u<p[v].childWidgets.length;u++)h+=p[v].childWidgets[u].height;var f=0;if(!t.isNullOrUndefined(l)&&l>0&&(f=l),i.clientActiveArea.height>=h+f&&!o&&!s){var m=void 0,y=c.indexOf(e);y<c.length-1?g=(m=c[y+1]).containerWidget:((m=new Qs).index=e.index,m.characterFormat=e.characterFormat,m.paragraphFormat=e.paragraphFormat,m.width=e.width,m.x=e.x,m.y=e.y,c.push(m)),r===e.containerWidget||this.skipUpdateContainerWidget||this.updateContainerWidget(e,r,n,!0,a);for(var v=e.childWidgets.length-1;v>0;v--){var W=e.childWidgets[v];if(this.isFitInClientArea(e,i,void 0)){1===m.childWidgets.length&&(this.updateParagraphWidgetInternal(W,m,0),this.skipUpdateContainerWidget=!0);break}var b=e.childWidgets[v];this.updateParagraphWidgetInternal(b,m,0)}if(t.isNullOrUndefined(m.containerWidget)&&m.childWidgets.length>0){var x=i.clientActiveArea.y,w=new zs(i.clientArea.x,i.clientArea.y,i.clientArea.width,i.clientArea.height),F=new zs(i.clientActiveArea.x,i.clientActiveArea.y,i.clientActiveArea.width,i.clientActiveArea.height),C=e.bodyWidget.page;if(g=this.moveBlocksToNextPage(e,!1,-1),m.containerWidget=g,g.childWidgets.splice(0,0,m),C===g.page)return e.x!==e.containerWidget.x&&(e.x=e.containerWidget.x),e.y=x,i.updateClientArea(g,g.page),m=this.addParagraphWidget(this.viewer.clientActiveArea,m),!0;g.height+=m.height;var P=this.getFootNoteWidgetsOf(m);if(g!=r&&this.moveFootNotesToPage(P,r,g),1===g.childWidgets.length&&g.firstChild instanceof Qs&&g.firstChild.equals(e))return e.y=x,!0;i.clientArea=w,i.clientActiveArea=F}}else{var T=void 0,O=!1,S=0;i.columnLayoutArea.setColumns(r.sectionFormat),g=this.createOrGetNextBodyWidget(r,this.viewer);var N=this.alignBlockElement(e);if(this.isInitialLoad||t.isNullOrUndefined(N.node)||e.isEndsWithPageBreak||e.isEndsWithColumnBreak||!t.isNullOrUndefined(e.previousSplitWidget)||(T=N.node instanceof tl?this.splitRow(N.node):N.node).containerWidget instanceof Ys&&T.containerWidget==r&&T.containerWidget.firstChild!==T&&(S=T instanceof el?0:parseInt(N.position.index,10),e=T,O=!0,!t.isNullOrUndefined(e.nextRenderedWidget)&&e.nextRenderedWidget instanceof Qs&&(this.keepWithNext=!0,this.documentHelper.blockToShift=e.nextRenderedWidget)),e.containerWidget!==g||O){C=e.bodyWidget.page;if(e.height=this.getHeight(e),g=this.moveBlocksToNextPage(e,!0),r!==g){if(i.updateClientArea(g,g.page),S>0&&this.keepWithNext){this.viewer.updateClientAreaForBlock(e,!0);var I=void 0;e instanceof el?this.addTableWidget(this.viewer.clientActiveArea,[e]):I=g.firstChild instanceof Qs&&g.firstChild.equals(e)?g.firstChild:new Qs,(I=this.moveChildsToParagraph(e,S,I)).containerWidget=g;for(var k=0;k<I.floatingElements.length;k++){var A=I.floatingElements[k];A.line.paragraph.bodyWidget!==e.bodyWidget&&"Inline"!==A.textWrappingStyle&&e.bodyWidget.floatingElements.splice(e.bodyWidget.floatingElements.indexOf(A),1)}e=I,-1===g.childWidgets.indexOf(e)&&g.childWidgets.splice(0,0,e),this.viewer.updateClientAreaLocation(e,this.viewer.clientActiveArea),this.layoutBlock(e,0,!0),this.viewer.updateClientAreaForBlock(e,!1)}else this.updateContainerWidget(e,g,0,!0),e instanceof el?this.addTableWidget(this.viewer.clientActiveArea,[e]):this.addParagraphWidget(this.viewer.clientActiveArea,e);this.moveFootNotesToPage(a,r,g)}if(r.page===g.page)return r!==g||(i.updateClientArea(g,g.page),!1)}}return r===e.containerWidget?(e.y=i.clientActiveArea.y,i.cutFromTop(i.clientActiveArea.y+e.height)):i.updateClientArea(g,g.page),!1},i.prototype.getMaximumLineHeightToSplit=function(e,i,r){if(r.clientActiveArea.height>=i&&!e.paragraphFormat.keepLinesTogether&&e.paragraphFormat.widowControl&&!t.isNullOrUndefined(e.previousWidget)&&t.isNullOrUndefined(e.previousSplitWidget))for(var n=e.height,o=e.childWidgets.length-1;o>=0;o--){var a=e.childWidgets[o],s=this.getMaxElementHeight(a);if(a.height>s&&(n-=a.height-s),r.clientActiveArea.height>=n){0===o&&(i=e.height);break}n-=a.height}return i},i.prototype.moveFootNotesToPage=function(e,t,i){if(e.length>0&&t.page.footnoteWidget&&t.page!==i.page){for(var r=-1,n=void 0,o=0,a=!1,s=0;s<e.length;s++)if(n=e[s],(r=t.page.footnoteWidget.bodyWidgets.indexOf(n))>=0){void 0===i.page.footnoteWidget&&this.addEmptyFootNoteToBody(i);for(var l=0;l<i.page.footnoteWidget.bodyWidgets.length;l++)i.page.footnoteWidget.bodyWidgets[l].footNoteReference===n.footNoteReference&&(a=!0);if(t.page.footnoteWidget.bodyWidgets.splice(r,1),i.page.footnoteWidget.bodyWidgets.indexOf(n)<0&&!a){i.page.footnoteWidget.bodyWidgets.length;var d=this.documentHelper.pages.indexOf(t.page),h=this.documentHelper.pages.indexOf(i.page);n.containerWidget=i.page.footnoteWidget,n.page=i.page,d>h?(i.page.footnoteWidget.bodyWidgets.push(n),o++):i.page.footnoteWidget.bodyWidgets.splice(o++,0,n),i.page.footnoteWidget.height+=n.height}t.page.footnoteWidget.height-=n.height}t.page.footnoteWidget&&0===t.page.footnoteWidget.bodyWidgets.length&&(t.page.footnoteWidget=void 0),void 0!==t.page.footnoteWidget&&this.layoutfootNote(t.page.footnoteWidget),void 0!==i.page.footnoteWidget&&this.layoutfootNote(i.page.footnoteWidget)}},i.prototype.addEmptyFootNoteToBody=function(e){var t=new Zs;t.footNoteType="Footnote",t.page=e.page;var i=new Qs;i.characterFormat=new S(void 0,this.documentHelper),i.paragraphFormat=new Ls,i.index=0;var r=new rl(i);i.childWidgets.push(r),t.height=this.documentHelper.textHelper.getParagraphMarkSize(i.characterFormat).Height,t.margin=new js(0,t.height,0,0),e.page.footnoteWidget=t},i.prototype.getMaxElementHeight=function(e){var i=0;if(t.isNullOrUndefined(e)||t.isNullOrUndefined(e.children))return 0;if(0===e.children.length||1===e.children.length&&e.children[0]instanceof kl||2===e.children.length&&e.children[0]instanceof kl&&e.children[1]instanceof kl){i=this.getParagraphMarkSize(e.paragraph,0,0).height,i+=0,e.children.length>0&&i<(n=e.children[0]).margin.top+n.height&&(i=n.margin.top+n.height)}else for(var r=0;r<e.children.length;r++){var n=e.children[r];i<n.margin.top+n.height&&(i=n.margin.top+n.height)}return i},i.prototype.getParagraphMarkSize=function(e,t,i){var r=this.documentHelper.textHelper.getParagraphMarkSize(e.characterFormat),n=r.BaselineOffset,o=r.Height,a=n;if(e instanceof Qs){if(e.childWidgets.length>0)e.childWidgets[0];var s=this.getLineSpacing(e,o),l=this.getBeforeSpacing(e);t=a-n,i=o-a-(r.Height-n);var d=e.paragraphFormat.lineSpacingType;"Multiple"===d?s>o?i+=s-o:t+=s-o:"Exactly"===d?t+=s-(t+r.Height+i):s>t+r.Height+i&&(t+=s-(t+r.Height+i)),t+=l,i+=this.getAfterSpacing(e)}return{width:r.Width,height:r.Height,topMargin:t,bottomMargin:i}},i.prototype.createOrGetNextBodyWidget=function(e,i){i.columnLayoutArea.setColumns(e.sectionFormat);var r=i.columnLayoutArea.getNextColumnByBodyWidget(e);if(!t.isNullOrUndefined(r))return this.createOrGetNextColumnBody(e);var n=void 0,o=0;o=this.documentHelper.pages.indexOf(e.page);var a=void 0,s=void 0;if(s=e.index,o===this.documentHelper.pages.length-1||this.documentHelper.pages[o+1].sectionIndex!==s){var l=new Ys;l.sectionFormat=e.sectionFormat,l.index=e.index,a=i.createNewPage(l),this.documentHelper.pages[o+1].sectionIndex!==s&&this.documentHelper.insertPage(o+1,a),n=a.bodyWidgets[0]}else n=(a=this.documentHelper.pages[o+1]).bodyWidgets[0];return n},i.prototype.isFitInClientArea=function(e,i,r){var n=e.childWidgets[e.childWidgets.length-1],o=e.height,a=this.getMaxElementHeight(n);n.height>a&&(o-=n.height-a);var s=0;if(!t.isNullOrUndefined(r)&&r.length>0){r[0].containerWidget instanceof Zs&&(s=r[0].containerWidget.margin.top);for(var l=0;l<r.length;l++)for(var d=0;d<r[l].childWidgets.length;d++)s+=r[l].childWidgets[d].height}return i.clientActiveArea.height>=o+s},i.prototype.isLineInFootNote=function(e,t){for(var i=0;i<t.length;i++)if(t[i].line===e)return!0;return!1},i.prototype.shiftToPreviousWidget=function(e,i,r,n,o){var a=e.containerWidget,s=r.containerWidget,l=[],d=[];s!==a&&(l=this.getFootNotesOfBlock(e));for(var h=0;h<e.childWidgets.length;h++){var c=e.childWidgets[h],g=this.getMaxElementHeight(c);if(this.isLineInFootNote(c,l)){for(var p=this.getFootNoteWidgetsBy(c.paragraph,l),u=0,f=0;f<p.length;f++)for(var m=p[f],y=0;y<m.childWidgets.length;y++)u+=m.childWidgets[y].height;p.length>0&&p[0].containerWidget&&(u+=p[0].containerWidget.margin.top),g+=u}if(!(i.clientActiveArea.height>=g)||n||o){var v=r.containerWidget;i.updateClientArea(v,v.page);var W=this.createOrGetNextBodyWidget(v,i);e.containerWidget!==W&&(W=this.moveBlocksToNextPage(e,!0)),v!==W&&((l=this.getFootNotesOfBlock(e)).length>0&&(d=d.concat(this.getFootNoteWidgetsBy(e,l)),s=W),this.updateContainerWidget(e,W,0,!0)),i.updateClientArea(W,W.page);break}if(l.length>0&&this.isLineInFootNote(c,l)&&(d=d.concat(this.getFootNoteWidgetsBy(c.paragraph,l))),this.updateParagraphWidgetInternal(c,r,r.childWidgets.length),h--,i.cutFromTop(i.clientActiveArea.y+c.height),t.isNullOrUndefined(e.childWidgets))break}!t.isNullOrUndefined(d)&&d.length>0&&a.page.footnoteWidget&&a!=s&&this.moveFootNotesToPage(d,a,s)},i.prototype.updateParagraphWidgetInternal=function(e,i,r){t.isNullOrUndefined(e.paragraph)||(e.paragraph.childWidgets.splice(e.paragraph.childWidgets.indexOf(e),1),e.paragraph.height-=e.height,t.isNullOrUndefined(e.paragraph.containerWidget)||(e.paragraph.containerWidget.height-=e.height),(t.isNullOrUndefined(e.paragraph.childWidgets)||0===e.paragraph.childWidgets.length)&&e.paragraph.destroyInternal(this.viewer)),!t.isNullOrUndefined(e.paragraph)&&e.paragraph.floatingElements.length>0&&this.shiftFloatingElements(e,i),i.childWidgets.splice(r,0,e),e.paragraph=i,i.height+=e.height,t.isNullOrUndefined(i.containerWidget)||(i.containerWidget.height+=e.height)},i.prototype.shiftFloatingElements=function(e,t){for(var i=0;i<e.children.length;i++)if((e.children[i]instanceof Pl||e.children[i]instanceof Tl)&&"Inline"===e.children[i].textWrappingStyle||"Inline"===e.children[i].textWrappingStyle){var r=e.paragraph.floatingElements.indexOf(e.children[i]);r>=0&&(e.paragraph.floatingElements.splice(r,1),t.floatingElements.splice(r,0,e.children[i]))}},i.prototype.shiftNextWidgets=function(e){for(var i=e;i.nextWidget instanceof Js;){if(i=i.nextWidget,this.viewer instanceof Es&&!this.isMultiColumnSplit&&i.bodyWidget.sectionFormat.columns.length>1){var r=this.getBodyWidget(i.bodyWidget,!1);if(!t.isNullOrUndefined(r.nextRenderedWidget)&&r.page===r.nextRenderedWidget.page){this.splitBodyWidgetBasedOnColumn(i.bodyWidget);break}}this.reLayoutOrShiftWidgets(i,this.viewer)}},i.prototype.updateContainerWidget=function(e,i,r,n,o){if(!(e.containerWidget&&e.containerWidget.containerWidget instanceof Zs)){var a=e.containerWidget;if(!t.isNullOrUndefined(e.containerWidget)&&(e.containerWidget.childWidgets.splice(e.containerWidget.childWidgets.indexOf(e),1),e.containerWidget.height-=i.height,a&&a.page&&a.page.footnoteWidget&&o&&o.length>0&&this.moveFootNotesToPage(o,a,i),(t.isNullOrUndefined(e.containerWidget.childWidgets)||0===e.containerWidget.childWidgets.length)&&e.containerWidget instanceof Ys&&e.containerWidget!==i&&n)){var s=e.containerWidget.page;if(this.documentHelper.pages[this.documentHelper.pages.length-1]===s&&-1!==this.viewer.visiblePages.indexOf(s)&&this.documentHelper.scrollToBottom(this.documentHelper.selectionPage),t.isNullOrUndefined(s.endnoteWidget)&&(t.isNullOrUndefined(s.nextPage)||s.nextPage.bodyWidgets[0].index!==e.containerWidget.index)){var l=e.containerWidget;!t.isNullOrUndefined(l.nextRenderedWidget)&&l.nextRenderedWidget.sectionFormat.columns.length>1&&(l.nextRenderedWidget.columnIndex=l.columnIndex),e.containerWidget.destroyInternal(this.viewer)}}if(i.childWidgets.splice(r,0,e),e instanceof Qs&&!t.isNullOrUndefined(e.floatingElements))for(var d=0;d<e.floatingElements.length;d++){var h=e.floatingElements[d];"Inline"!==h.textWrappingStyle&&(i.floatingElements.push(h),e.bodyWidget.floatingElements.splice(e.bodyWidget.floatingElements.indexOf(h),1),i.floatingElements.sort(function(e,t){return e.y-t.y}))}e instanceof el&&e.wrapTextAround&&-1!==e.bodyWidget.floatingElements.indexOf(e)&&e.bodyWidget.floatingElements.splice(e.bodyWidget.floatingElements.indexOf(e),1),i.height+=i.height,e.containerWidget=i,e instanceof Qs&&this.updateParaOnBeforeSpacing(e,e.bodyWidget,!0)}},i.prototype.getBodyWidgetOfPreviousBlock=function(e,i){i=0;var r=void 0,n=e.previousRenderedWidget;return r=n&&n.containerWidget.equals(e.containerWidget)?n.containerWidget:e instanceof el&&!t.isNullOrUndefined(e.containerWidget.previousRenderedWidget)&&e.containerWidget.index===e.containerWidget.previousRenderedWidget.index?e.containerWidget.previousRenderedWidget:e.containerWidget,i=n&&n.containerWidget.equals(e.containerWidget)?r.childWidgets.indexOf(n):e.containerWidget.childWidgets.indexOf(e),{bodyWidget:r,index:i}},i.prototype.moveBlocksToNextPage=function(e,i,r,n,o,a,s){var l=e.bodyWidget;this.viewer.columnLayoutArea.setColumns(l.sectionFormat);var d=this.viewer.columnLayoutArea.getNextColumnByBodyWidget(e.bodyWidget),h=void 0,c=void 0;if(!(t.isNullOrUndefined(d)||s&&e instanceof Qs&&e.isEndsWithPageBreak)&&(c=this.moveToNextColumnByBodyWidget(e,r),c.columnIndex=d.index,c.y=e.bodyWidget.y,this.viewer.updateClientArea(c,c.page),this.viewer.clientActiveArea.height-=c.y-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=c.y,e.bodyWidget.sectionFormat.columns.length>1))for(var g=e.bodyWidget.columnIndex,p=e.bodyWidget.x+e.bodyWidget.sectionFormat.columns[g].width+e.bodyWidget.sectionFormat.columns[g].space,u=0;u<e.bodyWidget.floatingElements.length;u++)(e.bodyWidget.floatingElements[u]instanceof Pl||e.bodyWidget.floatingElements[u]instanceof Tl)&&p<e.bodyWidget.floatingElements[u].x+e.bodyWidget.floatingElements[u].width&&c.floatingElements.push(e.bodyWidget.floatingElements[u]);if(t.isNullOrUndefined(c)){var f=!1,m=l.page,y=m.index+1;if(this.documentHelper.pages.length>y&&!this.isMultiColumnLayout)if(h=this.documentHelper.pages[y],!o||t.isNullOrUndefined(h)||t.isNullOrUndefined(h.endnoteWidget))!t.isNullOrUndefined(h)&&0!==h.bodyWidgets.length&&l.equals(h.bodyWidgets[0])&&"NoBreak"===l.sectionFormat.breakCode?h.bodyWidgets[0].index===l.index?(c=h.bodyWidgets[0],this.viewer.updateClientArea(c,c.page)):(c=this.createSplitBody(l),h.bodyWidgets.splice(0,0,c),c.page=h,this.viewer.updateClientArea(c,c.page),c.y=this.viewer.clientActiveArea.y):0===h.bodyWidgets.length||!l.equals(h.bodyWidgets[0])||l.sectionIndex!==h.bodyWidgets[0].sectionIndex&&("NewPage"===l.sectionFormat.breakCode||!l.isWord2010NextColumn&&"NoBreak"!==l.sectionFormat.breakCode)?(h=void 0,f=!0):(c=h.bodyWidgets[0],this.viewer.updateClientArea(c,c.page));else if(h.endnoteWidget.bodyWidgets[0].index===l.index)c=h.endnoteWidget.bodyWidgets[0],this.viewer.updateClientArea(c,c.page);else{c=this.createSplitBody(l);var v=new Zs;v.footNoteType="Endnote",v.page=h,v.bodyWidgets.push(c),c.containerWidget=v,c.page=h,this.viewer.updateClientArea(c,c.page),c.y=this.viewer.clientActiveArea.y}if(this.isMultiColumnLayout&&(f=!0),t.isNullOrUndefined(h)){if(c=this.createSplitBody(l),(this.documentHelper.editorProperties.isRedoing&&"SectionBreakContinuous"===this.documentHelper.editorProperties.action&&"NoBreak"===e.bodyWidget.sectionFormat.breakCode||n)&&e.bodyWidget.sectionFormat.numberOfColumns<=1);else if(o){var W=m.bodyWidgets[l.page.bodyWidgets.length-1],b=this.createSplitBody(W);h=this.viewer.createNewPage(b,y),this.viewer.updateClientArea(b,b.page),b.y=c.y=this.viewer.clientActiveArea.y,c.page=h}else{var x=this.isRTLLayout;this.isRTLLayout=!1,h=this.viewer.createNewPage(c,y),this.isRTLLayout=x,this.viewer.updateClientArea(c,c.page),c.y=this.viewer.clientActiveArea.y}f&&!t.isNullOrUndefined(h)&&this.documentHelper.insertPage(y,h),this.clearLineMeasures()}if(h)for(;;){var w=l.page.bodyWidgets[l.page.bodyWidgets.length-1];if(this.isSectionBreakCont||l===w||l.containerWidget instanceof Zs)break;l.page.bodyWidgets.splice(l.page.bodyWidgets.indexOf(w),1),h.bodyWidgets.splice(1,0,w),w.page=h}}if(this.isTextFormat){var F=l.childWidgets.indexOf(e)+1,C=l.childWidgets.slice(F);l.childWidgets.splice(F);for(var P=0,T=C;P<T.length;P++){var O=T[P];c.childWidgets.push(O),O.containerWidget=c}}else{var S=l.lastChild;if(!this.isRelayout&&t.isNullOrUndefined(S.nextSplitWidget)&&S instanceof Qs){for(var N=0,u=0;u<S.childWidgets.length;u++)N+=S.childWidgets[u].height;S.height<N&&(S.height=N)}for(;;){var I=void 0;if(I=l.lastChild instanceof Zs?l.lastChild.previousWidget:l.lastChild,i||a&&e!==I&&!(I instanceof el)&&I.isLayouted){var k=this.getFootNoteWidgetsOf(I);this.moveFootNotesToPage(k,l,c)}if(e===I)break;if(l.childWidgets.splice(l.childWidgets.indexOf(I),1),c.childWidgets.splice(0,0,I),I instanceof el&&-1!==l.floatingElements.indexOf(I)&&l.floatingElements.splice(l.floatingElements.indexOf(I),1),I instanceof Qs&&I.floatingElements.length>0)for(var A=0;A<I.floatingElements.length;A++)-1!==l.floatingElements.indexOf(I.floatingElements[A])&&"Inline"!==I.floatingElements[A].textWrappingStyle&&(l.floatingElements.splice(l.floatingElements.indexOf(I.floatingElements[A]),1),c.floatingElements.push(I.floatingElements[A]));I.containerWidget=c,c.height+=I.height}}return c},i.prototype.createSplitBody=function(e){var t=this.addBodyWidget(this.viewer.clientActiveArea);return t.sectionFormat=e.sectionFormat,t.index=e.index,t},i.prototype.createOrGetNextColumnBody=function(e){var i;return e.nextRenderedWidget&&e.columnIndex+1===e.nextRenderedWidget.columnIndex&&(i=e.nextRenderedWidget),t.isNullOrUndefined(i)&&((i=new Ys).sectionFormat=e.sectionFormat,i.index=e.index,i.page=e.page,i.y=e.y,e.containerWidget instanceof Zs?(e.containerWidget.bodyWidgets.splice(e.containerWidget.bodyWidgets.indexOf(e)+1,0,i),i.containerWidget=e.containerWidget):e.page.bodyWidgets.splice(e.page.bodyWidgets.indexOf(e)+1,0,i)),i},i.prototype.getParagraphBaseX=function(e){var t=e.containerWidget,i=bs.convertPointToPixel(e.bidi?e.rightIndent:e.leftIndent);return t.x+i},i.prototype.reLayoutParagraphAfterHidden=function(e){if(!e.nextSplitWidget){var t=e.nextWidget;if(t instanceof Qs&&!t.isEmpty()&&0!==t.childWidgets.length&&!t.isInsideTable){var i=t.x!==this.getParagraphBaseX(t);(this.isMergedWithNextParagraph(e)||i)&&this.reLayoutLine(t,0,!1,!0,!0)}}},i.prototype.moveToNextColumnByBodyWidget=function(e,t){var i=e.containerWidget;return this.createOrGetNextColumnBody(i)},i.prototype.reLayoutLine=function(e,i,r,n,o,a){this.documentHelper.editorProperties.isFootnoteElementRemoved||(this.isFootnoteContentChanged=!1),this.documentHelper.editorProperties.isDocumentLoaded&&!o&&this.updateWholeListItems(e);var s;s=e.paragraphFormat.listFormat&&-1!==e.paragraphFormat.listFormat.listId?e.getSplitWidgets()[0].firstChild:e.childWidgets[i];var l;e.containerWidget instanceof Ys&&e.containerWidget.sectionFormat.numberOfColumns>1&&e.containerWidget.sectionFormat.equalWidth&&(l=s.previousLine),t.isNullOrUndefined(l)&&(l=!t.isNullOrUndefined(a)&&!t.isNullOrUndefined(s.previousLine)&&s.previousLine.indexInOwner<s.indexInOwner?s.previousLine:s),!this.allowLayout||this.owner.editorProperties.enableSpellCheck&&this.owner.editorProperties.skipChangeDetection||(l.paragraph.splitTextRangeByScriptType(l.indexInOwner),l.paragraph.splitLtrAndRtlText(l.indexInOwner),l.paragraph.combineconsecutiveRTL(l.indexInOwner));var d=e.containerWidget;d.height-=e.height,!this.documentHelper.editorProperties.enableHeaderAndFooter&&!e.isInHeaderFooter||d instanceof Ol?d instanceof Ol?this.viewer.updateClientAreaForTextBoxShape(d.containerShape,!0):this.viewer.updateClientArea(d,d.page,!0):(e.bodyWidget.isEmpty=!1,this.viewer.updateHeaderFooterClientAreaWithTop(e.bodyWidget.sectionFormat,this.documentHelper.isBlockInHeader(e),d.page)),this.viewer.updateClientAreaForBlock(e,!0);var h=0;if(e.containerWidget instanceof Ys&&(h=(m=(f=e.getSplitWidgets())[f.length-1]).containerWidget.page.index),!t.isNullOrUndefined(e.containerWidget)&&!t.isNullOrUndefined(e.containerWidget.containerWidget)&&e.containerWidget.containerWidget instanceof Zs){O=e.bodyWidget.containerWidget.y;return this.viewer.cutFromTop(O),this.documentHelper.editorProperties.isFootNoteInsert=!0,this.layoutfootNote(e.containerWidget.containerWidget),void(this.documentHelper.editorProperties.isFootNoteInsert=!1)}if(l.paragraph.isEmptyInternal(!0)&&t.isNullOrUndefined(l.paragraph.nextSplitWidget))this.viewer.cutFromTop(e.y),this.layoutParagraph(e,0);else if(0===l.children.length&&l.isLastLine()&&!t.isNullOrUndefined(l.previousLine)&&l.previousLine.isEndsWithLineBreak)this.updateClientAreaForLine(l),this.layoutEmptyLineWidget(e,!0,l),this.updateWidgetToPage(this.viewer,e);else{if(this.updateClientAreaForLine(l),this.layoutListItems(l.paragraph),l.isFirstLine()&&!t.isNullOrUndefined(e.paragraphFormat)){var c=-bs.convertPointToPixel(e.paragraphFormat.firstLineIndent);this.viewer.updateClientWidth(c)}var g=e.previousWidget;if(l.isFirstLine()&&!e.previousSplitWidget&&g instanceof Qs&&this.isMergedWithNextParagraph(g)){e.x=this.viewer.clientActiveArea.x;var p=Math.max(0,this.getMergedParagraphOffset(e));e.x+=p,this.mergedParagraph=e,this.mergedParagraphOffset=p,this.viewer.updateClientWidth(-p)}do{e=(l=this.layoutLine(l,0)).paragraph,l=l.nextLine}while(l);this.updateWidgetToPage(this.viewer,e)}this.isMergedWithNextParagraph(e)&&(e.height=0,this.viewer.clientActiveArea.y=e.y),this.viewer.updateClientAreaForBlock(e,!1);var u=0;if(e.containerWidget instanceof Ys){var f=e.getSplitWidgets(),m=f[f.length-1];u=m.containerWidget.page.index}this.layoutNextItemsBlock(e,this.viewer,void 0,h!==u),this.reLayoutParagraphAfterHidden(e);var y=e.getSplitWidgets()[0].previousRenderedWidget;if(!(t.isNullOrUndefined(y)||e.isEndsWithPageBreak||e.isEndsWithColumnBreak||y instanceof Qs&&(!(y instanceof Qs)||y.isEndsWithPageBreak||y.isEndsWithColumnBreak)||(this.viewer.cutFromTop(e.y+e.height),e.containerWidget===y.containerWidget||t.isNullOrUndefined(y.containerWidget)))){var v=e.containerWidget,W=y.containerWidget,b=this.getFootNoteWidgetsOf(e);t.isNullOrUndefined(W.page.footnoteWidget)||this.moveFootNotesToPage(b,W,v)}var x,w=this.documentHelper.pages.length,F=this.documentHelper.pages[w-1],C=F.bodyWidgets[F.bodyWidgets.length-1];if(!this.documentHelper.editorProperties.isFootnoteElementRemoved&&!this.isFootnoteContentChanged||t.isNullOrUndefined(e.bodyWidget.page.footnoteWidget)||(x=e.bodyWidget.page.footnoteWidget,this.layoutfootNote(x)),this.documentHelper.editorProperties.isRedoing&&!t.isNullOrUndefined(C.page.endnoteWidget)&&(this.isEndnoteContentChanged=!0),(this.documentHelper.editorProperties.isEndnoteElementRemoved||this.isEndnoteContentChanged)&&!t.isNullOrUndefined(C.page.endnoteWidget)){x=C.page.endnoteWidget;var P=this.viewer.clientArea.clone(),T=this.viewer.clientActiveArea.clone(),O=C.y;if(C.childWidgets.length>0){var S=C.childWidgets[C.childWidgets.length-1];O=S.y+S.height}this.viewer.clientActiveArea.height=this.viewer.clientActiveArea.bottom-O,this.viewer.clientActiveArea.x=this.viewer.clientArea.x,this.viewer.clientActiveArea.width=this.viewer.clientArea.width,this.viewer.clientActiveArea.y=O,this.layoutfootNote(x),this.viewer.clientArea=P,this.viewer.clientActiveArea=T}this.documentHelper.editorProperties.isRedoing&&(this.isEndnoteContentChanged=!1)},i.prototype.isContainsRtl=function(e){if(this.documentHelper.editorProperties.isSelectionChangedOnMouseMoved&&!this.isDocumentContainsRtl)return!1;for(var t=!1,i=0;i<e.children.length;i++)if(e.children[i]instanceof hl&&(t=e.children[i].characterFormat.bidi||"RTL"===e.children[i].characterFormat.bdo||this.documentHelper.textHelper.isRTLText(e.children[i].text))){this.isDocumentContainsRtl||(this.isDocumentContainsRtl=t);break}return t},i.prototype.shiftElementsForRTLLayouting=function(i,r){var n=this.hasTextRangeBidi(i);if(this.isContainsRTLText(i)||r||n){for(var o=[],a=[],s=0;s<i.children.length;s++){var l=i.children[s];if(l instanceof hl&&l.height>0&&!l.isPageBreak&&"\v"!==l.text){g=l;a.push(g.characterFormat.bidi),"\t"==g.text?o.push(e.CharacterRangeType.Tab):o.push(g.characterRange),l.isRightToLeft=o[o.length-1]==e.CharacterRangeType.RightToLeft||o[o.length-1]==e.CharacterRangeType.WordSplit&&g.characterFormat.bidi}else if(l instanceof Jl||l instanceof ml||l instanceof Ll||l instanceof Al||l instanceof yl||l instanceof ol){var d=this.isStartMarker(l),h=this.isEndMarker(l);if(d&&s<i.children.length-1){var c=this.getNextValidWidget(s+1,i);if(!t.isNullOrUndefined(c)&&c instanceof hl&&c.height>0){var g=c;a.push(g.characterFormat.bidi),"\t"===c.text?o.push(e.CharacterRangeType.Tab):o.push(g.characterRange)}else a.push(!1),o.push(e.CharacterRangeType.LeftToRight)}else!h&&s>0?(a.push(a[a.length-1]),o.push(o[o.length-1])):(a.push(!1),o.push(e.CharacterRangeType.LeftToRight))}else l instanceof kl&&r?(a.push(r),o.push(e.CharacterRangeType.RightToLeft)):(a.push(!1),o.push(e.CharacterRangeType.LeftToRight))}for(var p=-1,u=void 0,s=0;s<o.length;s++)if(s+1<a.length&&a[s]!=a[s+1])-1!=p&&(this.updateCharacterRange(i,s,p,a,o),p=-1),u=null;else{if(s>0&&s!=o.length-1&&o[s]==e.CharacterRangeType.WordSplit&&a[s]&&o[s-1]==e.CharacterRangeType.Number&&a[s-1]&&o[s+1]==e.CharacterRangeType.Number&&a[s+1]&&this.isNumberNonReversingCharacter(i.children[s]))o[s]=e.CharacterRangeType.Number;else if(o[s]==e.CharacterRangeType.RightToLeft||o[s]==e.CharacterRangeType.LeftToRight||o[s]==e.CharacterRangeType.Number&&-1!=p||(t.isNullOrUndefined(u)||!u)&&a[s])if(-1==p&&o[s]!=e.CharacterRangeType.LeftToRight)p=s;else{if(-1==p){o[s]==e.CharacterRangeType.LeftToRight?u=!0:o[s]==e.CharacterRangeType.RightToLeft&&(u=!1);continue}o[s]==e.CharacterRangeType.LeftToRight&&(this.updateCharacterRange(i,s,p,a,o),p=o[s]==e.CharacterRangeType.RightToLeft||o[s]==e.CharacterRangeType.Number&&-1!=p?s:-1)}o[s]==e.CharacterRangeType.LeftToRight?u=!0:o[s]==e.CharacterRangeType.RightToLeft&&(u=!1)}if(-1!=p&&p<o.length-1&&(this.updateCharacterRange(i,o.length-1,p,a,o),p=-1),o.length!=i.children.length)throw new Error("Splitted Widget count mismatch while reordering layouted child widgets of a line");var f=this.reorderElements(i,o,a,r);a.length=0,o.length=0,i.children.length>0&&(i.layoutedElements=f)}return r},i.prototype.isNumberNonReversingCharacter=function(e){if(e instanceof hl){var t=e;if(!t.characterFormat.hasValueWithParent("localeIdBidi"))return hd.isNumberNonReversingCharacter(t.text,t.characterFormat.bidi);var i=t.text.charCodeAt(0);if(47==i&&!this.isNumberReverseLangForSlash(t.characterFormat.localeIdBidi)||(35==i||36==i||37==i||43==i||45==i)&&!this.isNumberReverseLangForOthers(t.characterFormat.localeIdBidi)||44==i||46==i||58==i||1548==i)return!0}return!1},i.prototype.isNumberReverseLangForSlash=function(e){return this.isNumberReverseLangForOthers(e)||6145==e||1164==e||1125==e||1120==e||1123==e||1065==e||2137==e||1114==e||1119==e||1152==e||1056==e},i.prototype.isNumberReverseLangForOthers=function(e){return 14337==e||15361==e||5121==e||3073==e||2049==e||11265==e||13313==e||12289==e||4097==e||8193==e||16385==e||1025==e||10241==e||7169==e||9217==e},i.prototype.isStartMarker=function(e){return e instanceof Jl?0===e.commentType:e instanceof ml?0===e.bookmarkType:e instanceof Ll||(e instanceof yl?0===e.type:e instanceof ol&&0===e.fieldType)},i.prototype.isEndMarker=function(e){return e instanceof Jl?1===e.commentType:e instanceof ml?1===e.bookmarkType:e instanceof Ll||(e instanceof yl?1===e.type:e instanceof ol&&1===e.fieldType)},i.prototype.getNextValidWidget=function(e,t){for(var i=e;i<t.children.length;i++){var r=t.children[i];if(!(r instanceof Jl||r instanceof ml||r instanceof Ll||r instanceof Al||r instanceof yl||r instanceof ol))return r[i]}return null},i.prototype.hasTextRangeBidi=function(e){for(var t=0;t<e.children.length;t++){var i=e.children[t];if(i instanceof hl&&i.characterFormat.bidi)return!0}return!1},i.prototype.isContainsRTLText=function(e){for(var t=e.paragraph.bodyWidget.page.documentHelper.textHelper,i=!1,r=0;r<e.children.length&&!(e.children[r]instanceof hl&&(i=e.children[r].characterFormat.bidi||1==e.children[r].characterFormat.bidi||t.isRTLText(e.children[r].text)));r++);return i},i.prototype.updateCharacterRange=function(t,i,r,n,o){var a=i;if(!n[i]&&(o[i]===e.CharacterRangeType.LeftToRight&&a--,"StandardContextual"!==this.documentHelper.characterFormat.ligature))for(s=a;s>=r;s--)if(o[s]!=e.CharacterRangeType.WordSplit){a=s;break}for(var s=r;s<=a;s++)if(o[s]==e.CharacterRangeType.WordSplit){o[s]=e.CharacterRangeType.RightToLeft|e.CharacterRangeType.WordSplit;var l=s-1,d=s+1;if(l>=0&&d<o.length&&o[l]==e.CharacterRangeType.RightToLeft&&(o[d]==e.CharacterRangeType.RightToLeft||o[d]==e.CharacterRangeType.Number)&&t.children[s]instanceof hl){var h=t.children[s];if("Times New Roman"==h.characterFormat.fontFamilyBidi){var c=h.text.split("").reverse().join("");h.text=c}}}},i.prototype.isPageOrNumPageField=function(e){var t,i=function(e){return!!e&&void 0!==e.fieldType};if(i(e))t=0===e.fieldType?e:e.fieldBegin;else for(var r=e.previousElement,n=0;r;){if(i(r))if(1===r.fieldType)n++;else if(0===r.fieldType){if(0===n){t=r;break}n--}r=r.previousElement}if(!t)return!1;for(var o="",a=t.nextElement;a&&!i(a);)"string"==typeof a.text&&(o+=a.text),a=a.nextElement;return/^\s*(NUMPAGES|PAGE)(\s|$)/i.test(o)},i.prototype.isNeedToConsiderPagefieldAsBidi=function(e,i,r){var n=e.paragraph;return!t.isNullOrUndefined(n)&&n.isInHeaderFooter&&i&&this.isPageOrNumPageField(r)},i.prototype.reorderElements=function(i,r,n,o){for(var a=0,s=-1,l=0,d=0,h=[],c=e.CharacterRangeType.LeftToRight,g=!1,p=0;p<i.children.length;p++){var u=i.children[p],f=u;f.characterRange=r[p];var m=(f.characterRange&e.CharacterRangeType.RightToLeft)==e.CharacterRangeType.RightToLeft||f.characterRange==e.CharacterRangeType.Number,y=this.isNeedToConsiderPagefieldAsBidi(i,g,u),v=n[p]||y;u instanceof ul&&(u.isRtlPageNumber=y&&!n[p]);var W=f.text;if(!t.isNullOrUndefined(W)&&0!=(f.characterRange&e.CharacterRangeType.WordSplit)){var b=-1!==W.indexOf(""),x=W.replace(/[\u200E\u200F]/g,"").trim();/[.,\u060C]/.test(x)&&c!==e.CharacterRangeType.Number&&b&&(m=c==e.CharacterRangeType.RightToLeft)}if(r[p]==e.CharacterRangeType.Tab){if(o){a=0,s=-1,l=0,c=e.CharacterRangeType.LeftToRight,g=!1,h.splice(a,0,u);continue}v&&(v=!1)}p>0&&g!=v&&(o?(a=0,s=-1,l=0):s=h.length-1,d=0),v||m?m||v&&f.characterRange==e.CharacterRangeType.WordSplit&&(c==e.CharacterRangeType.RightToLeft||this.isInsertWordSplitToLeft(r,n,p))?(l++,a=s+1,f.characterRange==e.CharacterRangeType.Number&&(c==e.CharacterRangeType.Number&&(a+=d),d++),h.splice(a,0,u)):(h.splice(a,0,u),a++,l=0):(o?(l>0&&g==v&&(a+=l),h.splice(a,0,u),a++):(h.push(u),a=p+1),l=0,s=o?a-1:h.length-1),f.characterRange!=e.CharacterRangeType.Number&&(d=0),f.characterRange!=e.CharacterRangeType.WordSplit&&(c=f.characterRange),g=v}return h},i.prototype.isInsertWordSplitToLeft=function(t,i,r){for(var n=r+1;n<t.length;n++){if((t[n]&e.CharacterRangeType.RightToLeft)==e.CharacterRangeType.RightToLeft)return!0;if(t[n]==e.CharacterRangeType.LeftToRight)return!i[n]}return!0},i.prototype.shiftLayoutFloatingItems=function(e){for(var t=0;t<e.floatingElements.length;t++){var i=e.floatingElements[t],r=this.getFloatingItemPoints(i),n=r.y-i.y;if(i.x=r.x,i.y=r.y,i instanceof Pl)for(var o=0;o<i.textFrame.childWidgets.length;o++){var a=i.textFrame.childWidgets[o];a instanceof Qs?a.y=a.y+n:a instanceof el&&this.shiftChildLocationForTableWidget(a,n)}}},i.prototype.getFloatingItemPoints=function(e){var i=e.line.paragraph;if(t.isNullOrUndefined(i)||t.isNullOrUndefined(i.bodyWidget)||t.isNullOrUndefined(i.bodyWidget.sectionFormat))return new xs(0,0);var r=i.bodyWidget.sectionFormat,n=0,o=0;if(i){var a=bs.convertPointToPixel(r.leftMargin),s=bs.convertPointToPixel(r.rightMargin),l=bs.convertPointToPixel(r.topMargin),d=r.bottomMargin>0?bs.convertPointToPixel(r.bottomMargin):48,h=bs.convertPointToPixel(r.headerDistance),c=bs.convertPointToPixel(r.footerDistance),g=bs.convertPointToPixel(r.pageWidth),p=bs.convertPointToPixel(r.pageHeight),u=g-(a+s),f=p-l-d;l=i.isInHeaderFooter&&r.topMargin<=0?Math.abs(l)>0?Math.abs(l):bs.convertPointToPixel(r.headerDistance)+i.height:l>0?l:48,!i.isInHeaderFooter&&l<this.viewer.clientArea.y&&(l=this.viewer.clientArea.y);var m="InFrontOfText",y=!1,v=e.verticalOrigin,W=e.horizontalOrigin,b=e.horizontalAlignment,x=e.verticalAlignment,w=e.verticalRelativePercent,F=(e.horizontalRelativePercent,e.height),C=e.width,P=e.verticalPosition,T=e.horizontalPosition,O=e.layoutInCell,S=e.heightRelativePercent,N=e.widthRelativePercent,I=void 0;if((e instanceof Pl||e instanceof Tl)&&(I=e.autoShapeType),i.isInsideTable&&O)y=!0,o=this.getVerticalPosition(e,P,v,m),n=this.getHorizontalPosition(e.width,e,b,W,T,m,i.associatedCell.cellFormat.cellWidth);else if(this.documentHelper.viewer instanceof Ms){switch(v){case"Line":o=this.documentHelper.editorProperties.getTop(e.line);break;default:o=this.viewer.clientActiveArea.y}switch(W){case"Character":n=this.viewer.clientActiveArea.x;break;default:switch(b){case"Center":n=this.viewer.clientArea.width/2-e.width/2;break;default:n=this.viewer.clientArea.x}}}else{switch(v){case"Page":case"TopMargin":switch(o=P,x){case"Top":o=P;break;case"Center":"TopMargin"===v?o=(l-F)/2:S>0&&N>0?(o=(p-p*(S/100))/2,e.height=p*(S/100)):o=(p-F)/2;break;case"Outside":case"Bottom":o="Page"===v&&"Bottom"===x?p-F:"TopMargin"===v?l-F:(i.bodyWidget.page.index+1)%2!=0?p-F-c/2:h/2;break;case"Inside":"Page"===v?o=(i.bodyWidget.page.index+1)%2==0?p-F-c/2:h/2:(i.bodyWidget.page.index+1)%2==0&&(o=(l-F)/2-h);break;case"None":o=w>0&&Math.abs(w)<=1e3?p*(w/100):P}break;case"Line":switch(o=P,x){case"Inside":case"Top":o=this.viewer.clientActiveArea.y;break;case"Center":o=this.viewer.clientActiveArea.y-F/2;break;case"Outside":case"Bottom":o=this.viewer.clientActiveArea.y-F;break;case"None":o=this.viewer.clientActiveArea.y+P}break;case"BottomMargin":switch(o=P,x){case"Inside":case"Top":o=p-d;break;case"Center":o=p-d+(d-F)/2;break;case"Outside":case"Bottom":o=i.bodyWidget.page.index+1!==0&&"Outside"===x?p-d:p-F;break;case"None":o=p-d+P}break;case"InsideMargin":case"OutsideMargin":switch(o=P,x){case"Inside":o="InsideMargin"===v?"InsideMargin"===v&&i.bodyWidget.page.index+1===0?p-F:0:(i.bodyWidget.page.index+1)%2!=0?p-d:l-F;break;case"Top":o="InsideMargin"===v?(i.bodyWidget.page.index+1)%2==0?p-d:0:(i.bodyWidget.page.index+1)%2!=0?p-d:0;break;case"Center":o="OutsideMargin"===v?(i.bodyWidget.page.index+1)%2!=0?p-d+(d-F)/2:(l-F)/2:(i.bodyWidget.page.index+1)%2==0?p-d+(d-F)/2:(l-F)/2;break;case"Outside":o="InsideMargin"===v?(i.bodyWidget.page.index+1)%2==0?p-d:l-F:(i.bodyWidget.page.index+1)%2!=0?l-F:p-d;break;case"Bottom":o="OutsideMargin"===v?i.bodyWidget.page.index+1!==0?p-F:l-F:(i.bodyWidget.page.index+1)%2==0?p-F:l-F}break;case"Paragraph":o=Math.round(i.y)+0+P;break;case"Margin":switch(o=i.isInHeaderFooter&&h>l?h+i.height+P:l+P,x){case"Top":o=l;break;case"Center":o=l+(f-F)/2;break;case"Outside":case"Bottom":o=(i.bodyWidget.page.index+1)%2!=0?l+f-F:l;break;case"Inside":o=(i.bodyWidget.page.index+1)%2==0?l+f-F:l}break;default:o=this.viewer.clientArea.y-P}switch(W){case"Page":switch(n=T,b){case"Center":y?n=(i.associatedCell.cellFormat.cellWidth-C)/2:S>0&&N>0?(n=(g-g*(N/100))/2,e.width=g*(N/100)):n=(g-C)/2;break;case"Left":n=0;break;case"Outside":case"Right":n=y?i.associatedCell.cellFormat.cellWidth-C:g-C;break;case"None":n=y?i.associatedCell.x+T:T}n<0&&y&&(n=i.associatedCell.x);break;case"Column":var k=!1;switch(this.viewer.clientActiveArea.x<i.x?n=i.x+T:!e.paragraph.isInsideTable&&("StraightConnector"===I||"Rectangle"===I||e instanceof Il)?(k=!0,n=T+i.bodyWidget.x):n=i.x+T,i.paragraphFormat.leftIndent&&!k&&(n-=bs.convertPointToPixel(i.leftIndent)),b){case"Center":n=this.viewer.clientActiveArea.x+(this.viewer.clientActiveArea.width-C)/2;break;case"Left":n=this.viewer.clientActiveArea.x;break;case"Right":n=this.viewer.clientActiveArea.x+this.viewer.clientActiveArea.width-C}break;case"Margin":if(i.bodyWidget){switch(n=a+T,b){case"Center":n=a+(u-C)/2;break;case"Left":n=a;break;case"Outside":(i.bodyWidget.page.index+1)%2!=0&&(n=a+u-C);break;case"Right":n=a+u-C;break;case"Inside":(i.bodyWidget.page.index+1)%2==0&&(n=a+u-C)}if((e instanceof Il||e instanceof Pl||e instanceof Tl)&&i.bodyWidget.floatingElements&&"InFrontOfText"!==e.textWrappingStyle&&"Behind"!==e.textWrappingStyle){var A=this.adjustPositionForFloatingTableCollision(n,o,e,g);n=A.x,o=A.y}}else n=this.viewer.clientArea.x+T;break;case"Character":n="Right"===b||"Center"===b?this.getLeftMarginHorizPosition(a,b,T,C,m):this.viewer.clientActiveArea.x+T;break;case"LeftMargin":n=this.getLeftMarginHorizPosition(a,b,T,C,m);break;case"RightMargin":n=this.getRightMarginHorizPosition(g,s,b,T,C,m);break;case"InsideMargin":n=(i.bodyWidget.page.index+1)%2==0?this.getRightMarginHorizPosition(g,s,b,T,C,m):this.getLeftMarginHorizPosition(a,b,T,C,m);break;case"OutsideMargin":n=(i.bodyWidget.page.index+1)%2==0?this.getLeftMarginHorizPosition(a,b,T,C,m):this.getRightMarginHorizPosition(g,s,b,T,C,m);break;default:n=this.viewer.clientArea.x+T}}!i||"Paragraph"!==v&&"Line"!==v||"InFrontOfText"===e.textWrappingStyle||"Behind"===e.textWrappingStyle||"Word2013"===this.documentHelper.compatibilityMode&&(i.isInHeaderFooter||(o+e.height>this.viewer.clientArea.bottom&&(o=this.viewer.clientArea.bottom-e.height),o<r.topMargin&&(o=r.topMargin)))}return new xs(n,o)},i.prototype.adjustPositionForFloatingTableCollision=function(e,t,i,r){var n={x:e,y:t},o=i.paragraph.bodyWidget;if(!o.floatingElements||0===o.floatingElements.length)return n;for(var a=0;a<o.floatingElements.length;a++){var s=o.floatingElements[a];if(s instanceof el&&!(i.allowOverlap&&s instanceof el&&s.positioning.allowOverlap)){var l=this.viewer.clientArea.y,d=this.viewer.clientArea.bottom,h=s.x,c=s.y,g=h+this.getTableWidth(s),p=c+s.height,u={x:h-s.positioning.distanceLeft,y:c-s.positioning.distanceTop,right:g+s.positioning.distanceRight,bottom:p+s.positioning.distanceBottom},f=u.x,m=r-u.right,y=u.y-l,v=d-u.bottom,W=e+i.width,b=t+i.height,x=e<u.right&&W>u.x,w=t<u.bottom&&b>u.y;if(x&&w)return m>=i.width?(n.x=u.right,n):f>=i.width?(n.x=u.x-i.width,n):v>=i.height?(n.y=u.bottom,n):y>=i.height?(n.y=u.y-i.height,n):n}}return n},i.prototype.getLeftMarginHorizPosition=function(e,t,i,r,n){var o=i;switch(t){case"Center":o=(e-r)/2;break;case"Left":o=0;break;case"Right":o=e-r}return o<0&&"InFrontOfText"!==n&&"Behind"!==n&&(o=0),o},i.prototype.getRightMarginHorizPosition=function(e,t,i,r,n,o){var a=e-t,s=a+r;switch(i){case"Center":s=a+(t-n)/2;break;case"Left":s=a;break;case"Right":s=e-n}return(s<0||s+n>e)&&"InFrontOfText"!==o&&"Behind"!==o&&(s=e-n),s},i.prototype.getVerticalPosition=function(e,t,i,r){var n=e.line.paragraph,o=e,a=0,s=n.associatedCell.y;switch(i){case"Page":case"Margin":case"TopMargin":case"InsideMargin":case"BottomMargin":case"OutsideMargin":a=s+t;break;case"Line":case"Paragraph":a=n.y+t+0,"Square"==o.textWrappingStyle&&(a=a<=n.associatedCell.y?n.associatedCell.y:a);break;default:a=this.viewer.clientActiveArea.y+t}return a},i.prototype.getHorizontalPosition=function(e,t,i,r,n,o,a){var s=0,l=t.line.paragraph.associatedCell,d=a-l.leftMargin-l.rightMargin,h=l.width,c=l.x,g=c-l.leftMargin;switch(r){case"Page":switch(s=n,i){case"Center":s=g+(d-e)/2;break;case"Left":s=g;break;case"Right":s=g+(d-e);break;case"None":s=g+n}break;case"Column":case"Margin":switch(i){case"Center":s=c+(h-e)/2;break;case"Left":s=c;break;case"Right":s=c+(h-e);break;case"None":s=c+n}break;default:s=c+n}return s},i.prototype.updateTableFloatPoints=function(e){if(e.wrapTextAround){var i=e.getTableCellWidth(),r=e.positioning,n=e.bodyWidget.sectionFormat;if(this.documentHelper.viewer instanceof Ms)"Margin"!==r.horizontalOrigin&&"Page"!==r.horizontalOrigin&&"Column"!==r.horizontalOrigin||("Right"===r.horizontalAlignment||"Outside"===r.horizontalAlignment?this.viewer.clientActiveArea.x=this.viewer.clientArea.width-i:this.viewer.clientActiveArea.x=this.viewer.clientArea.x);else if(e.containerWidget instanceof Ol||e.isInsideTable){if(e.isInsideTable){var o=e.containerWidget,a=o.cellFormat;if("Page"===r.verticalOrigin?(this.viewer.clientActiveArea.y=o.y,this.viewer.clientActiveArea.y+=bs.convertPointToPixel(r.verticalPosition)):"Margin"===r.verticalOrigin?(this.viewer.clientActiveArea.y+=bs.convertPointToPixel(r.verticalPosition),(this.viewer.clientActiveArea.y<o.y||"Top"===r.verticalAlignment)&&(this.viewer.clientActiveArea.y=o.y)):this.viewer.clientActiveArea.y+bs.convertPointToPixel(r.verticalPosition)<o.y?this.viewer.clientActiveArea.y=o.y:this.viewer.clientActiveArea.y+=bs.convertPointToPixel(r.verticalPosition),"Page"===r.horizontalOrigin?"Left"===r.horizontalAlignment||"Inside"===r.horizontalAlignment?this.viewer.clientActiveArea.x=o.x:"Right"!==r.horizontalAlignment&&"Outside"!==r.horizontalAlignment||(this.viewer.clientActiveArea.x=o.x+a.preferredWidth-i):"Margin"!==r.horizontalOrigin&&"Column"!==r.horizontalOrigin||("Left"===r.horizontalAlignment||"Inside"===r.horizontalAlignment?this.viewer.clientActiveArea.x=o.x+o.leftMargin:"Right"!==r.horizontalAlignment&&"Outside"!==r.horizontalAlignment||(this.viewer.clientActiveArea.x=o.x+a.preferredWidth-(i+o.rightMargin))),Math.round(r.horizontalPosition)>0&&(this.viewer.clientActiveArea.x=o.x,"Margin"===r.horizontalOrigin&&(this.viewer.clientActiveArea.x+=o.leftMargin),this.viewer.clientActiveArea.x+=bs.convertPointToPixel(r.horizontalPosition)),"Center"===r.horizontalAlignment){var s=o.width,l=o.x+(s-i)/2,d=o.x+o.margin.left;this.viewer.clientActiveArea.x=i>s?d:Math.max(d,l)}}}else"Page"===r.verticalOrigin?"Top"===r.verticalAlignment?this.viewer.clientActiveArea.y=0:"Inside"===r.verticalAlignment?this.viewer.clientActiveArea.y=0:(t.isNullOrUndefined(r.verticalAlignment)||"None"===r.verticalAlignment)&&(this.viewer.clientActiveArea.y=bs.convertPointToPixel(r.verticalPosition)):"Margin"===r.verticalOrigin?"Top"===r.verticalAlignment?this.viewer.clientActiveArea.y=bs.convertPointToPixel(n.topMargin):"Inside"===r.verticalAlignment?this.viewer.clientActiveArea.y=bs.convertPointToPixel(n.topMargin):0==Math.round(r.verticalPosition)||t.isNullOrUndefined(n.topMargin)?n.numberOfColumns>1&&!t.isNullOrUndefined(n.topMargin)?this.viewer.clientActiveArea.y=bs.convertPointToPixel(n.topMargin):this.viewer.clientActiveArea.y=bs.convertPointToPixel(r.verticalPosition):this.viewer.clientActiveArea.y=bs.convertPointToPixel(n.topMargin+r.verticalPosition):"Paragraph"===r.verticalOrigin&&("Bottom"===r.verticalAlignment||"Center"===r.verticalAlignment||"Top"===r.verticalAlignment||"Inside"===r.verticalAlignment||"Outside"===r.verticalAlignment?this.viewer.clientActiveArea.y=e.y:(t.isNullOrUndefined(r.verticalAlignment)||"None"===r.verticalAlignment)&&(this.viewer.clientActiveArea.y+=bs.convertPointToPixel(r.verticalPosition))),"Page"===r.horizontalOrigin?"Left"===r.horizontalAlignment?this.viewer.clientActiveArea.x=0:"Inside"===r.horizontalAlignment?this.viewer.clientActiveArea.x=0:"Right"===r.horizontalAlignment?this.viewer.clientActiveArea.x=bs.convertPointToPixel(n.pageWidth)-i:"Outside"===r.horizontalAlignment?this.viewer.clientActiveArea.x=bs.convertPointToPixel(n.pageWidth)-i:"Center"===r.horizontalAlignment&&(this.viewer.clientActiveArea.x=(bs.convertPointToPixel(n.pageWidth)-i)/2):"Margin"!==r.horizontalOrigin&&"Column"!==r.horizontalOrigin||("Left"===r.horizontalAlignment?(this.viewer.clientActiveArea.x=bs.convertPointToPixel(n.leftMargin),"Word2013"===this.documentHelper.compatibilityMode||e.isInsideTable||(this.viewer.clientActiveArea.x=this.viewer.clientActiveArea.x-bs.convertPointToPixel(e.firstChild.firstChild.leftMargin))):"Inside"===r.horizontalAlignment?this.viewer.clientActiveArea.x=bs.convertPointToPixel(n.leftMargin):"Right"===r.horizontalAlignment?this.viewer.clientActiveArea.x=bs.convertPointToPixel(n.pageWidth)-(bs.convertPointToPixel(n.rightMargin)+i):"Outside"===r.horizontalAlignment?this.viewer.clientActiveArea.x=bs.convertPointToPixel(n.pageWidth)-(bs.convertPointToPixel(n.rightMargin)+i):"Center"===r.horizontalAlignment&&(this.viewer.clientActiveArea.x=bs.convertPointToPixel(n.leftMargin)+(bs.convertPointToPixel(n.pageWidth-n.rightMargin-n.leftMargin)-i)/2)),(Math.round(r.horizontalPosition)>0||("Margin"===r.horizontalOrigin||"Column"===r.horizontalOrigin)&&"Left"===r.horizontalAlignment)&&(this.viewer.clientActiveArea.x+=bs.convertPointToPixel(r.horizontalPosition))}e.x=this.viewer.clientActiveArea.x,e.y=this.viewer.clientActiveArea.y},i.prototype.isTocField=function(e){if(e instanceof ol){var t=e.nextNode;if(e instanceof ol&&0===e.fieldType&&t instanceof hl&&-1!==t.text.trim().toLowerCase().indexOf("toc"))return!0}return!1},i.prototype.getTotalColumnSpan=function(e){for(var t=e,i=0,r=0;r<t.childWidgets.length;r++)i+=t.childWidgets[r].cellFormat.columnSpan;return i},i.prototype.getMaximumRightCellBorderWidth=function(e){for(var t=0,i=0;i<e.childWidgets.length;i++){var r=e.childWidgets[i],n=r.childWidgets[r.childWidgets.length-1].cellFormat.borders.right.lineWidth;t<n&&(t=n)}return t},i.prototype.getDefaultBorderSpacingValue=function(e,t,i){return 0==e?(e="Word2013"!=this.documentHelper.compatibilityMode&&"Center"==i?1.5:.75,!0):t},i.prototype.getMinimumWidthRequiredForTable=function(e,t,i){var r=0;return r="Word2013"==this.documentHelper.compatibilityMode?"Center"==t?e?18.5+Math.round(.375):18.5+Math.round(i/2):e?19.25:18.5+i:"Center"==t?e?19.25:18.5+i/2:.25==i?18.5:19.3,bs.convertPointToPixel(r)},i.prototype.shiftFloatingItemsFromTable=function(e,t){if(e.containerWidget instanceof Ys)for(var i=0;i<e.containerWidget.floatingElements.length;i++){var r=e.containerWidget.floatingElements[i];!(r instanceof el)&&r.paragraph.containerWidget instanceof il&&r.paragraph.containerWidget.ownerTable.containerWidget.ownerTable==e&&(t.floatingElements.push(e.containerWidget.floatingElements[i]),e.containerWidget.floatingElements.splice(e.containerWidget.floatingElements.indexOf(e.containerWidget.floatingElements[i]),1),this.shiftedFloatingItemsFromTable.push(r),i--)}},i.prototype.updateWholeListItems=function(e,i,r){if(this.documentHelper.renderedLists.clear(),this.documentHelper.renderedLevelOverrides=[],t.isNullOrUndefined(e)||t.isNullOrUndefined(e.bodyWidget))return null;e.bodyWidget.index;for(var n,o=0;o<this.documentHelper.pages.length;o++){for(var a=this.documentHelper.pages[o],s=0;s<a.bodyWidgets.length&&(n=this.getNextBlockForList(a.bodyWidgets[s].firstChild),t.isNullOrUndefined(n));s++);if(!t.isNullOrUndefined(n))break}do{if(!n)break;var l=null;if(i&&(l={paragraph:null,listId:r}),this.updateListItems(n,e,l)){if(!t.isNullOrUndefined(l))return l.paragraph==e?null:l.paragraph;break}n=n.getSplitWidgets().pop().nextRenderedWidget,t.isNullOrUndefined(n)||(n=this.getNextBlockForList(n))}while(n);return null},i.prototype.getNextBlockForList=function(e){if(e instanceof Qs&&this.isFirstElementWithPageBreak(e)){var i=e.nextRenderedWidget;if(!t.isNullOrUndefined(i)&&i.equals(e))return i}return e},i.prototype.updateListItems=function(e,t,i){return e instanceof Qs?this.updateListItemsForPara(e,t,i):this.updateListItemsForTable(e,t,i)},i.prototype.updateListItemsForTable=function(e,i,r){if(t.isNullOrUndefined(r)&&i instanceof el&&e.equals(i))return!0;var n=e.firstChild;do{if(this.updateListItemsForRow(n,i,r))return!0;n=n.getSplitWidgets().pop().nextRenderedWidget}while(n);return!1},i.prototype.updateListItemsForRow=function(e,i,r){if(t.isNullOrUndefined(e)||t.isNullOrUndefined(e.firstChild))return!1;var n=e.firstChild;do{var o=this.updateListItemsForCell(n,i,r);if(!t.isNullOrUndefined(r)&&!t.isNullOrUndefined(r.paragraph))return!0;if(o)return!0;n=n.nextRenderedWidget}while(n);return!1},i.prototype.updateListItemsForCell=function(e,i,r){if(0===e.childWidgets.length)return!1;var n=e.firstChild;do{var o=this.updateListItems(n,i,r);if(!t.isNullOrUndefined(r)&&!t.isNullOrUndefined(r.paragraph))return!0;if(o)return!0;n=n.getSplitWidgets().pop().nextRenderedWidget}while(n);return!1},i.prototype.updateRenderedListItems=function(e){e instanceof Qs?(e.isEndsWithColumnBreak&&(e=e.nextRenderedWidget),this.updateRenderedListItemsForPara(e)):this.updateRenderedListItemsForTable(e)},i.prototype.updateRenderedListItemsForTable=function(e){var t=e.firstChild;do{this.updateRenderedListItemsForRow(t),t=t.getSplitWidgets().pop().nextRenderedWidget}while(t)},i.prototype.updateRenderedListItemsForRow=function(e){var t=e.firstChild;do{this.updateRenderedListItemsForCell(t),t=t.nextRenderedWidget}while(t)},i.prototype.updateRenderedListItemsForCell=function(e){if(0!==e.childWidgets.length){var t=e.firstChild;do{this.updateRenderedListItems(t),t=t.getSplitWidgets().pop().nextRenderedWidget}while(t)}},i.prototype.updateListItemsForPara=function(e,i,r){if(e.equals(i))return t.isNullOrUndefined(r)||(r.paragraph=e),!0;var n=void 0,o=0;if(!t.isNullOrUndefined(e.paragraphFormat)&&!t.isNullOrUndefined(e.paragraphFormat.listFormat)){if(!t.isNullOrUndefined(r)&&e.paragraphFormat.listFormat.listId===r.listId)return r.paragraph=e,!0;n=this.documentHelper.getListById(e.paragraphFormat.listFormat.listId),o=e.paragraphFormat.listFormat.listLevelNumber}if(!t.isNullOrUndefined(n)&&!t.isNullOrUndefined(this.documentHelper.getAbstractListById(n.abstractListId))&&!t.isNullOrUndefined(this.documentHelper.getAbstractListById(n.abstractListId).levels[o])){var a=this.getListLevel(n,o);this.updateListNumber(a,e,!1)}return!1},i.prototype.updateRenderedListItemsForPara=function(e){if(!t.isNullOrUndefined(this.documentHelper.getListById(e.paragraphFormat.listFormat.listId))){var i=this.documentHelper.getListById(e.paragraphFormat.listFormat.listId),r=e.paragraphFormat.listFormat.listLevelNumber;if(!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(this.documentHelper.getAbstractListById(i.abstractListId))&&!t.isNullOrUndefined(this.documentHelper.getAbstractListById(i.abstractListId).levels[e.paragraphFormat.listFormat.listLevelNumber])){var n=this.getListLevel(i,r);this.updateListNumber(n,e,!0)}}},i.prototype.updateListNumber=function(e,i,r){var n=void 0;if(i.childWidgets.length>0){var o=i.childWidgets[0];o.children.length>0&&(n=o.children[0])}var a,s=i.paragraphFormat.listFormat;if(!t.isNullOrUndefined(n)&&n.nextElement instanceof kl&&(a=n.width+n.nextElement.width),!t.isNullOrUndefined(n)&&n instanceof kl){var l=this.getListNumber(i);if(r){var d=n.width;if(n.text=l,this.documentHelper.isIosDevice||this.documentHelper.isLinuxOS){var h=n.text;(h=h===String.fromCharCode(61623)?String.fromCharCode(9679):h===String.fromCharCode(61551)+String.fromCharCode(32)?String.fromCharCode(9675):h)!==n.text&&(n.text=h)}var c=this.documentHelper.textHelper.getTextSize(n,n.characterFormat);if(n.text&&n.text.indexOf("")>-1){var g=n.text.split("");if(2===g.length){var p=this.documentHelper.textHelper.getWidth(g[0],i.characterFormat),u=this.documentHelper.textHelper.getWidth(g[1],i.characterFormat);n.dualWidths={w1:p,w2:u},c=p+u}}else n.dualWidths=void 0;c>d&&(n.width=c),this.documentHelper.textHelper.updateTextSize(n,i),this.applyListNumberAlignment(n,e,i),!t.isNullOrUndefined(a)&&n.width<a&&(n.nextElement.width=a-n.width)}}else t.isNullOrUndefined(s)||-1===s.listId||t.isNullOrUndefined(n)||!n.isVisible||this.getListNumber(i)},i.prototype.updateListItemsTillEnd=function(e,i){var r=e.getSplitWidgets(),n=r[r.length-1].nextRenderedWidget;if(!t.isNullOrUndefined(n))for(var o=i?this.documentHelper.editorProperties.getNextRenderedBlock(e):e;!t.isNullOrUndefined(o)&&!this.documentHelper.isTextInput;)this.updateRenderedListItems(o),o=o.getSplitWidgets().pop().nextRenderedWidget},i}(),fd=function(){function e(){}return e.prototype.clear=function(){t.isNullOrUndefined(this.overrideListLevel)||this.overrideListLevel.clearFormat(),this.overrideListLevel=void 0},e.prototype.destroy=function(){t.isNullOrUndefined(this.overrideListLevel)||this.overrideListLevel.destroy(),this.levelNumber=void 0,this.startAt=void 0,this.overrideListLevel=void 0},e.prototype.clone=function(){var i=new e;return i.startAt=this.startAt,i.levelNumber=this.levelNumber,t.isNullOrUndefined(this.overrideListLevel)||(i.overrideListLevel=this.overrideListLevel.clone(i)),i},e}(),md=function(){function e(){this.nsid=-1,this.listId=-1,this.sourceListId=-1,this.abstractListId=-1,this.abstractList=void 0,this.levelOverrides=[]}return e.prototype.getListLevel=function(e){var i=this.getLevelOverride(e);return t.isNullOrUndefined(i)||t.isNullOrUndefined(i.overrideListLevel)?this.abstractList.levels[parseInt(e.toString(),10)]:i.overrideListLevel},e.prototype.getLevelOverride=function(e){for(var t=0;t<this.levelOverrides.length;t++)if(this.levelOverrides[parseInt(t.toString(),10)]instanceof fd){var i=this.levelOverrides[parseInt(t.toString(),10)];if(i.levelNumber===e)return i}},e.prototype.clear=function(){if(!t.isNullOrUndefined(this.levelOverrides)){for(var e=0;e<this.levelOverrides.length;e++)this.levelOverrides[parseInt(e.toString(),10)].clear();this.levelOverrides=[]}this.abstractList&&this.abstractList.clear(),this.abstractList=void 0},e.prototype.destroy=function(){if(!t.isNullOrUndefined(this.levelOverrides)){for(var e=0;e<this.levelOverrides.length;e++)this.levelOverrides[parseInt(e.toString(),10)].destroy();this.levelOverrides=[]}this.levelOverrides=void 0,this.abstractList&&(this.abstractList.destroy(),this.abstractList=void 0),this.abstractListId=void 0,this.listId=void 0,this.sourceListId=void 0},e.prototype.mergeList=function(e){t.isNullOrUndefined(this.abstractListId)||-1===this.abstractListId||(this.abstractListId=e.abstractListId),t.isNullOrUndefined(this.listId)||-1===this.listId||(this.listId=e.listId),t.isNullOrUndefined(this.sourceListId)||-1===this.sourceListId||(this.sourceListId=e.sourceListId),t.isNullOrUndefined(this.levelOverrides)||0===this.levelOverrides.length||(this.levelOverrides=e.levelOverrides)},e.prototype.clone=function(){for(var t=new e,i=0;i<this.levelOverrides.length;i++)t.levelOverrides.push(this.levelOverrides[parseInt(i.toString(),10)].clone());return t},e}(),yd=function(){function e(){this.fntTypeface=new p,this.fntSchemeList=[],this.fntTypeface=new p,this.fntSchemeList=[]}return Object.defineProperty(e.prototype,"fontTypeface",{get:function(){return this.fntTypeface},set:function(e){this.fntTypeface=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontSchemeList",{get:function(){return this.fntSchemeList},set:function(e){this.fntSchemeList=e},enumerable:!0,configurable:!0}),e.prototype.copyFormat=function(e){t.isNullOrUndefined(e)||(this.fntTypeface=e.fntTypeface,this.fntSchemeList=e.fntSchemeList)},e.prototype.destroy=function(){this.fntTypeface=void 0,this.fntSchemeList=void 0},e}(),vd=function(){function e(e){this.majFontScheme=new yd,this.minFontScheme=new yd}return Object.defineProperty(e.prototype,"fontSchemeName",{get:function(){return this.schemeName},set:function(e){this.schemeName=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"majorFontScheme",{get:function(){return this.majFontScheme},set:function(e){this.majFontScheme=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minorFontScheme",{get:function(){return this.minFontScheme},set:function(e){this.minFontScheme=e},enumerable:!0,configurable:!0}),e.prototype.copyFormat=function(e){t.isNullOrUndefined(e)||(this.schemeName=e.schemeName,this.majFontScheme.copyFormat(e.majFontScheme),this.minFontScheme.copyFormat(e.minFontScheme))},e.prototype.destroy=function(){this.schemeName=void 0,this.majFontScheme=void 0,this.minFontScheme=void 0},e}(),Wd=function(){function e(){}return Object.defineProperty(e.prototype,"name",{get:function(){return this.fontName},set:function(e){this.fontName=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"typeface",{get:function(){return this.fontTypeface},set:function(e){this.fontTypeface=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"panose",{get:function(){return this.pnose},set:function(e){this.pnose=e},enumerable:!0,configurable:!0}),e.prototype.copyFormat=function(e){t.isNullOrUndefined(e)||(this.fontName=e.fontName,this.fontTypeface=e.fontTypeface,this.pnose=e.panose)},e.prototype.destroy=function(){this.fontName=void 0,this.fontTypeface=void 0,this.pnose=void 0},e}(),bd=function(){function e(e){this.fntScheme=new vd}return Object.defineProperty(e.prototype,"fontScheme",{get:function(){return this.fntScheme},set:function(e){this.fntScheme=e},enumerable:!0,configurable:!0}),e.prototype.copyFormat=function(e){t.isNullOrUndefined(e)||this.fntScheme.copyFormat(e.fntScheme)},e.prototype.destroy=function(){this.fntScheme=void 0},e}(),xd=function(){function e(e){this.documentHelper=void 0,this.commentStarts=void 0,this.commentEnds=void 0,this.commentsCollection=void 0,this.revisionCollection=void 0,this.isPageBreakInsideTable=!1,this.isParseHeader=!1,this.footnotes=void 0,this.endnotes=void 0,this.keywordIndex=void 0,this.themes=void 0,this.stylesCollection=[],this.isCutPerformed=!1,this.isPaste=!1,this.isContextBasedPaste=!1,this.isHtmlPaste=!1,this.hasFieldSeparator=!1,this.revisionFactory=void 0,this.documentHelper=e,this.revisionHelper=new O(this.documentHelper),this.editableRanges=new p}return Object.defineProperty(e.prototype,"viewer",{get:function(){return this.documentHelper.viewer},enumerable:!0,configurable:!0}),e.prototype.convertJsonToDocument=function(e,i){this.commentStarts=new p,this.commentEnds=new p,this.commentsCollection=new p,this.revisionCollection=new p,this.fontInfoCollection=new p,this.keywordIndex=0,this.footnotes=new cl,this.endnotes=new cl;var r=[],n=bs.getSfdtDocument(e);if(!t.isNullOrUndefined(n.optimizeSfdt)&&n.optimizeSfdt&&(this.keywordIndex=1),t.isNullOrUndefined(n[I[this.keywordIndex]])||this.parseFontSubstitutionTable(n[I[this.keywordIndex]]),t.isNullOrUndefined(n[k[this.keywordIndex]])?this.parseCharacterFormat(0,this.documentHelper.editorCharacterFormat,this.documentHelper.characterFormat):(this.documentHelper.characterFormat.clearFormat(),this.parseCharacterFormat(this.keywordIndex,n[k[this.keywordIndex]],this.documentHelper.characterFormat)),t.isNullOrUndefined(this.documentHelper.documentCharacterFormat)||this.parseCharacterFormat(0,this.documentHelper.documentCharacterFormat,this.documentHelper.characterFormat),t.isNullOrUndefined(n[A[this.keywordIndex]])?this.parseParagraphFormat(0,this.documentHelper.editorParagraphFormat,this.documentHelper.paragraphFormat):(this.documentHelper.paragraphFormat.clearFormat(),this.parseParagraphFormat(this.keywordIndex,n[A[this.keywordIndex]],this.documentHelper.paragraphFormat)),t.isNullOrUndefined(this.documentHelper.documentParagraphFormat)||this.parseParagraphFormat(0,this.documentHelper.documentParagraphFormat,this.documentHelper.paragraphFormat),t.isNullOrUndefined(n[oe[this.keywordIndex]])||this.parseCharacterFormat(this.keywordIndex,n[oe[this.keywordIndex]],this.documentHelper.themeFontLanguage),this.parseDocumentProtection(n),t.isNullOrUndefined(n[M[this.keywordIndex]])||(this.documentHelper.defaultTabWidth=n[M[this.keywordIndex]]),t.isNullOrUndefined(n[D[this.keywordIndex]])||(this.documentHelper.enableTrackChanges!==bs.parseBoolValue(n[D[this.keywordIndex]])&&(this.documentHelper.skipSettingsOps=!0),this.documentHelper.enableTrackChanges=bs.parseBoolValue(n[D[this.keywordIndex]])),t.isNullOrUndefined(n[Q[this.keywordIndex]])||(this.documentHelper.dontUseHtmlParagraphAutoSpacing=bs.parseBoolValue(n[Q[this.keywordIndex]])),t.isNullOrUndefined(n[Va[this.keywordIndex]])||(this.documentHelper.allowSpaceOfSameStyleInTable=bs.parseBoolValue(n[Va[this.keywordIndex]])),t.isNullOrUndefined(n[$[this.keywordIndex]])||(this.documentHelper.alignTablesRowByRow=bs.parseBoolValue(n[$[this.keywordIndex]])),t.isNullOrUndefined(n[B[this.keywordIndex]])||(this.documentHelper.backgroundColor=this.getColor(n[B[this.keywordIndex]][Er[this.keywordIndex]])),t.isNullOrUndefined(n[ne[this.keywordIndex]])||(this.documentHelper.compatibilityMode=this.getCompatibilityMode(n[ne[this.keywordIndex]]),t.isNullOrUndefined(this.documentHelper.documentSettings)||(this.documentHelper.documentSettings.compatibilityMode=this.getCompatibilityMode(n[ne[this.keywordIndex]]))),t.isNullOrUndefined(n[U[this.keywordIndex]])||this.parseAbstractList(n,this.documentHelper.abstractLists),t.isNullOrUndefined(n[L[this.keywordIndex]])||this.parseList(n,this.documentHelper.lists),t.isNullOrUndefined(n[H[this.keywordIndex]])||this.parseStyles(n,this.documentHelper.styles),t.isNullOrUndefined(n[R[this.keywordIndex]])||this.parseComments(n,this.documentHelper.comments),t.isNullOrUndefined(n[q[this.keywordIndex]])||this.parseRevisions(n,[]),t.isNullOrUndefined(n[Ka[this.keywordIndex]])||this.parseImages(n[Ka[this.keywordIndex]]),t.isNullOrUndefined(n[N[this.keywordIndex]])||this.parseSections(n[N[this.keywordIndex]],r),t.isNullOrUndefined(n[E[this.keywordIndex]])||this.parseCustomXml(n),t.isNullOrUndefined(n[ee[this.keywordIndex]])||(this.documentHelper.documentEditorSettings.formFieldSettings.applyShading=bs.parseBoolValue(n[ee[this.keywordIndex]])),t.isNullOrUndefined(n[ie[this.keywordIndex]])||this.parseFootnotes(n[ie[this.keywordIndex]],this.documentHelper.footnotes),t.isNullOrUndefined(n[re[this.keywordIndex]])||this.parseEndtnotes(n[re[this.keywordIndex]],this.documentHelper.endnotes),t.isNullOrUndefined(n[ae[this.keywordIndex]])||this.parseThemes(n[ae[this.keywordIndex]],this.documentHelper.themes),this.removeUnmappedBookmark(),t.isNullOrUndefined(n[es[0]])||(i[es[0]]=n[es[0]]),this.documentHelper.fieldStacks&&this.documentHelper.fieldStacks.length>0){for(var o=this.documentHelper.fieldStacks.length-1;o>=0;o--){var a=this.documentHelper.fieldStacks[o];if(t.isNullOrUndefined(a.fieldSeparator)&&t.isNullOrUndefined(a.fieldEnd)){if(!t.isNullOrUndefined(a.line)){var s=a.line.children.indexOf(a);-1!==s&&a.line.children.splice(s,1)}var l=this.documentHelper.fields.indexOf(a);-1!==l&&this.documentHelper.fields.splice(l,1);var d=this.documentHelper.fieldStacks.indexOf(a);-1!==d&&this.documentHelper.fieldStacks.splice(d,1)}}this.documentHelper.fieldStacks=[]}return this.revisionMap&&(this.revisionMap.clear(),this.revisionMap=void 0),this.revisionCollection&&(this.revisionCollection.clear(),this.revisionMap=void 0),r},e.prototype.parseFontSubstitutionTable=function(e){if(!t.isNullOrUndefined(this.documentHelper)&&!t.isNullOrUndefined(this.documentHelper.fontSubstitutionTable)&&Object.keys(e).length>0)for(var i=0,r=Object.keys(e);i<r.length;i++){var n=r[i];this.documentHelper.fontSubstitutionTable.add(n,e[n])}},e.prototype.removeUnmappedBookmark=function(){for(var e=this.documentHelper.bookmarks.keys,t=this.documentHelper.endBookmarksUpdated,i=0;i<e.length;i++)if(-1===t.indexOf(e[i])){var r=this.documentHelper.bookmarks.get(e[i]);r&&r.line.children.splice(r.line.children.indexOf(r),1),this.documentHelper.bookmarks.remove(e[i])}this.documentHelper.endBookmarksUpdated=[]},e.prototype.parseFootnotes=function(e,i){t.isNullOrUndefined(e[ra[this.keywordIndex]])||this.parseBody(e[ra[this.keywordIndex]],i.separator),t.isNullOrUndefined(e[oa[this.keywordIndex]])||this.parseBody(e[oa[this.keywordIndex]],i.continuationNotice),t.isNullOrUndefined(e[na[this.keywordIndex]])||this.parseBody(e[na[this.keywordIndex]],i.continuationSeparator)},e.prototype.parseImages=function(e){for(var t in e)if(Array.isArray(e[""+t]))this.documentHelper.images.add(parseInt(t),e[""+t]);else{var i=[];i.push(e[""+t]),this.documentHelper.images.add(parseInt(t),i)}},e.prototype.parseEndtnotes=function(e,i){t.isNullOrUndefined(e[ra[this.keywordIndex]])||this.parseBody(e[ra[this.keywordIndex]],i.separator),t.isNullOrUndefined(e[oa[this.keywordIndex]])||this.parseBody(e[oa[this.keywordIndex]],i.continuationNotice),t.isNullOrUndefined(e[na[this.keywordIndex]])||this.parseBody(e[na[this.keywordIndex]],i.continuationSeparator)},e.prototype.parseCustomXml=function(e){for(var t=0;t<e[E[this.keywordIndex]].length;t++){var i=e[E[this.keywordIndex]][t];this.documentHelper.customXmlData.containsKey(i[kn[this.keywordIndex]])||this.documentHelper.customXmlData.add(i[kn[this.keywordIndex]],i[An[this.keywordIndex]])}},e.prototype.parseDocumentProtection=function(e){t.isNullOrUndefined(e[V[this.keywordIndex]])||(this.documentHelper.restrictFormatting=bs.parseBoolValue(e[V[this.keywordIndex]])),t.isNullOrUndefined(e[_[this.keywordIndex]])||(this.documentHelper.isDocumentProtected=bs.parseBoolValue(e[_[this.keywordIndex]])),t.isNullOrUndefined(e[z[this.keywordIndex]])||(this.documentHelper.protectionType=this.getProtectionType(e[z[this.keywordIndex]])),t.isNullOrUndefined(e[j[this.keywordIndex]])||(this.documentHelper.hashValue=e[j[this.keywordIndex]]),t.isNullOrUndefined(e[G[this.keywordIndex]])||(this.documentHelper.saltValue=e[G[this.keywordIndex]]),t.isNullOrUndefined(e[J[this.keywordIndex]])||(this.documentHelper.cryptAlgorithmSid=e[J[this.keywordIndex]]),t.isNullOrUndefined(e[X[this.keywordIndex]])||(this.documentHelper.cryptAlgorithmType=e[X[this.keywordIndex]]),t.isNullOrUndefined(e[Y[this.keywordIndex]])||(this.documentHelper.cryptAlgorithmClass=e[Y[this.keywordIndex]])},e.prototype.parseStyles=function(e,i){for(var r=0;r<e[H[this.keywordIndex]].length;r++){var n=this.documentHelper.isEditorModule,o=this.documentHelper.styles.findByName(e[H[this.keywordIndex]][r][se[this.keywordIndex]]);!t.isNullOrUndefined(o)&&this.stylesCollection.indexOf(e[H[this.keywordIndex]][r])<0&&o.type===this.getStyleType(o[Sa[this.keywordIndex]])&&i.remove(o),(!t.isNullOrUndefined(n)&&this.documentHelper.editorProperties.isRemoteAction||!i.contains(o))&&this.parseStyle(e,e[H[this.keywordIndex]][r],i)}this.stylesCollection=[]},e.prototype.toEditorRevision=function(e){return t.isNullOrUndefined(this.revisionFactory)||t.isNullOrUndefined(e)?e:this.revisionFactory(e)},e.prototype.parseRevisions=function(e,i){for(var r=0;r<e[q[this.keywordIndex]].length;r++){var n=e[q[this.keywordIndex]][r];if(!t.isNullOrUndefined(n[Nn[this.keywordIndex]])&&!t.isNullOrUndefined(n[Sn[this.keywordIndex]])){var o=this.toEditorRevision(this.parseRevision(n)),a=!0;if(!this.documentHelper.copyWithTrackChange&&this.isPaste){if("Insertion"===this.getRevisionType(n[Sn[this.keywordIndex]])&&this.isPaste&&this.documentHelper.enableTrackChanges&&!this.documentHelper.editorProperties.isRemoteAction)continue;this.revisionCollection.containsKey(n[Nn[this.keywordIndex]])||this.revisionCollection.add(n[Nn[this.keywordIndex]],o)}else this.revisionCollection.add(n[Nn[this.keywordIndex]],o);for(var s=0;s<i.length;s++)i[s].revisionID===o.revisionID&&(a=!1);a&&!this.documentHelper.editorProperties.isRemoteAction&&i.push(o)}}this.documentHelper.isSfdtExportModule&&(this.documentHelper.copyWithTrackChange=!1)},e.prototype.parseRevision=function(e){if(!t.isNullOrUndefined(e)){var i=new C(this.documentHelper,e[Fn[this.keywordIndex]],e[Pn[this.keywordIndex]]);return i.revisionID=e[Nn[this.keywordIndex]],i.revisionType=this.getRevisionType(e[Sn[this.keywordIndex]]),i.customData=e[In[this.keywordIndex]],i}},e.prototype.checkAndApplyRevision=function(e,i,r,n){var o=i[Ee[e]];if(o&&0!==o.length){var a=this.isPaste&&this.documentHelper.editorProperties.isRemoteAction&&r instanceof W;if(!t.isNullOrUndefined(o)&&o.length>0)for(var s=0;s<o.length;s++){var l=o[s],d=this.revisionCollection.get(l);if(d){if(r.revisionLength>0&&r.getRevision(0).author==d.author&&r.getRevision(0).revisionType==d.revisionType)return;var h=this.documentHelper.editorProperties.revisionsInternal?this.documentHelper.editorProperties.revisionsInternal.changes:void 0;t.isNullOrUndefined(h)||-1!==h.indexOf(d)||(h.push(d),this.documentHelper.revisionsInternal.add(l,d)),d=this.checkAndCreateNewRevision(d,n,r),t.isNullOrUndefined(d)||r.revisions.push(d),a&&this.documentHelper.editorProperties.remotePasteRevision.push(d)}}}},e.prototype.checkAndCreateNewRevision=function(e,i,r){t.isNullOrUndefined(this.revisionMap)&&(this.revisionMap=new p);var n,o=e.revisionID,a=this.revisionMap.get(i),s=a||void 0,l=s?s.get(o):void 0,d=!1;if(r instanceof nl&&!t.isNullOrUndefined(r.previousElement)&&!t.isNullOrUndefined(l)&&((n=r.previousElement)instanceof hl||n instanceof Jl)){0===n.revisionLength&&(d=!0);for(var h=0;h<n.revisionLength;h++){var c=n.getRevision(h);c.revisionType===e.revisionType&&c.author===e.author||(d=!0)}}if(!t.isNullOrUndefined(e.ownerNode)&&e.ownerNode!==i||d)if(t.isNullOrUndefined(l)||d){var g=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15);(e=this.toEditorRevision(e.cloneRevision())).revisionID=g;var u=this.revisionCollection.values.indexOf(e);this.revisionCollection.keys.splice(u+1,0,g),this.revisionCollection.values.splice(u+1,0,e);var f=this.documentHelper.editorProperties.revisionsInternal?this.documentHelper.editorProperties.revisionsInternal.changes:void 0;t.isNullOrUndefined(f)||-1!==f.indexOf(e)||(f.push(e),this.documentHelper.revisionsInternal.add(e.revisionID,e))}else e=l;if(t.isNullOrUndefined(s)||s&&t.isNullOrUndefined(l))if(a)a.add(o,e);else{var m=new p;m.add(o,e),this.revisionMap.add(i,m)}if(!d&&n&&n.revisionLength>0){var y=this.revisionHelper.retrieveRevisionByType(n,e.revisionType);this.documentHelper.revisionsInternal.containsKey(e.revisionID)&&!t.isNullOrUndefined(y)&&y!==e&&(e=this.revisionCollection.get(y.revisionID))}return e.ownerNode=i,e},e.prototype.parseComments=function(e,t){for(var i=0,r=0;r<e[R[this.keywordIndex]].length;r++){var n=e[R[this.keywordIndex]][r],o=void 0;for(o=this.parseComment(n,o);i<n[On[this.keywordIndex]].length;){var a=void 0;(a=this.parseComment(n[On[this.keywordIndex]][i],a)).ownerComment=o,a.isReply=!0,o.replyComments.push(a),this.commentsCollection.add(a.commentId,a),i++}this.commentsCollection.add(o.commentId,o),t.push(o),i=0}},e.prototype.parseComment=function(e,t){return t=new Zl(e[Pn[this.keywordIndex]]),t.author=e[Fn[this.keywordIndex]],t.initial=e[Cn[this.keywordIndex]],t.commentId=e[xn[this.keywordIndex]],t.isResolved=bs.parseBoolValue(e[Tn[this.keywordIndex]]),t.text=this.parseCommentText(e[Ho[this.keywordIndex]]),t.mentions=this.parseCommentMentions(e[Ho[this.keywordIndex]]),t.isPosted=!0,t},e.prototype.parseCommentText=function(e){for(var t="",i=!1,r=0;r<e.length;r++){if(0!==r&&(t+="<div>"),e[r][Rn[this.keywordIndex]].length>0)for(var n=e[r][Rn[this.keywordIndex]],o=0;o<n.length;o++){var a=n[o];if(0!==a[on[this.keywordIndex]]&&1!==a[on[this.keywordIndex]]&&2!==a[on[this.keywordIndex]]){var s=a[mr[this.keywordIndex]];i?(t=t+'<span contenteditable="false" class="e-mention-chip">'+(s?s.replace(/</g,"<").replace(/>/g,">"):s)+"</span>",i=!1):s&&(t+=s.replace(/</g,"<").replace(/>/g,">"))}else 0===a[on[this.keywordIndex]]?o++:2===a[on[this.keywordIndex]]&&(i=!0)}else t+=0===r?"<div><br></div>":"<br>";0!==r&&(t+="</div>")}return t},e.prototype.parseCommentMentions=function(e){for(var t=[],i=!1,r=!1,n=0;n<e.length;n++)for(var o=e[n][Rn[this.keywordIndex]],a={},s=0;s<o.length;s++){var l=o[s];if(0!==l[on[this.keywordIndex]]&&1!==l[on[this.keywordIndex]]&&2!==l[on[this.keywordIndex]]){var d=l[mr[this.keywordIndex]];if(i){var h=d.replace(/.*"(.*)".*/,"$1");h=h.replace("mailto:",""),a.value=h,i=!1}else r&&(a.text=d,r=!1,t.push(a),a={})}else 0===l[on[this.keywordIndex]]?i=!0:2===l[on[this.keywordIndex]]&&(r=!0)}return t},e.prototype.parseStyle=function(e,i,r,n){var o,a=0,s=this.documentHelper.isEditorModule;if(!t.isNullOrUndefined(n)&&n&&(a=this.keywordIndex,this.keywordIndex=0),!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(i[Sa[this.keywordIndex]])){if("Paragraph"===this.getStyleType(i[Sa[this.keywordIndex]])&&((o=new Os).type="Paragraph"),"Character"===this.getStyleType(i[Sa[this.keywordIndex]])&&((o=new Ss).type="Character"),"Table"===this.getStyleType(i[Sa[this.keywordIndex]])&&((o=new Ns).type="Table"),t.isNullOrUndefined(i[se[this.keywordIndex]])||(o.name=i[se[this.keywordIndex]]),r.push(o),this.stylesCollection.push(i),!t.isNullOrUndefined(i[le[this.keywordIndex]])){var l=void 0;if(l=s&&this.documentHelper.editorProperties.isRemoteAction?this.documentHelper.styles.findByName(i[le[this.keywordIndex]]):r.findByName(i[le[this.keywordIndex]]),t.isNullOrUndefined(l)){var d=this.getStyle(i[le[this.keywordIndex]],e),h=void 0;t.isNullOrUndefined(d)||this.getStyleType(d[Sa[this.keywordIndex]])!==o.type?"Paragraph"===o.type?h=JSON.parse('{"type":"Paragraph","name":"Normal","next":"Normal"}'):"Character"===o.type&&(h=JSON.parse('{"type": "Character","name": "Default Paragraph Font"}')):h=d,this.parseStyle(e,h,r),s&&this.documentHelper.editorProperties.isRemoteAction?o.basedOn=this.documentHelper.styles.findByName(h[se[this.keywordIndex]]):t.isNullOrUndefined(h)||o===r.findByName(h[se[this.keywordIndex]]).basedOn||(o.basedOn=r.findByName(h[se[this.keywordIndex]]))}else if(l.type===o.type&&l.name!==o.name){o.basedOn=l;var c=this.getStyle(i[le[this.keywordIndex]],e);this.isPaste&&!t.isNullOrUndefined(c)&&"Paragraph"===o.type&&"Paragraph"===this.getStyleType(c[Sa[this.keywordIndex]])&&this.updateParagraphFormatFromBaseStyle(i,c)}}if(!t.isNullOrUndefined(i[he[this.keywordIndex]])){var g=r.findByName(i[he[this.keywordIndex]]),p=this.getStyle(i[he[this.keywordIndex]],e);s&&this.documentHelper.editorProperties.isRemoteAction&&(g=this.documentHelper.styles.findByName(i[he[this.keywordIndex]]));h=void 0;if(t.isNullOrUndefined(g)){if(t.isNullOrUndefined(p)){var u={};u[k[this.keywordIndex]]=i[k[this.keywordIndex]],u[se[this.keywordIndex]]=i[se[this.keywordIndex]]+" Char",u[Sa[this.keywordIndex]]="Character",u[le[this.keywordIndex]]="Normal"===i[le[this.keywordIndex]]?"Default Paragraph Font":i[le[this.keywordIndex]]+" Char",h=u}else h=p;this.parseStyle(e,h,r);var f=void 0;s&&this.documentHelper.editorProperties.isRemoteAction?(f=this.documentHelper.styles.findByName(h[se[this.keywordIndex]]),o.link=t.isNullOrUndefined(f)?i[he[this.keywordIndex]]:f):(f=r.findByName(h[se[this.keywordIndex]]),o.link=t.isNullOrUndefined(f)?i[he[this.keywordIndex]]:f)}else o.link=g}if(t.isNullOrUndefined(i[k[this.keywordIndex]])||this.parseCharacterFormat(this.keywordIndex,i[k[this.keywordIndex]],o.characterFormat),t.isNullOrUndefined(i[A[this.keywordIndex]])||this.parseParagraphFormat(this.keywordIndex,i[A[this.keywordIndex]],o.paragraphFormat),!t.isNullOrUndefined(i[de[this.keywordIndex]]))if(i[de[this.keywordIndex]]===i[se[this.keywordIndex]])o.next=o;else{var m=void 0;if(m=s&&this.documentHelper.editorProperties.isRemoteAction?this.documentHelper.styles.findByName(i[de[this.keywordIndex]]):r.findByName(i[de[this.keywordIndex]]),t.isNullOrUndefined(m)||m.type!==o.type){var y=this.getStyle(i[de[this.keywordIndex]],e);t.isNullOrUndefined(y)?o.next=o:(this.parseStyle(e,y,r),s&&this.documentHelper.editorProperties.isRemoteAction?o.next=this.documentHelper.styles.findByName(y.name):o.next=r.findByName(y.name))}else o.next=m}}!t.isNullOrUndefined(n)&&n&&(this.keywordIndex=a),t.isNullOrUndefined(o)||"Table"===o.type||this.documentHelper.addToStylesMap(o)},e.prototype.updateParagraphFormatFromBaseStyle=function(e,i){if(!t.isNullOrUndefined(e[A[this.keywordIndex]])&&!t.isNullOrUndefined(i[A[this.keywordIndex]])){var r=e[A[this.keywordIndex]],n=i[A[this.keywordIndex]];!r.hasOwnProperty(_e[this.keywordIndex])&&n.hasOwnProperty(_e[this.keywordIndex])&&(r[_e[this.keywordIndex]]=n[_e[this.keywordIndex]]),!r.hasOwnProperty(je[this.keywordIndex])&&n.hasOwnProperty(je[this.keywordIndex])&&(r[je[this.keywordIndex]]=n[je[this.keywordIndex]]),!r.hasOwnProperty(Xe[this.keywordIndex])&&n.hasOwnProperty(Xe[this.keywordIndex])&&(r[Xe[this.keywordIndex]]=n[Xe[this.keywordIndex]]),!r.hasOwnProperty(Ye[this.keywordIndex])&&n.hasOwnProperty(Ye[this.keywordIndex])&&(r[Ye[this.keywordIndex]]=n[Ye[this.keywordIndex]]),!r.hasOwnProperty(Qe[this.keywordIndex])&&n.hasOwnProperty(Qe[this.keywordIndex])&&(r[Qe[this.keywordIndex]]=n[Qe[this.keywordIndex]]),!r.hasOwnProperty($e[this.keywordIndex])&&n.hasOwnProperty($e[this.keywordIndex])&&(r[$e[this.keywordIndex]]=n[$e[this.keywordIndex]]),!r.hasOwnProperty(Ke[this.keywordIndex])&&n.hasOwnProperty(Ke[this.keywordIndex])&&(r[Ke[this.keywordIndex]]=n[Ke[this.keywordIndex]]),!r.hasOwnProperty(nt[this.keywordIndex])&&n.hasOwnProperty(nt[this.keywordIndex])&&(r[nt[this.keywordIndex]]=n[nt[this.keywordIndex]]),!r.hasOwnProperty(ot[this.keywordIndex])&&n.hasOwnProperty(ot[this.keywordIndex])&&(r[ot[this.keywordIndex]]=n[ot[this.keywordIndex]]),!r.hasOwnProperty(tt[this.keywordIndex])&&n.hasOwnProperty(tt[this.keywordIndex])&&(r[tt[this.keywordIndex]]=n[tt[this.keywordIndex]]),!r.hasOwnProperty(rt[this.keywordIndex])&&n.hasOwnProperty(rt[this.keywordIndex])&&(r[rt[this.keywordIndex]]=n[rt[this.keywordIndex]]),!r.hasOwnProperty(it[this.keywordIndex])&&n.hasOwnProperty(it[this.keywordIndex])&&(r[it[this.keywordIndex]]=n[it[this.keywordIndex]])}},e.prototype.getStyle=function(e,t){for(var i=0;i<t[H[this.keywordIndex]].length;i++)if(t[H[this.keywordIndex]][i][se[this.keywordIndex]]===e)return t[H[this.keywordIndex]][i]},e.prototype.parseAbstractList=function(e,i){for(var r=new p,n=0;n<e[U[this.keywordIndex]].length;n++){var o=new sd,a=e[U[this.keywordIndex]][n];if(!t.isNullOrUndefined(a)&&(t.isNullOrUndefined(a[$o[this.keywordIndex]])||(o.abstractListId=a[$o[this.keywordIndex]]),t.isNullOrUndefined(a.nsid)||(o.nsid=a.nsid),!t.isNullOrUndefined(a[ea[this.keywordIndex]])))for(var s=0;s<a[ea[this.keywordIndex]].length;s++){var l=a[ea[this.keywordIndex]][s];if(!t.isNullOrUndefined(l)){var d=this.parseListLevel(l,o);o.levels.push(d)}}if(r.containsKey(o.abstractListId)){var h=i.indexOf(r.get(o.abstractListId));h>=0&&(i.splice(h,1),r.remove(o.abstractListId))}r.add(o.abstractListId,o),i.push(o)}},e.prototype.parseListLevel=function(e,i){var r=new ld(i);return"Bullet"===this.getListLevelPattern(e[jo[this.keywordIndex]])?(r.listLevelPattern="Bullet",r.numberFormat=t.isNullOrUndefined(e[Zo[this.keywordIndex]])?"":e[Zo[this.keywordIndex]]):(r.listLevelPattern=this.getListLevelPattern(e[jo[this.keywordIndex]]),r.startAt=e[Yo[this.keywordIndex]],r.numberFormat=t.isNullOrUndefined(e[Zo[this.keywordIndex]])?"":e[Zo[this.keywordIndex]],e[Xo[this.keywordIndex]]>=0?r.restartLevel=e[Xo[this.keywordIndex]]:r.restartLevel=e[Jo[this.keywordIndex]]),r.paraStyleName=t.isNullOrUndefined(e[Qo[this.keywordIndex]])?"":e[Qo[this.keywordIndex]],r.isLegalStyleNumbering=!t.isNullOrUndefined(e[Fo[this.keywordIndex]])&&bs.parseBoolValue(e[Fo[this.keywordIndex]]),r.followCharacter=this.getFollowCharacterType(e[Go[this.keywordIndex]]),r.numberAlignment=this.getListNumberAlignment(e[Ko[this.keywordIndex]]),this.parseCharacterFormat(this.keywordIndex,e[k[this.keywordIndex]],r.characterFormat),this.parseParagraphFormat(this.keywordIndex,e[A[this.keywordIndex]],r.paragraphFormat),r},e.prototype.parseList=function(e,i){for(var r=0;r<e[L[this.keywordIndex]].length;r++){var n=new md,o=e[L[this.keywordIndex]][r];t.isNullOrUndefined(o[$o[this.keywordIndex]])||(n.abstractListId=o[$o[this.keywordIndex]],n.abstractList=this.documentHelper.getAbstractListById(o[$o[this.keywordIndex]])),i.push(n),t.isNullOrUndefined(o[Me[this.keywordIndex]])||(n.listId=o[Me[this.keywordIndex]]),t.isNullOrUndefined(o.nsid)?n.nsid=n.abstractList.nsid:n.nsid=o.nsid,o.hasOwnProperty(ia[this.keywordIndex])&&this.parseLevelOverride(o[ia[this.keywordIndex]],n)}},e.prototype.parseLevelOverride=function(e,i){if(!t.isNullOrUndefined(e))for(var r=0;r<e.length;r++){var n=new fd,o=e[r];n.startAt=o[Yo[this.keywordIndex]],n.levelNumber=o[Jo[this.keywordIndex]],t.isNullOrUndefined(o[ta[this.keywordIndex]])||(n.overrideListLevel=this.parseListLevel(o[ta[this.keywordIndex]],n)),i.levelOverrides.push(n)}},e.prototype.parseSections=function(e,i){for(var r=0;r<e.length;r++){var n=new Ys;n.sectionFormat=new y(n),n.index=r;var o=e[r],a="",s=e[r+1],l=s&&s[_o[this.keywordIndex]]?s[_o[this.keywordIndex]]:void 0;a=l&&l[kt[this.keywordIndex]]?l[kt[this.keywordIndex]]:"NewPage",t.isNullOrUndefined(o[_o[this.keywordIndex]])||this.parseSectionFormat(this.keywordIndex,o[_o[this.keywordIndex]],n.sectionFormat),t.isNullOrUndefined(o[zo[this.keywordIndex]])&&(o[zo[this.keywordIndex]]={}),this.documentHelper.headersFooters.push(this.parseHeaderFooter(o[zo[this.keywordIndex]],this.documentHelper.headersFooters)),this.isParseHeader=!1,this.parseTextBody(o[Ho[this.keywordIndex]],n,r+1<e.length,a);for(var d=0;d<n.childWidgets.length;d++)n.childWidgets[d].containerWidget=n;i.push(n)}},e.prototype.parseHeaderFooter=function(e,i){this.isParseHeader=!0;var r={};if(!t.isNullOrUndefined(e[Ro[this.keywordIndex]])){var n=new Xs("OddHeader");r[0]=n,this.parseTextBody(e[Ro[this.keywordIndex]][Ho[this.keywordIndex]],n)}if(!t.isNullOrUndefined(e[qo[this.keywordIndex]])){var o=new Xs("OddFooter");r[1]=o,this.parseTextBody(e[qo[this.keywordIndex]][Ho[this.keywordIndex]],o)}if(!t.isNullOrUndefined(e[Eo[this.keywordIndex]])){var a=new Xs("EvenHeader");r[2]=a,this.parseTextBody(e[Eo[this.keywordIndex]][Ho[this.keywordIndex]],a)}if(!t.isNullOrUndefined(e[Mo[this.keywordIndex]])){var s=new Xs("EvenFooter");r[3]=s,this.parseTextBody(e[Mo[this.keywordIndex]][Ho[this.keywordIndex]],s)}if(!t.isNullOrUndefined(e[Vo[this.keywordIndex]])){var l=new Xs("FirstPageHeader");r[4]=l,this.parseTextBody(e[Vo[this.keywordIndex]][Ho[this.keywordIndex]],l)}if(!t.isNullOrUndefined(e[Do[this.keywordIndex]])){var d=new Xs("FirstPageFooter");r[5]=d,this.parseTextBody(e[Do[this.keywordIndex]][Ho[this.keywordIndex]],d)}return r},e.prototype.parseTextBody=function(e,t,i,r){this.parseBody(e,t.childWidgets,t,i,void 0,void 0,r)},e.prototype.addCustomStyles=function(e){if(!t.isNullOrUndefined(e[H[this.keywordIndex]]))for(var i=0;i<e[H[this.keywordIndex]].length;i++)void 0!==this.documentHelper.styles.findByName(e[H[this.keywordIndex]][i][se[this.keywordIndex]])||this.isPaste&&"Normal (Web)"===e[H[this.keywordIndex]][i][se[this.keywordIndex]]||this.parseStyle(e,e[H[this.keywordIndex]][i],this.documentHelper.styles)},e.prototype.isHtmlConvertedWebStyle=function(e){if(t.isNullOrUndefined(e))return!0;for(var i=0;i<e.length;i++)if("Normal (Web)"===e[i][se[this.keywordIndex]]){var r=e[i][k[this.keywordIndex]];return t.isNullOrUndefined(r)||0===Object.keys(r).length}return!0},e.prototype.parseBody=function(e,i,r,n,o,a,s,l){if(!t.isNullOrUndefined(e))for(var d=0;d<e.length;d++){var h=e[d],c=!1;if(h.hasOwnProperty(Rn[this.keywordIndex])){var g=new Qs;g.characterFormat=new S(g,this.documentHelper),g.paragraphFormat=new Ls(g);var p=this.documentHelper.layout.addLineWidget(g);h[Rn[this.keywordIndex]].length>0&&(c=this.parseParagraph(h[Rn[this.keywordIndex]],g,!1,p,l&&0===d));var u=h[k[this.keywordIndex]];if(!n||h!==e[e.length-1]||0!==h[Rn[this.keywordIndex]].length||c){this.parseCharacterFormat(this.keywordIndex,u,g.characterFormat),this.parseParagraphFormat(this.keywordIndex,h[A[this.keywordIndex]],g.paragraphFormat);var f=void 0,m="Normal";t.isNullOrUndefined(h[A[this.keywordIndex]])||t.isNullOrUndefined(h[A[this.keywordIndex]][Te[this.keywordIndex]])||(m=h[A[this.keywordIndex]][Te[this.keywordIndex]]),f=this.documentHelper.styles.findByName(m,"Paragraph"),this.isPaste&&"Normal (Web)"===m&&this.isHtmlConvertedWebStyle(a)?f=this.selectedBaseStyle instanceof Os?this.selectedBaseStyle:this.documentHelper.styles.findByName("Normal","Paragraph"):this.isPaste&&t.isNullOrUndefined(f)&&"Normal (Web)"===m&&(f=this.documentHelper.styles.findByName("Normal","Paragraph")),t.isNullOrUndefined(f)||g.paragraphFormat.applyStyle(f),i.push(g)}else t.isNullOrUndefined(u)||!t.isNullOrUndefined(u[Ee[this.keywordIndex]])&&u[Ee[this.keywordIndex]].length>0&&this.checkAndApplyRevision(this.keywordIndex,u,g.characterFormat,g.characterFormat),n&&1===e.length||(g.isSectionBreak=!0),i.push(g);g.index=i.length-1,g.containerWidget=r}else if(h.hasOwnProperty(bo[this.keywordIndex]))this.parseTable(h,i,i.length,r);else if(h.hasOwnProperty(qn[this.keywordIndex])){var y=new yl("Block"),v=new yl("Block");this.parseContentControlProperties(h[qn[this.keywordIndex]],y.contentControlProperties),v.contentControlProperties=y.contentControlProperties,y.type=0,v.type=1,h.hasOwnProperty(_n[this.keywordIndex])&&(y.authorName=h[_n[this.keywordIndex]],v.authorName=h[_n[this.keywordIndex]]),h.hasOwnProperty(jn[this.keywordIndex])&&(y.revDateTime=h[jn[this.keywordIndex]],v.revDateTime=h[jn[this.keywordIndex]]),h.hasOwnProperty(Dn[this.keywordIndex])&&(y.isInsertRevision=bs.parseBoolValue(h[Dn[this.keywordIndex]]),v.isInsertRevision=bs.parseBoolValue(h[Dn[this.keywordIndex]])),h.hasOwnProperty(zn[this.keywordIndex])&&(y.isDeleteRevision=bs.parseBoolValue(h[zn[this.keywordIndex]]),v.isDeleteRevision=bs.parseBoolValue(h[zn[this.keywordIndex]])),this.parseBody(h[Ho[this.keywordIndex]],i,r,n&&d===e.length-1,y.contentControlProperties);for(var W=0;W<2;W++){var b=i.length<h[Ho[this.keywordIndex]].length?i[0]:0===W?i[i.length-h[Ho[this.keywordIndex]].length]:i[i.length-1],x=void 0;if(b instanceof Qs?x=b:b instanceof el&&(x=0===W?b.firstChild.firstChild.firstChild:b.lastChild.lastChild.lastChild),!t.isNullOrUndefined(x)&&0===x.childWidgets.length){var w=new rl(x);x.childWidgets.push(w)}0!==W||t.isNullOrUndefined(x)||t.isNullOrUndefined(x.firstChild)||t.isNullOrUndefined(x.firstChild.children)?t.isNullOrUndefined(x)||t.isNullOrUndefined(x.lastChild)||t.isNullOrUndefined(x.lastChild.children)||(x.lastChild.children.push(v),v.line=x.lastChild):(x.firstChild.children.splice(0,0,y),y.line=x.firstChild)}}t.isNullOrUndefined(o)||(i[i.length-1].contentControlProperties=o)}},e.prototype.parseTable=function(e,i,r,n){var o=new el,a=!1;o.index=r,t.isNullOrUndefined(e[Po[this.keywordIndex]])||this.parseTableFormat(e[Po[this.keywordIndex]],o.tableFormat,this.keywordIndex),o.tableFormat.title=e[Kn[this.keywordIndex]],o.tableFormat.description=e[xo[this.keywordIndex]],this.parseTablePositioning(e,o);for(var s=0;s<e[bo[this.keywordIndex]].length;s++){var l=new tl;l.rowFormat=new W(l);var d=e[bo[this.keywordIndex]][s];if(t.isNullOrUndefined(d[qn[this.keywordIndex]])||(l.contentControlProperties=new vl("Row"),this.parseContentControlProperties(d[qn[this.keywordIndex]],l.contentControlProperties)),d.hasOwnProperty(vo[this.keywordIndex])){this.parseRowFormat(d[vo[this.keywordIndex]],l.rowFormat,this.keywordIndex),l.index=s;for(var h=0;h<d[Wo[this.keywordIndex]].length;h++){var c=new il;c.cellFormat=new x(c);var g=d[Wo[this.keywordIndex]][h];t.isNullOrUndefined(g[qn[this.keywordIndex]])||(c.contentControlProperties=new vl("Cell"),this.parseContentControlProperties(g[qn[this.keywordIndex]],c.contentControlProperties)),l.childWidgets.push(c),c.containerWidget=l,c.index=h,c.rowIndex=s,g.hasOwnProperty(Ga[this.keywordIndex])&&!t.isNullOrUndefined(g[Ga[this.keywordIndex]])?(c.columnIndex=g[Ga[this.keywordIndex]],a=!0):c.columnIndex=h,g.hasOwnProperty(yo[this.keywordIndex])&&this.parseCellFormat(g[yo[this.keywordIndex]],c.cellFormat,this.keywordIndex);for(var p=g[Ho[this.keywordIndex]],u=0;u<p.length;u++)p[u].hasOwnProperty([bo[this.keywordIndex]])&&(o.isContainInsideTable=!0);if(this.isPageBreakInsideTable=!0,this.parseTextBody(g[Ho[this.keywordIndex]],c,!1),!t.isNullOrUndefined(c.contentControlProperties)){var f=new yl("Cell"),m=new yl("Cell");f.contentControlProperties=c.contentControlProperties,m.contentControlProperties=c.contentControlProperties;var y=g[En[this.keywordIndex]];if(y&&y.hasOwnProperty(_n[this.keywordIndex])&&(f.authorName=y[_n[this.keywordIndex]],m.authorName=y[_n[this.keywordIndex]]),y&&y.hasOwnProperty(jn[this.keywordIndex])&&(f.revDateTime=y[jn[this.keywordIndex]],m.revDateTime=y[jn[this.keywordIndex]]),y&&y.hasOwnProperty(Dn[this.keywordIndex])&&(f.isInsertRevision=y[Dn[this.keywordIndex]],m.isInsertRevision=y[Dn[this.keywordIndex]]),y&&y.hasOwnProperty(zn[this.keywordIndex])&&(f.isDeleteRevision=y[zn[this.keywordIndex]],m.isDeleteRevision=y[zn[this.keywordIndex]]),f.type=0,m.type=1,0===c.firstChild.childWidgets.length){w=new rl(c.firstChild);c.firstChild.childWidgets.push(w)}if(f.line=c.firstChild.firstChild,c.firstChild.firstChild.children.splice(0,0,f),0===c.lastChild.childWidgets.length){w=new rl(c.lastChild);c.lastChild.childWidgets.push(w)}m.line=c.lastChild.lastChild,c.lastChild.lastChild.children.push(m)}if(!t.isNullOrUndefined(l.contentControlProperties))if(l.firstChild===c){var v=new yl("Row");if(v.contentControlProperties=l.contentControlProperties,v.type=0,0===c.firstChild.childWidgets.length){w=new rl(c.firstChild);c.firstChild.childWidgets.push(w)}v.line=c.firstChild.firstChild,c.firstChild.firstChild.children.splice(0,0,v)}else if(l.lastChild===c){var b=new yl("Row");if(b.contentControlProperties=l.contentControlProperties,b.type=1,0===c.lastChild.childWidgets.length){var w=new rl(c.lastChild);c.lastChild.childWidgets.push(w)}b.line=c.lastChild.lastChild,c.lastChild.lastChild.children.push(b)}this.isPageBreakInsideTable=!1}}l.childWidgets.length>0&&(o.childWidgets.push(l),l.containerWidget=o)}o.containerWidget=n,o.childWidgets.length>0&&i.push(o),o.isGridUpdated=!1,o.updateRowSpan(),a||o.assignCellColumnIndexes()},e.prototype.parseTablePositioning=function(e,i){i.wrapTextAround=!t.isNullOrUndefined(e[wo[this.keywordIndex]])&&bs.parseBoolValue(e[wo[this.keywordIndex]]),i.wrapTextAround&&(i.positioning=new $s,i.positioning.allowOverlap=bs.parseBoolValue(e[Co[this.keywordIndex]][To[this.keywordIndex]]),t.isNullOrUndefined(e[Co[this.keywordIndex]][Io[this.keywordIndex]])||(i.positioning.distanceBottom=bs.convertPointToPixel(e[Co[this.keywordIndex]][Io[this.keywordIndex]])),t.isNullOrUndefined(e[Co[this.keywordIndex]][No[this.keywordIndex]])||(i.positioning.distanceLeft=bs.convertPointToPixel(e[Co[this.keywordIndex]][No[this.keywordIndex]])),t.isNullOrUndefined(e[Co[this.keywordIndex]][So[this.keywordIndex]])||(i.positioning.distanceRight=bs.convertPointToPixel(e[Co[this.keywordIndex]][So[this.keywordIndex]])),t.isNullOrUndefined(e[Co[this.keywordIndex]][Oo[this.keywordIndex]])||(i.positioning.distanceTop=bs.convertPointToPixel(e[Co[this.keywordIndex]][Oo[this.keywordIndex]])),t.isNullOrUndefined(e[Co[this.keywordIndex]][Bt[this.keywordIndex]])||(i.positioning.verticalAlignment=this.getTableVerticalPosition(e[Co[this.keywordIndex]][Bt[this.keywordIndex]])),t.isNullOrUndefined(e[Co[this.keywordIndex]][ko[this.keywordIndex]])||(i.positioning.verticalOrigin=this.getTableVerticalRelation(e[Co[this.keywordIndex]][ko[this.keywordIndex]])),i.positioning.verticalPosition=e[Co[this.keywordIndex]][Ao[this.keywordIndex]],t.isNullOrUndefined(e[Co[this.keywordIndex]][Uo[this.keywordIndex]])||(i.positioning.horizontalAlignment=this.getTableHorizontalPosition(e[Co[this.keywordIndex]][Uo[this.keywordIndex]])),t.isNullOrUndefined(e[Co[this.keywordIndex]][Lo[this.keywordIndex]])||(i.positioning.horizontalOrigin=this.getTableHorizontalRelation(e[Co[this.keywordIndex]][Lo[this.keywordIndex]])),i.positioning.horizontalPosition=e[Co[this.keywordIndex]][Bo[this.keywordIndex]])},e.prototype.parseRowGridValues=function(e,i,r){t.isNullOrUndefined(e[Vt[r]])||(i.gridBefore=e[Vt[r]]),t.isNullOrUndefined(e[Dt[r]])||(i.gridBeforeWidth=e[Dt[r]]),t.isNullOrUndefined(e[zt[r]])||(i.gridBeforeWidthType=this.getWidthType(e[zt[r]])),t.isNullOrUndefined(e[_t[r]])||(i.gridAfter=e[_t[r]]),t.isNullOrUndefined(e[jt[r]])||(i.gridAfterWidth=e[jt[r]]),t.isNullOrUndefined(e[Gt[r]])||(i.gridAfterWidthType=this.getWidthType(e[Gt[r]]))},e.prototype.parseContentControlProperties=function(e,i,r){if(t.isNullOrUndefined(r)&&(r=this.keywordIndex),t.isNullOrUndefined(e[Mn[r]])||(i.lockContentControl=bs.parseBoolValue(e[Mn[r]])),t.isNullOrUndefined(e[Vn[r]])||(i.lockContents=bs.parseBoolValue(e[Vn[r]])),t.isNullOrUndefined(e[Gn[r]])?i.tag=void 0:i.tag=e[Gn[r]],t.isNullOrUndefined(e[Er[r]])||(i.color=e[Er[r]]),t.isNullOrUndefined(e[Kn[r]])?i.title=void 0:i.title=e[Kn[r]],t.isNullOrUndefined(e[Ea[r]])||(i.appearance=this.getContentControlAppearance(e[Ea[r]])),t.isNullOrUndefined(e[Sa[r]])||(i.type=this.getContentControlType(e[Sa[r]])),t.isNullOrUndefined(e[Yn[r]])||(i.hasPlaceHolderText=bs.parseBoolValue(e[Yn[r]])),t.isNullOrUndefined(e[Xn[r]])||(i.multiline=bs.parseBoolValue(e[Xn[r]])),t.isNullOrUndefined(e[Jn[r]])||(i.isTemporary=bs.parseBoolValue(e[Jn[r]])),t.isNullOrUndefined(e[k[r]])||this.parseCharacterFormat(r,e[k[r]],i.characterFormat),"CheckBox"===i.type)t.isNullOrUndefined(e[to[r]])||(i.isChecked=bs.parseBoolValue(e[to[r]])),t.isNullOrUndefined(e[io[r]])||(i.uncheckedState=new bl,i.uncheckedState.font=e[io[r]][ao[r]],i.uncheckedState.value=e[io[r]][so[r]]),t.isNullOrUndefined(e[ro[r]])||(i.checkedState=new bl,i.checkedState.font=e[ro[r]][ao[r]],i.checkedState.value=e[ro[r]][so[r]]);else if("Date"===i.type)t.isNullOrUndefined(e[Zn[r]])||(i.dateCalendarType=this.getDateCalendarType(e[Zn[r]])),t.isNullOrUndefined(e[Qn[r]])||(i.dateStorageFormat=this.getDateStorageFormat(e[Qn[r]])),t.isNullOrUndefined(e[$n[r]])||(i.dateDisplayLocale=e[$n[r]]),t.isNullOrUndefined(e[eo[r]])||(i.dateDisplayFormat=e[eo[r]]);else if(("ComboBox"===i.type||"DropDownList"===i.type)&&!t.isNullOrUndefined(e[no[r]])){i.contentControlListItems=[];for(var n=0;n<e[no[r]].length;n++){var o=new Wl;o.displayText=e[no[r]][n][lo[r]],o.value=e[no[r]][n][so[r]],i.contentControlListItems.push(o)}}t.isNullOrUndefined(e[oo[r]])||(i.xmlMapping=new xl,i.xmlMapping.isMapped=bs.parseBoolValue(e[oo[r]][ho[r]]),i.xmlMapping.isWordMl=bs.parseBoolValue(e[oo[r]][co[r]]),t.isNullOrUndefined(e[oo[r]][go[r]])||(i.xmlMapping.prefixMapping=e[oo[r]][go[r]]),i.xmlMapping.xPath=e[oo[r]][po[r]],i.xmlMapping.storeItemId=e[oo[r]][uo[r]],t.isNullOrUndefined(e[oo[r]][fo[r]])||(i.xmlMapping.customXmlPart=new wl,i.xmlMapping.customXmlPart.id=e[oo[r]][fo[r]][mo[r]],i.xmlMapping.customXmlPart.xml=e[oo[r]][fo[r]][An[r]]))},e.prototype.parseSymbol=function(e,t){var i=e.split(" "),r=i.indexOf("SYMBOL");if(-1!==r){var n=i[r+1],o=new hl;o.characterFormat=new S(o,this.documentHelper),o.text=String.fromCharCode(parseInt(n));var a=i.indexOf("\\f");if(-1!==a){for(var s="",l=a+1;l<i.length&&"\\s"!==i[l];l++)s+=i[l]+" ";null!==s&&(s=(s=s.replace(/"/g,"")).trim(),o.characterFormat.fontFamily=s)}var d=i.indexOf("\\s");-1!==d&&(o.characterFormat.fontSize=parseInt(i[d+1])),o.line=t,t.children.push(o)}},e.prototype.parseParagraph=function(e,i,r,n,o){var a=!1;t.isNullOrUndefined(n)?n=new rl(i):a=!0;for(var s,l=!1,d=this.documentHelper.enableTrackChanges,h=!1,c=!1,g=void 0,p=0;p<e.length;p++){var u=e[p];if(h=!1,u.hasOwnProperty([on[this.keywordIndex]])&&(2!==u[on[this.keywordIndex]]||p!==e.length-1&&e[p+1].hasOwnProperty(mr[this.keywordIndex])||(this.hasFieldSeparator=!0),1===u[on[this.keywordIndex]]&&this.hasFieldSeparator&&(h=!0)),h&&this.documentHelper.isPageField)(M=new ul).characterFormat=new S(M,this.documentHelper),M.text="",M.line=n,n.children.push(M),this.hasFieldSeparator=!1,l=!0,p--;else if(h&&!t.isNullOrUndefined(g)&&-1!==g.indexOf("SYMBOL")&&(this.parseSymbol(g,n),g=void 0,h=!1),!u.hasOwnProperty(mr[this.keywordIndex])&&!u.hasOwnProperty(Ne[this.keywordIndex])||u.hasOwnProperty(Ln[this.keywordIndex])){if(u.hasOwnProperty(Ln[this.keywordIndex])){var f=new gl;f.line=n,f.footnoteType=this.getFootnoteType(u[Ln[this.keywordIndex]]),"Footnote"===f.footnoteType?this.documentHelper.footnoteCollection.push(f):this.documentHelper.endnoteCollection.push(f),f.symbolCode=u[Un[this.keywordIndex]],f.symbolFontName=u[Bn[this.keywordIndex]],f.customMarker=u[Hn[this.keywordIndex]],f.characterFormat=new S(f,this.documentHelper),this.parseCharacterFormat(this.keywordIndex,u[k[this.keywordIndex]],f.characterFormat,r),this.applyCharacterStyle(u,f),this.checkAndApplyRevision(this.keywordIndex,u,f,i),this.parseBody(u[Ho[this.keywordIndex]],f.bodyWidget.childWidgets,f.bodyWidget,!1,void 0,void 0,void 0,!0),n.children.push(f),l=!0}else if(u.hasOwnProperty(gr[this.keywordIndex]))this.documentHelper.isEditorModule&&(this.documentHelper.editorProperties.chartType=!0),this.parseChart(u,n,!1),l=!0;else if(u.hasOwnProperty(_r[this.keywordIndex])){var m=new Il(bs.parseBoolValue(u[Kr[this.keywordIndex]]));m=this.parseImage(u,n,!1),"Inline"!==this.getTextWrappingStyle(m.textWrappingStyle)&&i.floatingElements.push(m),this.parseCharacterFormat(this.keywordIndex,u[k[this.keywordIndex]],m.characterFormat),l=!0}else if(u.hasOwnProperty(rn[this.keywordIndex])||u.hasOwnProperty(on[this.keywordIndex])&&0===u[on[this.keywordIndex]]){c=!0;var y=new ol(0);if(this.parseCharacterFormat(this.keywordIndex,u[k[this.keywordIndex]],y.characterFormat,r),this.applyCharacterStyle(u,y),y.fieldCodeType=u.fieldCodeType,y.hasFieldEnd=u[rn[this.keywordIndex]],u.hasOwnProperty(nn[this.keywordIndex])){var v=void 0;v=this.parseFormFieldData(this.keywordIndex,u,v),y.formFieldData=v,this.isContextBasedPaste||this.documentHelper.formFields.push(y)}this.documentHelper.fieldStacks.push(y),this.checkAndApplyRevision(this.keywordIndex,u,y,i),y.line=n,this.isContextBasedPaste||this.documentHelper.fields.push(y),n.children.push(y)}else if(u.hasOwnProperty([on[this.keywordIndex]])){var W=void 0;if(2===u[on[this.keywordIndex]]||1===u[on[this.keywordIndex]]&&c){if(W=new ol(2),this.parseCharacterFormat(this.keywordIndex,u[k[this.keywordIndex]],W.characterFormat,r),this.checkAndApplyRevision(this.keywordIndex,u,W,i),this.fieldSeparator=W,this.documentHelper.fieldStacks.length>0&&(W.fieldBegin=this.documentHelper.fieldStacks[this.documentHelper.fieldStacks.length-1],W.fieldBegin.fieldSeparator=W,n.children.length>=2)){var b=this.containsFieldBegin(n);!t.isNullOrUndefined(b)&&b instanceof hl&&(b.text.match("PAGE")||b.text.match("page"))&&(b.text.replace(/^\s+/g,"").startsWith("HYPERLINK")||(this.documentHelper.isPageField=!0))}1===u[on[this.keywordIndex]]&&c&&(p--,this.hasFieldSeparator=!0),c=!1}else 1===u[on[this.keywordIndex]]&&(W=new ol(1),this.parseCharacterFormat(this.keywordIndex,u[k[this.keywordIndex]],W.characterFormat,r),this.applyCharacterStyle(u,W),this.checkAndApplyRevision(this.keywordIndex,u,W,i),this.documentHelper.fieldStacks.length>0&&(W.fieldBegin=this.documentHelper.fieldStacks[this.documentHelper.fieldStacks.length-1],W.fieldBegin.fieldEnd=W),!t.isNullOrUndefined(W.fieldBegin)&&W.fieldBegin.fieldSeparator&&(W.fieldSeparator=W.fieldBegin.fieldSeparator,W.fieldBegin.fieldSeparator.fieldEnd=W,l=!0),this.documentHelper.fieldStacks.splice(this.documentHelper.fieldStacks.length-1,1),this.fieldSeparator=void 0,this.documentHelper.isPageField=!1,this.isContextBasedPaste||this.documentHelper.fieldCollection.push(W.fieldBegin),g=void 0);W.line=n,n.children.push(W)}else if(u.hasOwnProperty([aa[this.keywordIndex]])){var x=void 0;if(x=new ml(u[aa[this.keywordIndex]]),x.name=u[se[this.keywordIndex]],!t.isNullOrUndefined(this.documentHelper)&&!this.documentHelper.documentEditorSettings.allowHyphensInBookmarkNames){var w=x.name.replace("-","_");x.name=w}if(x.properties=u[sa[this.keywordIndex]],t.isNullOrUndefined(u[sa[this.keywordIndex]])||(t.isNullOrUndefined(u[sa[this.keywordIndex]][Ya[this.keywordIndex]])||(x.properties.isAfterParagraphMark=bs.parseBoolValue(u[sa[this.keywordIndex]][Ya[this.keywordIndex]])),t.isNullOrUndefined(u[sa[this.keywordIndex]][$a[this.keywordIndex]])||(x.properties.isAfterTableMark=bs.parseBoolValue(u[sa[this.keywordIndex]][$a[this.keywordIndex]])),t.isNullOrUndefined(u[sa[this.keywordIndex]][Ja[this.keywordIndex]])||(x.properties.isAfterRowMark=bs.parseBoolValue(u[sa[this.keywordIndex]][Ja[this.keywordIndex]])),t.isNullOrUndefined(u[sa[this.keywordIndex]][Xa[this.keywordIndex]])||(x.properties.isAfterCellMark=bs.parseBoolValue(u[sa[this.keywordIndex]][Xa[this.keywordIndex]])),t.isNullOrUndefined(u[sa[this.keywordIndex]][ua[this.keywordIndex]])||(x.properties.columnFirst=u[sa[this.keywordIndex]][ua[this.keywordIndex]]),t.isNullOrUndefined(u[sa[this.keywordIndex]][fa[this.keywordIndex]])||(x.properties.columnLast=u[sa[this.keywordIndex]][fa[this.keywordIndex]])),this.checkAndApplyRevision(this.keywordIndex,u,x,i),n.children.push(x),x.line=n,!this.isParseHeader||this.isPaste){var F=!1;if(this.isPaste&&(F=-1!==this.documentHelper.editorProperties.selectedBookmarks.indexOf(x.name)),0===u[aa[this.keywordIndex]]){var C=this.isPaste&&!this.documentHelper.bookmarks.containsKey(x.name);this.isPaste?C||F||n.children.splice(n.children.indexOf(x),1):this.documentHelper.bookmarks.add(x.name,x)}else if(1===u[aa[this.keywordIndex]]&&this.documentHelper.bookmarks.containsKey(x.name)){var P=this.documentHelper.bookmarks.get(x.name),T=this.isPaste&&t.isNullOrUndefined(P.reference);!this.isPaste||T&&!this.isContextBasedPaste?(P.reference=x,x.reference=P,this.documentHelper.endBookmarksUpdated.push(x.name)):T||F||n.children.splice(n.children.indexOf(x),1)}}0!==x.name.indexOf("_")&&(l=!0)}else if(u.hasOwnProperty([pa[this.keywordIndex]])){if(u.hasOwnProperty(va[this.keywordIndex])){var O=new Al;if(this.editableRanges.containsKey(u[pa[this.keywordIndex]])){var N=this.editableRanges.get(u[pa[this.keywordIndex]]);O.editRangeStart=N,N.editRangeEnd=O,t.isNullOrUndefined(u[pa[this.keywordIndex]])||(O.editRangeId=u[pa[this.keywordIndex]]),this.editableRanges.remove(u[pa[this.keywordIndex]])}n.children.push(O),O.line=n}else{var I=this.parseEditableRangeStart(u);n.children.push(I),I.line=n,this.editableRanges.containsKey(u[pa[this.keywordIndex]])||this.editableRanges.add(u[pa[this.keywordIndex]],I)}l=!0}else if(u.hasOwnProperty([xn[this.keywordIndex]])&&!this.isParseHeader){var A=u[xn[this.keywordIndex]],L=void 0;this.commentStarts.containsKey(A)&&this.commentStarts.get(A);if(this.commentEnds.containsKey(A)&&this.commentEnds.get(A),u.hasOwnProperty([wn[this.keywordIndex]])){if(0===u[wn[this.keywordIndex]]){var U=new Jl(0);U.commentId=A,this.commentStarts.containsKey(A)||this.commentStarts.add(A,U),U.line=n,n.children.push(U),L=this.commentsCollection.get(A),t.isNullOrUndefined(L)||(L.commentStart=U,U.comment=L)}else{var B=new Jl(1);B.commentId=A,this.commentEnds.containsKey(A)||this.commentEnds.add(A,B),B.line=n,n.children.push(B),L=this.commentsCollection.get(A),t.isNullOrUndefined(L)||(L.commentEnd=B,B.comment=L)}!t.isNullOrUndefined(L)&&L.isReply&&(t.isNullOrUndefined(L.ownerComment.commentStart)&&(L.ownerComment.commentStart=L.commentStart),t.isNullOrUndefined(L.ownerComment.commentEnd)&&(L.ownerComment.commentEnd=L.commentEnd))}}else if(u.hasOwnProperty([yr[this.keywordIndex]])){var H=this.parseShape(u,n);H.line=n,this.checkAndApplyRevision(this.keywordIndex,u,H,i),n.children.push(H),i.floatingElements.push(H)}else if(u.hasOwnProperty(qn[this.keywordIndex])){var R=new yl("Inline"),q=new yl("Inline");this.parseContentControlProperties(u[qn[this.keywordIndex]],R.contentControlProperties),q.contentControlProperties=R.contentControlProperties,R.line=n,q.line=n,R.type=0,q.type=1,u.hasOwnProperty(_n[this.keywordIndex])&&(R.authorName=u[_n[this.keywordIndex]],q.authorName=u[_n[this.keywordIndex]]),u.hasOwnProperty(jn[this.keywordIndex])&&(R.revDateTime=u[jn[this.keywordIndex]],q.revDateTime=u[jn[this.keywordIndex]]),u.hasOwnProperty(Dn[this.keywordIndex])&&(R.isInsertRevision=bs.parseBoolValue(u[Dn[this.keywordIndex]]),q.isInsertRevision=bs.parseBoolValue(u[Dn[this.keywordIndex]])),u.hasOwnProperty(zn[this.keywordIndex])&&(R.isDeleteRevision=bs.parseBoolValue(u[zn[this.keywordIndex]]),q.isDeleteRevision=bs.parseBoolValue(u[zn[this.keywordIndex]])),n.children.push(R),this.parseParagraph(u[Rn[this.keywordIndex]],i,r,n);for(var E=n.children[n.children.length-1];!(E instanceof yl);)E.contentControlProperties=R.contentControlProperties,E=E.previousElement;n.children.push(q),l=!0}}else{var M=void 0;if(this.documentHelper.isPageField){var V=this.documentHelper.fieldStacks[this.documentHelper.fieldStacks.length-1],D=n.children[n.children.length-1];if(this.isParseHeader&&D instanceof ul&&D.fieldBegin===V)continue;(M=new ul).fieldBegin=V}else if("\t"===u[mr[this.keywordIndex]])M=new fl;else{if("\f"===u[mr[this.keywordIndex]]&&this.isPageBreakInsideTable)continue;if(u.hasOwnProperty(Ne[this.keywordIndex]))(M=new nd).breakClearType=this.getBreakClearType(u[Ne[this.keywordIndex]]);else if(""===u[mr[this.keywordIndex]]||bs.checkTextFormat(u[mr[this.keywordIndex]])&&0===n.children.length&&0===p&&o)M=new ad;else if(M=new hl,0===u[mr[this.keywordIndex]].length&&!t.isNullOrUndefined(u[Ee[this.keywordIndex]]))continue}if(M.characterFormat=new S(M,this.documentHelper),this.parseCharacterFormat(this.keywordIndex,u[k[this.keywordIndex]],M.characterFormat,r),this.applyCharacterStyle(u,M),M.text=M instanceof nd?"\v":u[mr[this.keywordIndex]].replace(/\n/g," "),g=M.text,this.isHtmlPaste&&(M instanceof hl||M instanceof nd)){var z=void 0;n.children.length>0&&(z=n.children[n.children.length-1]),this.documentHelper.textHelper.isRTLText(M.text)?(M.characterFormat.bidi=!0,z instanceof hl&&" "===z.text&&(z.characterFormat.bidi=!0)):" "===M.text&&z&&z.characterFormat.bidi&&(M.characterFormat.bidi=!0)}M.line=n;for(var _=n.children,j=_.length-1;_.length>0&&_[j]instanceof ml&&!t.isNullOrUndefined(_[j].properties)&&!0===_[j].properties.isAfterParagraphMark;)j--;if(j!==_.length-1?_.splice(j+1,0,M):_.push(M),this.documentHelper.parser.isPaste&&!this.isCutPerformed){if(!t.isNullOrUndefined(u[Ee[this.keywordIndex]]))for(var G=0;G<u[Ee[this.keywordIndex]].length;G++)if(this.revisionCollection.containsKey(u[Ee[this.keywordIndex]][G])){if(d&&(s=this.revisionCollection.get(u[Ee[this.keywordIndex]][G])),!t.isNullOrUndefined(s)&&n.children.length>1&&!t.isNullOrUndefined(n.children[p-1].getRevision(G))&&(!d||d&&"Deletion"===s.revisionType)&&s.revisionID===u[Ee[this.keywordIndex]][G]){u[Ee[this.keywordIndex]][G]=n.children[p-1].getRevision(G).revisionID,this.checkAndApplyRevision(this.keywordIndex,u,M,i);continue}d||(s=this.documentHelper.revisionsInternal.containsKey(u[Ee[this.keywordIndex]][G])?this.documentHelper.revisionsInternal.get(u[Ee[this.keywordIndex]][G]):this.revisionCollection.get(u[Ee[this.keywordIndex]][G])),this.documentHelper.isEditorModule&&this.documentHelper.editorProperties.isRemoteAction?this.revisionHelper.insertRevision(M,s.revisionType,s.author,void 0,void 0,!1,s.revisionID):this.revisionHelper.insertRevision(M,s.revisionType,s.author,void 0,void 0,!1),u[Ee[this.keywordIndex]][G]=M.revisions[G].revisionID}this.documentHelper.textHelper.isRTLText(M.text)&&(this.documentHelper.layout.isDocumentContainsRtl=!0)}else this.checkAndApplyRevision(this.keywordIndex,u,M,i);M instanceof hl&&M.text.length>90&&bs.splitWordByMaxLength(M,n,!0),l=!0}}return this.isCutPerformed=!1,a||i.childWidgets.push(n),l},e.prototype.parseShape=function(e,t){var i;if(e.hasOwnProperty(_r[this.keywordIndex]))return this.parseImage(e,t,!0);if(e.hasOwnProperty(gr[this.keywordIndex]))return this.parseChart(e,t,!0);if(i=e[as[this.keywordIndex]]?new Tl:new Pl,(i=this.ParseChildShape(e,i))instanceof Tl){for(var r=0;r<e[as[this.keywordIndex]].length;r++){var n=e[as[this.keywordIndex]][r],o=this.parseShape(n,t);o.line=t,o.containerShape=i,o instanceof Tl||(o.shapeX=bs.convertPointToPixel(n.x),o.shapeY=bs.convertPointToPixel(n.y),o.shapeWidth=bs.convertPointToPixel(n[wr[this.keywordIndex]]),o.shapeHeight=bs.convertPointToPixel(n[Fr[this.keywordIndex]])),this.checkAndApplyRevision(this.keywordIndex,n,o,t.paragraph),i.childWidgets.push(o)}i.shapeX=bs.convertPointToPixel(e.x),i.shapeY=bs.convertPointToPixel(e.y),i.shapeWidth=bs.convertPointToPixel(e[wr[this.keywordIndex]]),i.shapeHeight=bs.convertPointToPixel(e[Fr[this.keywordIndex]]),i.offsetXValue=bs.convertPointToPixel(e[ss[this.keywordIndex]]),i.offsetYValue=bs.convertPointToPixel(e[ls[this.keywordIndex]]),i.extentXValue=bs.convertPointToPixel(e[ds[this.keywordIndex]]),i.extentYValue=bs.convertPointToPixel(e[hs[this.keywordIndex]]),i.is2007Shape=bs.parseBoolValue(e[fs[this.keywordIndex]]),i.coordinateSize=e[us[this.keywordIndex]],i.coordinateXOrigin=bs.convertPointToPixel(e[gs[this.keywordIndex]]),i.coordinateYOrigin=bs.convertPointToPixel(e[ps[this.keywordIndex]]),i.leftMargin=bs.convertPointToPixel(e[ut[this.keywordIndex]]),i.topMargin=bs.convertPointToPixel(e[mt[this.keywordIndex]])}return i},e.prototype.ParseChildShape=function(e,i){if(i.shapeId=e[yr[this.keywordIndex]],i.name=e[se[this.keywordIndex]],i.alternateText=e[vr[this.keywordIndex]],i.title=e[Kn[this.keywordIndex]],i.visible=bs.parseBoolValue(e[Wr[this.keywordIndex]]),i.width=bs.convertPointToPixel(e[wr[this.keywordIndex]]),i.height=bs.convertPointToPixel(e[Fr[this.keywordIndex]]),i.is2007Shape=bs.parseBoolValue(e[fs[this.keywordIndex]]),i.coordinateSize=e[us[this.keywordIndex]],i.coordinateXOrigin=bs.convertPointToPixel(e[gs[this.keywordIndex]]),i.coordinateYOrigin=bs.convertPointToPixel(e[ps[this.keywordIndex]]),i.leftMargin=bs.convertPointToPixel(e[ut[this.keywordIndex]]),i.topMargin=bs.convertPointToPixel(e[mt[this.keywordIndex]]),i.lineFromXPosition=e[ms[this.keywordIndex]],i.lineFromYPosition=e[ys[this.keywordIndex]],i.lineToXPosition=e[vs[this.keywordIndex]],i.lineToYPosition=e[Ws[this.keywordIndex]],0===i.height&&(i.isZeroHeight=!0),i.widthScale=e[Cr[this.keywordIndex]],i.heightScale=e[Pr[this.keywordIndex]],i.verticalPosition=bs.convertPointToPixel(e[Ao[this.keywordIndex]]),i.verticalOrigin=this.getVerticalOrigin(e[ko[this.keywordIndex]]),i.verticalAlignment=this.getShapeVerticalAlignment(e[Bt[this.keywordIndex]]),i.verticalRelativePercent=e[Ir[this.keywordIndex]],i.horizontalPosition=bs.convertPointToPixel(e[Bo[this.keywordIndex]]),i.horizontalOrigin=this.getHorizontalOrigin(e[Lo[this.keywordIndex]]),i.horizontalAlignment=this.getShapeHorizontalAlignment(e[Uo[this.keywordIndex]]),i.horizontalRelativePercent=e[kr[this.keywordIndex]],i.heightRelativePercent=e[Ar[this.keywordIndex]],i.widthRelativePercent=e[Lr[this.keywordIndex]],i.zOrderPosition=e[Ur[this.keywordIndex]],i.allowOverlap=bs.parseBoolValue(e[To[this.keywordIndex]]),i.textWrappingStyle=this.getTextWrappingStyle(e[Sr[this.keywordIndex]]),i.textWrappingType=this.getTextWrappingType(e[Nr[this.keywordIndex]]),i.isBelowText=bs.parseBoolValue(e[br[this.keywordIndex]]),i.isHorizontalRule=bs.parseBoolValue(e[xr[this.keywordIndex]]),t.isNullOrUndefined(e[Io[this.keywordIndex]])||(i.distanceBottom=bs.convertPointToPixel(e[Io[this.keywordIndex]])),t.isNullOrUndefined(e[No[this.keywordIndex]])||(i.distanceLeft=bs.convertPointToPixel(e[No[this.keywordIndex]])),t.isNullOrUndefined(e[So[this.keywordIndex]])||(i.distanceRight=bs.convertPointToPixel(e[So[this.keywordIndex]])),t.isNullOrUndefined(e[Oo[this.keywordIndex]])||(i.distanceTop=bs.convertPointToPixel(e[Oo[this.keywordIndex]])),i.layoutInCell=bs.parseBoolValue(e[Br[this.keywordIndex]]),i.lockAnchor=bs.parseBoolValue(e[Hr[this.keywordIndex]]),i.autoShapeType=this.getAutoShapeType(e[Rr[this.keywordIndex]]),i.editingPoints=e[os[this.keywordIndex]],e.hasOwnProperty(Tr[this.keywordIndex])){var r=new Sl;r.line=bs.parseBoolValue(e[Tr[this.keywordIndex]][xi[this.keywordIndex]]),r.lineFormatType=this.getLineFormatType(e[Tr[this.keywordIndex]][Ma[this.keywordIndex]]),r.color=e[Tr[this.keywordIndex]][Er[this.keywordIndex]],r.weight=e[Tr[this.keywordIndex]][Da[this.keywordIndex]],r.dashStyle=this.getLineDashStyle(e[Tr[this.keywordIndex]][ui[this.keywordIndex]]),i.lineFormat=r}if(e.hasOwnProperty(Or[this.keywordIndex])){var n=new Nl;n.color=e[Or[this.keywordIndex]][Er[this.keywordIndex]],n.fill=bs.parseBoolValue(e[Or[this.keywordIndex]][Mr[this.keywordIndex]]),n.isDefaultFill=bs.parseBoolValue(e[Or[this.keywordIndex]][Vr[this.keywordIndex]]),n.foreColor=e[Or[this.keywordIndex]][wi[this.keywordIndex]],n.fillType=this.getFillType(e[Or[this.keywordIndex]][Dr[this.keywordIndex]]),i.fillFormat=n}if(i instanceof Pl&&e.hasOwnProperty(qr[this.keywordIndex])){var o=new Ol;if(o.textVerticalAlignment=this.getTextVerticalAlignment(e[qr[this.keywordIndex]][zr[this.keywordIndex]]),o.marginLeft=bs.convertPointToPixel(e[qr[this.keywordIndex]][ut[this.keywordIndex]]),o.marginRight=bs.convertPointToPixel(e[qr[this.keywordIndex]][ft[this.keywordIndex]]),o.marginTop=bs.convertPointToPixel(e[qr[this.keywordIndex]][mt[this.keywordIndex]]),o.marginBottom=bs.convertPointToPixel(e[qr[this.keywordIndex]][yt[this.keywordIndex]]),0==e[qr[this.keywordIndex]][Ho[this.keywordIndex]].length){var a={i:[]};e[qr[this.keywordIndex]][Ho[this.keywordIndex]].push(a)}this.parseBody(e[qr[this.keywordIndex]][Ho[this.keywordIndex]],o.childWidgets,o),i.textFrame=o,o.containerShape=i}return i},e.prototype.parseImage=function(e,i,r){var n=this,o=new Il(bs.parseBoolValue(e[Kr[this.keywordIndex]]));o.isMetaFile=bs.parseBoolValue(e[Yr[this.keywordIndex]]),o.isCompressed=e[ja[this.keywordIndex]],o.metaFileImageString=e[jr[this.keywordIndex]],o.characterFormat=new S(o,this.documentHelper),o.line=i,r||(this.checkAndApplyRevision(this.keywordIndex,e,o,i.paragraph),i.children.push(o));var a=bs.formatClippedString(e[_r[this.keywordIndex]]).formatClippedString;if(this.validateImageUrl(a)?this.isPaste&&!t.isNullOrUndefined(this.documentHelper.editorProperties.pasteImageIndex)?(o.imageString=this.documentHelper.editorProperties.pasteImageIndex.get(e[_r[this.keywordIndex]]),t.isNullOrUndefined(e[jr[this.keywordIndex]])||(o.metaFileImageString=this.documentHelper.editorProperties.pasteImageIndex.get(e[jr[this.keywordIndex]]))):o.imageString=e[_r[this.keywordIndex]]:o.imageString="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAgVBMVEX///8AAADgAADY2Njl5eVcXFxjY2NZWVl/f3+wsLCmpqb4+PiioqKpqam7u7vV1dX2uLj2wsLhFRXzpKT3vb30sbHhCwv74+P40dH+9vbkIyO2trbBwcHLy8tsbGycnJz529v4zMzrbGzlLS3qZmblNzfrdXXoRkbvi4vvgYHlHh7CZsBOAAADpUlEQVR4nO3da1faQBSF4ekAUQlUEFs14AXxVv7/D6yaQiZx5mSEYXF2ut+PNKzyyK5diYDmR9czx34AB49C/CjE759w3jvvWr15Tdgz3atXE54f++EcIArxoxA/CvGjED8K8aMQPwrxoxA/CvGLEeZ9jPJdhfk4GyCUjb3ECGE/Q6m/q3DwfudjP0ERZYN9hKdn2hvd3+0jHJz5/kBVuTk96bbQUEjhYR9ckiikUH8UUqg/CinUH4UU6o9CCvVHIYX6o5BC/VFIof4opFB/FFKoPwop1B+FFOqPQgrjyxfjVC38Lxk9tnAxGqZqdKtSOE4GHA5/fuNJpDCtcNHbv4VqYYqPLjgfUViPQgrjozA2CptRSGF8/59w+Wrt+rr1btNna1cPzg0wwuXavncxabnX7PfHYYXzlYARvlobQZyUR9mXm+1NMEK7SSLONgcVV9vb8IQXv4J3KSeKKlxXxNCzONkeYp8AV3p9UT1+P3FWHVAsq5thhGZSEb1DrSZq7dS5HUdoLiuBZ6jORG3tCwAkNJfCUJ2Jrqe1P0ESCkMNTdSACYNDDU7UoAkDQw1P1MAJvUMVJmrwhJ6hShM1gMIvQxUnahCFjaHKEzWQQneoxR95ogZTWBuqPFEDKnSHKk/UoArdoYoTNbDC5lBDEzW4QjMpYiZqgIXG/S76JhwHK5zVVipcnkIVuv/RW/HyFKhwYhuFr6NiCmdNoDBUSGFjovJQEYXuRN9ahwoorJ8uSZenPsMTNk+X2q6jwgm/ntHL11HhhL4zenmoYEL/Gb04VCxh6KKTNFQoYfiikzBUJKF00Sk8VCChfF00OFQcYdt10dBQYYRT5xn0n9G7Q0X8GfCzNNEyZ6iPgD/HlydaVg11DfhajJaJlm2HugIUrlomWrYZKuJKHz6vHhbSM/hROdRnxNe1meuXYvW0DB6+aflYrB7dlzDiCM3N1dVN6GDhMCDhjlHYjEIK46MwNgqbUUhhfJ/vA07wO8N1vw94ONo/3e/lTpVOYfc/UyG//ZmqW52fi/FuTNW3/lZ+eguF+qOQQv1RSKH+KKRQfxRSqD8KKdQfhRTqj0IK9UchhfqjkEL9UUih/iikUH8UUqg/CmXh6Hsv3jlK+wnvD/vgkrSHMMuyu1P9ZdmuwnycDQYn+svG3n9KEUKT9zHyf6+IEWJHIX4U4kchfhTiRyF+FOJHIX4U4kchfnVhijeZa6sunCf4ZdPamteEHY5C/CjEr/vCv0ec0g+AtS1QAAAAAElFTkSuQmCC","NaN"===parseInt(e[_r[this.keywordIndex]]).toString()&&this.documentHelper.addBase64StringInCollection(o),o.width=bs.convertPointToPixel(e[wr[this.keywordIndex]]),o.height=bs.convertPointToPixel(e[Fr[this.keywordIndex]]),!this.isContextBasedPaste){var s=this.documentHelper.getImageString(o);t.isNullOrUndefined(s)||!bs.startsWith(s,"http://")&&!bs.startsWith(s,"https://")||(o.element.crossOrigin="Anonymous",this.viewer.documentHelper.getBase64(s,o.width,o.height).then(function(e){n.viewer.documentHelper.images.get(parseInt(o.imageString))[1]=e,o.element.src=e})),o.element.src=s}return o.top=e[Jr[this.keywordIndex]],o.left=e[$r[this.keywordIndex]],o.bottom=e[Zr[this.keywordIndex]],o.right=e[Qr[this.keywordIndex]],o.cropHeightScale=e[en[this.keywordIndex]],o.cropWidthScale=e[tn[this.keywordIndex]],o.name=e[se[this.keywordIndex]],o.alternateText=e[vr[this.keywordIndex]],o.title=e[Kn[this.keywordIndex]],o.visible=bs.parseBoolValue(e[Wr[this.keywordIndex]]),o.widthScale=e[Cr[this.keywordIndex]],o.heightScale=e[Pr[this.keywordIndex]],o.verticalPosition=bs.convertPointToPixel(e[Ao[this.keywordIndex]]),o.verticalOrigin=this.getVerticalOrigin(e[ko[this.keywordIndex]]),o.verticalAlignment=this.getShapeVerticalAlignment(e[Bt[this.keywordIndex]]),o.horizontalPosition=bs.convertPointToPixel(e[Bo[this.keywordIndex]]),o.horizontalOrigin=this.getHorizontalOrigin(e[Lo[this.keywordIndex]]),o.horizontalAlignment=this.getShapeHorizontalAlignment(e[Uo[this.keywordIndex]]),o.allowOverlap=bs.parseBoolValue(e[To[this.keywordIndex]]),t.isNullOrUndefined(e[Xr[this.keywordIndex]])||(o.hasImageReference=bs.parseBoolValue(e[Xr[this.keywordIndex]])),t.isNullOrUndefined(e[Sr[this.keywordIndex]])||(o.textWrappingStyle=this.getTextWrappingStyle(e[Sr[this.keywordIndex]])),t.isNullOrUndefined(e[Nr[this.keywordIndex]])||(o.textWrappingType=this.getTextWrappingType(e[Nr[this.keywordIndex]])),o.isBelowText=bs.parseBoolValue(e[br[this.keywordIndex]]),t.isNullOrUndefined(e[Io[this.keywordIndex]])||(o.distanceBottom=bs.convertPointToPixel(e[Io[this.keywordIndex]])),t.isNullOrUndefined(e[No[this.keywordIndex]])||(o.distanceLeft=bs.convertPointToPixel(e[No[this.keywordIndex]])),t.isNullOrUndefined(e[So[this.keywordIndex]])||(o.distanceRight=bs.convertPointToPixel(e[So[this.keywordIndex]])),t.isNullOrUndefined(e[Oo[this.keywordIndex]])||(o.distanceTop=bs.convertPointToPixel(e[Oo[this.keywordIndex]])),o.is2007Shape=bs.parseBoolValue(e[fs[this.keywordIndex]]),o.coordinateSize=e[us[this.keywordIndex]],o.coordinateXOrigin=bs.convertPointToPixel(e[gs[this.keywordIndex]]),o.coordinateYOrigin=bs.convertPointToPixel(e[ps[this.keywordIndex]]),o.leftMargin=bs.convertPointToPixel(e[ut[this.keywordIndex]]),o.topMargin=bs.convertPointToPixel(e[mt[this.keywordIndex]]),o.lineFromXPosition=e[ms[this.keywordIndex]],o.lineFromYPosition=e[ys[this.keywordIndex]],o.lineToXPosition=e[vs[this.keywordIndex]],o.lineToYPosition=e[Ws[this.keywordIndex]],o.zOrderPosition=e[Ur[this.keywordIndex]],o.layoutInCell=bs.parseBoolValue(e[Br[this.keywordIndex]]),o.is2007Shape=bs.parseBoolValue(e[fs[this.keywordIndex]]),o.coordinateSize=e[us[this.keywordIndex]],o.coordinateXOrigin=bs.convertPointToPixel(e[gs[this.keywordIndex]]),o.coordinateYOrigin=bs.convertPointToPixel(e[ps[this.keywordIndex]]),o.leftMargin=bs.convertPointToPixel(e[ut[this.keywordIndex]]),o.topMargin=bs.convertPointToPixel(e[mt[this.keywordIndex]]),o.lineFromXPosition=e[ms[this.keywordIndex]],o.lineFromYPosition=e[ys[this.keywordIndex]],o.lineToXPosition=e[vs[this.keywordIndex]],o.lineToYPosition=e[Ws[this.keywordIndex]],(!t.isNullOrUndefined(e[Jr[this.keywordIndex]])&&0!==e[Jr[this.keywordIndex]]||!t.isNullOrUndefined(e[Zr[this.keywordIndex]])&&0!==e[Zr[this.keywordIndex]]||!t.isNullOrUndefined(e[$r[this.keywordIndex]])&&0!==e[$r[this.keywordIndex]]||!t.isNullOrUndefined(e[Qr[this.keywordIndex]])&&0!==e[Qr[this.keywordIndex]])&&(o.isCrop=!0),o},e.prototype.parseChart=function(e,t,i){var n=new Ul;n.line=t,i||(this.checkAndApplyRevision(this.keywordIndex,e,n,t.paragraph),t.children.push(n)),n.title=e[cr[this.keywordIndex]],n.type=e[gr[this.keywordIndex]],n.chartGapWidth=e[pr[this.keywordIndex]],n.chartOverlap=e[ur[this.keywordIndex]],this.parseChartTitleArea(e[ar[this.keywordIndex]],n.chartTitleArea),this.parseChartArea(e[or[this.keywordIndex]],n.chartArea),this.parseChartArea(e[sr[this.keywordIndex]],n.chartPlotArea),this.parseChartLegend(e[lr[this.keywordIndex]],n.chartLegend),this.parseChartData(e,n),this.parseChartCategoryAxis(e[dr[this.keywordIndex]],n.chartPrimaryCategoryAxis),this.parseChartCategoryAxis(e[hr[this.keywordIndex]],n.chartPrimaryValueAxis),null!=e[fr[this.keywordIndex]]&&this.parseChartDataTable(e[fr[this.keywordIndex]],n.chartDataTable),n.height=bs.convertPointToPixel(e[Fr[this.keywordIndex]]),n.width=bs.convertPointToPixel(e[wr[this.keywordIndex]]);var o=new r.ChartComponent;return o.chartRender(e,this.keywordIndex),n.officeChart=o,o.chart.appendTo(n.targetElement),n},e.prototype.parseFormFieldData=function(e,t,i){if(i instanceof sl||i instanceof ll||i instanceof dl)i instanceof ll?(i.sizeType=t.sizeType,i.size=t.size,i.defaultValue=t.defaultValue,i.checked=t.checked):i instanceof sl?(i.type=t.type,i.maxLength=t.maxLength,i.defaultValue=t.defaultValue,i.format=t.format):(i.dropdownItems=t.dropdownItems,i.selectedIndex=t.selectedIndex),i.name=t.name,i.enabled=t.enabled,i.helpText=t.helpText,i.statusText=t.statusText;else{if(t[nn[e]].hasOwnProperty(hn[e]))(i=new sl).type=this.getTextFormFieldType(t[nn[e]][hn[e]][Sa[e]]),i.maxLength=t[nn[e]][hn[e]][pn[e]],i.defaultValue=t[nn[e]][hn[e]][un[e]],i.format=this.getTextFormFieldFormat(t[nn[e]][hn[e]][fn[e]]);else if(t[nn[e]].hasOwnProperty(cn[e]))(i=new ll).sizeType=this.getCheckBoxSizeType(t[nn[e]][cn[e]][mn[e]]),i.size=t[nn[e]][cn[e]][yn[e]],i.defaultValue=bs.parseBoolValue(t[nn[e]][cn[e]][un[e]]),i.checked=bs.parseBoolValue(t[nn[e]][cn[e]][vn[e]]);else{i=new dl;for(var r=t[nn[e]][gn[e]][Wn[e]],n=0;n<r.length&&!(i.dropdownItems.length>24);n++)i.dropdownItems.push(r[n]);var o=t[nn[e]][gn[e]][bn[e]];"string"==typeof o&&-1!==r.indexOf(o)?i.selectedIndex=r.indexOf(o):o>=0&&o<i.dropdownItems.length?i.selectedIndex=o:i.selectedIndex=0}i.name=t[nn[e]][se[e]],i.enabled=bs.parseBoolValue(t[nn[e]][sn[e]]),i.helpText=t[nn[e]][ln[e]],i.statusText=t[nn[e]][dn[e]]}return i},e.prototype.applyCharacterStyle=function(e,i){if(!t.isNullOrUndefined(e[k[this.keywordIndex]])&&!t.isNullOrUndefined(e[k[this.keywordIndex]][Te[this.keywordIndex]])){var r=this.documentHelper.styles.findByName(e[k[this.keywordIndex]][Te[this.keywordIndex]],"Character");i.characterFormat.applyStyle(r)}},e.prototype.parseEditableRangeStart=function(e){var i=new Ll;t.isNullOrUndefined(e[ua[this.keywordIndex]])||(i.columnFirst=e[ua[this.keywordIndex]]),t.isNullOrUndefined(e[fa[this.keywordIndex]])||(i.columnLast=e[fa[this.keywordIndex]]),t.isNullOrUndefined(e[pa[this.keywordIndex]])||(i.editRangeId=e[pa[this.keywordIndex]]);var r=t.isNullOrUndefined(e[ma[this.keywordIndex]])?"":e[ma[this.keywordIndex]],n=t.isNullOrUndefined(e[ya[this.keywordIndex]])?"":e[ya[this.keywordIndex]];return"everyone"===n&&(n="Everyone"),""!==r&&(i.user=r,-1===this.documentHelper.userCollection.indexOf(i.user)&&this.documentHelper.userCollection.push(i.user),this.addEditRangeCollection(i.user,i)),""!==n&&(i.group=n,-1===this.documentHelper.userCollection.indexOf(i.group)&&this.documentHelper.userCollection.push(i.group),this.addEditRangeCollection(i.group,i)),""===r&&""===n&&(i.group="Everyone",-1===this.documentHelper.userCollection.indexOf("Everyone")&&this.documentHelper.userCollection.push("Everyone"),this.addEditRangeCollection("Everyone",i)),i},e.prototype.addEditRangeCollection=function(e,t){if(this.documentHelper.editRanges.containsKey(e))this.documentHelper.editRanges.get(e).push(t);else{var i=[];i.push(t),this.documentHelper.editRanges.add(e,i)}},e.prototype.parseChartTitleArea=function(e,t){t.chartfontName=e[_a[this.keywordIndex]],t.chartFontSize=e[Fe[this.keywordIndex]],this.parseChartDataFormat(e[yi[this.keywordIndex]],t.dataFormat),this.parseChartLayout(e[mi[this.keywordIndex]],t.layout)},e.prototype.parseChartDataFormat=function(e,t){t.fill.color=e[Mr[this.keywordIndex]][wi[this.keywordIndex]],t.fill.rgb=e[Mr[this.keywordIndex]][qa[this.keywordIndex]],t.line.color=e[xi[this.keywordIndex]][Er[this.keywordIndex]],t.line.rgb=e[xi[this.keywordIndex]][qa[this.keywordIndex]]},e.prototype.parseChartLayout=function(e,t){t.chartLayoutLeft=e[Ci[this.keywordIndex]],t.chartLayoutTop=e[Pi[this.keywordIndex]]},e.prototype.parseChartLegend=function(e,t){t.chartLegendPostion=e[da[this.keywordIndex]],this.parseChartTitleArea(e[ar[this.keywordIndex]],t.chartTitleArea)},e.prototype.parseChartCategoryAxis=function(e,t){t.categoryAxisType=e[ir[this.keywordIndex]],t.categoryNumberFormat=e[Zo[this.keywordIndex]],e.hasOwnProperty(Ia[this.keywordIndex])&&(t.isAutoInternal=bs.parseBoolValue(e[Ia[this.keywordIndex]])),t.interval=e[Na[this.keywordIndex]],t.axisFontSize=e[Fe[this.keywordIndex]],t.axisFontName=e[_a[this.keywordIndex]],t.max=e[ka[this.keywordIndex]],t.min=e[Aa[this.keywordIndex]],t.majorGridLines=bs.parseBoolValue(e[La[this.keywordIndex]]),t.minorGridLines=bs.parseBoolValue(e[Ua[this.keywordIndex]]),t.majorTick=e[Ba[this.keywordIndex]],t.minorTick=e[Ha[this.keywordIndex]],t.tickPosition=e[Ra[this.keywordIndex]],t.categoryAxisTitle=e[cr[this.keywordIndex]],null!=e[cr[this.keywordIndex]]&&this.parseChartTitleArea(e[ar[this.keywordIndex]],t.chartTitleArea)},e.prototype.parseChartDataTable=function(e,t){t.showSeriesKeys=bs.parseBoolValue(e[Qi[this.keywordIndex]]),t.hasHorzBorder=bs.parseBoolValue(e[$i[this.keywordIndex]]),t.hasVertBorder=bs.parseBoolValue(e[er[this.keywordIndex]]),t.hasBorders=bs.parseBoolValue(e[tr[this.keywordIndex]])},e.prototype.parseChartArea=function(e,t){t.chartForeColor=e[wi[this.keywordIndex]]},e.prototype.parseChartData=function(e,t){for(var i=0;i<e[rr[this.keywordIndex]].length;i++){var r=new Hl,n=e[rr[this.keywordIndex]][i];n.hasOwnProperty(bi[this.keywordIndex])&&(r.xName=n[bi[this.keywordIndex]]);for(var o=0;o<n[Wi[this.keywordIndex]].length;o++){var a=new Rl,s=n[Wi[this.keywordIndex]][o];a.yAxisValue=s[vi[this.keywordIndex]],"Bubble"===e[gr[this.keywordIndex]]&&(a.bubbleSize=s[yn[this.keywordIndex]]),r.chartData.push(a)}t.chartCategory.push(r)}this.parseChartSeries(e,t)},e.prototype.parseChartSeries=function(e,t){for(var i=e[gr[this.keywordIndex]],r="Pie"===i||"Doughnut"===i,n=0;n<e[nr[this.keywordIndex]].length;n++){var o=new El,a=e[nr[this.keywordIndex]][n];if(a.hasOwnProperty(Ri[this.keywordIndex])){if(o.seriesName=a[Ri[this.keywordIndex]],r&&(a.hasOwnProperty(zi[this.keywordIndex])&&(o.firstSliceAngle=a[zi[this.keywordIndex]]),"Doughnut"===i&&(o.doughnutHoleSize=a[_i[this.keywordIndex]])),a.hasOwnProperty(qi[this.keywordIndex])&&this.parseChartDataLabels(a[qi[this.keywordIndex]],o),a.hasOwnProperty(Mi[this.keywordIndex])){var s=new Vl,l=a[Mi[this.keywordIndex]];s.markerStyle=l[Ni[this.keywordIndex]],s.markerColor=l[Ii[this.keywordIndex]],s.numberValue=l[ki[this.keywordIndex]],o.seriesFormat=s}if(a.hasOwnProperty(Ei[this.keywordIndex])){var d=o.errorBar;d.errorType=a[Ei[this.keywordIndex]][Sa[this.keywordIndex]],d.errorDirection=a[Ei[this.keywordIndex]][Ti[this.keywordIndex]],d.errorEndStyle=a[Ei[this.keywordIndex]][Oi[this.keywordIndex]],d.numberValue=a[Ei[this.keywordIndex]][Si[this.keywordIndex]]}a.hasOwnProperty(Vi[this.keywordIndex])&&this.parseChartTrendLines(a[Vi[this.keywordIndex]],o),this.parseChartSeriesDataPoints(a[Di[this.keywordIndex]],o)}t.chartSeries.push(o)}},e.prototype.parseChartDataLabels=function(e,t){var i=new Dl;i.labelPosition=e[da[this.keywordIndex]],i.fontName=e[_a[this.keywordIndex]],i.fontColor=e[Ce[this.keywordIndex]],i.fontSize=e[Fe[this.keywordIndex]],i.isLegendKey=bs.parseBoolValue(e[ji[this.keywordIndex]]),i.isBubbleSize=bs.parseBoolValue(e[Gi[this.keywordIndex]]),i.isCategoryName=bs.parseBoolValue(e[Ki[this.keywordIndex]]),i.isSeriesName=bs.parseBoolValue(e[Yi[this.keywordIndex]]),i.isValue=bs.parseBoolValue(e[Xi[this.keywordIndex]]),i.isPercentage=bs.parseBoolValue(e[Ji[this.keywordIndex]]),i.isLeaderLines=bs.parseBoolValue(e[Zi[this.keywordIndex]]),t.dataLabels=i},e.prototype.parseChartSeriesDataPoints=function(e,t){for(var i=0;i<e.length;i++){var r=new jl;e[i].hasOwnProperty(mo[this.keywordIndex])&&(r.id=e[i][mo[this.keywordIndex]]),this.parseChartDataFormat(e[i],r),t.chartDataFormat.push(r)}},e.prototype.parseChartTrendLines=function(e,t){for(var i=0;i<e.length;i++){var r=e[i],n=new zl;n.trendLineName=r[se[this.keywordIndex]],n.trendLineType=r[Sa[this.keywordIndex]],n.forwardValue=r[Ai[this.keywordIndex]],n.backwardValue=r[Li[this.keywordIndex]],n.interceptValue=r[Ui[this.keywordIndex]],n.isDisplayEquation=bs.parseBoolValue(r[Hi[this.keywordIndex]]),n.isDisplayRSquared=bs.parseBoolValue(r[Bi[this.keywordIndex]]),t.trendLines.push(n)}},e.prototype.parseTableFormat=function(e,i,r){this.parseBorders(r,e[at[r]],i.borders),t.isNullOrUndefined(e[Kt[r]])||(i.allowAutoFit=bs.parseBoolValue(e[Kt[r]])),t.isNullOrUndefined(e[Yt[r]])||(i.cellSpacing=e[Yt[r]]),t.isNullOrUndefined(e[ut[r]])||(i.leftMargin=e[ut[r]]),t.isNullOrUndefined(e[mt[r]])||(i.topMargin=e[mt[r]]),t.isNullOrUndefined(e[ft[r]])||(i.rightMargin=e[ft[r]]),t.isNullOrUndefined(e[yt[r]])||(i.bottomMargin=e[yt[r]]),t.isNullOrUndefined(e[_e[r]])||(i.leftIndent=e[_e[r]]),this.parseShading(e[Xt[r]],i.shading,r),t.isNullOrUndefined(e[Jt[r]])||(i.tableAlignment=this.getTableAlignment(e[Jt[r]])),t.isNullOrUndefined(e[Zt[r]])||(i.preferredWidth=e[Zt[r]]),t.isNullOrUndefined(e[Qt[r]])||(i.preferredWidthType=this.getWidthType(e[Qt[r]])),t.isNullOrUndefined(e[Oe[r]])||(i.bidi=bs.parseBoolValue(e[Oe[r]])),t.isNullOrUndefined(e[ni[r]])||(i.horizontalPositionAbs=this.getHorizontalPositionAbs(e[ni[r]])),t.isNullOrUndefined(e[Bo[r]])||(i.horizontalPosition=e[Bo[r]]),t.isNullOrUndefined(e[Te[r]])||(i.styleName=e[Te[r]]),this.documentHelper.editorProperties.enableCollaborativeEditing&&!t.isNullOrUndefined(e[Kn[r]])&&(i.title=e[Kn[r]]),this.documentHelper.editorProperties.enableCollaborativeEditing&&!t.isNullOrUndefined(e[xo[r]])&&(i.description=e[xo[r]]),!this.isPaste||t.isNullOrUndefined(this.documentHelper.isEditorModule)||t.isNullOrUndefined(e[te[r]])||(this.documentHelper.editorProperties.isLastParaMarkCopied=e[te[r]])},e.prototype.parseCellFormat=function(e,i,r){t.isNullOrUndefined(e)||(this.parseBorders(r,e[at[r]],i.borders),e.isSamePaddingAsTable||this.parseCellMargin(e,i,r),t.isNullOrUndefined(e[At[r]])||(i.cellWidth=e[At[r]]),t.isNullOrUndefined(e[Lt[r]])||(i.columnSpan=e[Lt[r]]),t.isNullOrUndefined(e[Ut[r]])||(i.rowSpan=e[Ut[r]]),this.parseShading(e[Xt[r]],i.shading,r),t.isNullOrUndefined(e[Bt[r]])||(i.verticalAlignment=this.getCellVerticalAlignment(e[Bt[r]])),t.isNullOrUndefined(e[Qt[r]])||(i.preferredWidthType=this.getWidthType(e[Qt[r]])),t.isNullOrUndefined(e[Zt[r]])||(i.preferredWidth=e[Zt[r]]),t.isNullOrUndefined(e[$t[r]])||(i.verticallyMergedCellsKeepWithNext=e[$t[r]]))},e.prototype.parseCellMargin=function(e,i,r){t.isNullOrUndefined(e[ut[r]])||(i.leftMargin=e[ut[r]]),t.isNullOrUndefined(e[ft[r]])||(i.rightMargin=e[ft[r]]),t.isNullOrUndefined(e[mt[r]])||(i.topMargin=e[mt[r]]),t.isNullOrUndefined(e[yt[r]])||(i.bottomMargin=e[yt[r]])},e.prototype.parseRowFormat=function(e,i,r){t.isNullOrUndefined(e)||(t.isNullOrUndefined(e[Ht[r]])||(i.allowBreakAcrossPages=bs.parseBoolValue(e[Ht[this.keywordIndex]])),t.isNullOrUndefined(e[Rt[r]])||(i.isHeader=bs.parseBoolValue(e[Rt[r]])),t.isNullOrUndefined(e[qt[r]])||(i.heightType=this.getHeightType(e[qt[r]])),t.isNullOrUndefined(e[Fr[r]])||(i.height=e[Fr[r]]),t.isNullOrUndefined(e[ut[r]])||(i.leftMargin=e[ut[r]]),t.isNullOrUndefined(e[mt[r]])||(i.topMargin=e[mt[r]]),t.isNullOrUndefined(e[ft[r]])||(i.rightMargin=e[ft[r]]),t.isNullOrUndefined(e[yt[r]])||(i.bottomMargin=e[yt[r]]),t.isNullOrUndefined(e[_e[r]])||(i.leftIndent=e[_e[r]]),t.isNullOrUndefined(e[ei[r]])||(i.verticallyMergedCellsLeftMargin=e[ei[r]]),t.isNullOrUndefined(e[ti[r]])||(i.verticallyMergedCellsRightMargin=e[ti[r]]),t.isNullOrUndefined(e[ii[r]])||(i.verticallyMergedCellsTopMargin=e[ii[r]]),t.isNullOrUndefined(e[ri[r]])||(i.verticallyMergedCellsBottomMargin=e[ri[r]]),!t.isNullOrUndefined(e[Ee[r]])&&e[Ee[r]].length>0&&this.checkAndApplyRevision(r,e,i,i),this.parseRowGridValues(e,i,r),this.parseBorders(r,e[at[r]],i.borders))},e.prototype.parseBorders=function(e,i,r){t.isNullOrUndefined(i)||(r.isParsing=!0,this.parseBorder(e,i[$r[e]],r.left),this.parseBorder(e,i[Qr[e]],r.right),this.parseBorder(e,i[Jr[e]],r.top),this.parseBorder(e,i[Zr[e]],r.bottom),this.parseBorder(e,i[hi[e]],r.vertical),this.parseBorder(e,i[ci[e]],r.horizontal),this.parseBorder(e,i[pi[e]],r.diagonalDown),this.parseBorder(e,i[gi[e]],r.diagonalUp),r.isParsing=!1)},e.prototype.parseBorder=function(e,i,r){t.isNullOrUndefined(i)||(t.isNullOrUndefined(i[Er[e]])||(r.color=this.getColor(i[Er[e]])),t.isNullOrUndefined(i[ui[e]])||(r.lineStyle=this.getLineStyle(i[ui[e]])),t.isNullOrUndefined(i[fi[e]])||(r.lineWidth=i[fi[e]]),t.isNullOrUndefined(i[di[e]])||(r.hasNoneStyle=bs.parseBoolValue(i[di[e]])),t.isNullOrUndefined(i[Wa[e]])||(r.space=i[Wa[e]]),t.isNullOrUndefined(i[li[e]])||(r.shadow=bs.parseBoolValue(i[li[e]])))},e.prototype.parseShading=function(e,i,r){t.isNullOrUndefined(e)||(t.isNullOrUndefined(e[ai[r]])||(i.backgroundColor=this.getColor(e[ai[r]])),t.isNullOrUndefined(e[si[r]])||(i.foregroundColor=this.getColor(e[si[r]])),t.isNullOrUndefined(e[oi[r]])&&t.isNullOrUndefined(e.textureStyle)||(i.textureStyle=t.isNullOrUndefined(e[oi[r]])?this.getTextureStyle(e.textureStyle):this.getTextureStyle(e[oi[r]])))},e.prototype.parseCharacterFormat=function(e,i,r,n){if(!t.isNullOrUndefined(i)){if(n&&i.hasOwnProperty(za[e]))return void this.parseCharacterFormat(e,i.inlineFormat,r);if(t.isNullOrUndefined(i[be[e]])||(r.baselineAlignment=this.getBaseAlignment(i[be[e]])),t.isNullOrUndefined(i[ye[e]])||(r.underline=this.getUnderline(i[ye[e]])),t.isNullOrUndefined(i[ve[e]])||(r.underlineColor=this.getColor(i[ve[e]])),t.isNullOrUndefined(i[We[e]])||(r.fontHintType=this.getFontHintType(i[We[e]])),t.isNullOrUndefined(i[xe[e]])||(r.strikethrough=this.getStrikethrough(i[xe[e]])),!t.isNullOrUndefined(i[Fe[e]])){i[Fe[e]]=parseFloat(i[Fe[e]]);var o=10*i[Fe[e]];o%10!=0&&(o=10*i[Fe[e]].toFixed(1),i[Fe[e]]=o%5==0?i[Fe[e]].toFixed(1):Math.round(i[Fe[e]]));s=parseFloat(i[Fe[e]]);r.fontSize=s<0?0:s}if(!t.isNullOrUndefined(i[Pe[e]])){-1!==i[Pe[e]].indexOf('"')&&(i[Pe[e]]=i[Pe[e]].replace('"',""));var a=i[Pe[e]];t.isNullOrUndefined(this.documentHelper.fontSubstitutionTable)||!this.documentHelper.fontSubstitutionTable.containsKey(a)||this.isFontInstalled(a)||(a=this.documentHelper.fontSubstitutionTable.get(a)),r.fontFamily=a,t.isNullOrUndefined(i[He[e]])&&(r.fontFamilyAscii=a),t.isNullOrUndefined(i[qe[e]])&&(r.fontFamilyNonFarEast=a)}if(t.isNullOrUndefined(i[ue[e]])||(r.bold=bs.parseBoolValue(i[ue[e]])),t.isNullOrUndefined(i[fe[e]])||(r.italic=bs.parseBoolValue(i[fe[e]])),t.isNullOrUndefined(i[we[e]])||(r.highlightColor=this.getHighlightColor(i[we[e]])),t.isNullOrUndefined(i[Ce[e]])||(r.fontColor=this.getColor(i[Ce[e]])),t.isNullOrUndefined(i[Oe[e]])||(r.bidi=bs.parseBoolValue(i[Oe[e]])),t.isNullOrUndefined(i[Se[e]])||(r.bdo=this.getBiDirectionalOverride(i[Se[e]])),!t.isNullOrUndefined(i[Ie[e]])){var s=parseFloat(i[Ie[e]]);r.fontSizeBidi=s<0?0:s}if(!t.isNullOrUndefined(i[ke[e]])){-1!==i[ke[e]].indexOf('"')&&(i[ke[e]]=i[ke[e]].replace('"',""));var l=i[ke[e]];t.isNullOrUndefined(this.documentHelper.fontSubstitutionTable)||!this.documentHelper.fontSubstitutionTable.containsKey(l)||this.isFontInstalled(l)||(l=this.documentHelper.fontSubstitutionTable.get(l)),r.fontFamilyBidi=l}if(t.isNullOrUndefined(i[Ae[e]])||(r.boldBidi=bs.parseBoolValue(i[Ae[e]])),t.isNullOrUndefined(i[Le[e]])||(r.italicBidi=bs.parseBoolValue(i[Le[e]])),!t.isNullOrUndefined(i[Ee[e]])&&i[Ee[e]].length>0&&this.checkAndApplyRevision(e,i,r,r),t.isNullOrUndefined(i[Ue[e]])||(r.allCaps=bs.parseBoolValue(i[Ue[e]])),t.isNullOrUndefined(i[pe[e]])||(r.localeIdBidi=i[pe[e]]),t.isNullOrUndefined(i[ce[e]])||(r.localeIdAscii=i[ce[e]]),t.isNullOrUndefined(i[ge[e]])||(r.localeIdFarEast=i[ge[e]]),t.isNullOrUndefined(i[me[e]])||(r.ligature=this.getLigature(i[me[e]])),t.isNullOrUndefined(i[Be[e]])||(r.complexScript=bs.parseBoolValue(i[Be[e]])),t.isNullOrUndefined(i[ts[e]])||(r.hidden=bs.parseBoolValue(i[ts[e]])),t.isNullOrUndefined(i[is[e]])||(r.specVanish=bs.parseBoolValue(i[is[e]])),t.isNullOrUndefined(i[rs[e]])||(r.kern=i[rs[e]]),t.isNullOrUndefined(i[ns[e]])||(r.isKernFont=bs.parseBoolValue(i[ns[e]])),!t.isNullOrUndefined(i[Re[e]])){-1!==i[Re[e]].indexOf('"')&&(i[Re[e]]=i[Re[e]].replace('"',""));var d=i[Re[e]];t.isNullOrUndefined(this.documentHelper.fontSubstitutionTable)||!this.documentHelper.fontSubstitutionTable.containsKey(d)||this.isFontInstalled(d)||(d=this.documentHelper.fontSubstitutionTable.get(d)),r.fontFamilyFarEast=d}if(!t.isNullOrUndefined(i[He[e]])){-1!==i[He[e]].indexOf('"')&&(i[He[e]]=i[He[e]].replace('"',""));var h=i[He[e]];t.isNullOrUndefined(this.documentHelper.fontSubstitutionTable)||!this.documentHelper.fontSubstitutionTable.containsKey(h)||this.isFontInstalled(h)||(h=this.documentHelper.fontSubstitutionTable.get(h)),r.fontFamilyAscii=h}if(!t.isNullOrUndefined(i[qe[e]])){-1!==i[qe[e]].indexOf('"')&&(i[qe[e]]=i[qe[e]].replace('"',""));var c=i[qe[e]];t.isNullOrUndefined(this.documentHelper.fontSubstitutionTable)||!this.documentHelper.fontSubstitutionTable.containsKey(c)||this.isFontInstalled(c)||(c=this.documentHelper.fontSubstitutionTable.get(c)),r.fontFamilyNonFarEast=c}t.isNullOrUndefined(i[Ve[e]])||(r.characterSpacing=i[Ve[e]]),t.isNullOrUndefined(i[De[e]])||(r.scaling=i[De[e]])}},e.prototype.isFontInstalled=function(e){if(this.fontInfoCollection&&this.fontInfoCollection.containsKey(e))return this.fontInfoCollection.get(e);var t=this.getWidth("monospace"),i=this.getWidth("sans-serif"),r=this.getWidth("serif"),n=t!==this.getWidth(e+", monospace",t)||i!==this.getWidth(e+", sans-serif",i)||r!==this.getWidth(e+", serif",r);return this.fontInfoCollection&&this.fontInfoCollection.add(e,n),n},e.prototype.getWidth=function(e,i){var r,n=document.createElement("span");return n.innerHTML=Array(100).join("wi"),n.style.cssText=["position:absolute","width:auto","font-size:128px","left:-99999px"].join(" !important;"),n.style.fontFamily=e,document.body.appendChild(n),r=n.clientWidth,""!==n.style.fontFamily||t.isNullOrUndefined(i)||(r=i),document.body.removeChild(n),r},e.prototype.getColor=function(e){return e||"#ffffff"},e.prototype.parseThemes=function(e,t){this.parseFontScheme(e[ba[this.keywordIndex]],t)},e.prototype.parseFontScheme=function(e,i){t.isNullOrUndefined(e[xa[this.keywordIndex]])||(i.fontScheme.fontSchemeName=e[xa[this.keywordIndex]]),t.isNullOrUndefined(e[wa[this.keywordIndex]])||this.parseMajorMinorFontScheme(e[wa[this.keywordIndex]],i.fontScheme.majorFontScheme),t.isNullOrUndefined(e[Fa[this.keywordIndex]])||this.parseMajorMinorFontScheme(e[Fa[this.keywordIndex]],i.fontScheme.minorFontScheme)},e.prototype.parseMajorMinorFontScheme=function(e,i){if(!t.isNullOrUndefined(e[Pa[this.keywordIndex]])&&Object.keys(e[Pa[this.keywordIndex]]).length>0){for(var r=0,n=Object.keys(e[Pa[this.keywordIndex]]);r<n.length;r++){var o=n[r];i.fontTypeface.add(o,e[Pa[this.keywordIndex]][o])}this.documentHelper.hasThemes=!0}if(!t.isNullOrUndefined(e[Ca[this.keywordIndex]])&&e[Ca[this.keywordIndex]].length>0){for(var a=0;a<e[Ca[this.keywordIndex]].length;a++){var s=e[Ca[this.keywordIndex]][a],l=new Wd;l.name=t.isNullOrUndefined(s.fontName)?s[se[this.keywordIndex]]:s[_a[this.keywordIndex]],l.typeface=t.isNullOrUndefined(s.fontTypeface)?s[Ta[this.keywordIndex]]:s.fontTypeface,l.panose=t.isNullOrUndefined(s.pnose)?s[Oa[this.keywordIndex]]:s.pnose,i.fontSchemeList.push(l)}this.documentHelper.hasThemes=!0}},e.prototype.parseParagraphFormat=function(e,i,r){t.isNullOrUndefined(i)||(t.isNullOrUndefined(i[at[e]])||this.parseBorders(e,i[at[e]],r.borders),t.isNullOrUndefined(i[Oe[e]])||(r.bidi=bs.parseBoolValue(i[Oe[e]])),t.isNullOrUndefined(i[_e[e]])||(r.leftIndent=i[_e[e]]),t.isNullOrUndefined(i[je[e]])||(r.rightIndent=i[je[e]]),t.isNullOrUndefined(i[Ge[e]])||(r.firstLineIndent=i[Ge[e]]),t.isNullOrUndefined(i[Ye[e]])?!this.isPaste||t.isNullOrUndefined(i[za[e]])||t.isNullOrUndefined(i[za[e]][Ye[e]])||(r.afterSpacing=i[za[e]][Ye[e]]):r.afterSpacing=i[Ye[e]],t.isNullOrUndefined(i[Xe[e]])?!this.isPaste||t.isNullOrUndefined(i[za[e]])||t.isNullOrUndefined(i[za[e]][Xe[e]])||(r.beforeSpacing=i[za[e]][Xe[e]]):r.beforeSpacing=i[Xe[e]],t.isNullOrUndefined(i[Ze[e]])||(r.spaceBeforeAuto=bs.parseBoolValue(i[Ze[e]])),t.isNullOrUndefined(i[Je[e]])||(r.spaceAfterAuto=bs.parseBoolValue(i[Je[e]])),t.isNullOrUndefined(i[Qe[e]])||(r.lineSpacing=i[Qe[e]]),t.isNullOrUndefined(i[$e[e]])?t.isNullOrUndefined(i[Qe[e]])||(r.lineSpacingType="Multiple"):r.lineSpacingType=this.getLineSpacingType(i[$e[e]]),t.isNullOrUndefined(i[Ke[e]])||(r.textAlignment=this.getTextAlignment(i[Ke[e]])),t.isNullOrUndefined(i[nt[e]])||(r.outlineLevel=this.getOutlineLevel(i[nt[e]])),t.isNullOrUndefined(i[ot[e]])||(r.contextualSpacing=bs.parseBoolValue(i[ot[e]])),t.isNullOrUndefined(i[tt[e]])||(r.keepWithNext=bs.parseBoolValue(i[tt[e]])),t.isNullOrUndefined(i[rt[e]])||(r.keepLinesTogether=bs.parseBoolValue(i[rt[e]])),t.isNullOrUndefined(i[it[e]])||(r.widowControl=bs.parseBoolValue(i[it[e]])),r.listFormat=new ks(r),i.hasOwnProperty(et[e])&&this.parseListFormat(e,i,r.listFormat),i.hasOwnProperty(st[e])&&this.parseTabStop(e,i[st[e]],r.tabs))},e.prototype.parseListFormat=function(e,i,r){if(!t.isNullOrUndefined(i[et[e]])){if(!t.isNullOrUndefined(i[et[e]][Me[e]])){var n=i[et[e]][Me[e]],o=this.documentHelper.getListById(n);t.isNullOrUndefined(o)&&-1!==n||(r.listId=n,r.list=o)}t.isNullOrUndefined(i[et[e]].nsid)?t.isNullOrUndefined(r.list)||(r.nsid=r.list.nsid):r.nsid=i[et[e]].nsid,t.isNullOrUndefined(i[et[e]][ze[e]])||(r.listLevelNumber=i[et[e]][ze[e]])}},e.prototype.parseSectionFormat=function(e,i,r,n){if(t.isNullOrUndefined(i[gt[e]])||(r.pageWidth=i[gt[e]]),t.isNullOrUndefined(i[pt[e]])||(r.pageHeight=i[pt[e]]),t.isNullOrUndefined(i[ut[e]])||(r.leftMargin=i[ut[e]]),t.isNullOrUndefined(i[mt[e]])||(r.topMargin=i[mt[e]]),t.isNullOrUndefined(i[ft[e]])||(r.rightMargin=i[ft[e]]),t.isNullOrUndefined(i[yt[e]])||(r.bottomMargin=i[yt[e]]),t.isNullOrUndefined(i[lt[e]])||(r.headerDistance=i[lt[e]]),t.isNullOrUndefined(i[dt[e]])||(r.footerDistance=i[dt[e]]),t.isNullOrUndefined(i[ht[e]])||(r.differentFirstPage=bs.parseBoolValue(i[ht[e]])),t.isNullOrUndefined(i[ct[e]])||(r.differentOddAndEvenPages=bs.parseBoolValue(i[ct[e]])),t.isNullOrUndefined(i[Oe[e]])||(r.bidi=bs.parseBoolValue(i[Oe[e]])),t.isNullOrUndefined(i[vt[e]])||(r.restartPageNumbering=bs.parseBoolValue(i[vt[e]])),t.isNullOrUndefined(i[Wt[e]])||(r.pageStartingNumber=i[Wt[e]]),t.isNullOrUndefined(i[bt[e]])||(r.endnoteNumberFormat=this.getFootEndNoteNumberFormat(i[bt[e]])),t.isNullOrUndefined(i[xt[e]])||(r.footNoteNumberFormat=this.getFootEndNoteNumberFormat(i[xt[e]])),t.isNullOrUndefined(i[wt[e]])||(r.restartIndexForFootnotes=this.getFootnoteRestartIndex(i[wt[e]])),t.isNullOrUndefined(i[Ft[e]])||(r.restartIndexForEndnotes=this.getFootnoteRestartIndex(i[Ft[e]])),t.isNullOrUndefined(i[Ct[e]])||(r.initialFootNoteNumber=i[Ct[e]]),t.isNullOrUndefined(i[Pt[e]])||(r.initialEndNoteNumber=i[Pt[e]]),t.isNullOrUndefined(i[Tt[e]])||(r.pageNumberStyle=i[Tt[e]]),!t.isNullOrUndefined(i[Ot[e]])&&!t.isNullOrUndefined(i[St[e]])&&i[St[e]]>1&&(r.numberOfColumns=i[St[e]],r.equalWidth=bs.parseBoolValue(i[Nt[e]]),r.lineBetweenColumns=bs.parseBoolValue(i[It[e]]),i[Ot[e]]))for(var o=0;o<i[Ot[e]].length;o++){var a=new v;n?(a.width=i[Ot[e]][o][wr[e]],a.space=i[Ot[e]][o][Wa[e]]):(a.width=bs.convertPointToPixel(i[Ot[e]][o][wr[e]]),a.space=bs.convertPointToPixel(i[Ot[e]][o][Wa[e]])),a.index=o,r.columns.push(a)}t.isNullOrUndefined(i[kt[e]])||(r.breakCode=i[kt[e]])},e.prototype.parseColumns=function(e,t){if(t=[],e)for(var i=0;i<e.length;i++){var r=new v;r.width=bs.convertPointToPixel(e[i][wr[this.keywordIndex]]),r.space=bs.convertPointToPixel(e[i][Wa[this.keywordIndex]]),r.index=i,t.push(r)}},e.prototype.parseTabStop=function(e,t,i){if(t)for(var r=0;r<t.length;r++){var n=!1,o=t[r];if(Object.keys(o).length>0){var a=new As;a.position=o[da[e]],a.tabLeader=this.getTabLeader(o[ga[e]]),a.deletePosition=o[ha[e]],a.tabJustification=this.getTabJustification(o[la[e]]);for(var s=0;s<i.length;s++){var l=i[s];if(l.position===a.position&&l.tabLeader===a.tabLeader&&l.deletePosition===a.deletePosition&&l.tabJustification===a.tabJustification){n=!0;break}}n||i.push(a)}}},e.prototype.validateImageUrl=function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;return e.charAt(e.length-1)===t.charAt(64)&&i--,e.charAt(e.length-2)===t.charAt(64)&&i--,i%1==0},e.prototype.containsFieldBegin=function(e){for(var t=void 0,i=e.children.length-1;i>=0;i--){if((t=e.children[i])instanceof ol&&t.hasFieldEnd&&t.nextElement instanceof hl)return t.nextElement;if(t instanceof ol)return}return t},e.prototype.getBaseAlignment=function(e){switch(e){case 0:return"Normal";case 1:return"Superscript";case 2:return"Subscript";default:return e}},e.prototype.getUnderline=function(e){switch(e){case 0:return"None";case 1:return"Single";case 2:return"Words";case 3:return"Double";case 4:return"Dotted";case 5:return"Thick";case 6:return"Dash";case 7:return"DashLong";case 8:return"DotDash";case 9:return"DotDotDash";case 10:return"Wavy";case 11:return"DottedHeavy";case 12:return"DashHeavy";case 13:return"DashLongHeavy";case 14:return"DotDashHeavy";case 15:return"DotDotDashHeavy";case 16:return"WavyHeavy";case 17:return"WavyDouble";default:return e}},e.prototype.getFontHintType=function(e){switch(e){case 0:return"Default";case 1:return"EastAsia";case 2:return"CS";default:return e}},e.prototype.getStrikethrough=function(e){switch(e){case 0:return"None";case 1:return"SingleStrike";case 2:return"DoubleStrike";default:return e}},e.prototype.getHighlightColor=function(e){switch(e){case 0:return"NoColor";case 1:return"Yellow";case 2:return"BrightGreen";case 3:return"Turquoise";case 4:return"Pink";case 5:return"Blue";case 6:return"Red";case 7:return"DarkBlue";case 8:return"Teal";case 9:return"Green";case 10:return"Violet";case 11:return"DarkRed";case 12:return"DarkYellow";case 13:return"Gray50";case 14:return"Gray25";case 15:return"Black";default:return e}},e.prototype.getLineSpacingType=function(e){switch(e){case 0:return"Multiple";case 1:return"AtLeast";case 2:return"Exactly";default:return e}},e.prototype.getOutlineLevel=function(e){switch(e){case 0:return"BodyText";case 1:return"Level1";case 2:return"Level2";case 3:return"Level3";case 4:return"Level4";case 5:return"Level5";case 6:return"Level6";case 7:return"Level7";case 8:return"Level8";case 9:return"Level9";default:return e}},e.prototype.getTextAlignment=function(e){switch(e){case 0:return"Left";case 1:return"Center";case 2:return"Right";case 3:return"Justify";default:return e}},e.prototype.getWidthType=function(e){switch(e){case 0:return"Auto";case 1:return"Percent";case 2:return"Point";default:return e}},e.prototype.getTableAlignment=function(e){switch(e){case 0:return"Left";case 1:return"Center";case 2:return"Right";default:return e}},e.prototype.getLineStyle=function(e){switch(e){case 0:return"Single";case 1:return"None";case 2:return"Dot";case 3:return"DashSmallGap";case 4:return"DashLargeGap";case 5:return"DashDot";case 6:return"DashDotDot";case 7:return"Double";case 8:return"Triple";case 9:return"ThinThickSmallGap";case 10:return"ThickThinSmallGap";case 11:return"ThinThickThinSmallGap";case 12:return"ThinThickMediumGap";case 13:return"ThickThinMediumGap";case 14:return"ThinThickThinMediumGap";case 15:return"ThinThickLargeGap";case 16:return"ThickThinLargeGap";case 17:return"ThinThickThinLargeGap";case 18:return"SingleWavy";case 19:return"DoubleWavy";case 20:return"DashDotStroked";case 21:return"Emboss3D";case 22:return"Engrave3D";case 23:return"Outset";case 24:return"Inset";case 25:return"Thick";case 26:return"Cleared";default:return e}},e.prototype.getTextureStyle=function(e){switch(e){case 0:return"TextureNone";case 1:return"Texture2Pt5Percent";case 2:return"Texture5Percent";case 3:return"Texture7Pt5Percent";case 4:return"Texture10Percent";case 5:return"Texture12Pt5Percent";case 6:return"Texture15Percent";case 7:return"Texture17Pt5Percent";case 8:return"Texture20Percent";case 9:return"Texture22Pt5Percent";case 10:return"Texture25Percent";case 11:return"Texture27Pt5Percent";case 12:return"Texture30Percent";case 13:return"Texture32Pt5Percent";case 14:return"Texture35Percent";case 15:return"Texture37Pt5Percent";case 16:return"Texture40Percent";case 17:return"Texture42Pt5Percent";case 18:return"Texture45Percent";case 19:return"Texture47Pt5Percent";case 20:return"Texture50Percent";case 21:return"Texture52Pt5Percent";case 22:return"Texture55Percent";case 23:return"Texture57Pt5Percent";case 24:return"Texture60Percent";case 25:return"Texture62Pt5Percent";case 26:return"Texture65Percent";case 27:return"Texture67Pt5Percent";case 28:return"Texture70Percent";case 29:return"Texture72Pt5Percent";case 30:return"Texture75Percent";case 31:return"Texture77Pt5Percent";case 32:return"Texture80Percent";case 33:return"Texture82Pt5Percent";case 34:return"Texture85Percent";case 35:return"Texture87Pt5Percent";case 36:return"Texture90Percent";case 37:return"Texture92Pt5Percent";case 38:return"Texture95Percent";case 39:return"Texture97Pt5Percent";case 40:return"TextureSolid";case 41:return"TextureDarkHorizontal";case 42:return"TextureDarkVertical";case 43:return"TextureDarkDiagonalDown";case 44:return"TextureDarkDiagonalUp";case 45:return"TextureDarkCross";case 46:return"TextureDarkDiagonalCross";case 47:return"TextureHorizontal";case 48:return"TextureVertical";case 49:return"TextureDiagonalDown";case 50:return"TextureDiagonalUp";case 51:return"TextureCross";case 52:return"TextureDiagonalCross";default:return e}},e.prototype.getLigature=function(e){switch(e){case 0:return"None";case 1:return"Standard";case 2:return"Contextual";case 3:return"StandardContextual";case 4:return"Historical";case 5:return"StandardHistorical";case 6:return"ContextualHistorical";case 7:return"StandardContextualHistorical";case 8:return"Discretional";case 9:return"StandardDiscretional";case 10:return"ContextualDiscretional";case 11:return"StandardContextualDiscretional";case 12:return"HistoricalDiscretional";case 13:return"StandardHistoricalDiscretional";case 14:return"ContextualHistoricalDiscretional";case 15:return"All";default:return e}},e.prototype.getHeightType=function(e){switch(e){case 0:return"AtLeast";case 1:return"Exactly";default:return e}},e.prototype.getCellVerticalAlignment=function(e){switch(e){case 0:return"Top";case 1:return"Center";case 2:return"Bottom";default:return e}},e.prototype.getListLevelPattern=function(e){switch(e){case 0:return"None";case 1:case 13:case"KanjiDigit":return"Arabic";case 2:return"UpRoman";case 3:return"LowRoman";case 4:return"UpLetter";case 5:return"LowLetter";case 6:return"Ordinal";case 7:return"Number";case 8:return"OrdinalText";case 9:return"LeadingZero";case 10:return"Bullet";case 11:return"FarEast";case 12:return"Special";case 14:return"Hebrew1";case 15:return"Hebrew2";case 16:return"Arabic1";case 17:return"Arabic2";default:return e}},e.prototype.getListNumberAlignment=function(e){switch(e){case 1:return"Center";case 2:return"Right";case"Center":case"Right":return e;default:return"Left"}},e.prototype.getFollowCharacterType=function(e){switch(e){case 0:return"Tab";case 1:return"Space";case 2:return"None";default:return e}},e.prototype.getStyleType=function(e){switch(e){case 0:return"Paragraph";case 1:return"Character";case 2:return"Table";default:return e}},e.prototype.getProtectionType=function(e){switch(e){case 0:return"NoProtection";case 1:return"ReadOnly";case 2:return"FormFieldsOnly";case 3:return"CommentsOnly";case 4:return"RevisionsOnly";default:return e}},e.prototype.getRevisionType=function(e){switch(e){case 1:return"Insertion";case 2:return"Deletion";case 3:return"MoveTo";case 4:return"MoveFrom";default:return e}},e.prototype.getFootnoteType=function(e){switch(e){case 0:return"Footnote";case 1:return"Endnote";default:return e}},e.prototype.getFootnoteRestartIndex=function(e){switch(e){case 0:return"DoNotRestart";case 1:return"RestartForEachSection";case 2:return"RestartForEachPage";default:return e}},e.prototype.getFootEndNoteNumberFormat=function(e){switch(e){case 0:return"Arabic";case 1:return"UpperCaseRoman";case 2:return"LowerCaseRoman";case 3:return"UpperCaseLetter";case 4:return"LowerCaseLetter";default:return e}},e.prototype.getBiDirectionalOverride=function(e){switch(e){case 0:return"None";case 1:return"LTR";case 2:return"RTL";default:return e}},e.prototype.getBreakClearType=function(e){switch(e){case 0:return"None";case 1:return"Left";case 2:return"Right";case 3:return"All";default:return e}},e.prototype.getTextVerticalAlignment=function(e){switch(e){case 0:return"Top";case 1:return"Center";case 2:return"Bottom";default:return e}},e.prototype.getShapeVerticalAlignment=function(e){switch(e){case 0:return"None";case 1:return"Top";case 2:return"Center";case 3:return"Bottom";case 4:return"Inline";case 5:return"Inside";case 6:return"Outside";default:return e}},e.prototype.getShapeHorizontalAlignment=function(e){switch(e){case 0:return"None";case 1:return"Center";case 2:return"Inside";case 3:return"Left";case 4:return"Outside";case 5:return"Right";default:return e}},e.prototype.getVerticalOrigin=function(e){switch(e){case 0:return"Paragraph";case 1:return"BottomMargin";case 2:return"InsideMargin";case 3:return"Line";case 4:return"Margin";case 5:return"OutsideMargin";case 6:return"Page";case 7:return"TopMargin";default:return e}},e.prototype.getHorizontalOrigin=function(e){switch(e){case 0:return"Column";case 1:return"Character";case 2:return"InsideMargin";case 3:return"LeftMargin";case 4:return"Margin";case 5:return"OutsideMargin";case 6:return"Page";case 7:return"RightMargin";default:return e}},e.prototype.getTableVerticalRelation=function(e){switch(e){case 0:return"Paragraph";case 1:return"Margin";case 2:return"Page";default:return e}},e.prototype.getTableHorizontalRelation=function(e){switch(e){case 0:return"Column";case 1:return"Margin";case 2:return"Page";default:return e}},e.prototype.getTableVerticalPosition=function(e){switch(e){case 0:return"None";case 1:return"Top";case 2:return"Center";case 3:return"Bottom";case 4:return"Inside";case 5:return"Outside";default:return e}},e.prototype.getTableHorizontalPosition=function(e){switch(e){case 0:return"Left";case 1:return"Center";case 2:return"Inside";case 3:return"Outside";case 4:return"Right";default:return e}},e.prototype.getLineDashStyle=function(e){switch(e){case 0:return"Solid";case 1:return"Dash";case 2:return"DashDot";case 3:return"DashDotDot";case 4:return"DashDotGEL";case 5:return"DashGEL";case 6:return"Dot";case 7:return"DotGEL";case 8:return"LongDashDotDotGEL";case 9:return"LongDashDotGEL";case 10:return"LongDashGEL";default:return e}},e.prototype.getFillType=function(e){switch(e){case 0:return"FillSolid";case 1:return"FillPatterned";case 2:return"FillGradient";case 3:return"FillTextured";case 4:return"FillBackground";case 5:return"FillPicture";case 6:return"None";case 7:return"FillMixed";default:return e}},e.prototype.getHorizontalPositionAbs=function(e){switch(e){case 0:return"Left";case 1:return"Center";case 2:return"Right";case 3:return"Inside";case 4:return"Outside";default:return e}},e.prototype.getTabJustification=function(e){switch(e){case 0:return"Left";case 1:return"Bar";case 2:return"Center";case 3:return"Decimal";case 4:return"List";case 5:return"Right";default:return e}},e.prototype.getTabLeader=function(e){switch(e){case 0:return"None";case 1:return"Single";case 2:return"Dot";case 3:return"Hyphen";case 4:return"Underscore";default:return e}},e.prototype.getTextFormFieldType=function(e){switch(e){case 0:return"Text";case 1:return"Number";case 2:return"Date";case 3:return"Calculation";default:return e}},e.prototype.getTextFormFieldFormat=function(e){switch(e){case 0:return"None";case 1:return"FirstCapital";case 2:return"Lowercase";case 3:return"Uppercase";case 4:return"Titlecase";default:return e}},e.prototype.getCheckBoxSizeType=function(e){switch(e){case 0:return"Auto";case 1:return"Exactly";default:return e}},e.prototype.getContentControlAppearance=function(e){switch(e){case 1:return"BoundingBox";case 2:return"Hidden";case 3:return"Tags";default:return e}},e.prototype.getContentControlType=function(e){switch(e){case 0:return"RichText";case 1:return"BuildingBlockGallery";case 2:return"CheckBox";case 3:return"ComboBox";case 4:return"Date";case 5:return"DropDownList";case 6:return"Group";case 7:return"Picture";case 8:return"RepeatingSection";case 9:return"Text";default:return e}},e.prototype.getDateCalendarType=function(e){switch(e){case 0:return"Gregorian";case 1:return"GregorianArabic";case 2:return"GregorianEnglish";case 3:return"GregorianMiddleEastFrench";case 4:return"GregorianTransliteratedEnglish";case 5:return"GregorianTransliteratedFrench";case 6:return"Hebrew";case 7:return"Hijri";case 8:return"Japan";case 9:return"Korean";case 10:return"Saka";case 11:return"Taiwan";case 12:return"Thai";default:return e}},e.prototype.getDateStorageFormat=function(e){switch(e){case 1:return"DateStorageDate";case 2:return"DateStorageDateTime";case 3:return"DateStorageText";default:return e}},e.prototype.getTextWrappingStyle=function(e){switch(e){case 0:return"Inline";case 1:return"InFrontOfText";case 2:return"Square";case 3:return"TopAndBottom";case 4:return"Behind";default:return e}},e.prototype.getTextWrappingType=function(e){switch(e){case 0:return"Both";case 1:return"Left";case 2:return"Right";case 3:return"Largest";default:return e}},e.prototype.getCompatibilityMode=function(e){switch(e){case 0:return"Word2013";case 1:return"Word2003";case 2:return"Word2007";case 3:return"Word2010";default:return e}},e.prototype.getLineFormatType=function(e){switch(e){case 0:return"Solid";case 1:return"Patterned";case 2:return"Gradient";case 3:return"None";default:return e}},e.prototype.getAutoShapeType=function(e){switch(e){case 1:return"Rectangle";case 2:return"RoundedRectangle";case 3:return"StraightConnector";case 4:return"Oval";case 5:return"IsoscelesTriangle";case 6:return"RightTriangle";case 7:return"Parallelogram";case 8:return"Trapezoid";case 9:return"Diamond";case 10:return"RegularPentagon";case 11:return"Hexagon";case 12:return"Heptagon";case 13:return"Octagon";case 14:return"Decagon";case 15:return"Dodecagon";case 16:return"Chord";case 17:return"Teardrop";case 18:return"Frame";case 19:return"HalfFrame";case 20:return"L_Shape";case 21:return"Pie";case 22:return"DiagonalStripe";case 23:return"Cross";case 24:return"Plaque";case 25:return"Can";case 26:return"Cube";case 27:return"Bevel";case 28:return"Donut";case 29:return"NoSymbol";case 30:return"BlockArc";case 31:return"FoldedCorner";case 32:return"SmileyFace";case 33:return"Heart";case 34:return"LightningBolt";case 35:return"Sun";case 36:return"Moon";case 37:return"Cloud";case 38:return"Arc";case 39:return"DoubleBracket";case 40:return"DoubleBrace";case 41:return"LeftBracket";case 42:return"RightBracket";case 43:return"LeftBrace";case 44:return"RightBrace";case 45:return"FlowChartProcess";case 46:return"FlowChartAlternateProcess";case 47:return"FlowChartDecision";case 48:return"FlowChartData";case 49:return"FlowChartPredefinedProcess";case 50:return"FlowChartInternalStorage";case 51:return"FlowChartDocument";case 52:return"FlowChartMultiDocument";case 53:return"FlowChartTerminator";case 54:return"FlowChartPreparation";case 55:return"FlowChartManualInput";case 56:return"FlowChartManualOperation";case 57:return"FlowChartConnector";case 58:return"FlowChartOffPageConnector";case 59:return"FlowChartCard";case 60:return"FlowChartPunchedTape";case 61:return"FlowChartSummingJunction";case 62:return"FlowChartOr";case 63:return"FlowChartCollate";case 64:return"FlowChartSort";case 65:return"FlowChartExtract";case 66:return"FlowChartMerge";case 67:return"FlowChartStoredData";case 68:return"FlowChartDelay";case 69:return"FlowChartSequentialAccessStorage";case 70:return"FlowChartMagneticDisk";case 71:return"FlowChartDirectAccessStorage";case 72:return"FlowChartDisplay";case 73:return"RightArrow";case 74:return"LeftArrow";case 75:return"UpArrow";case 76:return"DownArrow";case 77:return"LeftRightArrow";case 78:return"UpDownArrow";case 79:return"QuadArrow";case 80:return"LeftRightUpArrow";case 81:return"BentArrow";case 82:return"UTurnArrow";case 83:return"LeftUpArrow";case 84:return"BentUpArrow";case 85:return"CurvedRightArrow";case 86:return"CurvedLeftArrow";case 87:return"CurvedUpArrow";case 88:return"CurvedDownArrow";case 89:return"StripedRightArrow";case 90:return"NotchedRightArrow";case 91:return"Pentagon";case 92:return"Chevron";case 93:return"RightArrowCallout";case 94:return"DownArrowCallout";case 95:return"LeftArrowCallout";case 96:return"UpArrowCallout";case 97:return"LeftRightArrowCallout";case 98:return"QuadArrowCallout";case 99:return"CircularArrow";case 100:return"MathPlus";case 101:return"MathMinus";case 102:return"MathMultiply";case 103:return"MathDivision";case 104:return"MathEqual";case 105:return"MathNotEqual";case 106:return"Explosion1";case 107:return"Explosion2";case 108:return"Star4Point";case 109:return"Star5Point";case 110:return"Star6Point";case 111:return"Star7Point";case 112:return"Star8Point";case 113:return"Star10Point";case 114:return"Star12Point";case 115:return"Star16Point";case 116:return"Star24Point";case 117:return"Star32Point";case 118:return"UpRibbon";case 119:return"DownRibbon";case 120:return"CurvedUpRibbon";case 121:return"CurvedDownRibbon";case 122:return"VerticalScroll";case 123:return"HorizontalScroll";case 124:return"Wave";case 125:return"DoubleWave";case 126:return"SnipSingleCornerRectangle";case 127:return"SnipSameSideCornerRectangle";case 128:return"SnipDiagonalCornerRectangle";case 129:return"SnipAndRoundSingleCornerRectangle";case 130:return"RoundSingleCornerRectangle";case 131:return"RoundSameSideCornerRectangle";case 132:return"RoundDiagonalCornerRectangle";case 133:return"Unknown";case 134:return"ElbowConnector";case 135:return"CurvedConnector";case 136:return"RectangularCallout";case 137:return"CloudCallout";case 138:return"LineCallout1NoBorder";default:return e}},e.prototype.destroy=function(){this.footnotes&&this.footnotes.destroy(),this.footnotes=void 0,this.endnotes&&this.endnotes.destroy(),this.endnotes=void 0,this.editableRanges&&this.editableRanges.destroy(),this.editableRanges=void 0,this.commentEnds&&this.commentEnds.destroy(),this.commentEnds=void 0,this.commentStarts&&this.commentStarts.destroy(),this.commentStarts=void 0,this.commentsCollection&&this.commentsCollection.destroy(),this.commentsCollection=void 0,this.revisionCollection&&this.revisionCollection.destroy(),this.revisionCollection=void 0,this.fontInfoCollection&&this.fontInfoCollection.destroy(),this.revisionMap&&this.revisionMap.destroy(),this.revisionHelper=void 0,this.revisionMap=void 0,this.stylesCollection=void 0,this.fontInfoCollection=void 0,this.documentHelper=void 0,this.keywordIndex=void 0},e}(),wd=function(){function e(){this.style={},this.context=new Fd}return e.prototype.getContext=function(e,t){return this.context},e.prototype.toDataURL=function(e,t){return this.context.renderedPath},e}(),Fd=function(){function e(){this.renderedPath=""}return Object.defineProperty(e.prototype,"globalAlpha",{set:function(e){this.renderedPath+="GA:"+e+";"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"globalCompositeOperation",{set:function(e){this.renderedPath+="GCP:"+e+";"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fillStyle",{set:function(e){this.renderedPath+="FS:"+e+";"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"strokeStyle",{set:function(e){this.renderedPath+="SS:"+e+";"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"direction",{set:function(e){this.renderedPath+="Dir:"+e+";"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"font",{set:function(e){this.renderedPath+="Fn:"+e+";"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textAlign",{set:function(e){this.renderedPath+="TA:"+e+";"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textBaseline",{set:function(e){this.renderedPath+="TBL:"+e+";"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineWidth",{set:function(e){this.renderedPath+="LW:"+e+";"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineCap",{set:function(e){this.renderedPath+="LC:"+e+";"},enumerable:!0,configurable:!0}),e.prototype.drawImage=function(e,t,i,r,n,o,a,s,l){this.renderedPath+="LC:"+e.src+";",this.renderedPath+="sx:"+t+";",this.renderedPath+="sy:"+i+";",this.renderedPath+="sw:"+r+";",this.renderedPath+="sh:"+n+";",o&&(this.renderedPath+="dx:"+o+";"),a&&(this.renderedPath+="dy:"+a+";"),s&&(this.renderedPath+="dw:"+s+";"),l&&(this.renderedPath+="dh:"+l+";")},e.prototype.beginPath=function(){this.renderedPath+="BP;"},e.prototype.clip=function(e){this.renderedPath+="Cl;"},e.prototype.fill=function(e){this.renderedPath+="Fl;"},e.prototype.stroke=function(){this.renderedPath+="Stk;"},e.prototype.closePath=function(){this.renderedPath+="CP;"},e.prototype.lineTo=function(e,t){this.renderedPath+="LT:x:"+e+";y:"+t+";"},e.prototype.moveTo=function(e,t){this.renderedPath+="MT:x:"+e+";y:"+t+";"},e.prototype.rect=function(e,t,i,r){this.renderedPath+="Rt:x:"+e+";y:"+t+";w:"+i+";h:"+r+";"},e.prototype.setLineDash=function(e){this.renderedPath+="Sgm:"+e.toString()+";"},e.prototype.clearRect=function(e,t,i,r){this.renderedPath+="CR:x:"+e+";y:"+t+";w:"+i+";h:"+r+";"},e.prototype.fillRect=function(e,t,i,r){this.renderedPath+="FR:x:"+e+";y:"+t+";w:"+i+";h:"+r+";"},e.prototype.strokeRect=function(e,t,i,r){this.renderedPath+="SR:x:"+e+";y:"+t+";w:"+i+";h:"+r+";"},e.prototype.restore=function(){this.renderedPath+="RES;"},e.prototype.save=function(){this.renderedPath+="S;"},e.prototype.fillText=function(e,t,i,r){this.renderedPath+="FT:"+e+";x:"+t+";y:"+i+";",r&&(this.renderedPath+="MW:"+r+";")},e.prototype.measureText=function(e){return{width:30}},e.prototype.strokeText=function(e,t,i,r){this.renderedPath+="ST:"+e+";x:"+t+";y:"+i+";",r&&(this.renderedPath+="MW:"+r+";")},e.prototype.scale=function(e,t){this.renderedPath+="SC:x:"+e+";y:"+t+";"},e}(),Cd=function(){return(Cd=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)},Pd=function(){function i(e){this.commentMarkDictionary=new p,this.isPrinting=!1,this.skipRenderWavyLine=!1,this.isExporting=!1,this.pageLeft=0,this.pageTop=0,this.pageIndex=-1,this.isFieldCode=!1,this.isRenderHeader=!1,this.height=0,this.fieldStacks=[],this.isRenderingCellBorders=!1,this.shapes={Rectangle:"M0,0 L50,0 L50,50 L0,50 z",Oval:"M80.5,12.5 C80.5,19.127417 62.59139,24.5 40.5,24.5 C18.40861,24.5 0.5,19.127417 0.5,12.5C0.5,5.872583 18.40861,0.5 40.5,0.5 C62.59139,0.5 80.5,5.872583 80.5,12.5 z",IsoscelesTriangle:"M45,0 L90,45 L0,45 L45,0 z",RightTriangle:"M836.293,292.9238 L776.293,292.9238 L776.293,254.8408 L836.293,292.9238 z",Parallelogram:"M30,0 L60,0 L45,30 L15,30 z",Trapezoid:"M 1873 358 l -506 1332 h -686 l -506 -1332 z",Diamond:"M397.784,287.875 L369.5,316.159 L341.216,287.875 L369.5,259.591 L397.784,287.875 z",RegularPentagon:"M30,0 L60,30 L50,70 L10,70 L0,30 L30,0 z",Hexagon:"M30,0 L60,0 L90,30 L60,60 L30,60 L0,30 L30,0 z",Heptagon:"M223.7783,195.7134 L207.1303,174.8364 L213.0713,148.8034 L237.1303,137.2174 L261.1883,148.8034 L267.1303,174.8364L250.4813,195.7134 L223.7783,195.7134 z",Octagon:"M98.7319,196.4653 L81.1579,178.8923 L81.1579,154.0393 L98.7319,136.4653 L123.5849,136.4653L141.1579,154.0393 L141.1579,178.8923 L123.5849,196.4653 L98.7319,196.4653 z",Decagon:"M657.3379,302.4141 L642.3369,291.5161 L636.6089,273.8821 L642.3369,256.2481 L657.3379,245.3511 L675.8789,245.3511L690.8789,256.2481 L696.6089,273.8821L690.8789,291.5161 L675.8789,302.4141 L657.3379,302.4141 z",Dodecagon:"M-69.20000457763672,-17.685555555555553L-50.656966313962585,-48.31444444444445L-18.543038263674127,-66L18.543038263674134,-66L50.656966313962585,-48.31444444444445L69.20000457763672,-17.685555555555553L69.20000457763672,17.685555555555553L50.656966313962585,48.31444444444445L18.543038263674134,66L-18.543038263674127,66L-50.656966313962585,48.31444444444445L-69.20000457763672,17.685555555555553Z",Pie:"M 1024 1894 q -120 0 -231 -31 q -111 -31 -208 -88 q -97 -57 -176 -136 q -79 -79 -136 -176 q -57 -97 -88 -208 q -31 -111 -31 -231 q 0 -109 26 -212 q 26 -102 75 -194 q 48 -92 117 -170 q 68 -78 153 -138 q 84 -59 183 -98 q 99 -39 207 -52 l 58 -7 v 922 h 922 l -7 58 q -13 109 -52 207 q -39 99 -98 183 q -60 85 -138 153 q -78 69 -170 117 q -92 49 -194 75 q -103 26 -212 26 z",Chord:"M 1024 1894 q -120 0 -231 -31 q -111 -31 -208 -88 q -97 -57 -176 -136 q -79 -79 -136 -176 q -57 -97 -88 -208 q -31 -111 -31 -231 q 0 -116 29 -224 q 29 -108 82 -203 q 53 -94 128 -173 q 75 -79 167 -137 q 92 -57 198 -92 q 106 -34 222 -40 l 23 -1 l 891 891 l -1 23 q -6 116 -40 222 q -35 106 -92 198 q -58 92 -137 167 q -79 75 -173 128 q -95 53 -203 82 q -108 29 -224 29 z",Teardrop:"M 1024 1894 q -120 0 -231 -31 q -111 -31 -208 -88 q -97 -57 -176 -136 q -79 -79 -136 -176 q -57 -97 -88 -208 q -31 -111 -31 -231 q 0 -120 31 -231 q 31 -111 88 -208 q 57 -97 136 -176 q 79 -79 176 -136 q 97 -57 208 -88 q 111 -31 231 -31 h 870 v 870 q 0 120 -31 231 q -31 111 -88 208 q -57 97 -136 176 q -79 79 -176 136 q -97 57 -208 88 q -111 31 -231 31 z",Frame:"M 1894 154 v 1740 h -1740 v -1740 m 1433 307 h -1126 v 1126 h 1126 z",HalfFrame:"M 154 154 h 1668 l -307 307 h -1054 v 1054 l -307 307 z",L_Shape:"M 870 154 v 1024 h 1024 v 716 h -1740 v -1740 z",DiagonalStripe:"M 154 943 l 789 -789 h 879 l -1668 1668 z",Cross:"M 666 1894 v -512 h -512 v -716 h 512 v -512 h 716 v 512 h 512 v 716 h -512 v 512 z",Plaque:"M 563 1894 v -51 q 0 -66 -31 -131 q -31 -64 -81 -115 q -51 -50 -115 -81 q -65 -31 -131 -31 h -51 v -922 h 51 q 66 0 131 -31 q 64 -31 115 -82 q 50 -50 81 -115 q 31 -64 31 -130 v -51 h 922 v 51 q 0 66 31 130 q 31 65 82 115 q 50 51 115 82 q 64 31 130 31 h 51 v 922 h -51 q -66 0 -130 31 q -65 31 -115 81 q -51 51 -82 115 q -31 65 -31 131 v 51 z",Cube:"M 1946 102 v 1280 l -564 564 h -1280 v -1280 l 564 -564 m 665 615 h -1126 v 1126 h 1126 m 51 -1229 l 410 -409 h -1075 l -410 409 m 1536 -307 l -409 410 v 1024 l 409 -410 z",Bevel:"M 1946 102 v 1844 h -1844 v -1844 m 175 103 l 205 205 h 1084 l 205 -205 m -235 1331 v -1024 h -1024 v 1024 m -307 235 l 205 -205 v -1084 l -205 -205 m 1566 1566 l -205 -205 h -1084 l -205 205 m 1566 -1566 l -205 205 v 1084 l 205 205 z",Donut:"M 1024 154 q 120 0 231 31 q 111 31 208 88 q 97 57 176 136 q 79 79 136 176 q 57 97 88 208 q 31 111 31 231 q 0 120 -31 231 q -31 111 -88 208 q -57 97 -136 176 q -79 79 -176 136 q -97 57 -208 88 q -111 31 -231 31 q -120 0 -231 -31 q -111 -31 -208 -88 q -97 -57 -176 -136 q -79 -79 -136 -176 q -57 -97 -88 -208 q -31 -111 -31 -231 q 0 -120 31 -231 q 31 -111 88 -208 q 57 -97 136 -176 q 79 -79 176 -136 q 97 -57 208 -88 q 111 -31 231 -31 m 0 1331 q 95 0 179 -37 q 84 -36 147 -99 q 62 -62 99 -146 q 36 -84 36 -179 q 0 -95 -36 -179 q -37 -84 -99 -147 q -63 -62 -147 -99 q -84 -36 -179 -36 q -95 0 -179 36 q -84 37 -146 99 q -63 63 -99 147 q -37 84 -37 179 q 0 95 37 179 q 36 84 99 146 q 62 63 146 99 q 84 37 179 37 z",NoSymbol:"M 1024 154 q 124 0 237 30 q 112 30 209 85 q 96 56 175 134 q 78 79 134 175 q 55 97 85 209 q 30 113 30 237 q 0 124 -30 236 q -30 113 -85 209 q -56 97 -134 175 q -79 79 -175 134 q -97 56 -209 86 q -113 30 -237 30 q -124 0 -236 -30 q -113 -30 -209 -86 q -97 -55 -175 -134 q -79 -78 -134 -175 q -56 -96 -86 -209 q -30 -112 -30 -236 q 0 -124 30 -237 q 30 -112 86 -209 q 55 -96 134 -175 q 78 -78 175 -134 q 96 -55 209 -85 q 112 -30 236 -30 m 273 1369 l -772 -772 l -28 74 q -36 96 -36 199 q 0 116 45 218 q 44 103 121 179 q 76 77 179 121 q 102 45 218 45 q 103 0 199 -36 m 328 -328 q 36 -96 36 -199 q 0 -116 -44 -219 q -45 -102 -121 -179 q -77 -76 -179 -121 q -103 -44 -219 -44 q -103 0 -199 36 l -74 28 l 772 772 z",BlockArc:"M 1485 1485 v -51 q 0 -96 -36 -180 q -37 -84 -99 -147 q -63 -62 -147 -98 q -84 -36 -179 -36 q -95 0 -179 36 q -84 36 -146 98 q -63 63 -99 147 q -37 84 -37 180 v 51 h -409 v -51 q 0 -120 31 -231 q 31 -111 88 -208 q 57 -97 136 -177 q 79 -79 176 -136 q 97 -57 208 -88 q 111 -31 231 -31 q 120 0 231 31 q 111 31 208 88 q 97 57 176 136 q 79 80 136 177 q 57 97 88 208 q 31 111 31 231 v 51 z",FoldedCorner:"M 1946 102 v 1229 l -615 615 h -1229 v -1844 m 1229 1699 l 470 -470 h -470 m 512 -1126 h -1638 v 1638 h 1024 v -614 h 614 zM 154 1894 v -1740 h 1740 v 1156 l -584 584 z",SmileyFace:"M 1024 102 q 127 0 245 33 q 118 33 221 93 q 102 60 186 144 q 84 84 144 186 q 60 103 93 221 q 33 118 33 245 q 0 127 -33 245 q -33 118 -93 220 q -60 103 -144 187 q -84 84 -186 144 q -103 60 -221 93 q -118 33 -245 33 q -127 0 -245 -33 q -118 -33 -220 -93 q -103 -60 -187 -144 q -84 -84 -144 -187 q -60 -102 -93 -220 q -33 -118 -33 -245 q 0 -127 33 -245 q 33 -118 93 -221 q 60 -102 144 -186 q 84 -84 187 -144 q 102 -60 220 -93 q 118 -33 245 -33 m 0 1741 q 113 0 218 -30 q 104 -29 195 -82 q 91 -53 166 -128 q 75 -75 128 -166 q 53 -91 83 -196 q 29 -104 29 -217 q 0 -113 -29 -218 q -30 -104 -83 -195 q -53 -91 -128 -166 q -75 -75 -166 -128 q -91 -53 -195 -83 q -105 -29 -218 -29 q -113 0 -217 29 q -105 30 -196 83 q -91 53 -166 128 q -75 75 -128 166 q -53 91 -82 195 q -30 105 -30 218 q 0 113 30 217 q 29 105 82 196 q 53 91 128 166 q 75 75 166 128 q 91 53 196 82 q 104 30 217 30 m 358 -1331 q 32 0 60 12 q 28 12 49 33 q 21 21 33 49 q 12 28 12 60 q 0 32 -12 59 q -12 28 -33 49 q -21 21 -49 33 q -28 12 -60 12 q -32 0 -59 -12 q -28 -12 -49 -33 q -21 -21 -33 -49 q -12 -27 -12 -59 q 0 -32 12 -60 q 12 -28 33 -49 q 21 -21 49 -33 q 27 -12 59 -12 m 52 102 h -103 v 103 h 103 m -768 -205 q 31 0 59 12 q 28 12 49 33 q 21 21 33 49 q 12 28 12 60 q 0 32 -12 59 q -12 28 -33 49 q -21 21 -49 33 q -28 12 -59 12 q -32 0 -60 -12 q -28 -12 -49 -33 q -21 -21 -33 -49 q -12 -27 -12 -59 q 0 -32 12 -60 q 12 -28 33 -49 q 21 -21 49 -33 q 28 -12 60 -12 m 51 102 h -103 v 103 h 103 m 823 512 q -18 87 -66 162 q -48 75 -117 130 q -69 55 -154 86 q -86 31 -179 31 q -93 0 -178 -31 q -86 -31 -155 -86 q -69 -55 -117 -130 q -48 -75 -66 -162 h 106 q 17 66 57 122 q 39 56 94 97 q 55 42 122 65 q 66 23 137 23 q 71 0 138 -23 q 66 -23 121 -65 q 55 -41 95 -97 q 39 -56 56 -122 z",Heart:"M 997 1758 q -401 -286 -612 -551 q -212 -265 -231 -504 v -101 q 9 -106 45 -187 q 35 -80 87 -135 q 52 -55 114 -85 q 62 -30 122 -36 q 21 -2 41 -3 q 19 -1 38 -1 q 67 0 119 12 q 51 13 96 38 q 44 26 85 65 q 40 39 84 91 l 39 46 l 39 -46 q 44 -52 85 -91 q 40 -39 85 -65 q 44 -25 96 -38 q 51 -12 118 -12 q 19 0 39 1 q 19 1 40 3 q 60 6 122 36 q 62 31 114 86 q 51 56 87 137 q 36 82 45 189 v 100 q -19 240 -229 503 q -211 264 -609 548 l -30 21 z",LightningBolt:"M-8,-55L7,-24L1,-20L19,6L13,11L36,55L-3,21L5,16L-19,-6L-11,-12L-36,-35Z",Sun:"M69.60002899169922,0L41.51352437242167,8.416795119701419L41.51352437242167,-8.416795119701426ZM49.209798275982905,-41.47314036934465L36.41601824906962,-18.783766017986338L22.290725499983694,-30.686752034954836ZM0,-58.64998245239259L9.988224375410937,-34.982276749768076L-9.988224375410944,-34.982276749768076ZM-49.216242723111755,-41.47314036934465L-22.290725499983694,-30.686752034954836L-36.416018249069616,-18.783766017986338ZM-69.60002899169922,0L-41.51352437242167,-8.416795119701426L-41.51352437242167,8.416795119701419ZM-49.216242723111755,41.46770981541388L-36.416018249069616,18.783766017986338L-22.290725499983694,30.68675203495485ZM0,58.64998245239259L-9.988224375410944,34.98227674976806L9.988224375410937,34.98227674976806ZM49.209798275982905,41.46770981541388L22.290725499983694,30.68675203495485L36.41601824906962,18.783766017986338ZM-34.80001449584961,0Q-34.800014495849624,-12.14680908236253,-24.607326235405417,-20.735900154279413Q-14.414637974961238,-29.32499122619629,-1.4210854715202004e-14,-29.324991226196296Q14.414637974961224,-29.324991226196293,24.60732623540541,-20.735900154279413Q34.80001449584961,-12.146809082362545,34.80001449584961,-7.105427357601002e-15Q34.80001449584961,12.146809082362523,24.60732623540541,20.735900154279406Q14.414637974961224,29.32499122619629,0,29.32499122619629Q-14.414637974961217,29.32499122619629,-24.607326235405388,20.73590015427945Q-34.8000144958496,12.146809082362552,-34.80001449584961,7.105427357601002e-15Z",Moon:"M36.80000305175781,60.90000915527344Q6.313882332939066,60.90000915527344,-15.243060359409363,43.06280944801668Q-36.80000305175781,25.22560974075992,-36.80000305175781,7.105427357601002e-15Q-36.800003051757834,-25.225609740759907,-15.243060359409384,-43.062809448016665Q6.3138823329390235,-60.90000915527342,36.8000030517578,-60.90000915527344Q6.313882332939052,-41.98080184970351,0.9246466598519447,-10.765702362004177Q-4.464589013235177,20.449397125695157,18.400001525878878,45.67500686645508Q26.28571646554125,54.375008174351294,36.800003051757784,60.90000915527344Z",Cloud:"M 1024 1792 q -60 0 -115 -20 q -55 -19 -100 -54 q -46 -34 -79 -83 q -34 -48 -50 -106 l -24 -86 l -62 65 q -37 38 -83 58 q -47 21 -101 21 q -54 0 -101 -21 q -47 -20 -81 -55 q -35 -35 -54 -83 q -20 -47 -20 -100 q 0 -48 18 -91 q 18 -42 50 -78 l 25 -28 l -19 -32 q -38 -64 -56 -135 q -18 -71 -18 -145 q 0 -116 44 -219 q 44 -102 121 -179 q 76 -76 179 -121 q 102 -44 219 -44 q 106 0 206 38 q 99 39 177 113 l 39 37 l 35 -41 q 61 -72 140 -110 q 79 -37 171 -37 q 85 0 160 32 q 74 33 130 88 q 55 56 87 130 q 32 75 32 160 q 0 70 -23 135 q -23 66 -71 123 l -28 34 l 30 32 q 45 51 69 112 q 23 61 23 127 q 0 74 -28 139 q -28 65 -76 114 q -49 49 -114 77 q -66 28 -140 28 q -63 0 -126 -24 l -44 -17 l -20 43 q -23 47 -56 84 q -34 38 -76 64 q -42 27 -90 41 q -48 14 -100 14 z",Arc:"M-1.4210854715202004e-14,-45.200008392333984Q15.408730615404892,-45.200008392334,26.304348523034477,-31.96123244390823Q37.19996643066406,-18.722456495482472,37.19996643066406,-2.1316282072803006e-14Q37.19996643066406,-1.4210854715202004e-14,37.19996643066406,-1.4210854715202004e-14",DoubleBracket:"M 717 1843 v 103 h -307 q -63 0 -119 -25 q -56 -24 -98 -66 q -42 -42 -66 -98 q -25 -56 -25 -119 v -1228 q 0 -63 25 -119 q 24 -56 66 -98 q 42 -42 98 -67 q 56 -24 119 -24 h 307 v 103 h -307 q -42 0 -79 16 q -38 16 -66 44 q -28 28 -44 65 q -16 38 -16 80 v 1228 q 0 42 16 79 q 16 38 44 66 q 28 28 66 44 q 37 16 79 16 m 1228 -1741 q 63 0 119 24 q 56 25 98 67 q 42 42 67 98 q 24 56 24 119 v 1228 q 0 63 -24 119 q -25 56 -67 98 q -42 42 -98 66 q -56 25 -119 25 h -307 v -103 h 307 q 42 0 80 -16 q 37 -16 65 -44 q 28 -28 44 -66 q 16 -37 16 -79 v -1228 q 0 -42 -16 -80 q -16 -37 -44 -65 q -28 -28 -65 -44 q -38 -16 -80 -16 h -307 v -103 z",DoubleBrace:"M 1843 1126 q -38 0 -75 8 q -37 9 -66 32 q -29 23 -46 62 q -18 40 -18 103 v 410 q 0 77 -22 118 q -23 42 -55 61 q -33 20 -68 23 q -35 3 -59 3 h -103 v -103 q 14 -1 25 -1 q 10 0 18 0 q 15 0 27 0 q 11 1 33 1 q 38 0 59 -16 q 20 -15 30 -35 q 11 -22 13 -51 v -410 q 0 -62 18 -113 q 17 -51 46 -90 q 29 -39 66 -66 q 36 -26 75 -38 q -39 -12 -75 -40 q -37 -27 -66 -67 q -29 -40 -46 -91 q -18 -50 -18 -109 v -410 q 0 -38 -16 -59 q -16 -20 -35 -30 q -23 -11 -51 -13 h -103 v -103 h 103 q 57 3 102 26 q 19 10 38 24 q 18 15 32 37 q 14 22 23 51 q 9 29 9 67 v 410 q 0 59 18 98 q 17 39 46 63 q 29 24 66 34 q 37 10 75 10 m -1638 0 q 38 0 75 -10 q 37 -10 66 -34 q 29 -24 47 -63 q 17 -39 17 -98 v -410 q 0 -38 9 -67 q 9 -29 23 -51 q 14 -22 33 -37 q 18 -14 37 -24 q 45 -23 102 -26 h 103 v 103 h -103 q -29 2 -51 13 q -20 10 -35 30 q -16 21 -16 59 v 410 q 0 59 -17 109 q -18 51 -47 91 q -29 40 -65 67 q -37 28 -76 40 q 39 12 76 38 q 36 27 65 66 q 29 39 47 90 q 17 51 17 113 v 410 q 2 29 13 51 q 10 20 31 35 q 20 16 58 16 q 22 0 33 -1 q 11 0 27 0 q 8 0 19 0 q 10 0 24 1 v 103 h -103 q -24 0 -59 -3 q -35 -3 -67 -23 q -33 -19 -55 -61 q -23 -41 -23 -118 v -410 q 0 -63 -17 -103 q -18 -39 -47 -62 q -29 -23 -66 -32 q -37 -8 -75 -8 z",LeftBracket:"M 1331 1843 v 103 h -307 q -63 0 -119 -25 q -56 -24 -98 -66 q -42 -42 -66 -98 q -24 -56 -24 -119 v -1228 q 0 -63 24 -119 q 24 -56 66 -98 q 42 -42 98 -67 q 56 -24 119 -24 h 307 v 103 h -307 q -42 0 -79 16 q -38 16 -66 44 q -28 28 -44 65 q -16 38 -16 80 v 1228 q 0 42 16 79 q 16 38 44 66 q 28 28 66 44 q 37 16 79 16 z",RightBracket:"M 1024 102 q 63 0 119 24 q 56 25 98 67 q 42 42 66 98 q 24 56 24 119 v 1228 q 0 63 -24 119 q -24 56 -66 98 q -42 42 -98 66 q -56 25 -119 25 h -307 v -103 h 307 q 42 0 80 -16 q 37 -16 65 -44 q 28 -28 44 -66 q 16 -37 16 -79 v -1228 q 0 -42 -16 -80 q -16 -37 -44 -65 q -28 -28 -65 -44 q -38 -16 -80 -16 h -307 v -103 z",LeftBrace:"M 717 922 q 38 0 75 -10 q 37 -10 66 -34 q 29 -24 47 -63 q 17 -39 17 -98 v -410 q 0 -38 9 -67 q 9 -29 23 -51 q 14 -22 33 -37 q 18 -14 37 -24 q 45 -23 102 -26 h 103 v 103 h -103 q -29 2 -51 13 q -20 10 -35 30 q -16 21 -16 59 v 410 q 0 59 -17 109 q -18 51 -47 91 q -29 40 -65 67 q -37 28 -76 40 q 39 12 76 38 q 36 27 65 66 q 29 39 47 90 q 17 51 17 113 v 410 q 2 29 13 51 q 10 20 31 35 q 20 16 58 16 q 22 0 33 -1 q 11 0 27 0 q 8 0 19 0 q 10 0 24 1 v 103 h -103 q -24 0 -59 -3 q -35 -3 -67 -23 q -33 -19 -55 -61 q -23 -41 -23 -118 v -410 q 0 -63 -17 -103 q -18 -39 -47 -62 q -29 -23 -66 -32 q -37 -8 -75 -8 z",RightBrace:"M 1229 1126 q -39 0 -75 8 q -37 9 -66 32 q -29 23 -46 62 q -18 40 -18 103 v 410 q 0 51 -10 86 q -11 35 -28 58 q -18 23 -40 35 q -22 13 -44 18 q -23 6 -45 7 q -22 1 -38 1 h -102 v -103 q 14 -1 25 -1 q 10 0 18 0 q 15 0 26 0 q 11 1 33 1 q 38 0 59 -16 q 21 -15 31 -35 q 11 -22 13 -51 v -410 q 0 -62 18 -113 q 17 -51 46 -90 q 28 -39 65 -66 q 36 -26 75 -38 q -39 -12 -75 -40 q -37 -27 -65 -67 q -29 -40 -46 -91 q -18 -50 -18 -109 v -410 q 0 -38 -16 -59 q -16 -20 -36 -30 q -23 -11 -51 -13 h -102 v -103 h 102 q 57 3 102 26 q 19 10 38 24 q 18 15 33 37 q 14 22 23 51 q 9 29 9 67 v 410 q 0 59 18 98 q 17 39 46 63 q 29 24 66 34 q 36 10 75 10 z",Plus:"M696.6084,158.2656 L674.8074,158.2656 L674.8074,136.4656 L658.4084,136.4656 L658.4084,158.2656 L636.6084,158.2656L636.6084,174.6646 L658.4084,174.6646 L658.4084,196.4656 L674.8074,196.4656 L674.8074,174.6646 L696.6084,174.6646L696.6084,158.2656 z",Star:"M540.3643,137.9336 L546.7973,159.7016 L570.3633,159.7296 L550.7723,171.9366 L558.9053,194.9966 L540.3643,179.4996L521.8223,194.9966 L529.9553,171.9366 L510.3633,159.7296 L533.9313,159.7016 L540.3643,137.9336 z",Can:"M 542.802,362.009C 542.802,368.452 525.341,373.676 503.802,373.676C 482.263,373.676 464.802,368.452 464.802,362.009L 464.802,466.484C 464.802,472.928 482.263,478.151 503.802,478.151C 525.341,478.151 542.802,472.928 542.802,466.484L 542.802,362.016C 542.802,368.459 525.341,373.534 503.802,373.534C 482.263,373.534 464.802,368.31 464.802,361.867L 464.802,362.016C 464.802,355.572 482.263,350.349 503.802,350.349C 525.341,350.349 542.802,355.572 542.802,362.016",FlowChartProcess:"M419.511,76.687L359.511,76.687L359.511,43.086L419.511,43.086z",FlowChartAlternateProcess:"M 456 1690 q -62 0 -117 -24 q -55 -24 -96 -65 q -41 -41 -65 -96 q -24 -55 -24 -118 v -726 q 0 -63 24 -118 q 24 -55 65 -96 q 41 -41 96 -65 q 55 -24 117 -24 h 1136 q 62 0 117 24 q 55 24 96 65 q 41 41 65 96 q 24 55 24 118 v 726 q 0 63 -24 118 q -24 55 -65 96 q -41 41 -96 65 q -55 24 -117 24 z",FlowChartPunchedTape:"M 563 1894 q -94 0 -169 -15 q -76 -15 -129 -38 q -54 -23 -82 -50 q -29 -27 -29 -50 v -1276 q 69 45 175 71 q 105 27 234 27 q 109 0 203 -20 q 94 -19 163 -54 q 68 -34 107 -81 q 39 -46 39 -101 q 0 -23 29 -50 q 29 -27 83 -50 q 53 -23 129 -38 q 75 -15 169 -15 q 94 0 170 15 q 75 15 128 38 q 53 23 82 50 q 29 27 29 50 v 1276 q -69 -45 -174 -72 q -106 -26 -235 -26 q -110 0 -203 19 q -94 20 -162 54 q -69 35 -108 81 q -39 47 -39 102 q 0 23 -29 50 q -29 27 -82 50 q -54 23 -129 38 q -76 15 -170 15 Z",FlowChartDecision:"M 253.005,115.687L 200.567,146.071L 148.097,115.687L 200.534,85.304L 253.005,115.687 Z",FlowChartDocument:"M 60 31.9 c 0 0 -11 -7.7 -30 0 s -30 0 -30 0 V 0 h 60 V 31.9 Z",FlowChartPredefinedProcess:"M 0,0 L 50,0 L 50,50 L 0,50 Z M 8.334,0 L 8.334,50 M 41.667,0 L 41.667,50",FlowChartTerminator:"M 269.711,29.33C 269.71,44.061 257.77,56 243.04,56L 158.058,56C 143.33,56 131.39,44.061 131.39,29.33L 131.39,29.33C 131.391,14.6057 143.33,2.669 158.058,2.669L 243.044,2.669C 257.772,2.669 269.711,14.6057 269.711,29.333 Z",PaperTap:"M0.0009,17.2042 L0.0009,47.165 C0.001,47.165 14.403,53.5455 25.00,47.165 C35.599,40.7852 44.403,43.5087 50.00,47.165L50.001,17.2042 M50.001,32.7987 L50.001,2.8405 C50.001,2.8405 35.599,-3.5427 25.001,2.8405C14.403,9.2237 5.599,6.494 0.0009,2.8405 L0.0009,32.7987",DirectData:"M 132.62 0 L 17.38 0 C 7.78 0 0 13.43 0 30 C 0 46.57 7.78 60 17.38 60 L 132.62 60 M 132.62 0C 123.02 0 115.24 13.43 115.24 30 C 115.24 46.57 123.02 60 132.62 60 C 142.22 60 150 46.57 150 30 C 150 13.43 142.22 0 132.62 0 z ",SequentialData:"M0.0029,24.999 C0.0029,11.1922 10.433,0.0021 23.295,0.0021 C36.159,0.00216 46.585,11.1922 46.585,24.999C46.585,38.8057 36.159,49.9979 23.295,49.9979 C10.433,49.9979 0.0029,38.8057 0.0029,24.999 z M23.294,49.999 L50.002,49.999",FlowChartSort:"M50.001,24.9971 L25.001,49.9971 L0.00097,24.9971 L25.001,-0.00286865 L50.001,24.9971 z M0.000976562,24.9971 L50.001,24.9971",FlowChartMultiDocument:"M43.6826,40 C44.8746,40.6183 45.8586,41.3502 46.8366,42.1122 L46.8366,4.74487 L3.09857,4.74487 L3.09857,10.9544 M46.837,35.143 C48.027,35.765 49.025,36.604 50.003,37.369 L50.003,0.002 L6.264,0.002 L6.264,4.744 M43.682,47.113 L43.682,10.765 L0.0025,10.7652 L0.0025,47.1132 C0.0025,47.1132 12.5846,53.6101 21.8426,47.1132 C31.1006,40.6163 38.792,43.393 43.6826,47.1132 z",FlowChartCollate:"M50.001,0.0028 L25.001,25.0029 L0.00097,0.0028 L50.001,0.002 z M0.0009,50.002 L25.001,25.002L50.001,50.002 L0.0009,50.0029 z",FlowChartSummingJunction:"M7.3252,42.6768 L42.6772,7.3247 M42.6768,42.6768 L7.3248,7.3247 M0.0009,25.001 C0.0009,11.193 11.197,0.0009 25.001,0.0009 C38.809,0.0009 50.001,11.193 50.001,25.001 C50.001,38.809 38.809,50.001 25.001,50.001 C11.197,50.00 0.0009,38.809 0.0009,25.00 z",FlowChartOr:"M 0 50 L 100 50 M 50 100 L 50 0.0 M 0 50 C 0 22.384 22.392 0 50 0 C 77.616 0 100 22.384 100 50 C 100 77.616 77.616 100 50 100 C 22.392 100 0 77.616 0 50 Z",FlowChartInternalStorage:"M 0 3.81946A 2.5,3.81946 0 0,1 2.5,0L 47.5 0A 2.5,3.81946 0 0,1 50,3.81946L 50 45.836A 2.5,3.819446 0 0,1 47.5,49.652778L 2.5 49.652778A 2.5,3.819446 0 0,1 0,45.8336L 0 3.819446ZM 0 11.45834L 50 11.4583334M 12.5 0L 12.5 49.652778",FlowChartExtract:"M0,35 L30,0 L60,35 Z",FlowChartManualOperation:"M46.4,28.8 L14.8,28.8 L0,0 L60,0 Z",FlowChartMagneticDisk:"M 1024 1690 q -128 0 -242 -13 q -115 -12 -211 -34 q -97 -22 -174 -52 q -78 -30 -131 -64 q -54 -34 -83 -71 q -29 -37 -29 -74 v -716 q 0 -36 29 -74 q 29 -37 83 -71 q 53 -34 131 -64 q 77 -30 174 -52 q 96 -22 211 -35 q 114 -12 242 -12 q 128 0 243 12 q 114 13 211 35 q 96 22 174 52 q 77 30 131 64 q 53 34 82 71 q 29 38 29 74 v 716 q 0 37 -29 74 q -29 37 -82 71 q -54 34 -131 64 q -78 30 -174 52 q -97 22 -211 34 q -115 13 -243 13 Z",FlowChartConnector:"M 973 1792 q -113 0 -217 -30 q -105 -29 -196 -82 q -91 -53 -166 -128 q -75 -75 -128 -166 q -53 -91 -82 -196 q -30 -104 -30 -217 q 0 -113 30 -218 q 29 -104 82 -195 q 53 -91 128 -166 q 75 -75 166 -128 q 91 -53 196 -83 q 104 -29 217 -29 q 113 0 218 29 q 104 30 195 83 q 91 53 166 128 q 75 75 128 166 q 53 91 83 195 q 29 105 29 218 q 0 113 -29 217 q -30 105 -83 196 q -53 91 -128 166 q -75 75 -166 128 q -91 53 -195 82 q -105 30 -218 30 Z",FlowChartOffPageConnector:"M 358 1407 v -1253 h 1332 v 1253 l -666 476 Z",FlowChartDirectAccessStorage:"M 358 1024 q 0 -128 13 -243 q 12 -114 34 -211 q 22 -96 52 -174 q 30 -77 64 -131 q 34 -53 71 -82 q 37 -29 74 -29 h 716 q 36 0 74 29 q 37 29 71 82 q 34 54 64 131 q 30 78 52 174 q 22 97 35 211 q 12 115 12 243 q 0 128 -12 242 q -13 115 -35 211 q -22 97 -52 174 q -30 78 -64 131 q -34 54 -71 83 q -38 29 -74 29 h -716 q -37 0 -74 -29 q -37 -29 -71 -83 q -34 -53 -64 -131 q -30 -77 -52 -174 q -22 -96 -34 -211 q -13 -114 -13 -242 Z",FlowChartMerge:"M60,0 L30,35 L0,0 Z",OffPageReference:"M60,33.3 L30.1,39 L0,33.3 L0,0 L60,0 Z",FlowChartSequentialAccessStorage:"M 60 30 C 60 13.4 46.6 0 30 0 S 0 13.4 0 30 s 13.4 30 30 30 h 28.6 v -6.5 h -9.9C 55.5 48 60 39.5 60 30 Z",Annotation:"M49.9984,50.0029 L-0.00271199,50.0029 L-0.00271199,0.00286865 L49.9984,0.00286865",Annotation2:"M49.9977,50.0029 L25.416,50.0029 L25.416,0.00286865 L49.9977,0.00286865 M25.4166,25.0029 L-0.00227869,25.0029",FlowChartData:"M 10 0 L 40 0 L 30 40 L 0 40 Z",FlowChartCard:"M275,60 L400,60 L400,110 L260,110 L260,75 Z",FlowChartDelay:"M0,0 L12.029,0 C14.212999,0 16,1.7869979 16,3.9709952 C16,6.1549926 14.212999,7.9409904 12.029,7.9409904 L0,7.9409904 z",FlowChartPreparation:"M 1048.17 572 C 1051.06 568.86 1055.17 567.05 1059.5 567 L 1094.51 567 C 1098.84 567.05 1102.95 568.86 1105.84 572 L 1126.43 595 C 1127.01 596.28 1127.01 597.72 1126.43 599 L 1105.84 622 C 1102.95 625.14 1098.84 626.95 1094.51 627 L 1059.5 627 C 1055.17 626.95 1051.06 625.14 1048.17 622 L 1027.58 599 C 1027 597.72 1027 596.28 1027.58 595 L 1048.17 572 Z",FlowChartDisplay:"M47.8809,19.2914 L32.7968,-0.00594145 L11.3902,-0.00594145 C7.93166,-0.00594145 0.00124586,11.187 0.00124586,24.9968C0.00124586,38.8032 7.93166,49.9962 11.3902,49.9962 L32.7968,49.99 L47.615,31.038 C47.615,31.0388 52.798,24.9968 47.880,19.2914 z",FlowChartManualInput:"M 912 732 L 1006.85 707 C 1008.2 707 1009.5 707.53 1010.46 708.46 C 1011.41 709.4 1011.95 710.67 1011.95 712 L 1011.95 762C 1012 764.41 1010.28 766.52 1007.87 767 L 917.1 767 C 915.75 767 914.45 766.47 913.49 765.54 C 912.54 764.6 912 763.33 912 762 L 912 732 Z",LoopLimit:"M 8 9 L 27 9 L 33 15 L 33 26 C 33 27 33 27 32 27 L 4 27 C 3 27 2 27 2 26 L 2 15 L 8 9 Z",FlowChartStoredData:"M 5.55 0L 50 0A 1.5,30 0 0,1 50,0A 5.555,25 0 0,0 50,50A 1.5,30 0 0,1 50,50L 5.555 50A 5.55,25 0 0,1 5.555,0Z",RightArrow:"M 1178 1382 h -1024 v -716 h 1024 v -338 l 695 696 l -695 696 z",LeftArrow:"M 870 666 h 1024 v 716 h -1024 v 338 l -695 -696 l 695 -696 z",UpArrow:"M 1382 870 v 1024 h -716 v -1024 h -338 l 696 -695 l 696 695 z",DownArrow:"M 666 1178 v -1024 h 716 v 1024 h 338 l -696 695 l -696 -695 z",LeftRightArrow:"M 1382 1280 h -716 v 235 l -491 -491 l 491 -491 v 235 h 716 v -235 l 491 491 l -491 491 z",UpDownArrow:"M 768 1382 v -716 h -235 l 491 -491 l 491 491 h -235 v 716 h 235 l -491 491 l -491 -491 z",QuadArrow:"M 738 1587 h 132 v -409 h -409 v 132 l -286 -286 l 286 -286 v 132 h 409 v -409 h -132 l 286 -286 l 286 286 h -132 v 409 h 409 v -132 l 286 286 l -286 286 v -132 h -409 v 409 h 132 l -286 286 z",LeftRightUpArrow:"M 461 1485 v 132 l -286 -286 l 286 -286 v 133 h 409 v -615 h -132 l 286 -286 l 286 286 h -132 v 615 h 409 v -133 l 286 286 l -286 286 v -132 z",BentArrow:"M 154 1894 v -1126 q 0 -63 24 -119 q 24 -56 66 -98 q 41 -42 97 -66 q 56 -24 120 -24 h 1024 v -235 l 388 388 l -388 389 v -235 h -768 q -53 0 -99 20 q -47 20 -82 55 q -35 35 -55 81 q -20 47 -20 100 v 870 z",UTurnArrow:"M 154 1894 v -1075 q 0 -92 24 -177 q 24 -85 67 -159 q 43 -73 104 -134 q 61 -61 135 -104 q 73 -43 158 -67 q 85 -24 177 -24 h 103 q 92 0 177 24 q 85 24 159 67 q 73 43 134 104 q 61 61 104 134 q 43 74 67 159 q 24 85 24 177 v 359 h 235 l -388 388 l -389 -388 h 235 v -359 q 0 -74 -28 -139 q -28 -65 -77 -114 q -49 -49 -114 -77 q -65 -28 -139 -28 h -103 q -74 0 -139 28 q -65 28 -114 77 q -49 49 -77 114 q -28 65 -28 139 v 1075 z",LeftUpArrow:"M 175 1434 l 388 -389 v 235 h 717 v -717 h -235 l 389 -388 l 388 388 h -235 v 1024 h -1024 v 235 z",BentUpArrow:"M 154 1894 v -307 h 1126 v -1024 h -235 l 389 -388 l 388 388 h -235 v 1331 z",CurvedRightArrow:"M 1280 1587 h -205 q -99 0 -190 -26 q -92 -25 -171 -72 q -80 -47 -145 -112 q -66 -65 -113 -145 q -47 -80 -72 -172 q -26 -91 -26 -190 q 0 -99 26 -191 q 25 -91 72 -171 q 47 -79 113 -145 q 65 -65 145 -112 q 79 -46 171 -72 q 91 -25 190 -25 h 205 v 307 h -205 q -108 0 -208 31 q -101 31 -187 88 q -87 57 -155 137 q -68 81 -110 180 l -10 25 l 14 23 q 50 79 116 141 q 66 62 144 105 q 78 43 166 66 q 87 23 179 23 h 256 v -235 l 388 389 l -388 388 z",CurvedLeftArrow:"M 768 1822 l -388 -388 l 388 -389 v 235 h 256 q 92 0 180 -23 q 87 -23 165 -66 q 78 -43 144 -105 q 66 -62 116 -141 l 14 -23 l -10 -25 q -42 -99 -110 -180 q -68 -80 -154 -137 q -87 -57 -187 -88 q -101 -31 -209 -31 h -205 v -307 h 205 q 99 0 191 25 q 91 26 171 72 q 79 47 145 112 q 65 66 112 145 q 47 80 73 171 q 25 92 25 191 q 0 99 -25 190 q -26 92 -73 172 q -47 80 -112 145 q -66 65 -145 112 q -80 47 -171 72 q -92 26 -191 26 h -205 z",CurvedUpArrow:"M 1587 768 v 205 q 0 99 -25 190 q -26 92 -73 171 q -47 80 -112 145 q -65 66 -145 113 q -80 47 -171 72 q -92 26 -191 26 q -99 0 -190 -26 q -92 -25 -171 -72 q -80 -47 -145 -113 q -66 -65 -112 -145 q -47 -79 -72 -171 q -26 -91 -26 -190 v -205 h 307 v 205 q 0 108 31 208 q 31 101 88 187 q 57 87 138 155 q 80 68 179 110 l 25 10 l 23 -14 q 79 -50 141 -116 q 62 -66 105 -144 q 43 -78 66 -166 q 23 -87 23 -179 v -256 h -235 l 389 -388 l 388 388 z",CurvedDownArrow:"M 1822 1280 l -388 388 l -389 -388 h 235 v -256 q 0 -92 -23 -180 q -23 -87 -66 -165 q -43 -78 -105 -144 q -62 -66 -141 -116 l -23 -14 l -25 10 q -99 42 -179 110 q -81 68 -138 154 q -57 87 -88 187 q -31 101 -31 209 v 205 h -307 v -205 q 0 -99 26 -191 q 25 -91 72 -171 q 46 -79 112 -145 q 65 -65 145 -112 q 79 -47 171 -73 q 91 -25 190 -25 q 99 0 191 25 q 91 26 171 73 q 80 47 145 112 q 65 66 112 145 q 47 80 73 171 q 25 92 25 191 v 205 z",StripedRightArrow:"M 102 614 h 103 v 820 h -103 m 205 -820 h 103 v 820 h -103 m 819 409 v -409 h -614 v -820 h 614 v -409 l 820 819 m -717 307 v 265 l 572 -572 l -572 -572 v 265 h -615 v 614 z",NotchedRightArrow:"M 1126 1843 v -409 h -1024 l 512 -410 l -512 -410 h 1024 v -409 l 820 819 m -717 307 v 265 l 572 -572 l -572 -572 v 265 h -835 l 384 307 l -384 307 z",Pentagon:"M 154 1690 v -1434 h 1002 l 717 717 l -717 717 z",Chevron:"M 226 1690 l 717 -717 l -717 -717 h 930 l 717 717 l -717 717 z",RightArrowCallout:"M 154 154 h 1024 v 716 h 307 v -234 l 388 388 l -388 388 v -234 h -307 v 716 h -1024 z",DownArrowCallout:"M 154 154 h 1740 v 1024 h -716 v 307 h 234 l -388 388 l -388 -388 h 234 v -307 h -716 z",LeftArrowCallout:"M 1894 154 v 1740 h -1024 v -716 h -307 v 234 l -388 -388 l 388 -388 v 234 h 307 v -716 z",UpArrowCallout:"M 1894 1894 h -1740 v -1024 h 716 v -307 h -234 l 388 -388 l 388 388 h -234 v 307 h 716 z",LeftRightArrowCallout:"M 666 1894 v -716 h -205 v 132 l -286 -286 l 286 -286 v 132 h 205 v -716 h 716 v 716 h 205 v -132 l 286 286 l -286 286 v -132 h -205 v 716 z",QuadArrowCallout:"M 738 1587 h 132 v -205 h -204 v -204 h -205 v 132 l -286 -286 l 286 -286 v 132 h 205 v -204 h 204 v -205 h -132 l 286 -286 l 286 286 h -132 v 205 h 204 v 204 h 205 v -132 l 286 286 l -286 286 v -132 h -205 v 204 h -204 v 205 h 132 l -286 286 z",CircularArrow:"M 1045 1382 h 235 v -460 q 0 -74 -28 -140 q -28 -65 -77 -114 q -49 -48 -114 -77 q -65 -28 -139 -28 h -103 q -74 0 -139 28 q -65 29 -114 77 q -49 49 -77 114 q -28 66 -28 140 v 665 h -307 v -665 q 0 -92 24 -177 q 24 -85 67 -159 q 43 -74 104 -135 q 61 -60 135 -104 q 73 -43 158 -67 q 85 -24 177 -24 h 103 q 92 0 177 24 q 85 24 159 67 q 73 44 134 104 q 61 61 104 135 q 43 74 67 159 q 24 85 24 177 v 460 h 235 l -388 389 z",Explosion1:"M 833 1509 l -270 225 v -352 h -282 l 309 -193 l -374 -421 h 450 v -337 l 260 260 l 354 -443 v 418 h 361 l -226 317 l 381 297 h -394 l 228 457 l -479 -218 l -134 312 z",Explosion2:"M 591 1480 l -324 -1 l 208 -249 l -270 -360 h 492 l -135 -270 l 247 82 l 39 -239 l 187 281 l 168 -418 l 35 281 l 417 -186 l -135 408 l 253 42 l -215 172 l 246 206 h -300 l 174 346 l -347 -173 v 353 l -305 -175 l -416 270 z",Star4Point:"M 848 1200 l -572 -176 l 572 -176 l 176 -572 l 176 572 l 572 176 l -572 176 l -176 572 z",Star5Point:"M 1219 768 h 603 l -446 446 l 175 612 l -527 -352 l -527 352 l 175 -612 l -446 -446 h 598 l 202 -521 z",Star6Point:"M 786 1485 h -580 l 350 -461 l -350 -461 h 580 l 238 -367 l 238 367 h 580 l -350 461 l 350 461 h -580 l -238 367 z",Star7Point:"M 1024 1541 l -395 307 l -42 -422 l -396 -176 l 314 -314 l -207 -373 h 461 l 265 -372 l 265 372 h 461 l -207 373 l 314 314 l -396 176 l -42 422 z",Star8Point:"M 738 1587 h -277 v -277 l -286 -286 l 286 -286 v -277 h 282 l 281 -286 l 286 286 h 277 v 277 l 286 286 l -286 286 v 277 h -277 l -286 286 z",Star10Point:"M 828 1635 l -367 48 v -286 l -277 -93 l 198 -280 l -198 -280 l 277 -93 v -286 l 367 48 l 196 -231 l 196 231 l 370 -48 v 286 l 274 92 l -198 281 l 198 280 l -277 93 v 286 l -367 -48 l -196 231 z",Star12Point:"M 868 1611 l -305 231 v -357 h -357 l 231 -305 l -241 -156 l 241 -156 l -231 -305 h 357 v -357 l 305 231 l 156 -241 l 156 241 l 305 -231 v 357 h 357 l -231 305 l 241 156 l -241 156 l 231 305 h -357 v 357 l -305 -231 l -156 241 z",Star16Point:"M-51.20001220703125,0L-37.66234497940063,-6.9061855534744225L-47.302667277832036,-18.06249483215332L-31.9284556123352,-19.667176728401184L-36.204040631713866,-33.375589842071534L-21.333893086395264,-29.434036096916195L-19.593220671386717,-43.60713318054199L-7.491457786102288,-34.71996375514984L0,-47.19999694824219L7.491457786102288,-34.71996375514984L19.593220671386717,-43.60713318054199L21.33389308639528,-29.434036096916195L36.20404063171388,-33.375589842071534L31.928455612335213,-19.667176728401184L47.30266727783204,-18.06249483215332L37.66234497940066,-6.9061855534744225L51.20001220703125,0L37.66234497940066,6.9061855534744225L47.30266727783204,18.06249483215332L31.928455612335213,19.667176728401188L36.20404063171388,33.37558984207155L21.33389308639528,29.434036096916202L19.593220671386717,43.60713318054199L7.491457786102288,34.71996375514985L0,47.19999694824219L-7.491457786102288,34.71996375514985L-19.593220671386717,43.60713318054199L-21.333893086395264,29.434036096916202L-36.204040631713866,33.37558984207155L-31.9284556123352,19.667176728401188L-47.302667277832036,18.06249483215332L-37.66234497940063,6.9061855534744225Z",Star24Point:"M-51.20001220703125,0L-38.071305076904295,-4.620761701240539L-49.45541409708704,-12.216258138985935L-35.47700045837402,-13.546871124114986L-44.34051124536243,-23.599998474121094L-30.464647263336182,-21.55010260665893L-36.20387582842581,-33.3754379140864L-23.37638957336425,-28.084588184165955L-25.600006103515625,-40.87639641572571L-14.694915503540031,-32.70534988540649L-13.251538268661228,-45.59169605307234L-5.012353195037839,-35.096973730773925L0,-47.19999694824219L5.012353195037846,-35.096973730773925L13.251538268661236,-45.59169605307234L14.694915503540045,-32.70534988540649L25.600006103515625,-40.87639641572571L23.37638957336425,-28.084588184165955L36.20387582842582,-33.3754379140864L30.464647263336204,-21.55010260665893L44.340511245362435,-23.599998474121094L35.47700045837402,-13.546871124114986L49.45541409708704,-12.216258138985935L38.07130507690431,-4.620761701240539L51.20001220703125,0L38.07130507690431,4.620761701240539L49.45541409708704,12.216258138985935L35.47700045837402,13.546871124114993L44.340511245362435,23.599998474121094L30.464647263336204,21.550102606658925L36.20387582842582,33.375437914086405L23.37638957336425,28.084588184165966L25.600006103515625,40.87639641572571L14.694915503540045,32.70534988540649L13.251538268661236,45.59169605307234L5.012353195037846,35.096973730773925L0,47.19999694824219L-5.012353195037839,35.096973730773925L-13.251538268661228,45.59169605307234L-14.694915503540031,32.70534988540649L-25.600006103515625,40.87639641572571L-23.37638957336425,28.084588184165966L-36.20387582842581,33.375437914086405L-30.464647263336182,21.550102606658925L-44.34051124536243,23.599998474121094L-35.47700045837402,13.546871124114993L-49.45541409708704,12.216258138985935L-38.071305076904295,4.620761701240539Z",Star32Point:"M-54,0L-40.30479,-3.52872L-52.96266,-9.36432L-38.75607,-10.45008L-49.889520000000005,-18.368640000000003L-35.71776,-16.9704L-44.89938,-26.667360000000002L-31.306905,-22.838040000000007L-38.18376618407357,-33.94112549695428L-25.692795000000004,-27.828360000000004L-30.00078,-39.910560000000004L-19.091700000000003,-31.749120000000005L-20.664719999999996,-44.34624L-11.756339999999994,-34.44984L-10.534859999999995,-47.077920000000006L-3.9698099999999954,-35.82648L0,-48L3.9698100000000025,-35.82648L10.534860000000009,-47.077920000000006L11.756340000000009,-34.44984L20.664720000000003,-44.34624L19.091700000000003,-31.749120000000005L30.000780000000006,-39.910560000000004L25.692795000000004,-27.828360000000004L38.183766184073576,-33.94112549695428L31.306905000000015,-22.838040000000007L44.89938000000001,-26.667360000000002L35.71776000000001,-16.9704L49.889520000000005,-18.368640000000003L38.75607000000001,-10.45008L52.962660000000014,-9.36432L40.30479000000001,-3.52872L54,0L40.30479000000001,3.52872L52.962660000000014,9.36432L38.75607000000001,10.45008L49.889520000000005,18.36864L35.71776000000001,16.970399999999998L44.89938000000001,26.667359999999988L31.306905000000015,22.838039999999992L38.183766184073576,33.941125496954285L25.692795000000004,27.828360000000004L30.000780000000006,39.91055999999999L19.091700000000003,31.749120000000005L20.664720000000003,44.346239999999995L11.756340000000009,34.449839999999995L10.534860000000009,47.077920000000006L3.9698100000000025,35.826480000000004L0,48L-3.9698099999999954,35.826480000000004L-10.534859999999995,47.077920000000006L-11.756339999999994,34.449839999999995L-20.664719999999996,44.346239999999995L-19.091700000000003,31.749120000000005L-30.00078,39.91055999999999L-25.692795000000004,27.828360000000004L-38.18376618407357,33.941125496954285L-31.306905,22.838039999999992L-44.89938,26.667359999999988L-35.71776,16.970399999999998L-49.889520000000005,18.36864L-38.75607,10.45008L-52.96266,9.36432L-40.30479,3.52872Z",UpRibbon:"M 1741 1075 l 205 461 h -717 v -205 h -410 v 205 h -717 l 205 -461 l -205 -461 h 410 v -204 h 1024 v 204 h 410 m -512 615 v -717 h -820 v 717 m -102 -512 h -252 l 159 358 l -159 359 h 252 m 1117 -359 l 159 -358 h -252 v 717 h 252 m -1071 -103 h -103 v 103 h 103 m 717 0 v -103 h -103 v 103 z",DownRibbon:"M 1946 410 l -205 460 l 205 461 h -410 v 205 h -1024 v -205 h -410 l 205 -461 l -205 -460 h 717 v 204 h 410 v -204 m -615 307 v 717 h 820 v -717 m 102 512 h 252 l -159 -359 l 159 -358 h -252 m -1117 358 l -159 359 h 252 v -717 h -252 m 1174 0 h -103 v 102 h 103 m -820 -102 v 102 h 103 v -102 z",CurvedUpRibbon:"M 1741 1075 l 205 666 q -62 -57 -130 -102 q -29 -19 -62 -38 q -34 -18 -70 -33 q -36 -14 -73 -23 q -38 -9 -75 -9 h -307 v -256 q 0 -10 -16 -20 q -16 -9 -44 -16 q -28 -7 -65 -11 q -38 -4 -80 -4 q -42 0 -79 4 q -38 4 -66 11 q -28 7 -44 16 q -16 10 -16 20 v 256 h -307 q -38 0 -75 9 q -38 9 -74 23 q -36 15 -69 33 q -33 19 -62 38 q -69 45 -130 102 l 205 -666 l -205 -461 q 60 -75 122 -117 q 62 -41 119 -62 q 56 -20 104 -25 q 47 -4 78 -4 q 19 -43 65 -80 q 45 -37 111 -64 q 66 -27 149 -42 q 82 -15 174 -15 q 92 0 175 15 q 82 15 148 42 q 66 27 112 64 q 45 37 64 80 q 31 0 79 4 q 47 5 104 25 q 56 21 118 62 q 62 42 122 117 m -1659 876 q 116 -56 225 -56 v -926 l -8 -1 q -21 0 -51 4 q -30 4 -65 16 q -35 12 -73 34 q -39 22 -78 58 l 184 456 m 296 256 h -103 v 103 h 103 m 307 -308 q 72 0 124 8 q 52 9 87 23 q 35 15 55 33 q 20 19 30 39 h 114 v -773 l -4 -9 q -9 -21 -41 -46 q -32 -24 -83 -45 q -52 -21 -123 -35 q -71 -14 -159 -14 q -88 0 -159 14 q -71 14 -123 35 q -52 21 -83 45 q -32 25 -41 46 l -4 9 v 773 h 114 q 10 -20 30 -39 q 20 -18 55 -33 q 35 -14 87 -23 q 52 -8 124 -8 m 410 308 v -103 h -103 v 103 m 296 -380 l 184 -435 q -39 -36 -77 -58 q -39 -22 -74 -34 q -35 -12 -64 -16 q -30 -4 -51 -4 h -9 v 927 q 109 0 225 56 z",CurvedDownRibbon:"M 307 870 l -205 -665 q 61 58 130 103 q 29 19 62 37 q 33 19 69 33 q 36 14 74 23 q 37 9 75 9 h 307 v 256 q 0 11 16 20 q 16 9 44 16 q 28 7 66 11 q 37 4 79 4 q 42 0 80 -4 q 37 -4 65 -11 q 28 -7 44 -16 q 16 -9 16 -20 v -256 h 307 q 37 0 75 -9 q 37 -9 73 -23 q 36 -14 70 -33 q 33 -18 62 -37 q 68 -45 130 -103 l -205 665 l 205 461 q -55 69 -112 110 q -57 41 -110 63 q -54 23 -100 30 q -47 7 -80 7 q -6 0 -11 -1 q -5 0 -10 0 q -19 43 -64 80 q -46 37 -112 64 q -66 27 -148 42 q -83 15 -175 15 q -92 0 -174 -15 q -83 -15 -149 -42 q -66 -27 -111 -64 q -46 -37 -65 -80 q -5 0 -10 0 q -6 1 -11 1 q -33 0 -79 -7 q -47 -7 -100 -30 q -54 -22 -111 -63 q -57 -41 -112 -110 m 1659 -875 q -120 56 -225 56 v 926 h 8 q 21 0 51 -4 q 30 -4 65 -16 q 35 -12 74 -34 q 38 -22 77 -58 l -184 -456 m -296 -256 h 103 v -102 h -103 m -307 307 q -72 0 -124 -9 q -52 -8 -87 -22 q -35 -14 -55 -33 q -20 -18 -30 -38 h -114 v 773 l 4 9 q 9 21 41 45 q 31 25 83 45 q 52 21 123 35 q 71 14 159 14 q 88 0 159 -14 q 71 -14 123 -35 q 51 -20 83 -45 q 32 -24 41 -45 l 4 -9 v -773 h -114 q -10 20 -30 38 q -20 19 -55 33 q -35 14 -87 22 q -52 9 -124 9 m -410 -307 v 102 h 103 v -102 m -296 380 l -184 434 q 39 36 78 58 q 38 22 73 34 q 35 12 65 16 q 29 4 50 4 h 9 v -926 q -105 0 -225 -56 z",VerticalScroll:"M 1690 102 q 53 0 100 20 q 46 20 81 55 q 35 35 55 81 q 20 47 20 100 q 0 53 -20 100 q -20 47 -55 81 q -35 35 -81 55 q -47 20 -100 20 h -52 v 1178 q 0 32 -12 60 q -12 28 -32 49 q -21 21 -49 33 q -28 12 -60 12 h -1178 q -42 0 -79 -17 q -38 -16 -65 -44 q -28 -27 -44 -65 q -17 -37 -17 -79 q 0 -42 17 -80 q 16 -37 44 -65 q 27 -28 65 -44 q 37 -16 79 -16 h 103 v -1280 q 0 -32 12 -60 q 12 -28 33 -49 q 20 -21 48 -33 q 28 -12 60 -12 m 51 308 q 0 -41 16 -78 q 15 -36 42 -64 q 26 -28 62 -45 q 35 -16 76 -18 h -247 q -21 0 -36 15 q -15 15 -15 36 v 1587 h 973 q 21 0 36 -15 q 15 -15 15 -36 v -1178 h -717 q -42 0 -79 -16 q -38 -16 -66 -44 q -28 -27 -44 -65 q -16 -37 -16 -79 m 1076 102 q 31 0 59 -12 q 28 -12 49 -33 q 21 -21 33 -49 q 12 -28 12 -60 q 0 -31 -12 -59 q -12 -28 -33 -49 q -21 -21 -49 -33 q -28 -12 -59 -12 h -863 q 41 2 77 18 q 36 17 63 45 q 26 28 42 64 q 15 37 15 78 q 0 28 -7 53 q -7 26 -20 49 m -587 1126 h -103 q -21 0 -39 8 q -19 8 -33 22 q -14 14 -22 33 q -8 19 -8 40 q 0 21 8 39 q 8 19 22 33 q 14 14 33 22 q 18 8 39 8 h 103 m 409 -1331 q 21 0 40 -8 q 19 -8 33 -22 q 14 -14 22 -33 q 8 -18 8 -39 q 0 -21 -8 -40 q -8 -19 -22 -33 q -14 -14 -33 -22 q -19 -8 -40 -8 q -21 0 -39 8 q -19 8 -33 22 q -14 14 -22 33 q -8 19 -8 40 q 0 21 8 39 q 8 19 22 33 q 14 14 33 22 q 18 8 39 8 z",HorizontalScroll:"M 1741 102 q 42 0 80 16 q 37 17 65 44 q 27 28 44 65 q 16 38 16 80 v 1178 q 0 32 -12 60 q -12 28 -33 48 q -21 21 -49 33 q -28 12 -60 12 h -1178 v 52 q 0 53 -20 99 q -20 47 -54 82 q -35 35 -82 55 q -47 20 -100 20 q -53 0 -99 -20 q -47 -20 -82 -55 q -35 -35 -55 -82 q -20 -46 -20 -99 v -1127 q 0 -32 12 -60 q 12 -28 33 -49 q 21 -20 49 -32 q 28 -12 60 -12 h 1280 v -103 q 0 -42 16 -80 q 16 -37 44 -65 q 28 -27 66 -44 q 37 -16 79 -16 m 102 410 h -1587 q -21 0 -36 15 q -15 15 -15 36 v 248 q 1 -41 18 -77 q 17 -36 45 -63 q 27 -26 64 -42 q 37 -15 78 -15 q 42 0 80 16 q 37 16 65 44 q 27 28 43 65 q 16 38 16 80 v 717 h 1178 q 21 0 36 -15 q 15 -15 15 -36 m -1433 -461 q -41 0 -78 -16 q -37 -15 -64 -42 q -28 -26 -45 -62 q -17 -35 -18 -76 v 862 q 0 32 12 59 q 12 28 33 49 q 21 21 49 33 q 27 12 59 12 q 32 0 60 -12 q 28 -12 49 -33 q 21 -21 33 -49 q 12 -27 12 -59 v -693 q -23 13 -48 20 q -26 7 -54 7 m 1433 -717 q 0 -21 -8 -40 q -8 -18 -22 -32 q -14 -14 -32 -22 q -19 -8 -40 -8 q -21 0 -40 8 q -19 8 -33 22 q -14 14 -22 32 q -8 19 -8 40 v 103 h 205 m -1331 409 q 0 -21 -8 -40 q -8 -18 -22 -32 q -14 -14 -32 -22 q -19 -8 -40 -8 q -21 0 -40 8 q -19 8 -33 22 q -14 14 -22 32 q -8 19 -8 40 q 0 21 8 40 q 8 19 22 33 q 14 14 33 22 q 19 8 40 8 q 21 0 40 -8 q 18 -8 32 -22 q 14 -14 22 -33 q 8 -19 8 -40 z",Wave:"M 1383 1894 q -42 0 -84 -8 q -43 -7 -77 -16 q -34 -9 -55 -17 q -22 -7 -23 -7 q -8 -5 -26 -17 q -18 -11 -39 -25 q -21 -13 -41 -27 q -20 -13 -32 -24 l -38 -33 q -40 -35 -89 -76 q -49 -41 -106 -77 q -58 -35 -123 -59 q -66 -23 -138 -23 q -68 0 -122 10 q -55 10 -99 27 q -44 17 -78 39 q -34 23 -59 47 v -1275 q 24 -16 77 -47 q 52 -30 126 -59 q 73 -29 165 -51 q 91 -22 195 -22 q 72 0 130 17 q 57 18 104 47 q 46 29 85 65 q 38 37 74 75 q 35 39 70 75 q 34 37 72 66 q 38 29 83 46 q 44 18 99 18 q 78 0 147 -24 q 69 -23 127 -59 q 57 -36 104 -80 q 47 -44 82 -85 v 1356 q -16 18 -57 55 q -41 38 -105 75 q -64 37 -149 65 q -86 28 -191 28 z",DoubleWave:"M 1690 1894 q -58 0 -100 -19 q -42 -19 -75 -48 q -33 -28 -62 -61 q -29 -33 -61 -62 q -32 -28 -71 -47 q -39 -19 -92 -19 q -51 0 -92 19 q -42 19 -77 47 q -35 29 -65 62 q -30 33 -59 61 q -29 29 -57 48 q -29 19 -60 19 q -35 0 -73 -19 q -39 -19 -79 -48 q -40 -28 -80 -61 q -40 -33 -79 -62 q -40 -28 -78 -47 q -38 -19 -72 -19 q -26 0 -52 10 q -27 11 -53 27 q -27 17 -52 38 q -25 22 -47 44 v -1480 q 19 -20 45 -42 q 26 -21 54 -39 q 27 -18 55 -30 q 27 -12 50 -12 q 24 0 55 19 q 31 19 67 47 q 36 29 77 62 q 41 33 84 61 q 43 29 88 48 q 45 19 90 19 q 48 0 87 -19 q 38 -19 71 -48 q 33 -28 63 -61 q 29 -33 59 -62 q 30 -28 62 -47 q 31 -19 68 -19 q 36 0 68 19 q 31 19 63 47 q 31 29 64 62 q 33 33 72 61 q 39 29 87 48 q 47 19 107 19 q 70 0 120 -17 q 50 -16 84 -40 v 1477 q -5 6 -17 17 q -12 11 -35 21 q -24 11 -61 18 q -37 8 -91 8 z",MathPlus:"M 1894 1280 h -614 v 614 h -512 v -614 h -614 v -512 h 614 v -614 h 512 v 614 h 614 z",MathMinus:"M 154 768 h 1740 v 512 h -1740 z",MathMultiply:"M 1409 1771 l -435 -435 l -434 435 l -362 -362 l 434 -435 l -434 -434 l 362 -362 l 434 434 l 435 -434 l 362 362 l -435 434 l 435 435 z",MathDivision:"M 1024 1792 q -32 0 -60 -12 q -28 -12 -49 -33 q -21 -21 -33 -49 q -12 -28 -12 -60 q 0 -31 12 -59 q 12 -28 33 -49 q 21 -21 49 -33 q 28 -12 60 -12 q 32 0 60 12 q 28 12 49 33 q 21 21 33 49 q 12 28 12 59 q 0 32 -12 60 q -12 28 -33 49 q -21 21 -49 33 q -28 12 -60 12 m 0 -1229 q -32 0 -60 -12 q -28 -12 -49 -33 q -21 -21 -33 -49 q -12 -27 -12 -59 q 0 -32 12 -60 q 12 -28 33 -49 q 21 -21 49 -33 q 28 -12 60 -12 q 32 0 60 12 q 28 12 49 33 q 21 21 33 49 q 12 28 12 60 q 0 32 -12 59 q -12 28 -33 49 q -21 21 -49 33 q -28 12 -60 12 m -870 205 h 1740 v 512 h -1740 z",MathEqual:"M 154 358 h 1740 v 512 h -1740 m 0 205 h 1740 v 512 h -1740 z",MathNotEqual:"M 1372 870 l -136 205 h 658 v 512 h -1000 l -205 307 h -389 l 205 -307 h -351 v -512 h 693 l 136 -205 h -829 v -512 h 1170 l 137 -204 h 389 l -137 204 h 181 v 512 z",RoundedRectangle:"M 20,0 h 160 a 20,20 0 0 1 20,20 v 60 a 20,20 0 0 1 -20,20 h -160 a 20,20 0 0 1 -20,-20 v -60 a 20,20 0 0 1 20,-20 z",SnipSingleCornerRectangle:"M 154 1690 v -1332 h 1258 l 482 482 v 850 z",SnipSameSideCornerRectangle:"M 154 1690 v -850 l 482 -482 h 776 l 482 482 v 850 z",SnipDiagonalCornerRectangle:"M 636 1690 l -482 -482 v -850 h 1258 l 482 482 v 850 z",SnipAndRoundSingleCornerRectangle:"M 154 1690 v -1029 q 0 -63 24 -118 q 24 -55 65 -96 q 41 -41 96 -65 q 55 -24 117 -24 h 956 l 482 482 v 850 z",RoundSingleCornerRectangle:"M 154 1690 v -1332 h 1438 q 62 0 117 24 q 55 24 96 65 q 41 41 65 96 q 24 55 24 118 v 1029 z",RoundSameSideCornerRectangle:"M 154 1690 v -1029 q 0 -63 24 -118 q 24 -55 65 -96 q 41 -41 96 -65 q 55 -24 117 -24 h 1136 q 62 0 117 24 q 55 24 96 65 q 41 41 65 96 q 24 55 24 118 v 1029 z",RoundDiagonalCornerRectangle:"M 200 0 L 1800 0 L 1800 1300 A 200 200 0 0 1 1600 1500 L 0 1500 L 0 200 A 200 200 0 0 1 200 0 Z"},this.documentHelper=e}return Object.defineProperty(i.prototype,"pageCanvas",{get:function(){return this.isPrinting?(t.isNullOrUndefined(this.pageCanvasIn)&&(this.pageCanvasIn=document.createElement("canvas"),this.pageCanvasIn.getContext("2d").save()),this.pageCanvasIn):this.isExporting?(t.isNullOrUndefined(this.exportPageCanvas)&&(this.exportPageCanvas=new wd),this.exportPageCanvas):t.isNullOrUndefined(this.viewer)?void 0:this.documentHelper.containerCanvas},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"selectionCanvas",{get:function(){return t.isNullOrUndefined(this.viewer)?void 0:this.documentHelper.selectionCanvas},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pageContext",{get:function(){return this.pageCanvas.getContext("2d")},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"selectionContext",{get:function(){return this.selectionCanvas.getContext("2d")},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"viewer",{get:function(){return this.documentHelper.viewer},enumerable:!0,configurable:!0}),i.prototype.renderWidgets=function(e,i,r,n,o){if(!(t.isNullOrUndefined(this.pageCanvas)||t.isNullOrUndefined(e)||t.isNullOrUndefined(e.bodyWidgets))&&this.documentHelper.enableLayout){if(this.pageContext.fillStyle=bs.getColor(this.documentHelper.backgroundColor),this.pageContext.beginPath(),this.viewer instanceof Ms){o=o>this.documentHelper.visibleBounds.height?o:this.documentHelper.visibleBounds.height;var a=r;0===e.index&&(a=r-this.viewer.padding.top),this.pageContext.fillRect(i-this.viewer.padding.left,a,n+this.viewer.padding.left,o+this.viewer.padding.top)}else this.pageContext.fillRect(i,r,n,o);this.pageContext.closePath(),this.viewer instanceof Es&&(this.pageContext.strokeStyle=this.documentHelper.pageOutline,this.pageContext.strokeRect(i,r,n,o)),this.pageLeft=i,this.pageTop=r,this.pageIndex=e.index,this.isPrinting?this.setPageSize(e):(this.pageContext.beginPath(),this.pageContext.save(),this.pageContext.rect(i,r,n,o),this.pageContext.clip()),this.height=o,e.headerWidget&&this.renderHFWidgets(e,e.headerWidgetIn,n,!0),e.footerWidget&&this.renderHFWidgets(e,e.footerWidgetIn,n,!1);for(s=0;s<e.bodyWidgets.length;s++)t.isNullOrUndefined(e.bodyWidgets[s].floatingElements)||this.renderFloatingItems(e,e.bodyWidgets[s].floatingElements,"Behind");for(var s=0;s<e.bodyWidgets.length;s++)this.render(e,e.bodyWidgets[parseInt(s.toString(),10)]),e.footnoteWidget&&"Pages"===this.documentHelper.layoutType&&this.renderfootNoteWidget(e,e.footnoteWidget,n);e.endnoteWidget&&"Pages"===this.documentHelper.layoutType&&this.renderfootNoteWidget(e,e.endnoteWidget,n),this.documentHelper.editorProperties.enableHeaderAndFooter&&!this.isPrinting&&this.renderHeaderSeparator(e,this.pageLeft,this.pageTop,e.headerWidgetIn),this.pageLeft=0,this.pageTop=0,this.pageContext.restore()}},i.prototype.setPageSize=function(e){this.pageContext.clearRect(0,0,this.pageCanvas.width,this.pageCanvas.height),this.selectionContext.clearRect(0,0,this.selectionCanvas.width,this.selectionCanvas.height),this.pageContext.restore(),this.selectionContext.restore();var t=e.boundingRectangle.width,i=e.boundingRectangle.height,r=Math.max(window.devicePixelRatio,this.documentHelper.documentEditorSettings.printDevicePixelRatio);this.pageCanvas.width===t*r&&this.pageCanvas.height===i*r||(this.pageCanvas.height=i*r,this.pageCanvas.width=t*r,this.pageCanvas.style.height=i+"px",this.pageCanvas.style.width=t+"px",this.pageContext.globalAlpha=1,this.pageContext.scale(r,r)),this.pageContext.fillStyle="#FFFFFF",this.pageContext.fillRect(0,0,this.pageCanvas.width,this.pageCanvas.height),this.pageContext.fillStyle="#000000"},i.prototype.renderHFWidgets=function(e,i,r,n){this.isFieldCode&&(this.isFieldCode=!1),this.isPrinting||(this.pageContext.globalAlpha=this.documentHelper.editorProperties.enableHeaderAndFooter?1:.65);var o=!1,a=0,s="Word2013"===this.documentHelper.compatibilityMode&&e.headerWidget.height+e.footerWidget.height<e.boundingRectangle.height/100*80?e.boundingRectangle.height/100*80:e.boundingRectangle.height/100*40;if("Word2003"===this.documentHelper.compatibilityMode&&(s=this.getScaledValue(e.boundingRectangle.height)/100*50),!(t.isNullOrUndefined(e.bodyWidgets)||0===e.bodyWidgets.length||t.isNullOrUndefined(e.bodyWidgets[0])||t.isNullOrUndefined(e.bodyWidgets[0].sectionFormat))){if(n){var l=bs.convertPointToPixel(e.bodyWidgets[0].sectionFormat.topMargin);Math.max(i.y+i.height,l)>s&&(o=!0,this.pageContext.beginPath(),this.pageContext.save(),this.pageContext.rect(this.pageLeft,this.pageTop,r,this.getScaledValue(s)),this.pageContext.clip())}else{var d=bs.convertPointToPixel(e.bodyWidgets[0].sectionFormat.footerDistance),h=void 0;h=(t.isNullOrUndefined(e.footerWidgetIn.sectionFormat),e.boundingRectangle.height-Math.max(e.footerWidgetIn.height+d,bs.convertPointToPixel(e.footerWidgetIn.sectionFormat.bottomMargin))),a=Math.max(e.boundingRectangle.height-s,h)}this.renderFloatingItems(e,i.floatingElements,"Behind");for(var c=0;c<i.childWidgets.length;c++){var g=i.childWidgets[parseInt(c.toString(),10)];n||(a+=g.height),this.renderWidget(e,g)}this.renderFloatingItems(e,i.floatingElements,"InFrontOfText"),o&&this.pageContext.restore(),this.isPrinting||(this.pageContext.globalAlpha=this.documentHelper.editorProperties.enableHeaderAndFooter?.5:1)}},i.prototype.renderHeaderSeparator=function(e,i,r,n){var o=bs.convertPointToPixel(e.bodyWidgets[0].sectionFormat.topMargin),a=this.getScaledValue(Math.max(n.y+n.height,Math.abs(o))),s=this.getScaledValue(e.boundingRectangle.width),l=this.pageContext;l.save(),l.globalAlpha=.85;var d="Word2013"===this.documentHelper.compatibilityMode&&e.headerWidget.height+e.footerWidget.height<e.boundingRectangle.height/100*80?this.getScaledValue(e.boundingRectangle.height)/100*80:this.getScaledValue(e.boundingRectangle.height)/100*40;"Word2003"===this.documentHelper.compatibilityMode&&(d=this.getScaledValue(e.boundingRectangle.height)/100*50),a=Math.min(a,d),this.renderDashLine(l,i,r+a,s,"#000000",!1);var h=this.getHeaderFooterType(e,!0),c=this.viewer.getHeaderFooter(n.headerFooterType),g=e.sectionIndex,p=new t.L10n("documenteditor",this.documentHelper.defaultLocale);if(p.setLocale(this.documentHelper.locale),this.documentHelper.headersFooters.length>1){F=g+1;h=h+" -"+p.getConstant("Section")+" "+F+"-"}l.font="9pt Arial",l.letterSpacing="0pt";var u=l.measureText(h).width;this.renderHeaderFooterMark(l,i+5,r+a,u+10,20),this.renderHeaderFooterMarkText(l,h,i+10,a+r+15);var f;if(this.documentHelper.headersFooters[parseInt(g.toString(),10)]&&(f=this.documentHelper.headersFooters[parseInt(g.toString(),10)][parseInt(c.toString(),10)]),0!==g&&!f){var m=p.getConstant("Same as Previous"),y=l.measureText(m).width,v=this.viewer.containerWidth-y-75+i;this.renderHeaderFooterMark(l,v,r+a,y+10,20),this.renderHeaderFooterMarkText(l,m,v+5,a+r+15)}if(e.footerWidget){var W=bs.convertPointToPixel(e.bodyWidgets[0].sectionFormat.footerDistance),b="Word2013"===this.documentHelper.compatibilityMode&&e.footerWidgetIn.y+e.footerWidgetIn.height>e.boundingRectangle.height?e.footerWidgetIn.y:this.getScaledValue(e.boundingRectangle.height)-this.getScaledValue(Math.max(e.footerWidgetIn.height+W,Math.abs(bs.convertPointToPixel(e.footerWidgetIn.sectionFormat.bottomMargin))));b=Math.max(this.getScaledValue(e.boundingRectangle.height)-d,b),this.renderDashLine(l,i,r+b,s,"#000000",!1);var x=this.getHeaderFooterType(e,!1),w=e.sectionIndex;if(this.documentHelper.headersFooters.length>1){var F=w+1;x=x+" -"+p.getConstant("Section")+" "+F+"-"}u=l.measureText(x).width,this.renderHeaderFooterMark(l,i+5,r+b-20,u+10,20),this.renderHeaderFooterMarkText(l,x,i+10,r+b-5);var C,P=this.viewer.getHeaderFooter(e.footerWidget.headerFooterType);if(this.documentHelper.headersFooters[parseInt(w.toString(),10)]&&(C=this.documentHelper.headersFooters[parseInt(w.toString(),10)][parseInt(P.toString(),10)]),0!==w&&!C){var m=p.getConstant("Same as Previous"),T=l.measureText(m).width,v=this.viewer.containerWidth-T-75+i;this.renderHeaderFooterMark(l,v,r+b-20,T+10,20),this.renderHeaderFooterMarkText(l,m,v+5,r+b-5)}l.restore()}},i.prototype.getFooterHeight=function(e){var t=e.boundingRectangle.height/100*40,i=bs.convertPointToPixel(e.bodyWidgets[0].sectionFormat.footerDistance),r=e.boundingRectangle.height-Math.max(e.footerWidgetIn.height+i,bs.convertPointToPixel(e.footerWidgetIn.sectionFormat.bottomMargin));return Math.max(e.boundingRectangle.height-t,r)},i.prototype.getHeaderFooterType=function(e,i){var r,n=new t.L10n("documenteditor",this.documentHelper.defaultLocale);return n.setLocale(this.documentHelper.locale),r=i?n.getConstant("Header"):n.getConstant("Footer"),e.bodyWidgets[0].sectionFormat.differentFirstPage&&(t.isNullOrUndefined(e.previousPage)||e.sectionIndex!==e.previousPage.sectionIndex)?r=i?n.getConstant("First Page Header"):n.getConstant("First Page Footer"):e.bodyWidgets[0].sectionFormat.differentOddAndEvenPages&&(r=(this.documentHelper.pages.indexOf(e)+1)%2==0?i?n.getConstant("Even Page Header"):n.getConstant("Even Page Footer"):i?n.getConstant("Odd Page Header"):n.getConstant("Odd Page Footer")),r},i.prototype.renderDashLine=function(e,t,i,r,n,o){e.beginPath(),e.strokeStyle=n,e.lineWidth=1,o?e.setLineDash([3,2]):e.setLineDash([6,4]),e.moveTo(t,i),e.lineTo(t+r,i),e.stroke(),e.setLineDash([]),e.closePath()},i.prototype.renderSolidLine=function(e,t,i,r,n){e.beginPath(),e.strokeStyle=n,e.lineWidth=.5,e.moveTo(t,i),e.lineTo(t+r,i),e.stroke(),e.closePath()},i.prototype.renderHeaderFooterMark=function(e,t,i,r,n){e.beginPath(),e.fillStyle="lightgray",e.fillRect(t,i,r,n),e.strokeStyle="black",e.strokeRect(t,i,r,n),e.closePath()},i.prototype.renderHeaderFooterMarkText=function(e,t,i,r){e.beginPath(),e.fillStyle="#000000",e.textBaseline="alphabetic",e.fillText(t,i,r),e.closePath()},i.prototype.render=function(e,i){this.isFieldCode&&(this.isFieldCode=!1);var r,n=!1;t.isNullOrUndefined(i.nextRenderedWidget)||i.columnIndex+1!==i.nextRenderedWidget.columnIndex||(r=i.nextRenderedWidget);var o,a;if(!(this.viewer instanceof Ms)&&i.sectionFormat.columns.length>1&&!t.isNullOrUndefined(r)){var s=e.bodyWidgets.indexOf(i);0===i.columnIndex?(o=e.bodyWidgets[s].x-bs.convertPointToPixel(e.bodyWidgets[s].sectionFormat.leftMargin),a=bs.convertPointToPixel(e.bodyWidgets[s].sectionFormat.leftMargin)+i.sectionFormat.columns[i.columnIndex].width+i.sectionFormat.columns[i.columnIndex].space/2):s===i.sectionFormat.columns.length-1?(o=e.bodyWidgets[s].x-i.sectionFormat.columns[i.columnIndex-1].space/2,a=bs.convertPointToPixel(e.bodyWidgets[s].sectionFormat.rightMargin)+i.sectionFormat.columns[i.columnIndex].width+i.sectionFormat.columns[i.columnIndex-1].space/2):(o=e.bodyWidgets[s].x-i.sectionFormat.columns[i.columnIndex].space/2,a=i.sectionFormat.columns[i.columnIndex].width+i.sectionFormat.columns[i.columnIndex].space),this.clipRect(o,e.bodyWidgets[s].y,this.getScaledValue(a),this.getScaledValue(e.boundingRectangle.height)),n=!0}for(d=0;d<i.childWidgets.length;d++){var l=i.childWidgets[parseInt(d.toString(),10)];0===d&&i.childWidgets[0]instanceof el&&i.childWidgets[0].childWidgets.length>0&&e.repeatHeaderRowTableWidget&&this.renderHeader(e,l,this.documentHelper.layout.getHeader(i.childWidgets[0])),n&&l instanceof el&&l.wrapTextAround&&(this.pageContext.restore(),n=!1),this.renderWidget(e,l),!n&&o&&a&&(this.clipRect(o,e.bodyWidgets[e.bodyWidgets.indexOf(i)].y,this.getScaledValue(a),this.getScaledValue(e.boundingRectangle.height)),n=!0)}n&&this.pageContext.restore();for(d=0;d<e.bodyWidgets.length;d++)t.isNullOrUndefined(e.bodyWidgets[d].floatingElements)||this.renderFloatingItems(e,e.bodyWidgets[d].floatingElements,"InFrontOfText");for(var d=0;d<e.bodyWidgets.length;d++)if(!0===e.bodyWidgets[parseInt(d.toString(),10)].sectionFormat.lineBetweenColumns&&0!==e.bodyWidgets[parseInt(d.toString(),10)].columnIndex&&e.bodyWidgets.length>1){var h=bs.convertPointToPixel(e.bodyWidgets[0].sectionFormat.topMargin),c=this.getScaledValue(Math.max(e.headerWidgetIn.y+e.headerWidgetIn.height,h)),g=this.getScaledValue(e.boundingRectangle.height)/100*40,p=bs.convertPointToPixel(e.bodyWidgets[0].sectionFormat.footerDistance),u=this.getScaledValue(e.boundingRectangle.height)-this.getScaledValue(Math.max(e.footerWidgetIn.height+p,bs.convertPointToPixel(e.footerWidgetIn.sectionFormat.bottomMargin)));u=Math.max(this.getScaledValue(e.boundingRectangle.height)-g,u);var f=(e.bodyWidgets[parseInt(d.toString(),10)].x-(e.bodyWidgets[parseInt(d.toString(),10)].previousRenderedWidget.x+e.bodyWidgets[parseInt(d.toString(),10)].previousRenderedWidget.width))/2+(e.bodyWidgets[parseInt(d.toString(),10)].previousRenderedWidget.x+e.bodyWidgets[parseInt(d.toString(),10)].previousRenderedWidget.width),m=c/this.documentHelper.zoomFactor,y=f,v=void 0;v=e.footnoteWidget?(u-e.footerWidgetIn.height/2-e.footnoteWidget.height*this.documentHelper.zoomFactor)/this.documentHelper.zoomFactor:(u-e.footerWidgetIn.height/2)/this.documentHelper.zoomFactor;var W=this.documentHelper.layout.getBodyWidget(e.bodyWidgets[parseInt(d.toString(),10)],!0),b=this.documentHelper.layout.getNextWidgetHeight(W);m=e.bodyWidgets[parseInt(d.toString(),10)].y,v=b;this.renderSingleBorder("#000000",f,m,y,v,.5,"Single")}},i.prototype.renderFloatingItems=function(e,i,r){if(!t.isNullOrUndefined(i)&&i.length>0){var n=new p;i.sort(function(e,t){return e instanceof el||t instanceof el?0:e.zOrderPosition-t.zOrderPosition});for(var o=0;o<i.length;o++)if(!(i[o]instanceof el)){var a=i[o];if(!("Behind"===r&&"Behind"!==a.textWrappingStyle||"Behind"!==r&&"Behind"===a.textWrappingStyle))if(!this.isOverLappedShapeWidget(a)||n.containsKey(a.zOrderPosition))if(a instanceof Il)this.renderImageElementBox(a,a.x,a.y,0);else if(a instanceof Pl){var s=this.getScaledValue(a.x,1),l=this.getScaledValue(a.y,2);this.renderShapeElementBox(a,s,l,e)}else a instanceof Tl&&this.renderGroupShapeElementBox(a,e);else n.containsKey(a.zOrderPosition)||n.add(a.zOrderPosition,a)}if(n.length>0)for(var d=n.keys.sort(),h=0;h<d.length;h++)if((a=n.get(d[h]))instanceof Il)this.renderImageElementBox(a,a.x,a.y,0);else if(a instanceof Pl){var s=this.getScaledValue(a.x,1),l=this.getScaledValue(a.y,2);this.renderShapeElementBox(a,s,l,e)}else a instanceof Tl&&this.renderGroupShapeElementBox(a,e)}},i.prototype.isOverLappedShapeWidget=function(e){return e instanceof Il&&"Inline"!==e.textWrappingStyle&&"Behind"!==e.textWrappingStyle&&!("Word2013"!==this.documentHelper.compatibilityMode&&e.isBelowText&&"InFrontOfText"!==e.textWrappingStyle)||(e instanceof Pl||e instanceof Tl)&&"Inline"!==e.textWrappingStyle&&"Behind"!==e.textWrappingStyle&&!("Word2013"!==this.documentHelper.compatibilityMode&&e.isBelowText&&"InFrontOfText"!==e.textWrappingStyle)},i.prototype.renderGroupShapeElementBox=function(e,t){for(var i=0;i<e.childWidgets.length;i++){var r=e.childWidgets[i];if(r instanceof Tl)this.renderGroupShapeElementBox(r,t);else if(r instanceof Il)this.renderImageElementBox(r,r.x,r.y,0);else if(r instanceof Pl){var n=this.getScaledValue(r.x,1),o=this.getScaledValue(r.y,2);this.renderShapeElementBox(r,n,o,t)}}},i.prototype.renderShapeElementBox=function(e,i,r,n){var o=0===e.height,a=e.autoShapeType,s=e.textFrame.childWidgets;this.pageContext.beginPath();var l=this.pageContext.globalAlpha;e.fillFormat&&e.fillFormat.color&&e.fillFormat.fill&&"StraightConnector"!==a?(this.pageContext.globalAlpha=1,this.pageContext.fillStyle=e.fillFormat.color,"Rectangle"===a?this.pageContext.fillRect(i,r,this.getScaledValue(e.width),this.getScaledValue(e.height)):this.renderPathElement(e,i,r)):e.fillFormat&&e.fillFormat.color&&"Oval"===a&&(this.pageContext.fillStyle=e.fillFormat.color,this.renderPathElement(e,i,r)),this.pageContext.globalAlpha=l,t.isNullOrUndefined(a)||e.lineFormat.line&&"None"!==e.lineFormat.lineFormatType&&(this.pageContext.lineWidth=e.lineFormat.weight,this.pageContext.strokeStyle=bs.getColor(e.lineFormat.color),this.setShapeLineDash(e),"Rectangle"===a?this.pageContext.strokeRect(i,r,this.getScaledValue(e.width),this.getScaledValue(e.height)):"StraightConnector"===a&&(this.pageContext.moveTo(i,r),this.pageContext.lineTo(i+this.getScaledValue(e.width),r+this.getScaledValue(e.height)),this.pageContext.stroke()),this.pageContext.setLineDash([])),this.pageContext.closePath();var d=!1;0!=e.width&&0!=e.height&&(d=!0,this.clipRect(e.x,e.y,this.getScaledValue(e.width),this.getScaledValue(e.height)));for(var h=0;h<s.length;h++)this.renderWidget(n,s[h]),o&&"StraightConnector"!==a&&(e.height=bs.round(e.height+s[h].height,5));o&&(o=!1),d&&this.pageContext.restore()},i.prototype.renderPathElement=function(e,t,i){var r;if(e.autoShapeType&&"Unknown"!=e.autoShapeType)switch(e.autoShapeType){case"ElbowConnector":r=this.getConnectorPathData(e);break;case"CurvedConnector":r=this.getCurvedPathData(e);break;default:r=this.getShape(e.autoShapeType)}else e.autoShapeType&&(r=this.constructPath(e));if(r){var n=this.calculatePathBounds(r),o=this.updatePath(r,n,e);this.drawPath(o,e,t,i)}},i.prototype.renderWidget=function(e,t){if(this.documentHelper.enableLockAndEdit&&this.renderLockRegionBorder(e,t),"Word2003"===this.documentHelper.compatibilityMode)if(t instanceof Qs){if(!1===t.isRender)return}else if(t instanceof el&&!1===t.isRender)return;t instanceof Qs?this.renderParagraphWidget(e,t):this.renderTableWidget(e,t)},i.prototype.getConnectorPathData=function(e){var t=e.distanceTop,i=e.distanceLeft,r=e.distanceTop+this.getScaledValue(e.width),n=e.distanceLeft+this.getScaledValue(e.height),o=t+(r-t)/2,a="M "+t+","+i+" ";return a+="L "+o+","+i+" ",a+="L "+o+","+n+" ",a+="L "+r+","+n},i.prototype.getCurvedPathData=function(e){var t=e.distanceTop,i=e.distanceLeft,r=e.distanceTop+this.getScaledValue(e.width),n=e.distanceLeft+this.getScaledValue(e.height);return"M "+t+","+i+" C "+(t+this.getScaledValue(e.width)/1.5)+","+i+" "+(r-this.getScaledValue(e.width)/1.5)+","+n+" "+r+","+n},i.prototype.constructPath=function(e){var t=e.editingPoints,i={};for(var r in t)t.hasOwnProperty(r)&&(i[r]=this.calculateCoord(t[r],400,400));return"\n M "+i.connsiteX0+","+i.connsiteY0+"\n L "+i.connsiteX1+","+i.connsiteY1+"\n L "+i.connsiteX2+","+i.connsiteY2+"\n L "+i.connsiteX3+","+i.connsiteY3+"\n L "+i.connsiteX4+","+i.connsiteY4+"\n Z\n "},i.prototype.calculateCoord=function(e,t,i){var r=e.split(" "),n=r[0],o=parseFloat(r[1]),a="w"===r[2]?t:i,s=parseFloat(r[3]);return"*/"===n?o/s*a:0},i.prototype.drawPath=function(e,t,i,r){var o=[];o=g(o=n(e)),this.setStyle(t);var a=this.pageContext;a.translate&&(a.save(),a.beginPath(),a.translate(i,r),this.renderPath(a,o),a.fill(),t.lineFormat.line&&"None"!==t.lineFormat.lineFormatType&&(a.translate(-i,-r),a.stroke()),a.restore(),a.setLineDash([]))},i.prototype.renderPath=function(e,t){var i,r,n,o,a,s,l,d,h,c,g=e,p=t;for(l=0,d=0,c=0,h=p.length;c<h;++c){var u=p[parseInt(c.toString(),10)],f=u.command;switch("x1"in u&&(n=u.x1),"x2"in u&&(a=u.x2),"y1"in u&&(o=u.y1),"y2"in u&&(s=u.y2),"x"in u&&(l=u.x),"y"in u&&(d=u.y),f){case"M":g.moveTo(l,d),u.x=l,u.y=d;break;case"L":g.lineTo(l,d),u.x=l,u.y=d;break;case"C":g.bezierCurveTo(n,o,a,s,l,d),u.x=l,u.y=d,u.x1=n,u.y1=o,u.x2=a,u.y2=s;break;case"Q":g.quadraticCurveTo(n,o,l,d),u.x=l,u.y=d,u.x1=n,u.y1=o;break;case"A":var m={x:i,y:r},y=u.r1,v=u.r2,W=u.angle*(Math.PI/180),b=u.largeArc,x=u.sweep,w={x:l,y:d},F={x:Math.cos(W)*(m.x-w.x)/2+Math.sin(W)*(m.y-w.y)/2,y:-Math.sin(W)*(m.x-w.x)/2+Math.cos(W)*(m.y-w.y)/2},C=Math.pow(F.x,2)/Math.pow(y,2)+Math.pow(F.y,2)/Math.pow(v,2);C>1&&(y*=Math.sqrt(C),v*=Math.sqrt(C));var P=Math.pow(v,2)*Math.pow(F.x,2),T=(b===x?-1:1)*Math.sqrt((Math.pow(y,2)*Math.pow(v,2)-Math.pow(y,2)*Math.pow(F.y,2)-P)/(Math.pow(y,2)*Math.pow(F.y,2)+Math.pow(v,2)*Math.pow(F.x,2)));isNaN(T)&&(T=0);var O={x:T*y*F.y/v,y:T*-v*F.x/y},S={x:(m.x+w.x)/2+Math.cos(W)*O.x-Math.sin(W)*O.y,y:(m.y+w.y)/2+Math.sin(W)*O.x+Math.cos(W)*O.y},N=this.a([1,0],[(F.x-O.x)/y,(F.y-O.y)/v]),I=[(F.x-O.x)/y,(F.y-O.y)/v],k=[(-F.x-O.x)/y,(-F.y-O.y)/v],A=this.a(I,k);this.r(I,k)<=-1&&(A=Math.PI),this.r(I,k)>=1&&(A=0);var L=N+(x?1:-1)*(A/2);Math.cos(L),Math.sin(L);if(u.centp=S,u.xAxisRotation=W,u.rx=y,u.ry=v,u.a1=N,u.ad=A,u.sweep=x,null!=g){var U=y>v?y:v,B=y>v?1:y/v,H=y>v?v/y:1;g.save(),g.translate(S.x,S.y),g.rotate(W),g.scale(B,H),g.arc(0,0,U,N,N+A,!x),g.scale(1/B,1/H),g.rotate(-W),g.translate(-S.x,-S.y),g.restore()}break;case"Z":case"z":g.closePath(),l=i,d=r}i=l,r=d}},i.prototype.m=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2))},i.prototype.r=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(this.m(e)*this.m(t))},i.prototype.a=function(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(this.r(e,t))},i.prototype.updatePath=function(e,t,i){var r=!1,a="",s=-t.x,h=-t.y,c=[];return this.getScaledValue(i.width)===t.width&&this.getScaledValue(i.height)===t.height||(s=this.getScaledValue(i.width)/Number(t.width?t.width:1),h=this.getScaledValue(i.height)/Number(t.height?t.height:1),r=!0),c=n(e),c=l(c),a=r?d(c,s,h,r,t.x,t.y,0,0):o(c),r=!1,a},i.prototype.calculatePathBounds=function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","svg");document.body.appendChild(t);var i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttribute("d",e),t.appendChild(i);var r=i.getBBox();return t.remove(),new zs(r.x,r.y,r.width,r.height)},i.prototype.setStyle=function(e){var t=this.pageContext;"none"===e.lineFormat.color&&(e.lineFormat.color="transparent"),t.strokeStyle=bs.getColor(e.lineFormat.color),t.lineWidth=e.lineFormat.weight,0===e.lineFormat.weight&&(t.strokeStyle="transparent"),this.setShapeLineDash(e)},i.prototype.setShapeLineDash=function(e){var t=e.lineFormat.weight,i=3*t,r=[];switch(e.lineFormat.dashStyle){case"Dot":r=[1.25*t,t];break;case"DotGEL":r=[4.5*t,3*t];break;case"Dash":r=[4*t,1.5*t];break;case"DashGEL":r=[4.5*t,3.5*t];break;case"DashDot":case"DashDotGEL":r=[4.5*t,1.25*i,t,1.25*i];break;case"DashDotDot":r=[4.5*t,i,t,i,t,i];break;case"LongDashGEL":r=[9*t,i];break;case"LongDashDotGEL":r=[9.5*t,1.25*i,t,1.25*i];break;case"LongDashDotDotGEL":r=[9.5*t,i,t,1.25*i,t,1.25*i]}this.pageContext.setLineDash(t>0?r:[])},i.prototype.renderLockRegionBorder=function(e,i){if(!i.isInsideTable&&i instanceof Js&&i.locked){var r=this.documentHelper.documentEditorSettings.collaborativeEditingSettings,n=e.bodyWidgets[0].sectionFormat,o=bs.convertPointToPixel(n.leftMargin)-5,a=n.pageWidth-n.leftMargin-n.rightMargin;a=bs.convertPointToPixel(a)+10,this.viewer instanceof Ms&&(o=i.x-5,a=(this.documentHelper.visibleBounds.width-5*this.viewer.padding.right)/this.documentHelper.zoomFactor);var s=i.previousRenderedWidget,l=i.nextRenderedWidget,d=i.lockedBy===this.documentHelper.editorProperties.currentUser?r.editableRegionColor:r.lockedRegionColor,h=i.y,c=i.y+i.height;this.renderSingleBorder(d,o,h,o,c,1,"Single"),!t.isNullOrUndefined(s)&&s.locked&&i.lockedBy===s.lockedBy||this.renderSingleBorder(d,o,h,o+a,h,1,"Single"),this.renderSingleBorder(d,o+a,h,o+a,c,1,"Single"),!t.isNullOrUndefined(l)&&l.locked&&i.lockedBy===l.lockedBy||this.renderSingleBorder(d,o,c,o+a,c,1,"Single")}},i.prototype.renderHeader=function(e,i,r){if(!t.isNullOrUndefined(r)){e.viewer.updateClientArea(e.bodyWidgets[0],e);var n=!1;i.containerWidget instanceof Ys&&i.containerWidget.sectionFormat.columns.length>1&&(n=!0);var o=n?i.containerWidget.y:e.viewer.clientArea.y,a=r.ownerTable.getSplitWidgets()[0];if(0!==a.childWidgets.length&&-1===i.childWidgets.indexOf(r)){var s=a.clone(!0);this.documentHelper.isEditorModule&&this.documentHelper.editorProperties.constructRevisionsForTable(s,!0),s.childWidgets=[],e.viewer.updateClientAreaLocation(s,new zs(n?i.x:e.viewer.clientArea.x,o,s.width,s.height)),this.updateTableHeaderRows(r,s,e,o,n?i.x:e.viewer.clientArea.x,n),this.isRenderHeader=!0;for(var l=0;l<s.childWidgets.length;l++){for(var d=s.childWidgets[l],h=void 0,c=0;c<d.childWidgets.length;c++)h=d.childWidgets[c],this.renderTableCellWidget(e,h);o+=d.height}this.isRenderHeader=!1,i.y!==o&&e.documentHelper.layout.updateChildLocationForTable(o,i,void 0,!1,n)}}},i.prototype.updateClonedRowLocation=function(e,t,i,r){for(var n=[],o=0;o<t.childWidgets.length;o++)n.push(t.childWidgets[o].x);if(e.documentHelper.layout.updateChildLocationForRow(i,t,void 0,!1,r),r&&0!==t.childWidgets.length)for(var a=t.x+t.childWidgets[0].margin.left-n[0],o=0;o<t.childWidgets.length;o++){var s=t.childWidgets[o];s.x=n[o]+a;for(var l=0;l<s.childWidgets.length;l++)e.documentHelper.layout.shiftXPosition(s.childWidgets[l],a)}},i.prototype.updateTableHeaderRows=function(e,i,r,n,o,a){for(var s=e.ownerTable,l=1,d=0;d<s.childWidgets.length;d++){var h=s.childWidgets[d];if(h.rowFormat.isHeader){var c=h.clone(!0);if(this.documentHelper.isEditorModule&&this.documentHelper.editorProperties.constructRevisionFromID(c.rowFormat),i.childWidgets.push(c),c.containerWidget=i,r.viewer.updateClientAreaLocation(c,new zs(o,n,c.width,c.height)),this.updateClonedRowLocation(r,c,n,a),n+=c.height,h==e){for(var g=0;g<e.childWidgets.length;g++){var p=e.childWidgets[g];l=Math.max(l,p.cellFormat.rowSpan)}if(l>1&&d+l<s.childWidgets.length)for(var u=1;u<l;u++){var f=s.childWidgets[d+u];if(!t.isNullOrUndefined(f)){var m=f.clone();this.documentHelper.isEditorModule&&this.documentHelper.editorProperties.constructRevisionFromID(m.rowFormat),i.childWidgets.push(m),m.containerWidget=i,r.viewer.updateClientAreaLocation(m,new zs(o,n,m.width,m.height)),this.updateClonedRowLocation(r,m,n,a),n+=m.height}}}}}},i.prototype.renderParagraphWidget=function(e,i){if(!this.isFieldCode||!i.isFieldCodeBlock){var r=i.y,n=i.x,o=!1,a=i.firstChild,s=0;if(!t.isNullOrUndefined(a))for(d=0;d<a.children.length;d++){var l=a.children[d];if(l instanceof hl){s=l.padding.left;break}}s>0&&(this.clipRect(i.x+s,this.getScaledValue(e.boundingRectangle.y),this.getScaledValue(e.boundingRectangle.width),this.getScaledValue(e.boundingRectangle.height)),o=!0),i.containerWidget instanceof Xs&&i.containerWidget.isEmpty&&!this.documentHelper.isSelectionInHeaderFooter||this.renderParagraphBorder(e,i),o&&this.pageContext.restore();for(var d=0;d<i.childWidgets.length;d++){var h=i.childWidgets[d];r+=h.marginTop,!h.isFirstLine()&&i.previousRenderedWidget&&i.previousRenderedWidget instanceof Qs&&this.documentHelper.layout.isMergedWithNextParagraph(i.previousRenderedWidget)&&(n=e.viewer.clientArea.x),this.renderLine(h,e,n,r),r+=h.height}}},i.prototype.renderParagraphBorder=function(e,i){for(var r=i.paragraphFormat.borders.left,n=i.paragraphFormat.borders.top,o=i.paragraphFormat.borders.right,a=i.paragraphFormat.borders.bottom,s=0,l=0,d=0,h=0,c=0,g=i.firstChild,p=i.lastChild,u=this.getBottomMargin(i),f=0,m=0;m<i.childWidgets.length;m++)f+=i.childWidgets[m].height;var y=Number(i.height.toFixed(2));(f=Number(f.toFixed(2)))>y&&(u-=f-y);var v=this.documentHelper.canRenderBorder(i);if(t.isNullOrUndefined(r)||"None"===r.lineStyle||(s=this.documentHelper.getParagraphLeftPosition(i)-bs.convertPointToPixel(r.space+r.lineWidth),i.containerWidget instanceof Ol&&(W=i.containerWidget.containerShape).x>s&&(s+=bs.convertPointToPixel(r.lineWidth)),d=s,h=l+i.height,h="None"!==n.lineStyle&&g.isFirstLine()&&!v.skipTopBorder?(l=i.y+this.getTopMargin(i)-bs.convertPointToPixel(n.lineWidth+n.space))+i.height-(this.getTopMargin(i)-bs.convertPointToPixel(n.lineWidth+n.space)):(l=i.y)+i.height,"None"!==a.lineStyle&&p.isLastLine()&&!v.skipBottomBorder&&(h=h+bs.convertPointToPixel(a.lineWidth+a.space)-u),c=bs.convertPointToPixel(r.lineWidth),this.renderSingleBorder(r.color,s,l,d,h,c,r.lineStyle)),t.isNullOrUndefined(n)||"None"===n.lineStyle||!g.isFirstLine()||v.skipTopBorder||(d=(s=this.documentHelper.getParagraphLeftPosition(i))+this.getContainerWidth(i,e),h=l=i.y+this.getTopMargin(i)-bs.convertPointToPixel(n.lineWidth+n.space),"None"!==r.lineStyle&&(s-=bs.convertPointToPixel(r.space+r.lineWidth)),"None"!==o.lineStyle&&(d+=bs.convertPointToPixel(o.space+o.lineWidth)),c=bs.convertPointToPixel(n.lineWidth),this.renderSingleBorder(n.color,s,l,d,h,c,n.lineStyle)),!t.isNullOrUndefined(o)&&"None"!==o.lineStyle){if(s=this.documentHelper.getParagraphLeftPosition(i)+this.getContainerWidth(i,e)+bs.convertPointToPixel(o.space+o.lineWidth),i.containerWidget instanceof Ol){var W=i.containerWidget.containerShape;W.x+W.width<s&&(s-=bs.convertPointToPixel(o.lineWidth))}d=s,h=(l=h)+i.height,h="None"!==n.lineStyle&&g.isFirstLine()&&!v.skipTopBorder?(l=i.y+this.getTopMargin(i)-bs.convertPointToPixel(n.lineWidth+n.space))+i.height-(this.getTopMargin(i)-bs.convertPointToPixel(n.lineWidth+n.space)):(l=i.y)+i.height,"None"!==a.lineStyle&&p.isLastLine()&&!v.skipBottomBorder&&(h=h+bs.convertPointToPixel(a.lineWidth+a.space)-u),c=bs.convertPointToPixel(o.lineWidth),this.renderSingleBorder(o.color,s,l,d,h,c,o.lineStyle)}t.isNullOrUndefined(a)||"None"===a.lineStyle||!p.isLastLine()||v.skipBottomBorder||(d=(s=this.documentHelper.getParagraphLeftPosition(i))+this.getContainerWidth(i,e),h=l=i.y+i.height+bs.convertPointToPixel(a.lineWidth+a.space)-u,"None"!==r.lineStyle&&(s-=bs.convertPointToPixel(r.space+r.lineWidth)),"None"!==o.lineStyle&&(d+=bs.convertPointToPixel(o.space+o.lineWidth)),c=bs.convertPointToPixel(a.lineWidth),this.renderSingleBorder(a.color,s,l,d,h,c,a.lineStyle))},i.prototype.renderImgBorder=function(e,t,i,r,n,o,a,s){var l=e.width/this.documentHelper.zoomFactor,d=bs.convertPointToPixel(o),h=this.documentHelper.editorProperties.getNextTextElement(e),c=this.documentHelper.editorProperties.getPreviousTextElement(e),g="Subscript"===a?e.margin.top+(e.height-e.height/1.5):e.margin.top;i+=g>0?g:0;var p=e.height/("Normal"===a?1:1.5)+15,u=0,f=0,m=0,y=0;u=t,f=i,m=t+l,y=i,this.renderSingleBorder(r,u,f,m,y,d,n),y=f=i+p,this.renderSingleBorder(r,u,f,m,y,d,n),f=i,m=t,c instanceof hl&&(n=c.line!==e.line||void 0==c.contentControlProperties?"Solid":"None"),this.renderSingleBorder(r,u,f,m,y,d,n),m=u=t+l,n=h instanceof hl?h.line!==e.line||void 0==h.contentControlProperties?"Solid":"None":"Solid",this.renderSingleBorder(r,u,f,m,y,d,n)},i.prototype.getContainerWidth=function(e,t){var i=0;if(e.paragraphFormat.firstLineIndent<0&&(i=Math.abs(e.paragraphFormat.firstLineIndent)),e.isInsideTable){var r=e.associatedCell;return r.width+r.margin.left+r.margin.right-r.leftBorderWidth}if(e.containerWidget instanceof Ol)return e.width;if(this.viewer instanceof Ms){var n=bs.convertPointToPixel(e.leftIndent+e.rightIndent);return(this.documentHelper.visibleBounds.width-n-4*this.viewer.padding.right-2*this.viewer.padding.left)/this.documentHelper.zoomFactor}var o=e.bodyWidget;if(o instanceof Ys&&o.sectionFormat.columns.length>1){var a=o.columnIndex;return o.sectionFormat.columns[a].width+bs.convertPointToPixel(i-(e.rightIndent+e.leftIndent))}var s=o.sectionFormat.pageWidth-o.sectionFormat.leftMargin-o.sectionFormat.rightMargin;return bs.convertPointToPixel(s+i-(e.rightIndent+e.leftIndent))},i.prototype.getTopMargin=function(e){if(e.isEmpty())return e.childWidgets[0].margin.top;var i=e.childWidgets[0],r=0;return t.isNullOrUndefined(i.margin)||(r=i.margin.top),r},i.prototype.getBottomMargin=function(e){var i=e.childWidgets[e.childWidgets.length-1],r=0;return t.isNullOrUndefined(i.margin)||(r=i.margin.bottom),r},i.prototype.renderfootNoteWidget=function(e,i,r){1===i.page.bodyWidgets.length&&(1===i.page.bodyWidgets[0].childWidgets.length&&void 0!=i.page.bodyWidgets[0].childWidgets[0].isEmpty&&i.page.bodyWidgets[0].childWidgets[0].isEmpty()||i.page.bodyWidgets[0].childWidgets.length);var n=this.getFooterHeight(e),o=i.y+i.height;o>n&&(o=n-i.y),this.pageContext.beginPath(),this.pageContext.save(),this.pageContext.rect(this.pageLeft,this.getScaledValue(i.y,2),this.getScaledValue(r),this.getScaledValue(o)),this.pageContext.clip();for(var a=0;a<i.bodyWidgets.length;a++)for(var s=i.bodyWidgets[a],l=s.footNoteReference,d=0;d<s.childWidgets.length;d++){var h=s.childWidgets[d];if(0===a&&0===d){var c=this.pageContext,g=e.bodyWidgets[0].x;if(e.bodyWidgets.length>1&&!t.isNullOrUndefined(s.nextWidget)&&"NoBreak"!==s.nextWidget.sectionFormat.breakCode){var p=e.bodyWidgets[0].width;this.renderSolidLine(c,this.getScaledValue(g,1),this.getScaledValue(i.y+i.margin.top/2+1,2),p*this.documentHelper.zoomFactor,"#000000")}else{var u=!1;if(this.documentHelper.footnotes.separator.length>0&&this.documentHelper.footnotes.separator[0]instanceof Qs){var f=this.documentHelper.footnotes.separator[0];(f.paragraphFormat.bidi||"Right"===f.paragraphFormat.textAlignment)&&(u=!0)}var m=u?g+e.bodyWidgets[0].width-210*this.documentHelper.zoomFactor:g;this.renderSolidLine(c,this.getScaledValue(m,1),this.getScaledValue(i.y+i.margin.top/2+1,2),210*this.documentHelper.zoomFactor,"#000000")}}if(!t.isNullOrUndefined(l)&&!t.isNullOrUndefined(this.documentHelper.editorProperties)&&!this.documentHelper.editorProperties.isFootNoteInsert){var y=this.documentHelper.getFirstParagraphBlock(h);if(y.firstChild.children[0]instanceof hl){var v=y.firstChild.children[0];""===v.text&&(v.text=v.text.replace(v.text,l.text),v.width=l.width)}}this.renderWidget(e,h)}this.pageContext.restore()},i.prototype.renderTableWidget=function(e,i){if(!this.isFieldCode&&!t.isNullOrUndefined(i))for(var r=0;r<i.childWidgets.length;r++){var n=i.childWidgets[r];if(this.renderTableRowWidget(e,n),i.tableFormat.cellSpacing>0&&this.renderTableOutline(e,i),n.isRenderBookmarkEnd&&this.documentHelper.documentEditorSettings.showBookmarks){var o=n.lastChild,a=o.ownerTable.isBidiTable?il.getCellLeftBorder(o):il.getCellRightBorder(o),s=bs.convertPointToPixel(a.getLineWidth()),l=this.documentHelper.editorProperties.getLastParagraph(n.lastChild),d=l.lastChild.height-l.lastChild.margin.bottom;this.renderBookmark(this.getScaledValue(o.x+o.width+o.margin.right-s/2+this.documentHelper.textHelper.getParagraphMarkWidth(l.characterFormat),1),this.getScaledValue(o.y-o.margin.top,2),this.getScaledValue(d),1)}}},i.prototype.renderTableRowWidget=function(e,t){for(var i=0;i<t.childWidgets.length;i++){var r=t.childWidgets[i];if(this.renderTableCellWidget(e,r),r.isRenderBookmarkEnd&&this.documentHelper.documentEditorSettings.showBookmarks){var n=this.documentHelper.editorProperties.getLastParagraph(r),o=n.lastChild,a=this.documentHelper.editorProperties.getEndPosition(n),s=n.y+o.margin.top;this.renderBookmark(this.getScaledValue(a.x,1),this.getScaledValue(s,2),this.getScaledValue(o.height-(o.margin.bottom+o.margin.top))-2,1)}}},i.prototype.renderTableCellWidget=function(e,i){if(!this.isPrinting&&!this.isExporting){var r=0,n=0;if(r=i.margin.top-i.containerWidget.topBorderWidth,n=i.margin.bottom-i.containerWidget.bottomBorderWidth,(this.getScaledValue(i.y,2)+i.height+n*this.documentHelper.zoomFactor<0||this.getScaledValue(i.y,2)-r>this.documentHelper.visibleBounds.height)&&!this.documentHelper.isSpellCheck)return}this.renderSelectionHighlightOnTable(e,i),this.renderTableCellOutline(e.documentHelper,i);for(var o=0;o<i.childWidgets.length;o++){var a=i.childWidgets[o],s=i.width+i.margin.left+i.margin.right-i.leftBorderWidth;this.isPrinting||a instanceof el&&s===a.width&&"Word2007"===this.documentHelper.compatibilityMode||this.clipRect(i.x-i.margin.left,i.y,this.getScaledValue(s),this.height),this.renderWidget(e,a),this.pageContext.restore()}if(i.isRenderEditRangeStart){var l=this.documentHelper.editorProperties.getFirstParagraph(i).firstChild,d=l.paragraph.x;l.children.length>0&&!t.isNullOrUndefined(l.children[0].margin)&&l.children[0].margin.left>0&&(d+=l.children[0].margin.left);var h=l.paragraph.y;if(this.documentHelper.documentEditorSettings.highlightEditableRanges){var c=this.documentHelper.editorProperties.editRegionHighlighters,g=t.isNullOrUndefined(c)?[]:c.get(l),p=t.isNullOrUndefined(g)||t.isNullOrUndefined(g[0])?"ffff00":g[0].color;this.renderBookmark(this.getScaledValue(d,1),this.getScaledValue(h,2),this.getScaledValue(l.height-l.margin.bottom),0,p)}}},i.prototype.isSameLinePositionInTextFrame=function(e,t){var i=e.paragraph,r=t.paragraph;return!(i.containerWidget instanceof Ol&&r.containerWidget instanceof Ol)||i.childWidgets.indexOf(e)===r.childWidgets.indexOf(t)&&i.containerWidget.childWidgets.indexOf(i)===r.containerWidget.childWidgets.indexOf(r)},i.prototype.checkHeaderFooterLineWidget=function(e,i){var r;if(e instanceof rl?r=e.paragraph.bodyWidget:e instanceof il&&(r=e.bodyWidget),!t.isNullOrUndefined(r.parentHeaderFooter)){r=r.parentHeaderFooter;for(var n=0;n<i.length;n++){var o=i[n];if(o instanceof rl&&e instanceof rl){var a=o.getHierarchicalIndex(""),s=e.getHierarchicalIndex("");if(o.paragraph.isInHeaderFooter&&r===o.paragraph.bodyWidget&&a.substring(a.indexOf(";"))===s.substring(s.indexOf(";"))&&this.isSameLinePositionInTextFrame(o,e))return o}else if(o instanceof il&&e instanceof il){var a=o.getHierarchicalIndex(""),s=e.getHierarchicalIndex("");if(o.ownerTable.isInHeaderFooter&&r===o.ownerTable.bodyWidget&&a.substring(a.indexOf(";"))===s.substring(s.indexOf(";")))return o}}}},i.prototype.renderContentControlBorder=function(e,i,r){if(this.documentHelper.isEditorModule&&!t.isNullOrUndefined(e.documentHelper.editorProperties.contentControleditRegionHighlighters)){var n=e.documentHelper.editorProperties.contentControls;if(!t.isNullOrUndefined(n))for(var o=0;o<n.length;o++){var a=n[o],s=this.documentHelper.editorProperties.contentControleditRegionHighlighters.get(a);if(!t.isNullOrUndefined(s)){this.documentHelper.editorProperties.enableHeaderAndFooter&&(a.paragraph.containerWidget instanceof il?this.documentHelper.editorProperties.getContainerWidget(a.paragraph.containerWidget):a.paragraph.containerWidget)==(i.paragraph.containerWidget instanceof il?this.documentHelper.editorProperties.getContainerWidget(i.paragraph.containerWidget):i.paragraph.containerWidget).parentHeaderFooter&&a.paragraph.index==i.paragraph.index&&a.line.indexInOwner==i.indexInOwner&&(i=a.line);var l=s.keys.indexOf(i);if(-1!==l){var d=a.contentControlProperties.color;"#00000000"===d&&(d="#939393");for(var h=s.get(i),c=0;c<h.length;c++){var g=i.paragraph,p=0,u=g.firstChild===i?bs.convertPointToPixel(g.paragraphFormat.firstLineIndent):0,f=bs.convertPointToPixel(g.leftIndent);-1!==g.paragraphFormat.listFormat.listId&&(u=0),a.line===i&&(g.x+u!==h[c].left||a.reference&&a.reference.line===i)&&(u=0,f=0),p=h[c].left-f-u-2;var m=h[c].left+h[c].width+2;s.length-1>l&&(m=this.documentHelper.getParagraphLeftPosition(g)+this.getContainerWidth(g,e)+bs.convertPointToPixel(g.paragraphFormat.borders.right.space));var y=r,v=r+i.height;if(this.renderSingleBorder(d,p,y,p,v,1,"single"),0===l||i===a.line)this.renderSingleBorder(d,p,y,m,y,1,"single"),(1===s.length||t.isNullOrUndefined(g.nextWidget)&&i===g.lastChild)&&this.renderSingleBorder(d,p,v,m,v,1,"single");else if(i!==a.line&&i!==a.reference.line){if(t.isNullOrUndefined(g.previousWidget)&&i===g.firstChild)this.renderSingleBorder(d,p,y,m,y,1,"single");else if("Block"!==a.contentControlWidgetType){W=s.get(s.keys[l-1]);this.renderSingleBorder(d,p,y,W[c].left-2,y,1,"single")}t.isNullOrUndefined(g.nextWidget)&&i===g.lastChild&&(m=this.documentHelper.getParagraphLeftPosition(g)+this.getContainerWidth(g,e)+bs.convertPointToPixel(g.paragraphFormat.borders.right.space),this.renderSingleBorder(d,p,v,m,v,1,"single"))}else if(l===s.length-1&&i===a.reference.line){var W=s.get(s.keys[l-1]);t.isNullOrUndefined(g.previousWidget)&&i===g.firstChild?(m=this.documentHelper.getParagraphLeftPosition(g)+this.getContainerWidth(g,e)+bs.convertPointToPixel(g.paragraphFormat.borders.right.space),this.renderSingleBorder(d,p,y,m,y,1,"single")):p>W[c].left&&this.renderSingleBorder(d,W[c].left-2,y,p,y,1,"single");var b=g.lastChild;if(t.isNullOrUndefined(b)||t.isNullOrUndefined(e.nextPage)&&t.isNullOrUndefined(g.nextWidget)||i!==b||!(b.children[b.children.length-1]instanceof yl)||b.children[b.children.length-1]!==a.reference||"Block"!==a.contentControlWidgetType){if(this.renderSingleBorder(d,p,v,m,v,1,"single"),s.length>1){var x=s.get(s.keys[l-1]),w=this.documentHelper.getParagraphLeftPosition(g)+this.getContainerWidth(g,e)+bs.convertPointToPixel(g.paragraphFormat.borders.right.space),F=!1;1===l&&m<x[c].left-2&&(F=!0),this.renderSingleBorder(d,F?x[c].left-2:m,y,w,y,1,"single"),p<x[c].left-2&&"Block"!==a.contentControlWidgetType&&this.renderSingleBorder(d,F?m:x[c].left-2,y,p,y,1,"single")}}else m=this.documentHelper.getParagraphLeftPosition(g)+this.getContainerWidth(g,e)+bs.convertPointToPixel(g.paragraphFormat.borders.right.space),this.renderSingleBorder(d,p,v,m,v,1,"single")}if(this.renderSingleBorder(d,m,y,m,v,1,"single"),i===a.reference.line&&!t.isNullOrUndefined(a)&&("ComboBox"===a.contentControlProperties.type||"DropDownList"===a.contentControlProperties.type||"Date"===a.contentControlProperties.type)){var C=this.documentHelper.element.querySelector("#contenticon");if(C)C.style.display="block",p=this.getScaledValue(m,1),y=this.getScaledValue(y,2),C.style.left=p+"px",C.style.top=y+"px",C.style.border="0.5px solid #7F7F7F",C.style.backgroundColor="#D3D3D3",C.style.height=i.height+"px";else{var P=document.createElement("div");P.id="contenticon",P.style.display="block",P.style.position="sticky",p=this.getScaledValue(m,1),y=this.getScaledValue(y,2),P.style.left=p+"px",P.style.top=y+"px",P.style.border="0.5px solid #7F7F7F",P.style.backgroundColor="#D3D3D3",P.style.height=i.height+"px",P.classList.add("e-de-cmt-mark");var T=document.createElement("span");T.classList.add("e-icons"),T.classList.add("e-chevron-down-fill"),P.appendChild(T),this.documentHelper.pageContainer.appendChild(P)}}}}}}}},i.prototype.renderEditRegionHighlight=function(e,i,r){if(!this.isPrinting&&!t.isNullOrUndefined(e.documentHelper.editorProperties.editRegionHighlighters)){var n=this.documentHelper.editorProperties.editRegionHighlighters.containsKey(i);if(!n&&i.paragraph.isInHeaderFooter){var o=this.documentHelper.editorProperties.editRegionHighlighters.keys;i=this.checkHeaderFooterLineWidget(i,o),t.isNullOrUndefined(i)||(n=!0)}if(n)for(var a=this.documentHelper.editorProperties.editRegionHighlighters.get(i),s=0;s<a.length;s++)this.pageContext.fillStyle=""!==a[s].color?a[s].color:"#add8e6",this.pageContext.fillRect(this.getScaledValue(a[s].left,1),this.getScaledValue(r,2),this.getScaledValue(a[s].width),this.getScaledValue(i.height))}},i.prototype.renderSearchHighlight=function(e,i,r){if(this.documentHelper&&!t.isNullOrUndefined(e.documentHelper.editorProperties.searchHighlighters)){var n=e.documentHelper.editorProperties.searchHighlighters.containsKey(i);if(this.validateRemoveSearchHighlighters(e),!n&&i.paragraph.isInHeaderFooter){var o=e.documentHelper.editorProperties.searchHighlighters.keys;i=this.checkHeaderFooterLineWidget(i,o),t.isNullOrUndefined(i)||(n=!0)}if(n)for(var a=e.documentHelper.editorProperties.searchHighlighters.get(i),s=0;s<a.length;s++)this.pageContext.fillStyle=this.documentHelper.documentEditorSettings.searchHighlightColor,this.pageContext.fillRect(this.getScaledValue(a[s].left,1),this.getScaledValue(r,2),this.getScaledValue(a[s].width),this.getScaledValue(i.height))}},i.prototype.validateRemoveSearchHighlighters=function(e){for(var i=e.documentHelper.editorProperties.searchHighlighters.keys,r=i.length-1;r>=0;r--){var n=i[r];n instanceof rl&&!t.isNullOrUndefined(n.paragraph)&&!t.isNullOrUndefined(n.paragraph.containerWidget)||e.documentHelper.editorProperties.searchHighlighters.keys.splice(r,1)}},i.prototype.renderSelectionHighlight=function(e,i,r){if(!this.isPrinting&&e.documentHelper&&!this.documentHelper.editorProperties.isScrollToSpellCheck&&e.documentHelper.editorProperties&&e.documentHelper.editorProperties.selectedWidgets&&e.documentHelper.editorProperties.selectedWidgets.length>0){var n=e.documentHelper.editorProperties.selectedWidgets.containsKey(i);if(!n&&i.paragraph.isInHeaderFooter){var o=e.documentHelper.editorProperties.selectedWidgets.keys;i=this.checkHeaderFooterLineWidget(i,o),t.isNullOrUndefined(i)||(n=!0)}n&&!e.documentHelper.isUpdatedWhileLoadAsync&&e.documentHelper.editorProperties.addSelectionHighlight(this.selectionContext,i,r,e)}},i.prototype.renderSelectionHighlightOnTable=function(e,i){if(!this.isPrinting&&e.documentHelper&&e.documentHelper.editorProperties.selectedWidgets.length>0){var r=e.documentHelper.editorProperties.selectedWidgets.containsKey(i);if(!r&&i.ownerTable.isInHeaderFooter){var n=e.documentHelper.editorProperties.selectedWidgets.keys;i=this.checkHeaderFooterLineWidget(i,n),t.isNullOrUndefined(i)||(r=!0)}r&&e.documentHelper.editorProperties.addSelectionHighlightTable(this.selectionContext,i,e)}},i.prototype.renderLine=function(i,r,n,o){if(!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(i.paragraph)){this.renderSelectionHighlight(r,i,o);var a=i.paragraph.paragraphFormat,s=n;if(i.isFirstLine()&&!a.bidi&&(n+=bs.convertPointToPixel(a.firstLineIndent)),this.documentHelper&&this.documentHelper&&!t.isNullOrUndefined(this.documentHelper.editorProperties.formFieldHighlighters)&&this.documentHelper.editorProperties.formFieldHighlighters.containsKey(i)&&this.documentHelper.documentEditorSettings&&this.documentHelper.documentEditorSettings.formFieldSettings.applyShading)for(var l=r.documentHelper.editorProperties.formFieldHighlighters.get(i),d=0;d<l.length;d++){this.pageContext.fillStyle=this.documentHelper.documentEditorSettings.formFieldSettings.shadingColor;var h=i.height,c=!1;if(i.isLastLine()&&(h-=bs.convertPointToPixel(this.documentHelper.layout.getAfterSpacing(i.paragraph)),i.paragraph.paragraphFormat.lineSpacing>1)){var g=this.getFormfieldInLine(i);if(!t.isNullOrUndefined(g)){var p=this.documentHelper.textHelper.getHeight(g.characterFormat),u=p.Height;"Multiple"===i.paragraph.paragraphFormat.lineSpacingType?h-=bs.convertPointToPixel(this.documentHelper.layout.getLineSpacing(i.paragraph,u,!0)):(o+=bs.convertPointToPixel(i.paragraph.paragraphFormat.beforeSpacing),h=p.Height,c=!0)}}this.pageContext.fillRect(this.getScaledValue(l[d].left,1),this.getScaledValue(o,2),this.getScaledValue(l[d].width),this.getScaledValue(h)),c&&(c=!1,o-=bs.convertPointToPixel(i.paragraph.paragraphFormat.beforeSpacing))}this.renderSearchHighlight(r,i,o),this.renderEditRegionHighlight(r,i,o);var f=[],m=i.renderedElements,y=this.getUnderlineYPosition(i),v=[];!t.isNullOrUndefined(i.paragraph.associatedCell)&&i.paragraph.associatedCell.isRenderBookmarkStart&&i.paragraph.associatedCell.firstChild.firstChild==i&&v.push({x:n,y:o,height:i.height-i.margin.bottom,type:0});for(d=0;d<m.length;d++){var W=m[d];if(!(W instanceof Cl&&"Inline"!==W.textWrappingStyle)){if(W instanceof Jl||W instanceof Ll){var b=0;this.viewer instanceof Es&&(b=this.viewer.pageGap);var x="display:block;position:absolute;",w=this.getScaledValue(o+(r.boundingRectangle.y-b*(r.index+1)))+b*(r.index+1)+"px;";if(W instanceof Ll&&(this.documentHelper.editorProperties.currentUser===W.user||"Everyone"===W.group&&""===W.user)){if(this.documentHelper.documentEditorSettings.highlightEditableRanges&&-1==W.columnFirst){var F=W.line.height-W.line.margin.bottom,C=n;!t.isNullOrUndefined(W.margin)&&W.margin.left>0&&(C+=W.margin.left);var P=o,T=this.documentHelper.editorProperties.editRegionHighlighters,l=t.isNullOrUndefined(T)?[]:T.get(i),O=t.isNullOrUndefined(l)||t.isNullOrUndefined(l[0])?"ffff00":l[0].color;this.renderBookmark(this.getScaledValue(C,1),this.getScaledValue(P,2),this.getScaledValue(i.height-i.margin.bottom),0,O)}if(this.documentHelper.enableLockAndEdit){(ee=new t.L10n("documenteditor",this.documentHelper.defaultLocale)).setLocale(this.documentHelper.locale),this.renderLockMark(W,this.documentHelper.editorProperties.currentUser,ee);var S=this.documentHelper.documentEditorSettings.collaborativeEditingSettings;x+="color:"+(O=W.user===this.documentHelper.editorProperties.currentUser?S.editableRegionColor:S.lockedRegionColor)+";";var N=bs.convertPointToPixel(r.bodyWidgets[0].sectionFormat.leftMargin),I=r.boundingRectangle.x+this.getScaledValue(N-20)+"px;";this.viewer instanceof Ms&&(I=i.paragraph.x-5+"px;"),x=x+"left:"+I+"top:"+w,t.updateCSSText(W.editRangeMark,x)}else if(W.editRangeMark){L="display:none";t.updateCSSText(W.editRangeMark,L)}}else if(W instanceof Jl&&0===W.commentType&&this.documentHelper)if(this.documentHelper.enableComment){var k=bs.convertPointToPixel(r.bodyWidgets[0].sectionFormat.rightMargin),A=bs.convertPointToPixel(r.bodyWidgets[0].sectionFormat.pageWidth),I=r.boundingRectangle.x+this.getScaledValue(A-k+k/4)+"px;";this.viewer instanceof Ms&&(I=r.boundingRectangle.width-2*this.viewer.padding.right-2*this.viewer.padding.left+"px;"),x=x+"left:"+I+"top:"+w,-1!==f.indexOf(W.commentId)||t.isNullOrUndefined(W.comment)||W.comment.isReply||(f.push(W.commentId),W.renderCommentMark(w,I),t.updateCSSText(W.commentMark,x))}else if(W.commentMark){var L="display:none";t.updateCSSText(W.commentMark,L)}}if(W instanceof Al&&!t.isNullOrUndefined(W.editRangeStart)&&(this.documentHelper.editorProperties.currentUser===W.editRangeStart.user||"Everyone"===W.editRangeStart.group&&""===W.editRangeStart.user)&&-1==W.editRangeStart.columnFirst&&this.documentHelper.documentEditorSettings.highlightEditableRanges){var F=W.line.height-W.line.margin.bottom,C=n,P=o,T=this.documentHelper.editorProperties.editRegionHighlighters,l=t.isNullOrUndefined(T)?[]:T.get(i),O=t.isNullOrUndefined(l)||t.isNullOrUndefined(l[0])?"ffff00":l[0].color;this.renderBookmark(this.getScaledValue(C,1),this.getScaledValue(P,2),this.getScaledValue(i.height-i.margin.bottom),1,O)}if(W instanceof ml&&this.documentHelper.documentEditorSettings.showBookmarks&&!bs.startsWith(W.name,"_")){t.isNullOrUndefined(W.line.margin)&&(W.line.margin=new js(0,0,0,0));var F=W.line.height-(W.line.margin.bottom+W.line.margin.top),C=n;!t.isNullOrUndefined(W.margin)&&W.margin.left>0&&(C+=W.margin.left);P=o+W.line.margin.top;if(1==W.bookmarkType){if(this.isBookmarkEndAtStart(W)&&t.isNullOrUndefined(W.properties)){for(var U=W.paragraph,B=void 0,H=!1;!H&&!t.isNullOrUndefined(U);){for(var R=U.childWidgets.indexOf(W.line)>=0?U.childWidgets.indexOf(W.line):U.childWidgets.length-1;R>=0;R--){for(var q=U.childWidgets[R],E=q.children.indexOf(W)>=0?q.children.indexOf(W):q.children.length-1;E>=0;E--){if(this.isRenderable(q.children[E])){B=q.children[E],H=!0;break}if(q.children[E]instanceof ml&&0===q.children[E].bookmarkType&&q.children[E].name===W.name){H=!0;break}}if(H)break}H||(U=this.documentHelper.editorProperties.getPreviousParagraphBlock(U))}t.isNullOrUndefined(B)||(U.containerWidget instanceof il?C+=U.x+this.documentHelper.editorProperties.getWidth(B.line,!1)+this.documentHelper.textHelper.getParagraphMarkWidth(W.line.paragraph.characterFormat):t.isNullOrUndefined(U.paragraphFormat.listFormat.list)?C+=this.documentHelper.editorProperties.getWidth(B.line,!1)+this.documentHelper.textHelper.getParagraphMarkWidth(W.line.paragraph.characterFormat):C=U.x+this.documentHelper.editorProperties.getWidth(B.line,!1)+this.documentHelper.textHelper.getParagraphMarkWidth(W.line.paragraph.characterFormat),P=this.documentHelper.editorProperties.getTop(B.line)+B.line.margin.top)}t.isNullOrUndefined(W.properties)||(W.properties.isAfterParagraphMark&&(C+=this.documentHelper.textHelper.getParagraphMarkWidth(W.line.paragraph.characterFormat)),W.properties.isAfterCellMark&&(C+=this.documentHelper.textHelper.getWidth(String.fromCharCode(164),i.paragraph.characterFormat)))}if(1==W.bookmarkType){if(!t.isNullOrUndefined(W.reference))if(t.isNullOrUndefined(W.reference.properties))this.documentHelper.editorProperties.isRenderBookmarkAtEnd(W)||v.push({x:C,y:P,height:F,type:W.bookmarkType});else{var M=W.paragraph.associatedCell;t.isNullOrUndefined(M)&&v.push({x:C,y:P,height:F,type:W.bookmarkType})}}else t.isNullOrUndefined(W.properties)&&v.push({x:C,y:P,height:F,type:W.bookmarkType})}if(W instanceof ol||this.isFieldCode||0===W.width&&0===W.height){var V=W.width;this.isFieldCode&&(W instanceof Il||(W.width=0),V=0),n+=V+W.margin.left,this.toSkipFieldCode(W)}else if(this.isPrinting||!(this.getScaledValue(o+W.margin.top,2)+W.height*this.documentHelper.zoomFactor<0||this.getScaledValue(o+W.margin.top,2)>this.documentHelper.visibleBounds.height)||(n+=W.width+W.margin.left,W instanceof hl&&(this.documentHelper.isSpellCheck&&(W.canTrigger=!0),W.isVisible=!1,(!W.isSpellChecked&&!W.isSpellCheckTriggered||W.line.paragraph.isChangeDetected)&&(W.isChangeDetected=!0)),this.isExporting)){if(W instanceof kl)n+=W.padding.left,this.renderListTextElementBox(W,n,o,y);else if(W instanceof Il)n+=W.padding.left,this.renderImageElementBox(W,n,o,y);else if(W instanceof Pl){var D=W.margin.left,z=W.margin.top,_=this.getScaledValue(n+D,1),j=this.getScaledValue(o+z,2);this.renderShapeElementBox(W,_,j,r)}else W instanceof Tl?this.renderGroupShapeElementBox(W,r):(W.isVisible=!0,n+=W.padding.left,this.renderTextElementBox(W,n,o,y));n+=W.width+W.margin.left,i.paragraph.bidi?s+=W.margin.left:s=n}}}if(this.renderContentControlBorder(r,i,o),this.documentHelper.documentEditorSettings.showBookmarks&&v.length>0)for(d=0;d<v.length;d++){var G=v[d];this.renderBookmark(this.getScaledValue(G.x,1),this.getScaledValue(G.y,2),this.getScaledValue(G.height)-2,G.type)}var K=!1,Y=i.paragraph.paragraphFormat,X=i.paragraph.isInHeaderFooter&&i.paragraph.isEmpty()&&t.isNullOrUndefined(i.paragraph.nextWidget)&&t.isNullOrUndefined(i.paragraph.previousWidget);if(K=this.documentHelper.editorProperties.enableHeaderAndFooter||!X||X&&!t.isNullOrUndefined(Y.uniqueParagraphFormat),this.documentHelper.documentEditorSettings.showHiddenMarks&&!this.isPrinting){var J="",Z=i.paragraph.characterFormat,Q=0,$=this.retriveCharacterformat(Z),ee=new t.L10n("documenteditor",this.documentHelper.defaultLocale);ee.setLocale(this.documentHelper.locale),this.pageContext.fillStyle=bs.getColor(Z.fontColor);if(!i.paragraph.bodyWidget||i.paragraph.bodyWidget instanceof Xs||this.documentHelper.pages.indexOf(i.paragraph.bodyWidget.page),0!=m.length||i.isEndsWithLineBreak||t.isNullOrUndefined(i.paragraph)?Q=1===i.paragraph.childWidgets.length&&0==i.maxBaseLine?o+this.documentHelper.textHelper.getHeight(Z).BaselineOffset+(t.isNullOrUndefined(i.margin)?0:i.margin.top):i.margin&&i.margin.top>0?o+i.maxBaseLine+i.margin.top:o+i.maxBaseLine:(Q=i.paragraph.y+this.documentHelper.textHelper.getHeight(Z).BaselineOffset+(t.isNullOrUndefined(i.margin)?0:i.margin.top),!i.isEndsWithLineBreak&&i.indexInOwner>0&&0==m.length&&(Q=o+i.previousLine.maxBaseLine)),Z.revisionLength>0){var te=this.checkRevisionType(Z),O=te.length>0?this.getRevisionColor(te):Z.fontColor;this.pageContext.fillStyle=bs.getColor(O)}if(i.isEndsWithColumnBreak)$=this.retriveCharacterformat(Z,.7),J="....."+ee.getConstant("Column Break")+".....";else if(i.isEndsWithPageBreak){$=this.retriveCharacterformat(Z,.7),J=this.getPageBreakText(i.paragraph,ee);ne=this.documentHelper.textHelper.getWidth(J,Z,e.FontScriptType.English);this.viewer instanceof Es?i.paragraph.bidi?s<ne+this.viewer.clientActiveArea.x&&(J="....."):s>this.viewer.clientActiveArea.width&&(J="....."):i.paragraph.bidi?s-ne<this.viewer.clientActiveArea.x&&(J="....."):s+ne>this.viewer.clientActiveArea.width+this.viewer.clientActiveArea.x&&(J=".....")}else i.isEndsWithLineBreak?J=i.paragraph.bidi?String.fromCharCode(8627):String.fromCharCode(8629):i.paragraph.isInsideTable&&t.isNullOrUndefined(i.nextLine)&&t.isNullOrUndefined(i.paragraph.nextWidget)?0!=i.height&&(J=String.fromCharCode(164)):t.isNullOrUndefined(i.nextLine)&&K&&(J=String.fromCharCode(182));if(i.paragraph.containerWidget instanceof Ys&&!t.isNullOrUndefined(i.paragraph.nextRenderedWidget)&&i.paragraph.containerWidget.sectionIndex!==i.paragraph.nextRenderedWidget.containerWidget.sectionIndex&&i.isLastLine()){J="NoBreak"===i.paragraph.nextRenderedWidget.containerWidget.sectionFormat.breakCode&&i.paragraph.containerWidget.index!==i.paragraph.nextRenderedWidget.containerWidget.index?":::::"+ee.getConstant("Section Break Continuous")+":::::":":::::"+ee.getConstant("Section Break Next Page")+":::::",$=this.retriveCharacterformat(Z,.7);var ie=i.paragraph.previousRenderedWidget;if(ie instanceof Qs&&ie.isEndsWithPageBreak&&i.paragraph.isSectionBreak){var re=this.getPageBreakText(ie,ee);s+=.7*this.documentHelper.textHelper.getWidth(re,ie.characterFormat,e.FontScriptType.English),s-=this.documentHelper.textHelper.getParagraphMarkSize(ie.characterFormat).Width}else i.isEndsWithPageBreak&&(J=i.paragraph.bidi?J+String.fromCharCode(182)+"....."+ee.getConstant("Page Break")+".....":"....."+ee.getConstant("Page Break")+"....."+String.fromCharCode(182)+J);var ne=this.documentHelper.textHelper.getWidth(J,Z,e.FontScriptType.English);this.viewer instanceof Es?i.paragraph.bidi?s<ne+this.viewer.clientActiveArea.x&&(J=":::::",i.isEndsWithPageBreak&&(J=":::::.....")):s+ne-this.viewer.clientActiveArea.x>this.viewer.clientActiveArea.width&&(J=":::::",i.isEndsWithPageBreak&&(J=".....:::::")):i.paragraph.bidi?s-ne<this.viewer.clientActiveArea.x&&(J=":::::",i.isEndsWithPageBreak&&(J=":::::.....")):s+ne-this.documentHelper.pages[0].boundingRectangle.x>this.viewer.clientActiveArea.width&&(J=":::::",i.isEndsWithPageBreak&&(J=".....:::::"))}if(J.length>0&&(!i.paragraph.characterFormat.hidden||0!==i.paragraph.height)){i.paragraph.bidi&&!i.paragraph.isEmpty()&&(s-=this.documentHelper.textHelper.getWidth(J,Z,e.FontScriptType.English)),(a.firstLineIndent>0||a.firstLineIndent<0&&i.paragraph.isEmpty()&&K)&&(s=n),this.pageContext.font=$;var oe=/(?:AV|VA|AW|WA|To|Ta|Te|Ty|Yo)/;this.pageContext.fontKerning="auto",!Z.isKernFont&&oe.test(J)&&(this.pageContext.fontKerning="none");var ae=Z.scaling<100?1:Z.scaling/100;this.pageContext.letterSpacing=Z.characterSpacing*this.documentHelper.zoomFactor+"pt",this.pageContext.save(),this.pageContext.scale(ae,1),this.pageContext.fillText(J,this.getScaledValue(s,1)/ae,this.getScaledValue(Q,2)),this.pageContext.restore()}}}},i.prototype.getPageBreakText=function(e,t){return e.bidi?String.fromCharCode(182)+"....."+t.getConstant("Page Break")+".....":"....."+t.getConstant("Page Break")+"....."+String.fromCharCode(182)},i.prototype.isBookmarkEndAtStart=function(e){for(var t=e.paragraph,i=0,r=t.childWidgets[i],n=!0;-1==r.children.indexOf(e)&&(r=t.childWidgets[++i],i!=t.childWidgets.length););if(e.line!=r)return!1;for(var o=r.children.indexOf(e)>=0?r.children.indexOf(e):-1;o>=0;o--){var a=r.children[o];this.isRenderable(a)&&(n=!1)}return!!n},i.prototype.isRenderable=function(e){return!(e instanceof ml||e instanceof Ll||e instanceof Al)},i.prototype.combineHexColors=function(e,t){var i=e.replace("#",""),r=t.replace("#",""),n=parseInt(i.substring(0,2),16),o=parseInt(i.substring(2,4),16),a=parseInt(i.substring(4,6),16),s=parseInt(r.substring(0,2),16),l=parseInt(r.substring(2,4),16),d=parseInt(r.substring(4,6),16),h=Math.round(.35*n+.65*s),c=Math.round(.35*o+.65*l),g=Math.round(.35*a+.65*d);return"#"+h.toString(16)+c.toString(16)+g.toString(16)},i.prototype.renderBookmark=function(e,i,r,n,o){if(!this.isPrinting){this.pageContext.beginPath(),this.pageContext.lineWidth=1.5;if(0==n&&(this.pageContext.moveTo(e+3,i),this.pageContext.lineTo(e,i),this.pageContext.lineTo(e,i+r),this.pageContext.lineTo(e+3,i+r)),1==n&&(this.pageContext.moveTo(e-3,i),this.pageContext.lineTo(e,i),this.pageContext.lineTo(e,i+r),this.pageContext.lineTo(e-3,i+r)),this.pageContext.strokeStyle="#7F7F7F",this.pageContext.stroke(),this.pageContext.closePath(),!t.isNullOrUndefined(o)){var a=this.combineHexColors(o,"#7F7F7F");this.pageContext.fillStyle=a,this.pageContext.fillRect(e,i,1.5,r)}}},i.prototype.retriveCharacterformat=function(e,i){t.isNullOrUndefined(i)&&(i=1);this.pageContext.textBaseline="alphabetic";var r="",n="",o=11,a="";return r=e.bold?"bold":"",n=e.italic?"italic":"",o=0===e.fontSize?.5:e.fontSize/("Normal"===e.baselineAlignment?1:1.5),o=this.isPrinting?o*i:o*this.documentHelper.zoomFactor*i,a=e.fontFamily,r+" "+n+" "+o+'pt "'+a+'"'},i.prototype.toSkipFieldCode=function(e){e instanceof ol&&(0===e.fieldType?this.isFieldCode||t.isNullOrUndefined(e.fieldEnd)&&!e.hasFieldEnd||(this.fieldStacks.push(e),this.isFieldCode=!0):2!==e.fieldType&&1!==e.fieldType||this.fieldStacks.length>0&&e.fieldBegin===this.fieldStacks[this.fieldStacks.length-1]&&(this.fieldStacks.pop(),this.isFieldCode=!1))},i.prototype.getUnderlineYPosition=function(e){for(var t=0,i=0,r=0;r<e.children.length;r++){var n=e.children[r];n instanceof ol||0===n.width&&0===n.height||(n instanceof Pl||n instanceof Il&&"Inline"!==n.textWrappingStyle||t<n.height+n.margin.top&&(t=n.margin.top+n.height,i=n instanceof Il?.9:n.height/20))}return bs.containsUnderlinedImage(e)?t+2*i:t-2*i},i.prototype.renderListTextElementBox=function(e,t,i,r){var n=e.alignmentShift;n>0?(e.width+=n,this.renderListTextElement(e,t-n,i,r),e.width-=n):this.renderListTextElement(e,t,i,r)},i.prototype.renderListTextElement=function(e,i,r,n){var o=e.margin.top,a=e.margin.left,s=e.listLevel.characterFormat,l=e.line.paragraph.characterFormat,d=s.hasValue("fontColor")?s.fontColor:l.fontColor,h=l.revisionLength>1;if(l.revisionLength>0){var c=this.checkRevisionType(l);d=this.getRevisionColor(c)}else 0===l.revisionLength&&(e.text.indexOf("")>-1||e.previousElement instanceof kl&&e.previousElement.text.indexOf("")>-1&&"\t"===e.text)&&(d="#0f3d57");this.pageContext.textBaseline="alphabetic";var g="",p="",u=s.hasValue("fontFamily")?s.fontFamily:l.fontFamily;!this.documentHelper.isIosDevice&&!this.documentHelper.isLinuxOS||e.text!==String.fromCharCode(9679)&&e.text!==String.fromCharCode(9675)||(u="");var f=s.hasValue("fontSize")?s.fontSize:l.fontSize,m=s.hasValue("baselineAlignment")?s.baselineAlignment:l.baselineAlignment;g=s.hasValue("bold")?s.bold?"bold":"":l.bold?"bold":"",p=s.hasValue("italic")?s.italic?"italic":"":l.italic?"italic":"",t.isNullOrUndefined(e.paragraph.paragraphFormat.listFormat.listLevel)||"Bullet"!==e.paragraph.paragraphFormat.listFormat.listLevel.listLevelPattern||s.bold||(g=""),t.isNullOrUndefined(e.paragraph.paragraphFormat.listFormat.listLevel)||"Bullet"!==e.paragraph.paragraphFormat.listFormat.listLevel.listLevelPattern||s.italic||(p=""),f=0===f?.5:f/("Normal"===m?1:1.5),f=this.isPrinting?f:f*this.documentHelper.zoomFactor;var y=s.hasValue("strikethrough")?s.strikethrough:l.strikethrough,v=s.hasValue("highlightColor")?s.highlightColor:l.highlightColor;"NoColor"!==v&&("#"!==v.substring(0,1)?this.pageContext.fillStyle=bs.getHighlightColorCode(v):this.pageContext.fillStyle=bs.getColor(v),this.pageContext.fillRect(Math.floor(this.getScaledValue(i+a,1)),Math.floor(this.getScaledValue(r+o,2)-1),Math.ceil(this.getScaledValue(e.width)+1),Math.ceil(this.getScaledValue(e.height)+1))),this.pageContext.font=g+" "+p+" "+f+'pt "'+u+'"';var W=/(?:AV|VA|AW|WA|To|Ta|Te|Ty|Yo)/;this.pageContext.fontKerning="auto",!s.isKernFont&&W.test(e.text)&&(this.pageContext.fontKerning="none"),"Subscript"===m&&(o+=e.height-e.height/1.5);var b=e.baselineOffset;o="Normal"===s.baselineAlignment?o+b:o+b/1.5;var x=e.text,w=e.paragraph.paragraphFormat.bidi;if(w&&(this.pageContext.direction="rtl",i+=e.width),"empty"===d||"#00000000"===d){var F=this.getBackgroundColorHeirachy(e);this.pageContext.fillStyle=this.getDefaultFontColor(F)}else this.pageContext.fillStyle=bs.getColor(d);var C=s.scaling<100?1:s.scaling/100;if(x&&x.indexOf("")>-1&&!t.isNullOrUndefined(e.dualWidths)){var P=x.split(""),T=e.dualWidths.w1,O=e.dualWidths.w2,S=w?i-e.width+a:i+a;this.pageContext.letterSpacing=s.characterSpacing*this.documentHelper.zoomFactor+"pt",this.pageContext.save(),this.pageContext.scale(C,1);for(var N=0;N<P.length;N++){var I=P[N],k=0===N?T:O,A=0===N,L=void 0;L=w?S+k:S,this.pageContext.fillText(I,this.getScaledValue(L,1)/C,this.getScaledValue(r+o,2));var U=S;A?this.renderStrikeThrough(Cd({},e,{width:k}),U,r,s.strikethrough,d,m,{type:"Deletion",color:d}):this.renderUnderline(Cd({},e,{width:k}),U,r,n,d,s.underline,m,{type:"Insertion",color:d}),S+=k}return this.pageContext.restore(),void(w&&(this.pageContext.direction="ltr",i-=e.width))}this.documentHelper.documentEditorSettings.showHiddenMarks&&!this.isPrinting?(e instanceof kl&&"\t"===e.text&&this.tabMark(e,s,i,r,a,o),this.pageContext.letterSpacing=s.characterSpacing*this.documentHelper.zoomFactor+"pt",this.pageContext.save(),this.pageContext.scale(C,1),this.pageContext.fillText(this.replaceSpace(x),this.getScaledValue(i+a,1)/C,this.getScaledValue(r+o,2),this.getScaledValue(e.width)),this.pageContext.restore()):(this.pageContext.letterSpacing=s.characterSpacing*this.documentHelper.zoomFactor+"pt",this.pageContext.save(),this.pageContext.scale(C,1),this.pageContext.fillText(x,this.getScaledValue(i+a,1)/C,this.getScaledValue(r+o,2),this.getScaledValue(e.width)),this.pageContext.restore()),w&&(this.pageContext.direction="ltr",i-=e.width);var B=this.checkRevisionType(l),H=this.getRevisionType(B,!0);("None"!==s.underline&&!t.isNullOrUndefined(s.underline)||!t.isNullOrUndefined(H)&&!h&&("Insertion"===H.type||"MoveTo"===H.type)||e.previousElement instanceof kl&&e.previousElement.text.indexOf("")>-1&&"\t"===e.text)&&this.renderUnderline(e,i,r,n,d,s.underline,m,H),H=this.getRevisionType(B,!1),"None"===y&&(t.isNullOrUndefined(H)||"Deletion"!==H.type&&"MoveFrom"!==H.type)||this.renderStrikeThrough(e,i,r,s.strikethrough,d,m,H)},i.prototype.getDefaultFontColor=function(e){return bs.isVeryDark(e)?"#FFFFFF":"#000000"},i.prototype.isElementAllWordSplit=function(e){if(t.isNullOrUndefined(e)||t.isNullOrUndefined(e.text))return!1;for(var i=0;i<e.text.length;i++)if(!this.documentHelper.textHelper.isWordSplitChar(e.text[i]))return!1;return!0},i.prototype.isSkippableElement=function(e){return!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(e.text)&&(!!this.isElementAllWordSplit(e)||!!this.documentHelper.textHelper.containsNumberAlone(e.text))},i.prototype.prevIsRTL=function(e){if(t.isNullOrUndefined(e))return!1;if(this.isSkippableElement(e)){for(var i=e.previousElement instanceof hl?e.previousElement:void 0;i&&this.isSkippableElement(i);)i=i.previousElement instanceof hl?i.previousElement:void 0;return!t.isNullOrUndefined(i)&&this.documentHelper.textHelper.isRTLText(i.text)}return this.documentHelper.textHelper.isRTLText(e.text)},i.prototype.nextIsRTL=function(e){if(t.isNullOrUndefined(e))return!1;if(this.isSkippableElement(e)){for(var i=e.nextElement instanceof hl?e.nextElement:void 0;i&&this.isSkippableElement(i);)i=i.nextElement instanceof hl?i.nextElement:void 0;return!t.isNullOrUndefined(i)&&this.documentHelper.textHelper.isRTLText(i.text)}return this.documentHelper.textHelper.isRTLText(e.text)},i.prototype.checkFormatToCombineText=function(e,t){return e.fontSize===t.fontSize&&e.fontFamily===t.fontFamily&&e.bold===t.bold&&e.italic===t.italic&&e.baselineAlignment===t.baselineAlignment&&e.bidi===t.bidi&&e.bdo===t.bdo&&e.allCaps===t.allCaps&&e.complexScript===t.complexScript&&e.fontFamilyAscii===t.fontFamilyAscii&&e.fontFamilyBidi===t.fontFamilyBidi&&e.fontFamilyFarEast===t.fontFamilyFarEast&&e.characterSpacing===t.characterSpacing&&e.scaling===t.scaling&&e.isKernFont===t.isKernFont&&e.kern===t.kern&&e.fontFamilyNonFarEast===t.fontFamilyNonFarEast&&e.hidden===t.hidden},i.prototype.renderTextElementBox=function(i,r,n,o){var a=!1,s=i.line.paragraph.containerWidget;if(s instanceof il&&(a="Exactly"===s.ownerRow.rowFormat.heightType,s.cellFormat.rowSpan>1&&s.ownerTable&&s.ownerRow)){var l=s.ownerTable.childWidgets[s.ownerRow.index+s.cellFormat.rowSpan-1];t.isNullOrUndefined(l)||(a="Exactly"===l.rowFormat.heightType)}var d=i.margin.top,h=i.margin.left;if(a&&s instanceof il){var c=s.width+s.margin.left+s.margin.right-s.leftBorderWidth;this.clipRect(s.x-s.margin.left,s.y,this.getScaledValue(c),this.getScaledValue(s.height))}var g=i.characterFormat,p=!0;if("NoColor"!=g.highlightColor&&""==i.text.trim()){var u=i.line.paragraph.firstChild,f=i.line.paragraph.lastChild;!t.isNullOrUndefined(u)&&u instanceof rl&&u.children.length>0&&i===u.children[0]&&(p=!1),!t.isNullOrUndefined(f)&&f instanceof rl&&f.children.length>0&&i===f.children[f.children.length-1]&&(p=!1)}var m=!this.isPrinting&&this.documentHelper&&!t.isNullOrUndefined(this.documentHelper.editorProperties.editRegionHighlighters)&&this.documentHelper.editorProperties.editRegionHighlighters.containsKey(i.line);"NoColor"!==g.highlightColor&&p&&!m&&("#"!==g.highlightColor.substring(0,1)?this.pageContext.fillStyle=bs.getHighlightColorCode(g.highlightColor):this.pageContext.fillStyle=bs.getColor(g.highlightColor),this.pageContext.fillRect(Math.floor(this.getScaledValue(r+h,1)),Math.floor(this.getScaledValue(n+d,2)-1),Math.ceil(this.getScaledValue(i.width)+1),Math.ceil(this.getScaledValue(i.height)+1)));var y=this.checkRevisionType(i),v=y.length>0?this.getRevisionColor(y):g.fontColor;this.pageContext.textBaseline="alphabetic";var W=g.bidi||this.documentHelper.textHelper.isRTLText(i.text),b=W||g.complexScript,x="",w="",F=11;x=b?g.boldBidi?"bold":"":g.bold?"bold":"",w=b?g.italicBidi?"italic":"":g.italic?"italic":"",F=0===g.fontSize?.5:(b?g.fontSizeBidi:g.fontSize)/("Normal"===g.baselineAlignment?1:1.5),F=this.isPrinting?F:F*this.documentHelper.zoomFactor;var C=this.documentHelper.textHelper.getFontNameToRender(i.scriptType,g);this.pageContext.font=x+" "+w+" "+F+'pt "'+C+'"';var P=/(?:AV|VA|AW|WA|To|Ta|Te|Ty|Yo)/;this.pageContext.fontKerning="auto",!g.isKernFont&&P.test(i.text)&&(this.pageContext.fontKerning="none"),"Subscript"===g.baselineAlignment&&(d+=i.height-i.height/1.5);var T=i.baselineOffset;if(d="Normal"===g.baselineAlignment?d+T:d+T/1.5,"empty"===v||"#00000000"===v){var O=this.getBackgroundColorHeirachy(i);this.pageContext.fillStyle=this.getDefaultFontColor(O)}else this.pageContext.fillStyle=bs.getColor(v);var S=this.getScaledValue(i.width),N=i.text;if(i instanceof fl){var I=i;""!==I.tabText||t.isNullOrUndefined(I.tabLeader)||"None"===I.tabLeader?""!==I.tabText&&(N=I.tabText):(N=this.getTabLeader(i),I.tabText=N)}N=this.documentHelper.textHelper.setText(N,W,g.bdo,!0),i instanceof ul&&i.isRtlPageNumber&&(N=bs.reverseString(N));var k=i.line,A=k.renderedElements.indexOf(i);if(A>0){var L=k.renderedElements[A-1];L&&i.scriptType!==e.FontScriptType.Hebrew&&this.checkFormatToCombineText(i.characterFormat,L.characterFormat)&&!bs.startsWith(i.text," ")&&!bs.endsWith(L.text)&&i.characterFormat.bidi&&L.characterFormat.bidi&&i.characterRange===e.CharacterRangeType.RightToLeft&&L.characterRange===e.CharacterRangeType.RightToLeft&&(N+="")}g.allCaps&&(N=N.toUpperCase());var U=i.characterRange,B=!1,H=i.previousElement instanceof hl?i.previousElement:void 0,R=i.nextElement instanceof hl?i.nextElement:void 0;B=this.prevIsRTL(H)&&(this.nextIsRTL(R)||t.isNullOrUndefined(R)),((U==e.CharacterRangeType.WordSplit||(U&e.CharacterRangeType.WordSplit)==e.CharacterRangeType.WordSplit&&(U&e.CharacterRangeType.RightToLeft)==e.CharacterRangeType.RightToLeft)&&g.bidi||"StandardContextual"===this.documentHelper.characterFormat.ligature&&B)&&(N=this.documentHelper.textHelper.inverseCharacter(N));var q=g.scaling<100?1:g.scaling/100;if(U!==e.CharacterRangeType.RightToLeft||bs.startsWith(N," ")||(this.pageContext.direction="rtl",r+=i.width),this.documentHelper.documentEditorSettings.showHiddenMarks&&!this.isPrinting)(i instanceof fl||i instanceof hl)&&"\t"===i.text&&this.tabMark(i,g,r,n,h,d),"\r"===N&&(N=String.fromCharCode(182)),this.pageContext.letterSpacing=g.characterSpacing*this.documentHelper.zoomFactor+"pt",this.pageContext.save(),this.pageContext.scale(q,1),this.pageContext.fillText(this.replaceSpace(N),this.getScaledValue(r+h,1)/q,this.getScaledValue(n+d,2),S),this.pageContext.restore();else{if(this.pageContext.letterSpacing=g.characterSpacing*this.documentHelper.zoomFactor+"pt",this.pageContext.save(),this.pageContext.scale(q,1),i.paragraph.containerWidget.containerShape&&"Center"==i.paragraph.containerWidget.textVerticalAlignment){var E=i.paragraph.containerWidget.containerShape.height,M=0;if(i.paragraph.containerWidget.childWidgets&&i.paragraph.containerWidget.childWidgets.length>0)for(z=0;z<i.paragraph.containerWidget.childWidgets.length;z++)M+=i.paragraph.containerWidget.childWidgets[z].height;var V=this.getScaledValue(E)-(i.paragraph.containerWidget.marginTop+i.paragraph.containerWidget.marginBottom),D=this.getScaledValue(n+d,2)+(V-M)/2;M<this.getScaledValue(E)?this.pageContext.fillText(N,this.getScaledValue(r+h,1)/q,D,S):this.pageContext.fillText(N,this.getScaledValue(r+h,1)/q,this.getScaledValue(n+d,2),S)}else if(i.paragraph.containerWidget.containerShape&&"Bottom"==i.paragraph.containerWidget.textVerticalAlignment){var E=i.paragraph.containerWidget.containerShape.height,D=this.getScaledValue(n+d,2)+this.getScaledValue(E)/2,M=0;if(i.paragraph.containerWidget.childWidgets&&i.paragraph.containerWidget.childWidgets.length>0)for(var z=0;z<i.paragraph.containerWidget.childWidgets.length;z++)M+=i.paragraph.containerWidget.childWidgets[z].height;M+this.getScaledValue(E)/2<this.getScaledValue(E)?this.pageContext.fillText(N,this.getScaledValue(r+h,1)/q,D,S):this.pageContext.fillText(N,this.getScaledValue(r+h,1)/q,this.getScaledValue(n+d,2),S)}else this.pageContext.fillText(N,this.getScaledValue(r+h,1)/q,this.getScaledValue(n+d,2),S);this.pageContext.restore()}U!==e.CharacterRangeType.RightToLeft||bs.startsWith(N," ")||(this.pageContext.direction="ltr",r-=i.width),this.documentHelper.isSpellCheck&&this.documentHelper.hooks.onTriggerSpellChecker&&this.documentHelper.hooks.onTriggerSpellChecker(i,s,W,r,n,o,g.baselineAlignment);var _=this.getRevisionType(y,!0);("None"===g.underline||t.isNullOrUndefined(g.underline))&&(t.isNullOrUndefined(_)||"Insertion"!==_.type&&"MoveTo"!==_.type)||this.renderUnderline(i,r,n,o,v,g.underline,g.baselineAlignment,_),_=this.getRevisionType(y,!1),("None"===g.strikethrough||t.isNullOrUndefined(g.strikethrough))&&(t.isNullOrUndefined(_)||"Deletion"!==_.type&&"MoveFrom"!==_.type)||this.renderStrikeThrough(i,r,n,g.strikethrough,v,g.baselineAlignment,_),a&&this.pageContext.restore()},i.prototype.tabMark=function(e,t,i,r,n,o){var a=e.paragraph.bidi?String.fromCharCode(8592):String.fromCharCode(8594),s=this.documentHelper.textHelper.getWidth(a,t,e.scriptType),l=e.width/2,d=s/2;this.pageContext.font=this.retriveCharacterformat(e.characterFormat);var h=/(?:AV|VA|AW|WA|To|Ta|Te|Ty|Yo)/;this.pageContext.fontKerning="auto",!t.isKernFont&&h.test(e.text)&&(this.pageContext.fontKerning="none"),this.pageContext.letterSpacing=t.characterSpacing*this.documentHelper.zoomFactor+"pt",this.pageContext.save();var c=t.scaling<100?1:t.scaling/100;this.pageContext.scale(c,1),l>s?e.paragraph.bidi?this.pageContext.fillText(a,this.getScaledValue(i+n+d-l,1)/c,this.getScaledValue(r+o,2)):this.pageContext.fillText(a,this.getScaledValue(i+n+l-d,1)/c,this.getScaledValue(r+o,2)):this.pageContext.fillText(a,this.getScaledValue(i+n,1)/c,this.getScaledValue(r+o,2),this.getScaledValue(e.width)),this.pageContext.restore()},i.prototype.replaceSpace=function(e){return e=e.replace(new RegExp(String.fromCharCode(32),"g"),String.fromCharCode(183)),e=e.replace(new RegExp(String.fromCharCode(160),"g"),String.fromCharCode(176))},i.prototype.inverseCharacter=function(e){switch(e){case String.fromCharCode(40):return String.fromCharCode(41);case String.fromCharCode(41):return String.fromCharCode(40);case String.fromCharCode(60):return String.fromCharCode(62);case String.fromCharCode(62):return String.fromCharCode(60);case String.fromCharCode(123):return String.fromCharCode(125);case String.fromCharCode(125):return String.fromCharCode(123);case String.fromCharCode(91):return String.fromCharCode(93);case String.fromCharCode(93):return String.fromCharCode(91);default:return e}},i.prototype.getBackgroundColorHeirachy=function(e){var i;if(e.paragraph.isInsideTable){var r=e.paragraph.containerWidget;i=r.cellFormat.shading.backgroundColor;var n=r.cellFormat.shading.foregroundColor;if(r.cellFormat.shading.hasValue("textureStyle")&&"empty"===n&&("empty"===i||"#00000000"===i))return this.drawTextureStyle(r.cellFormat.shading.textureStyle,bs.getColor(n),bs.getColor(i),!0,!0);if("empty"!==i&&"#00000000"!==i)return i;if("empty"!==(i=r.ownerTable.tableFormat.shading.backgroundColor)&&"#00000000"!==i)return i}else if(e.paragraph.containerWidget instanceof Ol&&!t.isNullOrUndefined(e.paragraph.containerWidget.containerShape)&&!t.isNullOrUndefined(e.paragraph.containerWidget.containerShape.fillFormat)&&"#000000FF"===e.paragraph.containerWidget.containerShape.fillFormat.color)return e.paragraph.containerWidget.containerShape.fillFormat.color;return this.documentHelper.backgroundColor},i.prototype.drawWavy=function(e,i,r,n,o,a,s,l,d){this.pageContext.save(),this.pageContext.fillStyle=t.isNullOrUndefined(l)||"empty"===l?this.documentHelper.backgroundColor:l,this.pageContext.fillRect(e.x,e.y-n,i.x-e.x,3*n),this.pageContext.restore(),this.pageContext.lineWidth=1,this.pageContext.lineCap="round",this.pageContext.strokeStyle=a,this.pageContext.beginPath();var h=0,c=0,g=e.x,p=e.y,u=i.x,f=i.y,m=0,y=0,v=Math.atan2(f-p,u-g),W=Math.sqrt((g-u)*(g-u)+(p-f)*(p-f)),b=1*n,x=Math.PI*r;for(m;m<=W;m+=o)y=Math.sin(m/W*x)*b,h=e.x+Math.cos(v)*m+Math.cos(v-Math.PI/2)*y,c=e.y+Math.sin(v)*m+Math.sin(v-Math.PI/2)*y,m>0?this.pageContext.lineTo(h,c):this.pageContext.moveTo(h,c);this.pageContext.stroke()},i.prototype.getTabLeader=function(e){var t=0,i=this.getTabLeaderString(e.tabLeader),r=i;t=this.documentHelper.textHelper.getWidth(r,e.characterFormat,e.scriptType);var n=Math.floor(e.width/t);0==t&&(n=0);for(var o=0;o<=n;o++)r+=i;return r.slice(0,-1)},i.prototype.getTabLeaderString=function(e){var t="";switch(e){case"Dot":t=".";break;case"Hyphen":t="-";break;case"Underscore":case"Single":t="_"}return t},i.prototype.clipRect=function(e,t,i,r){this.pageContext.beginPath(),this.pageContext.save(),this.pageContext.rect(this.getScaledValue(e,1),this.getScaledValue(t,2),i,r),this.pageContext.clip()},i.prototype.getTrimmedWidth=function(e){var i=e.width;return e instanceof hl&&!(e instanceof fl)&&t.isNullOrUndefined(e.nextNode)&&(i=this.documentHelper.textHelper.getWidth(bs.trimEnd(e.text),e.characterFormat,e.scriptType)),i},i.prototype.renderUnderline=function(e,i,r,n,o,a,s,l){var d=e.height/("Normal"===s?1:1.5),h=e.margin.top,c=d/20,g=0,p=d/20;"Subscript"===s||e instanceof kl?(g=d-2*c+r,g+=(h+=e.height-d)>0?h:0):g=n+r;var u=0;for(t.isNullOrUndefined(l)||(a="MoveTo"===l.type?"Double":"Single"),e instanceof Il||"Double"!==a||(g-=p),e instanceof Il&&(p=c=.9);u<("Double"===a?2:1);){u++;var f=this.getTrimmedWidth(e);this.pageContext.fillRect(this.getScaledValue(i+e.margin.left,1),this.getScaledValue(g,2),this.getScaledValue(f),this.getScaledValue(c)),g+=2*p}},i.prototype.renderStrikeThrough=function(e,i,r,n,o,a,s){var l=e.height/("Normal"===a?1:1.5),d=e.margin.top;"Subscript"===a&&(d+=e.height-l),r+=d>0?d:0;var h=l/20,c=l/2+.5*h,g=0;for(t.isNullOrUndefined(s)||(n="Deletion"===s.type?"SingleStrike":"DoubleStrike"),e instanceof Il&&(h=.9),"DoubleStrike"===n&&(c-=h);g<("DoubleStrike"===n?2:1);){g++;var p=this.getTrimmedWidth(e);this.pageContext.fillRect(this.getScaledValue(i+e.margin.left,1),this.getScaledValue(c+r,2),this.getScaledValue(p),this.getScaledValue(h)),c+=2*h}},i.prototype.renderImageElementBox=function(e,i,r,n){var o=this,a=e.margin.top,s=e.margin.left,l=this.checkRevisionType(e),d=l.length>0?this.getRevisionColor(l):"black";this.pageContext.textBaseline="top";var h=0,c=!1,g=e.line.paragraph.containerWidget,p=!1,u=this.getScaledValue(i+s,1),f=this.getScaledValue(r+a,2),m=this.getScaledValue(e.width),y=this.getScaledValue(e.height);if(g instanceof il&&(p="Exactly"===g.ownerRow.rowFormat.heightType),"Inline"===e.textWrappingStyle)if((a<0||e.line.paragraph.width<e.width)&&!p){if("Exactly"===e.line.paragraph.paragraphFormat.lineSpacingType&&e.line.paragraph.paragraphFormat.lineSpacing>0)g instanceof il||(c=!0,this.clipRect(e.line.paragraph.x,e.line.paragraph.y,this.getScaledValue(e.line.paragraph.width),this.getScaledValue(e.line.paragraph.height)));else if(g instanceof il){v=0;g.childWidgets[0]instanceof Qs&&(v=(W=g.childWidgets[0]).paragraphFormat.leftIndent),h=g.width+g.margin.left-g.leftBorderWidth-v,c=!0,this.clipRect(i+s,r+a,this.getScaledValue(h),this.getScaledValue(g.height))}}else if(p){var v=0;if(g.childWidgets[0]instanceof Qs){var W=g.childWidgets[0];v=W.paragraphFormat.leftIndent}var b=g.width+g.margin.left-g.leftBorderWidth-v;c=!0,this.clipRect(i+s,g.y,this.getScaledValue(b),this.getScaledValue(g.height))}if(e.isMetaFile&&!t.isNullOrUndefined(e.metaFileImageString))e.isCrop&&e.cropWidth<m&&e.cropHeight<y?this.pageContext.drawImage(e.element,e.cropX,e.cropY,e.cropWidth,e.cropHeight,u,f,m,y):this.pageContext.drawImage(e.element,u,f,m,y);else{var x="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAgVBMVEX///8AAADgAADY2Njl5eVcXFxjY2NZWVl/f3+wsLCmpqb4+PiioqKpqam7u7vV1dX2uLj2wsLhFRXzpKT3vb30sbHhCwv74+P40dH+9vbkIyO2trbBwcHLy8tsbGycnJz529v4zMzrbGzlLS3qZmblNzfrdXXoRkbvi4vvgYHlHh7CZsBOAAADpUlEQVR4nO3da1faQBSF4ekAUQlUEFs14AXxVv7/D6yaQiZx5mSEYXF2ut+PNKzyyK5diYDmR9czx34AB49C/CjE759w3jvvWr15Tdgz3atXE54f++EcIArxoxA/CvGjED8K8aMQPwrxoxA/CvGLEeZ9jPJdhfk4GyCUjb3ECGE/Q6m/q3DwfudjP0ERZYN9hKdn2hvd3+0jHJz5/kBVuTk96bbQUEjhYR9ckiikUH8UUqg/CinUH4UU6o9CCvVHIYX6o5BC/VFIof4opFB/FFKoPwop1B+FFOqPQgrjyxfjVC38Lxk9tnAxGqZqdKtSOE4GHA5/fuNJpDCtcNHbv4VqYYqPLjgfUViPQgrjozA2CptRSGF8/59w+Wrt+rr1btNna1cPzg0wwuXavncxabnX7PfHYYXzlYARvlobQZyUR9mXm+1NMEK7SSLONgcVV9vb8IQXv4J3KSeKKlxXxNCzONkeYp8AV3p9UT1+P3FWHVAsq5thhGZSEb1DrSZq7dS5HUdoLiuBZ6jORG3tCwAkNJfCUJ2Jrqe1P0ESCkMNTdSACYNDDU7UoAkDQw1P1MAJvUMVJmrwhJ6hShM1gMIvQxUnahCFjaHKEzWQQneoxR95ogZTWBuqPFEDKnSHKk/UoArdoYoTNbDC5lBDEzW4QjMpYiZqgIXG/S76JhwHK5zVVipcnkIVuv/RW/HyFKhwYhuFr6NiCmdNoDBUSGFjovJQEYXuRN9ahwoorJ8uSZenPsMTNk+X2q6jwgm/ntHL11HhhL4zenmoYEL/Gb04VCxh6KKTNFQoYfiikzBUJKF00Sk8VCChfF00OFQcYdt10dBQYYRT5xn0n9G7Q0X8GfCzNNEyZ6iPgD/HlydaVg11DfhajJaJlm2HugIUrlomWrYZKuJKHz6vHhbSM/hROdRnxNe1meuXYvW0DB6+aflYrB7dlzDiCM3N1dVN6GDhMCDhjlHYjEIK46MwNgqbUUhhfJ/vA07wO8N1vw94ONo/3e/lTpVOYfc/UyG//ZmqW52fi/FuTNW3/lZ+eguF+qOQQv1RSKH+KKRQfxRSqD8KKdQfhRTqj0IK9UchhfqjkEL9UUih/iikUH8UUqg/CmXh6Hsv3jlK+wnvD/vgkrSHMMuyu1P9ZdmuwnycDQYn+svG3n9KEUKT9zHyf6+IEWJHIX4U4kchfhTiRyF+FOJHIX4U4kchfnVhijeZa6sunCf4ZdPamteEHY5C/CjEr/vCv0ec0g+AtS1QAAAAAElFTkSuQmCC";try{var w=this;e.element.onload=function(){var i=e.element.getAttribute("lastLoaded");t.isNullOrUndefined(w.documentHelper)||i===e.element.src||(e.isCrop?w.pageContext.drawImage(e.element,e.cropX,e.cropY,e.cropWidth,e.cropHeight,u,f,m,y):(w.pageContext.drawImage(e.element,u,f,m,y),w.documentHelper.editorProperties.enableHeaderAndFooter&&w.documentHelper.hooks.onUpdateScrollBars&&w.documentHelper.hooks.onUpdateScrollBars()))},e.element.onerror=function(){var t=x,i=o.documentHelper.getImageString(e);if(i&&(bs.startsWith(i,"http://")||bs.startsWith(i,"https://"))){var r=o.viewer.documentHelper.images.get(parseInt(e.imageString));r&&r.length>1&&(t=r[1])}e.element.src=t},e.isCrop?this.pageContext.drawImage(e.element,e.cropX,e.cropY,e.cropWidth,e.cropHeight,u,f,m,y):this.pageContext.drawImage(e.element,u,f,m,y)}catch(t){var F=this.documentHelper.getImageString(e);if(F&&(bs.startsWith(F,"http://")||bs.startsWith(F,"https://"))){var C=this.viewer.documentHelper.images.get(parseInt(e.imageString));C&&C.length>1?e.element.src=C[1]:e.element.src=x}else e.imageString=x,this.documentHelper.addBase64StringInCollection(e),e.element.src=this.documentHelper.getImageString(e);this.pageContext.drawImage(e.element,this.getScaledValue(i+s,1),this.getScaledValue(r+a,2),this.getScaledValue(e.width),this.getScaledValue(e.height))}}this.pageContext.fillStyle=bs.getColor(d);var P=this.getRevisionType(l,!1);t.isNullOrUndefined(P)||"Deletion"!==P.type&&"MoveFrom"!==P.type||this.renderStrikeThrough(e,i,r,"SingleStrike",d,"Normal",P),P=this.getRevisionType(l,!0);var T=e.characterFormat;if("Inline"===e.textWrappingStyle&&"None"!==T.underline&&!t.isNullOrUndefined(T.underline)||!t.isNullOrUndefined(P)&&("Insertion"===P.type||"MoveTo"===P.type)){var O=this.getUnderlineYPosition(e.line);this.renderUnderline(e,i,r,O,d,T.underline,T.baselineAlignment)}this.documentHelper.picturePositionY=this.getScaledValue(r+a,2);var S=this.documentHelper.lockedPictureContentControl;if(!t.isNullOrUndefined(S)&&S.line===e.line&&"Picture"===S.contentControlProperties.type){var N=e.characterFormat,I=S.contentControlProperties.color;"#00000000"===I&&(I="#939393"),this.renderImgBorder(e,i,r,I,"Solid",.5,N.baselineAlignment)}c&&this.pageContext.restore()},i.prototype.renderTableOutline=function(e,t){var i=new ud(this.documentHelper),r=t;t.width=this.documentHelper.layout.getTableWidth(r);var n=r.tableFormat.isRTFTable?r.firstChild.rowFormat.borders:r.tableFormat.borders,o=r.isBidiTable?i.getTableRightBorder(n):i.getTableLeftBorder(n),a=0;a=bs.convertPointToPixel(o.getLineWidth());var s,l=0;if(r.containerWidget instanceof Ys&&(s=r.containerWidget),s&&s.firstChild===t&&s.childWidgets[0].childWidgets.length>0&&e.repeatHeaderRowTableWidget)for(var d=this.documentHelper.layout.getHeader(s.childWidgets[0]);d&&d.rowFormat.isHeader;)l+=d.height,d=d.previousWidget;this.renderSingleBorder(o.color,t.x-t.margin.left-a/2,t.y-l,t.x-t.margin.left-a/2,t.y+t.height,a,o.lineStyle),o=i.getTableTopBorder(n),a=0,a=bs.convertPointToPixel(o.getLineWidth()),this.renderSingleBorder(o.color,t.x-t.margin.left-a,t.y-a/2-l,t.x+t.width+a+t.margin.right,t.y-a/2-l,a,o.lineStyle),o=r.isBidiTable?i.getTableLeftBorder(n):i.getTableRightBorder(n),a=0,a=bs.convertPointToPixel(o.getLineWidth()),this.renderSingleBorder(o.color,t.x+t.width+t.margin.right+a/2,t.y-l,t.x+t.width+t.margin.right+a/2,t.y+t.height,a,o.lineStyle),o=i.getTableBottomBorder(n),a=0,a=bs.convertPointToPixel(o.getLineWidth()),this.renderSingleBorder(o.color,t.x-t.margin.left-a,t.y+t.height-a/2,t.x+t.width+a+t.margin.right,t.y+t.height-a/2,a,o.lineStyle)},i.prototype.renderTableCellOutline=function(e,t){this.isRenderingCellBorders=!0;try{this.renderTableCellOutlineBorders(e,t)}finally{this.isRenderingCellBorders=!1}this.renderCellMultiLineBorders(t)},i.prototype.renderTableCellOutlineBorders=function(e,i){var r=e.layout,n=i,o=0,a=0,s=0,l=0,d=0,h=i.ownerTable.isBidiTable;n.cellFormat.borders,i.containerWidget instanceof tl&&(a=i.margin.bottom-i.containerWidget.bottomBorderWidth,o=i.margin.top-i.containerWidget.topBorderWidth),s=i.margin.left-i.leftBorderWidth,l=i.margin.right-i.rightBorderWidth,d=t.isNullOrUndefined(n.ownerRow)||"Exactly"!==n.ownerRow.rowFormat.heightType?i.height+o+a:bs.convertPointToPixel(n.ownerRow.rowFormat.height)+o+a;var c=h?il.getCellRightBorder(n):il.getCellLeftBorder(n),g=0;g=bs.convertPointToPixel(c.getLineWidth()),this.renderCellBackground(d,i,s,l,g);var p=g;if(0===n.index||1===n.cellFormat.rowSpan||n.cellFormat.rowSpan>1&&(h?n.columnIndex===n.ownerRow.childWidgets.length-1:0===n.columnIndex))this.renderSingleBorder(c.color,i.x-s-g,i.y-i.margin.top,i.x-s-g,i.y+i.height+a,g,c.lineStyle);else for(var u=0;u<n.ownerTable.childWidgets.length;u++){for(var f=n.ownerTable.childWidgets[u],m=void 0,y=0;y<f.childWidgets.length;y++){var v=f.childWidgets[y];if(h?v.columnIndex===n.columnIndex+n.cellFormat.columnSpan:v.columnIndex+v.cellFormat.columnSpan-1==n.columnIndex-1){m=v;break}if(!h&&v.columnIndex>=n.columnIndex&&v.previousWidget){m=v.previousWidget;break}}if(m&&(h?m.columnIndex===n.columnIndex+n.cellFormat.columnSpan:m.columnIndex+m.cellFormat.columnSpan-1==n.columnIndex-1)){var W=h?il.getCellLeftBorder(m):il.getCellRightBorder(m),b=bs.convertPointToPixel(W.getLineWidth());if(s=n.margin.left-b,m.y+m.height<n.y)continue;if(m.y<n.y&&m.y+m.height>n.y)this.renderSingleBorder(W.color,n.x-s-b,n.y-o,n.x-s-b,m.y+m.height+m.margin.bottom,b,W.lineStyle);else if(m.y===n.y||m.y>n.y&&m.y+m.height<n.y+n.height)this.renderSingleBorder(W.color,n.x-s-b,m.y-m.margin.top,n.x-s-b,m.y+m.height+m.margin.bottom,b,W.lineStyle);else if(m.y<n.y+n.height&&m.y+m.height>=n.y+n.height)this.renderSingleBorder(W.color,n.x-s-b,m.y-m.margin.top,n.x-s-b,m.y+m.height+a,b,W.lineStyle);else if(m.y>n.y+n.height)break}}if(n.updatedTopBorders&&n.updatedTopBorders.length>1)for(var x=h?i.x+i.width+i.margin.right-p/2:i.x-i.margin.left-p/2,w=i.y-i.margin.top,F=0;F<n.updatedTopBorders.length;F++){var C=n.updatedTopBorders[F];"None"!==(c=C.border).lineStyle&&c.lineWidth<il.getCellTopBorder(n).lineWidth&&(c.lineWidth=il.getCellTopBorder(n).lineWidth),t.isNullOrUndefined(c)||(g=bs.convertPointToPixel(c.getLineWidth()),this.renderSingleBorder(c.color,x,w+g/2,x+(h?-C.width:C.width),w+g/2,g,c.lineStyle),x+=h?-C.width:C.width)}else{c=il.getCellTopBorder(n),g=bs.convertPointToPixel(c.getLineWidth());var P=i.x-i.margin.left-p/2;!h&&0===n.columnIndex&&n.ownerRow.rowIndex>0&&(P+=p),this.renderSingleBorder(c.color,P,i.y-i.margin.top+g/2,i.x+i.width+i.margin.right+0,i.y-i.margin.top+g/2,g,c.lineStyle)}var T=!1;T=h?0===n.columnIndex:n.cellIndex===n.ownerRow.childWidgets.length-1;for(var O=n.containerWidget.getPreviousRowSpannedCells(),S=!1,N=0;N<O.length;N++){var I=O[N];if(n.rowIndex<I.rowIndex+I.cellFormat.rowSpan&&n.columnIndex<I.columnIndex){S=!0;break}}!(n.ownerTable.tableFormat.cellSpacing>0||T)||!h&&n.columnIndex+n.cellFormat.columnSpan!==n.ownerTable.tableHolder.columns.length&&S||(c=h?il.getCellLeftBorder(n):il.getCellRightBorder(n),g=bs.convertPointToPixel(c.getLineWidth()),this.renderSingleBorder(c.color,i.x+i.width+i.margin.right-g/2,i.y-i.margin.top,i.x+i.width+i.margin.right-g/2,i.y+i.height+a,g,c.lineStyle));var k=n.ownerRow.nextWidget,A=!1,L=void 0;if(!t.isNullOrUndefined(k)){if(k.lastChild){var U=k.lastChild;L=U.columnIndex+U.cellFormat.columnSpan}var B=void 0;(B=k)instanceof tl&&i.containerWidget instanceof tl&&i.containerWidget.containerWidget instanceof el&&(A=-1!==i.containerWidget.containerWidget.childWidgets.indexOf(B))}var H=!t.isNullOrUndefined(k)&&T&&!(k.rowFormat.gridAfter>0||k.rowFormat.gridBefore>0)&&k.lastChild.columnIndex+k.lastChild.cellFormat.columnSpan>n.ownerRow.lastChild.columnIndex&&k.lastChild.columnIndex+k.lastChild.cellFormat.columnSpan<n.ownerRow.lastChild.columnIndex+n.ownerRow.lastChild.cellFormat.columnSpan&&!t.isNullOrUndefined(k.childWidgets)&&k.childWidgets.length<n.ownerRow.childWidgets.length+n.cellFormat.columnSpan-1&&i.x+i.width>k.lastChild.x+k.lastChild.width+k.lastChild.margin.right&&"Cleared"!==n.cellFormat.borders.bottom.lineStyle;if(n.ownerTable.tableFormat.cellSpacing>0||n.ownerRow.rowIndex===n.ownerTable.childWidgets.length-1||n.cellFormat.rowSpan>1&&n.ownerRow.rowIndex+n.cellFormat.rowSpan>=n.ownerTable.childWidgets.length||!A||this.isRenderHeader||L&&k.childWidgets.length<n.ownerRow.childWidgets.length&&L<n.columnIndex+n.cellFormat.columnSpan||!t.isNullOrUndefined(n.cellFormat.borders.bottom)&&"Cleared"!==n.cellFormat.borders.bottom.lineStyle&&1===n.cellFormat.rowSpan&&!h&&(!t.isNullOrUndefined(k)&&i.x<k.firstChild.x-k.firstChild.margin.left&&k.rowFormat.gridBefore>0&&(0!==k.rowFormat.beforeWidth||0!==k.rowFormat.gridBeforeWidth)||!t.isNullOrUndefined(k)&&i.x+i.width>k.lastChild.x+k.lastChild.width+k.lastChild.margin.right&&k.rowFormat.gridAfter>0&&(0!==k.rowFormat.afterWidth||0!==k.rowFormat.gridAfterWidth))||H){var R=n.cellFormat.borders.bottom;c=(t.isNullOrUndefined(R)||"Cleared"!==R.lineStyle)&&n.cellFormat.rowSpan>1&&n.ownerRow.rowIndex+n.cellFormat.rowSpan===n.ownerTable.childWidgets.length?n.getBorderBasedOnPriority(n.getBorderBasedOnPriority(n.cellFormat.borders.bottom,n.ownerRow.rowFormat.borders.bottom),n.ownerTable.tableFormat.borders.bottom):il.getCellBottomBorder(n);var q=i.x-i.margin.left-p/2,E=i.x+i.width+i.margin.right;(L&&k.childWidgets.length<n.ownerRow.childWidgets.length&&L<n.columnIndex+n.cellFormat.columnSpan||t.isNullOrUndefined(k)||h||!(k.rowFormat.gridAfter>0)||0===k.rowFormat.afterWidth&&0===k.rowFormat.gridAfterWidth||t.isNullOrUndefined(k.lastChild)||t.isNullOrUndefined(il.getCellTopBorder(k.lastChild))||"None"===il.getCellTopBorder(k.lastChild).lineStyle||!(i.x<k.lastChild.x+k.lastChild.width+k.lastChild.margin.right))&&!H||(q=k.lastChild.x+k.lastChild.width+k.lastChild.margin.right),L&&k.childWidgets.length<n.ownerRow.childWidgets.length&&L<n.columnIndex+n.cellFormat.columnSpan||t.isNullOrUndefined(k)||h||!(k.rowFormat.gridBefore>0)||0===k.rowFormat.beforeWidth&&0===k.rowFormat.gridBeforeWidth||t.isNullOrUndefined(k.firstChild)||t.isNullOrUndefined(il.getCellTopBorder(k.firstChild))||"None"===il.getCellTopBorder(k.firstChild).lineStyle||!(i.x+i.width>k.firstChild.x-k.firstChild.margin.left)||(E=k.firstChild.x-k.firstChild.margin.left),g=bs.convertPointToPixel(c.getLineWidth()),this.renderSingleBorder(c.color,q,i.y+i.height+a+g/2,E,i.y+i.height+a+g/2,g,c.lineStyle)}c=r.getCellDiagonalUpBorder(n),(g=bs.convertPointToPixel(c.getLineWidth()))>0&&this.renderSingleBorder(c.color,i.x-s,i.y+i.height+a,i.x+i.width+l,i.y-o,g,c.lineStyle),c=r.getCellDiagonalDownBorder(n),(g=bs.convertPointToPixel(c.getLineWidth()))>0&&this.renderSingleBorder(c.color,i.x-s,i.y-o,i.x+i.width+l,i.y+i.height+a,g,c.lineStyle)},i.prototype.renderCellMultiLineBorders=function(e){var i=e.ownerTable,r=i.isBidiTable,n=e.ownerRow,o=i.tableHolder.columns.length,a=e.columnIndex+e.cellFormat.columnSpan,s=e.columnIndex<=n.rowFormat.gridBefore,l=a>=o-n.rowFormat.gridAfter,d=n.rowIndex+e.cellFormat.rowSpan-1,h=e.x-e.margin.left,c=e.x+e.width+e.margin.right,g=function(e){var i=[];if(!t.isNullOrUndefined(e))for(var r=0;r<e.childWidgets.length;r++){var n=e.childWidgets[r];Math.min(c,n.x+n.width+n.margin.right)-Math.max(h,n.x-n.margin.left)>1&&i.push(n)}return i},p=function(e,i,r){var n=e.cellFormat.borders[r],o=t.isNullOrUndefined(n)?"None":n.lineStyle;return!(t.isNullOrUndefined(i)||"Double"!==i.lineStyle&&"Triple"!==i.lineStyle||"Double"!==o&&"Triple"!==o&&"None"!==o)},u=function(e,t,i){for(var r=g(e),n=0;n<r.length;n++){var o="top"===t?il.getCellTopBorder(r[n]):il.getCellBottomBorder(r[n]);if(p(r[n],o,t))return!1}return!0},f=d<i.childWidgets.length?i.childWidgets[d].nextWidget:void 0,m=il.getCellBottomBorder(e);e.cellFormat.rowSpan>1&&d===i.childWidgets.length-1&&(!e.cellFormat.borders.bottom||"Cleared"!==e.cellFormat.borders.bottom.lineStyle)&&(m=e.getBorderBasedOnPriority(e.getBorderBasedOnPriority(e.cellFormat.borders.bottom,n.rowFormat.borders.bottom),i.tableFormat.borders.bottom));for(var y=[r?il.getCellRightBorder(e):il.getCellLeftBorder(e),il.getCellTopBorder(e),r?il.getCellLeftBorder(e):il.getCellRightBorder(e),m],v=[r?l:s,u(n.previousWidget,"bottom"),r?s:l,u(f,"top")],W=[],b=[],x=[],w=!1,F=0;F<4;F++){var C=t.isNullOrUndefined(y[F])?"None":y[F].lineStyle;1!==F&&3!==F||v[F]||p(e,y[F],1===F?"top":"bottom")||(C="None"),W[F]="Double"===C?2:"Triple"===C?3:0,b[F]=W[F]>0?bs.convertPointToPixel(y[F].getLineWidth()):0,x[F]=W[F]>0?b[F]/(2*W[F]-1):0,w=w||W[F]>0}if(w){var P=e.margin.bottom-(e.containerWidget instanceof tl?e.containerWidget.bottomBorderWidth:0),T=e.x+e.width+e.margin.right;r||v[2]||(T=e.x+e.width+e.margin.left);var O=[e.x-e.margin.left-(v[0]?b[0]/2:b[0]),e.y-e.margin.top,T-b[2],e.y+e.height+P],S=function(e,t){return W[e]>t&&(v[e]||t>0)},N=function(e,t){var i=S(e,t)?2*t*x[e]:0;return e<2?O[e]+i:O[e]+b[e]-i},I=this.pageContext;I.setLineDash([]);for(F=0;F<4;F++)for(var k=0;k<W[F];k++)if(S(F,k)){var A=function(e,t){var i=(2*t+.5)*x[e];return e<2?O[e]+i:O[e]+b[e]-i}(F,k),L=F%2==0,U=N(L?1:0,k),B=N(L?3:2,k);I.beginPath(),L?(I.moveTo(this.getScaledValue(A,1),this.getScaledValue(U,2)),I.lineTo(this.getScaledValue(A,1),this.getScaledValue(B,2))):(I.moveTo(this.getScaledValue(U,1),this.getScaledValue(A,2)),I.lineTo(this.getScaledValue(B,1),this.getScaledValue(A,2))),I.lineWidth=this.getScaledValue(x[F]),I.strokeStyle=bs.getColor(y[F].color),I.stroke(),I.closePath()}}},i.prototype.renderCellBackground=function(e,t,i,r,n){var o=t.cellFormat,a=t.x-i-n/2,s=t.margin.top-t.containerWidget.topBorderWidth,l=t.y-s,d=t.width+i+r+n/2,h=t.ownerTable.tableFormat.shading.backgroundColor,c=o.shading.backgroundColor;if(t.ownerRow.rowFormat.revisionLength>0){var g=t.ownerRow.rowFormat.getRevision(t.ownerRow.rowFormat.revisionLength-1);c=this.resolveRowRevisionFillColor(g)}if("empty"!==c){var p=il.getCellLeftBorder(t),u=il.getCellTopBorder(t);t===t.ownerRow.lastChild||"None"!==p.lineStyle&&"Cleared"!==p.lineStyle||(d+=.5),t.ownerRow.ownerTable.lastChild===t.ownerRow||"None"!==u.lineStyle&&"Cleared"!==u.lineStyle||(e+=.5)}t.ownerTable.tableFormat.cellSpacing>0&&this.renderBackgroundColor(h,a,l,d,e),this.renderBackgroundColor(c,a,l,d,e),o.shading.hasValue("foregroundColor")&&"TextureNone"!==o.shading.textureStyle&&(this.pageContext.beginPath(),this.pageContext.fillStyle=this.drawTextureStyle(o.shading.textureStyle,bs.getColor(o.shading.foregroundColor),bs.getColor(o.shading.backgroundColor),"empty"===o.shading.foregroundColor,"empty"===o.shading.backgroundColor),this.pageContext.fillRect(this.getScaledValue(a,1),this.getScaledValue(l,2),this.getScaledValue(d),this.getScaledValue(e)),this.pageContext.closePath())},i.prototype.renderBackgroundColor=function(e,t,i,r,n){this.pageContext.beginPath(),"empty"!==e&&(this.pageContext.fillStyle=bs.getColor(e),this.pageContext.fillRect(this.getScaledValue(t,1),this.getScaledValue(i,2),this.getScaledValue(r),this.getScaledValue(n)),this.pageContext.closePath())},i.prototype.drawTextureStyle=function(e,t,i,r,n){if(n&&(i="#ffffff"),r&&(t="#000000"),e.indexOf("Percent")>-1){var o=e.replace("Texture","").replace("Percent","").replace("Pt","."),a=parseInt(o);return this.getForeColor(t,i,a,r,n)}return"TextureSolid"===e?t:"#FFFFFF"},i.prototype.getForeColor=function(e,t,i,r,n){var o=0,a=0,s=0,l=bs.convertHexToRgb(e),d=bs.convertHexToRgb(t);return o=this.getColorValue(l.r,d.r,i,r,n),a=this.getColorValue(l.g,d.g,i,r,n),s=this.getColorValue(l.b,d.b,i,r,n),"#"+bs.convertRgbToHex(o)+bs.convertRgbToHex(a)+bs.convertRgbToHex(s)},i.prototype.getColorValue=function(e,t,i,r,n){return 100==i?e:r?n?Math.round(255*(1-i/100)):Math.round(t*(1-i/100)):n?Math.round(e*(i/100)):t+Math.round(e*(i/100))-Math.round(t*(i/100))},i.prototype.setLineDashBasedOnStyle=function(e,t){var i=this.getScaledValue(t);switch(e){case"Dot":this.pageContext.setLineDash([this.getScaledValue(1)*i,this.getScaledValue(1)*i]);break;case"DashSmallGap":this.pageContext.setLineDash([this.getScaledValue(4)*i,this.getScaledValue(2)*i]);break;case"DashLargeGap":this.pageContext.setLineDash([this.getScaledValue(4)*i,this.getScaledValue(4)*i])}},i.prototype.renderMultipleLineBorder=function(e,t,i,r,n,o,a){var s=Math.sqrt(Math.pow(r-t,2)+Math.pow(n-i,2));if(0!==s){var l=Math.max(o/(a+1),.5),d=Math.max(o,2),h=-(n-i)/s,c=(r-t)/s,g=2===a?[-d/2,d/2]:[-d,0,d];this.pageContext.setLineDash([]);for(var p=0,u=g;p<u.length;p++){var f=u[p];this.pageContext.beginPath(),this.pageContext.moveTo(this.getScaledValue(t+h*f,1),this.getScaledValue(i+c*f,2)),this.pageContext.lineTo(this.getScaledValue(r+h*f,1),this.getScaledValue(n+c*f,2)),this.pageContext.lineWidth=this.getScaledValue(l),this.pageContext.strokeStyle=bs.getColor(e),this.pageContext.stroke(),this.pageContext.closePath()}}},i.prototype.renderSingleBorder=function(e,t,i,r,n,o,a){if("Double"===a||"Triple"===a){if(this.isRenderingCellBorders)return;return void this.renderMultipleLineBorder(e,t,i,r,n,o,"Double"===a?2:3)}this.setLineDashBasedOnStyle(a,o),this.pageContext.beginPath(),this.pageContext.moveTo(this.getScaledValue(t,1),this.getScaledValue(i,2)),this.pageContext.lineTo(this.getScaledValue(r,1),this.getScaledValue(n,2)),this.pageContext.lineWidth=this.getScaledValue(o),this.pageContext.strokeStyle=bs.getColor(e),"None"!==a&&"Cleared"!==a&&this.pageContext.stroke(),this.pageContext.closePath(),"Dot"!==a&&"DashSmallGap"!==a&&"DashLargeGap"!==a||this.pageContext.setLineDash([])},i.prototype.getScaledValue=function(e,i){return this.isPrinting?e:(t.isNullOrUndefined(i)&&(i=0),e*this.documentHelper.zoomFactor+(1===i?this.pageLeft:2===i?this.pageTop:0))},i.prototype.checkRevisionType=function(e){for(var t=[],i=e.revisionLength,r=0;r<i;r++){var n=e.getRevision(r),o=this.resolveRevisionDisplayColor(n);t.push({type:n.revisionType,color:o})}return t},i.prototype.resolveRevisionDisplayColor=function(e){return this.resolveTypedRevisionColor(e,!1)},i.prototype.resolveRowRevisionFillColor=function(e){return this.tintColor(this.resolveTypedRevisionColor(e,!0),10)},i.prototype.tintColor=function(e,i){if(t.isNullOrUndefined(e)||""===e||"empty"===e)return e;var r="#"===e.charAt(0)?e:"#"+e;9===r.length&&(r="#"+r.substring(3));var n=bs.convertHexToRgb(r);if(t.isNullOrUndefined(n))return e;var o=Math.max(0,Math.min(100,i))/100,a=Math.round(n.r*o+255*(1-o)),s=Math.round(n.g*o+255*(1-o)),l=Math.round(n.b*o+255*(1-o));return"#"+bs.convertRgbToHex(a)+bs.convertRgbToHex(s)+bs.convertRgbToHex(l)},i.prototype.resolveTypedRevisionColor=function(e,i){var r=this.documentHelper&&this.documentHelper.documentEditorSettings?this.documentHelper.documentEditorSettings.revisionSettings:void 0,n="Insertion"===e.revisionType||"MoveTo"===e.revisionType,o="Deletion"===e.revisionType||"MoveFrom"===e.revisionType;if(!t.isNullOrUndefined(r)){var a=i?r.insertedRowColor:r.insertRevisionColor,s=i?r.deletedRowColor:r.deleteRevisionColor;if(n&&!t.isNullOrUndefined(a)&&""!==a&&"byauthor"!==a.toLowerCase())return a;if(o&&!t.isNullOrUndefined(s)&&""!==s&&"byauthor"!==s.toLowerCase())return s}var l=this.documentHelper.authors.get(e.author);return t.isNullOrUndefined(l)&&(l=this.documentHelper.getAuthorColor(e.author)),l},i.prototype.getRevisionColor=function(e){if(1===e.length)return e[0].color;for(var t=0;t<e.length;t++)if("Deletion"===e[t].type||"MoveFrom"===e[t].type)return e[t].color;return e.length>0?e[0].color:void 0},i.prototype.getRevisionType=function(e,t){if(0!==e.length)for(var i=0;i<e.length;i++){var r=void 0;if(t&&("Insertion"===e[i].type||"MoveTo"===e[i].type))return r=e[i],this.pageContext.fillStyle=bs.getColor(r.color),e.splice(i,1),r;if(!t&&("Deletion"===e[i].type||"MoveFrom"===e[i].type))return r=e[i],this.pageContext.fillStyle=bs.getColor(r.color),e.splice(i,1),r}},i.prototype.getFormfieldInLine=function(e){for(var i=0;i<e.children.length;i++)if(e.children[i]instanceof ol&&!t.isNullOrUndefined(e.children[i].formFieldData))return e.children[i]},i.prototype.renderLockMark=function(e,i,r){if(t.isNullOrUndefined(e.editRangeMark)){var n=i===e.user?"you":e.user;e.editRangeMark=document.createElement("div"),e.editRangeMark.style.display="none",e.editRangeMark.classList.add("e-de-lock-mark");var o=document.createElement("span");o.className="e-icons e-de-ctnr-lock",e.editRangeMark.appendChild(o),e.editRangeMark.title=r.getConstant("This region is locked by")+" "+n}e.line&&t.isNullOrUndefined(e.editRangeMark.parentElement)&&e.line.paragraph.bodyWidget.page.documentHelper.pageContainer.appendChild(e.editRangeMark)},i.prototype.getShape=function(e){return this.shapes[e.toString()]},i.prototype.destroy=function(){this.documentHelper=void 0,this.shapes=null,t.isNullOrUndefined(this.pageCanvasIn)||(this.pageCanvasIn.innerHTML=""),this.pageCanvasIn=void 0},i}(),Td=function(){function e(){this.printDevicePixelRatio=1,this.collaborativeEditingSettings={roomName:"",editableRegionColor:"#22b24b",lockedRegionColor:"#f44336"},this.showBookmarks=!1,this.highlightEditableRanges=!0,this.commentSettings={highlightCommentsByAuthor:!1},this.searchHighlightColor="#FFE97F",this.formFieldSettings={shadingColor:"#cfcfcf",applyShading:!0,selectionColor:"#cccccc",formFillingMode:"Popup"},this.showHiddenMarks=!1,this.revisionSettings={customData:"",showCustomDataWithAuthor:!1,revisionColors:["#b5082e","#0e76b1","#bb00ff","#c14f16","#128317","#881824","#a26400","#50565e"],insertRevisionColor:"byAuthor",deleteRevisionColor:"byAuthor",insertedRowColor:"byAuthor",deletedRowColor:"byAuthor"},this.openAsyncSettings={enable:!1,initialPageLoadCount:5,incrementalPageLoadCount:3},this.defaultCheckBoxOption="Tick",this.allowHyphensInBookmarkNames=!1}return e}(),Od=function(){function e(){this.compatibilityMode="Word2013"}return e}(),Sd=function(){function e(){}return e}(),Nd=function(){function e(e){this.enableHeaderAndFooter=!1,this.isDocumentLoaded=!1,this.currentUser="",this.isRedoing=!1,this.isSelectionChangedOnMouseMoved=!1,this.isEndnoteElementRemoved=!1,this.isFootnoteElementRemoved=!1,this.isFootNoteInsert=!1,this.isPaste=!1,this.isRemoteAction=!1,this.remotePasteRevision=[],this.chartType=!1,this.pasteImageIndex=void 0,this.isLastParaMarkCopied=!1,this.revisionData=void 0,this.isFootNote=!1,this.isAutofitToWindow=!1,this.isDeleteOrBackSpace=!1,this.handledEnter=!1,this.isMeasureParaWidth=!1,this.lastElementForPasteIcon=void 0,this.isTableInsert=!1,this.isInsertingTOC=!1,this.skipChangeDetection=!1,this.enableSpellCheck=!1,this.restrictLayout=!1,this.action=void 0,this.selectedBookmarks=[],this.isMoveDownOrMoveUp=!1,this.editRegionHighlighters=new p,this.contentControls=[],this.contentControleditRegionHighlighters=new p,this.searchHighlighters=new p,this.selectedWidgets=new p,this.formFieldHighlighters=new p,this.isCommentSelected=!1,this.isTableMarkerDragging=!1,this.isComposingIME=!1,this.resizeNode=0,this.resizingRowFormat=void 0,this.hasChanges=!1,this.isCommentEditMode=!1,this.currentSelectedComment=void 0,this.owner=e}return e.prototype.getNextParagraphBlock=function(e){return e.nextRenderedWidget instanceof Qs?e.nextRenderedWidget:e.nextRenderedWidget instanceof el?this.owner.getFirstParagraphInFirstCell(e.nextRenderedWidget):e.containerWidget instanceof il?this.getNextParagraphCell(e.containerWidget):e.containerWidget instanceof Ys?this.getNextParagraph(e.containerWidget):e.containerWidget instanceof Xs&&this.isMoveDownOrMoveUp?this.getFirstBlockInNextHeaderFooter(e):void 0},e.prototype.getNextParagraphCell=function(e){if(e.nextRenderedWidget&&e.nextRenderedWidget instanceof il){if(e.rowIndex===e.nextRenderedWidget.rowIndex){if((e=e.nextRenderedWidget).getSplitWidgets()[0]instanceof il)for(var t=0,i=e.getSplitWidgets();t<i.length&&!(e=i[t]).firstChild;t++);var r=e.firstChild;return r?this.owner.getFirstParagraphBlock(r):this.getNextParagraphCell(e)}return e=e.nextRenderedWidget,this.getNextParagraphCell(e)}return e.nextSplitWidget&&0===e.nextSplitWidget.childWidgets.length&&(e=e.getSplitWidgets().pop()),this.getNextParagraphRow(e.containerWidget)},e.prototype.getNextParagraph=function(e){if(e.nextRenderedWidget instanceof Ys){var t=e.nextRenderedWidget.childWidgets[0];return this.owner.getFirstParagraphBlock(t)}},e.prototype.getFirstBlockInNextHeaderFooter=function(e){var t,i=e.containerWidget;if(-1!==i.headerFooterType.indexOf("Header"))t=i.page.footerWidget.firstChild;else{if(!i.page.nextPage)return;var r=i.page.nextPage,n=r.headerWidget;n.page=r,r.footerWidget&&(r.footerWidget.page=r),t=n.firstChild}return t instanceof Qs?t:this.getFirstBlockInFirstCell(t)},e.prototype.getNextParagraphRow=function(e){if(!t.isNullOrUndefined(e.nextRenderedWidget)){for(var i=e.nextRenderedWidget.childWidgets[0];0===i.childWidgets.length&&!t.isNullOrUndefined(i.previousSplitWidget)&&!t.isNullOrUndefined(i.nextRenderedWidget)&&i.nextRenderedWidget instanceof il;)i=i.nextRenderedWidget;var r=i.childWidgets[0];return t.isNullOrUndefined(r)?this.getNextParagraphCell(i):this.owner.getFirstParagraphBlock(r)}return this.getNextParagraphBlock(e.ownerTable)},e.prototype.getFirstBlockInFirstCell=function(e){if(e.childWidgets.length>0)for(var t=e.childWidgets[0],i=0;i<t.childWidgets.length;i++){var r=t.childWidgets[i];if(r.childWidgets.length>0)return r.childWidgets[0]}},e.prototype.getLastParagraph=function(e){for(;e.nextSplitWidget&&e.nextSplitWidget.childWidgets.length>0;)e=e.nextSplitWidget;var i=void 0;return e.childWidgets.length>0?i=e.lastChild:t.isNullOrUndefined(e.previousSplitWidget)||(i=e.previousSplitWidget.lastChild),this.owner.getLastParagraphBlock(i)},e.prototype.getFieldCode=function(e,i){var r="";if(!(t.isNullOrUndefined(e)||e.fieldEnd instanceof ol))return r;var n=e.paragraph,o=e.fieldEnd.paragraph;e.fieldSeparator instanceof ol&&(o=e.fieldSeparator.paragraph);var a=e.line.indexInOwner,s=e.indexInOwner;do{if(r+=this.getFieldCodeInternal(n,a,s),n===o)break;n=this.getNextParagraphBlock(n),a=0,s=0}while(n instanceof Qs);return i?r:r.trim()},e.prototype.getFieldCodeInternal=function(e,t,i){for(var r="",n=t;n<e.childWidgets.length;n++){for(var o=e.childWidgets[n],a=i;a<o.children.length;a++){var s=o.children[a];if(s instanceof hl&&(r+=s.text),s instanceof ol&&(2===s.fieldType||1===s.fieldType))return r}i=0}return r},e.prototype.getEndPosition=function(e){var i=e.x,r=e.y,n=void 0;e.childWidgets.length>0&&(n=e.childWidgets[e.childWidgets.length-1],e.paragraphFormat.bidi?i=this.getLeft(n):i+=this.getWidth(n,!1)),t.isNullOrUndefined(n)||(r=this.getTop(n));var o=this.getParagraphMarkSize(e,0,0);return new xs(i,r+o.topMargin)},e.prototype.getLeft=function(e){var t=e.paragraph.x,i=e.paragraph.paragraphFormat;this.isParagraphFirstLine(e)&&!i.bidi&&"Right"!==i.textAlignment&&(t+=bs.convertPointToPixel(i.firstLineIndent));for(var r=e.renderedElements,n=0;n<r.length;n++){var o=r[n];if(!(o instanceof kl)||i.bidi){t+=o.margin.left;break}0===n?(t+=o.margin.left+o.width,o.padding&&(t+=o.padding.left)):t+=o.width}return t},e.prototype.getWidth=function(e,i){var r=0,n=e.paragraph.paragraphFormat;this.isParagraphFirstLine(e)&&!n.bidi&&(r+=bs.convertPointToPixel(n.firstLineIndent));for(var o=0;o<e.children.length;o++){var a=e.children[o];a instanceof Cl&&"Inline"!==a.textWrappingStyle||(r+=a.margin.left+a.width+a.padding.left)}return i&&e.paragraph.childWidgets.indexOf(e)===e.paragraph.childWidgets.length-1&&t.isNullOrUndefined(e.paragraph.nextSplitWidget)&&(r+=this.owner.textHelper.getParagraphMarkWidth(e.paragraph.characterFormat)),r},e.prototype.getTop=function(e){if(t.isNullOrUndefined(e)||t.isNullOrUndefined(e.paragraph))return 0;for(var i=e.paragraph.y,r=e.paragraph.childWidgets.indexOf(e),n=0;n<r;n++){var o=e.paragraph.childWidgets[n];i=i+o.height+o.marginTop}return i+=e.marginTop},e.prototype.getParagraphMarkSize=function(e,t,i){var r=this.owner.textHelper.getParagraphMarkSize(e.characterFormat),n=r.BaselineOffset,o=r.Height,a=n;if(e instanceof Qs){e.childWidgets.length>0&&e.childWidgets[0];var s=this.owner.layout.getLineSpacing(e,o),l=this.owner.layout.getBeforeSpacing(e);t=a-n,i=o-a-(r.Height-n);var d=e.paragraphFormat.lineSpacingType;"Multiple"===d?s>o?i+=s-o:t+=s-o:"Exactly"===d?t+=s-(t+r.Height+i):s>t+r.Height+i&&(t+=s-(t+r.Height+i)),t+=l,i+=this.owner.layout.getAfterSpacing(e)}return{width:r.Width,height:r.Height,topMargin:t,bottomMargin:i}},e.prototype.isParagraphFirstLine=function(e){return!(!t.isNullOrUndefined(e.paragraph.previousSplitWidget)||e!==e.paragraph.firstChild)},e.prototype.getFirstParagraph=function(e){for(;e.previousSplitWidget&&e.previousSplitWidget.childWidgets.length>0;)e=e.previousSplitWidget;var t=e.firstChild;return this.owner.getFirstParagraphBlock(t)},e.prototype.getContainerWidget=function(e){var i;if(e.containerWidget instanceof Ol)i=e.containerWidget.containerShape.line.paragraph.bodyWidget;else if(e.containerWidget instanceof Ks)i=!t.isNullOrUndefined(e.containerWidget.containerWidget)&&e.containerWidget.containerWidget instanceof Zs?e.containerWidget.containerWidget:e.containerWidget;else for(i=e.containerWidget;!(i instanceof Ks||(i instanceof Ol&&(i=i.containerShape.line.paragraph),t.isNullOrUndefined(i)||t.isNullOrUndefined(i.containerWidget)));)i=i.containerWidget;return i},e.prototype.getNextRenderedBlock=function(e){return t.isNullOrUndefined(e.nextWidget)?e.nextRenderedWidget:e.nextWidget},e.prototype.isRenderBookmarkAtEnd=function(e){var i;if((i=1===e.bookmarkType?e.reference:e)&&t.isNullOrUndefined(i.properties)){var r=i.reference?i.reference.paragraph.associatedCell:void 0;if(t.isNullOrUndefined(r))return!1;var n=i.reference?i.reference.paragraph.associatedCell.ownerRow:void 0,o=n?n.childWidgets[n.childWidgets.length-1]:void 0;return!t.isNullOrUndefined(o)&&!(r!==o||1===e.bookmarkType&&!t.isNullOrUndefined(e.line)&&e.line.children.indexOf(e)!==e.line.children.length-1)}return!1},e.prototype.addSelectionHighlight=function(e,i,r,n){if(this.selectedWidgets.containsKey(i)){var o=this.owner.render.getScaledValue(i.height),a=this.selectedWidgets.get(i),s=void 0;if(a instanceof Fs?(s=[]).push(a):s=a,!t.isNullOrUndefined(s))for(var l=0;l<s.length;l++){var d=s[l],h=this.owner.render.getScaledValue(s[l].width),c=this.owner.render.getScaledValue(s[l].left,1);if(t.isNullOrUndefined(n)&&(n=this.getPage(i.paragraph)),this.clipSelection(n,this.getPageTop(n)),this.isComposingIME)this.renderDashLine(e,n,i,c,r,h,o);else{e.clearRect(c,this.owner.render.getScaledValue(r,2),h,o),e.globalAlpha=.4;var g="gray";if(this.owner.documentEditorSettings.commentSettings&&this.owner.documentEditorSettings.commentSettings.highlightCommentsByAuthor){var p=this.getSelectedCommentHighlightColor();t.isNullOrUndefined(p)||(g=p)}if(e.fillStyle=g,e.fillRect(c,this.owner.render.getScaledValue(r,2),h,o),d.floatingItems&&d.floatingItems.length>0)for(var u=0;u<d.floatingItems.length;u++){var f=d.floatingItems[u];h=this.owner.render.getScaledValue(f.width),c=this.owner.render.getScaledValue(f.x,1);var m=this.owner.render.getScaledValue(f.y,2);e.fillRect(c,m,h,this.owner.render.getScaledValue(f.height))}}e.restore()}}},e.prototype.addSelectionHighlightTable=function(e,i,r){if(this.selectedWidgets.containsKey(i)){var n=this.selectedWidgets.get(i),o=void 0;if(n instanceof Fs?(o=[]).push(n):o=n,!t.isNullOrUndefined(o))for(var a=0;a<o.length;a++){var s=this.owner.render.getScaledValue(o[a].left,1),l=this.owner.render.getScaledValue(i.y,2),d=this.owner.render.getScaledValue(o[a].width),h=this.owner.render.getScaledValue(i.height);e.clearRect(s,l,d,h),e.fillStyle="gray",t.isNullOrUndefined(r)&&(r=this.getPage(i)),this.clipSelection(r,this.getPageTop(r)),e.fillRect(s,l,d,h),e.restore()}}},e.prototype.getPage=function(e){var i=void 0;if(e.containerWidget instanceof Ol){var r=e.containerWidget.containerShape;r.line&&(i=this.getPage(r.line.paragraph))}else if(e.containerWidget instanceof Ks){e.containerWidget;i=e.containerWidget.page}else t.isNullOrUndefined(e.containerWidget)||(i=this.getPage(e.containerWidget));return i},e.prototype.clipSelection=function(e,t){var i,r;this.owner.viewer instanceof Ms&&this.owner.zoomFactor<1?(i=e.boundingRectangle.width/this.owner.zoomFactor,r=e.boundingRectangle.height/this.owner.zoomFactor):(i=e.boundingRectangle.width*this.owner.zoomFactor,r=e.boundingRectangle.height*this.owner.zoomFactor);var n=e.boundingRectangle.x;this.owner.selectionContext.beginPath(),this.owner.selectionContext.save(),this.owner.selectionContext.rect(n-this.owner.viewer.containerLeft,t-this.owner.viewer.containerTop,i,r),this.owner.selectionContext.clip()},e.prototype.getSelectedCommentHighlightColor=function(){if(!this.isCommentSelected)return null;var e=this.currentSelectedComment;if(e&&e.author){var t=this.owner.getAuthorColor(e.author);return this.owner.convertColorToRGBA(t,.6)}return null},e.prototype.getPageTop=function(e){return t.isNullOrUndefined(e.boundingRectangle)?0:(e.boundingRectangle.y-this.owner.viewer.pageGap*(this.owner.pages.indexOf(e)+1))*this.owner.zoomFactor+this.owner.viewer.pageGap*(this.owner.pages.indexOf(e)+1)},e.prototype.renderDashLine=function(e,t,i,r,n,o,a){var s=this.owner.characterFormat.fontColor,l=s?bs.getColor(s):"#000000";e.globalAlpha=1;var d=this.copyInsertFormat(new S(void 0,this.owner),!1),h=this.owner.textHelper.getHeight(d),c=this.getPageTop(t),g=h.Height-h.BaselineOffset;n=this.owner.render.getUnderlineYPosition(i)+n+4-g,this.owner.render.renderDashLine(e,r,c-this.owner.viewer.containerTop+n*this.owner.zoomFactor,o,l,!0)},e.prototype.getNextTextElement=function(e){return e.nextNode instanceof hl?e.nextNode:t.isNullOrUndefined(e.nextNode)?void 0:this.getNextTextElement(e.nextNode)},e.prototype.getPreviousTextElement=function(e){return e.previousNode instanceof hl?e.previousNode:t.isNullOrUndefined(e.previousNode)?void 0:this.getPreviousTextElement(e.previousNode)},e.prototype.getPreviousParagraphBlock=function(e,t){return e.previousRenderedWidget instanceof Qs?e.previousRenderedWidget:e.previousRenderedWidget instanceof el?this.owner.getLastParagraphInLastCell(e.previousRenderedWidget):e.containerWidget instanceof il?this.getPreviousParagraphCell(e.containerWidget):e.containerWidget instanceof Ys?this.getPreviousParagraph(e.containerWidget):e.containerWidget instanceof Xs&&this.isMoveDownOrMoveUp&&!t?this.getLastBlockInPreviousHeaderFooter(e):void 0},e.prototype.getPreviousParagraphCell=function(e){if(!t.isNullOrUndefined(e.previousRenderedWidget)&&e.previousRenderedWidget instanceof il){var i=(e=e.previousRenderedWidget).lastChild;return this.owner.getLastParagraphBlock(i)}return this.getPreviousParagraphRow(e.ownerRow)},e.prototype.getPreviousParagraphRow=function(e){if(!t.isNullOrUndefined(e.previousRenderedWidget)){var i=e.previousRenderedWidget.lastChild,r=i.lastChild?i.lastChild:i.previousSplitWidget.lastChild;return this.owner.getLastParagraphBlock(r)}return this.getPreviousParagraphBlock(e.ownerTable)},e.prototype.getPreviousParagraph=function(e){if(e.previousRenderedWidget instanceof Ys){var t=e.previousRenderedWidget,i=t.childWidgets[t.childWidgets.length-1];return this.owner.getLastParagraphBlock(i)}},e.prototype.getLastBlockInPreviousHeaderFooter=function(e){var t,i=e.containerWidget;if(-1!==i.headerFooterType.indexOf("Footer"))t=i.page.headerWidget.lastChild;else{if(!i.page.previousPage)return;var r=i.page.previousPage,n=r.footerWidget;n.page=r,r.headerWidget&&(r.headerWidget.page=r),t=n.lastChild}return t instanceof Qs?t:this.getFirstBlockInFirstCell(t)},e.prototype.isTocStyle=function(e){var t=e.paragraphFormat.baseStyle;return void 0!==t&&-1!==t.name.toLowerCase().indexOf("toc")},e.prototype.constructRevisionsForTable=function(e,t){for(var i=0;i<e.childWidgets.length;i++){var r=e.childWidgets[i];if(t){this.canConstructRevision(r.rowFormat)&&this.constructRevisionFromID(r.rowFormat);for(var n=0;n<r.childWidgets.length;n++)for(var o=r.childWidgets[n],a=0;a<o.childWidgets.length;a++)o.childWidgets[a]instanceof Qs?this.constructRevisionsForBlock(o.childWidgets[a],t):o.childWidgets[a]instanceof el&&this.constructRevisionsForTable(o.childWidgets[a],!0)}}},e.prototype.canConstructRevision=function(e){return!!(e.revisionLength>0&&(t.isNullOrUndefined(e.getRevision(0).ownerNode)||0===e.getRevision(0).getRange().length)||e.removedIds.length>0)},e.prototype.constructRevisionsForBlock=function(e,t){for(var i=0;i<e.childWidgets.length;i++)for(var r=e.childWidgets[i],n=0;n<r.children.length;n++)t&&(r.children[n]instanceof nl&&this.canConstructRevision(r.children[n])&&this.constructRevisionFromID(r.children[n]),r.children[n]instanceof gl&&this.constructRevisionForFootnote(r.children[n],t));this.canConstructRevision(e.characterFormat)&&this.constructRevisionFromID(e.characterFormat)},e.prototype.constructRevisionForFootnote=function(e,t){for(var i=0;i<e.bodyWidget.childWidgets.length;i++)e.bodyWidget.childWidgets[i]instanceof Qs&&this.constructRevisionsForBlock(e.bodyWidget.childWidgets[i],t)},e.prototype.constructRevisionFromID=function(e){if(e.removedIds.length>0){for(r=0;r<e.removedIds.length;r++)if(this.owner.revisionsInternal.containsKey(e.removedIds[r])){var i=this.owner.revisionsInternal.get(e.removedIds[r]);i.ownerNode=e instanceof nl?e.paragraph:e,e.addRevision(i),t.isNullOrUndefined(this.owner.hooks.onRevisionConstructed)||this.owner.hooks.onRevisionConstructed(i,e)}e.removedIds=[]}else for(var r=0;r<e.revisionLength;r++){var n=e.getRevision(r);this.owner.revisionsInternal.containsKey(n.revisionID)&&((n=this.owner.revisionsInternal.get(n.revisionID)).ownerNode=e instanceof nl?e.paragraph:e,e.removeRevision(r),e.insertRevisionAt(r,n),t.isNullOrUndefined(this.owner.hooks.onRevisionConstructed)||this.owner.hooks.onRevisionConstructed(n,e))}},e.prototype.copyInsertFormat=function(e,i,r){var n=r?new S(r,this.owner):new S(void 0,this.owner),o=this.owner.selectionCharacterFormat;return t.isNullOrUndefined(o)?i?n:e:(i&&n.copyFormat(e),t.isNullOrUndefined(o.bidi)||e.bidi===o.bidi||(n.bidi=o.bidi),t.isNullOrUndefined(o.bold)||e.bold===o.bold||(n.bold=o.bold),t.isNullOrUndefined(o.italic)||e.italic===o.italic||(n.italic=o.italic),o.fontSize>0&&e.fontSize!==o.fontSize&&(n.fontSize=o.fontSize),t.isNullOrUndefined(o.fontFamily)||e.fontFamily===o.fontFamily||(n.fontFamily=o.fontFamily),t.isNullOrUndefined(o.highlightColor)||e.highlightColor===o.highlightColor||(n.highlightColor=o.highlightColor),t.isNullOrUndefined(o.baselineAlignment)||e.baselineAlignment===o.baselineAlignment||(n.baselineAlignment=o.baselineAlignment),t.isNullOrUndefined(o.fontColor)||e.fontColor===o.fontColor||(n.fontColor=o.fontColor),t.isNullOrUndefined(o.underline)||e.underline===o.underline||(n.underline=o.underline),t.isNullOrUndefined(o.strikethrough)||e.strikethrough===o.strikethrough||(n.strikethrough=o.strikethrough),t.isNullOrUndefined(o.boldBidi)||e.boldBidi===o.boldBidi||(n.boldBidi=o.boldBidi),t.isNullOrUndefined(o.italicBidi)||e.italicBidi===o.italicBidi||(n.italicBidi=o.italicBidi),o.fontSizeBidi>0&&e.fontSizeBidi!==o.fontSizeBidi&&(n.fontSizeBidi=o.fontSizeBidi),n)},e.prototype.removeFieldInWidget=function(e,i,r,n){t.isNullOrUndefined(i)&&(i=!1);for(var o=0;o<e.childWidgets.length;o++)this.removeFieldInBlock(e.childWidgets[o],i,r,n)},e.prototype.removeFieldInBlock=function(e,i,r,n){if(e instanceof el){if(e.wrapTextAround&&!t.isNullOrUndefined(e.bodyWidget)){var o=e.bodyWidget.floatingElements.indexOf(e);-1!==o&&e.bodyWidget.floatingElements.splice(o,1)}this.removeFieldTable(e,i,r,n)}else if(e instanceof tl)for(var a=0;a<e.childWidgets.length;a++)this.removeFieldInWidget(e.childWidgets[a],i,r,n);else this.removeField(e,i,r,n)},e.prototype.removeFieldTable=function(e,t,i,r){for(var n=0;n<e.childWidgets.length;n++)for(var o=e.childWidgets[n],a=0;a<o.childWidgets.length;a++)this.removeFieldInWidget(o.childWidgets[a],t,i,r)},e.prototype.removeField=function(e,i,r,n){var o=this.owner.fields;if(i?o=this.owner.bookmarks.keys:r&&(o=this.owner.contentControlCollection),e.floatingElements.length>0)for(var a=0;a<e.floatingElements.length;a++){var s=e.floatingElements[a];if(s instanceof Pl&&s.textFrame&&s.textFrame.childWidgets.length>0)for(c=0;c<s.textFrame.childWidgets.length;c++){var l=s.textFrame.childWidgets[c];this.removeFieldInBlock(l,i,r)}this.removeAutoShape(s),a--}for(c=0;c<o.length;c++)((g=i?this.owner.bookmarks.get(o[c]):o[c]).line.paragraph===e||g instanceof ml&&!t.isNullOrUndefined(g.reference)&&g.reference.line.paragraph===e)&&(r?this.owner.contentControlCollection.splice(c,1):(this.owner.fields.splice(c,1),-1!==this.owner.formFields.indexOf(g)&&this.owner.formFields.splice(this.owner.formFields.indexOf(g),1)),c--);if(this.owner.footnoteCollection.length>0)for(c=0;c<this.owner.footnoteCollection.length;c++)if((g=this.owner.footnoteCollection[c]).line.paragraph===e){if(g.paragraph.bodyWidget.page.footnoteWidget){for(var d=g.paragraph.bodyWidget.page.footnoteWidget,h=0;h<d.bodyWidgets.length;h++)g===d.bodyWidgets[h].footNoteReference&&(d.height-=d.bodyWidgets[h].height,d.bodyWidgets.splice(h,1),h--);0===d.bodyWidgets.length&&(g.paragraph.bodyWidget.page.footnoteWidget=void 0)}this.owner.footnoteCollection.splice(c,1),c--}if(this.owner.endnoteCollection.length>0)for(var c=0;c<this.owner.endnoteCollection.length;c++){var g=this.owner.endnoteCollection[c];if(g.line.paragraph===e){if(g.paragraph.bodyWidget.page.endnoteWidget){for(var p=g.paragraph.bodyWidget.page.endnoteWidget,h=0;h<p.bodyWidgets.length;h++)g===p.bodyWidgets[h].footNoteReference&&(p.height-=p.bodyWidgets[h].height,p.bodyWidgets.splice(h,1),h--);0===p.bodyWidgets.length&&(g.paragraph.bodyWidget.page.endnoteWidget=void 0)}this.owner.endnoteCollection.splice(c,1),c--}}},e.prototype.removeAutoShape=function(e){var t=e.line.paragraph.floatingElements.indexOf(e),i=e.line.paragraph.bodyWidget.floatingElements.indexOf(e);i>-1&&e.line.paragraph.bodyWidget.floatingElements.splice(i,1),e.line.paragraph.floatingElements.splice(t,1)},e.prototype.destroy=function(){this.owner=void 0},e}(),Id=function(e,t,i,r){return new(i||(i=Promise))(function(n,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){e.done?n(e.value):new i(function(t){t(e.value)}).then(a,s)}l((r=r.apply(e,t||[])).next())})},kd=function(e,t){function i(e){return function(t){return r([e,t])}}function r(i){if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,o&&(a=2&i[0]?o.return:i[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,i[1])).done)return a;switch(o=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return l.label++,{value:i[1],done:!1};case 5:l.label++,o=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(a=l.trys,!(a=a.length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){l.label=i[1];break}if(6===i[0]&&l.label<a[1]){l.label=a[1],a=i;break}if(a&&l.label<a[2]){l.label=a[2],l.ops.push(i);break}a[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}catch(e){i=[6,e],o=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}var n,o,a,s,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s},Ad=function(){function e(){this.enableLayout=!0,this.layoutType="Pages",this.isLayoutEnabled=!0,this.isShiftingEnabled=!1,this.isEditorModule=!1,this.isSfdtExportModule=!1,this.isSelectionModule=!1,this.isFormatPainterModule=!1,this.formatPainterCursor="text",this.formatPainterActive=!1,this.viewerContainer=void 0,this.isSelectionInHeaderFooter=!1,this.isSpellCheck=!1,this.pageOutline="#000000",this.copyWithTrackChange=!1,this.currentPage=void 0,this.backgroundColor="#FFFFFF",this.enableTrackChanges=!1,this.restrictFormatting=!1,this.protectionType="NoProtection",this.isDocumentProtected=!1,this.hashValue="",this.saltValue="",this.cryptAlgorithmSid="",this.cryptAlgorithmType="",this.cryptAlgorithmClass="",this.skipSettingsOps=!1,this.fieldStacks=[],this.splittedCellWidgets=[],this.tableLefts=[],this.isFirstLineFitInShiftWidgets=!1,this.zoomFactor=1,this.fields=[],this.heightInfoCollection={},this.defaultTabWidth=36,this.dontUseHtmlParagraphAutoSpacing=!1,this.allowSpaceOfSameStyleInTable=!1,this.alignTablesRowByRow=!1,this.compatibilityMode="Word2013",this.lists=[],this.comments=[],this.authors=new p,this.revisionsInternal=new p,this.abstractLists=[],this.styles=new Is,this.stylesMap=new p,this.preDefinedStyles=void 0,this.isRowOrCellResizing=!1,this.endBookmarksUpdated=[],this.formFields=[],this.fieldCollection=[],this.isPageField=!1,this.isTextInput=!1,this.userCollection=[],this.cachedPages=[],this.isIosDevice=!1,this.isMobileDevice=!1,this.isLinuxOS=!1,this.isFormFilling=!1,this.fontSubstitutionTable=void 0,this.themes=new bd,this.hasThemes=!1,this.footnotes=new cl,this.endnotes=new cl,this.isFootnoteWidget=!1,this.isUpdatedWhileLoadAsync=!1,this.isRestartNumbering=!1,this.visibleBoundsIn=new zs(0,0,816,1056),this.currentDocumentLoadId=0,this.scheduledTimeouts={},this.resizerBoundaryWidth=0,this.isFollowedListLayoutRequired=!1,this.externalFonts=[],this.locale="",this.defaultLocale={Header:"Header",Footer:"Footer","First Page Header":"First Page Header","First Page Footer":"First Page Footer","Even Page Header":"Even Page Header","Even Page Footer":"Even Page Footer","Odd Page Header":"Odd Page Header","Odd Page Footer":"Odd Page Footer","Same as Previous":"Same as Previous",Section:"Section","Page Break":"Page Break","Column Break":"Column Break","Section Break Continuous":"Section Break Continuous","Section Break Next Page":"Section Break Next Page","This region is locked by":"This region is locked by"},this.editorProperties=new Nd(this),this.documentEditorSettings=new Td,this.documentSettings=new Od,this.hooks=new Sd,this.parser=new xd(this),this.pages=[],this.lists=[],this.abstractLists=[],this.characterFormat=new S(this),this.themeFontLanguage=new S(this),this.paragraphFormat=new Ls(this),this.renderedLists=new p,this.renderedLevelOverrides=[],this.headersFooters=[],this.styles=new Is,this.stylesMap=new p,this.preDefinedStyles=new p,this.initalizeStyles(),this.bookmarks=new p,this.editRanges=new p,this.isIosDevice="undefined"!=typeof window&&/Mac|iPad|iPod/i.test(navigator.userAgent),this.isMobileDevice="undefined"!=typeof window&&/Android|Windows Phone|webOS/i.test(navigator.userAgent),this.isLinuxOS="undefined"!=typeof window&&/Linux/i.test(navigator.userAgent),this.customXmlData=new p,this.fontSubstitutionTable=new p,this.contentControlCollection=[],this.footnoteCollection=[],this.endnoteCollection=[],this.themes=new bd,this.images=new p,this.textMeasureHelper=new Ud(this),this.viewer=new Es(this),this.render=new Pd(this),this.initializeComponents()}return Object.defineProperty(e.prototype,"element",{get:function(){return this.hostElement?this.hostElement:this.elementIn},set:function(e){this.elementIn=e},enumerable:!0,configurable:!0}),e.prototype.getSections=function(){return this.sections},e.prototype.getInsertedRevision=function(){return this.editorProperties.revision},e.prototype.getRevisionItem=function(){return this.editorProperties.revisionItem},Object.defineProperty(e.prototype,"currentRenderingPage",{get:function(){if(0!==this.pages.length)return this.pages[this.pages.length-1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"visibleBounds",{get:function(){return this.visibleBoundsIn},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionCanvas",{get:function(){return t.isNullOrUndefined(this.selectionCanvasIn)&&(this.selectionCanvasIn=document.createElement("canvas"),this.selectionCanvas.getContext("2d").save()),t.isNullOrUndefined(this.pageContainer)||this.selectionCanvasIn.parentElement===this.pageContainer||(this.pageContainer.appendChild(this.selectionCanvasIn),this.syncFormatPainterCursor(this.selectionCanvasIn)),this.selectionCanvasIn},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"containerCanvas",{get:function(){return t.isNullOrUndefined(this.containerCanvasIn)&&(this.containerCanvasIn=document.createElement("canvas"),this.containerCanvasIn.getContext("2d").save()),t.isNullOrUndefined(this.pageContainer)||this.containerCanvasIn.parentElement===this.pageContainer||(this.pageContainer.appendChild(this.containerCanvasIn),this.syncFormatPainterCursor(this.containerCanvasIn)),this.containerCanvasIn},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionContext",{get:function(){return this.selectionCanvas.getContext("2d")},enumerable:!0,configurable:!0}),e.prototype.initalizeStyles=function(){this.preDefinedStyles.add("Normal",'{"type":"Paragraph","name":"Normal","next":"Normal"}'),this.preDefinedStyles.add("Heading 1",'{"type":"Paragraph","name":"Heading 1","basedOn":"Normal","next":"Normal","link":"Heading 1 Char","characterFormat":{"fontSize":16.0,"fontFamily":"Calibri Light","fontColor":"#2F5496"},"paragraphFormat":{"leftIndent":0.0,"rightIndent":0.0,"firstLineIndent":0.0,"beforeSpacing":12.0,"afterSpacing":0.0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","textAlignment":"Left","outlineLevel":"Level1"}}'),this.preDefinedStyles.add("Heading 2",'{"type":"Paragraph","name":"Heading 2","basedOn":"Normal","next":"Normal","link":"Heading 2 Char","characterFormat":{"fontSize":13.0,"fontFamily":"Calibri Light","fontColor":"#2F5496"},"paragraphFormat":{"leftIndent":0.0,"rightIndent":0.0,"firstLineIndent":0.0,"beforeSpacing":2.0,"afterSpacing":0.0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","textAlignment":"Left","outlineLevel":"Level2"}}'),this.preDefinedStyles.add("Heading 3",'{"type":"Paragraph","name":"Heading 3","basedOn":"Normal","next":"Normal","link":"Heading 3 Char","characterFormat":{"fontSize":12.0,"fontFamily":"Calibri Light","fontColor":"#1F3763"},"paragraphFormat":{"leftIndent":0.0,"rightIndent":0.0,"firstLineIndent":0.0,"beforeSpacing":2.0,"afterSpacing":0.0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","textAlignment":"Left","outlineLevel":"Level3"}}'),this.preDefinedStyles.add("Heading 4",'{"type":"Paragraph","name":"Heading 4","basedOn":"Normal","next":"Normal","link":"Heading 4 Char","characterFormat":{"italic":true,"fontFamily":"Calibri Light","fontColor":"#2F5496"},"paragraphFormat":{"leftIndent":0.0,"rightIndent":0.0,"firstLineIndent":0.0,"beforeSpacing":2.0,"afterSpacing":0.0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","textAlignment":"Left","outlineLevel":"Level4"}}'),this.preDefinedStyles.add("Heading 5",'{"type":"Paragraph","name":"Heading 5","basedOn":"Normal","next":"Normal","link":"Heading 5 Char","characterFormat":{"fontFamily":"Calibri Light","fontColor":"#2F5496"},"paragraphFormat":{"leftIndent":0.0,"rightIndent":0.0,"firstLineIndent":0.0,"beforeSpacing":2.0,"afterSpacing":0.0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","textAlignment":"Left","outlineLevel":"Level5"}}'),this.preDefinedStyles.add("Heading 6",'{"type":"Paragraph","name":"Heading 6","basedOn":"Normal","next":"Normal","link":"Heading 6 Char","characterFormat":{"fontFamily":"Calibri Light","fontColor":"#1F3763"},"paragraphFormat":{"leftIndent":0.0,"rightIndent":0.0,"firstLineIndent":0.0,"beforeSpacing":2.0,"afterSpacing":0.0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","textAlignment":"Left","outlineLevel":"Level6"}}'),this.preDefinedStyles.add("Heading 7",'{"type":"Paragraph","name":"Heading 7","basedOn":"Normal","next":"Normal","link":"Heading 7 Char","characterFormat":{"italic":true,"fontFamily":"Calibri Light","fontColor":"#1F3763"},"paragraphFormat":{"leftIndent":0.0,"rightIndent":0.0,"firstLineIndent":0.0,"beforeSpacing":2.0,"afterSpacing":0.0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","textAlignment":"Left","outlineLevel":"Level7"}}'),this.preDefinedStyles.add("Heading 8",'{"type":"Paragraph","name":"Heading 8","basedOn":"Normal","next":"Normal","link":"Heading 8 Char","characterFormat":{"fontSize":10.5,"fontFamily":"Calibri Light","fontColor":"#333333"},"paragraphFormat":{"leftIndent":0.0,"rightIndent":0.0,"firstLineIndent":0.0,"beforeSpacing":2.0,"afterSpacing":0.0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","textAlignment":"Left","outlineLevel":"Level8"}}'),this.preDefinedStyles.add("Heading 9",'{"type":"Paragraph","name":"Heading 9","basedOn":"Normal","next":"Normal","link":"Heading 9 Char","characterFormat":{"fontSize":10.5,"italic":true,"fontFamily":"Calibri Light","fontColor":"#333333"},"paragraphFormat":{"leftIndent":0.0,"rightIndent":0.0,"firstLineIndent":0.0,"beforeSpacing":2.0,"afterSpacing":0.0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","textAlignment":"Left","outlineLevel":"Level9"}}'),this.preDefinedStyles.add("Default Paragraph Font",'{"type":"Character","name":"Default Paragraph Font"}'),this.preDefinedStyles.add("Heading 1 Char",'{"type":"Character","name":"Heading 1 Char","basedOn":"Default Paragraph Font","characterFormat":{"fontSize":16.0,"fontFamily":"Calibri Light","fontColor":"#2F5496"}}'),this.preDefinedStyles.add("Heading 2 Char",'{"type":"Character","name":"Heading 2 Char","basedOn":"Default Paragraph Font","characterFormat":{"fontSize":13.0,"fontFamily":"Calibri Light","fontColor":"#2F5496"}}'),this.preDefinedStyles.add("Heading 3 Char",'{"type":"Character","name":"Heading 3 Char","basedOn":"Default Paragraph Font","characterFormat":{"fontSize":12.0,"fontFamily":"Calibri Light","fontColor": "#1F3763"}}'),this.preDefinedStyles.add("Heading 4 Char",'{"type":"Character","name":"Heading 4 Char","basedOn":"Default Paragraph Font","characterFormat":{"italic":true,"fontFamily":"Calibri Light","fontColor":"#2F5496"}}'),this.preDefinedStyles.add("Heading 5 Char",'{"type":"Character","name":"Heading 5 Char","basedOn":"Default Paragraph Font","characterFormat":{"fontFamily":"Calibri Light","fontColor":"#2F5496"}}'),this.preDefinedStyles.add("Heading 6 Char",'{"type":"Character","name":"Heading 6 Char","basedOn":"Default Paragraph Font","characterFormat":{"fontFamily":"Calibri Light","fontColor":"#1F3763"}}'),this.preDefinedStyles.add("Heading 7 Char",'{"type":"Character","name":"Heading 7 Char","basedOn":"Default Paragraph Font","characterFormat":{"italic":true,"fontFamily":"Calibri Light","fontColor":"#1F3763"}}'),this.preDefinedStyles.add("Heading 8 Char",'{"type":"Character","name":"Heading 8 Char","basedOn":"Default Paragraph Font","characterFormat":{"fontSize":10.5,"fontFamily":"Calibri Light","fontColor":"#333333"}}'),this.preDefinedStyles.add("Heading 9 Char",'{"type":"Character","name":"Heading 9 Char","basedOn":"Default Paragraph Font","characterFormat":{"fontSize":10.5,"italic":true,"fontFamily":"Calibri Light","fontColor":"#333333"}}'),this.preDefinedStyles.add("Hyperlink",'{"type":"Character","name":"Hyperlink","basedOn":"Default Paragraph Font","next":"Normal","characterFormat":{"fontColor":"#0563C1","underline": "Single"}}'),this.preDefinedStyles.add("TOC 1",'{"type":"Paragraph","name":"TOC 1","basedOn":"Normal","next":"Normal","paragraphFormat":{"afterSpacing":5.0}}'),this.preDefinedStyles.add("TOC 2",'{"type":"Paragraph","name":"TOC 2","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :11.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("TOC 3",'{"type":"Paragraph","name":"TOC 3","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :22.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("TOC 4",'{"type":"Paragraph","name":"TOC 4","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :33.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("TOC 5",'{"type":"Paragraph","name":"TOC 5","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :44.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("TOC 6",'{"type":"Paragraph","name":"TOC 6","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :55.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("TOC 7",'{"type":"Paragraph","name":"TOC 7","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :66.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("TOC 8",'{"type":"Paragraph","name":"TOC 8","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :77.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("TOC 9",'{"type":"Paragraph","name":"TOC 9","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :88.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("Header",'{"type":"Paragraph","name":"Header","basedOn":"Normal","next":"Header","paragraphFormat":{"afterSpacing":0,"lineSpacing":1,"lineSpacingType":"Multiple"}}'),this.preDefinedStyles.add("Footer",'{"type":"Paragraph","name":"Footer","basedOn":"Normal","next":"Footer","paragraphFormat":{"afterSpacing":0,"lineSpacing":1,"lineSpacingType":"Multiple"}}')},e.prototype.open=function(e){if(!t.isNullOrUndefined(e)&&("string"==typeof e||"object"==typeof e))if(e instanceof Blob)this.handleBlobOpen(e);else{var i={};this.setDefaultDocumentFormat(),this.sections=this.parser.convertJsonToDocument(e,i)}},e.prototype.handleBlobOpen=function(e){var t=this,i=new FileReader;i.onload=function(){try{var e=i.result;JSON.parse(e),t.open(e)}catch(e){console.error("Failed to parse blob as SFDT:",e)}},i.onerror=function(){console.error("Failed to read blob")},i.readAsText(e)},e.prototype.syncFormatPainterCursor=function(e){t.isNullOrUndefined(e)||t.isNullOrUndefined(this.isFormatPainterModule)||!this.formatPainterActive||(e.style.cursor=this.viewerContainer&&this.viewerContainer.style.cursor?this.viewerContainer.style.cursor:this.formatPainterCursor)},e.prototype.clearDocumentItems=function(){this.editRanges.clear(),this.headersFooters=[],this.fields=[],this.layout.lastScrollUpdatePageIndex=-1,this.formFields=[];for(t=0;t<this.comments.length;t++){var e=this.comments[t].commentStart;e&&e.destroy()}if(this.comments=[],this.bookmarks.clear(),this.endBookmarksUpdated=[],this.styles.clear(),this.stylesMap.clear(),this.pages&&this.pages.length>0){for(t=0;t<this.pages.length;t++)this.pages[t].componentDestroy();this.pages=[]}if(this.authors.clear(),this.revisionsInternal.clear(),this.characterFormat.clearFormat(),this.themeFontLanguage.clearFormat(),this.paragraphFormat.clearFormat(),this.setDefaultCharacterValue(this.characterFormat),this.setDefaultParagraphValue(this.paragraphFormat),this.defaultTabWidth=36,this.userCollection=[],this.customXmlData.clear(),this.fontSubstitutionTable.clear(),this.images.clear(),this.contentControlCollection=[],this.splittedCellWidgets=[],this.endnotes.clear(),this.footnotes.clear(),this.footnoteCollection=[],this.endnoteCollection=[],this.lists&&this.lists.length>0)for(var t=0;t<this.lists.length;t++)this.lists[Number(t)].clear();this.lists=[],this.abstractLists=[],this.sections=[],this.themes=new bd,this.hasThemes=!1,this.isRestartNumbering=!1,this.isUpdatedWhileLoadAsync=!1,this.isFollowedListLayoutRequired=!1},e.prototype.setDefaultDocumentFormat=function(){t.isNullOrUndefined(this.editorCharacterFormat)||this.parser.parseCharacterFormat(0,this.editorCharacterFormat,this.characterFormat),t.isNullOrUndefined(this.editorParagraphFormat)||this.parser.parseParagraphFormat(0,this.editorParagraphFormat,this.paragraphFormat),t.isNullOrUndefined(this.documentCharacterFormat)||this.parser.parseCharacterFormat(0,this.documentCharacterFormat,this.characterFormat),t.isNullOrUndefined(this.documentParagraphFormat)||this.parser.parseParagraphFormat(0,this.documentParagraphFormat,this.paragraphFormat)},e.prototype.initializeComponents=function(){this.layout=new ud(this),this.textHelper=new hd(this)},e.prototype.setDefaultCharacterValue=function(e){e.bold=!1,e.italic=!1,e.fontFamily="Calibri",e.fontSize=11,e.underline="None",e.strikethrough="None",e.fontSizeBidi=11,e.fontFamilyBidi="Calibri",e.baselineAlignment="Normal",e.highlightColor="NoColor",e.allCaps=!1},e.prototype.setDefaultParagraphValue=function(e){e.leftIndent=0,e.rightIndent=0,e.firstLineIndent=0,e.textAlignment="Left",e.beforeSpacing=0,e.afterSpacing=0,e.lineSpacing=1,e.lineSpacingType="Multiple",e.bidi=!1,e.keepWithNext=!1,e.keepLinesTogether=!1,e.widowControl=!0,e.outlineLevel="BodyText"},e.prototype.getAbstractListById=function(e,i){if(!t.isNullOrUndefined(this.abstractLists))for(var r=0;r<this.abstractLists.length;r++){var n=this.abstractLists[r];if(!t.isNullOrUndefined(n)){if(i&&n.nsid===e)return n;if(n.abstractListId===e)return n}}},e.prototype.getListById=function(e,i){if(!t.isNullOrUndefined(this.lists))for(var r=0;r<this.lists.length;r++){var n=this.lists[r];if(!t.isNullOrUndefined(n)){if(i&&n.nsid===e)return n;if(n.listId===e)return n}}},e.getListLevelNumber=function(e){return e.ownerBase instanceof fd?e.ownerBase.levelNumber:e.ownerBase instanceof sd&&!t.isNullOrUndefined(e.ownerBase.levels)?e.ownerBase.levels.indexOf(e):-1},e.prototype.getImageString=function(e){var i=this.images.get(parseInt(e.imageString,10));return t.isNullOrUndefined(i)||0===i.length?"":e.isMetaFile&&".svg"!==bs.formatClippedString(i[0]).extension?i[1]:".tif"===bs.formatClippedString(i[0]).extension?i[1]:i[0]},e.prototype.addBase64StringInCollection=function(e){return Id(this,void 0,void 0,function(){var i,r,n,o,a,s;return kd(this,function(l){for(i=this.images.length>0?Math.max.apply(Math,this.images.keys)+1:0,r=!0,n=[],o=0;o<this.images.length;o++){if(a=this.images.keys[parseInt(o.toString(),10)],s=this.images.get(a),e.isMetaFile&&e.metaFileImageString===s[0]){i=a,r=!1;break}if(e.imageString===s[0]){i=a,r=!1;break}}return r&&(e.isMetaFile?(n.push(t.isNullOrUndefined(e.metaFileImageString)?e.imageString:e.metaFileImageString),n.push(""===e.imageString?e.metaFileImageString:e.imageString)):n.push(e.imageString),this.images.add(i,n)),e.isMetaFile&&!t.isNullOrUndefined(e.metaFileImageString)&&(e.metaFileImageString=i.toString()),e.imageString=i.toString(),[2]})})},e.prototype.getBookmarks=function(e){for(var t=[],i=0;i<this.bookmarks.keys.length;i++){var r=this.bookmarks.keys[Number(i)];(e||0!==r.indexOf("_"))&&t.push(r)}return t},e.prototype.getBase64=function(e,t,i){return Id(this,void 0,void 0,function(){return kd(this,function(t){return[2,new Promise(function(t,i){var r=new Image;r.onload=function(){var e=document.createElement("canvas");e.width=r.naturalWidth,e.height=r.naturalHeight,e.getContext("2d").drawImage(r,0,0,r.naturalWidth,r.naturalHeight);var i=e.toDataURL("image/png",1);t(i)},r.onerror=function(){i()},e&&(bs.startsWith(e,"http://")||bs.startsWith(e,"https://"))&&fetch(e,{cache:"no-cache"}).then(function(e){return e.blob()}).then(function(e){return new Promise(function(t,i){var r=new FileReader;r.onloadend=function(){return t(r.result)},r.onerror=i,r.readAsDataURL(e)})}).then(function(e){r.src=e}).catch(function(){i()})})]})})},e.prototype.storeTimeoutId=function(e,t){this.scheduledTimeouts[e]||(this.scheduledTimeouts[e]=[]),this.scheduledTimeouts[e].push(t)},e.prototype.convertColorToRGBA=function(e,t){var i=e.replace("#","");return"rgba("+parseInt(i.substring(0,2),16)+", "+parseInt(i.substring(2,4),16)+", "+parseInt(i.substring(4,6),16)+", "+Math.max(0,Math.min(1,t))+")"},e.prototype.getAuthorColor=function(e){if(this.authors.containsKey(e))return this.authors.get(e);var t=this.generateRandomColor();return this.authors.add(e,t),t},e.prototype.generateRandomColor=function(){var e=["#b5082e","#0e76b1","#bb00ff","#c14f16","#128317","#881824","#a26400","#50565e"],i=this.documentEditorSettings.revisionSettings;if(!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(i.revisionColors)&&i.revisionColors.length>0){var r=i.revisionColors.filter(function(e){return!t.isNullOrUndefined(e)&&""!==e});r.length>0&&(e=r)}return e[this.authors.length%e.length]},e.prototype.getPageWidth=function(e){return e.boundingRectangle.width},e.prototype.removePage=function(e){this.currentPage===e&&(this.currentPage=void 0),e.headerWidgetIn&&(e.headerWidgetIn.page=void 0),e.footerWidgetIn&&(e.footerWidgetIn.page=void 0),e.headerWidget&&e.headerWidget.page===e&&(e.headerWidget.page=void 0),e.footerWidget&&e.footerWidget.page===e&&(e.footerWidget.page=void 0);var i=this.pages.indexOf(e);if(i>-1&&this.pages.splice(i,1),!t.isNullOrUndefined(this.viewer.visiblePages)&&this.viewer.visiblePages.indexOf(e)>-1){var r=this.viewer.visiblePages.indexOf(e);this.viewer.visiblePages.splice(r,1)}for(var n=0,o=0;o<this.pages.length;o++)n+=this.pages[o].boundingRectangle.height;n-=e.boundingRectangle.height+20;var a=20;if(i>0&&(a+=this.pages[i-1].boundingRectangle.bottom),-1!==i)for(o=i;o<this.pages.length;o++)(e=this.pages[o]).boundingRectangle=new zs(e.boundingRectangle.x,a,e.boundingRectangle.width,e.boundingRectangle.height),a=e.boundingRectangle.bottom+20,!(e.bodyWidgets.length>0)||t.isNullOrUndefined(e.bodyWidgets[0].firstChild)||e.bodyWidgets[0].firstChild instanceof el&&e.bodyWidgets[0].firstChild.header||(e.repeatHeaderRowTableWidget=!1)},e.prototype.insertPage=function(e,t){var i=!1;this.pages.indexOf(t)!==e&&(i=!0),this.pages.indexOf(t)>-1&&this.pages.splice(this.pages.indexOf(t),1),this.pages.splice(e,0,t);var r=20;e>0&&(r+=this.pages[e-1].boundingRectangle.bottom);for(var n=e;n<this.pages.length;n++)t=this.pages[n],i&&(t.currentPageNum=1),t.boundingRectangle=new zs(t.boundingRectangle.x,r,t.boundingRectangle.width,t.boundingRectangle.height),r=t.boundingRectangle.bottom+20},e.prototype.removeEmptyPages=function(e){for(var i=!1,r=!1,n=t.isNullOrUndefined(this.editorProperties.selectionStartPage)?-1:this.editorProperties.selectionStartPage-1,o=0;o<this.pages.length;o++){for(var a=this.pages[Number(o)],s=0;s<a.bodyWidgets.length;s++){g=a.bodyWidgets[Number(s)];if((0===a.bodyWidgets.length||0===g.childWidgets.length)&&a.bodyWidgets.length>=1){var l=a.bodyWidgets.indexOf(g);a.bodyWidgets.splice(l,1),s--}}if(a.bodyWidgets.length<=0){if(o===this.pages.length-1&&-1!==this.viewer.visiblePages.indexOf(a)&&(i=!0),!t.isNullOrUndefined(a.endnoteWidget)&&a.endnoteWidget.bodyWidgets.length>0){var d=a.endnoteWidget,h=a.previousPage;if(!t.isNullOrUndefined(h)){t.isNullOrUndefined(h.endnoteWidget)&&(h.endnoteWidget=new Zs,h.endnoteWidget.footNoteType="Endnote",h.endnoteWidget.page=h);for(var c=0;c<d.bodyWidgets.length;c++){var g=d.bodyWidgets[c],p=!1;if(h.endnoteWidget.bodyWidgets.length>0){var u=h.endnoteWidget.bodyWidgets[h.endnoteWidget.bodyWidgets.length-1];g.index===u.index&&g.footNoteReference===u.footNoteReference&&(u.combineWidget(this.viewer),d.bodyWidgets.splice(c,1),p=!0)}p||(d.bodyWidgets.splice(c,1),g.index=h.endnoteWidget.bodyWidgets.length,h.endnoteWidget.bodyWidgets.push(g),g.containerWidget=h.endnoteWidget,g.page=h),c--}t.isNullOrUndefined(a.endnoteWidget)||0!==a.endnoteWidget.bodyWidgets.length||(a.endnoteWidget=void 0),r=!0,i=!1}}-1===this.pages.indexOf(a)||t.isNullOrUndefined(this.pages[o])||this.removePage(this.pages[o]),o--}}t.isNullOrUndefined(this.pages[n])||((a=this.pages[n]).headerWidget&&(a.headerWidget.page=a),a.footerWidget&&(a.footerWidget.page=a)),r&&!e&&this.layout.reLayoutEndnote(),i&&this.scrollToBottom(this.selectionPage)},e.prototype.scrollToBottom=function(e){if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(e.boundingRectangle)){var i=this.visibleBounds.height;this.viewerContainer.scrollTop=e.boundingRectangle.bottom-i}},e.prototype.getFieldResult=function(e,i){if(!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(e)){var r=this.editorProperties.getFieldCode(e).split("*"),n=r[0].replace(/[^\w\s]/gi,"").trim().toLowerCase(),o="";switch(r.length>1&&" MERGEFORMAT"!==r[1]&&(o=r[1].replace(/[^\w\s]/gi,"").trim()),""===o&&(o=i.bodyWidgets[0].sectionFormat.pageNumberStyle),-1!==n.indexOf(" ")&&(n=n.split(" ")[0]),n){case"page":if(i.bodyWidgets[0].sectionFormat.restartPageNumbering&&0!==i.sectionIndex){var a=i.sectionIndex,s=i.previousPage;return this.isRestartNumbering=!0,a!==s.sectionIndex&&s.bodyWidgets[s.bodyWidgets.length-1].sectionIndex!==a?(i.currentPageNum=i.bodyWidgets[0].sectionFormat.pageStartingNumber,this.getFieldText(o,i.currentPageNum)):((1===s.currentPageNum&&a!==s.sectionIndex||a===s.sectionIndex&&"FirstPageFooter"===s.footerWidget.headerFooterType)&&(s.currentPageNum=i.bodyWidgets[0].sectionFormat.pageStartingNumber),i.currentPageNum=s.currentPageNum+1,this.getFieldText(o,i.currentPageNum))}if(i.bodyWidgets[0].sectionFormat.restartPageNumbering&&0===i.sectionIndex)return i.currentPageNum=i.bodyWidgets[0].sectionFormat.pageStartingNumber+i.index,this.getFieldText(o,i.currentPageNum);var l=i.previousPage,d=-1,h=!1;if(t.isNullOrUndefined(i.previousPage)||(h=i.previousPage.bodyWidgets[0].sectionFormat.restartPageNumbering),l&&i.sectionIndex!==l.sectionIndex&&l.bodyWidgets[0].sectionFormat.restartPageNumbering&&1===l.currentPageNum)for(;l&&!t.isNullOrUndefined(l.previousPage)&&l.sectionIndex===l.previousPage.sectionIndex;)d=(l=l.previousPage).index;if(!h&&d>=0&&i.previousPage.bodyWidgets[0].sectionFormat.pageStartingNumber+(i.previousPage.index-d)!==i.previousPage.currentPageNum)i.currentPageNum=i.index+1;else if(!t.isNullOrUndefined(i.previousPage)&&(i.previousPage.bodyWidgets[0].sectionFormat.restartPageNumbering&&1!==i.previousPage.currentPageNum||this.isRestartNumbering&&1!==i.previousPage.currentPageNum))i.previousPage.bodyWidgets[0].sectionFormat.restartPageNumbering&&(this.isRestartNumbering=!0),i.currentPageNum=i.previousPage.currentPageNum+1;else if(t.isNullOrUndefined(l))i.currentPageNum=i.index+1;else{for(;l.previousPage;)if(l&&1===l.currentPageNum&&!l.bodyWidgets[0].sectionFormat.restartPageNumbering)l=l.previousPage;else{if(!l.bodyWidgets[0].sectionFormat.restartPageNumbering||l.bodyWidgets[0].sectionFormat!==l.previousPage.bodyWidgets[0].sectionFormat)break;l=l.previousPage}l&&l.bodyWidgets[0].sectionFormat.restartPageNumbering&&1===l.currentPageNum?i.currentPageNum=l.bodyWidgets[0].sectionFormat.pageStartingNumber+(i.index-l.index):l&&1!==l.currentPageNum?i.currentPageNum=l.currentPageNum+(i.index-l.index):i.currentPageNum=i.index+1}return this.getFieldText(o,i.currentPageNum);case"numpages":return this.getFieldText(o,i.documentHelper.pages.length);case"sectionpages":for(var a=i.sectionIndex,c=0,g=0;g<i.documentHelper.pages.length;g++)if(i.documentHelper.pages[g].sectionIndex===a)c++;else if(0!==c)break;return this.getFieldText(o,c)}}return""},e.prototype.getFieldText=function(e,t){switch(e){case"ALPHABETIC":return this.layout.getAsLetter(t).toUpperCase();case"alphabetic":return this.layout.getAsLetter(t).toLowerCase();case"roman":return this.layout.getAsRoman(t).toLowerCase();case"ROMAN":case"RomanUpper":return this.layout.getAsRoman(t).toUpperCase();case"RomanLower":return this.layout.getAsRoman(t).toLowerCase();case"LetterUpper":return this.layout.getAsLetter(t).toUpperCase();case"LetterLower":return this.layout.getAsLetter(t).toLowerCase();default:return t.toString()}},e.prototype.getNextParagraphBlock=function(e){return e.nextRenderedWidget instanceof Qs?e.nextRenderedWidget:e.nextRenderedWidget instanceof el?this.getFirstParagraphInFirstCell(e.nextRenderedWidget):e.containerWidget instanceof il?this.getNextParagraphCell(e.containerWidget):e.containerWidget instanceof Ys?this.getNextParagraph(e.containerWidget):e.containerWidget instanceof Xs&&this.editorProperties.isMoveDownOrMoveUp?this.getFirstBlockInNextHeaderFooter(e):void 0},e.prototype.getNextParagraphCell=function(e){if(e.nextRenderedWidget&&e.nextRenderedWidget instanceof il){if(e.rowIndex===e.nextRenderedWidget.rowIndex){if((e=e.nextRenderedWidget).getSplitWidgets()[0]instanceof il)for(var t=0,i=e.getSplitWidgets();t<i.length&&!(e=i[t]).firstChild;t++);var r=e.firstChild;return r?this.getFirstParagraphBlock(r):this.getNextParagraphCell(e)}return e=e.nextRenderedWidget,this.getNextParagraphCell(e)}return e.nextSplitWidget&&0===e.nextSplitWidget.childWidgets.length&&(e=e.getSplitWidgets().pop()),this.getNextParagraphRow(e.containerWidget)},e.prototype.getNextParagraph=function(e){if(e.nextRenderedWidget instanceof Ys){var t=e.nextRenderedWidget.childWidgets[0];return this.getFirstParagraphBlock(t)}},e.prototype.getFirstBlockInNextHeaderFooter=function(e){var t,i=e.containerWidget;if(-1!==i.headerFooterType.indexOf("Header"))t=i.page.footerWidget.firstChild;else{if(!i.page.nextPage)return;var r=i.page.nextPage,n=r.headerWidget;n.page=r,r.footerWidget&&(r.footerWidget.page=r),t=n.firstChild}return t instanceof Qs?t:this.getFirstBlockInFirstCell(t)},e.prototype.getNextParagraphRow=function(e){if(!t.isNullOrUndefined(e.nextRenderedWidget)){for(var i=e.nextRenderedWidget.childWidgets[0];0===i.childWidgets.length&&!t.isNullOrUndefined(i.previousSplitWidget)&&!t.isNullOrUndefined(i.nextRenderedWidget)&&i.nextRenderedWidget instanceof il;)i=i.nextRenderedWidget;var r=i.childWidgets[0];return t.isNullOrUndefined(r)?this.getNextParagraphCell(i):this.getFirstParagraphBlock(r)}return this.getNextParagraphBlock(e.ownerTable)},e.prototype.getFirstBlockInFirstCell=function(e){if(e.childWidgets.length>0)for(var t=e.childWidgets[0],i=0;i<t.childWidgets.length;i++){var r=t.childWidgets[i];if(r.childWidgets.length>0)return r.childWidgets[0]}},e.prototype.destroy=function(){if(this.styles&&(this.styles.destroy(),this.styles=void 0),this.stylesMap&&(this.stylesMap.destroy(),this.stylesMap=void 0),this.characterFormat&&(this.characterFormat.destroy(),this.characterFormat=void 0),this.themeFontLanguage&&(this.themeFontLanguage.destroy(),this.themeFontLanguage=void 0),this.paragraphFormat&&(this.paragraphFormat.destroy(),this.paragraphFormat=void 0),this.pages&&this.pages.length>0){for(i=0;i<this.pages.length;i++)this.pages[i].componentDestroy();this.pages=[]}if(this.pages=void 0,this.lists&&this.lists.length>0){for(i=0;i<this.lists.length;i++)this.lists[Number(i)].destroy();this.lists=[]}if(this.lists=void 0,this.abstractLists&&this.abstractLists.length>0)for(i=0;i<this.abstractLists.length;i++){var e=this.abstractLists[Number(i)];t.isNullOrUndefined(e)||e.destroy()}if(this.abstractLists=[],this.abstractLists=void 0,this.fieldStacks=[],this.fieldStacks=void 0,this.splittedCellWidgets=[],this.splittedCellWidgets=void 0,this.fields=[],this.fields=void 0,t.isNullOrUndefined(this.renderedLists)||this.renderedLists.destroy(),this.renderedLists=void 0,t.isNullOrUndefined(this.authors)||this.authors.destroy(),this.authors=void 0,t.isNullOrUndefined(this.revisionsInternal)||this.revisionsInternal.destroy(),this.revisionsInternal=void 0,t.isNullOrUndefined(this.preDefinedStyles)||this.preDefinedStyles.destroy(),this.preDefinedStyles=void 0,t.isNullOrUndefined(this.bookmarks)||this.bookmarks.destroy(),this.bookmarks=void 0,t.isNullOrUndefined(this.editRanges)||this.editRanges.destroy(),this.editRanges=void 0,t.isNullOrUndefined(this.customXmlData)||this.customXmlData.destroy(),t.isNullOrUndefined(this.images)||this.images.destroy(),t.isNullOrUndefined(this.fontSubstitutionTable)||this.fontSubstitutionTable.destroy(),this.fontSubstitutionTable=void 0,this.customXmlData=void 0,this.images=void 0,this.blockToShift=void 0,this.comments&&this.comments.length>0){for(i=0;i<this.comments.length;i++)this.comments[Number(i)].destroy();this.comments=[]}if(this.comments=void 0,this.contentControlCollection&&this.contentControlCollection.length>0)for(var i=0;i<this.contentControlCollection.length;i++){var r=this.contentControlCollection[Number(i)];t.isNullOrUndefined(r)||r.destroy()}this.contentControlCollection=[],this.contentControlCollection=void 0,this.renderedLevelOverrides=[],this.renderedLevelOverrides=void 0,this.headersFooters=[],this.headersFooters=void 0,this.listParagraphs=[],this.listParagraphs=void 0,this.formFields=[],this.formFields=void 0,this.fieldCollection=[],this.fieldCollection=void 0,this.userCollection=[],this.userCollection=void 0,this.footnotes&&(this.footnotes.componentDestroy(),this.footnotes=void 0),this.endnotes&&(this.endnotes.componentDestroy(),this.endnotes=void 0),this.footnoteCollection=[],this.footnoteCollection=void 0,this.endnoteCollection=[],this.endnoteCollection=void 0,this.layout&&this.layout.destroy(),this.layout=void 0,this.textHelper&&this.textHelper.destroy(),this.textHelper=void 0,t.isNullOrUndefined(this.textMeasureHelper)||(this.textMeasureHelper.destroy(),this.textMeasureHelper=void 0),t.isNullOrUndefined(this.parser)||(this.parser.destroy(),this.parser=void 0),t.isNullOrUndefined(this.render)||(this.render.destroy(),this.render=void 0),t.isNullOrUndefined(this.viewer)||(this.viewer.destroy(),this.viewer=void 0),t.isNullOrUndefined(this.revisionHelper)||(this.revisionHelper.destroy(),this.revisionHelper=void 0),t.isNullOrUndefined(this.themes)||(this.themes.destroy(),this.themes=void 0),t.isNullOrUndefined(this.selectionCanvasIn)||t.isNullOrUndefined(this.selectionCanvasIn.parentElement)||this.selectionCanvasIn.parentElement.removeChild(this.selectionCanvasIn),this.selectionCanvasIn=void 0,t.isNullOrUndefined(this.containerCanvasIn)||t.isNullOrUndefined(this.containerCanvasIn.parentElement)||this.containerCanvasIn.parentElement.removeChild(this.containerCanvasIn),this.containerCanvasIn=void 0,this.sections=[],this.sections=void 0,this.tableLefts=[],this.tableLefts=void 0,this.endBookmarksUpdated=[],this.endBookmarksUpdated=void 0,this.cachedPages=[],this.cachedPages=void 0,this.scheduledTimeouts={},this.scheduledTimeouts=void 0,this.visibleBoundsIn=void 0,this.editorProperties=void 0,this.documentEditorSettings=void 0,this.documentSettings=void 0,this.viewerContainer=void 0,this.pageContainer=void 0,this.elementIn=void 0,this.hostElement=void 0,this.selectionPage=void 0,this.selectionEndParagraph=void 0,this.selectionCharacterFormat=void 0,this.editorCharacterFormat=void 0,this.editorParagraphFormat=void 0,this.documentCharacterFormat=void 0,this.documentParagraphFormat=void 0,this.lockedPictureContentControl=void 0,this.L10n=void 0,this.defaultLocale=void 0,this.hooks.onRevisionConstructed=void 0,this.hooks.onUpdateScrollBars=void 0,this.hooks.onProcessAsyncPageUpdate=void 0,this.hooks.onPerformUpdateAfterLoad=void 0,this.hooks.onUpdateBookmarkCollection=void 0,this.hooks.onInsertContentControl=void 0,this.hooks.onCommentSelected=void 0,this.hooks.isBlockExistAfter=void 0,this.hooks.getSelectionOffsets=void 0,this.hooks.selectRange=void 0,this.hooks.onTriggerSpellChecker=void 0,this.hooks=void 0,this.heightInfoCollection=void 0,this.isRestartNumbering=!1,this.currentDocumentLoadId=0},e.prototype.canRenderBorder=function(e){var i,r,n,o,a=!1,s=!1,l=e.previousRenderedWidget,d=e.nextRenderedWidget,h=e.previousSplitWidget;t.isNullOrUndefined(l)||t.isNullOrUndefined(h)||l!==h||(a=!0);var c=e.nextSplitWidget;if(t.isNullOrUndefined(d)||t.isNullOrUndefined(c)||d!==c||(s=!0),a&&s||a&&t.isNullOrUndefined(d)||s&&t.isNullOrUndefined(l))return{skipTopBorder:a,skipBottomBorder:s};var g=this.getParagraphLeftPosition(e),p=0,u=0;!a&&!t.isNullOrUndefined(l)&&l instanceof Qs&&(p=this.getParagraphLeftPosition(l)),!s&&!t.isNullOrUndefined(d)&&d instanceof Qs&&(u=this.getParagraphLeftPosition(d));var f=e.paragraphFormat.borders.top,m=e.paragraphFormat.borders.bottom,y=e.paragraphFormat.borders.left,v=e.paragraphFormat.borders.right;if(!a&&!t.isNullOrUndefined(l)&&l instanceof Qs&&g===p){i=this.checkEqualBorder(f,l.paragraphFormat.borders.top),r=this.checkEqualBorder(m,l.paragraphFormat.borders.bottom),n=this.checkEqualBorder(y,l.paragraphFormat.borders.left),o=this.checkEqualBorder(v,l.paragraphFormat.borders.right);var W=l.paragraphFormat.borders.horizontal;i&&r&&n&&o&&!t.isNullOrUndefined(W)&&"None"===W.lineStyle&&(a=!0)}return!s&&!t.isNullOrUndefined(d)&&d instanceof Qs&&(g===u||this.layout.isInitialLoad&&this.skipBottomBorder(e,d))&&(i=this.checkEqualBorder(f,d.paragraphFormat.borders.top),r=this.checkEqualBorder(m,d.paragraphFormat.borders.bottom),n=this.checkEqualBorder(y,d.paragraphFormat.borders.left),o=this.checkEqualBorder(v,d.paragraphFormat.borders.right),r&&i&&n&&o&&(s=!0)),{skipTopBorder:a,skipBottomBorder:s}},e.prototype.checkEqualBorder=function(e,i){return t.isNullOrUndefined(e)||t.isNullOrUndefined(i)?!(!t.isNullOrUndefined(e)||!t.isNullOrUndefined(i)):e.isEqualFormat(i)},e.prototype.getParagraphLeftPosition=function(e){var i=0,r=0,n=e.paragraphFormat.firstLineIndent;n<0&&(i=bs.convertPointToPixel(Math.abs(n)),i=parseFloat(i.toFixed(5)));var o=e.paragraphFormat.textAlignment;return r=e.isEmpty()&&("Left"!==o&&"Justify"!==o||"Justify"===o&&e.paragraphFormat.bidi)?e.clientX>i?e.clientX-i:e.clientX:e.x>i?e.x-i:e.x,t.isNullOrUndefined(r)||(r=parseFloat(r.toFixed(2))),r},e.prototype.skipBottomBorder=function(e,t){var i=0,r=0;return e.paragraphFormat.leftIndent===t.paragraphFormat.leftIndent||(i=e.paragraphFormat.firstLineIndent<0?Math.abs(e.paragraphFormat.firstLineIndent):0,r=t.paragraphFormat.firstLineIndent<0?Math.abs(t.paragraphFormat.firstLineIndent):0,i=e.paragraphFormat.leftIndent>i?e.paragraphFormat.leftIndent-i:0,r=t.paragraphFormat.leftIndent>r?t.paragraphFormat.leftIndent-r:0,i===r)},e.prototype.getFirstParagraphInCell=function(e){var t=e.childWidgets[0];return t instanceof Qs?t:this.getFirstParagraphInFirstCell(t)},e.prototype.getFirstParagraphInFirstCell=function(e){if(!t.isNullOrUndefined(e.childWidgets)&&e.childWidgets.length>0){var i=e.childWidgets[0].childWidgets[0].childWidgets[0];return this.getFirstParagraphBlock(i)}},e.prototype.getLastParagraphInLastCell=function(e){if(!t.isNullOrUndefined(e.childWidgets)&&e.childWidgets.length>0){var i=e.lastChild.lastChild.lastChild;return this.getLastParagraphBlock(i)}},e.prototype.getFirstParagraphBlock=function(e){return e instanceof Qs?e:e instanceof el?this.getFirstParagraphInFirstCell(e):void 0},e.prototype.getLastParagraphBlock=function(e){return e instanceof Qs?e:e instanceof el?this.getLastParagraphInLastCell(e):void 0},e.prototype.getLastParagraphInFirstRow=function(e){if(e.childWidgets.length>0){var t=e.firstChild.lastChild.lastChild;return this.getLastParagraphBlock(t)}},e.prototype.getFirstParagraphInLastRow=function(e){if(e.childWidgets.length>0){var t=e.childWidgets[e.childWidgets.length-1].childWidgets[0].childWidgets[0];return this.getFirstParagraphBlock(t)}},e.prototype.addToStylesMap=function(e){var i={},r={};if(!t.isNullOrUndefined(e)){var n=this.L10n?this.L10n.getConstant(e.name):e.name;i.StyleName=""===n?e.name:n,"Paragraph"==e.type&&(r.paragraphFormat={},bs.writeParagraphFormat(r.paragraphFormat,!0,e.paragraphFormat)),r.characterFormat={},bs.writeCharacterFormat(r.characterFormat,!0,e.characterFormat),i.Style=this.parseStyle(JSON.stringify(r)),t.isNullOrUndefined(e.type)||(i.type=e.type,"Paragraph"!=i.type||t.isNullOrUndefined(e.link)||(i.type="Linked")),"Paragraph"==i.type?i.IconClass="e-list-icon e-de-listview-icon e-de-e-paragraph-style-mark e-icons":"Character"==i.type?i.IconClass="e-list-icon e-de-listview-icon e-de-e-character-style-mark e-icons":i.IconClass="e-list-icon e-de-listview-icon e-de-e-linked-style-mark e-icons",this.stylesMap.get(i.type)?this.stylesMap.get(i.type).push(i):this.stylesMap.add(i.type,[i])}},e.prototype.parseStyle=function(e){var i="",r=JSON.parse(e),n="";if(!t.isNullOrUndefined(r.characterFormat.baselineAlignment)&&"Normal"!==r.characterFormat.baselineAlignment){var o="";switch(r.characterFormat.baselineAlignment){case"Superscript":o="super";break;case"Subscript":o="sub"}o.length>1&&(i+="vertical-align:"+o+";")}return t.isNullOrUndefined(r.characterFormat.underline)||"None"===r.characterFormat.underline||(n+="underline "),t.isNullOrUndefined(r.characterFormat.strikethrough)||"None"===r.characterFormat.strikethrough||(n+="line-through "),t.isNullOrUndefined(r.characterFormat.fontSize)||(i+="font-size:"+r.characterFormat.fontSize+"px;"),t.isNullOrUndefined(r.characterFormat.fontFamily)||(i+="font-family:"+r.characterFormat.fontFamily+";"),!t.isNullOrUndefined(r.characterFormat.bold)&&r.characterFormat.bold&&(i+="font-weight:bold;"),!t.isNullOrUndefined(r.characterFormat.italic)&&r.characterFormat.italic&&(i+="font-style:italic;"),t.isNullOrUndefined(r.characterFormat.fontColor)||("#00000000"===r.characterFormat.fontColor?i+="color: #000000;":i+="color: "+r.characterFormat.fontColor+";"),n.length>1&&(i+="text-decoration:"+n+";"),i},e.prototype.getNextValidElement=function(e){var i=void 0;if(e instanceof ml&&1===e.bookmarkType)return e;for(;e instanceof ol;){if(0===e.fieldType&&!t.isNullOrUndefined(e.fieldEnd))return t.isNullOrUndefined(i)?e:i;1!==e.fieldType||t.isNullOrUndefined(e.fieldBegin)||(i=e),e=e.nextNode}return t.isNullOrUndefined(i)?e:i},e.prototype.getNextValidElementForField=function(e){if(e instanceof ol&&0===e.fieldType&&bs.isLinkedFieldCharacter(e)){var i=e;e=t.isNullOrUndefined(i.fieldSeparator)?i.fieldEnd:i.fieldSeparator}var r=void 0;return t.isNullOrUndefined(e.nextNode)||(r=this.getNextValidElement(e.nextNode)),r},e.prototype.combineSection=function(){var e=[],t=this.pages[0].bodyWidgets[0];this.isSelectionModule&&this.removeEmptyPages(!0);do{t=this.combineSectionChild(t,e,!1)}while(t);for(var i=0;i<this.pages.length;i++)this.pages[i].destroy(),i--;return e},e.prototype.combineSectionChild=function(e,t,i){var r=e,n=new Ys,o=!1;n.sectionFormat=e.sectionFormat,n.index=r.index;do{o=!1,r=e,e.lastChild&&(e.lastChild.combineWidget(this.viewer),this.layout.isMultiColumnDoc&&this.removeEmptyPages()),e=e.nextRenderedWidget;for(var a=0;a<r.childWidgets.length;a++){var s=r.childWidgets[a];s instanceof el?this.layout.clearTableWidget(s,!0,!0,!0):(s.x=0,s.y=0,s.width=0,s.height=0),n.childWidgets.push(s),r.childWidgets.splice(a,1),a--,s.containerWidget=n}for(var l=0;l<r.page.bodyWidgets.length;l++){if(0!==r.page.bodyWidgets[l].childWidgets.length){o=!1;break}o=!0}o&&i&&r.page.destroy()}while(e&&r.index===e.index);return t.push(n),e},e.prototype.isBlockInHeader=function(e){for(;!(e.containerWidget instanceof Xs);){if(!e.containerWidget)return!1;(e=e.containerWidget)instanceof Ol&&(e=e.containerShape.paragraph)}return-1!==e.containerWidget.headerFooterType.indexOf("Header")},e}(),Ld=function(){function e(e){this.documentHelper=e}return e.prototype.getModuleName=function(){return"Regular"},e.prototype.getHeightInternal=function(e,i){var r=0,n=0,o=document.createElement("span");o.innerText="m";var a=t.createElement("iframe");document.body.appendChild(a);t.isNullOrUndefined(a.contentDocument)||(a.contentDocument.open(),a.contentDocument.write("<!DOCTYPE html><html><head></head><body></body></html>"),a.contentDocument.close()),this.applyStyle(o,e,i);var s=document.createElement("div");s.style.cssText="display:inline-block;position:absolute;";var l=document.createElement("div");l.style.cssText="display:inline-block;width: 1px; height: 0px;vertical-align: baseline;",s.appendChild(o),s.appendChild(l),a.contentDocument.body.appendChild(s),r=o.offsetHeight;var d=o.offsetTop;return n=l.offsetTop-d,document.body.removeChild(a),{Height:r,BaselineOffset:n}},e.prototype.applyStyle=function(e,i,r){if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i)){var n="white-space:nowrap;";t.isNullOrUndefined(r)||""===r?n+="font-family:"+i.fontFamily+";":n+="font-family:"+r+";";var o=i.bidi||i.complexScript?i.fontSizeBidi:i.fontSize;o<=.5&&(o=.5),n+="font-size:"+o.toString()+"pt;",i.bold&&(n+="font-weight:bold;"),i.italic&&(n+="font-style:italic;"),t.updateCSSText(e,n)}},e.prototype.destroy=function(){this.documentHelper=void 0},e}(),Ud=function(){function e(e){this.documentHelper=e,this.optimizedHeightCollection={}}return e.prototype.getModuleName=function(){return"Optimized"},e.prototype.getkeyFromCharFormat=function(e){var t=e.fontFamily.toLocaleLowerCase();return e.bold&&(t+=";bold"),e.italic&&(t+=";italic"),t},e.prototype.getFontInfo=function(e){var i=t.createElement("iframe");document.body.appendChild(i);var r="<!DOCTYPE html><html><head></head><body></body></html>",n=this.documentHelper.externalFonts;n&&n.length>0&&n.forEach(function(e){e.src&&(r+="<style>@font-face {font-family: '"+e.fontFamily+"'; src: "+e.src+"; }</style>")}),t.isNullOrUndefined(i.contentDocument)||(i.contentDocument.open(),i.contentDocument.write(r),i.contentDocument.close());var o=document.createElement("div");t.updateCSSText(o,"position:absolute;top:-1000px;left:-1000px;opacity:0;font-size:0px;line-height:normal");var a=1/window.devicePixelRatio;o.style.transform="scale("+a.toString()+","+a.toString()+")",o.innerHTML="";var s=document.createElement("span");s.className="e-de-font-info",s.style.cssText="font-size: 0; font-family: '"+e.fontFamily+"'; display: inline-block;",s.textContent="m";var l=document.createElement("span");l.className="e-de-font-info",l.style.cssText="font-size: 288pt; font-family: '"+e.fontFamily+"'; "+(e.bold?"font-weight: bold; ":"")+(e.italic?"font-style: italic; ":"")+"display: inline-block;",l.textContent="m",o.appendChild(s),o.appendChild(l),i.contentDocument.body.appendChild(o);var d=o.firstChild.offsetTop/o.lastChild.offsetHeight,h=parseFloat((o.lastChild.offsetHeight/288).toFixed(2));return document.body.removeChild(i),{HeightFactor:h,BaselineFactor:d}},e.prototype.getHeightInternal=function(e){var i=this.getkeyFromCharFormat(e),r=e.bidi||e.complexScript;if(t.isNullOrUndefined(this.optimizedHeightCollection[""+i])){var n=this.getFontInfo(e);return this.optimizedHeightCollection[""+i]=n,{Height:a=n.HeightFactor*(r?e.fontSizeBidi:e.fontSize),BaselineOffset:n.BaselineFactor*a}}var o=this.optimizedHeightCollection[""+i],a=o.HeightFactor*(r?e.fontSizeBidi:e.fontSize);return{Height:a,BaselineOffset:o.BaselineFactor*a}},e.prototype.destroy=function(){this.documentHelper=void 0,this.optimizedHeightCollection=void 0},e}();return e.BlockContainer=Ks,e.BlockWidget=Js,e.BodyWidget=Ys,e.BookmarkElementBox=ml,e.BreakElementBox=nd,e.CONTROL_CHARACTERS=Hs,e.ChartArea=Bl,e.ChartCategory=Hl,e.ChartCategoryAxis=Yl,e.ChartData=Rl,e.ChartDataFormat=jl,e.ChartDataLabels=Dl,e.ChartDataTable=Xl,e.ChartElementBox=Ul,e.ChartErrorBar=Ml,e.ChartFill=Gl,e.ChartLayout=Kl,e.ChartLegend=ql,e.ChartSeries=El,e.ChartSeriesFormat=Vl,e.ChartTitleArea=_l,e.ChartTrendLines=zl,e.CheckBoxFormField=ll,e.CheckBoxState=bl,e.ColumnLayout=Vs,e.ColumnSizeInfo=td,e.CommentCharacterElementBox=Jl,e.CommentEditInfo=id,e.CommentElementBox=Zl,e.ContentControl=yl,e.ContentControlListItems=Wl,e.ContentControlProperties=vl,e.CustomXmlPart=wl,e.Dictionary=p,e.DocumentCanvasElement=wd,e.DocumentCanvasRenderingContext2D=Fd,e.DocumentEditorSettingsModel=Td,e.DocumentSettingsModel=Od,e.DocxRenderer=Ad,e.DocxRevision=C,e.DocxRevisionCollection=T,e.DropDownFormField=dl,e.EditRangeEndElementBox=Al,e.EditRangeStartElementBox=Ll,e.EditorProperties=Nd,e.ElementBox=nl,e.ErrorTextElementBox=pl,e.FieldElementBox=ol,e.FieldTextElementBox=ul,e.FillFormat=Nl,e.FontScheme=vd,e.FontSchemeStruct=Wd,e.FootNoteWidget=Zs,e.Footnote=cl,e.FootnoteElementBox=gl,e.FootnoteEndnoteMarkerElementBox=ad,e.FormField=al,e.GroupShapeElementBox=Tl,e.HeaderFooterWidget=Xs,e.ImageElementBox=Il,e.Layout=ud,e.LayoutHelper=qs,e.LayoutHelperMethods=bs,e.LineFormat=Sl,e.LineWidget=rl,e.ListTextElementBox=kl,e.MajorMinorFontScheme=yd,e.Margin=js,e.MentionDataEditInfo=rd,e.Optimized=Ud,e.Padding=_s,e.Page=Ql,e.PageLayoutHelper=Es,e.ParagraphWidget=Qs,e.Point=xs,e.Rect=zs,e.Regular=Ld,e.Renderer=Pd,e.RendererHooks=Sd,e.RevisionBase=F,e.RevisionCollectionBase=P,e.RevisionHelperMethods=O,e.SearchWidgetInfo=Cs,e.SelectionWidgetInfo=Fs,e.SfdtReader=xd,e.ShapeBase=Cl,e.ShapeCommon=Fl,e.ShapeElementBox=Pl,e.TabElementBox=fl,e.TabStopListInfo=od,e.TableCellWidget=il,e.TablePosition=$s,e.TableRowWidget=tl,e.TableWidget=el,e.TextElementBox=hl,e.TextFormField=sl,e.TextFrame=Ol,e.TextHelper=hd,e.Themes=bd,e.WAbstractList=sd,e.WBorder=m,e.WBorders=Us,e.WCellFormat=x,e.WCharacterFormat=S,e.WCharacterStyle=Ss,e.WColumn=ed,e.WColumnFormat=v,e.WLevelOverride=fd,e.WList=md,e.WListFormat=ks,e.WListLevel=ld,e.WParagraphFormat=Ls,e.WParagraphStyle=Os,e.WRowFormat=W,e.WSectionFormat=y,e.WShading=b,e.WStyle=Ts,e.WStyles=Is,e.WTabStop=As,e.WTableFormat=Bs,e.WTableHolder=$l,e.WTableStyle=Ns,e.WUniqueFormat=u,e.WUniqueFormats=f,e.WebLayoutHelper=Ms,e.Widget=Gs,e.WrapPosition=ws,e.XmlMapping=xl,e.abstractListIdProperty=$o,e.abstractListsProperty=U,e.afterSpacingProperty=Ye,e.afterWidthProperty=Mt,e.alignTablesRowByRowProperty=$,e.allCapsProperty=Ue,e.allowAutoFitProperty=Kt,e.allowBreakAcrossPagesProperty=Ht,e.allowHyphensInBookmarkNamesProperty=cs,e.allowOverlapProperty=To,e.allowSpaceOfSameStyleInTableProperty=Va,e.alternativeTextProperty=vr,e.appearanceProperty=Ea,e.authorNameProperty=_n,e.authorProperty=Fn,e.autoShapeTypeProperty=Rr,e.backgroundColorProperty=ai,e.backgroundProperty=B,e.backwardProperty=Li,e.basedOnProperty=le,e.baselineAlignmentProperty=be,e.bdoProperty=Se,e.beforeSpacingProperty=Xe,e.beforeWidthProperty=Et,e.belowTextProperty=br,e.bidiProperty=Oe,e.blocksProperty=Ho,e.boldBidiProperty=Ae,e.boldProperty=ue,e.bookmarkTypeProperty=aa,e.bordersProperty=at,e.bottomMarginProperty=yt,e.bottomProperty=Zr,e.breakClearTypeProperty=Ne,e.breakCodeProperty=kt,e.categoryTypeProperty=ir,e.categoryXNameProperty=bi,e.cellContentControlProperty=En,e.cellFormatProperty=yo,e.cellSpacingProperty=Yt,e.cellWidthProperty=At,e.cellsProperty=Wo,e.characterFormatProperty=k,e.characterSpacingProperty=Ve,e.chartAreaProperty=or,e.chartCategoryProperty=rr,e.chartDataProperty=Wi,e.chartDataTableProperty=fr,e.chartLegendProperty=lr,e.chartPrimaryCategoryAxisProperty=dr,e.chartPrimaryValueAxisProperty=hr,e.chartSeriesProperty=nr,e.chartTitleAreaProperty=ar,e.chartTitleProperty=cr,e.chartTypeProperty=gr,e.checkBoxProperty=cn,e.checkedProperty=vn,e.checkedStateProperty=ro,e.childShapeProperty=as,e.colorProperty=Er,e.columnCountProperty=Qa,e.columnFirstProperty=ua,e.columnIndexProperty=Ga,e.columnLastProperty=fa,e.columnSpanProperty=Lt,e.columnsProperty=Ot,e.commentCharacterTypeProperty=wn,e.commentIdProperty=xn,e.commentsProperty=R,e.compatibilityModeProperty=ne,e.complexScriptProperty=Be,e.contentControlListItemsProperty=no,e.contentControlPropertiesProperty=qn,e.contextualSpacingProperty=ot,e.continuationNoticeProperty=oa,e.continuationSeparatorProperty=na,e.coordinateSize=us,e.coordinateXOrigin=gs,e.coordinateYOrigin=ps,e.cryptAlgorithmClassProperty=Y,e.cryptAlgorithmSidProperty=J,e.cryptAlgorithmTypeProperty=X,e.cryptProviderTypeProperty=K,e.cryptSpinCountProperty=Z,e.customDataProperty=In,e.customMarkerProperty=Hn,e.customXmlPartProperty=fo,e.customXmlProperty=E,e.dataFormatProperty=yi,e.dataLabelProperty=qi,e.dataPointsProperty=Di,e.dateCalendarTypeProperty=Zn,e.dateDisplayFormatProperty=eo,e.dateDisplayLocaleProperty=$n,e.dateProperty=Pn,e.dateStorageFormatProperty=Qn,e.defaultFont="Times New Roman",e.defaultTabWidthProperty=M,e.defaultValueProperty=un,e.deletePositionProperty=ha,e.descriptionProperty=xo,e.diagonalDownProperty=pi,e.diagonalUpProperty=gi,e.differentFirstPageProperty=ht,e.differentOddAndEvenPagesProperty=ct,e.directionProperty=Ti,e.displayTextProperty=lo,e.distanceBottomProperty=Io,e.distanceLeftProperty=No,e.distanceRightProperty=So,e.distanceTopProperty=Oo,e.doNotUseHTMLParagraphAutoSpacingProperty=Q,e.doneProperty=Tn,e.dropDownItemsProperty=Wn,e.dropDownListProperty=gn,e.editRangeIdProperty=pa,e.editableRangeStartProperty=va,e.editingPointsProperty=os,e.enabledProperty=sn,e.endStyleProperty=Oi,e.endnoteNumberFormatProperty=bt,e.endnotesProperty=re,e.enforcementProperty=_,e.equalWidthProperty=Nt,e.errorBarProperty=Ei,e.evenFooterProperty=Mo,e.evenHeaderProperty=Eo,e.extentXValue=ds,e.extentYValue=hs,e.fieldTypeProperty=on,e.fillFormatProperty=Or,e.fillProperty=Mr,e.fillTypeProperty=Dr,e.firstLineIndentProperty=Ge,e.firstPageFooterProperty=Do,e.firstPageHeaderProperty=Vo,e.firstSliceAngleProperty=zi,e.followCharacterProperty=Go,e.fontColorProperty=Ce,e.fontFamilyAsciiProperty=He,e.fontFamilyBidiProperty=ke,e.fontFamilyFarEastProperty=Re,e.fontFamilyNonFarEastProperty=qe,e.fontFamilyProperty=Pe,e.fontHintTypeProperty=We,e.fontNameProperty=_a,e.fontProperty=ao,e.fontSchemeListProperty=Ca,e.fontSchemeNameProperty=xa,e.fontSchemeProperty=ba,e.fontSizeBidiProperty=Ie,e.fontSizeProperty=Fe,e.fontSubstitutionTableProperty=I,e.fontTypefaceProperty=Pa,e.footNoteNumberFormatProperty=xt,e.footerDistanceProperty=dt,e.footerProperty=qo,e.footnoteTypeProperty=Ln,e.footnotesProperty=ie,e.foreColorProperty=wi,e.foregroundColorProperty=si,e.formFieldDataProperty=nn,e.formFieldShadingProperty=ee,e.formatProperty=fn,e.formattingProperty=V,e.forwardProperty=Ai,e.gapWidthProperty=pr,e.getImageHeightProperty=en,e.getImageWidthProperty=tn,e.getPathString=o,e.getString=a,e.gridAfterProperty=_t,e.gridAfterWidthProperty=jt,e.gridAfterWidthTypeProperty=Gt,e.gridBeforeProperty=Vt,e.gridBeforeWidthProperty=Dt,e.gridBeforeWidthTypeProperty=zt,e.gridProperty=Za,e.groupProperty=ya,e.hasBordersProperty=tr,e.hasFieldEndProperty=rn,e.hasHorizontalBorderProperty=$i,e.hasImageReferenceProperty=Xr,e.hasMajorGridLinesProperty=La,e.hasMinorGridLinesProperty=Ua,e.hasNoneStyleProperty=di,e.hasPlaceHolderTextProperty=Yn,e.hasVerticalBorderProperty=er,e.hashValueProperty=j,e.headerDistanceProperty=lt,e.headerProperty=Ro,e.headersFootersProperty=zo,e.heightProperty=Fr,e.heightRelativePercentProperty=Ar,e.heightScaleProperty=Pr,e.heightTypeProperty=qt,e.helpTextProperty=ln,e.hiddenProperty=ts,e.highlightColorProperty=we,e.holeSizeProperty=_i,e.horizontalAlignmentProperty=Uo,e.horizontalOriginProperty=Lo,e.horizontalPositionAbsProperty=ni,e.horizontalPositionProperty=Bo,e.horizontalProperty=ci,e.horizontalRelativePercentProperty=kr,e.horizontalRuleProperty=xr,e.idProperty=mo,e.imageStringProperty=_r,e.imagesProperty=Ka,e.incrementalOps=es,e.initialEndNoteNumberProperty=Pt,e.initialFootNoteNumberProperty=Ct,e.initialProperty=Cn,e.inlineFormatProperty=za,e.inlinesProperty=Rn,e.interceptProperty=Ui,e.is2007Shape=fs,e.isAfterCellMarkProperty=Xa,e.isAfterParagraphMarkProperty=Ya,e.isAfterRowMarkProperty=Ja,e.isAfterTableMarkProperty=$a,e.isAutoMajorProperty=Ia,e.isBubbleSizeProperty=Gi,e.isCategoryNameProperty=Ki,e.isCheckedProperty=to,e.isCompressedProperty=ja,e.isCreatedUsingHtmlSpanTagProperty=an,e.isDefaultFillProperty=Vr,e.isDeleteRevisionProperty=zn,e.isDisplayEquationProperty=Hi,e.isDisplayRSquaredProperty=Bi,e.isHeaderProperty=Rt,e.isInlineImageProperty=Kr,e.isInsertRevisionProperty=Dn,e.isKernFontProperty=ns,e.isLeaderLinesProperty=Zi,e.isLegalStyleNumberingProperty=Fo,e.isLegendKeyProperty=ji,e.isMappedProperty=ho,e.isMetaFileProperty=Yr,e.isPercentageProperty=Ji,e.isSeriesNameProperty=Yi,e.isTemporaryProperty=Jn,e.isValueProperty=Xi,e.isWordMlProperty=co,e.italicBidiProperty=Le,e.italicProperty=fe,e.itemIDProperty=kn,e.keepLinesTogetherProperty=rt,e.keepWithNextProperty=tt,e.kernProperty=rs,e.lastParagraphMarkCopiedProperty=te,e.layoutInCellProperty=Br,e.layoutProperty=mi,e.layoutXProperty=Ci,e.layoutYProperty=Pi,e.leaderProperty=ca,e.leftIndentProperty=_e,e.leftMarginProperty=ut,e.leftProperty=$r,e.lengthProperty=Gr,e.levelNumberProperty=Jo,e.levelOverridesProperty=ia,e.levelsProperty=ea,e.ligatureProperty=me,e.lineBetweenColumnsProperty=It,e.lineFormatProperty=Tr,e.lineFormatTypeProperty=Ma,e.lineFromXPosition=ms,e.lineFromYPosition=ys,e.lineProperty=xi,e.lineSpacingProperty=Qe,e.lineSpacingTypeProperty=$e,e.lineStyleProperty=ui,e.lineToXPosition=vs,e.lineToYPosition=Ws,e.lineWidthProperty=fi,e.linkProperty=he,e.listFormatProperty=et,e.listIdProperty=Me,e.listLevelNumberProperty=ze,e.listLevelPatternProperty=jo,e.listsProperty=L,e.localeIdBidiProperty=pe,e.localeIdFarEastProperty=ge,e.localeIdProperty=ce,e.lockAnchorProperty=Hr,e.lockContentControlProperty=Mn,e.lockContentsProperty=Vn,e.majorFontSchemeProperty=wa,e.majorTickMarkProperty=Ba,e.majorUnitProperty=Na,e.markerColorProperty=Ii,e.markerSizeProperty=ki,e.markerStyleProperty=Ni,e.maxLengthProperty=pn,e.maximumValueProperty=ka,e.metaFileImageStringProperty=jr,e.minimumValueProperty=Aa,e.minorFontSchemeProperty=Fa,e.minorTickMarkProperty=Ha,e.multiLineProperty=Xn,e.nameProperty=se,e.nextProperty=de,e.nsidProperty="nsid",e.numberAlignmentProperty=Ko,e.numberFormatProperty=Zo,e.numberOfColumnsProperty=St,e.numberValueProperty=Si,e.offsetXValue=ss,e.offsetYValue=ls,e.outlineLevelProperty=nt,e.overlapProperty=ur,e.overrideListLevelProperty=ta,e.pageHeightProperty=pt,e.pageNumberStyleProperty=Tt,e.pageStartingNumberProperty=Wt,e.pageWidthProperty=gt,e.panoseProperty=Oa,e.paraStyleNameProperty=Qo,e.paragraphFormatProperty=A,e.parsePathData=s,e.pathSegmentCollection=g,e.patternProperty=Fi,e.plotAreaProperty=sr,e.positionProperty=da,e.positioningProperty=Co,e.preferredWidthProperty=Zt,e.preferredWidthTypeProperty=Qt,e.prefixMappingProperty=go,e.processPathData=n,e.propertiesProperty=sa,e.protectionTypeProperty=z,e.replyCommentsProperty=On,e.restartIndexForEndnotesProperty=Ft,e.restartIndexForFootnotesProperty=wt,e.restartLevelProperty=Xo,e.restartPageNumberingProperty=vt,e.revDateTimeProperty=jn,e.revisionIdProperty=Nn,e.revisionIdsProperty=Ee,e.revisionTypeProperty=Sn,e.revisionsProperty=q,e.rgbProperty=qa,e.rightIndentProperty=je,e.rightMarginProperty=ft,e.rightProperty=Qr,e.rowFormatProperty=vo,e.rowSpanProperty=Ut,e.rowsProperty=bo,e.saltValueProperty=G,e.scalePathData=c,e.scalingProperty=De,e.sectionFormatProperty=_o,e.sectionsProperty=N,e.selectedIndexProperty=bn,e.separatorProperty=ra,e.seriesFormatProperty=Mi,e.seriesNameProperty=Ri,e.shadingProperty=Xt,e.shadowProperty=li,e.shapeIdProperty=yr,e.showSeriesKeysProperty=Qi,e.sizeProperty=yn,e.sizeTypeProperty=mn,e.spaceAfterAutoProperty=Je,e.spaceBeforeAutoProperty=Ze,e.spaceProperty=Wa,e.specVanishProperty=is,e.splitArrayCollection=l,e.startAtProperty=Yo,e.statusTextProperty=dn,e.storeItemIdProperty=uo,e.strikethroughProperty=xe,e.styleNameProperty=Te,e.stylesProperty=H,e.symbolCodeProperty=Un,e.symbolFontNameProperty=Bn,e.tabJustificationProperty=la,e.tabLeaderProperty=ga,e.tableAlignmentProperty=Jt,e.tableFormatProperty=Po,e.tabsProperty=st,e.tagProperty=Gn,e.textAlignmentProperty=Ke,e.textFrameProperty=qr,e.textInputProperty=hn,e.textProperty=mr,e.textVerticalAlignmentProperty=zr,e.textWrappingStyleProperty=Sr,e.textWrappingTypeProperty=Nr,e.textureProperty=oi,e.themeFontLanguagesProperty=oe,e.themesProperty=ae,e.tickLabelPositionProperty=Ra,e.titleProperty=Kn,e.topMarginProperty=mt,e.topProperty=Jr,e.trackChangesProperty=D,e.transformPath=d,e.trendLinesProperty=Vi,e.typeProperty=Sa,e.typefaceProperty=Ta,e.uncheckedStateProperty=io,e.underlineColorProperty=ve,e.underlineProperty=ye,e.updatedSegment=h,e.userProperty=ma,e.valueProperty=so,e.verticalAlignmentProperty=Bt,e.verticalOriginProperty=ko,e.verticalPositionProperty=Ao,e.verticalProperty=hi,e.verticalRelativePercentProperty=Ir,e.verticallyMergedCellsBottomMarginProperty=ri,e.verticallyMergedCellsKeepWithNext=$t,e.verticallyMergedCellsLeftMarginProperty=ei,e.verticallyMergedCellsRightMarginProperty=ti,e.verticallyMergedCellsTopMarginProperty=ii,e.visibleProperty=Wr,e.weightProperty=Da,e.widowControlProperty=it,e.widthProperty=wr,e.widthRelativePercentProperty=Lr,e.widthScaleProperty=Cr,e.wrapTextAroundProperty=wo,e.xPathProperty=po,e.xmlMappingProperty=oo,e.xmlProperty=An,e.yValueProperty=vi,e.zOrderPositionProperty=Ur,e}({},ej.base,ej.compression,ej.officechart),this.ejs=ej;
|
|
2
|
+
//# sourceMappingURL=ej2-docx-renderer.min.js.map
|