@boldreports/javascript-reporting-controls
Version:
The Bold Reports by Syncfusion controls for JavaScript contains ReportViewer and ReportDesigner HTML5 and JavaScript reporting controls for enterprise web development
10 lines • 366 kB
JavaScript
/*!
* filename: ej2-pdf-export.min.js
* version : 17.4.47
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
this.ej=this.ej||{},this.ej.pdfexport=function(t,e,i){"use strict";function r(t){return"[object String]"===Object.prototype.toString.call(t)?"$s"+t:"$o"+t.toString()}var n=function(){function t(t){this.table={},this.nElements=0,this.toStr=t||r}return t.prototype.getValue=function(t){var e=this.table["$"+this.toStr(t)];if(void 0!==e)return e.value},t.prototype.setValue=function(t,e){var i="$"+this.toStr(t);this.table[i];this.nElements++,this.table[i]={key:t,value:e}},t.prototype.remove=function(t){var e="$"+this.toStr(t),i=this.table[e];return delete this.table[e],this.nElements--,i.value},t.prototype.keys=function(){for(var t=[],e=Object.keys(this.table),i=0;i<e.length;i++){var r=this.table[e[i]];t.push(r.key)}return t},t.prototype.values=function(){for(var t=[],e=Object.keys(this.table),i=0;i<e.length;i++){var r=this.table[e[i]];t.push(r.value)}return t},t.prototype.containsKey=function(t){return!(void 0===this.getValue(t))},t.prototype.clear=function(){this.table={},this.nElements=0},t.prototype.size=function(){return this.nElements},t}(),o=function(){function t(t){this.stringStartMark="/",this.internalValue="",this.isSaving6=!1,this.position6=-1,this.internalValue=this.normalizeValue(t)}return Object.defineProperty(t.prototype,"status",{get:function(){return this.status6},set:function(t){this.status6=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving6},set:function(t){this.isSaving6=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index6},set:function(t){this.index6=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position6},set:function(t){this.position6=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.internalValue},set:function(t){var e=t;null!==t&&t.length>0?(e=t,this.internalValue=this.normalizeValue(e)):this.internalValue=e},enumerable:!0,configurable:!0}),t.prototype.save=function(t){t.write(this.toString())},t.prototype.toString=function(){return this.stringStartMark+this.escapeString(this.value)},t.prototype.clone=function(e){var i=new t;return i.value=this.internalValue,i},t.prototype.escapeString=function(e){for(var i="",r=0,n=e.length;r<n;r++){var o=e[r];t.delimiters.indexOf(o);i+=o}return i},t.prototype.normalizeValue=function(t,e){return t},t.delimiters="()<>[]{}/%}",t.replacements=[" ","\t","\n","\r"],t}(),s=function(){function t(){this.forTest="test",this.forTest=t.obj}return t.obj="obj",t.endObj="endobj",t.r="R",t.whiteSpace=" ",t.slash="/",t.newLine="\r\n",t.stream="stream",t.endStream="endstream",t.xref="xref",t.f="f",t.n="n",t.trailer="trailer",t.startxref="startxref",t.eof="%%EOF",t.header="%PDF-1.5",t.beginText="BT",t.endText="ET",t.beginPath="m",t.appendLineSegment="l",t.stroke="S",t.fill="f",t.fillEvenOdd="f*",t.fillStroke="B",t.fillStrokeEvenOdd="B*",t.appendbeziercurve="c",t.appendRectangle="re",t.saveState="q",t.restoreState="Q",t.paintXObject="Do",t.modifyCtm="cm",t.modifyTM="Tm",t.setLineWidth="w",t.setLineCapStyle="J",t.setLineJoinStyle="j",t.setDashPattern="d",t.setFlatnessTolerance="i",t.closePath="h",t.closeStrokePath="s",t.closeFillStrokePath="b",t.setCharacterSpace="Tc",t.setWordSpace="Tw",t.setHorizontalScaling="Tz",t.setTextLeading="TL",t.setFont="Tf",t.setRenderingMode="Tr",t.setTextRise="Ts",t.setTextScaling="Tz",t.setCoords="Td",t.goToNextLine="T*",t.setText="Tj",t.setTextWithFormatting="TJ",t.setTextOnNewLine="'",t.selectcolorspaceforstroking="CS",t.selectcolorspacefornonstroking="cs",t.setrbgcolorforstroking="RG",t.setrbgcolorfornonstroking="rg",t.setcmykcolorforstroking="K",t.setcmykcolorfornonstroking="k",t.setgraycolorforstroking="G",t.setgraycolorfornonstroking="g",t.clipPath="W",t.clipPathEvenOdd="W*",t.endPath="n",t.setGraphicsState="gs",t.comment="%",t.evenOdd="*",t.setMiterLimit="M",t}(),a=function(){function t(){this.pages="Pages",this.kids="Kids",this.count="Count",this.resources="Resources",this.type="Type",this.size="Size",this.mediaBox="MediaBox",this.parent="Parent",this.root="Root",this.decodeParms="DecodeParms",this.filter="Filter",this.font="Font",this.type1="Type1",this.baseFont="BaseFont",this.encoding="Encoding",this.subtype="Subtype",this.contents="Contents",this.procset="ProcSet",this.colorSpace="ColorSpace",this.extGState="ExtGState",this.pattern="Pattern",this.xObject="XObject",this.length="Length",this.width="Width",this.height="Height",this.bitsPerComponent="BitsPerComponent",this.image="Image",this.dctdecode="DCTDecode",this.columns="Columns",this.blackIs1="BlackIs1",this.k="K",this.s="S",this.predictor="Predictor",this.deviceRgb="DeviceRGB",this.next="Next",this.action="Action",this.link="Link",this.a="A",this.annot="Annot",this.p="P",this.c="C",this.rect="Rect",this.uri="URI",this.annots="Annots",this.ca="ca",this.CA="CA",this.xyz="XYZ",this.fit="Fit",this.dest="Dest",this.BM="BM",this.flatedecode="FlateDecode",this.rotate="Rotate",this.bBox="BBox",this.form="Form",this.w="W",this.cIDFontType2="CIDFontType2",this.cIDToGIDMap="CIDToGIDMap",this.identity="Identity",this.dw="DW",this.fontDescriptor="FontDescriptor",this.cIDSystemInfo="CIDSystemInfo",this.fontName="FontName",this.flags="Flags",this.fontBBox="FontBBox",this.missingWidth="MissingWidth",this.stemV="StemV",this.italicAngle="ItalicAngle",this.capHeight="CapHeight",this.ascent="Ascent",this.descent="Descent",this.leading="Leading",this.avgWidth="AvgWidth",this.fontFile2="FontFile2",this.maxWidth="MaxWidth",this.xHeight="XHeight",this.stemH="StemH",this.registry="Registry",this.ordering="Ordering",this.supplement="Supplement",this.type0="Type0",this.identityH="Identity-H",this.toUnicode="ToUnicode",this.descendantFonts="DescendantFonts"}return t}(),h=function(){function t(t){if(this.position7=-1,this.primitiveItems=new n,this.prefix="<<",this.suffix=">>",this.resources=[],this.object=null,this.archive=!0,this.isFont=!1,void 0===t)this.primitiveItems=new n,this.encrypt=!0,this.dictionaryProperties=new a;else{this.primitiveItems=new n;for(var e=t.items.keys(),i=t.items.values(),r=0;r<t.items.size();r++)this.primitiveItems.setValue(e[r],i[r]);this.status=t.status,this.freezeChanges(this),this.encrypt=!0,this.dictionaryProperties=new a}}return Object.defineProperty(t.prototype,"items",{get:function(){return this.primitiveItems},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this.status7},set:function(t){this.status7=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving7},set:function(t){this.isSaving7=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index7},set:function(t){this.index7=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return this.object},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position7},set:function(t){this.position7=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Count",{get:function(){return this.primitiveItems.size()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Dictionary",{get:function(){return this},enumerable:!0,configurable:!0}),t.prototype.getArchive=function(){return this.archive},t.prototype.setArchive=function(t){this.archive=t},t.prototype.setEncrypt=function(t){this.encrypt=t,this.modify()},t.prototype.getEncrypt=function(){return this.encrypt},t.prototype.freezeChanges=function(t){this.bChanged=!1},t.prototype.clone=function(e){return new t},t.prototype.modify=function(){this.bChanged=!0},t.prototype.remove=function(t){"string"!=typeof t?(this.primitiveItems.remove(t.value),this.modify()):this.remove(new o(t))},t.prototype.containsKey=function(t){return this.primitiveItems.containsKey(t.toString())},t.prototype.onBeginSave=function(){this.beginSave.sender.beginSave()},t.prototype.onFontDictionaryBeginSave=function(){this.fontDictionaryBeginSave.sender.fontDictionaryBeginSave()},t.prototype.onDescendantFontBeginSave=function(){this.descendantFontBeginSave.sender.descendantFontBeginSave()},t.prototype.onTemplateBeginSave=function(){this.pageBeginDrawTemplate.sender.pageBeginSave()},t.prototype.onBeginAnnotationSave=function(){this.annotationBeginSave.sender.beginSave()},t.prototype.onSectionBeginSave=function(t){var e=this.sectionBeginSave;e.sender.beginSave(e.state,t)},t.prototype.save=function(t,e){void 0===e?this.save(t,!0):(t.write(this.prefix),void 0!==this.beginSave&&this.onBeginSave(),void 0!==this.descendantFontBeginSave&&this.onDescendantFontBeginSave(),void 0!==this.fontDictionaryBeginSave&&this.onFontDictionaryBeginSave(),void 0!==this.annotationBeginSave&&this.onBeginAnnotationSave(),void 0!==this.sectionBeginSave&&this.onSectionBeginSave(t),void 0!==this.pageBeginDrawTemplate&&this.onTemplateBeginSave(),this.Count>0&&this.saveItems(t),t.write(this.suffix),t.write(s.newLine))},t.prototype.saveItems=function(t){t.write(s.newLine);for(var e=this.primitiveItems.keys(),i=this.primitiveItems.values(),r=0;r<e.length;r++){var n=e[r];new o(n).save(t),t.write(s.whiteSpace),i[r].save(t),t.write(s.newLine)}},t}(),l=function(){function t(t){this.sender=t}return t}(),u=function(){function t(t){this.sender=t}return t}(),c=function(){function t(t){this.sender=t}return t}(),p=function(){function t(t){this.sender=t}return t}(),d=function(){function t(t,e){this.sender=t,this.state=e}return t}(),f=function(){function t(t){this.sender=t}return t}(),g=function(){function t(t){this.position5=-1,this.value=t}return Object.defineProperty(t.prototype,"intValue",{get:function(){return this.value},set:function(t){this.value=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isInteger",{get:function(){return this.integer},set:function(t){this.integer=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this.status5},set:function(t){this.status5=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving5},set:function(t){this.isSaving5=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index5},set:function(t){this.index5=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position5},set:function(t){this.position5=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.save=function(t){t.write(this.intValue.toString())},t.prototype.clone=function(e){return new t(this.value)},t.floatToString=function(t){var e=t.toFixed(2);return"0.00"===e&&(e=".00"),e},t.min=function(t,e,i){var r=Math.min(t,e);return Math.min(i,r)},t}(),m=function(){function t(e){if(this.startMark="[",this.endMark="]",this.position9=-1,this.clonedObject9=null,this.isFont=!1,void 0===e)this.internalElements=[];else if(void 0===e||e instanceof t){var i=e;this.internalElements=[];for(n=0;n<i.elements.length;n++)this.internalElements.push(i.elements[n])}else for(var r=e,n=0;n<r.length;n++){var o=new g(r[n]);this.add(o)}}return t.prototype.items=function(t){return this.internalElements[t]},Object.defineProperty(t.prototype,"count",{get:function(){return this.internalElements.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this.status9},set:function(t){this.status9=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving9},set:function(t){this.isSaving9=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return this.clonedObject9},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position9},set:function(t){this.position9=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index9},set:function(t){this.index9=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"CrossTable",{get:function(){return this.pdfCrossTable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"elements",{get:function(){return this.internalElements},enumerable:!0,configurable:!0}),t.prototype.add=function(t){void 0===this.internalElements&&(this.internalElements=[]),this.internalElements.push(t),this.markedChange()},t.prototype.markedChange=function(){this.bChanged=!0},t.prototype.contains=function(t){for(var e=0;e<this.internalElements.length;e++){var i=this.internalElements[e],r=t;if(null!=i&&void 0!==i&&null!=r&&void 0!==r&&i.value===r.value)return!0}return!1},t.prototype.getItems=function(t){return this.internalElements[t]},t.prototype.save=function(t){t.write(this.startMark);for(var e=0,i=this.count;e<i;e++)this.getItems(e).save(t),e+1!==i&&t.write(s.whiteSpace);t.write(this.endMark)},t.prototype.clone=function(e){this.clonedObject9=null;for(var i=new t,r=0;r<this.internalElements.length;r++){var n=this.internalElements[r];i.add(n.clone(e))}return i.pdfCrossTable=e,this.clonedObject9=i,i},t.fromRectangle=function(e){return new t([e.x,e.y,e.width,e.height])},t.prototype.insert=function(t,e){if(t<this.internalElements.length&&t>0){for(var i=[],r=0;r<t;r++)i.push(this.internalElements[r]);i.push(e);for(r=t;r<this.internalElements.length;r++)i.push(this.internalElements[r]);this.internalElements=i}else this.internalElements.push(e);this.markChanged()},t.prototype.indexOf=function(t){return this.internalElements.indexOf(t)},t.prototype.remove=function(t){var e=this.internalElements.indexOf(t);this.internalElements[e]=null,this.markChanged()},t.prototype.removeAt=function(t){if(this.internalElements.length>t){for(var e=[],i=0;i<t;i++)e.push(this.internalElements[i]);for(i=t+1;i<this.internalElements.length;i++)e.push(this.internalElements[i]);this.internalElements=e}this.markChanged()},t.prototype.clear=function(){this.internalElements=[],this.markChanged()},t.prototype.markChanged=function(){this.bChanged=!0},t}(),y=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),b=function(t){function i(e,i){var r=t.call(this,e)||this;return r.dicPrefix="stream",r.dicSuffix="endstream",r.clonedObject2=null,r.bCompress=!0,r.isImageStream=!1,r.isFontStream=!1,void 0!==e||void 0!==i?(r.dataStream2=[],r.dataStream2=i,r.bCompress2=!1):(r.dataStream2=[],r.bCompress2=!0),r}return y(i,t),Object.defineProperty(i.prototype,"internalStream",{get:function(){return this.dataStream2},set:function(t){this.dataStream2=[],this.dataStream2=t,this.modify()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isImage",{get:function(){return this.isImageStream},set:function(t){this.isImageStream=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isFont",{get:function(){return this.isFontStream},set:function(t){this.isFontStream=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"compress",{get:function(){return this.bCompress},set:function(t){this.bCompress=t,this.modify()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"data",{get:function(){return this.dataStream2},set:function(t){this.dataStream2=[],this.dataStream2=t,this.modify()},enumerable:!0,configurable:!0}),i.prototype.clearStream=function(){this.internalStream=[],this.items.containsKey(this.dictionaryProperties.filter)&&this.remove(this.dictionaryProperties.filter),this.bCompress=!0,this.modify()},i.prototype.write=function(t){if(null==t)throw new Error("ArgumentNullException:text");if(t.length<=0)throw new Error("ArgumentException: Can not write an empty string, text");this.dataStream2.push(t),this.modify()},i.prototype.writeBytes=function(t){if(null===t)throw new Error("ArgumentNullException:data");if(t.length<=0)throw new Error("ArgumentException: Can not write an empty bytes, data");for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);this.dataStream2.push(e),this.modify()},i.prototype.onCmapBeginSave=function(){this.cmapBeginSave.sender.cmapBeginSave()},i.prototype.onFontProgramBeginSave=function(){this.fontProgramBeginSave.sender.fontProgramBeginSave()},i.prototype.compressContent=function(t,i){if(this.bCompress){for(var r=[],n=0;n<t.length;n++)r.push(t.charCodeAt(n));var o=new Uint8Array(r),s=new e.CompressedStreamWriter;s.write(o,0,o.length),s.close(),t=s.getCompressedString,this.addFilter(this.dictionaryProperties.flatedecode)}return t},i.prototype.addFilter=function(t){var e=this.items.getValue(this.dictionaryProperties.filter);e instanceof C&&(e=e.object);var i=e,r=e;null!=r&&((i=new m).insert(0,r),this.items.setValue(this.dictionaryProperties.filter,i)),r=new o(t),null==i?this.items.setValue(this.dictionaryProperties.filter,r):i.insert(0,r)},i.prototype.save=function(e){void 0!==this.cmapBeginSave&&this.onCmapBeginSave(),void 0!==this.fontProgramBeginSave&&this.onFontProgramBeginSave();for(var i="",r=0;r<this.data.length;r++)i+=this.data[r];i.length>1&&!this.isImage&&!this.isFont&&(i="q\r\n"+i+"Q\r\n");var n=(i=this.compressContent(i,e)).length;this.items.setValue(this.dictionaryProperties.length,new g(n)),t.prototype.save.call(this,e,!1),e.write(this.dicPrefix),e.write(s.newLine),i.length>0&&e.write(i),e.write(s.newLine),e.write(this.dicSuffix),e.write(s.newLine)},i.bytesToString=function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},i}(h),w=function(){function t(t){this.sender=t}return t}(),S=function(){function t(t){this.sender=t}return t}();!function(t){!function(t){t[t.None=0]="None",t[t.Ascii=1]="Ascii",t[t.Unicode=2]="Unicode"}(t.ForceEncoding||(t.ForceEncoding={}));var e;!function(t){t[t.StringValue=0]="StringValue",t[t.ByteBuffer=1]="ByteBuffer"}(e||(e={}))}(t.InternalEnum||(t.InternalEnum={}));var P=function(){function e(t){if(this.bHex=!1,this.position1=-1,this.clonedObject1=null,this.bDecrypted=!1,this.isParentDecrypted=!1,this.isPacked=!1,this.isFormField=!1,this.isColorSpace=!1,this.isHexString=!0,void 0===t)this.bHex=!1;else if(!(t.length>0&&"0xfeff"===t[0])){this.stringValue=t,this.data=[];for(var e=0;e<t.length;++e)this.data.push(t.charCodeAt(e))}}return Object.defineProperty(e.prototype,"hex",{get:function(){return this.bHex},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.stringValue},set:function(t){this.stringValue=t,this.data=null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.status1},set:function(t){this.status1=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSaving",{get:function(){return this.isSaving1},set:function(t){this.isSaving1=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"objectCollectionIndex",{get:function(){return this.index1},set:function(t){this.index1=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clonedObject",{get:function(){return this.clonedObject1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.position1},set:function(t){this.position1=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CrossTable",{get:function(){return this.crossTable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"converted",{get:function(){return this.bConverted},set:function(t){this.bConverted=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"encode",{get:function(){return this.bForceEncoding},set:function(t){this.bForceEncoding=t},enumerable:!0,configurable:!0}),e.bytesToHex=function(t){if(null==t)return"";return""},e.prototype.save=function(i){if(null===i)throw new Error("ArgumentNullException : writer");void 0!==this.encode&&this.encode===t.InternalEnum.ForceEncoding.Ascii?i.write(this.pdfEncode()):i.write(e.stringMark[0]+this.value+e.stringMark[1])},e.prototype.pdfEncode=function(){var i="";if(void 0!==this.encode&&this.encode===t.InternalEnum.ForceEncoding.Ascii){for(var r=this.escapeSymbols(this.value),n=0;n<r.length;n++)i+=String.fromCharCode(r[n]);i=e.stringMark[0]+i+e.stringMark[1]}else i=this.value;return i},e.prototype.escapeSymbols=function(t){for(var e=[],i=0;i<t.length;i++){var r=t.charCodeAt(i);switch(r){case 40:case 41:e.push(92),e.push(r);break;case 13:e.push(92),e.push(114);break;case 92:e.push(92),e.push(r);break;default:e.push(r)}}return e},e.prototype.clone=function(t){if(null!==this.clonedObject1&&this.clonedObject1.CrossTable===t)return this.clonedObject1;this.clonedObject1=null;var i=new e(this.stringValue);return i.bHex=this.bHex,i.crossTable=t,i.isColorSpace=this.isColorSpace,this.clonedObject1=i,i},e.toUnicodeArray=function(t,e){if(null==t)throw new Error("Argument Null Exception : value");for(var i=[],r=0;r<t.length;r++){var n=t.charCodeAt(r);i.push(n/256>>>0),i.push(255&n)}return i},e.byteToString=function(t){if(null==t)throw new Error("Argument Null Exception : stream");for(var e="",i=0;i<t.length;++i)e+=String.fromCharCode(t[i]);return e},e.stringMark="()",e.hexStringMark="<>",e.hexFormatPattern="{0:X2}",e}(),v=function(){function t(t,e){this.index3=-1,this.position3=-1,this.objNumber=0,this.genNumber=0,"number"==typeof t&&"number"==typeof e?(this.objNumber=t,this.genNumber=e):(this.objNumber=Number(t),this.genNumber=Number(e))}return Object.defineProperty(t.prototype,"status",{get:function(){return this.status3},set:function(t){this.status3=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving3},set:function(t){this.isSaving3=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index3},set:function(t){this.index3=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position3},set:function(t){this.position3=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.save=function(t){t.write(this.toString())},t.prototype.toString=function(){return this.objNumber.toString()+" "+this.genNumber.toString()+" R"},t.prototype.clone=function(t){return null},t}(),C=function(){function t(t,e){this.index4=-1,this.position4=-1,this.objectIndex=-1,this.dictionaryProperties=new a,this.initialize(t)}return Object.defineProperty(t.prototype,"status",{get:function(){return this.status4},set:function(t){this.status4=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving4},set:function(t){this.isSaving4=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index4},set:function(t){this.index4=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position4},set:function(t){this.position4=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"object",{get:function(){return this.primitiveObject},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"reference",{get:function(){return this.pdfReference},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"index",{get:function(){return this.objectIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.primitiveObject},enumerable:!0,configurable:!0}),t.prototype.initialize=function(t){if(t instanceof m||t instanceof h||t instanceof o||t instanceof g||t instanceof b||t instanceof v||t instanceof P)this.primitiveObject=t;else{var e=t;this.initialize(e.element)}},t.prototype.save=function(t){t.position;var e=t.document.crossTable;this.object.isSaving=!0;e.getReference(this.object).save(t)},t.prototype.clone=function(t){return null},t}(),x=function(){function t(){this.action=null,this.dictionaryProperties=new a,this.initialize()}return Object.defineProperty(t.prototype,"next",{get:function(){return this.action},set:function(t){this.action=t,this.dictionary.items.setValue(this.dictionaryProperties.next,new C(this.action))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dictionary",{get:function(){return void 0===this.pdfDictionary&&(this.pdfDictionary=new h),this.pdfDictionary},enumerable:!0,configurable:!0}),t.prototype.initialize=function(){this.dictionary.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.action))},Object.defineProperty(t.prototype,"element",{get:function(){return this.dictionary},enumerable:!0,configurable:!0}),t}(),O=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),L=function(t){function e(e){var i=t.call(this)||this;return i.uniformResourceIdentifier="",i}return O(e,t),Object.defineProperty(e.prototype,"uri",{get:function(){return this.uniformResourceIdentifier},set:function(t){this.uniformResourceIdentifier=t,this.dictionary.items.setValue(this.dictionaryProperties.uri,new P(this.uniformResourceIdentifier))},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){t.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.s,new o(this.dictionaryProperties.uri))},e}(x);!function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right"}(t.PdfHorizontalAlignment||(t.PdfHorizontalAlignment={})),function(t){t[t.Top=0]="Top",t[t.Middle=1]="Middle",t[t.Bottom=2]="Bottom"}(t.PdfVerticalAlignment||(t.PdfVerticalAlignment={})),function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right",t[t.Justify=3]="Justify"}(t.PdfTextAlignment||(t.PdfTextAlignment={})),function(t){t[t.Fill=0]="Fill",t[t.Stroke=1]="Stroke",t[t.FillStroke=2]="FillStroke",t[t.None=3]="None",t[t.ClipFlag=4]="ClipFlag",t[t.ClipFill=4]="ClipFill",t[t.ClipStroke=5]="ClipStroke",t[t.ClipFillStroke=6]="ClipFillStroke",t[t.Clip=7]="Clip"}(t.TextRenderingMode||(t.TextRenderingMode={})),function(t){t[t.Miter=0]="Miter",t[t.Round=1]="Round",t[t.Bevel=2]="Bevel"}(t.PdfLineJoin||(t.PdfLineJoin={})),function(t){t[t.Flat=0]="Flat",t[t.Round=1]="Round",t[t.Square=2]="Square"}(t.PdfLineCap||(t.PdfLineCap={})),function(t){t[t.Solid=0]="Solid",t[t.Dash=1]="Dash",t[t.Dot=2]="Dot",t[t.DashDot=3]="DashDot",t[t.DashDotDot=4]="DashDotDot",t[t.Custom=5]="Custom"}(t.PdfDashStyle||(t.PdfDashStyle={})),function(t){t[t.Winding=0]="Winding",t[t.Alternate=1]="Alternate"}(t.PdfFillMode||(t.PdfFillMode={})),function(t){t[t.Rgb=0]="Rgb",t[t.Cmyk=1]="Cmyk",t[t.GrayScale=2]="GrayScale",t[t.Indexed=3]="Indexed"}(t.PdfColorSpace||(t.PdfColorSpace={})),function(t){t[t.Normal=0]="Normal",t[t.Multiply=1]="Multiply",t[t.Screen=2]="Screen",t[t.Overlay=3]="Overlay",t[t.Darken=4]="Darken",t[t.Lighten=5]="Lighten",t[t.ColorDodge=6]="ColorDodge",t[t.ColorBurn=7]="ColorBurn",t[t.HardLight=8]="HardLight",t[t.SoftLight=9]="SoftLight",t[t.Difference=10]="Difference",t[t.Exclusion=11]="Exclusion",t[t.Hue=12]="Hue",t[t.Saturation=13]="Saturation",t[t.Color=14]="Color",t[t.Luminosity=15]="Luminosity"}(t.PdfBlendMode||(t.PdfBlendMode={})),function(t){t[t.Centimeter=0]="Centimeter",t[t.Pica=1]="Pica",t[t.Pixel=2]="Pixel",t[t.Point=3]="Point",t[t.Inch=4]="Inch",t[t.Document=5]="Document",t[t.Millimeter=6]="Millimeter"}(t.PdfGraphicsUnit||(t.PdfGraphicsUnit={})),function(t){t[t.Fit=0]="Fit",t[t.Center=1]="Center",t[t.Stretch=2]="Stretch",t[t.Tile=3]="Tile"}(t.PdfGridImagePosition||(t.PdfGridImagePosition={})),function(t){t[t.None=0]="None",t[t.LeftToRight=1]="LeftToRight",t[t.RightToLeft=2]="RightToLeft"}(t.PdfTextDirection||(t.PdfTextDirection={}));var T=function(){function e(t,i,r,n){void 0===t?void 0!==i&&void 0!==r&&void 0!==n?this.assignRGB(i,r,n):this.filled=!1:t instanceof e?(this.redColor=t.r,this.greenColor=t.g,this.blueColor=t.b,this.grayColor=t.gray,this.alpha=t.alpha,this.filled=0!==this.alpha):void 0===n?this.assignRGB(t,i,r):this.assignRGB(i,r,n,t)}return e.prototype.assignRGB=function(t,i,r,n){void 0===t||void 0===i||void 0===r?this.filled=!1:(this.cyanColor=0,this.magentaColor=0,this.yellowColor=0,this.blackColor=0,this.grayColor=0,this.redColor=t,this.greenColor=i,this.blueColor=r,this.alpha=void 0===n?e.maxColourChannelValue:n,this.filled=!0,this.assignCMYK(t,i,r))},e.prototype.assignCMYK=function(t,i,r){var n=t/e.maxColourChannelValue,o=i/e.maxColourChannelValue,s=r/e.maxColourChannelValue,a=g.min(1-n,1-o,1-s),h=1===a?0:(1-n-a)/(1-a),l=1===a?0:(1-o-a)/(1-a),u=1===a?0:(1-s-a)/(1-a);this.blackColor=a,this.cyanColor=h,this.magentaColor=l,this.yellowColor=u},Object.defineProperty(e.prototype,"r",{get:function(){return this.redColor},set:function(t){this.redColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"red",{get:function(){return this.r/e.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"b",{get:function(){return this.blueColor},set:function(t){this.blueColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blue",{get:function(){return this.b/e.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"g",{get:function(){return this.greenColor},set:function(t){this.greenColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"green",{get:function(){return this.g/e.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gray",{get:function(){return(this.redColor+this.greenColor+this.blueColor)/(3*e.maxColourChannelValue)},set:function(t){this.grayColor=t<0?0:t>1?1:t,this.r=this.grayColor*e.maxColourChannelValue,this.g=this.grayColor*e.maxColourChannelValue,this.b=this.grayColor*e.maxColourChannelValue,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return!this.filled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"a",{get:function(){return this.alpha},set:function(t){this.alpha=t<0?0:t,this.filled=!0},enumerable:!0,configurable:!0}),e.prototype.toString=function(t,e){return this.isEmpty?"":this.rgbToString(e)},e.prototype.rgbToString=function(t){var i=this.r,r=this.g,n=this.b,o=(i<<16)+(r<<8)+n;t&&(o+=1<<24);var a="",h=null;if(e.rgbStrings.containsKey(o)&&(h=e.rgbStrings.getValue(o)),null==h){var l=i/e.maxColourChannelValue,u=r/e.maxColourChannelValue,c=n/e.maxColourChannelValue;a=t?l.toString()+" "+u.toString()+" "+c.toString()+" RG":l.toString()+" "+u.toString()+" "+c.toString()+" rg",e.rgbStrings.setValue(o,a)}else a=h.toString();return a+s.newLine},e.prototype.toArray=function(e){var i=new m;switch(e){case t.PdfColorSpace.Rgb:i.add(new g(this.red)),i.add(new g(this.green)),i.add(new g(this.blue));break;default:throw new Error("NotSupportedException : Unsupported colour space.")}return i},e.rgbStrings=new n,e.grayStringsSroke=new n,e.grayStringsFill=new n,e.maxColourChannelValue=255,e}(),j=function(){function t(t,e){void 0===t?(this.x=0,this.y=0):(this.x=null!==t?t:0,this.y=null!==e?e:0)}return t}(),R=function(){function t(t,e){void 0===e?(this.height=0,this.width=0):(this.height=null!==e?e:0,this.width=null!==t?t:0)}return t}(),B=function(){function t(t,e,i,r){if(typeof t==typeof t&&void 0===t)this.x=0,this.y=0,this.height=0,this.width=0;else if(t instanceof j&&e instanceof R&&void 0===i){var n=t;this.x=n.x,this.y=n.y;var o=e;this.height=o.height,this.width=o.width}else{var s=t,a=e,h=i,l=r;this.x=s,this.y=a,this.height=l,this.width=h}}return t}(),N=function(){function t(t,e,i,r){this.left=t,this.top=e,this.right=i,this.bottom=r}return Object.defineProperty(t.prototype,"width",{get:function(){return this.right-this.left},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.bottom-this.top},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"topLeft",{get:function(){return new j(this.left,this.top)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return new R(this.width,this.height)},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return this.topLeft+"x"+this.size},t}(),V=function(){function t(){}return t}(),I=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),F=function(e){function i(t){var i=e.call(this)||this;return i.pdfColor=t,i}return I(i,e),Object.defineProperty(i.prototype,"color",{get:function(){return this.pdfColor},set:function(t){this.pdfColor=t},enumerable:!0,configurable:!0}),i.prototype.monitorChanges=function(t,e,i,r,n){if(null==e)throw new Error("ArgumentNullException:streamWriter");var o=!1;return o=!0,e.setColorAndSpace(this.pdfColor,n,!1),o},i.prototype.resetChanges=function(e){e.setColorAndSpace(new T(0,0,0),t.PdfColorSpace.Rgb,!1)},i}(V);!function(t){t[t.Regular=0]="Regular",t[t.Bold=1]="Bold",t[t.Italic=2]="Italic",t[t.Underline=4]="Underline",t[t.Strikeout=8]="Strikeout"}(t.PdfFontStyle||(t.PdfFontStyle={})),function(t){t[t.Helvetica=0]="Helvetica",t[t.Courier=1]="Courier",t[t.TimesRoman=2]="TimesRoman",t[t.Symbol=3]="Symbol",t[t.ZapfDingbats=4]="ZapfDingbats"}(t.PdfFontFamily||(t.PdfFontFamily={})),function(t){t[t.Standard=0]="Standard",t[t.TrueType=1]="TrueType",t[t.TrueTypeEmbedded=2]="TrueTypeEmbedded"}(t.PdfFontType||(t.PdfFontType={})),function(t){t[t.None=0]="None",t[t.Word=1]="Word",t[t.WordOnly=2]="WordOnly",t[t.Character=3]="Character"}(t.PdfWordWrapType||(t.PdfWordWrapType={})),function(t){t[t.None=0]="None",t[t.SuperScript=1]="SuperScript",t[t.SubScript=2]="SubScript"}(t.PdfSubSuperScript||(t.PdfSubSuperScript={})),function(t){t[t.Unknown=0]="Unknown",t[t.StandardEncoding=1]="StandardEncoding",t[t.MacRomanEncoding=2]="MacRomanEncoding",t[t.MacExpertEncoding=3]="MacExpertEncoding",t[t.WinAnsiEncoding=4]="WinAnsiEncoding",t[t.PdfDocEncoding=5]="PdfDocEncoding",t[t.IdentityH=6]="IdentityH"}(t.FontEncoding||(t.FontEncoding={})),function(t){t[t.Apple=0]="Apple",t[t.Microsoft=4]="Microsoft",t[t.Trimmed=6]="Trimmed"}(t.TtfCmapFormat||(t.TtfCmapFormat={})),function(t){t[t.Unknown=0]="Unknown",t[t.Symbol=1]="Symbol",t[t.Unicode=2]="Unicode",t[t.Macintosh=3]="Macintosh"}(t.TtfCmapEncoding||(t.TtfCmapEncoding={})),function(t){t[t.AppleUnicode=0]="AppleUnicode",t[t.Macintosh=1]="Macintosh",t[t.Iso=2]="Iso",t[t.Microsoft=3]="Microsoft"}(t.TtfPlatformID||(t.TtfPlatformID={})),function(t){t[t.Undefined=0]="Undefined",t[t.Unicode=1]="Unicode"}(t.TtfMicrosoftEncodingID||(t.TtfMicrosoftEncodingID={})),function(t){t[t.Roman=0]="Roman",t[t.Japanese=1]="Japanese",t[t.Chinese=2]="Chinese"}(t.TtfMacintoshEncodingID||(t.TtfMacintoshEncodingID={})),function(t){t[t.FixedPitch=1]="FixedPitch",t[t.Serif=2]="Serif",t[t.Symbolic=4]="Symbolic",t[t.Script=8]="Script",t[t.Nonsymbolic=32]="Nonsymbolic",t[t.Italic=64]="Italic",t[t.ForceBold=262144]="ForceBold"}(t.FontDescriptorFlags||(t.FontDescriptorFlags={})),function(t){t[t.Arg1And2AreWords=1]="Arg1And2AreWords",t[t.ArgsAreXyValues=2]="ArgsAreXyValues",t[t.RoundXyToGrid=4]="RoundXyToGrid",t[t.WeHaveScale=8]="WeHaveScale",t[t.Reserved=16]="Reserved",t[t.MoreComponents=32]="MoreComponents",t[t.WeHaveAnXyScale=64]="WeHaveAnXyScale",t[t.WeHaveTwoByTwo=128]="WeHaveTwoByTwo",t[t.WeHaveInstructions=256]="WeHaveInstructions",t[t.UseMyMetrics=512]="UseMyMetrics"}(t.TtfCompositeGlyphFlags||(t.TtfCompositeGlyphFlags={}));var E=function(){function e(e,i){this.scalingFactor=100,this.wordWrapType=t.PdfWordWrapType.Word,this.internalLineLimit=!0,this.wordWrapType=t.PdfWordWrapType.Word,void 0!==e&&"string"!=typeof e&&(this.textAlignment=e),void 0!==i&&(this.verticalAlignment=i)}return Object.defineProperty(e.prototype,"alignment",{get:function(){return this.textAlignment},set:function(t){this.textAlignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textDirection",{get:function(){return this.direction},set:function(t){this.direction=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineAlignment",{get:function(){return void 0===this.verticalAlignment||null==this.verticalAlignment?t.PdfVerticalAlignment.Top:this.verticalAlignment},set:function(t){this.verticalAlignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightToLeft",{get:function(){return void 0!==this.isRightToLeft&&null!=this.isRightToLeft&&this.isRightToLeft},set:function(t){this.isRightToLeft=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"characterSpacing",{get:function(){return void 0===this.internalCharacterSpacing||null==this.internalCharacterSpacing?0:this.internalCharacterSpacing},set:function(t){this.internalCharacterSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wordSpacing",{get:function(){return void 0===this.internalWordSpacing||null==this.internalWordSpacing?0:this.internalWordSpacing},set:function(t){this.internalWordSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineSpacing",{get:function(){return void 0===this.leading||null==this.leading?0:this.leading},set:function(t){this.leading=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clipPath",{get:function(){return void 0!==this.clip&&null!=this.clip&&this.clip},set:function(t){this.clip=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"subSuperScript",{get:function(){return void 0===this.pdfSubSuperScript||null==this.pdfSubSuperScript?t.PdfSubSuperScript.None:this.pdfSubSuperScript},set:function(t){this.pdfSubSuperScript=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paragraphIndent",{get:function(){return void 0===this.internalParagraphIndent||null==this.internalParagraphIndent?0:this.internalParagraphIndent},set:function(t){this.internalParagraphIndent=t,this.firstLineIndent=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineLimit",{get:function(){return this.internalLineLimit},set:function(t){this.internalLineLimit=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"measureTrailingSpaces",{get:function(){return void 0!==this.trailingSpaces&&null!=this.trailingSpaces&&this.trailingSpaces},set:function(t){this.trailingSpaces=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"noClip",{get:function(){return void 0!==this.isNoClip&&null!=this.isNoClip&&this.isNoClip},set:function(t){this.isNoClip=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wordWrap",{get:function(){return this.wordWrapType},set:function(t){this.wordWrapType=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontalScalingFactor",{get:function(){return this.scalingFactor},set:function(t){if(t<=0)throw new Error("ArgumentOutOfRangeException:The scaling factor cant be less of equal to zero, ScalingFactor");this.scalingFactor=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstLineIndent",{get:function(){return void 0===this.initialLineIndent||null==this.initialLineIndent?0:this.initialLineIndent},set:function(t){this.initialLineIndent=t},enumerable:!0,configurable:!0}),e.prototype.clone=function(){return this},e}(),A=function(){function t(t){if(this.currentPosition=0,null==t)throw new Error("ArgumentNullException:text");this.text=t}return Object.defineProperty(t.prototype,"length",{get:function(){return this.text.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"end",{get:function(){return this.currentPosition===this.text.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.currentPosition},set:function(t){this.currentPosition=t},enumerable:!0,configurable:!0}),t.getCharsCount=function(t,e){if("string"==typeof e){if(null==t)throw new Error("ArgumentNullException:wholeText");for(var i=0,r=0;-1!==(r=t.indexOf(e,r));)i++,r++;return i}if(null==t)throw new Error("ArgumentNullException:text");if(null==e)throw new Error("ArgumentNullException:symbols");for(var n=0,o=0,s=t.length;o<s;o++){var a=t[o];this.contains(e,a)&&n++}return n},t.prototype.readLine=function(){for(var t=this.currentPosition;t<this.length;){switch(this.text[t]){case"\r":case"\n":var e=this.text.substring(this.currentPosition,t-this.currentPosition);return this.currentPosition=t+1,this.currentPosition++,e}t++}if(t>this.currentPosition){var i=this.text.substring(this.currentPosition,t-this.currentPosition);return this.currentPosition=t,i}return null},t.prototype.peekLine=function(){var t=this.currentPosition,e=this.readLine();return this.currentPosition=t,e},t.prototype.readWord=function(){for(var t=this.currentPosition;t<this.length;){var e=this.text[t];switch(e){case"\r":case"\n":var i=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t+1,"\r"===e&&this.currentPosition<this.length&&"\n"===this.text[this.currentPosition]&&this.currentPosition++,i;case" ":case"\t":t===this.currentPosition&&t++;var r=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t,r}t++}if(t>this.currentPosition){var n=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t,n}return null},t.prototype.peekWord=function(){var t=this.currentPosition,e=this.readWord();return this.currentPosition=t,e},t.prototype.read=function(t){if(void 0===t){var e="0";return this.end||(e=this.text[this.currentPosition],this.currentPosition++),e}for(var i=0,r="";!this.end&&i<t;)r+=e=this.read(),i++;return r},t.prototype.peek=function(){var t="0";return this.end||(t=this.text[this.currentPosition]),t},t.prototype.close=function(){this.text=null},t.prototype.readToEnd=function(){var t;return t=0===this.currentPosition?this.text:this.text.substring(this.length,this.currentPosition),this.currentPosition=this.length,t},t.contains=function(t,e){for(var i=!1,r=0;r<t.length;r++)if(t[r]===e){i=!0;break}return i},t.whiteSpace=" ",t.tab="\t",t.spaces=[t.whiteSpace,t.tab],t.whiteSpacePattern="^[ \t]+$",t}(),M=function(){function e(){this.isOverloadWithPosition=!1}return e.prototype.layout=function(t,e,i,r,n,o,s){if(r instanceof B){this.initialize(t,e,i,r,n),this.isOverloadWithPosition=o,this.clientSize=s;a=this.doLayout();return this.clear(),a}this.initialize(t,e,i,r),this.isOverloadWithPosition=n,this.clientSize=o;var a=this.doLayout();return this.clear(),a},e.prototype.initialize=function(t,e,i,r,n){if("number"==typeof n){if(null==t)throw new Error("ArgumentNullException:text");if(null==e)throw new Error("ArgumentNullException:font");this.text=t,this.font=e,this.format=i,this.size=new R(r.width,r.height),this.rectangle=r,this.pageHeight=n,this.reader=new A(t)}else this.initialize(t,e,i,new B(new j(0,0),r),0)},e.prototype.clear=function(){this.font=null,this.format=null,this.reader.close(),this.reader=null,this.text=null},e.prototype.doLayout=function(){for(var t=new D,e=new D,i=[],r=this.reader.peekLine(),n=this.getLineIndent(!0);null!=r;){if(null!==(e=this.layoutLine(r,n))||void 0!==e){var o=0,s=this.copyToResult(t,e,i,o),a=s.success;if(o=s.numInserted,!a){this.reader.read(o);break}}this.reader.readLine(),r=this.reader.peekLine(),n=this.getLineIndent(!1)}return this.finalizeResult(t,i),t},e.prototype.getLineIndent=function(t){var e=0;return null!=this.format&&(e=t?this.format.firstLineIndent:this.format.paragraphIndent,e=this.size.width>0?Math.min(this.size.width,e):e),e},e.prototype.getLineHeight=function(){var t=this.font.height;return null!=this.format&&0!==this.format.lineSpacing&&(t=this.format.lineSpacing+this.font.height),t},e.prototype.getLineWidth=function(t){return this.font.getLineWidth(t,this.format)},e.prototype.layoutLine=function(e,i){var r=new D;r.layoutLineHeight=this.getLineHeight();var n=[],o=this.size.width,s=this.getLineWidth(e)+i,a=t.LineType.FirstParagraphLine,h=!0;if(o<=0||Math.round(s)<=Math.round(o))this.addToLineResult(r,n,e,s,t.LineType.NewLineBreak|a);else{var l="",u="";s=i;var c=i,p=new A(e),d=p.peekWord();for(d.length!==p.length&&" "===d&&(u+=d,l+=d,p.position+=1,d=p.peekWord());null!=d;){u+=d;var f=this.getLineWidth(u.toString())+c;if(" "===u.toString()&&(u="",f=0),f>o){if(this.getWrapType()===t.PdfWordWrapType.None)break;if(u.length===d.length){if(this.getWrapType()===t.PdfWordWrapType.WordOnly){r.textRemainder=e.substring(p.position);break}if(1===u.length){l+=d;break}h=!1,u="",d=p.peek().toString();continue}this.getLineWidth(d.toString())>o?this.format.wordWrap=t.PdfWordWrapType.Character:void 0!==this.format&&null!==this.format&&(this.format.wordWrap=t.PdfWordWrapType.Word),this.getWrapType()===t.PdfWordWrapType.Character&&h?(h=!1,u="",u+=l.toString(),d=p.peek().toString()):(" "!==(g=l.toString())&&this.addToLineResult(r,n,g,s,t.LineType.LayoutBreak|a),this.isOverloadWithPosition&&(o=this.clientSize.width),u="",l="",s=0,c=0,f=0,a=t.LineType.None,d=h?d:p.peekWord(),h=!0)}else l+=d,s=f,h?(p.readWord(),d=p.peekWord()):(p.read(),d=p.peek().toString())}if(l.length>0){var g=l.toString();this.addToLineResult(r,n,g,s,t.LineType.NewLineBreak|t.LineType.LastParagraphLine)}p.close()}r.layoutLines=[];for(var m=0;m<n.length;m++)r.layoutLines.push(n[m]);return n=[],r},e.prototype.addToLineResult=function(t,e,i,r,n){var o=new k;o.text=i,o.width=r,o.lineType=n,e.push(o);var s=t.actualSize;s.height+=this.getLineHeight(),s.width=Math.max(s.width,r),t.size=s},e.prototype.copyToResult=function(t,e,i,r){var n=!0,o=null!=this.format&&!this.format.lineLimit,s=t.actualSize.height,a=this.size.height;if(this.pageHeight>0&&a+this.rectangle.y>this.pageHeight&&(a=this.rectangle.y-this.pageHeight,a=Math.max(a,-a)),r=0,null!=e.lines)for(var h=0,l=e.lines.length;h<l;h++){var u=s+e.lineHeight;if(!(u<=a||a<=0||o)){n=!1;break}var c=e.lines[h];r+=c.text.length,c=this.trimLine(c,0===i.length),i.push(c);var p=t.actualSize;p.width=Math.max(p.width,c.width),t.size=p,s=u}if(s!=t.size.height){var d=t.actualSize;d.height=s,t.size=d}return{success:n,numInserted:r}},e.prototype.finalizeResult=function(t,e){t.layoutLines=[];for(var i=0;i<e.length;i++)t.layoutLines.push(e[i]);t.layoutLineHeight=this.getLineHeight(),this.reader.end||(t.textRemainder=this.reader.readToEnd()),e=[]},e.prototype.trimLine=function(e,i){var r=e.text,n=e.width;e.lineType,t.LineType.FirstParagraphLine,null==this.format||this.format.rightToLeft;return(r=r.trim()).length!==e.text.length&&(n=this.getLineWidth(r),(e.lineType&t.LineType.FirstParagraphLine)>0&&(n+=this.getLineIndent(i))),e.text=r,e.width=n,e},e.prototype.getWrapType=function(){return null!=this.format?this.format.wordWrap:t.PdfWordWrapType.Word},e}(),D=function(){function t(){}return Object.defineProperty(t.prototype,"remainder",{get:function(){return this.textRemainder},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"actualSize",{get:function(){return void 0===this.size&&(this.size=new R(0,0)),this.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lines",{get:function(){return this.layoutLines},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lineHeight",{get:function(){return this.layoutLineHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return null==this.layoutLines||0===this.layoutLines.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lineCount",{get:function(){return this.empty?0:this.layoutLines.length},enumerable:!0,configurable:!0}),t}(),k=function(){function t(){}return Object.defineProperty(t.prototype,"lineType",{get:function(){return this.type},set:function(t){this.type=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this.content},set:function(t){this.content=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.lineWidth},set:function(t){this.lineWidth=t},enumerable:!0,configurable:!0}),t}();!function(t){t[t.None=0]="None",t[t.NewLineBreak=1]="NewLineBreak",t[t.LayoutBreak=2]="LayoutBreak",t[t.FirstParagraphLine=4]="FirstParagraphLine",t[t.LastParagraphLine=8]="LastParagraphLine"}(t.LineType||(t.LineType={}));var z=function(){function e(e,i){this.fontStyle=t.PdfFontStyle.Regular,"number"==typeof e&&void 0===i?this.fontSize=e:(th