stimulsoft-reports-js-vuejs 2025.2.1

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.
@@ -0,0 +1,10 @@
1
+ /*
2
+ Stimulsoft.Reports.JS
3
+ Version: 2025.2.1
4
+ Build date: 2025.03.20
5
+ License: https://www.stimulsoft.com/en/licensing/reports
6
+ */
7
+ import{Stimulsoft}from"./stimulsoft.reports.engine.mjs";function defaultsDeep(t,e){for(var i in e)i in t?defaultsDeep(t[i],e[i]):t[i]=e[i];return t}defaultsDeep(Stimulsoft||{},{Report:{Export:{Office:{}}},Reflection:{}});var __={};__.a=Stimulsoft.Report,__.b=Stimulsoft.Reflection,__.c=__.a.Export,__.d=__.c.Office;let Exception=Stimulsoft.System.Exception,StiMath=Stimulsoft.System.StiMath,Char=Stimulsoft.System.Char,StiCheckBox=__.a.Components.StiCheckBox,CultureInfo=Stimulsoft.System.Globalization.CultureInfo,StiZipWriter20=Stimulsoft.Base.Zip.StiZipWriter20,ImageFormat=__.a.ImageFormat,IStiExportImageExtended=__.a.Components.IStiExportImageExtended,StiText=__.a.Components.StiText,StiArray=Stimulsoft.System.StiArray,Hashtable=Stimulsoft.System.Collections.Hashtable,StiPageOrientation=__.a.Components.StiPageOrientation,StiPagesCollection=__.a.Components.StiPagesCollection,DateTime=Stimulsoft.System.DateTime,Formatting=Stimulsoft.System.Xml.Formatting,XmlTextWriter=Stimulsoft.System.Xml.XmlTextWriter,Encoding=Stimulsoft.System.Text.Encoding,StreamWriter=Stimulsoft.System.IO.StreamWriter,Color=Stimulsoft.System.Drawing.Color,StiString=Stimulsoft.System.StiString,MemoryStream=Stimulsoft.System.IO.MemoryStream,StiLocalization=Stimulsoft.Base.Localization.StiLocalization,StiTextHorAlignment=Stimulsoft.Base.Drawing.StiTextHorAlignment,StiVertAlignment=Stimulsoft.Base.Drawing.StiVertAlignment;{class d{constructor(){this.BorderLeft="none",this.BorderRight="none",this.BorderTop="none",this.BorderBottom="none",this.BackColor=Color.transparent,this.VertAlign=StiVertAlignment.Bottom,this.FontName="Arial",this.FontSize=6,this.Bold=!1,this.Italic=!1,this.Underline=!1,this.FontColor=Color.black,this.HorAlign=StiTextHorAlignment.Left,this.Angle=0,this.Wordwrap=!1,this.DataStyle=-1}}class e{constructor(){this.isNumeric=!1,this.isCurrency=!1,this.isPercent=!1,this.isDate=!1,this.isTime=!1,this.isDefaultFormat=!1,this.DecimalDigits=2,this.DecimalComma=" ",this.GroupDigits=0,this.CurrencySymbol="$",this.CurrencyPositionBefore=!1,this.NegativeBraces=!1,this.DateTimeFormatString=null,this.CurrencyPositivePattern=null,this.CurrencyNegativePattern=null}}__.c.StiOdsExportService=class extends __.c.StiExportService{constructor(){super(...arguments),this.multipleFiles=!1,this.matrix=null,this.imageCache=null,this.cellStyleList=null,this.dataStyleList=null,this.sheetNameList=null,this.matrixList=null,this.firstPageIndexList=null,this.minRowList=null,this.maxRowList=null,this.cellStyleTableList=null,this.imageQuality=.75,this.imageResolution=96,this.xmlIndentation=1}implements(){let t=[__.c.IStiOdsExportService];return(this.implements=()=>t)()}get defaultExtension(){return"ods"}get exportFormat(){return __.a.StiExportFormat.Ods}get groupCategory(){return"Excel"}get position(){return __.c.StiExportPosition.Ods}get exportNameInMenu(){return StiLocalization.get("Export","ExportTypeCalcFile")}getFilter(){return StiLocalization.get("FileFilters","WriteCalcFilesrFiles")}exportTo(t,e,i){this.exportOds(t,e,i)}exportToAsync(e,i,t,r){setTimeout(async()=>{try{await __.c.StiExportImageHelper.convertAllImages(i,Stimulsoft.System.Drawing.Imaging.ImageFormat.Jpeg,!1,this.exportFormat),this.exportTo(i,t,r),null!=i&&null!=i.preparedExportImages&&(i.preparedExportImages.clear(),i.preparedExportImages=null)}catch(t){if(Exception.log(t,i,`Export Error`).isImportant)return e(Exception.getMessage(t))}e()})}doubleToString(t){return StiMath.round2(t/100,4).toString()[Stimulsoft.System.StiObject.stimulsoft]().replaceAll(",",".")+"in"}getColumnName(t){let e=t/26|0,i=t%26,r="";return 0<e&&(r+=String.fromCharCode(65+e-1)),r+=String.fromCharCode(65+i)}getColorString(t){return"#"+StiString.format("{0:X8}",t.toArgb()).substr(2)}getCellStyleNumber(r,n,e,i){let a=new d,o=!0,s=!0;for(let t=0;t<e;t++)null==this.matrix.bordersY[r+t][n]&&(o=!1),null==this.matrix.bordersY[r+t][n+i]&&(s=!1);let l=!0,m=!0;for(let t=0;t<i;t++)null==this.matrix.bordersX[r][n+t]&&(l=!1),null==this.matrix.bordersX[r+e][n+t]&&(m=!1);if(l&&(a.BorderTop=this.getStringFromBorder(this.matrix.bordersX[r][n])),o&&(a.BorderLeft=this.getStringFromBorder(this.matrix.bordersY[r][n])),m&&(a.BorderBottom=this.getStringFromBorder(this.matrix.bordersX[r+e][n])),s&&(a.BorderRight=this.getStringFromBorder(this.matrix.bordersY[r][n+i])),null!=this.matrix.cells[r][n]){let i=this.matrix.cells[r][n],t=i.cellStyle,e=(a.BackColor=t.color,a.VertAlign=t.vertAlignment,a.FontName=t.font.name,a.FontSize=t.font.sizeInPoints,a.Bold=t.font.bold,a.Italic=t.font.italic,a.Underline=t.font.underline,a.FontColor=t.textColor,a.HorAlign=t.horAlignment,0);if(null!=t.textOptions&&(e=t.textOptions.angle,a.Wordwrap=t.textOptions.wordWrap),a.Angle=0|Math.round(e),null!=i.component){let t=i.component[Stimulsoft.System.StiObject.stimulsoft]().as(StiText),e=(null!=t&&(a.DataStyle=this.getDataStyleNumber(t)),i.component[Stimulsoft.System.StiObject.stimulsoft]().as(StiCheckBox));null==e||StiString.isNullOrEmpty(e.excelDataValue)||(a.FontName=Stimulsoft.StiOptions.Export.CheckBoxReplacementForExcelValue.Font.name,a.FontSize=Stimulsoft.StiOptions.Export.CheckBoxReplacementForExcelValue.Font.sizeInPoints,a.Bold=Stimulsoft.StiOptions.Export.CheckBoxReplacementForExcelValue.Font.bold,a.Italic=Stimulsoft.StiOptions.Export.CheckBoxReplacementForExcelValue.Font.italic,a.Underline=Stimulsoft.StiOptions.Export.CheckBoxReplacementForExcelValue.Font.underline,a.VertAlign=Stimulsoft.StiOptions.Export.CheckBoxReplacementForExcelValue.VertAlignment,a.HorAlign=Stimulsoft.StiOptions.Export.CheckBoxReplacementForExcelValue.HorAlignment)}}if(0<this.cellStyleList.length)for(let e=0;e<this.cellStyleList.length;e++){let t=this.cellStyleList[e];if(t.BorderLeft==a.BorderLeft&&t.BorderRight==a.BorderRight&&t.BorderTop==a.BorderTop&&t.BorderBottom==a.BorderBottom&&t.BackColor.equals(a.BackColor)&&t.VertAlign==a.VertAlign&&t.FontName==a.FontName&&t.FontSize==a.FontSize&&t.Bold==a.Bold&&t.Italic==a.Italic&&t.Underline==a.Underline&&t.FontColor.equals(a.FontColor)&&t.HorAlign==a.HorAlign&&t.Angle==a.Angle&&t.Wordwrap==a.Wordwrap&&t.DataStyle==a.DataStyle)return e}return this.cellStyleList.push(a),this.cellStyleList.length-1}getStringFromBorder(t){return StiString.format("{0} solid {1}",this.doubleToString(t.size),this.getColorString(t.color))}getDataStyleNumber(t){let i=new e,r=t.format,n=null!=r?r.indexOf("|"):-1;if(-1!=n&&(i.CurrencyPositivePattern=__.c.StiExportUtils.getPositivePattern(r.charCodeAt(n+1)-65),i.CurrencyNegativePattern=__.c.StiExportUtils.getNegativePattern(r.charCodeAt(n+2)-65),r=r.substr(0,n)),StiString.isNullOrEmpty(r))return-1;if("C"==r.charAt(0)&&(i.isCurrency=!0),"N"==r.charAt(0)&&(i.isNumeric=!0),"P"==r.charAt(0)&&(i.isPercent=!0),"D"==r.charAt(0)&&(i.isDate=!0,1<r.length)&&(i.DateTimeFormatString=r.substr(1)),"T"==r.charAt(0)&&(i.isTime=!0,1<r.length)&&(i.DateTimeFormatString=r.substr(1)),1==r.length)i.isDefaultFormat=!0;else if(i.isCurrency||i.isNumeric||i.isPercent){let e=1;if(Char.isDigit(r,e)){let t="";while(e<r.length&&Char.isDigit(r,e))t+=r.charAt(e),e++;i.DecimalDigits=parseInt(t)}e<r.length&&"G"==r.charAt(e)&&(e++,i.GroupDigits=3),e<r.length&&"("==r.charAt(e)&&(e++,i.NegativeBraces=!0),e<r.length&&("."==r.charAt(e)||","==r.charAt(e))&&(i.DecimalComma=r.charAt(e),e++),e<r.length&&("+"==r.charAt(e)||"-"==r.charAt(e))&&("+"==r.charAt(e)&&(i.CurrencyPositionBefore=!0),++e<r.length)&&(i.CurrencySymbol=r.substr(e))}if(t.hideZeros&&!StiString.isNullOrEmpty(r)&&(i.isDefaultFormat=!1),0<this.dataStyleList.length)for(let e=0;e<this.dataStyleList.length;e++){let t=this.dataStyleList[Stimulsoft.System.StiObject.stimulsoft]().getByIndex(e);if(t.isNumeric==i.isNumeric&&t.isCurrency==i.isCurrency&&t.isPercent==i.isPercent&&t.isDate==i.isDate&&t.isTime==i.isTime&&t.isDefaultFormat==i.isDefaultFormat&&t.DecimalDigits==i.DecimalDigits&&t.DecimalComma==i.DecimalComma&&t.GroupDigits==i.GroupDigits&&t.CurrencySymbol==i.CurrencySymbol&&t.CurrencyPositionBefore==i.CurrencyPositionBefore&&t.DateTimeFormatString==i.DateTimeFormatString&&t.CurrencyPositivePattern==i.CurrencyPositivePattern&&t.CurrencyNegativePattern==i.CurrencyNegativePattern)return e}this.dataStyleList.push(i);let a=this.dataStyleList[Stimulsoft.System.StiObject.stimulsoft]().countItems-1;return a}writeMimetype(){let t=new MemoryStream,e=new StreamWriter(t,Encoding.ASCII);return e.write("application/vnd.oasis.opendocument.spreadsheet"),e.flush(),t}writeMeta(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t),i=(e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),e.writeStartElement("office:document-meta"),e.writeAttributeString("xmlns:office","urn:oasis:names:tc:opendocument:xmlns:office:1.0"),e.writeAttributeString("xmlns:xlink","http://www.w3.org/1999/xlink"),e.writeAttributeString("xmlns:dc","http://purl.org/dc/elements/1.1/"),e.writeAttributeString("xmlns:meta","urn:oasis:names:tc:opendocument:xmlns:meta:1.0"),e.writeAttributeString("xmlns:ooo","http://openoffice.org/2004/office"),e.writeAttributeString("office:version","1.1"),e.writeStartElement("office:meta"),DateTime.now.toString("yyyy-MM-ddTHH:mm:ss")),r=__.c.StiExportUtils.getReportVersion(this.report);return e.writeElementString("meta:generator",r),e.writeElementString("meta:creation-date",i),e.writeElementString("dc:date",i),e.writeElementString("meta:editing-cycles","1"),e.writeElementString("meta:editing-duration","PT0M0S"),e.writeStartElement("meta:user-defined"),e.writeAttributeString("meta:name","Info 1"),e.writeEndElement(),e.writeStartElement("meta:user-defined"),e.writeAttributeString("meta:name","Info 2"),e.writeEndElement(),e.writeStartElement("meta:user-defined"),e.writeAttributeString("meta:name","Info 3"),e.writeEndElement(),e.writeStartElement("meta:user-defined"),e.writeAttributeString("meta:name","Info 4"),e.writeEndElement(),e.writeStartElement("meta:document-statistic"),e.writeAttributeString("meta:table-count","1"),e.writeAttributeString("meta:cell-count","1"),e.writeEndElement(),e.writeFullEndElement(),e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeManifest(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),e.writeStartElement("manifest:manifest"),e.writeAttributeString("xmlns:manifest","urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"),e.writeStartElement("manifest:file-entry"),e.writeAttributeString("manifest:media-type","application/vnd.oasis.opendocument.spreadsheet"),e.writeAttributeString("manifest:full-path","/"),e.writeEndElement();for(let t=0;t<this.imageCache.imagePackedStore[Stimulsoft.System.StiObject.stimulsoft]().countItems;t++)e.writeStartElement("manifest:file-entry"),e.writeAttributeString("manifest:media-type","image/jpeg"),e.writeAttributeString("manifest:full-path",StiString.format("Pictures/{0:D5}.jpg",t+1)),e.writeEndElement();return e.writeStartElement("manifest:file-entry"),e.writeAttributeString("manifest:media-type","text/xml"),e.writeAttributeString("manifest:full-path","content.xml"),e.writeEndElement(),e.writeStartElement("manifest:file-entry"),e.writeAttributeString("manifest:media-type","text/xml"),e.writeAttributeString("manifest:full-path","styles.xml"),e.writeEndElement(),e.writeStartElement("manifest:file-entry"),e.writeAttributeString("manifest:media-type","text/xml"),e.writeAttributeString("manifest:full-path","meta.xml"),e.writeEndElement(),e.writeStartElement("manifest:file-entry"),e.writeAttributeString("manifest:media-type","text/xml"),e.writeAttributeString("manifest:full-path","settings.xml"),e.writeEndElement(),e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeImage(t){let e=new MemoryStream,i=this.imageCache.imagePackedStore[t];return null!=i&&e.write(i,0,i.length),e}writeSettings(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);return e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),e.writeStartElement("office:document-settings"),e.writeAttributeString("xmlns:office","urn:oasis:names:tc:opendocument:xmlns:office:1.0"),e.writeAttributeString("xmlns:xlink","http://www.w3.org/1999/xlink"),e.writeAttributeString("xmlns:config","urn:oasis:names:tc:opendocument:xmlns:config:1.0"),e.writeAttributeString("xmlns:ooo","http://openoffice.org/2004/office"),e.writeAttributeString("office:version","1.1"),e.writeStartElement("office:settings"),e.writeStartElement("config:config-item-set"),e.writeAttributeString("config:name","ooo:view-settings"),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","VisibleAreaTop"),e.writeAttributeString("config:type","int"),e.writeString("0"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","VisibleAreaLeft"),e.writeAttributeString("config:type","int"),e.writeString("-10107"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","VisibleAreaWidth"),e.writeAttributeString("config:type","int"),e.writeString("43208"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","VisibleAreaHeight"),e.writeAttributeString("config:type","int"),e.writeString("22174"),e.writeEndElement(),e.writeStartElement("config:config-item-map-indexed"),e.writeAttributeString("config:name","Views"),e.writeStartElement("config:config-item-map-entry"),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ViewId"),e.writeAttributeString("config:type","string"),e.writeString("View1"),e.writeEndElement(),e.writeStartElement("config:config-item-map-named"),e.writeAttributeString("config:name","Tables"),e.writeStartElement("config:config-item-map-entry"),e.writeAttributeString("config:name","Sheet1"),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","CursorPositionX"),e.writeAttributeString("config:type","int"),e.writeString("1"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","CursorPositionY"),e.writeAttributeString("config:type","int"),e.writeString("1"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","HorizontalSplitMode"),e.writeAttributeString("config:type","short"),e.writeString("0"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","VerticalSplitMode"),e.writeAttributeString("config:type","short"),e.writeString("0"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","HorizontalSplitPosition"),e.writeAttributeString("config:type","int"),e.writeString("0"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","VerticalSplitPosition"),e.writeAttributeString("config:type","int"),e.writeString("0"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ActiveSplitRange"),e.writeAttributeString("config:type","short"),e.writeString("2"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PositionLeft"),e.writeAttributeString("config:type","int"),e.writeString("0"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PositionRight"),e.writeAttributeString("config:type","int"),e.writeString("0"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PositionTop"),e.writeAttributeString("config:type","int"),e.writeString("0"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PositionBottom"),e.writeAttributeString("config:type","int"),e.writeString("0"),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ActiveTable"),e.writeAttributeString("config:type","string"),e.writeString("Sheet1"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","HorizontalScrollbarWidth"),e.writeAttributeString("config:type","int"),e.writeString("270"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ZoomType"),e.writeAttributeString("config:type","short"),e.writeString("0"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ZoomValue"),e.writeAttributeString("config:type","int"),e.writeString("100"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PageViewZoomValue"),e.writeAttributeString("config:type","int"),e.writeString("60"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ShowPageBreakPreview"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ShowZeroValues"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ShowNotes"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ShowGrid"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","GridColor"),e.writeAttributeString("config:type","long"),e.writeString("12632256"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ShowPageBreaks"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","HasColumnRowHeaders"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","HasSheetTabs"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","IsOutlineSymbolsSet"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","IsSnapToRaster"),e.writeAttributeString("config:type","long"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","RasterIsVisible"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","RasterResolutionX"),e.writeAttributeString("config:type","int"),e.writeString("1000"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","RasterResolutionY"),e.writeAttributeString("config:type","int"),e.writeString("1000"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","RasterSubdivisionX"),e.writeAttributeString("config:type","int"),e.writeString("1"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","RasterSubdivisionY"),e.writeAttributeString("config:type","int"),e.writeString("1"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","IsRasterAxisSynchronized"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("config:config-item-set"),e.writeAttributeString("config:name","ooo:configuration-settings"),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ShowZeroValues"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ShowNotes"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ShowGrid"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","GridColor"),e.writeAttributeString("config:type","long"),e.writeString("12632256"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ShowPageBreaks"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","LinkUpdateMode"),e.writeAttributeString("config:type","short"),e.writeString("3"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","HasColumnRowHeaders"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","HasSheetTabs"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","IsOutlineSymbolsSet"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","IsSnapToRaster"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","RasterIsVisible"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","RasterResolutionX"),e.writeAttributeString("config:type","int"),e.writeString("1000"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","RasterResolutionY"),e.writeAttributeString("config:type","int"),e.writeString("1000"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","RasterSubdivisionX"),e.writeAttributeString("config:type","int"),e.writeString("1"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","RasterSubdivisionY"),e.writeAttributeString("config:type","int"),e.writeString("1"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","IsRasterAxisSynchronized"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","AutoCalculate"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PrinterName"),e.writeAttributeString("config:type","string"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PrinterSetup"),e.writeAttributeString("config:type","base64Binary"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ApplyUserData"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","CharacterCompressionType"),e.writeAttributeString("config:type","short"),e.writeString("0"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","IsKernAsianPunctuation"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","SaveVersionOnClose"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","UpdateFromTemplate"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","AllowPrintJobCancel"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","LoadReadonly"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeEndElement(),e.writeFullEndElement(),e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeStyles(t){let e=new MemoryStream,i=new XmlTextWriter(Encoding.UTF8,e),r=(i.indentation=this.xmlIndentation<0?0:this.xmlIndentation,i.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,i.writeStartDocument(),i.writeStartElement("office:document-styles"),i.writeAttributeString("xmlns:office","urn:oasis:names:tc:opendocument:xmlns:office:1.0"),i.writeAttributeString("xmlns:style","urn:oasis:names:tc:opendocument:xmlns:style:1.0"),i.writeAttributeString("xmlns:text","urn:oasis:names:tc:opendocument:xmlns:text:1.0"),i.writeAttributeString("xmlns:table","urn:oasis:names:tc:opendocument:xmlns:table:1.0"),i.writeAttributeString("xmlns:draw","urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"),i.writeAttributeString("xmlns:fo","urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"),i.writeAttributeString("xmlns:xlink","http://www.w3.org/1999/xlink"),i.writeAttributeString("xmlns:dc","http://purl.org/dc/elements/1.1/"),i.writeAttributeString("xmlns:meta","urn:oasis:names:tc:opendocument:xmlns:meta:1.0"),i.writeAttributeString("xmlns:number","urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"),i.writeAttributeString("xmlns:presentation","urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"),i.writeAttributeString("xmlns:svg","urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"),i.writeAttributeString("xmlns:chart","urn:oasis:names:tc:opendocument:xmlns:chart:1.0"),i.writeAttributeString("xmlns:dr3d","urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"),i.writeAttributeString("xmlns:math","http://www.w3.org/1998/Math/MathML"),i.writeAttributeString("xmlns:form","urn:oasis:names:tc:opendocument:xmlns:form:1.0"),i.writeAttributeString("xmlns:script","urn:oasis:names:tc:opendocument:xmlns:script:1.0"),i.writeAttributeString("xmlns:ooo","http://openoffice.org/2004/office"),i.writeAttributeString("xmlns:ooow","http://openoffice.org/2004/writer"),i.writeAttributeString("xmlns:oooc","http://openoffice.org/2004/calc"),i.writeAttributeString("xmlns:dom","http://www.w3.org/2001/xml-events"),i.writeAttributeString("office:version","1.1"),i.writeStartElement("office:font-face-decls"),i.writeStartElement("style:font-face"),i.writeAttributeString("style:name","Arial"),i.writeAttributeString("svg:font-family","Arial"),i.writeEndElement(),i.writeStartElement("style:font-face"),i.writeAttributeString("style:name","Tahoma"),i.writeAttributeString("svg:font-family","Tahoma"),i.writeAttributeString("style:font-family-generic","system"),i.writeAttributeString("style:font-pitch","variable"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("office:styles"),i.writeStartElement("style:default-style"),i.writeAttributeString("style:family","table-cell"),i.writeStartElement("style:table-cell-properties"),i.writeAttributeString("style:decimal-places","2"),i.writeEndElement(),i.writeStartElement("style:paragraph-properties"),i.writeAttributeString("style:tab-stop-distance","1.25cm"),i.writeEndElement(),i.writeStartElement("style:text-properties"),i.writeAttributeString("style:font-name","Arial"),i.writeAttributeString("fo:language","ru"),i.writeAttributeString("fo:country","RU"),i.writeAttributeString("style:font-name-asian","Lucida Sans Unicode"),i.writeAttributeString("style:language-asian","zxx"),i.writeAttributeString("style:country-asian","none"),i.writeAttributeString("style:font-name-complex","Tahoma"),i.writeAttributeString("style:language-complex","zxx"),i.writeAttributeString("style:country-complex","none"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("number:number-style"),i.writeAttributeString("style:name","N0"),i.writeStartElement("number:number"),i.writeAttributeString("number:min-integer-digits","1"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("style:style"),i.writeAttributeString("style:name","Default"),i.writeAttributeString("style:family","table-cell"),i.writeEndElement(),i.writeStartElement("style:style"),i.writeAttributeString("style:name","Result"),i.writeAttributeString("style:family","table-cell"),i.writeAttributeString("style:parent-style-name","Default"),i.writeStartElement("style:text-properties"),i.writeAttributeString("fo:font-style","italic"),i.writeAttributeString("style:text-underline-style","solid"),i.writeAttributeString("style:text-underline-width","auto"),i.writeAttributeString("style:text-underline-color","font-color"),i.writeAttributeString("fo:font-weight","bold"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("style:style"),i.writeAttributeString("style:name","Heading"),i.writeAttributeString("style:family","table-cell"),i.writeAttributeString("style:parent-style-name","Default"),i.writeStartElement("style:table-cell-properties"),i.writeAttributeString("style:text-align-source","fix"),i.writeAttributeString("style:repeat-content","false"),i.writeEndElement(),i.writeStartElement("style:paragraph-properties"),i.writeAttributeString("fo:text-align","center"),i.writeEndElement(),i.writeStartElement("style:text-properties"),i.writeAttributeString("fo:font-size","16pt"),i.writeAttributeString("fo:font-style","italic"),i.writeAttributeString("fo:font-weight","bold"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("style:style"),i.writeAttributeString("style:name","Heading1"),i.writeAttributeString("style:family","table-cell"),i.writeAttributeString("style:parent-style-name","Heading"),i.writeStartElement("style:table-cell-properties"),i.writeAttributeString("style:rotation-angle","90"),i.writeEndElement(),i.writeEndElement(),i.writeFullEndElement(),i.writeStartElement("office:automatic-styles"),t.getByIndex(0)),n=r.unit.convertToHInches(r.pageHeight*r.segmentPerHeight),a=r.unit.convertToHInches(r.pageWidth*r.segmentPerWidth),o=r.unit.convertToHInches(r.margins.left),s=r.unit.convertToHInches(r.margins.right),l=r.unit.convertToHInches(r.margins.top),m=r.unit.convertToHInches(r.margins.bottom)-4;return m<0&&(m=0),i.writeStartElement("style:page-layout"),i.writeAttributeString("style:name","pm1"),i.writeStartElement("style:page-layout-properties"),i.writeAttributeString("fo:page-width",this.doubleToString(a)),i.writeAttributeString("fo:page-height",this.doubleToString(n)),i.writeAttributeString("style:num-format","1"),i.writeAttributeString("style:print-orientation",r.orientation==StiPageOrientation.Portrait?"portrait":"landscape"),i.writeAttributeString("fo:margin-top",this.doubleToString(l)),i.writeAttributeString("fo:margin-bottom",this.doubleToString(m)),i.writeAttributeString("fo:margin-left",this.doubleToString(o)),i.writeAttributeString("fo:margin-right",this.doubleToString(s)),i.writeAttributeString("style:writing-mode","lr-tb"),i.writeEndElement(),i.writeStartElement("style:header-style"),i.writeStartElement("style:header-footer-properties"),i.writeAttributeString("fo:min-height","0.101cm"),i.writeAttributeString("fo:margin-left","0cm"),i.writeAttributeString("fo:margin-right","0cm"),i.writeAttributeString("fo:margin-bottom","0cm"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("style:footer-style"),i.writeStartElement("style:header-footer-properties"),i.writeAttributeString("fo:min-height","0.101cm"),i.writeAttributeString("fo:margin-left","0cm"),i.writeAttributeString("fo:margin-right","0cm"),i.writeAttributeString("fo:margin-top","0cm"),i.writeEndElement(),i.writeEndElement(),i.writeEndElement(),i.writeFullEndElement(),i.writeStartElement("office:master-styles"),i.writeStartElement("style:master-page"),i.writeAttributeString("style:name","Default"),i.writeAttributeString("style:page-layout-name","pm1"),i.writeStartElement("style:header"),i.writeAttributeString("style:display","false"),i.writeStartElement("text:p"),i.writeStartElement("text:sheet-name"),i.writeString("Sheet1"),i.writeEndElement(),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("style:header-left"),i.writeAttributeString("style:display","false"),i.writeEndElement(),i.writeStartElement("style:footer"),i.writeAttributeString("style:display","false"),i.writeStartElement("text:p"),i.writeString("Page "),i.writeStartElement("text:page-number"),i.writeString("1"),i.writeEndElement(),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("style:footer-left"),i.writeAttributeString("style:display","false"),i.writeEndElement(),i.writeEndElement(),i.writeEndElement(),i.writeFullEndElement(),i.writeEndDocument(),i.flush(),e}writeContent(s,l){let t=new MemoryStream,r=new XmlTextWriter(Encoding.UTF8,t),m=(r.indentation=this.xmlIndentation<0?0:this.xmlIndentation,r.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,r.writeStartDocument(),r.writeStartElement("office:document-content"),r.writeAttributeString("xmlns:office","urn:oasis:names:tc:opendocument:xmlns:office:1.0"),r.writeAttributeString("xmlns:style","urn:oasis:names:tc:opendocument:xmlns:style:1.0"),r.writeAttributeString("xmlns:text","urn:oasis:names:tc:opendocument:xmlns:text:1.0"),r.writeAttributeString("xmlns:table","urn:oasis:names:tc:opendocument:xmlns:table:1.0"),r.writeAttributeString("xmlns:draw","urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"),r.writeAttributeString("xmlns:fo","urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"),r.writeAttributeString("xmlns:xlink","http://www.w3.org/1999/xlink"),r.writeAttributeString("xmlns:dc","http://purl.org/dc/elements/1.1/"),r.writeAttributeString("xmlns:meta","urn:oasis:names:tc:opendocument:xmlns:meta:1.0"),r.writeAttributeString("xmlns:number","urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"),r.writeAttributeString("xmlns:presentation","urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"),r.writeAttributeString("xmlns:svg","urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"),r.writeAttributeString("xmlns:chart","urn:oasis:names:tc:opendocument:xmlns:chart:1.0"),r.writeAttributeString("xmlns:dr3d","urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"),r.writeAttributeString("xmlns:math","http://www.w3.org/1998/Math/MathML"),r.writeAttributeString("xmlns:form","urn:oasis:names:tc:opendocument:xmlns:form:1.0"),r.writeAttributeString("xmlns:script","urn:oasis:names:tc:opendocument:xmlns:script:1.0"),r.writeAttributeString("xmlns:ooo","http://openoffice.org/2004/office"),r.writeAttributeString("xmlns:ooow","http://openoffice.org/2004/writer"),r.writeAttributeString("xmlns:oooc","http://openoffice.org/2004/calc"),r.writeAttributeString("xmlns:dom","http://www.w3.org/2001/xml-events"),r.writeAttributeString("xmlns:xforms","http://www.w3.org/2002/xforms"),r.writeAttributeString("xmlns:xsd","http://www.w3.org/2001/XMLSchema"),r.writeAttributeString("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance"),r.writeAttributeString("office:version","1.1"),0);while(m<l.count){let t=new StiPagesCollection(s,l),e=(t.addV2Internal(l.getByIndex(m)),m),i=l.getByIndex(m).excelSheetValue;while(m<l.count-1&&l.getByIndex(m+1).excelSheetValue==i)m++,t.addV2Internal(l.getByIndex(m));t.cacheMode=s.renderedPages.cacheMode;let r=t.getByIndex(0).excelSheetValue,n=(StiString.isNullOrEmpty(r)&&(r=StiString.format("Page {0}",this.sheetNameList[Stimulsoft.System.StiObject.stimulsoft]().countItems+1)),""),a=1;if(this.matrix=new __.c.StiMatrix(t,Stimulsoft.StiOptions.Export.OpenDocumentCalc.divideBigCells,this),this.isStopped)return null;let o=0;do{this.firstPageIndexList.push(e),this.matrixList.push(this.matrix);let t=this.matrix.coordY.countItems-1;if(t-o>Stimulsoft.StiOptions.Export.OpenDocumentCalc.maximumSheetHeight?t=o+Stimulsoft.StiOptions.Export.OpenDocumentCalc.maximumSheetHeight:this.matrix=null,this.minRowList.push(o),this.maxRowList.push(t),o=t,(null!=this.matrix||0<n.length)&&(n=` part`+a++),this.sheetNameList.push(r+n),this.isStopped)return null}while(null!=this.matrix);m++}let h=new Hashtable,c=new Hashtable,n=new Hashtable,g=new Hashtable;for(let i=0;i<this.matrixList[Stimulsoft.System.StiObject.stimulsoft]().countItems;i++){this.matrix=this.matrixList[Stimulsoft.System.StiObject.stimulsoft]().getByIndex(i);let t=this.minRowList[Stimulsoft.System.StiObject.stimulsoft]().getByIndex(i),e=this.maxRowList[Stimulsoft.System.StiObject.stimulsoft]().getByIndex(i),a=StiArray.create2(Boolean,this.matrix.coordY.countItems,this.matrix.coordX.countItems),o=StiArray.create2(Number,this.matrix.coordY.countItems,this.matrix.coordX.countItems);for(let t=0;t<this.matrix.coordX.countItems-1;t++){let e=this.matrix.coordX.getByIndex(t+1)-this.matrix.coordX.getByIndex(t);if(!n.containsKey(e)){let t=n.count;n.set(e,t),g.set(t,e)}}for(let n=t+1;n<e+1;n++){let e=this.matrix.coordY.getByIndex(n)-this.matrix.coordY.getByIndex(n-1);if(!h.containsKey(e)){let t=h.count;h.set(e,t),c.set(t,e)}for(let r=1;r<this.matrix.coordX.countItems;r++){let i=this.matrix.cells[n-1][r-1];if(!a[n][r])if(null!=i){for(let e=0;e<=i.height;e++)for(let t=0;t<=i.width;t++)a[n+e][r+t]=!0;o[n-1][r-1]=this.getCellStyleNumber(n-1,r-1,i.height+1,i.width+1)}else o[n-1][r-1]=this.getCellStyleNumber(n-1,r-1,1,1)}}this.cellStyleTableList.push(o)}r.writeStartElement("office:scripts"),r.writeEndElement();let i=new Hashtable;for(let t of this.cellStyleList)i.set(t.FontName,t.FontName);r.writeStartElement("office:font-face-decls");for(let e of i.keys){let t=i.get(e);r.writeStartElement("style:font-face"),r.writeAttributeString("style:name",t),r.writeAttributeString("svg:font-family",t),r.writeEndElement()}r.writeEndElement(),r.writeStartElement("office:automatic-styles");for(let e=0;e<n.count;e++){r.writeStartElement("style:style"),r.writeAttributeString("style:name",`co`+(e+1)),r.writeAttributeString("style:family","table-column"),r.writeStartElement("style:table-column-properties"),r.writeAttributeString("fo:break-before","auto");let t=g.get(e);r.writeAttributeString("style:column-width",this.doubleToString(t)),r.writeEndElement(),r.writeEndElement()}for(let e=0;e<h.count;e++){r.writeStartElement("style:style"),r.writeAttributeString("style:name",`ro`+(e+1)),r.writeAttributeString("style:family","table-row"),r.writeStartElement("style:table-row-properties");let t=c.get(e);r.writeAttributeString("style:row-height",this.doubleToString(t)),r.writeAttributeString("fo:break-before","auto"),r.writeAttributeString("style:use-optimal-row-height","false"),r.writeEndElement(),r.writeEndElement()}r.writeStartElement("style:style"),r.writeAttributeString("style:name","ta1"),r.writeAttributeString("style:family","table"),r.writeAttributeString("style:master-page-name","Default"),r.writeStartElement("style:table-properties"),r.writeAttributeString("table:display","true"),r.writeAttributeString("style:writing-mode","lr-tb"),r.writeEndElement(),r.writeEndElement(),r.writeStartElement("style:style"),r.writeAttributeString("style:name","gr1"),r.writeAttributeString("style:family","graphic"),r.writeStartElement("style:graphic-properties"),r.writeAttributeString("draw:stroke","none"),r.writeAttributeString("draw:fill","none"),r.writeAttributeString("draw:textarea-horizontal-align","center"),r.writeAttributeString("draw:textarea-vertical-align","middle"),r.writeAttributeString("draw:color-mode","standard"),r.writeAttributeString("draw:luminance","0%"),r.writeAttributeString("draw:contrast","0%"),r.writeAttributeString("draw:gamma","100%"),r.writeAttributeString("draw:red","0%"),r.writeAttributeString("draw:green","0%"),r.writeAttributeString("draw:blue","0%"),r.writeAttributeString("fo:clip","rect(0cm 0cm 0cm 0cm)"),r.writeAttributeString("draw:image-opacity","100%"),r.writeAttributeString("style:mirror","none"),r.writeEndElement(),r.writeEndElement(),r.writeStartElement("style:style"),r.writeAttributeString("style:name","P1"),r.writeAttributeString("style:family","paragraph"),r.writeStartElement("style:paragraph-properties"),r.writeAttributeString("fo:text-align","center"),r.writeEndElement(),r.writeEndElement();for(let e=0;e<this.dataStyleList[Stimulsoft.System.StiObject.stimulsoft]().countItems;e++){let t=this.dataStyleList[Stimulsoft.System.StiObject.stimulsoft]().getByIndex(e);t.isNumeric&&(r.writeStartElement("number:number-style"),t.NegativeBraces?(r.writeAttributeString("style:name",`N${e+1}P0`),r.writeAttributeString("style:volatile","true")):r.writeAttributeString("style:name",`N`+(e+1))," "!=t.DecimalComma&&(r.writeAttributeString("number:language",","==t.DecimalComma?"ru":"en"),r.writeAttributeString("number:country",","==t.DecimalComma?"RU":"US")),r.writeStartElement("number:number"),r.writeAttributeString("number:decimal-places",t.DecimalDigits.toString()),r.writeAttributeString("number:min-integer-digits","1"),r.writeAttributeString("number:grouping",3==t.GroupDigits?"true":"false"),r.writeEndElement(),r.writeEndElement(),t.NegativeBraces)&&(r.writeStartElement("number:number-style"),r.writeAttributeString("style:name",`N`+(e+1))," "!=t.DecimalComma&&(r.writeAttributeString("number:language",","==t.DecimalComma?"ru":"en"),r.writeAttributeString("number:country",","==t.DecimalComma?"RU":"US")),r.writeElementString("number:text","("),r.writeStartElement("number:number"),r.writeAttributeString("number:decimal-places",t.DecimalDigits.toString()),r.writeAttributeString("number:min-integer-digits","1"),r.writeAttributeString("number:grouping",3==t.GroupDigits?"true":"false"),r.writeEndElement(),r.writeElementString("number:text",")"),r.writeStartElement("style:map"),r.writeAttributeString("style:condition","value()>=0"),r.writeAttributeString("style:apply-style-name",`N${e+1}P0`),r.writeEndElement(),r.writeEndElement()),t.isPercent&&(r.writeStartElement("number:percentage-style"),r.writeAttributeString("style:name",`N`+(e+1))," "!=t.DecimalComma&&(r.writeAttributeString("number:language",","==t.DecimalComma?"ru":"en"),r.writeAttributeString("number:country",","==t.DecimalComma?"RU":"US")),r.writeStartElement("number:number"),r.writeAttributeString("number:decimal-places",t.DecimalDigits.toString()),r.writeAttributeString("number:min-integer-digits","1"),3==t.GroupDigits&&r.writeAttributeString("number:grouping","true"),r.writeEndElement(),r.writeElementString("number:text","%"),r.writeEndElement()),t.isCurrency&&(r.writeStartElement("number:currency-style"),r.writeAttributeString("style:name",`N`+(e+1))," "!=t.DecimalComma&&(r.writeAttributeString("number:language",","==t.DecimalComma?"ru":"en"),r.writeAttributeString("number:country",","==t.DecimalComma?"RU":"US")),t.CurrencyPositionBefore&&r.writeElementString("number:currency-symbol",t.CurrencySymbol),r.writeStartElement("number:number"),r.writeAttributeString("number:decimal-places",t.DecimalDigits.toString()),r.writeAttributeString("number:min-integer-digits","1"),r.writeAttributeString("number:grouping",3==t.GroupDigits?"true":"false"),r.writeEndElement(),t.CurrencyPositionBefore||r.writeElementString("number:currency-symbol",t.CurrencySymbol),r.writeEndElement()),t.isDate&&(r.writeStartElement("number:date-style"),r.writeAttributeString("style:name",`N`+(e+1)),this.writeDateTimeFormatString(r,t.DateTimeFormatString,"d"),r.writeEndElement()),t.isTime&&(r.writeStartElement("number:time-style"),r.writeAttributeString("style:name",`N`+(e+1)),StiString.isNullOrEmpty(t.DateTimeFormatString)||-1==t.DateTimeFormatString.indexOf("h")||(r.writeAttributeString("number:language","en"),r.writeAttributeString("number:country","US")),this.writeDateTimeFormatString(r,t.DateTimeFormatString,"t"),r.writeEndElement())}for(let i=0;i<this.cellStyleList[Stimulsoft.System.StiObject.stimulsoft]().countItems;i++){let t=this.cellStyleList[Stimulsoft.System.StiObject.stimulsoft]().getByIndex(i),e=(r.writeStartElement("style:style"),r.writeAttributeString("style:name",`ce`+(i+1)),r.writeAttributeString("style:family","table-cell"),r.writeAttributeString("style:parent-style-name","Default"),-1!=t.DataStyle&&r.writeAttributeString("style:data-style-name",`N`+(t.DataStyle+1)),r.writeStartElement("style:table-cell-properties"),0<t.BackColor.a?r.writeAttributeString("fo:background-color",this.getColorString(t.BackColor)):r.writeAttributeString("fo:background-color","transparent"),t.VertAlign==StiVertAlignment.Center&&r.writeAttributeString("style:vertical-align","middle"),t.VertAlign==StiVertAlignment.Top&&r.writeAttributeString("style:vertical-align","top"),r.writeAttributeString("style:text-align-source","fix"),r.writeAttributeString("style:repeat-content","false"),t.Wordwrap&&r.writeAttributeString("fo:wrap-option","wrap"),r.writeAttributeString("fo:padding","0in"),r.writeAttributeString("fo:border-left",t.BorderLeft),r.writeAttributeString("fo:border-right",t.BorderRight),r.writeAttributeString("fo:border-top",t.BorderTop),r.writeAttributeString("fo:border-bottom",t.BorderBottom),0!=t.Angle&&(r.writeAttributeString("style:rotation-angle",t.Angle.toString()),r.writeAttributeString("style:rotation-align","none")),r.writeEndElement(),r.writeStartElement("style:paragraph-properties"),t.HorAlign==StiTextHorAlignment.Left&&r.writeAttributeString("fo:text-align","start"),t.HorAlign==StiTextHorAlignment.Center&&r.writeAttributeString("fo:text-align","center"),t.HorAlign==StiTextHorAlignment.Right&&r.writeAttributeString("fo:text-align","end"),t.HorAlign==StiTextHorAlignment.Width&&r.writeAttributeString("fo:text-align","justify"),r.writeAttributeString("fo:margin-left","0cm"),r.writeEndElement(),r.writeStartElement("style:text-properties"),r.writeAttributeString("fo:color",this.getColorString(t.FontColor)),r.writeAttributeString("style:font-name",t.FontName),t.FontSize+`pt`);r.writeAttributeString("fo:font-size",e),r.writeAttributeString("fo:font-size-asian",e),r.writeAttributeString("fo:font-size-complex",e),t.Italic&&(r.writeAttributeString("fo:font-style","italic"),r.writeAttributeString("fo:font-style-asian","italic"),r.writeAttributeString("fo:font-style-complex","italic")),t.Underline&&(r.writeAttributeString("style:text-underline-style","solid"),r.writeAttributeString("style:text-underline-width","auto"),r.writeAttributeString("style:text-underline-color","font-color")),t.Bold&&(r.writeAttributeString("fo:font-weight","bold"),r.writeAttributeString("fo:font-weight-asian","bold"),r.writeAttributeString("fo:font-weight-complex","bold")),r.writeEndElement(),r.writeEndElement()}r.writeFullEndElement(),r.writeStartElement("office:body"),r.writeStartElement("office:spreadsheet"),r.writeStartElement("table:calculation-settings"),r.writeAttributeString("table:use-regular-expressions","false"),r.writeEndElement(),this.currentPassNumber=Stimulsoft.StiOptions.Export.OpenDocumentCalc.divideSegmentPages?3:2;for(let t=0;t<this.matrixList[Stimulsoft.System.StiObject.stimulsoft]().countItems;t++)this.writeTableFromMatrix(r,t,h,n);return r.writeEndElement(),r.writeEndElement(),r.writeFullEndElement(),r.writeEndDocument(),r.flush(),t}writeDateTimeFormatString(i,r,t){if(1==(r=StiString.isNullOrEmpty(r)?t:r).length){let t=this.currentCulture.dateTimeFormat;switch(r){case"d":r=t.shortDatePattern;break;case"D":r=t.longDatePattern;break;case"f":r=t.shortDatePattern+" "+t.shortTimePattern;break;case"F":r=t.fullDateTimePattern;break;case"g":r=t.shortDatePattern+" "+t.shortTimePattern;break;case"G":r=t.shortDatePattern+" "+t.longTimePattern;break;case"m":case"M":r=CultureInfo.currentCulture.name.includes("en")||CultureInfo.currentCulture.name.includes("us")?"MMMM d":"d MMMM";break;case"r":case"R":r="ddd, dd MMM yyyy HH\\:mm\\:ss \\G\\M\\T";break;case"s":r="yyyy\\-MM\\-dd\\THH\\:mm\\:ss";break;case"t":r=t.shortTimePattern;break;case"T":r=t.longTimePattern;break;case"u":r="yyyy\\-MM\\-dd HH\\:mm\\:ss\\Z";break;case"U":r=t.fullDateTimePattern;break;case"y":case"Y":r=t.yearMonthPattern;break}r=r[Stimulsoft.System.StiObject.stimulsoft]().replaceAll('"',"")[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("'","")}let n=0;while(n<r.length){let t=r.charAt(n),e=1;while(n+1<r.length&&r.charAt(n+1)==t)n++,e++;switch(n++,t){case"d":1==e&&(i.writeStartElement("number:day"),i.writeEndElement()),2==e&&(i.writeStartElement("number:day"),i.writeAttributeString("number:style","long"),i.writeEndElement()),3==e&&(i.writeStartElement("number:day-of-week"),i.writeEndElement()),4==e&&(i.writeStartElement("number:day-of-week"),i.writeAttributeString("number:style","long"),i.writeEndElement());break;case"M":1==e&&(i.writeStartElement("number:month"),i.writeEndElement()),2==e&&(i.writeStartElement("number:month"),i.writeAttributeString("number:style","long"),i.writeEndElement()),3==e&&(i.writeStartElement("number:month"),i.writeAttributeString("number:textual","true"),i.writeEndElement()),4==e&&(i.writeStartElement("number:month"),i.writeAttributeString("number:style","long"),i.writeAttributeString("number:textual","true"),i.writeEndElement());break;case"y":1!=e&&2!=e||(i.writeStartElement("number:year"),i.writeEndElement()),3!=e&&4!=e||(i.writeStartElement("number:year"),i.writeAttributeString("number:style","long"),i.writeEndElement());break;case"s":1==e&&(i.writeStartElement("number:seconds"),i.writeEndElement()),2==e&&(i.writeStartElement("number:seconds"),i.writeAttributeString("number:style","long"),i.writeEndElement());break;case"m":1==e&&(i.writeStartElement("number:minutes"),i.writeEndElement()),2==e&&(i.writeStartElement("number:minutes"),i.writeAttributeString("number:style","long"),i.writeEndElement());break;case"h":case"H":1==e&&(i.writeStartElement("number:hours"),i.writeEndElement()),2==e&&(i.writeStartElement("number:hours"),i.writeAttributeString("number:style","long"),i.writeEndElement());break;default:i.writeElementString("number:text",t);break}}}writeTableFromMatrix(g,t,r,n){let S=this.matrixList[t],e=this.minRowList[t],i=this.maxRowList[t],a=this.cellStyleTableList[t],p=this.sheetNameList[t],d=StiArray.create2(Boolean,S.coordY.countItems,S.coordX.countItems);g.writeStartElement("table:table"),g.writeAttributeString("table:name",p),g.writeAttributeString("table:style-name","ta1"),g.writeAttributeString("table:print","false");for(let i=0;i<S.coordX.countItems-1;i++){let t=S.coordX.getByIndex(i+1)-S.coordX.getByIndex(i),e=n.get(t);g.writeStartElement("table:table-column"),g.writeAttributeString("table:style-name",`co`+(e+1)),g.writeAttributeString("table:default-cell-style-name","Default"),g.writeEndElement()}let o=Math.max(S.coordY.countItems/200,1),s=0;for(let c=e+1;c<i+1;c++){let t=c/o|0,e=(t>s&&(s=t,this.invokeExporting2(c,S.coordY.countItems,this.currentPassNumber,this.maximumPassNumber)),S.coordY.getByIndex(c)-S.coordY.getByIndex(c-1)),i=r.get(e);g.writeStartElement("table:table-row"),g.writeAttributeString("table:style-name",`ro`+(i+1));for(let h=1;h<S.coordX.countItems;h++){let o=S.cells[c-1][h-1];if(d[c][h])g.writeStartElement("table:covered-table-cell");else if(null!=o){for(let e=0;e<=o.height;e++)for(let t=0;t<=o.width;t++)d[c+e][h+t]=!0;let t=a[c-1][h-1],s=this.cellStyleList[t].DataStyle,l=(g.writeStartElement("table:table-cell"),g.writeAttributeString("table:style-name",`ce`+(t+1)),(0<o.width||0<o.height)&&(g.writeAttributeString("table:number-columns-spanned",(o.width+1).toString()),g.writeAttributeString("table:number-rows-spanned",(o.height+1).toString())),o.component[Stimulsoft.System.StiObject.stimulsoft]().as(StiText)),m=o.text,e=o.component[Stimulsoft.System.StiObject.stimulsoft]().as(StiCheckBox);if(null==e||StiString.isNullOrEmpty(e.excelDataValue)||(m=e.excelDataValue),!o.component.isExportAsImage(__.a.StiExportFormat.Ods)&&(!StiString.isNullOrEmpty(m)||null!=l&&null!=l.excelDataValue)){let i=!1,r=0,n=DateTime.now,a=null;if(-1!=s&&null!=l&&null!=l.excelDataValue&&"-"!=l.excelDataValue){let e=l.excelDataValue,t=e.replace(/[^\d.,-]/g,"")[Stimulsoft.System.StiObject.stimulsoft]().replaceAll(",",".");a=this.dataStyleList[s],i=!0;try{if(a.isDate||a.isTime){let t=DateTime.tryParseExact(e,[null]);t.successfully?n=t.result:i=!1}else r=parseFloat(t),isNaN(r)&&(i=!1,r=0)}catch(t){i=!1}i||null!=m||(m=e)}if(i)if(a.isDate)g.writeAttributeString("office:value-type","date"),g.writeAttributeString("office:date-value",n.toString("yyyy-MM-dd"));else if(a.isTime)g.writeAttributeString("office:value-type","time"),g.writeAttributeString("office:time-value",n.toString("PTHH\\Hmm\\Mss\\S"));else{let t=r.toString()[Stimulsoft.System.StiObject.stimulsoft]().replaceAll(",",".");a.isNumeric&&g.writeAttributeString("office:value-type","float"),a.isPercent&&g.writeAttributeString("office:value-type","percentage"),a.isCurrency&&g.writeAttributeString("office:value-type","currency"),g.writeAttributeString("office:value",t)}else g.writeAttributeString("office:value-type","string");let o=__.c.StiExportUtils.splitString(m,!0);for(let e=0;e<o.length;e++){let t=o[e];g.writeStartElement("text:p"),g.writeString(t),g.writeEndElement()}}if(o.component.isExportAsImage(__.a.StiExportFormat.Ods)){g.writeAttributeString("office:value-type","string");let e=o.component[Stimulsoft.System.StiObject.stimulsoft]().as(IStiExportImageExtended);if(null!=e){let a=null,t={ref:this.imageResolution};if(null!=(a=e.getImage(t,__.a.StiExportFormat.Ods))){let t=S.getRealImageData(o,a),e=(null!=t&&(a=t),this.imageCache.addImageInt(a)),i=S.coordX.getByIndex(h+o.width)-S.coordX.getByIndex(h-1),r=S.coordY.getByIndex(c+o.height)-S.coordY.getByIndex(c-1),n=`'${p}'.`+this.getColumnName(o.left+o.width+1)+(o.top+o.height+1+1);g.writeStartElement("draw:frame"),g.writeAttributeString("table:end-cell-address",n),g.writeAttributeString("table:end-x","0in"),g.writeAttributeString("table:end-y","0in"),g.writeAttributeString("draw:z-index","0"),g.writeAttributeString("draw:name",`Picture`+(e+1)),g.writeAttributeString("draw:style-name","gr1"),g.writeAttributeString("draw:text-style-name","P1"),g.writeAttributeString("text:anchor-type","paragraph"),g.writeAttributeString("svg:x",this.doubleToString(0)),g.writeAttributeString("svg:y",this.doubleToString(0)),g.writeAttributeString("svg:width",this.doubleToString(i)),g.writeAttributeString("svg:height",this.doubleToString(r)),g.writeStartElement("draw:image"),g.writeAttributeString("xlink:href",StiString.format("Pictures/{0:D5}.jpg",e+1)),g.writeAttributeString("xlink:type","simple"),g.writeAttributeString("xlink:show","embed"),g.writeAttributeString("xlink:actuate","onLoad"),g.writeStartElement("text:p"),g.writeEndElement(),g.writeEndElement(),g.writeEndElement()}}}}else{let t=a[c-1][h-1];g.writeStartElement("table:table-cell"),g.writeAttributeString("table:style-name",`ce`+(t+1))}g.writeEndElement()}g.writeEndElement()}g.writeEndElement()}exportOds(i,r,t){if(null==Stimulsoft.Base[["St","iL","ic","en","se"].join("")].key&&console.warn("You are using a trial version of the Stimulsoft product!"),__.a.StiLogService.write(this[Stimulsoft.System.StiObject.stimulsoft]().getType(),"Export report to ODT format"),null==t)throw new Error("The 'settings' argument cannot be equal in null.");this.report=i;let n=t.pageRange;this.imageResolution=t.imageResolution,this.imageQuality=t.imageQuality,this.xmlIndentation=-1,this.imageQuality<0&&(this.imageQuality=0),1<this.imageQuality&&(this.imageQuality=1),this.imageResolution<10&&(this.imageResolution=10),this.imageResolution=this.imageResolution/100,this.currentCulture=CultureInfo.currentCulture;try{CultureInfo.currentCulture=CultureInfo.cultures["en-US"],this.imageCache=new __.a.StiImageCache(Stimulsoft.StiOptions.Export.OpenDocumentCalc.allowImageComparer,!0,ImageFormat.Jpeg,this.imageQuality,!1),this.cellStyleList=[],this.dataStyleList=[],this.sheetNameList=[],this.matrixList=[],this.firstPageIndexList=[],this.minRowList=[],this.maxRowList=[],this.cellStyleTableList=[],this.currentPassNumber=0,this.maximumPassNumber=Stimulsoft.StiOptions.Export.OpenDocumentCalc.divideSegmentPages?4:3;let t=n.getSelectedPages(i.renderedPages);if(Stimulsoft.StiOptions.Export.OpenDocumentCalc.divideSegmentPages&&(t=__.c.StiSegmentPagesDivider.divide(t,this),this.currentPassNumber=1),this.isStopped)return;let e=new StiZipWriter20;if(e.begin(r,!0),e.addFile("content.xml",this.writeContent(i,t)),e.addFile("mimetype",this.writeMimetype()),e.addFile("meta.xml",this.writeMeta()),e.addFile("META-INF/manifest.xml",this.writeManifest()),e.addFile("settings.xml",this.writeSettings()),e.addFile("styles.xml",this.writeStyles(t)),0<this.imageCache.imagePackedStore[Stimulsoft.System.StiObject.stimulsoft]().countItems)for(let t=0;t<this.imageCache.imagePackedStore[Stimulsoft.System.StiObject.stimulsoft]().countItems;t++)e.addFile(StiString.format("Pictures/{0:D5}.jpg",t+1),this.writeImage(t));e.end()}finally{CultureInfo.currentCulture=this.currentCulture,this.sheetNameList[Stimulsoft.System.StiObject.stimulsoft]().clear(),this.sheetNameList=null,this.firstPageIndexList[Stimulsoft.System.StiObject.stimulsoft]().clear(),this.firstPageIndexList=null,this.minRowList[Stimulsoft.System.StiObject.stimulsoft]().clear(),this.minRowList=null,this.maxRowList[Stimulsoft.System.StiObject.stimulsoft]().clear(),this.maxRowList=null;for(let t of this.matrixList)null!=t&&t.clear();this.matrixList[Stimulsoft.System.StiObject.stimulsoft]().clear(),this.matrixList=null,this.cellStyleTableList[Stimulsoft.System.StiObject.stimulsoft]().clear(),this.cellStyleTableList=null,this.dataStyleList[Stimulsoft.System.StiObject.stimulsoft]().clear(),this.dataStyleList=null,this.cellStyleList[Stimulsoft.System.StiObject.stimulsoft]().clear(),this.cellStyleList=null,this.imageCache.clear(),this.imageCache=null,i.renderedPages.cacheMode&&__.c.StiMatrix.GCCollect()}}}}{class ub{constructor(){this.BorderLeft="none",this.BorderRight="none",this.BorderTop="none",this.BorderBottom="none",this.BackColor=Color.transparent,this.VertAlign=StiVertAlignment.Bottom}}class vb{constructor(){this.FontName="Arial",this.FontSize=6,this.Bold=!1,this.Italic=!1,this.Underline=!1,this.FontColor=Color.black,this.HorAlign=StiTextHorAlignment.Left,this.Angle=0}}__.c.StiOdtExportService=class extends __.c.StiExportService{constructor(){super(...arguments),this.multipleFiles=!1,this.matrix=null,this.removeEmptySpaceAtBottom=Stimulsoft.StiOptions.Export.OpenDocumentWriter.removeEmptySpaceAtBottom,this.imageCache=null,this.cellStyleList=null,this.paragraphStyleList=null,this.xmlIndentation=1,this.imageQuality=.75,this.imageResolution=96,this.usePageHeadersAndFooters=!1}implements(){let t=[__.c.IStiOdtExportService];return(this.implements=()=>t)()}get defaultExtension(){return"odt"}get exportFormat(){return __.a.StiExportFormat.Odt}get groupCategory(){return"Word"}get position(){return __.c.StiExportPosition.Odt}get exportNameInMenu(){return StiLocalization.get("Export","ExportTypeWriterFile")}getFilter(){return StiLocalization.get("FileFilters","WriterFiles")}exportTo(t,e,i){this.exportOdt(t,e,i)}exportToAsync(e,i,t,r){setTimeout(async()=>{try{await __.c.StiExportImageHelper.convertAllImages(i,Stimulsoft.System.Drawing.Imaging.ImageFormat.Jpeg,!1,this.exportFormat),this.exportTo(i,t,r),null!=i&&null!=i.preparedExportImages&&(i.preparedExportImages.clear(),i.preparedExportImages=null)}catch(t){if(Exception.log(t,i,`Export Error`).isImportant)return e(Exception.getMessage(t))}e()},0)}doubleToString(t){return StiMath.round2(t/100,4).toString()[Stimulsoft.System.StiObject.stimulsoft]().replaceAll(",",".")+"in"}getColumnName(t){let e=t/26|0,i=t%26,r="";return 0<e&&(r+=String.fromCharCode(65+e-1)),r+=String.fromCharCode(65+i)}getColorString(t){return"#"+StiString.format("{0:X8}",t.toArgb()).substr(2)}getCellStyleNumber(i,r,e,n){let a=new ub,o=!0,s=!0;for(let t=0;t<e;t++)null==this.matrix.bordersY[i+t][r]&&(o=!1),null==this.matrix.bordersY[i+t][r+n]&&(s=!1);let l=!0,m=!0;for(let t=0;t<n;t++)null==this.matrix.bordersX[i][r+t]&&(l=!1),null==this.matrix.bordersX[i+e][r+t]&&(m=!1);if(l&&(a.BorderTop=this.getStringFromBorder(this.matrix.bordersX[i][r])),o&&(a.BorderLeft=this.getStringFromBorder(this.matrix.bordersY[i][r])),m&&(a.BorderBottom=this.getStringFromBorder(this.matrix.bordersX[i+e][r])),s&&(a.BorderRight=this.getStringFromBorder(this.matrix.bordersY[i][r+n])),null!=this.matrix.cells[i][r]){let e=this.matrix.cells[i][r];if(a.BackColor=e.cellStyle.color,a.VertAlign=e.cellStyle.vertAlignment,null!=e.cellStyle.textOptions){let t=e.cellStyle.textOptions.angle;(45<t&&t<135||225<t&&t<315)&&(e.cellStyle.horAlignment==StiTextHorAlignment.Left&&(a.VertAlign=StiVertAlignment.Bottom),e.cellStyle.horAlignment==StiTextHorAlignment.Center&&(a.VertAlign=StiVertAlignment.Center),e.cellStyle.horAlignment==StiTextHorAlignment.Right&&(a.VertAlign=StiVertAlignment.Top),e.cellStyle.horAlignment==StiTextHorAlignment.Width)&&(a.VertAlign=StiVertAlignment.Bottom)}}if(0<this.cellStyleList.length)for(let e=0;e<this.cellStyleList.length;e++){let t=this.cellStyleList[e];if(t.BorderLeft==a.BorderLeft&&t.BorderRight==a.BorderRight&&t.BorderTop==a.BorderTop&&t.BorderBottom==a.BorderBottom&&t.BackColor.equals(a.BackColor)&&t.VertAlign==a.VertAlign)return e}this.cellStyleList.push(a);let t=this.cellStyleList.length-1;return t}getStringFromBorder(t){return StiString.format("{0} solid {1}",this.doubleToString(t.size),this.getColorString(t.color))}getParagraphStyleNumber(t,e){let i=this.matrix.cells[t][e].cellStyle,r=new vb,n=(r.FontName=i.font.name,r.FontSize=i.font.sizeInPoints,r.Bold=i.font.bold,r.Italic=i.font.italic,r.Underline=i.font.underline,r.FontColor=i.textColor,r.HorAlign=i.horAlignment,0);if(45<(n=null!=i.textOptions?i.textOptions.angle:n)&&n<135&&(r.Angle=90),225<n&&n<315&&(r.Angle=270),0!=r.Angle&&(i.vertAlignment==StiVertAlignment.Top&&(r.HorAlign=StiTextHorAlignment.Left),i.vertAlignment==StiVertAlignment.Center&&(r.HorAlign=StiTextHorAlignment.Center),i.vertAlignment==StiVertAlignment.Bottom)&&(r.HorAlign=StiTextHorAlignment.Right),0<this.paragraphStyleList.length)for(let e=0;e<this.paragraphStyleList.length;e++){let t=this.paragraphStyleList[e];if(t.FontName==r.FontName&&t.FontSize==r.FontSize&&t.Bold==r.Bold&&t.Italic==r.Italic&&t.Underline==r.Underline&&t.FontColor.equals(r.FontColor)&&t.HorAlign==r.HorAlign&&t.Angle==r.Angle)return e}this.paragraphStyleList.push(r);let a=this.paragraphStyleList.length-1;return a}writeMimetype(){let t=new MemoryStream,e=new StreamWriter(t,Encoding.ASCII);return e.write("application/vnd.oasis.opendocument.text"),e.flush(),t}writeMeta(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t),i=(e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),e.writeStartElement("office:document-meta"),e.writeAttributeString("xmlns:office","urn:oasis:names:tc:opendocument:xmlns:office:1.0"),e.writeAttributeString("xmlns:xlink","http://www.w3.org/1999/xlink"),e.writeAttributeString("xmlns:dc","http://purl.org/dc/elements/1.1/"),e.writeAttributeString("xmlns:meta","urn:oasis:names:tc:opendocument:xmlns:meta:1.0"),e.writeAttributeString("xmlns:ooo","http://openoffice.org/2004/office"),e.writeAttributeString("office:version","1.1"),e.writeStartElement("office:meta"),StiString.format("{0}",DateTime.now.toString("yyyy-MM-ddTHH:mm:ss"))),r=__.c.StiExportUtils.getReportVersion(this.report);return e.writeElementString("meta:generator",r),e.writeElementString("meta:creation-date",i),e.writeElementString("dc:date",i),e.writeElementString("meta:editing-cycles","1"),e.writeElementString("meta:editing-duration","PT0M01S"),e.writeStartElement("meta:user-defined"),e.writeAttributeString("meta:name","Info 1"),e.writeEndElement(),e.writeStartElement("meta:user-defined"),e.writeAttributeString("meta:name","Info 2"),e.writeEndElement(),e.writeStartElement("meta:user-defined"),e.writeAttributeString("meta:name","Info 3"),e.writeEndElement(),e.writeStartElement("meta:user-defined"),e.writeAttributeString("meta:name","Info 4"),e.writeEndElement(),e.writeStartElement("meta:document-statistic"),e.writeAttributeString("meta:table-count","1"),e.writeAttributeString("meta:image-count","0"),e.writeAttributeString("meta:object-count","0"),e.writeAttributeString("meta:page-count","1"),e.writeAttributeString("meta:paragraph-count","1"),e.writeAttributeString("meta:word-count","1"),e.writeAttributeString("meta:character-count","1"),e.writeEndElement(),e.writeFullEndElement(),e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeManifest(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),e.writeStartElement("manifest:manifest"),e.writeAttributeString("xmlns:manifest","urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"),e.writeStartElement("manifest:file-entry"),e.writeAttributeString("manifest:media-type","application/vnd.oasis.opendocument.text"),e.writeAttributeString("manifest:full-path","/"),e.writeEndElement();for(let t=0;t<this.imageCache.imagePackedStore[Stimulsoft.System.StiObject.stimulsoft]().countItems;t++)e.writeStartElement("manifest:file-entry"),e.writeAttributeString("manifest:media-type","image/jpeg"),e.writeAttributeString("manifest:full-path",StiString.format("Pictures/{0:D5}.jpg",t+1)),e.writeEndElement();return e.writeStartElement("manifest:file-entry"),e.writeAttributeString("manifest:media-type","text/xml"),e.writeAttributeString("manifest:full-path","content.xml"),e.writeEndElement(),e.writeStartElement("manifest:file-entry"),e.writeAttributeString("manifest:media-type","text/xml"),e.writeAttributeString("manifest:full-path","styles.xml"),e.writeEndElement(),e.writeStartElement("manifest:file-entry"),e.writeAttributeString("manifest:media-type","text/xml"),e.writeAttributeString("manifest:full-path","meta.xml"),e.writeEndElement(),e.writeStartElement("manifest:file-entry"),e.writeAttributeString("manifest:media-type","text/xml"),e.writeAttributeString("manifest:full-path","settings.xml"),e.writeEndElement(),e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeImage(t){let e=new MemoryStream,i=this.imageCache.imagePackedStore[t];return null!=i&&e.write(i,0,i.length),e}writeSettings(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);return e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),e.writeStartElement("office:document-settings"),e.writeAttributeString("xmlns:office","urn:oasis:names:tc:opendocument:xmlns:office:1.0"),e.writeAttributeString("xmlns:xlink","http://www.w3.org/1999/xlink"),e.writeAttributeString("xmlns:config","urn:oasis:names:tc:opendocument:xmlns:config:1.0"),e.writeAttributeString("xmlns:ooo","http://openoffice.org/2004/office"),e.writeAttributeString("office:version","1.1"),e.writeStartElement("office:settings"),e.writeStartElement("config:config-item-set"),e.writeAttributeString("config:name","ooo:view-settings"),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ViewAreaTop"),e.writeAttributeString("config:type","int"),e.writeString("0"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ViewAreaLeft"),e.writeAttributeString("config:type","int"),e.writeString("-10107"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ViewAreaWidth"),e.writeAttributeString("config:type","int"),e.writeString("43208"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ViewAreaHeight"),e.writeAttributeString("config:type","int"),e.writeString("22174"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ShowRedlineChanges"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","InBrowseMode"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item-map-indexed"),e.writeAttributeString("config:name","Views"),e.writeStartElement("config:config-item-map-entry"),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ViewId"),e.writeAttributeString("config:type","string"),e.writeString("view2"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ViewLeft"),e.writeAttributeString("config:type","int"),e.writeString("3002"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ViewTop"),e.writeAttributeString("config:type","int"),e.writeString("10435"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","VisibleLeft"),e.writeAttributeString("config:type","int"),e.writeString("-10107"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","VisibleTop"),e.writeAttributeString("config:type","int"),e.writeString("0"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","VisibleRight"),e.writeAttributeString("config:type","int"),e.writeString("33099"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","VisibleBottom"),e.writeAttributeString("config:type","int"),e.writeString("22172"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ZoomType"),e.writeAttributeString("config:type","short"),e.writeString("0"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ZoomFactor"),e.writeAttributeString("config:type","short"),e.writeString("100"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","IsSelectedFrame"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("config:config-item-set"),e.writeAttributeString("config:name","ooo:configuration-settings"),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","AddParaTableSpacing"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PrintReversed"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","OutlineLevelYieldsNumbering"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","LinkUpdateMode"),e.writeAttributeString("config:type","short"),e.writeString("1"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PrintEmptyPages"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","IgnoreFirstLineIndentInNumbering"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","CharacterCompressionType"),e.writeAttributeString("config:type","short"),e.writeString("0"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PrintSingleJobs"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","UpdateFromTemplate"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PrintPaperFromSetup"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","AddFrameOffsets"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PrintLeftPages"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","RedlineProtectionKey"),e.writeAttributeString("config:type","base64Binary"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PrintTables"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ChartAutoUpdate"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PrintControls"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PrinterSetup"),e.writeAttributeString("config:type","base64Binary"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","IgnoreTabsAndBlanksForLineCalculation"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PrintAnnotationMode"),e.writeAttributeString("config:type","short"),e.writeString("0"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","LoadReadonly"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","AddParaSpacingToTableCells"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","AddExternalLeading"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ApplyUserData"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","FieldAutoUpdate"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","SaveVersionOnClose"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","SaveGlobalDocumentLinks"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","IsKernAsianPunctuation"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","AlignTabStopPosition"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ClipAsCharacterAnchoredWriterFlyFrames"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","CurrentDatabaseDataSource"),e.writeAttributeString("config:type","string"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","DoNotCaptureDrawObjsOnPage"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","TableRowKeep"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PrinterName"),e.writeAttributeString("config:type","string"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PrintFaxName"),e.writeAttributeString("config:type","string"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","ConsiderTextWrapOnObjPos"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","UseOldPrinterMetrics"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PrintRightPages"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","IsLabelDocument"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","UseFormerLineSpacing"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","AddParaTableSpacingAtStart"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","UseFormerTextWrapping"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","DoNotResetParaAttrsForNumFont"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PrintProspect"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PrintGraphics"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","AllowPrintJobCancel"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","CurrentDatabaseCommandType"),e.writeAttributeString("config:type","int"),e.writeString("0"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","DoNotJustifyLinesWithManualBreak"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","UseFormerObjectPositioning"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PrinterIndependentLayout"),e.writeAttributeString("config:type","string"),e.writeString("high-resolution"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","UseOldNumbering"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PrintPageBackground"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","CurrentDatabaseCommand"),e.writeAttributeString("config:type","string"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PrintDrawings"),e.writeAttributeString("config:type","boolean"),e.writeString("true"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","PrintBlackFonts"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeStartElement("config:config-item"),e.writeAttributeString("config:name","UnxForceZeroExtLeading"),e.writeAttributeString("config:type","boolean"),e.writeString("false"),e.writeEndElement(),e.writeEndElement(),e.writeFullEndElement(),e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeStyles(t){let e=new MemoryStream,i=new XmlTextWriter(Encoding.UTF8,e),r=(i.indentation=this.xmlIndentation<0?0:this.xmlIndentation,i.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,i.writeStartDocument(),i.writeStartElement("office:document-styles"),i.writeAttributeString("xmlns:office","urn:oasis:names:tc:opendocument:xmlns:office:1.0"),i.writeAttributeString("xmlns:style","urn:oasis:names:tc:opendocument:xmlns:style:1.0"),i.writeAttributeString("xmlns:text","urn:oasis:names:tc:opendocument:xmlns:text:1.0"),i.writeAttributeString("xmlns:table","urn:oasis:names:tc:opendocument:xmlns:table:1.0"),i.writeAttributeString("xmlns:draw","urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"),i.writeAttributeString("xmlns:fo","urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"),i.writeAttributeString("xmlns:xlink","http://www.w3.org/1999/xlink"),i.writeAttributeString("xmlns:dc","http://purl.org/dc/elements/1.1/"),i.writeAttributeString("xmlns:meta","urn:oasis:names:tc:opendocument:xmlns:meta:1.0"),i.writeAttributeString("xmlns:number","urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"),i.writeAttributeString("xmlns:svg","urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"),i.writeAttributeString("xmlns:chart","urn:oasis:names:tc:opendocument:xmlns:chart:1.0"),i.writeAttributeString("xmlns:dr3d","urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"),i.writeAttributeString("xmlns:math","http://www.w3.org/1998/Math/MathML"),i.writeAttributeString("xmlns:form","urn:oasis:names:tc:opendocument:xmlns:form:1.0"),i.writeAttributeString("xmlns:script","urn:oasis:names:tc:opendocument:xmlns:script:1.0"),i.writeAttributeString("xmlns:ooo","http://openoffice.org/2004/office"),i.writeAttributeString("xmlns:ooow","http://openoffice.org/2004/writer"),i.writeAttributeString("xmlns:oooc","http://openoffice.org/2004/calc"),i.writeAttributeString("xmlns:dom","http://www.w3.org/2001/xml-events"),i.writeAttributeString("office:version","1.1"),i.writeStartElement("office:font-face-decls"),i.writeStartElement("style:font-face"),i.writeAttributeString("style:name","Arial"),i.writeAttributeString("svg:font-family","Arial"),i.writeEndElement(),i.writeStartElement("style:font-face"),i.writeAttributeString("style:name","Tahoma"),i.writeAttributeString("svg:font-family","Tahoma"),i.writeAttributeString("style:font-family-generic","system"),i.writeAttributeString("style:font-pitch","variable"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("office:styles"),i.writeStartElement("style:default-style"),i.writeAttributeString("style:family","graphic"),i.writeStartElement("style:graphic-properties"),i.writeAttributeString("draw:shadow-offset-x","0.3cm"),i.writeAttributeString("draw:shadow-offset-y","0.3cm"),i.writeAttributeString("draw:start-line-spacing-horizontal","0.283cm"),i.writeAttributeString("draw:start-line-spacing-vertical","0.283cm"),i.writeAttributeString("draw:end-line-spacing-horizontal","0.283cm"),i.writeAttributeString("draw:end-line-spacing-vertical","0.283cm"),i.writeAttributeString("style:flow-with-text","false"),i.writeEndElement(),i.writeStartElement("style:paragraph-properties"),i.writeAttributeString("style:text-autospace","ideograph-alpha"),i.writeAttributeString("style:line-break","strict"),i.writeAttributeString("style:writing-mode","lr-tb"),i.writeAttributeString("style:font-independent-line-spacing","false"),i.writeStartElement("style:tab-stops"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("style:text-properties"),i.writeAttributeString("style:use-window-font-color","true"),i.writeAttributeString("fo:font-size","10pt"),i.writeAttributeString("style:letter-kerning","true"),i.writeAttributeString("style:font-size-asian","12pt"),i.writeAttributeString("style:language-asian","zxx"),i.writeAttributeString("style:country-asian","none"),i.writeAttributeString("style:font-size-complex","12pt"),i.writeAttributeString("style:language-complex","zxx"),i.writeAttributeString("style:country-complex","none"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("style:default-style"),i.writeAttributeString("style:family","paragraph"),i.writeStartElement("style:paragraph-properties"),i.writeAttributeString("fo:hyphenation-ladder-count","no-limit"),i.writeAttributeString("style:text-autospace","ideograph-alpha"),i.writeAttributeString("style:punctuation-wrap","hanging"),i.writeAttributeString("style:line-break","strict"),i.writeAttributeString("style:tab-stop-distance","1.251cm"),i.writeAttributeString("style:writing-mode","page"),i.writeEndElement(),i.writeStartElement("style:text-properties"),i.writeAttributeString("style:use-window-font-color","true"),i.writeAttributeString("style:font-name","Arial"),i.writeAttributeString("fo:font-size","10pt"),i.writeAttributeString("style:letter-kerning","true"),i.writeAttributeString("style:font-name-asian","Lucida Sans Unicode"),i.writeAttributeString("style:font-size-asian","12pt"),i.writeAttributeString("style:language-asian","zxx"),i.writeAttributeString("style:country-asian","none"),i.writeAttributeString("style:font-name-complex","Tahoma"),i.writeAttributeString("style:font-size-complex","12pt"),i.writeAttributeString("style:language-complex","zxx"),i.writeAttributeString("style:country-complex","none"),i.writeAttributeString("fo:hyphenate","false"),i.writeAttributeString("fo:hyphenation-remain-char-count","2"),i.writeAttributeString("fo:hyphenation-push-char-count","2"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("style:default-style"),i.writeAttributeString("style:family","table"),i.writeStartElement("style:table-properties"),i.writeAttributeString("table:border-model","collapsing"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("style:default-style"),i.writeAttributeString("style:family","table-row"),i.writeStartElement("style:table-row-properties"),i.writeAttributeString("fo:keep-together","auto"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("style:style"),i.writeAttributeString("style:name","Standard"),i.writeAttributeString("style:family","paragraph"),i.writeAttributeString("style:class","text"),i.writeEndElement(),i.writeStartElement("style:style"),i.writeAttributeString("style:name","Title"),i.writeAttributeString("style:family","paragraph"),i.writeAttributeString("style:parent-style-name","Standard"),i.writeAttributeString("style:next-style-name","Text_20_body"),i.writeAttributeString("style:class","text"),i.writeStartElement("style:paragraph-properties"),i.writeAttributeString("fo:margin-top","0.423cm"),i.writeAttributeString("fo:margin-bottom","0.212cm"),i.writeAttributeString("fo:keep-with-next","always"),i.writeEndElement(),i.writeStartElement("style:text-properties"),i.writeAttributeString("style:font-name","Arial1"),i.writeAttributeString("fo:font-size","14pt"),i.writeAttributeString("style:font-name-asian","Lucida Sans Unicode"),i.writeAttributeString("style:font-size-asian","14pt"),i.writeAttributeString("style:font-name-complex","Tahoma"),i.writeAttributeString("style:font-size-complex","14pt"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("style:style"),i.writeAttributeString("style:name","Text_20_body"),i.writeAttributeString("style:display-name","Text body"),i.writeAttributeString("style:family","paragraph"),i.writeAttributeString("style:parent-style-name","Standard"),i.writeAttributeString("style:class","text"),i.writeStartElement("style:paragraph-properties"),i.writeAttributeString("fo:margin-top","0cm"),i.writeAttributeString("fo:margin-bottom","0.212cm"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("style:style"),i.writeAttributeString("style:name","Subtitle"),i.writeAttributeString("style:family","paragraph"),i.writeAttributeString("style:parent-style-name","Title"),i.writeAttributeString("style:next-style-name","Text_20_body"),i.writeAttributeString("style:class","chapter"),i.writeStartElement("style:paragraph-properties"),i.writeAttributeString("fo:text-align","center"),i.writeAttributeString("style:justify-single-word","false"),i.writeEndElement(),i.writeStartElement("style:text-properties"),i.writeAttributeString("fo:font-size","14pt"),i.writeAttributeString("fo:font-style","italic"),i.writeAttributeString("style:font-size-asian","14pt"),i.writeAttributeString("style:font-style-asian","italic"),i.writeAttributeString("style:font-size-complex","14pt"),i.writeAttributeString("style:font-style-complex","italic"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("style:style"),i.writeAttributeString("style:name","List"),i.writeAttributeString("style:family","paragraph"),i.writeAttributeString("style:parent-style-name","Text_20_body"),i.writeAttributeString("style:class","list"),i.writeStartElement("style:text-properties"),i.writeAttributeString("style:font-name","Arial"),i.writeAttributeString("style:font-name-complex","Tahoma1"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("style:style"),i.writeAttributeString("style:name","Caption"),i.writeAttributeString("style:family","paragraph"),i.writeAttributeString("style:parent-style-name","Standard"),i.writeAttributeString("style:class","extra"),i.writeStartElement("style:paragraph-properties"),i.writeAttributeString("fo:margin-top","0.212cm"),i.writeAttributeString("fo:margin-bottom","0.212cm"),i.writeAttributeString("text:number-lines","false"),i.writeAttributeString("text:line-number","0"),i.writeEndElement(),i.writeStartElement("style:text-properties"),i.writeAttributeString("style:font-name","Arial"),i.writeAttributeString("fo:font-size","10pt"),i.writeAttributeString("fo:font-style","italic"),i.writeAttributeString("style:font-size-asian","12pt"),i.writeAttributeString("style:font-style-asian","italic"),i.writeAttributeString("style:font-name-complex","Tahoma1"),i.writeAttributeString("style:font-size-complex","12pt"),i.writeAttributeString("style:font-style-complex","italic"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("style:style"),i.writeAttributeString("style:name","Index"),i.writeAttributeString("style:family","paragraph"),i.writeAttributeString("style:parent-style-name","Standard"),i.writeAttributeString("style:class","index"),i.writeStartElement("style:paragraph-properties"),i.writeAttributeString("text:number-lines","false"),i.writeAttributeString("text:line-number","0"),i.writeEndElement(),i.writeStartElement("style:text-properties"),i.writeAttributeString("style:font-name","Arial"),i.writeAttributeString("style:font-name-complex","Tahoma1"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("style:style"),i.writeAttributeString("style:name","Table_20_Contents"),i.writeAttributeString("style:display-name","Table Contents"),i.writeAttributeString("style:family","paragraph"),i.writeAttributeString("style:parent-style-name","Standard"),i.writeAttributeString("style:class","extra"),i.writeStartElement("style:paragraph-properties"),i.writeAttributeString("text:number-lines","false"),i.writeAttributeString("text:line-number","0"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("style:style"),i.writeAttributeString("style:name","Graphics"),i.writeAttributeString("style:family","graphic"),i.writeStartElement("style:graphic-properties"),i.writeAttributeString("text:anchor-type","paragraph"),i.writeAttributeString("svg:x","0cm"),i.writeAttributeString("svg:y","0cm"),i.writeAttributeString("style:wrap","dynamic"),i.writeAttributeString("style:number-wrapped-paragraphs","no-limit"),i.writeAttributeString("style:wrap-contour","false"),i.writeAttributeString("style:vertical-pos","top"),i.writeAttributeString("style:vertical-rel","paragraph"),i.writeAttributeString("style:horizontal-pos","center"),i.writeAttributeString("style:horizontal-rel","paragraph"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("text:outline-style"),i.writeStartElement("text:outline-level-style"),i.writeAttributeString("text:level","1"),i.writeAttributeString("style:num-format",""),i.writeStartElement("style:list-level-properties"),i.writeAttributeString("text:min-label-distance","0.381cm"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("text:outline-level-style"),i.writeAttributeString("text:level","2"),i.writeAttributeString("style:num-format",""),i.writeStartElement("style:list-level-properties"),i.writeAttributeString("text:min-label-distance","0.381cm"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("text:outline-level-style"),i.writeAttributeString("text:level","3"),i.writeAttributeString("style:num-format",""),i.writeStartElement("style:list-level-properties"),i.writeAttributeString("text:min-label-distance","0.381cm"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("text:outline-level-style"),i.writeAttributeString("text:level","4"),i.writeAttributeString("style:num-format",""),i.writeStartElement("style:list-level-properties"),i.writeAttributeString("text:min-label-distance","0.381cm"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("text:outline-level-style"),i.writeAttributeString("text:level","5"),i.writeAttributeString("style:num-format",""),i.writeStartElement("style:list-level-properties"),i.writeAttributeString("text:min-label-distance","0.381cm"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("text:outline-level-style"),i.writeAttributeString("text:level","6"),i.writeAttributeString("style:num-format",""),i.writeStartElement("style:list-level-properties"),i.writeAttributeString("text:min-label-distance","0.381cm"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("text:outline-level-style"),i.writeAttributeString("text:level","7"),i.writeAttributeString("style:num-format",""),i.writeStartElement("style:list-level-properties"),i.writeAttributeString("text:min-label-distance","0.381cm"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("text:outline-level-style"),i.writeAttributeString("text:level","8"),i.writeAttributeString("style:num-format",""),i.writeStartElement("style:list-level-properties"),i.writeAttributeString("text:min-label-distance","0.381cm"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("text:outline-level-style"),i.writeAttributeString("text:level","9"),i.writeAttributeString("style:num-format",""),i.writeStartElement("style:list-level-properties"),i.writeAttributeString("text:min-label-distance","0.381cm"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("text:outline-level-style"),i.writeAttributeString("text:level","10"),i.writeAttributeString("style:num-format",""),i.writeStartElement("style:list-level-properties"),i.writeAttributeString("text:min-label-distance","0.381cm"),i.writeEndElement(),i.writeEndElement(),i.writeFullEndElement(),i.writeStartElement("text:notes-configuration"),i.writeAttributeString("text:note-class","footnote"),i.writeAttributeString("style:num-format","1"),i.writeAttributeString("text:start-value","0"),i.writeAttributeString("text:footnotes-position","page"),i.writeAttributeString("text:start-numbering-at","document"),i.writeEndElement(),i.writeStartElement("text:notes-configuration"),i.writeAttributeString("text:note-class","endnote"),i.writeAttributeString("style:num-format","i"),i.writeAttributeString("text:start-value","0"),i.writeEndElement(),i.writeStartElement("text:linenumbering-configuration"),i.writeAttributeString("text:number-lines","false"),i.writeAttributeString("text:offset","0.499cm"),i.writeAttributeString("style:num-format","1"),i.writeAttributeString("text:number-position","left"),i.writeAttributeString("text:increment","5"),i.writeEndElement(),i.writeEndElement(),t.getByIndex(0)),n=r.unit.convertToHInches(r.pageHeight*r.segmentPerHeight),a=r.unit.convertToHInches(r.pageWidth*r.segmentPerWidth),o=r.unit.convertToHInches(r.margins.left),s=r.unit.convertToHInches(r.margins.right),l=r.unit.convertToHInches(r.margins.top),m=r.unit.convertToHInches(r.margins.bottom)-4;return m<0&&(m=0),i.writeStartElement("office:automatic-styles"),i.writeStartElement("style:page-layout"),i.writeAttributeString("style:name","pm1"),i.writeStartElement("style:page-layout-properties"),i.writeAttributeString("fo:page-width",this.doubleToString(a)),i.writeAttributeString("fo:page-height",this.doubleToString(n)),i.writeAttributeString("style:num-format","1"),i.writeAttributeString("style:print-orientation",r.orientation==StiPageOrientation.Portrait?"portrait":"landscape"),i.writeAttributeString("fo:margin-top",this.doubleToString(l)),i.writeAttributeString("fo:margin-bottom",this.doubleToString(m)),i.writeAttributeString("fo:margin-left",this.doubleToString(o)),i.writeAttributeString("fo:margin-right",this.doubleToString(s)),i.writeAttributeString("style:writing-mode","lr-tb"),i.writeAttributeString("style:footnote-max-height","0cm"),i.writeStartElement("style:footnote-sep"),i.writeAttributeString("style:width","0.018cm"),i.writeAttributeString("style:distance-before-sep","0.101cm"),i.writeAttributeString("style:distance-after-sep","0.101cm"),i.writeAttributeString("style:adjustment","left"),i.writeAttributeString("style:rel-width","25%"),i.writeAttributeString("style:color","#000000"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("style:header-style"),i.writeEndElement(),i.writeStartElement("style:footer-style"),i.writeEndElement(),i.writeEndElement(),i.writeFullEndElement(),i.writeStartElement("office:master-styles"),i.writeStartElement("style:master-page"),i.writeAttributeString("style:name","Standard"),i.writeAttributeString("style:page-layout-name","pm1"),i.writeEndElement(),i.writeEndElement(),i.writeFullEndElement(),i.writeEndDocument(),i.flush(),e}writeContent(){let t=new MemoryStream,s=new XmlTextWriter(Encoding.UTF8,t),l=(s.indentation=this.xmlIndentation<0?0:this.xmlIndentation,s.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,s.writeStartDocument(),s.writeStartElement("office:document-content"),s.writeAttributeString("xmlns:office","urn:oasis:names:tc:opendocument:xmlns:office:1.0"),s.writeAttributeString("xmlns:style","urn:oasis:names:tc:opendocument:xmlns:style:1.0"),s.writeAttributeString("xmlns:text","urn:oasis:names:tc:opendocument:xmlns:text:1.0"),s.writeAttributeString("xmlns:table","urn:oasis:names:tc:opendocument:xmlns:table:1.0"),s.writeAttributeString("xmlns:draw","urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"),s.writeAttributeString("xmlns:fo","urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"),s.writeAttributeString("xmlns:xlink","http://www.w3.org/1999/xlink"),s.writeAttributeString("xmlns:dc","http://purl.org/dc/elements/1.1/"),s.writeAttributeString("xmlns:meta","urn:oasis:names:tc:opendocument:xmlns:meta:1.0"),s.writeAttributeString("xmlns:number","urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"),s.writeAttributeString("xmlns:svg","urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"),s.writeAttributeString("xmlns:chart","urn:oasis:names:tc:opendocument:xmlns:chart:1.0"),s.writeAttributeString("xmlns:dr3d","urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"),s.writeAttributeString("xmlns:math","http://www.w3.org/1998/Math/MathML"),s.writeAttributeString("xmlns:form","urn:oasis:names:tc:opendocument:xmlns:form:1.0"),s.writeAttributeString("xmlns:script","urn:oasis:names:tc:opendocument:xmlns:script:1.0"),s.writeAttributeString("xmlns:ooo","http://openoffice.org/2004/office"),s.writeAttributeString("xmlns:ooow","http://openoffice.org/2004/writer"),s.writeAttributeString("xmlns:oooc","http://openoffice.org/2004/calc"),s.writeAttributeString("xmlns:dom","http://www.w3.org/2001/xml-events"),s.writeAttributeString("xmlns:xforms","http://www.w3.org/2002/xforms"),s.writeAttributeString("xmlns:xsd","http://www.w3.org/2001/XMLSchema"),s.writeAttributeString("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance"),s.writeAttributeString("office:version","1.1"),StiArray.create2(Boolean,this.matrix.coordY.countItems,this.matrix.coordX.countItems)),m=StiArray.create2(Number,this.matrix.coordY.countItems,this.matrix.coordX.countItems),i=new Hashtable,r=new Hashtable,a=[];for(let n=1;n<this.matrix.coordY.countItems;n++){let e=this.matrix.coordY.getByIndex(n)-this.matrix.coordY.getByIndex(n-1);if(!i.containsKey(e)){let t=i.count;i.set(e,t),r.set(t,e)}a[n-1]=0|i.get(e);for(let r=1;r<this.matrix.coordX.countItems;r++){let i=this.matrix.cells[n-1][r-1];if(!l[n][r])if(null!=i){for(let e=0;e<=i.height;e++)for(let t=0;t<=i.width;t++)l[n+e][r+t]=!0;m[n-1][r-1]=this.getCellStyleNumber(n-1,r-1,i.height+1,i.width+1),this.getParagraphStyleNumber(n-1,r-1)}else m[n-1][r-1]=this.getCellStyleNumber(n-1,r-1,1,1)}}s.writeStartElement("office:scripts"),s.writeEndElement();let n=new Hashtable;for(let t of this.paragraphStyleList)n.set(t.FontName,t.FontName);s.writeStartElement("office:font-face-decls");for(let e of n.keys){let t=n.get(e);s.writeStartElement("style:font-face"),s.writeAttributeString("style:name",t),s.writeAttributeString("svg:font-family",t),s.writeEndElement()}s.writeEndElement(),s.writeStartElement("office:automatic-styles"),s.writeStartElement("style:style"),s.writeAttributeString("style:name","Table1"),s.writeAttributeString("style:family","table"),s.writeStartElement("style:table-properties");let e=this.matrix.coordX.getByIndex(this.matrix.coordX.countItems-1)-this.matrix.coordX.getByIndex(0);s.writeAttributeString("style:width",this.doubleToString(e)),s.writeAttributeString("table:align","left"),s.writeEndElement(),s.writeEndElement();for(let e=0;e<this.matrix.coordX.countItems-1;e++){s.writeStartElement("style:style"),s.writeAttributeString("style:name",StiString.format("Table1.{0}",this.getColumnName(e))),s.writeAttributeString("style:family","table-column"),s.writeStartElement("style:table-column-properties");let t=this.matrix.coordX.getByIndex(e+1)-this.matrix.coordX.getByIndex(e);s.writeAttributeString("style:column-width",this.doubleToString(t)),s.writeEndElement(),s.writeEndElement()}for(let e=0;e<i.count;e++){s.writeStartElement("style:style"),s.writeAttributeString("style:name",StiString.format("Table1.{0}",e+1)),s.writeAttributeString("style:family","table-row"),s.writeStartElement("style:table-row-properties");let t=r.get(e);s.writeAttributeString("style:row-height",this.doubleToString(t)),s.writeEndElement(),s.writeEndElement()}for(let e=0;e<this.cellStyleList[Stimulsoft.System.StiObject.stimulsoft]().countItems;e++){let t=this.cellStyleList[e];s.writeStartElement("style:style"),s.writeAttributeString("style:name",StiString.format("cell{0}",e+1)),s.writeAttributeString("style:family","table-cell"),s.writeStartElement("style:table-cell-properties"),t.VertAlign==StiVertAlignment.Center&&s.writeAttributeString("style:vertical-align","middle"),t.VertAlign==StiVertAlignment.Bottom&&s.writeAttributeString("style:vertical-align","bottom"),0<t.BackColor.a?s.writeAttributeString("fo:background-color",this.getColorString(t.BackColor)):s.writeAttributeString("fo:background-color","transparent"),s.writeAttributeString("fo:padding","0in"),s.writeAttributeString("fo:border-left",t.BorderLeft),s.writeAttributeString("fo:border-right",t.BorderRight),s.writeAttributeString("fo:border-top",t.BorderTop),s.writeAttributeString("fo:border-bottom",t.BorderBottom),s.writeEndElement(),s.writeEndElement()}for(let i=0;i<this.paragraphStyleList[Stimulsoft.System.StiObject.stimulsoft]().countItems;i++){let t=this.paragraphStyleList[i],e=(s.writeStartElement("style:style"),s.writeAttributeString("style:name",StiString.format("par{0}",i+1)),s.writeAttributeString("style:family","paragraph"),s.writeAttributeString("style:parent-style-name","Table_20_Contents"),t.HorAlign!=StiTextHorAlignment.Left&&(s.writeStartElement("style:paragraph-properties"),t.HorAlign==StiTextHorAlignment.Center&&s.writeAttributeString("fo:text-align","center"),t.HorAlign==StiTextHorAlignment.Right&&s.writeAttributeString("fo:text-align","right"),t.HorAlign==StiTextHorAlignment.Width&&s.writeAttributeString("fo:text-align","justify"),s.writeEndElement()),s.writeStartElement("style:text-properties"),s.writeAttributeString("fo:color",this.getColorString(t.FontColor)),s.writeAttributeString("style:font-name",t.FontName),t.FontSize+`pt`);s.writeAttributeString("fo:font-size",e),s.writeAttributeString("fo:font-size-asian",e),s.writeAttributeString("fo:font-size-complex",e),t.Italic&&(s.writeAttributeString("fo:font-style","italic"),s.writeAttributeString("fo:font-style-asian","italic"),s.writeAttributeString("fo:font-style-complex","italic")),t.Underline&&(s.writeAttributeString("style:text-underline-style","solid"),s.writeAttributeString("style:text-underline-width","auto"),s.writeAttributeString("style:text-underline-color","font-color")),t.Bold&&(s.writeAttributeString("fo:font-weight","bold"),s.writeAttributeString("fo:font-weight-asian","bold"),s.writeAttributeString("fo:font-weight-complex","bold")),0!=t.Angle&&s.writeAttributeString("style:text-rotation-angle",t.Angle.toString()),s.writeEndElement(),s.writeEndElement()}s.writeStartElement("style:style"),s.writeAttributeString("style:name","parEnd"),s.writeAttributeString("style:family","paragraph"),s.writeAttributeString("style:parent-style-name","Table_20_Contents"),s.writeStartElement("style:text-properties");let o="1pt";s.writeAttributeString("fo:font-size",o),s.writeAttributeString("fo:font-size-asian",o),s.writeAttributeString("fo:font-size-complex",o),s.writeEndElement(),s.writeEndElement(),s.writeStartElement("style:style"),s.writeAttributeString("style:name","fr1"),s.writeAttributeString("style:family","graphic"),s.writeAttributeString("style:parent-style-name","Graphics"),s.writeStartElement("style:graphic-properties"),s.writeAttributeString("style:vertical-pos","middle"),s.writeAttributeString("style:vertical-rel","paragraph"),s.writeAttributeString("style:horizontal-pos","center"),s.writeAttributeString("style:horizontal-rel","paragraph"),s.writeAttributeString("fo:background-color","transparent"),s.writeAttributeString("style:background-transparency","100%"),s.writeAttributeString("style:shadow","none"),s.writeAttributeString("style:mirror","none"),s.writeAttributeString("fo:clip","rect(0cm 0cm 0cm 0cm)"),s.writeAttributeString("draw:luminance","0%"),s.writeAttributeString("draw:contrast","0%"),s.writeAttributeString("draw:red","0%"),s.writeAttributeString("draw:green","0%"),s.writeAttributeString("draw:blue","0%"),s.writeAttributeString("draw:gamma","100%"),s.writeAttributeString("draw:color-inversion","false"),s.writeAttributeString("draw:image-opacity","100%"),s.writeAttributeString("draw:color-mode","standard"),s.writeEndElement(),s.writeEndElement(),s.writeEndElement(),s.writeStartElement("office:body"),s.writeStartElement("office:text"),s.writeStartElement("office:forms"),s.writeAttributeString("form:automatic-focus","false"),s.writeAttributeString("form:apply-design-mode","false"),s.writeEndElement(),s.writeStartElement("text:sequence-decls"),s.writeStartElement("text:sequence-decl"),s.writeAttributeString("text:display-outline-level","0"),s.writeAttributeString("text:name","Illustration"),s.writeEndElement(),s.writeStartElement("text:sequence-decl"),s.writeAttributeString("text:display-outline-level","0"),s.writeAttributeString("text:name","Table"),s.writeEndElement(),s.writeStartElement("text:sequence-decl"),s.writeAttributeString("text:display-outline-level","0"),s.writeAttributeString("text:name","Text"),s.writeEndElement(),s.writeStartElement("text:sequence-decl"),s.writeAttributeString("text:display-outline-level","0"),s.writeAttributeString("text:name","Drawing"),s.writeEndElement(),s.writeEndElement(),l=StiArray.create2(Boolean,this.matrix.coordY.countItems,this.matrix.coordX.countItems),s.writeStartElement("table:table"),s.writeAttributeString("table:name","Table1"),s.writeAttributeString("table:style-name","Table1");for(let t=0;t<this.matrix.coordX.countItems-1;t++)s.writeStartElement("table:table-column"),s.writeAttributeString("table:style-name",StiString.format("Table1.{0}",this.getColumnName(t))),s.writeEndElement();let h=Math.max(this.matrix.coordY.countItems/200,1),c=0;for(let o=1;o<this.matrix.coordY.countItems;o++){let t=o/h|0;t>c&&(c=t,this.invokeExporting2(o,this.matrix.coordY.countItems,this.currentPassNumber,this.maximumPassNumber)),s.writeStartElement("table:table-row"),s.writeAttributeString("table:style-name",`Table1.`+(a[o-1]+1));for(let a=1;a<this.matrix.coordX.countItems;a++){let n=this.matrix.cells[o-1][a-1];if(l[o][a])s.writeStartElement("table:covered-table-cell");else if(null!=n){for(let e=0;e<=n.height;e++)for(let t=0;t<=n.width;t++)l[o+e][a+t]=!0;let t=m[o-1][a-1],r=this.getParagraphStyleNumber(o-1,a-1);if(s.writeStartElement("table:table-cell"),s.writeAttributeString("table:style-name",`cell`+(t+1)),0<n.width&&s.writeAttributeString("table:number-columns-spanned",(n.width+1).toString()),0<n.height&&s.writeAttributeString("table:number-rows-spanned",(n.height+1).toString()),s.writeAttributeString("office:value-type","string"),n.component.is(StiText)&&!n.component.isExportAsImage(__.a.StiExportFormat.Odt)&&null!=n.text){let t=n.text,i=(0!=this.paragraphStyleList[r][Stimulsoft.System.StiObject.stimulsoft]().as(vb).Angle&&(t=t[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("\n"," ")),__.c.StiExportUtils.splitString(t,!0));for(let e=0;e<i[Stimulsoft.System.StiObject.stimulsoft]().countItems;e++){let t=i[e];s.writeStartElement("text:p"),s.writeAttributeString("text:style-name",`par`+(r+1)),s.writeString(t),s.writeEndElement()}}if(n.component.isExportAsImage(__.a.StiExportFormat.Odt)){let i=n.component[Stimulsoft.System.StiObject.stimulsoft]().as(IStiExportImageExtended);if(null!=i){let t=this.imageResolution,e={ref:t},r=i.getImage(e);if(t=e.ref,null!=r){let t=this.imageCache.addImageIntRaw(r,r.imageFormat),e=this.matrix.coordX.getByIndex(a+n.width)-this.matrix.coordX.getByIndex(a-1),i=this.matrix.coordY.getByIndex(o+n.height)-this.matrix.coordY.getByIndex(o-1);s.writeStartElement("text:p"),s.writeAttributeString("text:style-name","Table_20_Contents"),s.writeStartElement("draw:frame"),s.writeAttributeString("draw:style-name","fr1"),s.writeAttributeString("draw:name",`Picture`+(t+1)),s.writeAttributeString("text:anchor-type","paragraph"),s.writeAttributeString("svg:width",this.doubleToString(e)),s.writeAttributeString("svg:height",this.doubleToString(i)),s.writeAttributeString("draw:z-index","0"),s.writeStartElement("draw:image"),s.writeAttributeString("xlink:href",StiString.format("Pictures/{0:D5}.jpg",t+1)),s.writeAttributeString("xlink:type","simple"),s.writeAttributeString("xlink:show","embed"),s.writeAttributeString("xlink:actuate","onLoad"),s.writeEndElement(),s.writeEndElement(),s.writeEndElement()}}}}else{let t=m[o-1][a-1];s.writeStartElement("table:table-cell"),s.writeAttributeString("table:style-name",`cell`+(t+1))}s.writeEndElement()}s.writeEndElement()}return s.writeEndElement(),s.writeStartElement("text:p"),s.writeAttributeString("text:style-name","parEnd"),s.writeEndElement(),s.writeEndElement(),s.writeEndElement(),s.writeFullEndElement(),s.writeEndDocument(),s.flush(),t}exportOdt(i,r,t){if(null==Stimulsoft.Base[["St","iL","ic","en","se"].join("")].key&&console.warn("You are using a trial version of the Stimulsoft product!"),__.a.StiLogService.write(this[Stimulsoft.System.StiObject.stimulsoft]().getType(),"Export report to ODT format"),null==t)throw new Error("The 'settings' argument cannot be equal in null.");this.report=i;let n=t.pageRange;this.usePageHeadersAndFooters=t.usePageHeadersAndFooters,this.removeEmptySpaceAtBottom=t.removeEmptySpaceAtBottom,this.imageResolution=t.imageResolution,this.imageQuality=t.imageQuality,this.xmlIndentation=-1,this.imageQuality<0&&(this.imageQuality=0),1<this.imageQuality&&(this.imageQuality=1),this.imageResolution<10&&(this.imageResolution=10),this.imageResolution=this.imageResolution/100;try{this.imageCache=new __.a.StiImageCache(Stimulsoft.StiOptions.Export.OpenDocumentWriter.allowImageComparer,!0,ImageFormat.Jpeg,this.imageQuality,!1),this.cellStyleList=[],this.paragraphStyleList=[],this.currentPassNumber=0,this.maximumPassNumber=3+(Stimulsoft.StiOptions.Export.OpenDocumentWriter.divideSegmentPages?1:0);let t=n.getSelectedPages(i.renderedPages);if(Stimulsoft.StiOptions.Export.OpenDocumentWriter.divideSegmentPages&&(t=__.c.StiSegmentPagesDivider.divide(t,this),this.currentPassNumber++),this.isStopped)return;let e=new StiZipWriter20;if(e.begin(r,!0),this.matrix=new __.c.StiMatrix(t,!0,this),this.currentPassNumber=2+(Stimulsoft.StiOptions.Export.OpenDocumentWriter.divideSegmentPages?1:0),e.addFile("content.xml",this.writeContent()),e.addFile("mimetype",this.writeMimetype()),e.addFile("meta.xml",this.writeMeta()),e.addFile("META-INF/manifest.xml",this.writeManifest()),e.addFile("settings.xml",this.writeSettings()),e.addFile("styles.xml",this.writeStyles(t)),0<this.imageCache.imagePackedStore[Stimulsoft.System.StiObject.stimulsoft]().countItems)for(let t=0;t<this.imageCache.imagePackedStore[Stimulsoft.System.StiObject.stimulsoft]().countItems;t++)e.addFile(StiString.format("Pictures/{0:D5}.jpg",t+1),this.writeImage(t));e.end()}finally{null!=this.matrix&&(this.matrix.clear(),this.matrix=null),this.cellStyleList[Stimulsoft.System.StiObject.stimulsoft]().clear(),this.cellStyleList=null,this.paragraphStyleList[Stimulsoft.System.StiObject.stimulsoft]().clear(),this.paragraphStyleList=null,this.imageCache.clear(),this.imageCache=null,i.renderedPages.cacheMode&&__.c.StiMatrix.GCCollect()}}}}let StiLinePrimitive=__.a.Components.StiLinePrimitive,StiPrintOnType=__.a.Components.StiPrintOnType,Font=Stimulsoft.System.Drawing.Font,StiBorderSide=Stimulsoft.Base.Drawing.StiBorderSide,StiPenStyle=Stimulsoft.Base.Drawing.StiPenStyle,StiHtmlTagsState=Stimulsoft.Base.Drawing.StiHtmlTagsState,StiBrush=Stimulsoft.Base.Drawing.StiBrush,StiHtmlState=Stimulsoft.Base.Drawing.StiHtmlState,StiTextRenderer=Stimulsoft.Base.Drawing.StiTextRenderer,StiShape=__.a.Components.StiShape,StiRichText=__.a.Components.StiRichText,StiBorderSides=Stimulsoft.Base.Drawing.StiBorderSides,StiImage=__.a.Components.StiImage,StiVerticalLineShapeType=__.a.Components.StiVerticalLineShapeType,StiHorizontalLineShapeType=__.a.Components.StiHorizontalLineShapeType,StiTopAndBottomLineShapeType=__.a.Components.StiTopAndBottomLineShapeType,StiLeftAndRightLineShapeType=__.a.Components.StiLeftAndRightLineShapeType,StiRectangleShapeType=__.a.Components.StiRectangleShapeType,StiDiagonalDownLineShapeType=__.a.Components.StiDiagonalDownLineShapeType,StiDiagonalUpLineShapeType=__.a.Components.StiDiagonalUpLineShapeType,StiOvalShapeType=__.a.Components.StiOvalShapeType,IStiBrush=__.a.Components.IStiBrush,IStiFont=__.a.Components.IStiFont,IStiTextBrush=__.a.Components.IStiTextBrush,IStiTextHorAlignment=__.a.Components.IStiTextHorAlignment,IStiTextOptions=__.a.Components.IStiTextOptions,IStiVertAlignment=__.a.Components.IStiVertAlignment,IStiBorder=__.a.Components.IStiBorder,IStiIgnoreBorderWhenExport=__.a.Components.IStiIgnoreBorderWhenExport,StiAdvancedBorder=Stimulsoft.Base.Drawing.StiAdvancedBorder,IStiText=__.a.Components.IStiText,IStiExportImage=__.a.Components.IStiExportImage,IStiBreakable=__.a.Components.IStiBreakable,StiHorAlignment=Stimulsoft.Base.Drawing.StiHorAlignment,StiTextQuality=__.a.Components.StiTextQuality,IStiHorAlignment=__.a.Components.IStiHorAlignment,StiNumber=Stimulsoft.System.StiNumber;{class Lc{}class Mc{}class Nc extends __.c.StiExportService{constructor(){super(...arguments),this.multipleFiles=!1,this.sw=null,this.colorList=null,this.fontList=null,this.styleList=null,this.unicodeMapArray=null,this.codePageToFont=null,this.charsetCount=0,this.fontToCodePages=null,this.baseFontNumber=0,this.sw2=null,this.usePageHeadersAndFooters=!1,this.imageResolution=.96,this.imageQuality=.75,this.imageFormat=__.a.StiExportFormat.Rtf,this.imageCodec=null,this.useStyles=!1,this.bookmarkList=null,this.usedBookmarks=null,this.removeEmptySpaceAtBottom=Stimulsoft.StiOptions.Export.RichText.removeEmptySpaceAtBottom,this.hiToTwips=14.4,this.frameCorrectValue=38,this.matrix=null}implements(){let t=[__.c.IStiRtfExportService];return(this.implements=()=>t)()}get defaultExtension(){return"rtf"}get exportFormat(){return __.a.StiExportFormat.Rtf}get groupCategory(){return"Word"}get position(){return __.c.StiExportPosition.Rtf}get exportNameInMenu(){return StiLocalization.get("Export","ExportTypeRtfFile")}getFilter(){return StiLocalization.get("FileFilters","RtfFiles")}exportTo(t,e,i){this.exportRtf(t,e,i[Stimulsoft.System.StiObject.stimulsoft]().as(__.c.StiRtfExportSettings))}exportToAsync(e,i,t,r){setTimeout(async()=>{try{await __.c.StiExportImageHelper.convertAllImages(i,Stimulsoft.System.Drawing.Imaging.ImageFormat.Png,!1,this.exportFormat),this.exportTo(i,t,r),null!=i&&null!=i.preparedExportImages&&(i.preparedExportImages.clear(),i.preparedExportImages=null)}catch(t){if(Exception.log(t,i,`Export Error`).isImportant)return e(Exception.getMessage(t))}e()},0)}getColorNumberInt(e,i){if(0<e.length)for(let t=0;t<e.length;t++)if(i.equals(e[t]))return t;e.push(i);let t=e.length-1;return t}getColorNumber(t,e){return this.getColorNumberInt(t,e).toString()}getFontNumber(i,r){if(0<i.length)for(let e=0;e<i.length;e++){let t=i[e];if(t.name==r.name)return e*(0==this.charsetCount?1:this.charsetCount)}i.push(r);let t=i.length-1;return t*(0==this.charsetCount?1:this.charsetCount)}getFontNumber2(i,r,n){if(0<i.length)for(let e=0;e<i.length;e++){let t=i[e];if(t.name==r.name)return e*(0==this.charsetCount?1:this.charsetCount)+this.getCharsetIndex(n)}i.push(r);let t=i.length-1;return t*(0==this.charsetCount?1:this.charsetCount)+this.getCharsetIndex(n)}getCharsetIndex(e){let i=0;for(let t=0;t<__.c.StiEncode.codePagesTableSize;t++)if(__.c.StiEncode.codePagesTable[t][2]==e){i=t+1;break}if(0==this.charsetCount)return this.codePageToFont[i]=1,0;return this.codePageToFont[i]}getFontNumber3(i,r){if(0<i.length)for(let e=0;e<i.length;e++){let t=i[e];if(t.name==r)return e*(0==this.charsetCount?1:this.charsetCount)}i.push(new Font(r,8));let t=i.length-1;return t*(0==this.charsetCount?1:this.charsetCount)}getStyleNumber(i,r){if(0<i.length)for(let e=0;e<i.length;e++){let t=i[e];if(t.alignment==r.alignment&&t.name==r.name&&t.fontNumber==r.fontNumber&&t.fontSize==r.fontSize&&t.bold==r.bold&&t.italic==r.italic&&t.underline==r.underline&&t.textColor==r.textColor&&t.rightToLeft==r.rightToLeft)return e+1}i.push(r);let t=i.length-1;return t+1}getLineStyle(t,e){let i="";if(null!=t&&t.style!=StiPenStyle.None){switch(t.style){case StiPenStyle.Solid:i+="\\brdrs";break;case StiPenStyle.Dot:i+="\\brdrdot";break;case StiPenStyle.Dash:i+="\\brdrdash";break;case StiPenStyle.DashDot:i+="\\brdrdashd";break;case StiPenStyle.DashDotDot:i+="\\brdrdashdd";break;case StiPenStyle.Double:i+="\\brdrdb";break}i=(i=(i+="\\brdrw")+15*t.size)+StiString.format("\\brdrcf{0}",this.getColorNumber(e,t.color))}return i}convertStringToBookmark(e){let i="";for(let t of e.split(""))Char.isLetterOrDigit(t)&&(i+=t);return i}compareExcellSheetNames(t,e){let i=t,r=(StiString.isNullOrEmpty(i)&&(i=""),e);return StiString.isNullOrEmpty(r)&&(r=""),i==r}convertTextWithHtmlTagsToRtfText(t,e){let i=e,r=new StiHtmlTagsState(t.font.bold,t.font.italic,t.font.underline,t.font.strikeout,t.font.sizeInPoints,t.font.name,StiBrush.toColor(t.textBrush),StiBrush.toColor(t.brush),!1,!1,0,0,t.lineSpacing,t.horAlignment),n=new StiHtmlState(r,0),a=StiTextRenderer.parseHtmlToStates(i,n),o=(this.baseFontNumber=this.getFontNumber(this.fontList,t.font),Nc.getLineHeightInTwips(t.lineSpacing)),s=r;for(let t=0;t<a.length;t++){let e=a[t],i=e.ts,r="",n=null;if(Stimulsoft.StiOptions.Engine.htmlAllowListItemSecondLineIndent&&0<i.indent&&0<t&&"\n"==a[t-1].text.toString()){let t=Math.trunc(20+53*i.fontSize*i.indent);r+=StiString.format("\\fi-{0}\\li{0}",t)}if(i.bold!=s.bold&&(r+=i.bold?"\\b":"\\b0"),i.italic!=s.italic&&(r+=i.italic?"\\i":"\\i0"),i.underline!=s.underline&&(r+=i.underline?"\\ul":"\\ul0"),i.strikeout!=s.strikeout&&(r+=i.strikeout?"\\strike":"\\strike0"),i.superscript!=s.superscript&&(r+=i.superscript?"\\super":"\\nosupersub"),i.subscript!=s.subscript&&(r+=i.subscript?"\\sub":"\\nosupersub"),i.fontColor!=s.fontColor&&(r+=StiString.format("\\cf{0}",this.getColorNumberInt(this.colorList,i.fontColor))),i.backColor!=s.backColor&&(r+=StiString.format("\\chshdng0\\chcbpat{0}",this.getColorNumber(this.colorList,i.backColor))),i.fontSize!=s.fontSize&&(r+=StiString.format("\\fs{0}",Math.trunc(2*i.fontSize))),i.letterSpacing!=s.letterSpacing&&(r+=StiString.format("\\expnd{0}",Math.trunc(i.letterSpacing*i.fontSize*3.8+Stimulsoft.StiOptions.Export.RichText.spaceBetweenCharacters))),i.lineHeight!=s.lineHeight&&(r+=Nc.getLineHeightInTwips(i.lineHeight)),i.textAlign!=s.textAlign){let t="\\ql";i.textAlign==StiTextHorAlignment.Center&&(t="\\qc"),i.textAlign==StiTextHorAlignment.Right&&(t="\\qr"),i.textAlign==StiTextHorAlignment.Width&&(t="\\qj"),"\n"==e.text.toString()?n=t:r+=t}if(i.fontName!=s.fontName&&(this.baseFontNumber=this.getFontNumber3(this.fontList,i.fontName),r+=StiString.format("{0}{1}","",String.fromCharCode(256+this.baseFontNumber))),0<r.length&&(o=o+r[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("\\","")+" "),"\n"==e.text.toString())o+="\n",null!=n&&(o,n[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("\\",""));else{let t=o[o.length-1];" "!=t&&"\n"!=t&&"?"!=t&&" "!=t&&(o+=" "),o+=StiTextRenderer.prepareStateText(e.text)}s=i}return o}static getLineHeightInTwips(t){let e=Stimulsoft.StiOptions.Export.RichText.lineSpacing;return StiString.format("{0}sl{1}{0}slmult1","",Math.round(240*e*t))}replacePardInRtf(e){let i="",r=0,n=0,a=!1,o=0;while(o<e.length){let t=e[o++];if(i+=t,"{"==t){r++;continue}if("}"==t){--r<n&&(a=!1);continue}if("\\"==t){if(o<e.length&&("{"==e[o]||"}"==e[o])){o++;continue}o+2<e.length&&"s"==e[o]&&"h"==e[o+1]&&"p"==e[o+2]&&"{"==e[o-2]&&(a=!0,n=r),!a&&o+3<e.length&&"p"==e[o]&&"a"==e[o+1]&&"r"==e[o+2]&&"d"==e[o+3]&&(o+=4,i+="pard\\intbl")}}return i}getImageString(t,e,i,r){let n="jpeg",a=(t.imageFormat==Stimulsoft.System.Drawing.Imaging.ImageFormat.Png&&(n="png"),t.bytes),o="";if(o+="{"+StiString.format("\\pict\\picscalex{0}\\picscaley{1}\\picwgoal{2}\\pichgoal{3}\\{4}blip ",100,100,i,r,n),null!=a)for(let e=0;e<a.length;e++){let t=a[e];o+=(15<t?"":"0")+t.toString(16)}return o+="}"}drawLine(t,e,i,r,n,a){0!=n.a&&(this.sw.write("{\\shp{\\*"),this.sw.write(StiString.format("\\shpinst\\shpleft{0}\\shptop{1}\\shpright{2}\\shpbottom{3}",t<i?t:i,e<r?e:r,i<t?t:i,r<e?e:r)),this.sw.write("\\shpwr3"),this.sw.write("{\\sp{\\sn shapeType}{\\sv 20}}"),this.sw.write("{\\sp{\\sn fFlipH}{\\sv "+(t<i?"0":"1")+"}}"),this.sw.write("{\\sp{\\sn fFlipV}{\\sv "+(e<r?"0":"1")+"}}"),this.sw.write("{\\sp{\\sn fFilled}{\\sv 0}}"),this.sw.write("{\\sp{\\sn lineColor}{\\sv "+StiString.format("{0}",65536*n.b+256*n.g+n.r)+"}}"),this.sw.write("{\\sp{\\sn lineWidth}{\\sv "+a+"}}"),this.sw.write("{\\sp{\\sn fLine}{\\sv 1}}"),this.sw.writeLine("}}"))}fillRect(t,e){0!=e.a&&(this.sw.write("{\\shp{\\*"),this.sw.write(StiString.format("\\shpinst\\shpleft{0}\\shptop{1}\\shpright{2}\\shpbottom{3}",t.x,t.y,t.x+t.width,t.y+t.height)),this.sw.write("\\shpwr3"),this.sw.write("{\\sp{\\sn shapeType}{\\sv 1}}"),this.sw.write("{\\sp{\\sn fFlipH}{\\sv 0}}"),this.sw.write("{\\sp{\\sn fFlipV}{\\sv 0}}"),this.sw.write("{\\sp{\\sn fillColor}{\\sv "+StiString.format("{0}",65536*e.b+256*e.g+e.r)+"}}"),this.sw.write("{\\sp{\\sn fFilled}{\\sv 1}}"),this.sw.write("{\\sp{\\sn fLine}{\\sv 0}}"),this.sw.writeLine("}}"))}checkShape1(t){return!!(t.shapeType.is2(StiVerticalLineShapeType)||t.shapeType.is2(StiHorizontalLineShapeType)||t.shapeType.is2(StiTopAndBottomLineShapeType)||t.shapeType.is2(StiLeftAndRightLineShapeType)||t.shapeType.is2(StiRectangleShapeType))}renderShape1(s,l,m){let h=s.component,c=h.as(StiShape);if(null!=c)if(1==this.checkShape1(c)){let t=h.as(IStiBrush),e="",i=Color.transparent;if(0!=(i=null!=t?StiBrush.toColor(t.brush):i).a){let t=this.getColorNumber(this.colorList,i);e=StiString.format("\\cbpat{0}",t)}let r="",n=c.borderColor;if(0!=n.a){let t=this.getColorNumber(this.colorList,n);r=StiString.format("\\brdrcf{0}",t)}let a=14*c.size,o=StiString.format("\\brdrs\\brdrw{0}",a);this.sw.write("\\fs1"),c.shapeType.is(StiVerticalLineShapeType)&&(0!=i.a&&this.sw.write(e),0!=n.a)&&(this.sw.writeLine(" \\par}"),this.sw.write("{"),this.sw.write(StiString.format("\\nowrap\\posx{0}\\posy{1}\\absw{2}\\absh{3}",s.x+l,s.y,Math.trunc((s.width-2*this.frameCorrectValue-a)/2),s.height)),this.sw.write("\\brdrr"+o+r+"\\fs1")),c.shapeType.is(StiHorizontalLineShapeType)&&(0!=i.a&&this.sw.write(e),0!=n.a)&&(this.sw.writeLine(" \\par}"),this.sw.write("{"),this.sw.write(StiString.format("\\nowrap\\posx{0}\\posy{1}\\absw{2}\\absh{3}",s.x+l,s.y,s.width-m,Math.trunc((s.height+a)/2))),this.sw.write("\\brdrb"+o+r+"\\fs1")),c.shapeType.is(StiTopAndBottomLineShapeType)&&(0!=i.a&&this.sw.write(e),this.sw.write("\\brdrt"+o+r),this.sw.write("\\brdrb"+o+r),this.sw.writeLine("\\fs1")),c.shapeType.is(StiLeftAndRightLineShapeType)&&(0!=i.a&&this.sw.write(e),this.sw.write("\\brdrl"+o+r),this.sw.write("\\brdrr"+o+r),this.sw.writeLine("\\fs1")),c.shapeType.is(StiRectangleShapeType)&&(0!=i.a&&this.sw.write(e),this.sw.write("\\box"+o+r),this.sw.writeLine("\\fs1"))}else this.renderImage12(h,s.width-m,s.height)}checkShape2(t){return!!(t.shapeType.is2(StiVerticalLineShapeType)||t.shapeType.is2(StiHorizontalLineShapeType)||t.shapeType.is2(StiTopAndBottomLineShapeType)||t.shapeType.is2(StiLeftAndRightLineShapeType)||t.shapeType.is2(StiRectangleShapeType)||t.shapeType.is2(StiDiagonalDownLineShapeType)||t.shapeType.is2(StiDiagonalUpLineShapeType)||t.shapeType.is2(StiOvalShapeType))}renderShape2(a){let o=a.component,s=o.as(StiShape);if(null!=s)if(1==this.checkShape2(s)){let t=o.as(IStiBrush),e=Color.transparent,i=(null!=t&&(e=StiBrush.toColor(t.brush)),s.borderColor),r=8400*s.size,n=StiString.format("{0}",r);s.shapeType.is(StiVerticalLineShapeType)&&(this.fillRect(a,e),this.drawLine(Math.trunc(a.x+a.width/2),a.y,Math.trunc(a.x+a.width/2),a.y+a.height,i,n)),s.shapeType.is(StiHorizontalLineShapeType)&&(this.fillRect(a,e),this.drawLine(a.x,Math.trunc(a.y+a.height/2),a.x+a.width,Math.trunc(a.y+a.height/2),i,n)),s.shapeType.is(StiTopAndBottomLineShapeType)&&(this.fillRect(a,e),this.drawLine(a.x,a.y,a.x+a.width,a.y,i,n),this.drawLine(a.x,a.y+a.height,a.x+a.width,a.y+a.height,i,n)),s.shapeType.is(StiLeftAndRightLineShapeType)&&(this.fillRect(a,e),this.drawLine(a.x,a.y,a.x,a.y+a.height,i,n),this.drawLine(a.x+a.width,a.y,a.x+a.width,a.y+a.height,i,n)),s.shapeType.is(StiRectangleShapeType)&&(this.sw.write("{\\shp{\\*"),this.sw.write(StiString.format("\\shpinst\\shpleft{0}\\shptop{1}\\shpright{2}\\shpbottom{3}",a.x,a.y,a.x+a.width,a.y+a.height)),this.sw.write("\\shpwr3"),this.sw.write("{\\sp{\\sn shapeType}{\\sv 1}}"),this.sw.write("{\\sp{\\sn fFlipH}{\\sv 0}}"),this.sw.write("{\\sp{\\sn fFlipV}{\\sv 0}}"),0!=e.a?(this.sw.write("{\\sp{\\sn fillColor}{\\sv "+StiString.format("{0}",65536*e.b+256*e.g+e.r)+"}}"),this.sw.write("{\\sp{\\sn fFilled}{\\sv 1}}")):this.sw.write("{\\sp{\\sn fFilled}{\\sv 0}}"),0!=i.a?(this.sw.write("{\\sp{\\sn lineColor}{\\sv "+StiString.format("{0}",65536*i.b+256*i.g+i.r)+"}}"),this.sw.write("{\\sp{\\sn lineWidth}{\\sv "+n+"}}"),this.sw.write("{\\sp{\\sn fLine}{\\sv 1}}")):this.sw.write("{\\sp{\\sn fLine}{\\sv 0}}"),this.sw.writeLine("}}")),s.shapeType.is(StiOvalShapeType)&&(this.sw.write("{\\shp{\\*"),this.sw.write(StiString.format("\\shpinst\\shpleft{0}\\shptop{1}\\shpright{2}\\shpbottom{3}",a.x,a.y,a.x+a.width,a.y+a.height)),this.sw.write("\\shpwr3"),this.sw.write("{\\sp{\\sn shapeType}{\\sv 3}}"),this.sw.write("{\\sp{\\sn fFlipH}{\\sv 0}}"),this.sw.write("{\\sp{\\sn fFlipV}{\\sv 0}}"),0!=e.a?(this.sw.write("{\\sp{\\sn fillColor}{\\sv "+StiString.format("{0}",65536*e.b+256*e.g+e.r)+"}}"),this.sw.write("{\\sp{\\sn fFilled}{\\sv 1}}")):this.sw.write("{\\sp{\\sn fFilled}{\\sv 0}}"),0!=i.a?(this.sw.write("{\\sp{\\sn lineColor}{\\sv "+StiString.format("{0}",65536*i.b+256*i.g+i.r)+"}}"),this.sw.write("{\\sp{\\sn lineWidth}{\\sv "+n+"}}"),this.sw.write("{\\sp{\\sn fLine}{\\sv 1}}")):this.sw.write("{\\sp{\\sn fLine}{\\sv 0}}"),this.sw.writeLine("}}")),s.shapeType.is(StiDiagonalDownLineShapeType)&&(this.fillRect(a,e),this.drawLine(a.x,a.y,a.x+a.width,a.y+a.height,i,n)),s.shapeType.is(StiDiagonalUpLineShapeType)&&(this.fillRect(a,e),this.drawLine(a.x,a.y+a.height,a.x+a.width,a.y,i,n))}else this.renderImage12(o,a.width,a.height)}checkArabic(t){if(Stimulsoft.StiOptions.Export.RichText.convertDigitsToArabic)return __.c.StiExportUtils.convertDigitsToArabic(t,Stimulsoft.StiOptions.Export.RichText.arabicDigitsType);return t}unicodeToRtfString(t,e){let i=t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=1<(t=(t=(t=(t=e?this.checkArabic(t):t)[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("\\","\\\\"))[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("{","\\{"))[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("}","\\}")).length&&"\t"==t[0]?t[Stimulsoft.System.StiObject.stimulsoft]().insert(0,"\t\t"):t)[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("\n\t","\n\t\t\t"))[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("\n","\\par "))[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("","\\"))[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("","{\\field{\\*\\fldinst {PAGE}}}"))[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("","{\\field{\\*\\fldinst {NUMPAGES}}}"))[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("","{\\field{\\*\\fldinst {"))[Stimulsoft.System.StiObject.stimulsoft]().replaceAll(""," }}{\\fldrslt {"))[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("","{\\*\\bkmkstart "))[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("","}{\\*\\bkmkend "))[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("","}"),r=null,o=(-1==i.indexOf("")?(r=[])[0]=i:r=i.split(""),"");for(let t=0;t<r.length;t++){let a=r[t],i=(0!=t&&(this.baseFontNumber=a.charCodeAt(0)-256,this.baseFontNumber<0&&(this.baseFontNumber=0),a=a.substr(2)),0);while(i<a.length){let r=i,t="",e=1;while(i<a.length&&0==__.c.StiEncode.unicodeToCodePageArray[a.charCodeAt(i)])t+=a[i],i++;if(i<a.length){e=__.c.StiEncode.unicodeToCodePageArray[a.charCodeAt(i)],t+=a[i],i++;while(i<a.length&&(0==__.c.StiEncode.unicodeToCodePageArray[a.charCodeAt(i)]||__.c.StiEncode.unicodeToCodePageArray[a.charCodeAt(i)]==e))t+=a[i],i++}let n=__.c.StiEncode.encode(t,e);o+="\\f"+(this.baseFontNumber+this.codePageToFont[e]).toString()+" ";for(let i=0;i<n.length;i++){let t=a.charCodeAt(r+i),e=n.charCodeAt(i);63==e&&__.c.StiEncode.unicodeToCodePageArray[t]<2?o+="\\u"+t.toString()+"?":o+=127<e?"\\'"+e.toString(16):String.fromCharCode(e)}}}return o}deleteToken(e,i){let r;do{if(-1<(r=e.indexOf(i))){let t=r+i.length;while(t<e.length&&Char.isDigit(e[t]))t++;e=e[Stimulsoft.System.StiObject.stimulsoft]().remove(r,t-r)}}while(-1!=r);return e}getRtfString(t){let o="",e=t.as(StiRichText);if(null!=e&&""!=e.text){let l=[],m=[],h,s=[],c;if(-1==(o=e.text).trimStart().toLowerCase().indexOf("rtf"))return o;let r=o.indexOf("\\ansicpg"),t=o.indexOf("\\'");if(-1!=r&&-1!=t&&Char.isDigit(o,r+8)){r+=8;let t=0;while(r+t<o.length&&Char.isDigit(o,r+t))t++;let e=parseInt(o.substr(r,t)),i=null;try{i=Encoding.getEncoding(e)}catch(t){}if(null!=i){let t="";r=0;while(r<o.length)if(r<o.length-4&&"\\"==o[r]&&"'"==o[r+1]){let e=[];while(r<o.length-4&&"\\"==o[r]&&"'"==o[r+1]){let t=Nc.parseHexTwoCharToInt(o[r+2],o[r+3]);e.push(t<256?t:"?".charCodeAt(0)),r+=4}0<e.length&&(t+=i.getString(e))}else t+=o[r],"\\"==o[r]&&r<o.length-2&&"\\"==o[r+1]&&(t+="\\",r++),r++;o=t}}if(-1!=(r=o.indexOf("{\\fonttbl"))){r+=9;while(r<o.length&&"}"!=o[r]){while(r<o.length&&"{"!=o[r])r++;let t=0,e=r;do{"{"==o[e]&&t++,"}"==o[e]&&t--,e++}while(0<t);l.push(o.substr(r,e-r)),r=e;while(r<o.length&&"{"!=o[r]&&"}"!=o[r])r++}o=o[Stimulsoft.System.StiObject.stimulsoft]().remove(0,r+1)}for(let s=0;s<l.length;s++){let i=l[s],r;do{if(-1!=(r=i.indexOf("{\\*"))){let t=0,e=r;do{"{"==i[e]&&t++,"}"==i[e]&&t--,e++}while(0<t);" "!=(i=i[Stimulsoft.System.StiObject.stimulsoft]().remove(r,e-r))[r-1]&&" "!=i[r]&&(i=i[Stimulsoft.System.StiObject.stimulsoft]().insert(r," "))}}while(-1!=r);r=i.indexOf(" ");let t=i.length-r-2,e=(";"==i[r+1+t-1]&&t--,i.substr(r+1,t)),n=(h=new Font(e,10),0);if(0<(r=i.indexOf("\\fcharset"))){r+=9;let t="";while(Char.isDigit(i[r]))t+=i[r],r++;let e=StiNumber.tryParse(t,!1);n=e.result,e.successfully||(n=0)}let a=this.getFontNumber2(this.fontList,h,n).toString(),o=(m.push(a),"");r=i.indexOf("\\f"),r+=2;while(Char.isDigit(i[r]))o+=i[r],r++;l[s]=o}if(-1!=(r=o.indexOf("{\\colortbl"))){r+=10;while(r<o.length&&"}"!=o[r]){while(r<o.length&&";"!=o[r]&&"\\"!=o[r])r++;let t=r;while(t<o.length&&";"!=o[t]&&"}"!=o[t])t++;s.push(o.substr(r,t+1-r)),";"==o[t]&&t++,r=t;while(r<o.length&&";"!=o[r]&&"\\"!=o[r]&&"}"!=o[r])r++}o=o[Stimulsoft.System.StiObject.stimulsoft]().remove(0,r+1)}for(let o=0;o<s.length;o++){let a=s[o];if(";"!=a){let t,e,i,r,n;t=a.indexOf("\\red")+4,n="";while(Char.isDigit(a[t]))n+=a[t],t++;e=n,t=a.indexOf("\\green")+6,n="";while(Char.isDigit(a[t]))n+=a[t],t++;i=n,t=a.indexOf("\\blue")+5,n="";while(Char.isDigit(a[t]))n+=a[t],t++;r=n,c=Color.fromArgb2(parseInt(e),parseInt(i),parseInt(r)),s[o]=this.getColorNumber(this.colorList,c)}else s[o]=this.getColorNumber(this.colorList,Color.transparent)}if(-1!=(r=o.indexOf("{\\stylesheet"))){let t=0,e=r;do{"{"==o[e]&&t++,"}"==o[e]&&t--,e++}while(0<t);o=o[Stimulsoft.System.StiObject.stimulsoft]().remove(0,e)}if(-1!=(r=o.indexOf("{\\*\\generator"))){let t=0,e=r;do{"{"==o[e]&&t++,"}"==o[e]&&t--,e++}while(0<t);o=o[Stimulsoft.System.StiObject.stimulsoft]().remove(0,e)}let n=0,a;do{if(-1!=(n=o.indexOf("\\f",n)))if(1==Char.isDigit(o[n+2])){let e=n+=2;a="";while(Char.isDigit(o[e]))a+=o[e],e++;let i=a;for(let t=0;t<l.length;t++)l[t]==i&&(o=o.substr(0,n)+m[t]+o.substr(e));n=e}else n+=2}while(-1!=n);if(0<s.length){n=0;let i=3;do{if(-1!=(n=o.indexOf("\\cf",n)))if(1==Char.isDigit(o[n+i])){let t=n+=i;a="";while(Char.isDigit(o[t]))a+=o[t],t++;let e=parseInt(a);e<s.length&&(o=o.substr(0,n)+s[e]+o.substr(t)),n=t}else n+=i}while(-1!=n);n=0,i=6;do{if(-1!=(n=o.indexOf("\\cbpat",n)))if(1==Char.isDigit(o[n+i])){let t=n+=i;a="";while(Char.isDigit(o[t]))a+=o[t],t++;let e=parseInt(a);e<s.length&&(o=o.substr(0,n)+s[e]+o.substr(t)),n=t}else n+=i}while(-1!=n);n=0,i=10;do{if(-1!=(n=o.indexOf("\\highlight",n)))if(1==Char.isDigit(o[n+i])){let t=n+=i;a="";while(Char.isDigit(o[t]))a+=o[t],t++;let e=parseInt(a);e<s.length&&(o=o.substr(0,n)+s[e]+o.substr(t)),n=t}else n+=i}while(-1!=n)}r=o.length-1;while("}"!=o[r])r--;r--;while("\r"==o[r]||"\n"==o[r]||" "==o[r])r--;if((o=(o=o.substr(0,r+1)).endsWith("\\par")?o.substr(0,o.length-"\\par".length):o).endsWith("\\par }")&&(o=o.substr(0,o.length-"\\par }".length)+"}"),o=this.deleteToken(o,"\\viewkind"),o=this.deleteToken(o,"\\uc"),StiString.isNullOrWhiteSpace(o))return"";while("\r"==o[0]||"\n"==o[0])o=o[Stimulsoft.System.StiObject.stimulsoft]().remove(0,1);"\\pard"==o.substr(0,5)&&(o=o[Stimulsoft.System.StiObject.stimulsoft]().remove(0,5)),o=this.deleteToken(o,"\\formprot"),o=this.deleteToken(o,"\\pagebb");let i="";for(let e=0;e<o.length;e++){let t=o.charCodeAt(e);i+=255<t?StiString.format("\\u{0}{1}",t,"?"):o[e]}o=i}let i=0,r=0;while(r<o.length){let t=o[r++];if("{"==t){i++;continue}if("}"==t){i--;continue}if("\\"==t&&r<o.length&&("{"==o[r]||"}"==o[r])){r++;continue}}return i<0&&(o=StiString.fill("{",-i)+o),0<i&&(o+=StiString.fill("}",i)),o}static parseHexTwoCharToInt(t,e){return 16*this.parseHexCharToInt(t)+this.parseHexCharToInt(e)}static parseHexCharToInt(t){if("0"<=t&&t<="9")return t.charCodeAt(0)-"0".charCodeAt(0);if("a"==t||"A"==t)return 10;if("b"==t||"B"==t)return 11;if("c"==t||"C"==t)return 12;if("d"==t||"D"==t)return 13;if("e"==t||"E"==t)return 14;if("f"==t||"F"==t)return 15;return 256}makeHorAlignString(t,e){let i=0,r="\\ql"+(0!=i?StiString.format("\\ri{0}",i):"");return(t==StiTextHorAlignment.Left&&1==e||t==StiTextHorAlignment.Right&&0==e)&&(r="\\qr"+(0!=i?StiString.format("\\li{0}",i):"")),t==StiTextHorAlignment.Center&&(r="\\qc"+(0!=i?StiString.format("\\ri{0}",i):"")),r=t==StiTextHorAlignment.Width?"\\qj":r}getRtfStyleFromComponent(a){if(null!=a){let t=a.as(IStiFont),e=a.as(IStiTextBrush),i=a.as(IStiTextHorAlignment),r=a.as(IStiTextOptions),n=new Mc;return n.name=a.name,null!=a.componentStyle&&0<a.componentStyle.length&&(n.name=a.componentStyle),null!=t&&(n.fontNumber=this.getFontNumber(this.fontList,t.font),n.fontSize=StiMath.round2(2*t.font.sizeInPoints,0),n.bold=t.font.bold,n.italic=t.font.italic,n.underline=t.font.underline),null!=e&&(n.textColor=this.getColorNumberInt(this.colorList,StiBrush.toColor(e.textBrush))),null!=i&&(n.alignment=i.horAlignment),null!=r&&(n.rightToLeft=r.textOptions.rightToLeft),this.getStyleNumber(this.styleList,n)}return 0}renderStartDoc(){this.sw.write("{\\rtf1"),this.sw.writeLine(StiString.format("\\ansi\\ansicpg{0}",1252)),this.sw.writeLine("{\\fonttbl");for(let r=0;r<this.fontList.length;r++){let i=this.fontList[r];for(let e=0;e<this.charsetCount;e++){let t=__.c.StiEncode.codePagesTable[this.fontToCodePages[e]][2];this.sw.write("{"),this.sw.write(StiString.format("\\f{0}\\fcharset{1} {2};",r*this.charsetCount+e,1==t?0:t,i.name)),this.sw.writeLine("}")}}this.sw.writeLine("}"),this.sw.writeLine("{\\colortbl");for(let e=0;e<this.colorList.length;e++){let t=this.colorList[e];Color.transparent.equals(t)?this.sw.writeLine(";"):this.sw.writeLine(StiString.format("\\red{0}\\green{1}\\blue{2};",t.r,t.g,t.b))}if(this.sw.writeLine("}"),this.useStyles){this.sw.writeLine("{\\stylesheet");for(let e=0;e<this.styleList.length;e++){this.sw.write("{");let t=this.styleList[e];this.sw.write(StiString.format("\\s{0}\\sbasedon0\\snext{0} ",e+1)),-1!=t.fontNumber&&(this.sw.write(StiString.format("\\f{0}",t.fontNumber)),this.sw.write(StiString.format("\\fs{0}",t.fontSize)),t.bold&&this.sw.write("\\b"),t.italic&&this.sw.write("\\i"),t.underline)&&this.sw.write("\\ul"),-1!=t.textColor&&this.sw.write(StiString.format("\\cf{0}",t.textColor)),this.sw.write(this.makeHorAlignString(t.alignment,t.rightToLeft)),t.rightToLeft?this.sw.write("\\rtlpar"):this.sw.write("\\ltrpar"),this.sw.write(StiString.format(" {0};",t.name)),this.sw.writeLine("}")}this.sw.writeLine("}")}this.sw.writeLine("{\\info{\\doccomm "+__.c.StiExportUtils.getReportVersion(this.report)+"}}"),this.sw.write("\\viewkind1"),this.sw.write(StiString.format("\\deftab{0}",Math.round(20*this.hiToTwips))),this.sw.write("\\nouicompat")}renderEndDoc(){this.sw.writeLine(""),this.sw.writeLine("}")}renderPageHeader(t){let e=Stimulsoft.StiOptions.Export.RichText.useTemplatePageSize,i=(this.pageHeight=Math.round(this.hiToTwips*t.unit.convertToHInches(t.pageHeight*(e?1:t.segmentPerHeight))),this.pageWidth=Math.round(this.hiToTwips*t.unit.convertToHInches(t.pageWidth*(e?1:t.segmentPerWidth))),Math.round(this.hiToTwips*t.unit.convertToHInches(t.margins.left))),r=Math.round(this.hiToTwips*t.unit.convertToHInches(t.margins.right)),n=Math.round(this.hiToTwips*t.unit.convertToHInches(t.margins.top)),a=Math.round(this.hiToTwips*t.unit.convertToHInches(t.margins.bottom))-Stimulsoft.StiOptions.Export.RichText.bottomMarginCorrection;a<0&&(a=0),31500<this.pageWidth&&(this.pageWidth=31500),31500<this.pageHeight&&(this.pageHeight=31500),this.sw.write("\\sectd"),t.orientation==StiPageOrientation.Landscape&&this.sw.write("\\lndscpsxn"),this.sw.write(StiString.format("\\paperw{0}\\paperh{1}",this.pageWidth,this.pageHeight)),this.sw.writeLine(StiString.format("\\margl{0}\\margr{1}\\margt{2}\\margb{3}\\headery{2}\\footery{3}",i,r,n,a))}renderPageFooter(){Stimulsoft.StiOptions.Export.RichText.useNewPageCommandInsteadOfNewSection?this.sw.writeLine("\\page\\par"):this.sw.writeLine("\\sect")}renderTextAngle1(t){let i=t.as(IStiTextOptions);if(null!=i){let t=i.textOptions.angle,e=225<t&&t<315?2:45<t&&t<135?1:0;switch(e){case 1:this.sw.write("\\frmtxbtlr");break;case 2:this.sw.write("\\frmtxtbrl");break;default:this.sw.write("\\frmtxlrtb");break}}}renderTextAngle2(t){let i=t.as(IStiTextOptions);if(null!=i){let t=i.textOptions.angle,e=225<t&&t<315?2:45<t&&t<135?1:0;switch(e){case 1:this.sw.write("\\cltxbtlr");break;case 2:this.sw.write("\\cltxtbrl");break;default:this.sw.write("\\cltxlrtb");break}}}renderHorAlign12(t){let e=t.as(IStiTextHorAlignment),i=t.as(IStiTextOptions),r=null!=i&&i.textOptions.rightToLeft;if(null!=e){let t=this.makeHorAlignString(e.horAlignment,r);this.sw.write(StiString.format("{0}",t))}}renderVerAlign2(t){let e=t.as(IStiVertAlignment);null!=e&&(e.vertAlignment==StiVertAlignment.Top&&this.sw.write("\\clvertalt"),e.vertAlignment==StiVertAlignment.Center&&this.sw.write("\\clvertalc"),e.vertAlignment==StiVertAlignment.Bottom)&&this.sw.write("\\clvertalb")}renderBorder1(t){let e=t.as(IStiBorder);if(null!=e&&!t.is(IStiIgnoreBorderWhenExport))if(e.border.is(StiAdvancedBorder)){let t=e.border;t.isLeftBorderSidePresent&&0!=t.leftSide.color.a&&this.sw.write("\\brdrl"+this.getLineStyle(t.leftSide,this.colorList)),t.isRightBorderSidePresent&&0!=t.rightSide.color.a&&this.sw.write("\\brdrr"+this.getLineStyle(t.rightSide,this.colorList)),t.isTopBorderSidePresent&&0!=t.topSide.color.a&&this.sw.write("\\brdrt"+this.getLineStyle(t.topSide,this.colorList)),t.isBottomBorderSidePresent&&0!=t.bottomSide.color.a&&this.sw.write("\\brdrb"+this.getLineStyle(t.bottomSide,this.colorList))}else{let t=e.border.color;if(0!=t.a){let t=this.getLineStyle(new StiBorderSide(e.border.color,e.border.size,e.border.style),this.colorList);0<(e.border.side&StiBorderSides.Left)&&this.sw.write("\\brdrl"+t),0<(e.border.side&StiBorderSides.Right)&&this.sw.write("\\brdrr"+t),0<(e.border.side&StiBorderSides.Top)&&this.sw.write("\\brdrt"+t),0<(e.border.side&StiBorderSides.Bottom)&&this.sw.write("\\brdrb"+t)}}}renderBorder2(t){let e=t.as(IStiBorder);if(null!=e&&!t.is(IStiIgnoreBorderWhenExport))if(e.border.is(StiAdvancedBorder)){let t=e.border;t.isLeftBorderSidePresent&&0!=t.leftSide.color.a&&this.sw.write("\\clbrdrl"+this.getLineStyle(t.leftSide,this.colorList)),t.isRightBorderSidePresent&&0!=t.rightSide.color.a&&this.sw.write("\\clbrdrr"+this.getLineStyle(t.rightSide,this.colorList)),t.isTopBorderSidePresent&&0!=t.topSide.color.a&&this.sw.write("\\clbrdrt"+this.getLineStyle(t.topSide,this.colorList)),t.isBottomBorderSidePresent&&0!=t.bottomSide.color.a&&this.sw.write("\\clbrdrb"+this.getLineStyle(t.bottomSide,this.colorList))}else{let t=e.border.color;if(0!=t.a){let t=this.getLineStyle(new StiBorderSide(e.border.color,e.border.size,e.border.style),this.colorList);0<(e.border.side&StiBorderSides.Left)&&this.sw.write("\\clbrdrl"+t),0<(e.border.side&StiBorderSides.Right)&&this.sw.write("\\clbrdrr"+t),0<(e.border.side&StiBorderSides.Top)&&this.sw.write("\\clbrdrt"+t),0<(e.border.side&StiBorderSides.Bottom)&&this.sw.write("\\clbrdrb"+t)}}}renderBorder2Table(e,i,r,n,t,a=!1){let o=!0,s=!0;for(let t=0;t<r+1;t++)null==this.matrix.bordersY[e-1+t][i-1]&&(o=!1),null==this.matrix.bordersY[e-1+t][i-1+n+1]&&(s=!1);let l=!0,m=!0;for(let t=0;t<n+1;t++)null==this.matrix.bordersX[e-1][i-1+t]&&(l=!1),null==this.matrix.bordersX[e-1+r+1][i-1+t]&&(m=!1);a&&e<this.matrix.coordY.countItems&&this.matrix.linePlacement[e]==__.c.StiTableLineInfo.HeaderAP&&(m=!1);let h="";if(o&&(h+="\\clbrdrl"+this.getLineStyle(this.matrix.bordersY[e-1][i-1],this.colorList)),s&&(h+="\\clbrdrr"+this.getLineStyle(this.matrix.bordersY[e-1][i-1+n+1],this.colorList)),l&&(h+="\\clbrdrt"+this.getLineStyle(this.matrix.bordersX[e-1][i-1],this.colorList)),m&&(h+="\\clbrdrb"+this.getLineStyle(this.matrix.bordersX[e-1+r+1][i-1],this.colorList)),t)return h;return 0<h.length&&this.sw.write(h),null}renderBorder2TableGetValues(t,e,i){let r=StiBorderSides.None,n="";return null!=this.matrix.bordersY[t-1][e-1]&&(r|=StiBorderSides.Left),null!=this.matrix.bordersY[t-1][e-1+1]&&(r|=StiBorderSides.Right),null!=this.matrix.bordersX[t-1][e-1]&&(n+="\\clbrdrt"+this.getLineStyle(this.matrix.bordersX[t-1][e-1],this.colorList),r|=StiBorderSides.Top),null!=this.matrix.bordersX[t-1+1][e-1]&&(n+="\\clbrdrb"+this.getLineStyle(this.matrix.bordersX[t-1+1][e-1],this.colorList),r|=StiBorderSides.Bottom),i.ref=n,r}renderBrush1(t){let i=t.as(IStiBrush);if(null!=i&&!t.isExportAsImage(__.a.StiExportFormat.Rtf)){let e=StiBrush.toColor(i.brush);if(0!=e.a){let t=this.getColorNumber(this.colorList,e);this.sw.write(StiString.format("\\cbpat{0}",t))}}}renderBrush2(t){let e=t.as(IStiBrush);if(null!=e&&!t.isExportAsImage(__.a.StiExportFormat.Rtf)){let t=StiBrush.toColor(e.brush);this.sw.write("{\\sp{\\sn fillColor}{\\sv "),this.sw.write(StiString.format("{0}",65536*t.b+256*t.g+t.r)),this.sw.write("}}"),0!=t.a?this.sw.write("{\\sp{\\sn fFilled}{\\sv 1}} "):this.sw.write("{\\sp{\\sn fFilled}{\\sv 0}} ")}}renderTextBrush12(t){let e=t.as(IStiTextBrush);if(null!=e){let t=this.getColorNumber(this.colorList,StiBrush.toColor(e.textBrush));this.sw.write(StiString.format("\\cf{0}",t))}}renderTextFont12(t){let e=t.as(IStiFont);null!=e&&(this.baseFontNumber=this.getFontNumber(this.fontList,e.font),this.sw.write(StiString.format("\\f{0}",this.baseFontNumber)),this.sw.write(StiString.format("\\fs{0}",Math.round(2*e.font.sizeInPoints))),e.font.bold&&this.sw.write("\\b"),e.font.italic&&this.sw.write("\\i"),e.font.underline&&this.sw.write("\\ul"),this.sw.write(StiString.format("\\sl{0}\\slmult1",Math.round(240*Stimulsoft.StiOptions.Export.RichText.lineSpacing*(t.is(StiText)?t.lineSpacing:1)))),0!=Stimulsoft.StiOptions.Export.RichText.spaceBetweenCharacters)&&this.sw.write(StiString.format("\\expndtw{0}",Stimulsoft.StiOptions.Export.RichText.spaceBetweenCharacters))}renderText12(o){let s=o.as(IStiText),l=o.as(IStiTextOptions);if(null!=s&&!o.isExportAsImage(__.a.StiExportFormat.Rtf)){let t=s.text,e=o.as(StiText),i=(null!=e&&e.checkAllowHtmlTags()&&(t=this.convertTextWithHtmlTagsToRtfText(e,t)),t=o.is(StiText)&&o.textQuality==StiTextQuality.Wysiwyg&&!StiString.isNullOrEmpty(t)&&t.endsWith(StiTextRenderer.StiForceWidthAlignTag)?t.substr(0,t.length-StiTextRenderer.StiForceWidthAlignTag.length):t),r=null!=l&&null!=l.textOptions&&l.textOptions.rightToLeft,n=this.unicodeToRtfString(i,r),a=[];for(let t=0;t<n.length;t++)a[t]=n.charCodeAt(t);this.sw.flush(),this.sw2.write(a,0,a.length)}}renderImage12(t,n,a){let o=t.as(IStiExportImage);if(null!=o){let e=this.imageResolution,i=o.as(IStiExportImageExtended),r=null;if(t.isExportAsImage(__.a.StiExportFormat.Rtf)){let t={ref:e};r=null!=i&&i.isExportAsImage(__.a.StiExportFormat.Rtf)?i.getImage(t,this.imageFormat):o.getImage(t),e=t.ref}null!=r&&this.sw.write(this.getImageString(r,e,n,a))}}renderRtf12(n,a=0){let t=n.as(StiRichText);if(null!=t)if(0<a){this.sw.flush();let t=this.sw.baseStream.position,e=StiArray.create(Number,t-(a+1)),i=(this.sw.baseStream.position=a+1,this.sw.baseStream.read(e,0,e.length),Encoding.ASCII.getString(e)),r=this.getRtfString(n);r=(r=(r=r[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("pardpar",""))[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("\\pard",""))[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("","\\pard"+i+"\\par"),this.sw.write(r)}else{let t=this.getRtfString(n)[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("\\pard","");this.sw.write(t)}}renderImage3(t,n,a,o){let s=t.as(IStiExportImageExtended);if(null!=s){let e=this.imageResolution,i=s.as(IStiExportImageExtended),r=null;if(t.isExportAsImage(__.a.StiExportFormat.Rtf)){let t={ref:e};r=null!=i&&i.isExportAsImage(__.a.StiExportFormat.Rtf)?s.getImage(t,this.imageFormat):s.getImage(t),e=t.ref}null!=r&&(n+=this.getImageString(r,e,a,o))}}renderRtf3(e,i){let t=e.as(StiRichText);if(null!=t){let t=this.getRtfString(e)[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("\\pard","\\par");i+=t}}renderText3(n,a){let o=n.as(IStiText),s=n.as(IStiTextOptions);if(null!=o&&!n.isExportAsImage(__.a.StiExportFormat.Rtf)){let t=o.text,e=t=n.is(StiText)&&n.textQuality==StiTextQuality.Wysiwyg&&!StiString.isNullOrEmpty(t)&&t.endsWith(StiTextRenderer.StiForceWidthAlignTag)?t.substr(0,t.length-StiTextRenderer.StiForceWidthAlignTag.length):t,i=null!=s&&null!=s.textOptions&&s.textOptions.rightToLeft,r=this.unicodeToRtfString(e,i);a+=r}}renderTextFont3(t,e){let i=t.as(IStiFont);null!=i&&(e+="\\f",this.baseFontNumber=this.getFontNumber(this.fontList,i.font),e=(e=e+this.baseFontNumber.toString()+"\\fs")+Math.round(2*i.font.sizeInPoints),i.font.bold,i.font.italic&&(e+="\\i"),i.font.underline&&(e+="\\ul"),e+=StiString.format("\\sl{0}\\slmult1",Math.round(240*Stimulsoft.StiOptions.Export.RichText.lineSpacing*(t.is(StiText)?t.lineSpacing:1))),0!=Stimulsoft.StiOptions.Export.RichText.spaceBetweenCharacters)&&(e+=StiString.format("\\expndtw{0}",Stimulsoft.StiOptions.Export.RichText.spaceBetweenCharacters))}renderTextBrush3(t,e){let i=t.as(IStiTextBrush);if(null!=i){let t=this.getColorNumber(this.colorList,StiBrush.toColor(i.textBrush));e=e+"\\cf"+t}}renderBrush3(t,e){let i=t.as(IStiBrush);if(null!=i&&!t.isExportAsImage(__.a.StiExportFormat.Rtf)){let t=this.getColorNumber(this.colorList,StiBrush.toColor(i.brush));e=e+"\\cbpat"+t}}renderBorder3(t,e){let i=t.as(IStiBorder);if(null!=i&&!t.is(IStiIgnoreBorderWhenExport))if(i.border.is(StiAdvancedBorder)){let t=i.border;t.isLeftBorderSidePresent&&0!=t.leftSide.color.a&&(e+="\\brdrl"+this.getLineStyle(t.leftSide,this.colorList)),t.isRightBorderSidePresent&&0!=t.rightSide.color.a&&(e+="\\brdrr"+this.getLineStyle(t.rightSide,this.colorList)),t.isTopBorderSidePresent&&0!=t.topSide.color.a&&(e+="\\brdrt"+this.getLineStyle(t.topSide,this.colorList)),t.isBottomBorderSidePresent&&0!=t.bottomSide.color.a&&(e+="\\brdrb"+this.getLineStyle(t.bottomSide,this.colorList))}else{let t=i.border.color;if(0!=t.a){let t=this.getLineStyle(new StiBorderSide(i.border.color,i.border.size,i.border.style),this.colorList);0<(i.border.side&StiBorderSides.Left)&&(e+="\\brdrl"+t),0<(i.border.side&StiBorderSides.Right)&&(e+="\\brdrr"+t),0<(i.border.side&StiBorderSides.Top)&&(e+="\\brdrt"+t),0<(i.border.side&StiBorderSides.Bottom)&&(e+="\\brdrb"+t)}}}renderStyle12(e){let t=e.as(StiText);if(this.useStyles&&null!=t){let t=this.getRtfStyleFromComponent(e);this.sw.write(StiString.format("\\s{0}",t))}}writeFromMatrix(c,g,S){let p=this.matrix.coordX.countItems,d=[];for(let e=1;e<this.matrix.coordX.countItems;e++){let t=this.matrix.coordX.getByIndex(e);d[e]=Math.round(t*this.hiToTwips)}let u=StiArray.create2(Number,this.matrix.coordY.countItems,this.matrix.coordX.countItems),w=StiArray.create2(Number,this.matrix.coordY.countItems,this.matrix.coordX.countItems),f="",b=0,E=Math.max(this.matrix.coordY.countItems/200,1),y=0;for(let h=1;h<this.matrix.coordY.countItems;h++){let t=Math.trunc(h/E),e=(t>y&&(y=t,this.invokeExporting2(h,this.matrix.coordY.countItems,this.currentPassNumber,this.maximumPassNumber)),Math.round((this.matrix.coordY.getByIndex(h)-this.matrix.coordY.getByIndex(h-1))*this.hiToTwips)),s=h-1>=c&&h-1<=g&&0==b,r=(0<b&&b--,0!=S||this.matrix.linePlacement[h-1]!=__.c.StiTableLineInfo.PageHeader&&this.matrix.linePlacement[h-1]!=__.c.StiTableLineInfo.PageFooter&&this.matrix.linePlacement[h-1]!=__.c.StiTableLineInfo.Trash||(s=!1),100005),n=[],a=!1,o=Stimulsoft.StiOptions.Export.RichText.useCanBreakProperty;if(s)for(let t=1;t<p;t++){let i=this.matrix.cells[h-1][t-1];if(0<=u[h][t]&&null!=i&&null!=i.component){if(null!=i.component.tagValue){let t=i.component.tagValue.toString().toLowerCase();-1!=t.indexOf("rtfparagraph")&&(n.push(i),s=!1),-1!=t.indexOf("rtfnewpage")&&(a=!0)}let t=i.component.as(IStiBreakable),e=(null==t||t.canBreak||(o=!1),null);i.component.is(StiText)&&(e=i.component.margins),i.component.is(StiRichText)&&(e=i.component.margins),null!=(e=i.component.is(StiImage)?i.component.margins:e)&&(e.top<r&&(r=e.top),0<i.height)&&(r=0)}}a&&this.sw.writeLine("}\\fs2\\page\\par{"),this.usePageHeadersAndFooters||(o=!1),r*=this.hiToTwips;let l=Math.round(r);if(s){if(this.usePageHeadersAndFooters&&this.matrix.linePlacement[h-1]==__.c.StiTableLineInfo.HeaderAP){let t=this.matrix.parentBandName[h-1],e=t.indexOf("");(t=-1!=e?t.substr(0,e):t)!=f&&(f=t,this.sw.writeLine("}\\fs2\\par{"))}let t=this.usePageHeadersAndFooters&&this.matrix.linePlacement[h-1]!=__.c.StiTableLineInfo.Empty||!Stimulsoft.StiOptions.Export.RichText.lineHeightExactly;this.sw.write("\\trowd"),this.usePageHeadersAndFooters&&!Stimulsoft.StiOptions.Export.RichText.forceLineHeight||this.sw.write(StiString.format("\\trrh{0}{1}",t?"":"-",e)),o||this.sw.write("\\trkeep"),this.sw.write("\\ltrrow"),this.usePageHeadersAndFooters&&this.matrix.linePlacement[h-1]==__.c.StiTableLineInfo.HeaderAP&&this.sw.write("\\trhdr")}let m="",i=0;for(let o=1;o<p;o++){let a=this.matrix.cells[h-1][o-1];if(0<=u[h][o]){if(i++,m+="{",null!=a){let t=a.cellStyle,n=!1,e=(null!=t.textOptions&&(n=t.textOptions.rightToLeft),t.font);if(this.baseFontNumber=this.getFontNumber(this.fontList,e),this.useStyles){let t=this.getRtfStyleFromComponent(a.component);m+=StiString.format("\\s{0}",t)}n?m+="\\rtlpar":m+="\\ltrpar",m+=this.makeHorAlignString(t.horAlignment,n);let i=this.getColorNumber(this.colorList,t.textColor),r=(m=(m=(m+=StiString.format("\\cf{0}",i))+StiString.format("\\f{0}",this.baseFontNumber))+StiString.format("\\fs{0}",Math.round(2*e.sizeInPoints)),e.bold&&(m+="\\b"),e.italic&&(m+="\\i"),e.underline&&(m+="\\ul"),m+=StiString.format("\\sl{0}\\slmult1",Math.round(240*Stimulsoft.StiOptions.Export.RichText.lineSpacing*(a.component.is(StiText)?a.component.lineSpacing:1))),0!=Stimulsoft.StiOptions.Export.RichText.spaceBetweenCharacters&&(m+=StiString.format("\\expndtw{0}",Stimulsoft.StiOptions.Export.RichText.spaceBetweenCharacters)),this.matrix.bookmarks[h-1][o-1]);if(null!=r&&s&&!this.usedBookmarks.containsKey(r)){this.usedBookmarks.set(r,r);let t=this.convertStringToBookmark(r);m+=this.unicodeToRtfString(""+t+""+t+"",!1)}if(!a.component.is(StiRichText)){let i=a.text;if(null!=i&&0<i.length&&!a.component.isExportAsImage(__.a.StiExportFormat.Rtf)){let t=a.component.as(StiText),r=i;if(null!=t&&t.checkAllowHtmlTags()&&(r=this.convertTextWithHtmlTagsToRtfText(t,i)),this.usePageHeadersAndFooters){let i=a.component.tagValue;if(null!=i&&0<i.length)if(Stimulsoft.StiOptions.Export.RichText.usePageRefField&&this.bookmarkList.containsKey(i))r=""+"PAGEREF "+this.convertStringToBookmark(i)+""+a.text+"";else if(-1==i.toLowerCase().indexOf("rtfnewpage")&&(-1!=i.indexOf("#PageNumber#")||-1!=i.indexOf("#TotalPageCount#")||-1!=i.indexOf("#PageRef"))){(r=i)[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("#PageNumber#",""),r[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("#TotalPageCount#","");let e=0;while(-1!=(e=i.indexOf("#PageRef",e))){let t=e+8;while(t<i.length&&"#"!=i[t])t++;r[Stimulsoft.System.StiObject.stimulsoft]().replaceAll(i.substr(e,t+1-e),""+"PAGEREF "+i+""+a.text+""),e+=8}}}if(null!=a.component.hyperlinkValue){let e=a.component.hyperlinkValue.toString().trim();if(0<e.length&&!e.StartsWith("javascript:")){let t=r;0==t.length&&(t=e),r=e.startsWith("#")?(e=e.substr(1),""+'HYPERLINK \\l "'+this.convertStringToBookmark(e)+'"'+""+t+""):""+'HYPERLINK "'+e+'"'+""+t+""}}let e=this.unicodeToRtfString(r,n);m+=StiString.format(" {0}",e)}}if(a.component.is(StiRichText)){let t=a.component.as(StiRichText);if(null!=t){let t=this.getRtfString(a.component),i=(StiString.isNullOrEmpty(a.text)&&(t=""),this.replacePardInRtf(t));if(null!=a.component.hyperlinkValue){let e=a.component.hyperlinkValue.toString().trim();if(0<e.length&&!e.startsWith("javascript:")){let t=i;0==t.length&&(t=e),i=e.StartsWith("#")?(e=e.substr(1),""+'HYPERLINK \\\\l "'+this.convertStringToBookmark(e)+'"'+""+t+""):""+'HYPERLINK "'+e+'"'+""+t+""}}i[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("","\\"),i[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("","{\\field{\\*\\fldinst {PAGE}}}"),i[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("","{\\field{\\*\\fldinst {NUMPAGES}}}"),i[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("","{\\field{\\*\\fldinst {"),i[Stimulsoft.System.StiObject.stimulsoft]().replaceAll(""," }}{\\fldrslt {"),i[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("","{\\*\\bkmkstart "),i[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("","}{\\*\\bkmkend "),i[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("","}"),m+=i}}else{let n=a.component.as(IStiExportImage);if(null!=n){let e=this.imageResolution,i=n.as(IStiExportImageExtended),r=null;if(a.component.isExportAsImage(__.a.StiExportFormat.Rtf)){let t={ref:e};r=null!=i&&i.isExportAsImage(__.a.StiExportFormat.Rtf)?i.getImage(t,this.imageFormat):n.getImage(t),e=t.ref}if(null!=r){let t=this.matrix.getRealImageData(a,r),i=(null!=t&&(r=t),this.getImageString(r,e,Math.round((this.matrix.coordX.getByIndex(o+a.width)-this.matrix.coordX.getByIndex(o-1))*this.hiToTwips),Math.round((this.matrix.coordY.getByIndex(h+a.height)-this.matrix.coordY.getByIndex(h-1))*this.hiToTwips)));if(null!=a.component.hyperlinkValue){let e=a.component.hyperlinkValue.toString().trim();if(0<e.length&&!e.startsWith("javascript:")){let t=i;i=e.startsWith("#")?(e=e.substr(1),"{\\field{\\*\\fldinst {"+'HYPERLINK \\\\l "'+this.convertStringToBookmark(e)+'"'+" }}{\\fldrslt {"+t+"}}}"):"{\\field{\\*\\fldinst {"+'HYPERLINK "'+e+'"'+" }}{\\fldrslt {"+t+"}}}"}}m=m+i+"\\f0\\fs2"}}}if(2!=w[h][o]){for(let e=0;e<=a.height;e++){for(let t=0;t<=a.width;t++)u[h+e][o+t]=-1;u[h+e][o]=a.width}if(0<a.height){w[h][o]=1;for(let t=1;t<=a.height;t++)w[h+t][o]=2}}}else if(0==w[h][o]&&Stimulsoft.StiOptions.Export.RichText.forceEmptyCellsOptimization){let r={ref:null},n=this.renderBorder2TableGetValues(h,o,r);if(0==(n&StiBorderSides.Right)){let i=0;while(o+i+1<p&&null==this.matrix.cells[h-1][o+i+1-1]&&0==u[h][o+i+1]&&0==w[h][o+i+1]){let t={ref:null},e=this.renderBorder2TableGetValues(h,o+i+1,t);if(0<(e&StiBorderSides.Left))break;if((e&(StiBorderSides.Top|StiBorderSides.Bottom))!=(n&(StiBorderSides.Top|StiBorderSides.Bottom)))break;if(r.ref!=t.ref)break;if(i++,0<(e&StiBorderSides.Right))break}if(0<i){for(let t=1;t<=i;t++)u[h][o+t]=-1;u[h][o]=i}}}m+="\\cell}"}if(64<=i)break}if(s){i=0;for(let r=1;r<p;r++){if(1==w[h][r]&&this.sw.write("\\clvmgf"),2==w[h][r]&&this.sw.write("\\clvmrg"),0<=u[h][r])if(i++,2==w[h][r]){let t=h;while(2==w[t][r])t--;let e=this.matrix.cells[t-1][r-1];this.renderBorder2Table(t,r,e.height,e.width,!1)}else{let i=this.matrix.cells[h-1][r-1];if(null!=i){let t=i.cellStyle;if(this.renderVerAlign2(i.component),this.renderBorder2Table(h,r,i.height,i.width,!1),this.renderTextAngle2(i.component),!i.component.isExportAsImage(__.a.StiExportFormat.Rtf)){let e=t.color;if(0!=e.a){let t=this.getColorNumber(this.colorList,e);this.sw.write(StiString.format("\\clcbpat{0}",t))}let n=i.component.as(StiText),a=i.component.as(StiRichText);if(null!=n||null!=a){let t=Stimulsoft.StiOptions.Export.RichText.rightMarginCorrection,e=0,i=0,r=0;null!=n&&(e=Math.round(n.margins.left*this.hiToTwips),i=Math.round((n.margins.right-t)*this.hiToTwips),r=Math.round(n.margins.top*this.hiToTwips)),null!=a&&(e=Math.round(a.margins.left*this.hiToTwips),i=Math.round((a.margins.right-t)*this.hiToTwips),r=Math.round(a.margins.top*this.hiToTwips)),r>l&&(r=l),0<e&&this.sw.write(StiString.format("\\clpadt{0}\\clpadft3",e)),0<i&&this.sw.write(StiString.format("\\clpadr{0}\\clpadfr3",i)),0<r&&this.sw.write(StiString.format("\\clpadl{0}\\clpadfl3",r))}}}else this.renderBorder2Table(h,r,0,u[h][r],!1,this.usePageHeadersAndFooters)}if(0<=u[h][r]&&this.sw.write(StiString.format("\\cellx{0}",d[r+u[h][r]])),64<=i)break}this.sw.write("\\pard\\intbl ");let e=[];for(let t=0;t<m.length;t++)e[t]=m.charCodeAt(t);this.sw.flush(),this.sw2.write(e,0,e.length),this.sw.writeLine("\\row")}for(let l of n){this.sw.write("\\pard{"),m="",b=l.height;let s=l.text;if(!l.component.is(StiRichText)&&null!=s&&0<s.length&&!l.component.isExportAsImage(__.a.StiExportFormat.Rtf)){let t=l.cellStyle,e=!1,i=(null!=t.textOptions&&(e=t.textOptions.rightToLeft),t.font);if(this.baseFontNumber=this.getFontNumber(this.fontList,i),this.useStyles){let t=this.getRtfStyleFromComponent(l.component);m+=StiString.format("\\s{0}",t)}e?m+="\\rtlpar":m+="\\ltrpar",m+=this.makeHorAlignString(t.horAlignment,e);let r=this.getColorNumber(this.colorList,t.textColor),n=(m=(m=(m+=StiString.format("\\cf{0}",r))+StiString.format("\\f{0}",this.baseFontNumber))+StiString.format("\\fs{0}",Math.round(2*i.sizeInPoints)),i.bold&&(m+="\\b"),i.italic&&(m+="\\i"),i.underline&&(m+="\\ul"),m+=StiString.format("\\sl{0}\\slmult1",Math.round(240*Stimulsoft.StiOptions.Export.RichText.lineSpacing*(l.component.is(StiText)?l.component.lineSpacing:1))),0!=Stimulsoft.StiOptions.Export.RichText.spaceBetweenCharacters&&(m+=StiString.format("\\expndtw{0}",Stimulsoft.StiOptions.Export.RichText.spaceBetweenCharacters)),s),a=l.component.as(StiText);if(null!=a&&a.checkAllowHtmlTags()&&(n=this.convertTextWithHtmlTagsToRtfText(a,s)),null!=l.component.hyperlinkValue){let e=l.component.hyperlinkValue.toString().trim();if(0<e.length&&!e.startsWith("javascript:")){let t=n;0==t.length&&(t=e),n=e.startsWith("#")?(e=e.substr(1),""+'HYPERLINK \\\\l "'+this.convertStringToBookmark(e)+'"'+""+t+""):""+'HYPERLINK "'+e+'"'+""+t+""}}let o=this.unicodeToRtfString(n,e);m+=StiString.format(" {0}",o)}if(l.component.is(StiRichText)){let t=l.component;if(null!=t){let t=this.getRtfString(l.component),i=t=StiString.isNullOrEmpty(l.text)?"":t;if(null!=l.component.hyperlinkValue){let e=l.component.hyperlinkValue.toString().trim();if(0<e.length&&!e.startsWith("javascript:")){let t=i;0==t.length&&(t=e),i=e.startsWith("#")?(e=e.substr(1),""+'HYPERLINK \\\\l "'+this.convertStringToBookmark(e)+'"'+""+t+""):""+'HYPERLINK "'+e+'"'+""+t+""}}i[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("","\\"),i[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("","{\\field{\\*\\fldinst {PAGE}}}"),i[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("","{\\field{\\*\\fldinst {NUMPAGES}}}"),i[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("","{\\field{\\*\\fldinst {"),i[Stimulsoft.System.StiObject.stimulsoft]().replaceAll(""," }}{\\fldrslt {"),i[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("","{\\*\\bkmkstart "),i[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("","}{\\*\\bkmkend "),i[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("","}"),m+=i}}else{let i=l.component.as(IStiExportImage);if(null!=i){let n=this.imageResolution,e=i.as(IStiExportImageExtended),a=null;if(l.component.isExportAsImage(__.a.StiExportFormat.Rtf)){let t={ref:n};a=null!=e&&e.isExportAsImage(__.a.StiExportFormat.Rtf)?e.getImage(t,this.imageFormat):i.getImage(t),n=t.ref}if(null!=a){let t=this.matrix.getRealImageData(l,a),i=(null!=t&&(a=t),this.getImageString(a,n,Math.round((this.matrix.coordX.getByIndex(l.left+1+l.width)-this.matrix.coordX.getByIndex(l.left))*this.hiToTwips),Math.round((this.matrix.coordY.getByIndex(l.top+1+l.height)-this.matrix.coordY.getByIndex(l.top))*this.hiToTwips)));if(null!=l.component.hyperlinkValue){let e=l.component.hyperlinkValue.toString().trim();if(0<e.length&&!e.startsWith("javascript:")){let t=i;i=e.startsWith("#")?(e=e.substr(1),"{\\field{\\*\\fldinst {"+'HYPERLINK \\\\l "'+this.convertStringToBookmark(e)+'"'+" }}{\\fldrslt {"+t+"}}}"):"{\\field{\\*\\fldinst {"+'HYPERLINK "'+e+'"'+" }}{\\fldrslt {"+t+"}}}"}}let e=l.cellStyle.horAlignment;if(l.component.is(IStiTextHorAlignment)){let t=l.component.as(IStiHorAlignment);null!=t&&(t.horAlignment==StiHorAlignment.Left&&(e=StiTextHorAlignment.Left),t.horAlignment==StiHorAlignment.Center&&(e=StiTextHorAlignment.Center),t.horAlignment==StiHorAlignment.Right)&&(e=StiTextHorAlignment.Right)}let r=!1;null!=l.cellStyle.textOptions&&(r=l.cellStyle.textOptions.rightToLeft),m=(m+=this.makeHorAlignString(e,r))+i}}m+="\\f0\\fs2"}let e=[];for(let t=0;t<m.length;t++)e[t]=m.charCodeAt(t);this.sw.flush(),this.sw2.write(e,0,e.length),m.trim().endsWith("\\par")||this.sw.write("\\par"),this.sw.writeLine("}")}}}exportRtf2(t,e,i){let r=new __.c.StiRtfExportSettings;r.exportMode=i,this.exportRtf(t,e,r)}exportRtf(m,t,e){if(__.a.StiLogService.write(this[Stimulsoft.System.StiObject.stimulsoft]().getType(),"Export report to Rtf format"),null==Stimulsoft.Base[["St","iL","ic","en","se"].join("")].key&&console.warn("You are using a trial version of the Stimulsoft product!"),null==e)throw"The 'settings' argument cannot be equal in null.";this.report=m;let i=e.exportMode,r=e.pageRange,n=(this.usePageHeadersAndFooters=e.usePageHeadersAndFooters,this.removeEmptySpaceAtBottom=e.removeEmptySpaceAtBottom,this.imageResolution=e.imageResolution,this.imageQuality=e.imageQuality,e.storeImagesAsPng),c=(this.unicodeMapArray=[],this.codePageToFont=StiArray.create(Number,__.c.StiEncode.codePagesTableSize+1),this.fontToCodePages=StiArray.create(Number,__.c.StiEncode.codePagesTableSize+1),this.charsetCount=0,this.useStyles=!0,this.imageQuality<0&&(this.imageQuality=0),1<this.imageQuality&&(this.imageQuality=1),this.imageResolution<10&&(this.imageResolution=10),this.imageResolution=this.imageResolution/100,this.imageFormat=n?__.a.StiExportFormat.ImagePng:__.a.StiExportFormat.Rtf,12),g=1,S=1;this.colorList=[],this.fontList=[],this.styleList=[],this.sw=new StreamWriter(t,Encoding.getEncoding(1252)),this.sw2=t;for(let t=0;t<65536;t++)this.unicodeMapArray[t]=0;this.bookmarkList=new Hashtable,this.usedBookmarks=new Hashtable,this.currentPassNumber=0,this.maximumPassNumber=(i==__.c.StiRtfExportMode.Table?4:2)+(Stimulsoft.StiOptions.Export.RichText.divideSegmentPages?1:0);let p=r.getSelectedPages(m.renderedPages);Stimulsoft.StiOptions.Export.RichText.divideSegmentPages&&(p=__.c.StiSegmentPagesDivider.divide(p,this),this.currentPassNumber++),__.c.StiExportUtils.checkPassive(p);for(let t of p.list){p.getPage(t),this.invokeExporting(t,p,this.currentPassNumber,this.maximumPassNumber);for(let s of t.components.list)if(s.enabled){let t=s.as(IStiTextBrush),e=(null!=t&&this.getColorNumberInt(this.colorList,StiBrush.toColor(t.textBrush)),s.as(IStiBrush)),i=(null!=e&&this.getColorNumber(this.colorList,StiBrush.toColor(e.brush)),s.as(IStiBorder));if(null!=i&&!s.is(IStiIgnoreBorderWhenExport)){let t=i.border.as(StiAdvancedBorder);null!=t?(this.getColorNumber(this.colorList,t.leftSide.color),this.getColorNumber(this.colorList,t.rightSide.color),this.getColorNumber(this.colorList,t.topSide.color),this.getColorNumber(this.colorList,t.bottomSide.color)):this.getColorNumber(this.colorList,i.border.color)}let r=s.as(StiShape),n=(null!=r&&this.getColorNumber(this.colorList,r.borderColor),s.as(IStiFont)),a=(null!=n&&this.getFontNumber(this.fontList,n.font),s.as(StiRichText)),o=(null!=a&&(this.getRtfString(s),this.getColorNumber(this.colorList,a.backColor)),s.as(StiText));if(null!=o){let t=o.text,e=(o.checkAllowHtmlTags()&&(t=this.convertTextWithHtmlTagsToRtfText(o,o.text)),this.checkArabic(t));for(let t=0;t<e.length;t++)this.unicodeMapArray[e.charCodeAt(t)]=1;this.getRtfStyleFromComponent(s)}if(Stimulsoft.StiOptions.Export.RichText.usePageRefField&&null!=s.bookmarkValue){let t=s.bookmarkValue.toString();null!=t&&0<t.length&&(this.bookmarkList.containsKey(t)||this.bookmarkList.add(t,t))}}}i==__.c.StiRtfExportMode.Table&&this.getFontNumber3(this.fontList,"Arial");for(let t=0;t<65536;t++)0!=this.unicodeMapArray[t]&&(this.codePageToFont[__.c.StiEncode.unicodeToCodePageArray[t]]=1);this.codePageToFont[1]=1;for(let t=1;t<__.c.StiEncode.codePagesTableSize+1;t++)0!=this.codePageToFont[t]&&(this.codePageToFont[t]=this.charsetCount,this.fontToCodePages[this.charsetCount]=t-1,this.charsetCount++);this.codePageToFont[0]=this.codePageToFont[1];for(let e=0;e<this.styleList.length;e++){let t=this.styleList[e];t.fontNumber=t.fontNumber*this.charsetCount,this.styleList[e]=t}if(this.renderStartDoc(),this.currentPassNumber++,i==__.c.StiRtfExportMode.Table){this.sw.writeLine("\\nolead"),this.sw.writeLine("\\afs16");let i=p,l=(p=null,!1),n=0;while(n<i.length){(p=new StiPagesCollection(m,m.renderedPages)).cacheMode=m.renderedPages.cacheMode,p.addV2Internal(i.getPageWithoutCache(n));let t=i.getPageWithoutCache(n).excelSheetValue;while(n<i.length-1&&this.compareExcellSheetNames(i.getPageWithoutCache(n+1).excelSheetValue,t)&&i.getPageWithoutCache(n+1).orientation==i.getPageWithoutCache(n).orientation)n++,p.addV2Internal(i.getPageWithoutCache(n));let e=p.getByIndex(0);if(null!=e){p.getPage(e),Stimulsoft.StiOptions.Export.RichText.useNewPageCommandInsteadOfNewSection&&0!=n||this.renderPageHeader(e);let r=Stimulsoft.StiOptions.Export.RichText.divideBigCells&&!Stimulsoft.StiOptions.Export.RichText.useCanBreakProperty;if(this.usePageHeadersAndFooters){let i=new StiPagesCollection(m,m.renderedPages);if(i.cacheMode=m.renderedPages.cacheMode,i.addV2Internal(p.getByIndex(0)),this.matrix=new __.c.StiMatrix(i,r,this),this.isStopped)return;this.matrix.scanComponentsPlacement(!1,!0);let a=!1,o,s;s=Math.max(this.matrix.coordY.countItems-1-1,0);while(this.matrix.linePlacement[s]!=__.c.StiTableLineInfo.PageHeader&&0<s)s--;if(this.matrix.linePlacement[s]==__.c.StiTableLineInfo.PageHeader){o=0;while(this.matrix.linePlacement[o]!=__.c.StiTableLineInfo.PageHeader)o++;this.sw.writeLine("{"),this.sw.writeLine("{\\header "),this.writeFromMatrix(o,s,!0),this.sw.writeLine("}"),l=!0}else{let e=!1;if(1<p.length&&null!=p.getByIndex(1)){let t=this.matrix;if((i=new StiPagesCollection(m,m.renderedPages)).cacheMode=m.renderedPages.cacheMode,i.addV2Internal(p.getByIndex(1)),this.matrix=new __.c.StiMatrix(i,r,this),this.isStopped)return;this.matrix.scanComponentsPlacement(!1,!0),s=Math.max(this.matrix.coordY.countItems-1-1,0);while(this.matrix.linePlacement[s]!=__.c.StiTableLineInfo.PageHeader&&0<s)s--;if(this.matrix.linePlacement[s]==__.c.StiTableLineInfo.PageHeader){o=0;while(this.matrix.linePlacement[o]!=__.c.StiTableLineInfo.PageHeader)o++;let r=StiPrintOnType.AllPages,n=!1;for(let i=o;i<s;i++){for(let e=0;e<this.matrix.coordX.countItems-1;e++){let t=this.matrix.cells[i][e];if(null!=t&&null!=t.component){r=t.component.printOn,n=!0;break}}if(n)break}(n=n&&r==StiPrintOnType.ExceptFirstAndLastPage||r==StiPrintOnType.ExceptFirstPage)&&(this.sw.writeLine("\\titlepg "),a=!0),this.sw.writeLine("{"),this.sw.writeLine("{\\header "),this.writeFromMatrix(o,s,!0),this.sw.writeLine("}"),l=!0,e=!0}else this.sw.writeLine("{");this.matrix=t}else this.sw.writeLine("{");!e&&l&&this.sw.writeLine("{\\header \\fs2 }")}o=0;while(this.matrix.linePlacement[o]!=__.c.StiTableLineInfo.PageFooter&&o<this.matrix.coordY.countItems-1-1)o++;if(this.matrix.linePlacement[o]==__.c.StiTableLineInfo.PageFooter){s=this.matrix.coordY.countItems-1-1;while(this.matrix.linePlacement[s]!=__.c.StiTableLineInfo.PageFooter)s--;a&&(this.sw.writeLine("{\\footerf "),this.writeFromMatrix(o,s,!0),this.sw.writeLine("}")),this.sw.writeLine("{\\footer "),this.writeFromMatrix(o,s,!0),this.sw.writeLine("}"),l=!0}else l&&this.sw.writeLine("{\\footer \\fs2 }");this.matrix=new __.c.StiMatrix(p,r,this),this.matrix.scanComponentsPlacement(!0,!0),s=this.matrix.coordY.countItems-1-1,this.currentPassNumber=Stimulsoft.StiOptions.Export.RichText.divideSegmentPages?4:3,this.writeFromMatrix(0,s,!1)}else{if(this.matrix=new __.c.StiMatrix(p,r,this),this.isStopped)return;this.sw.writeLine("{"),this.currentPassNumber=Stimulsoft.StiOptions.Export.RichText.divideSegmentPages?4:3,this.writeFromMatrix(0,this.matrix.coordY.countItems-1-1,!0)}this.sw.writeLine("\\pard\\fs2 \\par"),this.sw.writeLine("}")}n<i.length-1&&this.renderPageFooter(),n++}}else{this.sw.writeLine("\\nolead");for(let h of p.list){if(p.getPage(h),this.invokeExporting(h,p,this.currentPassNumber,this.maximumPassNumber),this.isStopped)return;this.renderPageHeader(h),this.sw.writeLine("{");let e=Math.round(this.pageHeight/(c/S))+2,l=[];for(let t=0;t<e;t++)l.push(new Hashtable);let m=new Hashtable;for(let s of h.components.list)if(s.enabled){let t=h.unit.convertToHInches(s.left),e=h.unit.convertToHInches(s.top),i=h.unit.convertToHInches(s.right),r=h.unit.convertToHInches(s.bottom),n=new Lc;n.x=Math.round(t*this.hiToTwips*g),n.y=Math.round(e*this.hiToTwips*S),n.width=Math.round(i*this.hiToTwips*g)-n.x,n.height=Math.round(r*this.hiToTwips*S)-n.y,n.component=s,n.x++,n.y++;while(1){let t=StiString.format("{0}:{1}:{2}:{3}",n.x,n.y,n.width,n.height);if(!m.contains(t)){m.set(t,t);break}n.width++}let a=n.x,o=Math.round(e/(c/S));o<0&&(o=0);while(o>l.length-1)l.push(new Hashtable);while(-1!=l[o].indexOfKey(a))a++;l[o].add(a,n)}switch(i){case __.c.StiRtfExportMode.Frame:this.sw.writeLine("\\nowidctlpar\\phmrg\\pvmrg\\nowrap");for(let s=0;s<l.length;s++)if(0<l[s].count){this.sw.write("\\pard");for(let o=0;o<l[s].count;o++){let t=l[s].getByIndex(o),e=t.component;if(0==e.width||0==e.height)continue;if(e.is(StiLinePrimitive))continue;let i=0,r=0,n=e.as(IStiBorder),a=(null==n||e.is(IStiIgnoreBorderWhenExport)||(0<(n.border.side&StiBorderSides.Left)&&(i+=this.frameCorrectValue,r+=this.frameCorrectValue),0<(n.border.side&StiBorderSides.Right)&&(r+=this.frameCorrectValue)),this.sw.flush(),this.sw.baseStream.position);this.sw.write("{"),this.sw.write(StiString.format("\\nowrap\\posx{0}\\posy{1}\\absw{2}\\absh{3}",t.x+i,t.y,t.width-r,t.height)),this.renderTextAngle1(e),this.renderBorder1(e),this.renderBrush1(e),this.renderStyle12(e),this.renderHorAlign12(e),this.renderTextBrush12(e),this.renderTextFont12(e),e.is(StiText)&&this.renderText12(e),e.is(StiRichText)?this.renderRtf12(e,a):e.is(StiShape)?this.renderShape1(t,i,r):this.renderImage12(e,t.width-r,t.height),this.sw.writeLine(" \\par}")}}for(let a=0;a<l.length;a++)if(0<l[a].count){this.sw.write("\\pard");for(let n=0;n<l[a].count;n++){let t=l[a].getByIndex(n),e=t.component;if(0==e.width||0==e.height)continue;if(!e.is(StiLinePrimitive))continue;let i=0,r=e.as(IStiBorder);null==r||e.is(IStiIgnoreBorderWhenExport)||0<(r.border.side&StiBorderSides.Left)&&(i+=this.frameCorrectValue),this.sw.write("{"),this.sw.write(StiString.format("\\nowrap\\posx{0}\\posy{1}\\absw{2}\\absh{3}",t.x+i,t.y,t.width,t.height)),this.renderBorder1(e),this.sw.writeLine("\\fs0\\par}")}}break;case __.c.StiRtfExportMode.WinWord:for(let n=0;n<l.length;n++)if(0<l[n].count)for(let r=0;r<l[n].count;r++){let t=l[n].getByIndex(r),e=t.component,i=e.as(StiShape);e.is(StiShape)&&null!=i&&1==this.checkShape2(i)?this.renderShape2(t):(this.sw.write("{\\shp{\\*"),this.sw.write(StiString.format("\\shpinst\\shpleft{0}\\shptop{1}\\shpright{2}\\shpbottom{3}",t.x,t.y,t.x+t.width,t.y+t.height)),this.sw.write("\\shpwr3"),this.sw.write("{\\sp{\\sn dxTextLeft}{\\sv 0}}"),this.sw.write("{\\sp{\\sn dyTextTop}{\\sv 0}}"),this.sw.write("{\\sp{\\sn dxTextRight}{\\sv 0}}"),this.sw.write("{\\sp{\\sn dyTextBottom}{\\sv 0}}"),this.renderBrush2(e),this.sw.write("{\\sp{\\sn fLine}{\\sv 0}}"),this.sw.write("{\\shptxt\\trowd\\trqc"),this.sw.write(StiString.format("\\trrh-{0}",t.height)),this.renderVerAlign2(e),this.renderBorder2(e),this.renderTextAngle2(e),this.sw.write(StiString.format("\\cellx{0}\\intbl",t.width)),this.renderHorAlign12(e),this.renderTextBrush12(e),this.renderTextFont12(e),e.is(StiRichText)||this.renderText12(e),e.is(StiRichText)?this.renderRtf12(e):this.renderImage12(e,t.width,t.height),this.sw.writeLine("\\cell\\row\\pard\\par}}}"))}break;case __.c.StiRtfExportMode.TabbedText:for(let s=0;s<l.length;s++){if(0<l[s].count&&this.sw.write("\\pard{"),0<l[s].count){let a="",o="";for(let n=0;n<l[s].count;n++){let t=l[s].getByIndex(n),e=t.component,i=t.x,r=e.as(IStiTextHorAlignment);null!=r&&(0<(r.horAlignment&StiTextHorAlignment.Center)&&(i=t.x+Math.round(t.width/2)-1,a+="\\tqc"),0<(r.horAlignment&StiTextHorAlignment.Right))&&(i=t.x+t.width-28,a+="\\tqr"),a=(a+="\\tx")+i,o+="\\tab",this.renderBorder3(e,o),this.renderBrush3(e,o),this.renderTextFont3(e,o),this.renderTextBrush3(e,o),e.is(StiRichText)||this.renderText3(e,o),e.is(StiRichText)?this.renderRtf3(e,o):this.renderImage3(e,o,t.width,t.height)}this.sw.write(a);let e=[];for(let t=0;t<o.length;t++)e[t]=o.charCodeAt(t);this.sw.flush(),this.sw2.write(e,0,e.length)}0<l[s].count&&this.sw.writeLine("\\par}")}break}this.sw.writeLine("}"),h!=p.getByIndex(p.length-1)&&this.renderPageFooter()}}this.renderEndDoc(),this.sw.flush(),null!=this.matrix&&(this.matrix.clear(),this.matrix=null),this.colorList=null,this.fontList=null,this.styleList=null,this.unicodeMapArray=null,this.codePageToFont=null,this.fontToCodePages=null,this.imageCodec=null,this.bookmarkList=null,this.usedBookmarks=null,m.renderedPages.cacheMode&&__.c.StiMatrix.GCCollect()}}__.c.StiRtfExportService=Nc}let StiTxtBorderType=__.c.StiTxtBorderType,StringBuilder=Stimulsoft.System.Text.StringBuilder;{class e7 extends __.c.StiExportService{constructor(){super(...arguments),this.multipleFiles=!1,this.borderCodes=[6,9,12,10,5,3,13,11,14,7,15,1,2,4,8],this.firstEscapeCodeIndex=63742,this.ltrMark=" 0E",this.useFullVerticalBorder=!0,this.useFullHorizontalBorder=!0}implements(){let t=[__.c.IStiTxtExportService];return(this.implements=()=>t)()}get defaultExtension(){return"txt"}exportTo(t,e,i){this.exportTxt(t,e,i)}get exportFormat(){return __.a.StiExportFormat.Text}get groupCategory(){return"Word"}get position(){return __.c.StiExportPosition.Txt}get exportNameInMenu(){return StiLocalization.get("Export","ExportTypeTxtFile")}getFilter(){return StiLocalization.get("FileFilters","TxtFiles")}getBorderChar(t,e){if(this.useFullVerticalBorder)switch(e){case StiTxtBorderType.UnicodeSingle:return"─│┌┐└┘├┤┬┴┼ ─ ".charCodeAt(t);case StiTxtBorderType.UnicodeDouble:return"═║╔╗╚╝╠╣╦╩╬ ═ ".charCodeAt(t);default:return"-|+++++++++ - ".charCodeAt(t)}else switch(e){case StiTxtBorderType.UnicodeSingle:return"─│┌┐└┘├┤┬┴┼ ".charCodeAt(t);case StiTxtBorderType.UnicodeDouble:return"═║╔╗╚╝╠╣╦╩╬ ".charCodeAt(t);default:return"-|+++++++++ ".charCodeAt(t)}}lineFill(e,t,i,r){let n=this.borderCodes[t-1];for(let t=0;t<r;t++)-1==this.borderCodes.indexOf(e[i+t])?32==e[i+t]&&(e[i+t]=n):e[i+t]|=n}lineFillChar(e,i,r,n){for(let t=0;t<n;t++)e[r+t]=i}checkWordWrap(t,e,i,r){let a=e.ref;if(this.useEscapeCodes)for(let t=0;t<a.length;t++){let e=a[t],r=new StringBuilder(e);if(__.c.StiBidirectionalConvert.stringContainArabicOrHebrew(e)){let t=e.length;while(Char.isWhitespace(e,t-1))t--;r.insert(t,"<#ltrMark>")}let n=0;while(n<r.length){if("<"==r.charAt(n)&&n<r.length+1&&"#"==r.charAt(n+1)){let t=n,e=new StringBuilder;while("<"==r.charAt(t)&&t<r.length+1&&"#"==r.charAt(t+1)){while(t<r.length&&">"!=r.charAt(t))e.append(r.charAt(t)),t++;if(e.append(">"),++t>r.length-1)break}t>r.length-1?0<n?(n--,e.insert(0,r[n])):e.append(String.fromCharCode(65535)):(e.append(r.charAt(t)),t++);let i=this.getEscapeNumber(this.escapeCodesList,e.toString());r.remove(n,t-n),r.insert(n,String.fromCharCode(this.firstEscapeCodeIndex-i))}n++}r.length!=a[t].length&&(a[t]=r.toString())}else for(let n=0;n<a.length;n++)if(__.c.StiBidirectionalConvert.stringContainArabicOrHebrew(a[n])){let t=a[n],e=t.length-1;while(Char.isWhitespace(t,e))e--;let i=t.charAt(e)+this.ltrMark,r=this.getEscapeNumber(this.escapeCodesList,i);e==t.length-1?a[n]=t.substring(0,e)+String.fromCharCode(this.firstEscapeCodeIndex-r):a[n]=t.substring(0,e)+String.fromCharCode(this.firstEscapeCodeIndex-r)+t.substring(e+1)}let l=i,n=(this.useFullVerticalBorder?this.needVerticalBorders[t.left+t.width]&&l--:!this.useFullTextBoxWidth&&1<l&&l--,!1),o=t.component[Stimulsoft.System.StiObject.stimulsoft]().as(IStiTextOptions);if(n=null!=o?o.textOptions.wordWrap:n){let s=a.slice();for(let o=0;o<s.length;o++){let a=s[o];if(a.length>l-1&&1<l){let e=StiArray.create(Number,a.length),i=0,r=0;while(" "==a.charAt(r))e[r]=i,r++;for(let t=r;t<a.length;t++)" "==a.charAt(t)&&i++,e[t]=i;let t=l-1-1,n=t;if(0<e[t])if(e[t]!=e[t+1]){n=t++;while(" "==a.charAt(t))t++}else{while(" "!=a.charAt(t))t--;n=t++;while(" "==a.charAt(n))n--}else t++;s[o]=a.substring(0,n+1),s[Stimulsoft.System.StiObject.stimulsoft]().insert(o+1,a.substr(t,a.length-t))}}s.length>a.length&&(a=s)}if(r)for(let t=0;t<a.length;t++)a[t].length>l&&(a[t]=a[t].substring(0,l));e.ref=a}checkGrow(t,e,i){while(t.length<=i)t.push([]),e.push(!1)}addCharsToLine(e,i,r,n){for(let t=0;t<r;t++)e[i].push(n)}getStyleNumber(i,r){if(0<i.length)for(let e=0;e<i.length;e++){let t=i[e];if(t.Bold==r.Bold&&t.Italic==r.Italic&&t.Underline==r.Underline&&t.Codes==r.Codes)return e}i.push(r);let t=i.length-1;return t}getEscapeNumber(e,i){if(0<e.length)for(let t=0;t<e.length;t++)if(e[t]==i)return t+1;e.push(i);let t=e.length;return t}getEscapeNames(t,e){let i=this.styleList[t],r=this.styleList[e],n=new StringBuilder;return!i.Bold&&r.Bold&&n.append("<#b>"),i.Bold&&!r.Bold&&n.append("<#/b>"),!i.Italic&&r.Italic&&n.append("<#i>"),i.Italic&&!r.Italic&&n.append("<#/i>"),!i.Underline&&r.Underline&&n.append("<#u>"),i.Underline&&!r.Underline&&n.append("<#/u>"),n}exportTxt(t,e,i){if(null==Stimulsoft.Base[["St","iL","ic","en","se"].join("")].key&&console.warn("You are using a trial version of the Stimulsoft product!"),__.a.StiLogService.write(this[Stimulsoft.System.StiObject.stimulsoft]().getType(),"Export report to Text format"),this.report=t,null==i)throw new Error("The 'settings' argument cannot be equal in null.");let r=i.pageRange,n=i.encoding,a=i.drawBorder,o=i.borderType,s=i.killSpaceLines,l=i.killSpaceGraphLines,m=i.putFeedPageCode,u=i.cutLongLines,h=i.zoomX,c=i.zoomY,g=(this.useEscapeCodes=i.useEscapeCodes,this.useFullTextBoxWidth=Stimulsoft.StiOptions.Export.Text.useFullTextBoxWidth,this.useFullVerticalBorder=Stimulsoft.StiOptions.Export.Text.useFullVerticalBorder,this.useFullHorizontalBorder=Stimulsoft.StiOptions.Export.Text.useFullHorizontalBorder,9.7),S=18,p=(0==s&&(l=!1),0==a&&(l=!1),this.useFullVerticalBorder&&(this.useFullTextBoxWidth=!1),new MemoryStream),d=null!=n?new StreamWriter(p,n):new StreamWriter(p),w=r.getSelectedPages(t.renderedPages),f=0,b=(this.styleList=[],new f7),E=(this.getStyleNumber(this.styleList,b),this.escapeCodesList=[],this.currentPassNumber=0,this.maximumPassNumber=3,new __.c.StiMatrix(w,!1,this));if(this.isStopped)return;this.needVerticalBorders=StiArray.create(Boolean,E.coordX.countItems);for(let i=1;i<E.coordX.countItems;i++){let e=!1;for(let t=1;t<E.coordY.countItems;t++)if(null!=E.bordersY[t-1][i]){e=!0;break}this.needVerticalBorders[i-1]=e}this.needHorizontalBorders=StiArray.create(Boolean,E.coordY.countItems);for(let i=1;i<E.coordY.countItems;i++){let e=!1;for(let t=1;t<E.coordX.countItems;t++)if(null!=E.bordersX[i][t-1]){e=!0;break}this.needHorizontalBorders[i-1]=e}let y=StiArray.create(Number,E.coordX.countItems);for(let i=1;i<E.coordX.countItems;i++){let t=E.coordX.getByIndex(i),e=E.coordX.getByIndex(i-1);y[i-1]=Math.round((t-e)/(g/h)),this.useFullVerticalBorder&&this.needVerticalBorders[i-1]&&y[i-1]++}let v=StiArray.create2(Boolean,E.coordY.countItems,E.coordX.countItems),x=StiArray.create2(Number,E.coordY.countItems,E.coordX.countItems),A=StiArray.create2(Number,E.coordY.countItems,E.coordX.countItems);for(let o=1;o<E.coordY.countItems;o++)for(let a=1;a<E.coordX.countItems;a++)if(!v[o-1][a-1]){let n=E.cells[o-1][a-1];if(x[o-1][a-1]=y[a-1],null!=n){if(0<n.width)for(let t=0;t<n.width;t++)x[o-1][a-1]+=y[a-1+1+t];if(null!=n.component){if(null!=n.component){let e=n.component.tagValue;if(!StiString.isNullOrWhiteSpace(e)){e=e.trim();let t=parseInt(e);!isNaN(t)&&0<t&&(x[o-1][a-1]=t,this.useFullVerticalBorder)&&this.needVerticalBorders[a-1+n.width]&&x[o-1][a-1]++}}let r=n.text,i=n.component[Stimulsoft.System.StiObject.stimulsoft]().as(StiCheckBox);if(null!=i&&null!=i.checkedValue){let t=!1,e=!1;"boolean"==typeof i.checkedValue&&(i.checkedValue?t=!0:e=!0),"string"==typeof i.checkedValue&&("True"==i.checkedValue?t=!0:e=!0),t&&(r=Stimulsoft.StiOptions.Export.Text.checkBoxTextForTrue),e&&(r=Stimulsoft.StiOptions.Export.Text.checkBoxTextForFalse)}if(!n.component.isExportAsImage(__.a.StiExportFormat.Text)&&!StiString.isNullOrEmpty(r)){if(n.component.is(StiText)&&n.component.checkAllowHtmlTags()){let t=new StiHtmlState(""),e=StiTextRenderer.parseHtmlToStates(r,t),i=new StringBuilder;for(let t of e)i.append(StiTextRenderer.prepareStateText(t.text));r=i.toString()}let t=__.c.StiExportUtils.splitString(r[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("\r",""),!1),e={ref:t},i=(this.checkWordWrap(n,e,x[o-1][a-1],u),(t=e.ref).length);A[o-1][a-1]=i}}for(let e=0;e<=n.height;e++){for(let t=0;t<=n.width;t++)v[o-1+e][a-1+t]=!0;x[o-1+e][a-1]=x[o-1][a-1]}}}let T=StiArray.create(Number,E.coordY.countItems);for(let r=f=1;r<E.coordY.countItems;r++){let t=E.coordY.getByIndex(r),e=E.coordY.getByIndex(r-1),i=Math.round((t-e)/(S/c));i<1&&(i=1);for(let e=1;e<E.coordX.countItems;e++){let t=E.cells[r-1][e-1];null!=t&&t.height<1&&A[r-1][e-1]>i&&(i=A[r-1][e-1])}this.useFullHorizontalBorder&&this.needHorizontalBorders[r-1]&&i++,T[r-1]=i,f+=i}f++;let F=[],C=[],P=[];for(let t=0;t<f;t++)F.push([]),C.push([]),P.push(!1);v=StiArray.create2(Boolean,E.coordY.countItems,E.coordX.countItems);let L=a?1:0,k=new StiText;k.vertAlignment=StiVertAlignment.Center,k.horAlignment=StiTextHorAlignment.Center,this.currentPassNumber=2;for(let d=1;d<E.coordY.countItems;d++){this.invokeExporting2(d,E.coordY.countItems,this.currentPassNumber,this.maximumPassNumber);for(let t=0;t<E.horizontalPageBreaks.length;t++)E.horizontalPageBreaks[t]==d-1&&(P[L-(a&&1<d&&this.needHorizontalBorders[d-1-1]?1:0)]=!0);let p=a?1:0;for(let S=1;S<E.coordX.countItems;S++){let h=E.cells[d-1][S-1],c=x[d-1][S-1],g=T[d-1];if(!v[d-1][S-1]){let o=0,s=0,i=0;if(null!=h){o=h.width,s=h.height;for(let e=0;e<=h.width;e++)for(let t=0;t<=h.height;t++)v[d-1+t][S-1+e]=!0;if(0<h.height)for(let t=0;t<h.height;t++)g+=T[d-1+1+t];if(this.useFullHorizontalBorder&&this.needHorizontalBorders[d-1+s]&&g--,null!=h.component){let e=h.component[Stimulsoft.System.StiObject.stimulsoft]().as(StiText);if(null!=e){let t=new f7;t.Bold=e.font.bold,t.Italic=e.font.italic,t.Underline=e.font.underline,t.Codes=null,i=this.getStyleNumber(this.styleList,t)}let r=h.text,m=h.component[Stimulsoft.System.StiObject.stimulsoft]().as(StiCheckBox);if(null!=m&&null!=m.checkedValue){let t=!1,e=!1;"boolean"==typeof m.checkedValue&&(m.checkedValue?t=!0:e=!0),"string"==typeof m.checkedValue&&("True"==m.checkedValue?t=!0:e=!0),t&&(r=Stimulsoft.StiOptions.Export.Text.checkBoxTextForTrue),e&&(r=Stimulsoft.StiOptions.Export.Text.checkBoxTextForFalse)}if(!h.component.isExportAsImage(__.a.StiExportFormat.Text)&&!StiString.isNullOrEmpty(r)){if(h.component.is(StiText)&&h.component.checkAllowHtmlTags()){let t=new StiHtmlState(""),e=StiTextRenderer.parseHtmlToStates(r,t),i=new StringBuilder;for(let t of e)i.append(StiTextRenderer.prepareStateText(t.text));r=i.toString()}let s=__.c.StiExportUtils.splitString(r[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("\r",""),!1),t={ref:s},l=(this.checkWordWrap(h,t,x[d-1][S-1],u),s=t.ref,0),e=h.component[Stimulsoft.System.StiObject.stimulsoft]().as(IStiVertAlignment);null!=(e=null!=m?k:e)&&s.length<g&&(0<(e.vertAlignment&StiVertAlignment.Center)&&(l=StiMath.trunc((g-s.length)/2)),0<(e.vertAlignment&StiVertAlignment.Bottom))&&(l=g-s.length);for(let o=0;o<s.length;o++){let t=0,e=c,i=(this.useFullVerticalBorder?this.needVerticalBorders[h.left+h.width]&&e--:!this.useFullTextBoxWidth&&1<e&&e--,h.component[Stimulsoft.System.StiObject.stimulsoft]().as(IStiTextHorAlignment)),r=(null!=(i=null!=m?k:i)&&(i.horAlignment==StiTextHorAlignment.Center&&(t=StiMath.trunc((e-s[o].length)/2)),i.horAlignment==StiTextHorAlignment.Right)&&(t=e-s[o].length),p+t),n=L+l+o,a=(r=r<0?0:r)+s[o].length;this.checkGrow(F,P,n),F[n].length<a&&this.addCharsToLine(F,n,a-F[n].length,32);for(let e=0;e<s[o].length;e++){let t=s[o].charCodeAt(e);t<32&&(t+=65280),F[n][r+e]=t}}}}}else this.useFullHorizontalBorder&&this.needHorizontalBorders[d-1]&&g--;this.useFullHorizontalBorder||g--;for(let e=0;e<g;e++){C[L+e].length<p+c&&this.addCharsToLine(C,L+e,p+c-C[L+e].length,0);let t=c;this.useFullVerticalBorder?null!=h&&this.needVerticalBorders[h.left+h.width]&&t--:!this.useFullTextBoxWidth&&1<t&&t--,this.lineFillChar(C[L+e],i,p,t)}if(a){let e=p+c-1;for(let t=-1;t<=g;t++)this.checkGrow(F,P,L+t),F[L+t].length<e+1&&this.addCharsToLine(F,L+t,e+1-F[L+t].length,32);let i=!0,r=!0;for(let t=0;t<s+1;t++)null==E.bordersY[d-1+t][S-1]&&(i=!1),null==E.bordersY[d-1+t][S-1+o+1]&&(r=!1);let n=!0,a=!0;for(let t=0;t<o+1;t++)null==E.bordersX[d-1][S-1+t]&&(n=!1),null==E.bordersX[d-1+s+1][S-1+t]&&(a=!1);if(n&&(this.lineFill(F[L-1],14,p-1,1),this.lineFill(F[L-1],1,p,c-1),this.lineFill(F[L-1],13,p+c-1,1)),i){this.lineFill(F[L-1],15,p-1,1);for(let t=0;t<g;t++)this.lineFill(F[L+t],2,p-1,1);this.lineFill(F[L+g],12,p-1,1)}if(r){this.lineFill(F[L-1],15,p+c-1,1);for(let t=0;t<g;t++)this.lineFill(F[L+t],2,p+c-1,1);this.lineFill(F[L+g],12,p+c-1,1)}a&&(this.lineFill(F[L+g],14,p-1,1),this.lineFill(F[L+g],1,p,c-1),this.lineFill(F[L+g],13,p+c-1,1))}}p+=c}L+=T[d-1]}if(a){let e=!0;for(let t=0;t<F.length;t++)if(0<F[t].length&&32!=F[t][0]){e=!1;break}if(e)for(let t=0;t<F.length;t++)0<F[t].length&&F[t][Stimulsoft.System.StiObject.stimulsoft]().removeRange(0,1),0<C[t].length&&C[t][Stimulsoft.System.StiObject.stimulsoft]().removeRange(0,1)}if(!(Stimulsoft.Base.FslAA.wtLiI.aYwiY()||Stimulsoft.Base.FslAA.wtLiI.dSiYV()||(Stimulsoft.Base.FslAA.wtLiI.DKlzG()||Stimulsoft.Base.FslAA.wtLiI.hatRb()||Stimulsoft.Base.FslAA.wtLiI.kqAKB())&&Stimulsoft.System.NodeJs.isStandaloneVersion)){let t=(E.coordX.getByIndex(E.coordX.countItems-1)-E.coordX.getByIndex(0))/(g/h),e=Math.max(1,StiMath.trunc(t/2-10));d.writeLine(StiString.fill(" ",e)+"---=== TRIAL ===---\r\n")}let B=F.length-1;while(0<B&&0==F[B].length)B--;let I=0;for(let n=0;n<F.length;n++){if(0<F[n].length){for(let t=0;t<this.borderCodes.length;t++){let e=this.borderCodes[t],i=this.getBorderChar(t,o);for(let t=0;t<F[n].length;t++)F[n][t]==e&&(F[n][t]=i)}if(Stimulsoft.StiOptions.Export.Text.trimTrailingSpaces,l){let i=this.getBorderChar(1,o),r=!0;for(let e=0;e<F[n].length;e++){let t=F[n][e];t!=i&&32!=t&&(r=!1)}r&&(F[n]=[])}m&&P[n]&&(this.useEscapeCodes&&d.write(this.getEscapeNames(I,0).toString()),I=0,d.write("\f")),this.useEscapeCodes}let r=F[n];if(!s&&n<=B||0<r.length){let t=r.length;if(Stimulsoft.StiOptions.Export.Text.trimTrailingSpaces)while(0<t&&32==r[t-1])t--;let i="";for(let e=0;e<t;e++){let t=r[e];65280<=t&&(t-=65280),i+=String.fromCharCode(t)}Stimulsoft.StiOptions.Export.Text.removeLastNewLineMarker&&n==B?d.write(i):d.writeLine(i)}}let D=new StringBuilder;this.useEscapeCodes&&D.append(this.getEscapeNames(I,0)),m&&D.append("\f"),0<D.length&&d.write(D.toString()),d.flush(),this.useEscapeCodes,p.writeTo(e),p.close(),this.needVerticalBorders=null,this.needHorizontalBorders=null,this.styleList=null,this.escapeCodesList=null}}__.c.StiTxtExportService=e7;class f7{}}let StiRectanglePrimitive=__.a.Components.StiRectanglePrimitive,UnicodeCategory=Stimulsoft.System.Globalization.UnicodeCategory,StiTextOptions=Stimulsoft.Base.Drawing.StiTextOptions,RectangleD=Stimulsoft.Base.Drawing.RectangleD,StiTextDrawing=Stimulsoft.Base.Drawing.StiTextDrawing,StiGradientBrush=Stimulsoft.Base.Drawing.StiGradientBrush,StiContainer=__.a.Components.StiContainer;{class Yj{get right(){return this.x+this.width}get bottom(){return this.y+this.height}}class Zj extends __.c.StiExportService{constructor(){super(...arguments),this.defaultExtension="xps",this.groupCategory="Document",this.position=__.c.StiExportPosition.Xps,this.exportNameInMenu=StiLocalization.get("Export","ExportTypeXpsFile"),this.multipleFiles=!1,this.hiToDpi=96/100,this.xmlIndentation=1,this.precision_digits=3,this.reduceFontSize=!0,this.useImageComparer=!0,this.imageQuality=.75,this.imageResolution=96,this.fontCorrectValue=1.333333*this.hiToDpi,this.exportRtfTextAsImage=!0}get exportFormat(){return __.a.StiExportFormat.Xps}exportTo(t,e,i){this.exportXps(t,e,i),this.invokeExporting2(100,100,1,1)}exportToAsync(e,i,t,r){setTimeout(async()=>{try{await __.c.StiExportImageHelper.convertAllImages(i,Stimulsoft.System.Drawing.Imaging.ImageFormat.Jpeg,!1,this.exportFormat),this.exportTo(i,t,r),null!=i&&null!=i.preparedExportImages&&(i.preparedExportImages.clear(),i.preparedExportImages=null)}catch(t){if(Exception.log(t,i,`Export Error`).isImportant)return e(Exception.getMessage(t))}e()},0)}getFilter(){return StiLocalization.get("FileFilters","XpsFiles")}isWordWrapSymbol(t,e){let i=" ";return e<t.length-1&&(i=t[e+1]),this.isWordWrapSymbol2(t[e],i)}isWordWrapSymbol2(t,e){let i=Char.getUnicodeCategory(t),r=Char.getUnicodeCategory(e);return i==UnicodeCategory.OpenPunctuation||i==UnicodeCategory.ClosePunctuation&&r!=UnicodeCategory.OtherPunctuation||i==UnicodeCategory.DashPunctuation||i==UnicodeCategory.InitialQuotePunctuation||i==UnicodeCategory.FinalQuotePunctuation||i==UnicodeCategory.SpaceSeparator}floatToString(t){let e=this.precision_digits,i=(Math.abs(t)<1&&(e=this.precision_digits+2),StiMath.round2(t,e));return Stimulsoft.System.Internals.formatNumber(i,"G")}prepareData(){this.pdfFont=new __.c.PdfFonts,this.pdfFont.standardPdfFonts=!1,this.pdfFont.maxSymbols=32767,this.pdfFont.fontList=[],this.imageCache=new __.a.StiImageCache(this.useImageComparer,!0,ImageFormat.Jpeg,this.imageQuality)}getTabsSize(t,e,i){if(null==t||null==t.textOptions)return 0;let r=i,n=750/e,a=n*t.textOptions.distanceBetweenTabs,o=n*t.textOptions.firstTabOffset+a;if(i<o)r=o;else if(0<t.textOptions.distanceBetweenTabs){let t=Math.trunc((i-o)/a);t++,r=o+t*a}return r-i}static convertToEscapeSequence(i){let r=""+String.fromCharCode(13)+String.fromCharCode(10)+String.fromCharCode(8)+String.fromCharCode(12),n="rnbf",a,o;if(null==i)return"";o="";for(let e=0;e<i.length;e++){a=!1;for(let t=0;t<r.length;t++)if(i[e]==r[t]){o+="\\"+n[t],a=!0;break}a||(o+=i[e])}return o}getLineStyleDash(t){switch(t){case StiPenStyle.Dot:return"1.1 1.1";case StiPenStyle.Dash:return"3 1";case StiPenStyle.DashDot:return"3 1 1 1";case StiPenStyle.DashDotDot:return"3 1 1 1 1 1";default:return""}}checkGraphicsForTextRenderer(){}writeContentTypes(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);return e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),e.writeStartElement("Types"),e.writeAttributeString("xmlns","http://schemas.openxmlformats.org/package/2006/content-types"),e.writeStartElement("Default"),e.writeAttributeString("Extension","jpg"),e.writeAttributeString("ContentType","image/jpeg"),e.writeEndElement(),e.writeStartElement("Default"),e.writeAttributeString("Extension","png"),e.writeAttributeString("ContentType","image/png"),e.writeEndElement(),e.writeStartElement("Default"),e.writeAttributeString("Extension","rels"),e.writeAttributeString("ContentType","application/vnd.openxmlformats-package.relationships+xml"),e.writeEndElement(),e.writeStartElement("Default"),e.writeAttributeString("Extension","xml"),e.writeAttributeString("ContentType","application/xml"),e.writeEndElement(),e.writeStartElement("Default"),e.writeAttributeString("Extension","fdseq"),e.writeAttributeString("ContentType","application/vnd.ms-package.xps-fixeddocumentsequence+xml"),e.writeEndElement(),e.writeStartElement("Default"),e.writeAttributeString("Extension","fpage"),e.writeAttributeString("ContentType","application/vnd.ms-package.xps-fixedpage+xml"),e.writeEndElement(),e.writeStartElement("Default"),e.writeAttributeString("Extension","ttf"),e.writeAttributeString("ContentType","application/vnd.ms-opentype"),e.writeEndElement(),e.writeStartElement("Default"),e.writeAttributeString("Extension","fdoc"),e.writeAttributeString("ContentType","application/vnd.ms-package.xps-fixeddocument+xml"),e.writeEndElement(),e.writeStartElement("Override"),e.writeAttributeString("PartName","/docProps/core.xml"),e.writeAttributeString("ContentType","application/vnd.openxmlformats-package.core-properties+xml"),e.writeEndElement(),e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeMainRels(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);return e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),e.writeStartElement("Relationships"),e.writeAttributeString("xmlns","http://schemas.openxmlformats.org/package/2006/relationships"),e.writeStartElement("Relationship"),e.writeAttributeString("Id","rId1"),e.writeAttributeString("Type","http://schemas.microsoft.com/xps/2005/06/fixedrepresentation"),e.writeAttributeString("Target","FixedDocSeq.fdseq"),e.writeEndElement(),e.writeStartElement("Relationship"),e.writeAttributeString("Id","rId2"),e.writeAttributeString("Type","http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties"),e.writeAttributeString("Target","docProps/core.xml"),e.writeEndElement(),e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeDocPropsCore(t){let e=new MemoryStream,i=new XmlTextWriter(Encoding.UTF8,e),r=(i.indentation=this.xmlIndentation<0?0:this.xmlIndentation,i.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,i.writeStartDocument(),i.writeStartElement("cp:coreProperties"),i.writeAttributeString("xmlns:cp","http://schemas.openxmlformats.org/package/2006/metadata/core-properties"),i.writeAttributeString("xmlns:dc","http://purl.org/dc/elements/1.1/"),i.writeAttributeString("xmlns:dcterms","http://purl.org/dc/terms/"),i.writeAttributeString("xmlns:dcmitype","http://purl.org/dc/dcmitype/"),i.writeAttributeString("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance"),DateTime.now.toString("yyyy-MM-ddTHH:mm:ssZ"));return i.writeStartElement("dcterms:created"),i.writeAttributeString("xsi:type","dcterms:W3CDTF"),i.writeString(r),i.writeEndElement(),i.writeStartElement("dcterms:modified"),i.writeAttributeString("xsi:type","dcterms:W3CDTF"),i.writeString(r),i.writeEndElement(),StiString.isNullOrEmpty(t.reportName)||i.writeElementString("dc:title",t.reportName),StiString.isNullOrEmpty(t.reportAlias)||i.writeElementString("dc:subject",t.reportAlias),StiString.isNullOrEmpty(t.reportDescription)||i.writeElementString("dc:description",t.reportDescription),i.writeElementString("dc:creator",__.c.StiExportUtils.getReportVersion(t)),i.writeFullEndElement(),i.writeEndDocument(),i.flush(),e}writeFixedDocSeq(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.Unicode,t);return e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartElement("FixedDocumentSequence"),e.writeAttributeString("xmlns","http://schemas.microsoft.com/xps/2005/06"),e.writeStartElement("DocumentReference"),e.writeAttributeString("Source","/Documents/1/FixedDoc.fdoc"),e.writeEndElement(),e.writeFullEndElement(),e.flush(),t}writeFixedDoc(t){let e=new MemoryStream,r=new XmlTextWriter(Encoding.Unicode,e);r.indentation=this.xmlIndentation<0?0:this.xmlIndentation,r.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,r.writeStartElement("FixedDocument"),r.writeAttributeString("xmlns","http://schemas.microsoft.com/xps/2005/06");for(let i=0;i<t.length;i++){r.writeStartElement("PageContent"),r.writeAttributeString("Source",`Pages/${i+1}.fpage`);let e=[];for(let t of this.pageBookmarks.keys)this.pageBookmarks.get(t).value==i&&e.push(t);if(0<e.length){r.writeStartElement("PageContent.LinkTargets");for(let t of e)r.writeStartElement("LinkTarget"),r.writeAttributeString("Name",t),r.writeEndElement();r.writeFullEndElement()}r.writeFullEndElement()}return r.writeFullEndElement(),r.flush(),e}writePage(e,o){let t=new MemoryStream,s=new XmlTextWriter(Encoding.Unicode,t),r=(s.indentation=this.xmlIndentation<0?0:this.xmlIndentation,s.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,this.hiToDpi*o.unit.convertToHInches(e.pageHeight*e.segmentPerHeight)),n=this.hiToDpi*o.unit.convertToHInches(e.pageWidth*e.segmentPerWidth),l=this.hiToDpi*o.unit.convertToHInches(e.margins.left),i=this.hiToDpi*o.unit.convertToHInches(e.margins.right),m=this.hiToDpi*o.unit.convertToHInches(e.margins.top),a=this.hiToDpi*o.unit.convertToHInches(e.margins.bottom);if(s.writeStartElement("FixedPage"),s.writeAttributeString("xmlns","http://schemas.microsoft.com/xps/2005/06"),s.writeAttributeString("Width",this.floatToString(n)),s.writeAttributeString("Height",this.floatToString(r)),s.writeAttributeString("xml:lang","en-EN"),s.writeStartElement("Canvas"),this.writeHyperlinksData(s,e,!1),null!=e.brush){let t=new Yj;t.x=0,t.y=0,t.width=n,t.height=r,t.component=new StiContainer,t.component.brush=e.brush,t.component.border=null,this.writeBorderFill(s,t)}this.writeWatermark(s,e.watermark,!0,n,r);for(let a of e.components.list){let t=0<a.width&&0<a.height;if(a.enabled&&t){let t=this.hiToDpi*o.unit.convertToHInches(a.left),e=this.hiToDpi*o.unit.convertToHInches(a.top),i=this.hiToDpi*o.unit.convertToHInches(a.right),r=this.hiToDpi*o.unit.convertToHInches(a.bottom),n=new Yj;n.x=t,n.y=e,n.width=i-t,n.height=r-e,n.y+=m,n.x+=l,(n.component=a).is(StiShape)||this.writeBorderFill(s,n),a.is(StiText)&&!a.isExportAsImage(__.a.StiExportFormat.Xps)&&this.writeText(s,n),a.isExportAsImage(__.a.StiExportFormat.Xps)&&this.writeImage(s,n),this.writeBorderStroke(s,n)}}if(null!=e.border){let t=new Yj;t.x=l,t.y=m,t.width=n-l-i,t.height=r-m-a,t.component=new StiContainer,t.component.border=e.border,this.writeBorderStroke(s,t)}if(this.writeWatermark(s,e.watermark,!1,n,r),!(Stimulsoft.Base.FslAA.wtLiI.aYwiY()||Stimulsoft.Base.FslAA.wtLiI.dSiYV()||(Stimulsoft.Base.FslAA.wtLiI.DKlzG()||Stimulsoft.Base.FslAA.wtLiI.hatRb()||Stimulsoft.Base.FslAA.wtLiI.kqAKB())&&Stimulsoft.System.NodeJs.isStandaloneVersion)){let t=n/794*1.75,e=r/1123*1.75,i=(t>e?t=e:e=t,s.writeStartElement("Canvas"),s.writeAttributeString("RenderTransform",StiString.format("{0},0,0,{1},{2},{3}",this.floatToString(t),this.floatToString(e),this.floatToString(n/2),this.floatToString(r/2))),s.writeStartElement("Canvas"),s.writeAttributeString("RenderTransform","0.707,-0.707,0.707,0.707,0,0"),s.writeStartElement("Path"),s.writeAttributeString("Stroke",StiString.format("#{0:X8}",1080321124)),s.writeAttributeString("StrokeThickness",this.floatToString(15)),s.writeAttributeString("StrokeStartLineCap","Round"),s.writeAttributeString("StrokeEndLineCap","Round"),s.writeAttributeString("StrokeLineJoin","Round"),"");i=(i=(i+="M 40,0 L 40,100 M 0,100 L 80,100 ")+"M 100,0 L 100,70 M 100,45 L 120,65 L 130,72 L 140,68 "+"M 170,0 L 170,70 M 169,100 L 171,100 ")+"M 215,60 L 222,69 L 232,71 L 255,70 L 265,60 L 265,5 L 270,0 M 265,44 L 220,31 L 212,20 L 212,10 L 225,0 L 235,0 L 250,5 L 265,18 "+"M 310,0 L 310,100 ",s.writeAttributeString("Data",i),s.writeAttributeString("RenderTransform","1,0,0,-1,-155,50"),s.writeFullEndElement(),s.writeFullEndElement(),s.writeFullEndElement()}return s.writeEndElement(),s.writeFullEndElement(),s.flush(),t}writeBorderFill(u,w){let t=Color.transparent,f=w.component.as(IStiBrush),e=(null!=f&&null!=f.brush&&(t=StiBrush.toColor(f.brush)),w.component.as(StiRichText));if(0!=(t=null!=e?e.backColor:t).a){if(u.writeStartElement("Path"),u.writeAttributeString("Data",StiString.format("M {0},{1} L {0},{3} L {2},{3} L {2},{1} Z ",this.floatToString(w.x),this.floatToString(w.y),this.floatToString(w.x+w.width),this.floatToString(w.y+w.height))),w.component.is(StiText)||w.component.is(StiImage)||this.writeHyperlinksData(u,w.component,!1),u.writeStartElement("Path.Fill"),null!=f&&null!=f.brush&&f.brush.is(StiGradientBrush)){let t=f.brush,e=1,i=1,r=t.angle,n=(r<0&&(r+=360),270<=r&&r<360&&(r=360-r,i=-1),180<=r&&r<270&&(r-=180,i=-1,e=-1),90<=r&&r<180&&(r=180-r,e=-1),r=r*Math.PI/180,w.x+w.width/2),a=w.y+w.height/2,o=Math.sqrt(w.width*w.width+w.height*w.height)/2,s=Math.atan2(w.height,w.width),l=Math.PI/2-r+s,m=o*Math.sin(l),h=m*Math.cos(r)*e,c=m*Math.sin(r)*i,g=n-h,S=n+h,p=a-c,d=a+c;u.writeStartElement("LinearGradientBrush"),u.writeAttributeString("MappingMode","Absolute"),u.writeAttributeString("StartPoint",this.floatToString(g)+`,`+this.floatToString(p)),u.writeAttributeString("EndPoint",this.floatToString(S)+`,`+this.floatToString(d)),u.writeStartElement("LinearGradientBrush.GradientStops"),u.writeStartElement("GradientStop"),u.writeAttributeString("Color",StiString.format("#{0:X8}",t.startColor.toArgb())),u.writeAttributeString("Offset","0"),u.writeEndElement(),u.writeStartElement("GradientStop"),u.writeAttributeString("Color",StiString.format("#{0:X8}",t.endColor.toArgb())),u.writeAttributeString("Offset","1"),u.writeEndElement(),u.writeEndElement()}else u.writeStartElement("SolidColorBrush"),u.writeAttributeString("Color",StiString.format("#{0:X8}",t.toArgb()));u.writeEndElement(),u.writeEndElement(),u.writeFullEndElement()}else!this.writeHyperlinksData(u,w.component,!0)||w.component.is(StiText)||w.component.is(StiImage)||(u.writeStartElement("Path"),u.writeAttributeString("Data",StiString.format("M {0},{1} L {0},{3} L {2},{3} L {2},{1} Z ",this.floatToString(w.x),this.floatToString(w.y),this.floatToString(w.x+w.width),this.floatToString(w.y+w.height))),this.writeHyperlinksData(u,w.component,!1),u.writeEndElement())}writeBorderStroke(i,r){let n=r.component.as(IStiBorder);if(null==n)return;if(n.border.dropShadow&&null!=n.border.shadowBrush){let e=StiBrush.toColor(n.border.shadowBrush);if(0!=e.a){let t=n.border.shadowSize;i.writeStartElement("Path"),i.writeAttributeString("Data",StiString.format("M {0},{4} L {1},{4} L {1},{3} L {2},{3} L {2},{5} L {0},{5} Z ",this.floatToString(r.x+t),this.floatToString(r.x+r.width),this.floatToString(r.x+r.width+t),this.floatToString(r.y+t),this.floatToString(r.y+r.height),this.floatToString(r.y+r.height+t))),i.writeStartElement("Path.Fill"),i.writeStartElement("SolidColorBrush"),i.writeAttributeString("Color",StiString.format("#{0:X8}",e.toArgb())),i.writeEndElement(),i.writeEndElement(),i.writeFullEndElement()}}let a=n.border.as(StiAdvancedBorder),o=null!=a,t=new StiRectanglePrimitive,s=(r.component.is(StiRectanglePrimitive)&&(t=r.component),n.border.isLeftBorderSidePresent&&t.leftSide),l=n.border.isRightBorderSidePresent&&t.rightSide,m=n.border.isTopBorderSidePresent&&t.topSide,h=n.border.isBottomBorderSidePresent&&t.bottomSide,e=n.border.side!=StiBorderSides.None&&n.border.style!=StiPenStyle.None,c=(o&&(e=a.side!=StiBorderSides.None),.9),g=new StiBorderSide(n.border.color,n.border.size,n.border.style),S=0;if(g.style==StiPenStyle.Double&&(S=c),e){let e="";if(s){o&&(g=a.leftSide,S=g.style==StiPenStyle.Double?c:0);let t=StiString.format("M {0},{1} L {2},{3} ",this.floatToString(r.x-S),this.floatToString(r.y-S),this.floatToString(r.x-S),this.floatToString(r.y+S+r.height));g.style==StiPenStyle.Double&&(t+=StiString.format("M {0},{1} L {2},{3} ",this.floatToString(r.x+S),this.floatToString(r.y+(m?S:-S)),this.floatToString(r.x+S),this.floatToString(r.y+(h?-S:S)+r.height))),o?this.writeBorderSide(i,g,t):e+=t}if(l){o&&(g=a.rightSide,S=g.style==StiPenStyle.Double?c:0);let t=StiString.format("M {0},{1} L {2},{3} ",this.floatToString(r.x+S+r.width),this.floatToString(r.y-S),this.floatToString(r.x+S+r.width),this.floatToString(r.y+S+r.height));g.style==StiPenStyle.Double&&(t+=StiString.format("M {0},{1} L {2},{3} ",this.floatToString(r.x-S+r.width),this.floatToString(r.y+(m?S:-S)),this.floatToString(r.x-S+r.width),this.floatToString(r.y+(h?-S:S)+r.height))),o?this.writeBorderSide(i,g,t):e+=t}if(m){o&&(g=a.topSide,S=g.style==StiPenStyle.Double?c:0);let t=StiString.format("M {0},{1} L {2},{3} ",this.floatToString(r.x-S),this.floatToString(r.y-S),this.floatToString(r.x+S+r.width),this.floatToString(r.y-S));g.style==StiPenStyle.Double&&(t+=StiString.format("M {0},{1} L {2},{3} ",this.floatToString(r.x+(s?S:-S)),this.floatToString(r.y+S),this.floatToString(r.x+(l?-S:S)+r.width),this.floatToString(r.y+S))),o?this.writeBorderSide(i,g,t):e+=t}if(h){o&&(g=a.bottomSide,S=g.style==StiPenStyle.Double?c:0);let t=StiString.format("M {0},{1} L {2},{3} ",this.floatToString(r.x-S),this.floatToString(r.y+S+r.height),this.floatToString(r.x+S+r.width),this.floatToString(r.y+S+r.height));g.style==StiPenStyle.Double&&(t+=StiString.format("M {0},{1} L {2},{3} ",this.floatToString(r.x+(s?S:-S)),this.floatToString(r.y-S+r.height),this.floatToString(r.x+(l?-S:S)+r.width),this.floatToString(r.y-S+r.height))),o?this.writeBorderSide(i,g,t):e+=t}o||this.writeBorderSide(i,new StiBorderSide(n.border.color,n.border.size,n.border.style),e)}}writeBorderSide(t,e,i){let r=e.size,n=.9*(r=e.style==StiPenStyle.Double?1:r),a=e.color,o=this.getLineStyleDash(e.style);t.writeStartElement("Path"),t.writeAttributeString("Stroke",StiString.format("#{0:X8}",a.toArgb())),t.writeAttributeString("StrokeThickness",n.toString()),t.writeAttributeString("StrokeStartLineCap","Square"),t.writeAttributeString("StrokeEndLineCap","Square"),""!=o&&(t.writeAttributeString("StrokeDashArray",o),t.writeAttributeString("StrokeDashCap","Flat")),t.writeAttributeString("Data",i),t.writeFullEndElement()}writeHyperlinksData(e,i,r){let n=!1;if(null!=i.bookmarkValue&&""!=i.bookmarkValue){let t=__.a.StiNameValidator.correctName(i.bookmarkValue.toString(),null,this.report);r||this.pageBookmarks.containsKey(t)||(e.writeAttributeString("Name",t),this.pageBookmarks.set(t,this.indexPage)),n=!0}if(null!=i.hyperlinkValue&&0<i.hyperlinkValue.toString().trim().length&&!i.hyperlinkValue.toString().trim().startsWith("javascript:")){let t=i.hyperlinkValue.toString().trim();r||(t.startsWith("#")?(t=__.a.StiNameValidator.correctName(t.substr(1),null,this.report),e.writeAttributeString("FixedPage.NavigateUri",`../FixedDoc.fdoc#`+t)):e.writeAttributeString("FixedPage.NavigateUri",t)),n=!0}return n}writeText(A,T){let F=T.component.as(IStiText),C=T.component.as(StiText),P=T.component.as(IStiFont),L=T.component.as(IStiTextBrush),k=T.component.as(IStiTextOptions),B=T.component.as(IStiTextHorAlignment),I=T.component.as(IStiVertAlignment),D=null!=k&&k.textOptions.wordWrap,R=null!=B&&B.horAlignment==StiTextHorAlignment.Width,_=null!=k&&null!=k.textOptions&&k.textOptions.rightToLeft,N=0,M=0,H=0,O=0;if(null!=P&&(H=this.pdfFont.getFontNumber(P.font),O=P.font.sizeInPoints*this.fontCorrectValue,this.pageFonts.set(H,H)),null!=F){let S=Color.transparent,p=(null!=L&&(S=StiBrush.toColor(L.textBrush)),1),t=(null!=P&&(p=P.font.sizeInPoints),__.a.StiDpiHelper.graphicsScale),e=p*this.fontCorrectValue*this.pdfFont.tmASC/1e3*t,i=p*this.fontCorrectValue*this.pdfFont.tmDESC/1e3*-1*t,r=p*this.fontCorrectValue*this.pdfFont.tmExternal/1e3*t,a=p*this.fontCorrectValue*this.pdfFont.UnderscoreSize/1e3*t,o=p*this.fontCorrectValue*this.pdfFont.UnderscorePosition/1e3*t,s=p*this.fontCorrectValue*this.pdfFont.StrikeoutSize/1e3*t,l=p*this.fontCorrectValue*this.pdfFont.StrikeoutPosition/1e3*t,d=(e-i+r)*C.lineSpacing,h=e,n=i,m=C.margins.left,c=C.margins.right,g=C.margins.top,u=C.margins.bottom,w=T.x+m,f=T.y+u,b=T.width-m-c,E=T.height-g-u,y=2,v=1,x=(w+=y,b-=2*y,f+=v,E-=2*v,F.text);if(x=x[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("\r",""),0<b&&0<x.length){A.writeStartElement("Canvas"),A.writeAttributeString("Clip",StiString.format("M {0},{1} L {0},{3} L {2},{3} L {2},{1} Z ",this.floatToString(T.x),this.floatToString(T.y),this.floatToString(T.x+T.width),this.floatToString(T.y+T.height))),this.writeHyperlinksData(A,T.component,!1);let c=null;if(R){let t=C.page.unit.convertRectangleToHInches(T.component.componentToPage(T.component.clientRectangle));t=C.convertTextMargins(t,!1),(t=C.convertTextBorders(t,!1)).width/=__.a.StiDpiHelper.deviceCapsScale,t.height/=__.a.StiDpiHelper.deviceCapsScale,this.checkGraphicsForTextRenderer(),c=StiTextDrawing.splitTextWordwrapWidth(x,null,C.font,t),D=!1}else c=__.c.StiExportUtils.splitString(x,!0);N=c.length;let e=w,i=f,r=b,n=E;if(null!=k&&0!=(M=k.textOptions.angle)){if(45<M&&M<135||225<M&&M<315){let t=b;b=E,E=t}w=-b/2,f=-E/2}if(A.writeStartElement("Canvas"),0!=M){let t=-M*Math.PI/180;A.writeAttributeString("RenderTransform",StiString.format("{0},{1},{2},{3},{4},{5}",this.floatToString(Math.cos(t)),this.floatToString(Math.sin(t)),this.floatToString(-Math.sin(t)),this.floatToString(Math.cos(t)),this.floatToString(e+r/2),this.floatToString(i+n/2)))}if(D)for(let m=0;m<c.length;m++){let r=c[m],n="",a=0;while(a<r.length)if(Char.isWhitespace(r[a]))n+=r[a],a++;else{let t="";while(a<r.length&&!Char.isWhitespace(r[a]))t+=r[a],a++;let e=__.c.StiBidirectionalConvert2.convertString(t,!1),i=(n+=e,t.length-e.length);0<i&&(n+=StiString.fill(String.fromCharCode(0),i))}let e=StiArray.create(Number,r.length);for(let t=0;t<r.length;t++)e[t]=this.pdfFont.UnicodeMap[n.charCodeAt(t)];let o=StiArray.create(Number,r.length),s=StiArray.create(Number,r.length),i=0,l=0;for(let t=0;t<e.length;t++)32<=e[t]&&(l+=this.pdfFont.Widths[e[t]-32]),"\t"==String.fromCharCode(e[t])&&(l+=this.getTabsSize(k,p,l)),o[t]=l,this.isWordWrapSymbol(n,t)&&0<t&&i++,s[t]=i;let t=l*(p*this.fontCorrectValue)/1e3;if(t>b){let t=r.length-1,e=Math.trunc(1e3*b/(p*this.fontCorrectValue));while(o[t]>e&&0<t)t--;let i=t;if(0<s[t]){if(s[t]!=s[t+1])i=t++;else{while(!this.isWordWrapSymbol(n,t))t--;i=t-1;while(Char.isWhitespace(n[i])&&0<i)i--}while(Char.isWhitespace(n[t]))t++}else t++;c[m]=R?r.substr(0,i+1)+"a":r.substr(0,i+1),c[Stimulsoft.System.StiObject.stimulsoft]().insert(m+1,r.substr(t,r.length-t).trimStart())}}for(let i=0;i<c.length;i++){let t=c[i],e=__.c.StiBidirectionalConvert2.convertString(t,_);c[i]=e}if(null!=I){let t=d,e=c.length*t,i=I.vertAlignment;(i=0!=M&&90!=M&&180!=M&&270!=M?StiVertAlignment.Center:i)==StiVertAlignment.Top&&(f+=h),i==StiVertAlignment.Center&&(f+=(E-e)/2+h),i==StiVertAlignment.Bottom&&(f+=E-e+h)}let g=StiArray.create2(Number,c.length,3);for(let h=0;h<c.length;h++){let m=c[h];if(0<m.length){let r=StiArray.create(Number,m.length),n=0;for(let e=0;e<m.length;e++){let t=m.charCodeAt(e);if(32<=t&&(n+=this.pdfFont.Widths[this.pdfFont.UnicodeMap[t]-32]),"\t"==String.fromCharCode(t)){let t=this.getTabsSize(k,p,n);n+=t,r[e]=t/10}}n=n*(p*this.fontCorrectValue)/1e3,"{"==(m=Zj.convertToEscapeSequence(m))[0]&&(m="{}"+m);let e=w,t=f+d*h;if(null!=B){let t=B.horAlignment;if(R&&(0<m.length&&"a"==m[m.length-1]?m=m.substr(0,m.length-1):t=StiTextHorAlignment.Left),null!=k&&null!=k.textOptions&&k.textOptions.rightToLeft&&(t==StiTextHorAlignment.Left?t=StiTextHorAlignment.Right:t==StiTextHorAlignment.Right&&(t=StiTextHorAlignment.Left)),t==StiTextHorAlignment.Center&&(e+=(b-n)/2),t==StiTextHorAlignment.Right&&(e+=b-n),t==StiTextHorAlignment.Width){let i=0;for(let t=0;t<m.length;t++)" "==m[t]&&i++;if(0<i&&(h!=c.length-1||R)){let e=(b-n)/i*100/(p*this.fontCorrectValue);if(0<e){e+=this.pdfFont.Widths[0]/10;for(let t=0;t<m.length;t++)" "==m[t]&&(r[t]=e)}}}}g[h][0]=e,g[h][1]=t,g[h][2]=n;let i=this.pdfFont.fontList[H],a=i.Name,o=a=Stimulsoft.StiOptions.Export.useAlternativeFontNames&&Stimulsoft.StiOptions.Export.alternativeFontNames.containsKey(a)?Stimulsoft.StiOptions.Export.alternativeFontNames.get(a):a,s=(o=o[Stimulsoft.System.StiObject.stimulsoft]().replaceAll(" ","_"),(i.Bold||i.Italic)&&(i.Bold&&(o+="_Bold"),i.Italic)&&(o+="_Italic"),!1),l="";for(let t=0;t<r.length-1;t++)0!=r[t]&&(l=(l+=",")+this.floatToString(r[t]),s=!0),t!=r.length-1-1&&(l+=";");A.writeStartElement("Glyphs"),A.writeAttributeString("BidiLevel","0"),A.writeAttributeString("Fill",StiString.format("#{0:X8}",S.toArgb())),A.writeAttributeString("FontUri",StiString.format("/Resources/{0}.ttf",o)),A.writeAttributeString("FontRenderingEmSize",this.floatToString(O)),A.writeAttributeString("StyleSimulations","None"),A.writeAttributeString("OriginX",this.floatToString(e)),A.writeAttributeString("OriginY",this.floatToString(t)),A.writeAttributeString("UnicodeString",m),A.writeAttributeString("Indices",s?l:""),A.writeFullEndElement()}}if(null!=P&&P.font.underline){let e=.09*p,i=.115*-p;0!=this.pdfFont.UnderscoreSize&&(e=a,i=o),e<.1&&(e=.1);for(let t=0;t<c.length;t++)0!=g[t][2]&&(A.writeStartElement("Path"),A.writeAttributeString("Stroke",StiString.format("#{0:X8}",S.toArgb())),A.writeAttributeString("StrokeThickness",StiString.format("{0}",this.floatToString(e))),A.writeAttributeString("Data",StiString.format("M {0},{2} L {1},{2}",this.floatToString(g[t][0]),this.floatToString(g[t][0]+g[t][2]),this.floatToString(g[t][1]-i))),A.writeFullEndElement())}if(null!=P&&P.font.strikeout){let e=.09*p,i=.4*p;0!=this.pdfFont.StrikeoutSize&&(e=s,i=l),e<.1&&(e=.1);for(let t=0;t<c.length;t++)0!=g[t][2]&&(A.writeStartElement("Path"),A.writeAttributeString("Stroke",StiString.format("#{0:X8}",S.toArgb())),A.writeAttributeString("StrokeThickness",StiString.format("{0}",this.floatToString(e))),A.writeAttributeString("Data",StiString.format("M {0},{2} L {1},{2}",this.floatToString(g[t][0]),this.floatToString(g[t][0]+g[t][2]),this.floatToString(g[t][1]-i))),A.writeFullEndElement())}A.writeFullEndElement(),A.writeFullEndElement()}if(F.linesOfUnderline!=StiPenStyle.None){let o=T.y+u+v,s=!0,l=!0;if(null!=I){let t=d*(N=0==N?1:N),e=I.vertAlignment;(e=0!=M&&90!=M&&180!=M&&270!=M?StiVertAlignment.Center:e)==StiVertAlignment.Top&&(o+=h,s=!1),e==StiVertAlignment.Center&&(o+=(E-t)/2+h),e==StiVertAlignment.Bottom&&(o+=E-d+h,l=!1)}o+=-n;let m=T.component.as(IStiBorder);if(null!=m){let t=m.border.size,e=.9*t,i=m.border.color,r=this.getLineStyleDash(F.linesOfUnderline),n="",a=o;if(s)while(a-d>T.y+g)a-=d;while(a<T.y+T.height-u-(l?0:d))n+=StiString.format("M {0},{1} L {2},{3} ",this.floatToString(T.x),this.floatToString(a),this.floatToString(T.x+T.width),this.floatToString(a)),a+=d;A.writeStartElement("Path"),A.writeAttributeString("Stroke",StiString.format("#{0:X8}",i.toArgb())),A.writeAttributeString("StrokeThickness",e.toString()),A.writeAttributeString("StrokeStartLineCap","Square"),A.writeAttributeString("StrokeEndLineCap","Square"),""!=r&&(A.writeAttributeString("StrokeDashArray",r),A.writeAttributeString("StrokeDashCap","Flat")),A.writeAttributeString("Data",n),A.writeFullEndElement()}}}}writeImage(t,e){let i=e.component.as(IStiExportImageExtended);if(null==i||!e.component.isExportAsImage(__.a.StiExportFormat.Xps))return;let r={ref:this.imageResolution/100},n=i.getImage(r,__.a.StiExportFormat.Xps);if(null==n)return;let a=this.imageCache.addImageInt(n),o=-1;this.pageImages.set(a,a),-1!=o&&this.pageImages.set(o,o),t.writeStartElement("Path"),this.writeHyperlinksData(t,e.component,!1),t.writeAttributeString("Data",StiString.format("M {0},{1} L {0},{3} L {2},{3} L {2},{1} Z ",this.floatToString(e.x),this.floatToString(e.y),this.floatToString(e.x+e.width),this.floatToString(e.y+e.height))),-1!=o&&(t.writeStartElement("Path.OpacityMask"),t.writeStartElement("ImageBrush"),t.writeAttributeString("ImageSource",StiString.format("/Resources/Images/image_{0}.png",o)),t.writeAttributeString("Viewbox",StiString.format("{0},{1},{2},{3}",0,0,n.width,n.height)),t.writeAttributeString("TileMode","None"),t.writeAttributeString("ViewboxUnits","Absolute"),t.writeAttributeString("ViewportUnits","Absolute"),t.writeAttributeString("Viewport",StiString.format("0,0,{0},{0}",1)),t.writeStartElement("ImageBrush.Transform"),t.writeStartElement("MatrixTransform"),t.writeAttributeString("Matrix",StiString.format("{0},{1},{2},{3},{4},{5}",this.floatToString(e.width),0,0,this.floatToString(e.height),this.floatToString(e.x),this.floatToString(e.y))),t.writeEndElement(),t.writeEndElement(),t.writeEndElement(),t.writeEndElement()),t.writeStartElement("Path.Fill"),t.writeStartElement("ImageBrush"),t.writeAttributeString("ImageSource",StiString.format("/Resources/Images/image_{0}.jpg",a)),t.writeAttributeString("Viewbox",StiString.format("{0},{1},{2},{3}",0,0,n.width,n.height)),t.writeAttributeString("TileMode","None"),t.writeAttributeString("ViewboxUnits","Absolute"),t.writeAttributeString("ViewportUnits","Absolute"),t.writeAttributeString("Viewport",StiString.format("0,0,{0},{0}",1)),t.writeStartElement("ImageBrush.Transform"),t.writeStartElement("MatrixTransform"),t.writeAttributeString("Matrix",StiString.format("{0},{1},{2},{3},{4},{5}",this.floatToString(e.width),0,0,this.floatToString(e.height),this.floatToString(e.x),this.floatToString(e.y))),t.writeEndElement(),t.writeEndElement(),t.writeEndElement(),t.writeEndElement(),t.writeFullEndElement()}writeWatermark(t,e,i,r,n){if(null==e||StiString.isNullOrEmpty(e.text)||e.showBehind!=i)return;let a=new Yj;a.x=0,a.y=0,a.width=r,a.height=n,a.component=new StiText(new RectangleD(a.x,a.y,a.width,a.height)),a.component.text=e.text,a.component.textBrush=e.textBrush,a.component.font=e.font,a.component.textOptions=new StiTextOptions,a.component.textOptions.angle=e.angle,a.component.horAlignment=StiTextHorAlignment.Center,a.component.vertAlignment=StiVertAlignment.Center,this.writeText(t,a)}writePageRels(){let t=new MemoryStream,n=new XmlTextWriter(Encoding.UTF8,t),a=(n.indentation=this.xmlIndentation<0?0:this.xmlIndentation,n.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,n.writeStartDocument(),n.writeStartElement("Relationships"),n.writeAttributeString("xmlns","http://schemas.openxmlformats.org/package/2006/relationships"),[]);this.pageFonts.values.copyTo(a,0);for(let r=0;r<a.length;r++){let t=this.pdfFont.fontList[a[r]],e=t.Name,i=e=Stimulsoft.StiOptions.Export.useAlternativeFontNames&&Stimulsoft.StiOptions.Export.alternativeFontNames.containsKey(e)?Stimulsoft.StiOptions.Export.alternativeFontNames.get(e):e;i=i[Stimulsoft.System.StiObject.stimulsoft]().replaceAll(" ","_"),(t.Bold||t.Italic)&&(t.Bold&&(i+="_Bold"),t.Italic)&&(i+="_Italic"),n.writeStartElement("Relationship"),n.writeAttributeString("Id",`rId`+(r+1)),n.writeAttributeString("Type","http://schemas.microsoft.com/xps/2005/06/required-resource"),n.writeAttributeString("Target",`../../../Resources/${i}.ttf`),n.writeEndElement()}let i=StiArray.create(Number,this.pageImages.count);this.pageImages.values.copyTo(i,0);for(let e=0;e<i.length;e++){n.writeStartElement("Relationship"),n.writeAttributeString("Id",`rId`+(this.pageFonts.count+e+1)),n.writeAttributeString("Type","http://schemas.microsoft.com/xps/2005/06/required-resource");let t="jpg";this.imageCache.imageFormatStore[i[e]]==ImageFormat.Png&&(t="png"),n.writeAttributeString("Target",`../../../Resources/Images/image_${i[e]}.`+t),n.writeEndElement()}return n.writeFullEndElement(),n.writeEndDocument(),n.flush(),t}writeResourceImage(t){let e=new MemoryStream,i=this.imageCache.imagePackedStore[t];return e.write(i,0,i.length),e}writeRecourceFont(t){let e=new MemoryStream,i=(this.pdfFont.currentFont=t,this.pdfFont.fontList[t]),r=this.pdfFont.getFontDataBuf(i.Font,this.report);if(0<(null==(r=null==r?__.a.Resources.RobotoFont.getContent():r)?void 0:r.length)&&this.reduceFontSize){let t=this.pdfFont.reduceFontSize(r,i.Name,!0);null!=t&&(r=t)}return 0<(null==r?void 0:r.length)&&e.write(r,0,r.length),e}exportXps(e,t,i){if(null==Stimulsoft.Base[["St","iL","ic","en","se"].join("")].key&&console.warn("You are using a trial version of the Stimulsoft product!"),__.a.StiLogService.write(this[Stimulsoft.System.StiObject.stimulsoft]().getType(),"Export report to Microsoft XML Paper Specification format"),null==i)throw"ArgumentNullException";this.report=e;let r=i.pageRange,n=(this.imageResolution=i.imageResolution,this.imageQuality=i.imageQuality,this.exportRtfTextAsImage=i.exportRtfTextAsImage,this.imageQuality<0&&(this.imageQuality=0),1<this.imageQuality&&(this.imageQuality=1),this.imageResolution<10&&(this.imageResolution=10),this.xmlIndentation=1,this.useImageComparer=Stimulsoft.StiOptions.Export.Xps.allowImageComparer,this.reduceFontSize=Stimulsoft.StiOptions.Export.Xps.reduceFontFileSize,CultureInfo.currentCulture);try{CultureInfo.currentCulture=JSON.parse(JSON.stringify(CultureInfo.cultures["en-US"])),CultureInfo.currentCulture.numberFormat.numberDecimalSeparator=".";let i=r.getSelectedPages(e.renderedPages);if(this.isStopped)return;this.prepareData();for(let e of i.list){if(i.getPage(e),i.cacheMode&&this.invokeExporting(e,i,0,2),null!=e.watermark&&!StiString.isNullOrEmpty(e.watermark.text)){null!=e.watermark.font&&this.pdfFont.getFontNumber(e.watermark.font);let t=__.c.StiBidirectionalConvert2.convertString(e.watermark.text,!1);this.pdfFont.storeUnicodeSymbolsInMap(t)}for(let n of e.components.list)if(n.enabled){let t=n.as(IStiFont),r=(null!=t&&this.pdfFont.getFontNumber(t.font),n.as(IStiTextOptions));if(n.is(StiText)&&!n.isExportAsImage(__.a.StiExportFormat.Xps)){let t=n,e=null!=r.textOptions&&r.textOptions.rightToLeft,i=__.c.StiBidirectionalConvert2.convertString(t.text,e);this.pdfFont.storeUnicodeSymbolsInMap(i)}}}this.pdfFont.InitFontsData(e);let a=new StiZipWriter20;a.begin(t,!0),a.addFile("[Content_Types].xml",this.writeContentTypes()),a.addFile("_rels/.rels",this.writeMainRels()),a.addFile("docProps/core.xml",this.writeDocPropsCore(e)),a.addFile("FixedDocSeq.fdseq",this.writeFixedDocSeq()),this.pageFonts=new Hashtable,this.pageImages=new Hashtable,this.pageBookmarks=new Hashtable,this.indexPage=0;for(let t of i.list){if(i.getPage(t),this.invokeExporting(t,i,1,2),this.isStopped)return;if(a.addFile(`Documents/1/Pages/${this.indexPage+1}.fpage`,this.writePage(t,e)),(0<this.pageFonts.count||0<this.pageImages.count)&&a.addFile(`Documents/1/Pages/_rels/${this.indexPage+1}.fpage.rels`,this.writePageRels()),this.pageFonts.clear(),this.pageImages.clear(),this.isStopped)return;this.indexPage++}if(a.addFile("Documents/1/FixedDoc.fdoc",this.writeFixedDoc(i)),0<this.pdfFont.fontList.length)for(let n=0;n<this.pdfFont.fontList.length;n++){let t=this.pdfFont.fontList[n],e=t.Name,i=e=Stimulsoft.StiOptions.Export.useAlternativeFontNames&&Stimulsoft.StiOptions.Export.alternativeFontNames.containsKey(e)?Stimulsoft.StiOptions.Export.alternativeFontNames.get(e):e,r=(i=i[Stimulsoft.System.StiObject.stimulsoft]().replaceAll(" ","_"),(t.Bold||t.Italic)&&(t.Bold&&(i+="_Bold"),t.Italic)&&(i+="_Italic"),this.writeRecourceFont(n));0<r.length&&a.addFile(`Resources/${i}.ttf`,r)}if(0<this.imageCache.imagePackedStore.length)for(let e=0;e<this.imageCache.imagePackedStore.length;e++){let t="jpg";this.imageCache.imageFormatStore[e]==ImageFormat.Png&&(t="png"),a.addFile(`Resources/Images/image_${e}.`+t,this.writeResourceImage(e))}a.end()}finally{CultureInfo.currentCulture=n,this.pdfFont.clear(),this.pdfFont=null,this.pageFonts=null,this.pageImages=null,this.imageCache.clear(),this.pageBookmarks.clear(),this.pageBookmarks=null}}}__.c.StiXpsExportService=Zj}let StiExportService=__.c.StiExportService,IStiDashboard=__.a.Dashboard.IStiDashboard;__.c.StiCsvExportService=class extends StiExportService{constructor(){super(...arguments),this.multipleFiles=!1}implements(){let t=[__.c.IStiCsvExportService];return(this.implements=()=>t)()}get defaultExtension(){return"csv"}get exportFormat(){return __.a.StiExportFormat.Csv}get groupCategory(){return"Data"}get position(){return __.c.StiExportPosition.Data}get exportNameInMenu(){return StiLocalization.get("Export","ExportTypeCsvFile")}exportTo(t,e,i){this.exportCsv(t,e,i[Stimulsoft.System.StiObject.stimulsoft]().as(__.c.StiDataExportSettings))}get getFilter(){return StiLocalization.get("FileFilters","CsvFiles")}compareExcellSheetNames(t,e){let i=t,r=(null!=i&&0!=i.length||(i=""),e);return null!=r&&0!=r.length||(r=""),i==r}exportCsv(i,t,e){if(__.a.StiLogService.write(this[Stimulsoft.System.StiObject.stimulsoft]().getType(),"Export report to Csv format"),null==Stimulsoft.Base[["St","iL","ic","en","se"].join("")].key&&console.warn("You are using a trial version of the Stimulsoft product!"),!i.isDocument&&i.getCurrentPage().is(IStiDashboard))return;if(null==e)throw new Error("The 'settings' argument cannot be equal in null.");let r=e.pageRange,n=e.separator,a=e.encoding,o=e.skipColumnHeaders,s=e.dataExportMode,l=("\\t"==n&&(n="\t"),r.getSelectedPages(i.renderedPages)),m=(this.currentPassNumber=0,this.maximumPassNumber=2,this.writer=new StreamWriter(t,a),0);while(m<l.count){let t=new StiPagesCollection(i,i.renderedPages),e=(t.cacheMode=i.renderedPages.cacheMode,t.addV2Internal(l.getPageWithoutCache(m)),l.getPageWithoutCache(m).excelSheetValue);while(m<l.count-1&&this.compareExcellSheetNames(l.getPageWithoutCache(m+1).excelSheetValue,e))m++,t.addV2Internal(l.getPageWithoutCache(m));m++;let r=new __.c.StiMatrix(t,!1,this,null,s);if(r.scanComponentsPlacement(!1),this.isStopped)return;if(r.prepareDocument(this,s),!o){for(let e=0;e<r.fields.length;e++){let t=r.fields[e].name[Stimulsoft.System.StiObject.stimulsoft]().replaceAll('"','""');-1==t.indexOf(n)&&-1==t.indexOf('"')&&-1==t.indexOf("\n")||(t='"'+t+'"'),this.writer.write(t),e<r.fields.length-1&&this.writer.write(n)}this.writer.writeLine("")}this.currentPassNumber++;for(let i=0;i<r.dataArrayLength;i++){if(this.invokeExporting2(i,r.dataArrayLength-1,this.currentPassNumber,this.maximumPassNumber),this.isStopped)return;for(let e=0;e<r.fields.length;e++){let t=r.fields[e].dataArray[i];""!=(t=null==t?"":t)&&(-1==t.indexOf(n)&&-1==t.indexOf('"')&&-1==t.indexOf("\n")||(t='"'+(t=t[Stimulsoft.System.StiObject.stimulsoft]().replaceAll('"','""'))+'"'),this.writer.write(t)),e<r.fields.length-1&&this.writer.write(n)}this.writer.writeLine("")}r.clear(),this.currentPassNumber++,this.maximumPassNumber+=2}this.writer.flush()}},__.c.StiDataExportService=class extends __.c.StiExportService{constructor(){super(...arguments),this.multipleFiles=!1}implements(){let t=[__.c.IStiDataExportService];return(this.implements=()=>t)()}get defaultExtension(){if(this.exportSettings.is(__.c.StiDbfExportSettings))return"dbf";if(this.exportSettings.is(__.c.StiDifExportSettings))return"dif";if(this.exportSettings.is(__.c.StiSylkExportSettings))return"slk";if(this.exportSettings.is(__.c.StiXmlExportSettings))return"xml";if(this.exportSettings.is(__.c.StiJsonExportSettings))return"json";if(this.exportSettings.is(__.c.StiDataExportSettings)){let t=this.exportSettings.dataType;if(t==__.c.StiDataType.Dbf)return"dbf";if(t==__.c.StiDataType.Dif)return"dif";if(t==__.c.StiDataType.Sylk)return"slk";if(t==__.c.StiDataType.Xml)return"xml";if(t==__.c.StiDataType.Json)return"json"}return"csv"}get exportFormat(){if(this.exportSettings.is(__.c.StiCsvExportSettings))return __.a.StiExportFormat.Csv;if(this.exportSettings.is(__.c.StiDbfExportSettings))return __.a.StiExportFormat.Dbf;if(this.exportSettings.is(__.c.StiDifExportSettings))return __.a.StiExportFormat.Dif;if(this.exportSettings.is(__.c.StiSylkExportSettings))return __.a.StiExportFormat.Sylk;if(this.exportSettings.is(__.c.StiXmlExportSettings))return __.a.StiExportFormat.Xml;if(this.exportSettings.is(__.c.StiJsonExportSettings))return __.a.StiExportFormat.Json;if(this.exportSettings.is(__.c.StiDataExportSettings)){let t=this.exportSettings.dataType;if(t==__.c.StiDataType.Csv)return __.a.StiExportFormat.Csv;if(t==__.c.StiDataType.Dbf)return __.a.StiExportFormat.Dbf;if(t==__.c.StiDataType.Dif)return __.a.StiExportFormat.Dif;if(t==__.c.StiDataType.Sylk)return __.a.StiExportFormat.Sylk;if(t==__.c.StiDataType.Xml)return __.a.StiExportFormat.Xml;if(t==__.c.StiDataType.Json)return __.a.StiExportFormat.Json}return __.a.StiExportFormat.Data}get groupCategory(){return"Data"}get position(){return __.c.StiExportPosition.Data}get exportNameInMenu(){return StiLocalization.get("Export","ExportTypeDataFile")}exportTo(t,e,i){this.exportData(t,e,i)}getFilter(){return StiLocalization.get("FileFilters","CsvFiles")}exportData(e,i,r){null==Stimulsoft.Base[["St","iL","ic","en","se"].join("")].key&&console.warn("You are using a trial version of the Stimulsoft product!");let t=null!=(this.exportSettings=r)?r.dataType:__.c.StiDataType.Csv;if(t==__.c.StiDataType.Dbf||r.is2(__.c.StiDbfExportSettings)){let t=new __.c.StiDbfExportService;t.exportDbf(e,i,r)}else if(t==__.c.StiDataType.Dif||r.is2(__.c.StiDifExportSettings)){let t=new __.c.StiDifExportService;t.exportDif(e,i,r)}else if(t==__.c.StiDataType.Sylk||r.is2(__.c.StiSylkExportSettings)){let t=new __.c.StiSylkExportService;t.exportSylk(e,i,r)}else if(t==__.c.StiDataType.Xml||r.is2(__.c.StiXmlExportSettings)){let t=new __.c.StiXmlExportService;t.exportXml(e,i,r)}else if(t==__.c.StiDataType.Json){let t=new __.c.StiJsonExportService;t.exportJson(e,i,r)}else{let t=new __.c.StiCsvExportService;t.exportCsv(e,i,r)}}};{class lp extends StiExportService{constructor(){super(...arguments),this.separator=CultureInfo.currentCulture.numberFormat.numberDecimalSeparator,this.multipleFiles=!1}implements(){let t=[__.c.IStiDbfExportService];return(this.implements=()=>t)()}get defaultExtension(){return"dbf"}get exportFormat(){return __.a.StiExportFormat.Dbf}get groupCategory(){return"Data"}get position(){return __.c.StiExportPosition.Data}get exportNameInMenu(){return StiLocalization.get("Export","ExportTypeDbfFile")}exportTo(t,e,i){this.exportDbf(t,e,i[Stimulsoft.System.StiObject.stimulsoft]().as(__.c.StiDataExportSettings))}get getFilter(){return StiLocalization.get("FileFilters","DbfFiles")}prepareData(t){let e=t,i=0;while(i<=e.length-2&&"0"==e[i]&&"."!=e[i+1])e[Stimulsoft.System.StiObject.stimulsoft]().insert(i," ",1),i++;return e}getBytes(e,i){let r=[];for(let t=0;t<e;t++)r[t]=i>>8*t;return r}exportDbf(t,e,i){if(__.a.StiLogService.write(this[Stimulsoft.System.StiObject.stimulsoft]().getType(),"Export report to Dbf format"),null==Stimulsoft.Base[["St","iL","ic","en","se"].join("")].key&&console.warn("You are using a trial version of the Stimulsoft product!"),!t.isDocument&&t.getCurrentPage().is(IStiDashboard))return;if(null==i)throw"The 'settings' argument cannot be equal in null.";let r=i.pageRange,n=i.codePage,a=i.dataExportMode,o=0;for(let t=0;t<lp.codePageCodes.length;t++)if(lp.codePageCodes[t][1]==n){o=t;break}let s=0==o?Encoding.Default:Encoding.getEncoding(lp.codePageCodes[o][1]),l=r.getSelectedPages(t.renderedPages),m=(__.c.StiExportUtils.checkPassive(l),this.currentPassNumber=0,this.maximumPassNumber=3,new __.c.StiMatrix(l,!1,this));if(m.scanComponentsPlacement(!1),this.isStopped)return;m.prepareDocument(this,a);let h=0;for(let n=0;n<m.fields.length;n++){let r=0;for(let i=0;i<m.dataArrayLength;i++){let t=m.fields[n].dataArray[i],e=(t=null==t?"":t).length;e>r&&(r=e)}0==r&&(r=1),m.fields[n].info[0]==__.c.StiExportDataType.String&&0==m.fields[n].info[1]&&(m.fields[n].info[1]=r),h+=m.fields[n].info[1];let e=new StringBuilder;if(m.fields[n].info[0]==__.c.StiExportDataType.Float||m.fields[n].info[0]==__.c.StiExportDataType.Double){let t=m.fields[n].info[1]-m.fields[n].info[2]-1;0<t&&e.append("0",t),e.append("."),e.append("0",m.fields[n].info[2])}m.fields[n].info[0]!=__.c.StiExportDataType.Int&&m.fields[n].info[0]!=__.c.StiExportDataType.Long||e.append("0",m.fields[n].info[1]),1<e.length&&e.append(";-"+e.toString().substr(1,e.length-1)),m.fields[n].formatString=e.toString()}h++;let c=new Hashtable;for(let r=0;r<m.fields.length;r++){let t=m.fields[r].name.toUpperCase(),e="",i=0;while(1){if(!c.contains(t+e))break;i++,e=i[Stimulsoft.System.StiObject.stimulsoft]().toString(),10<t.length+e.length&&(t=t.substr(0,10-e.length))}t+=e,m.fields[r].name=t,c.add(t,t)}let g=32+32*m.fields.length+1,S=StiArray.create(Number,g),p=(S[0]=3,DateTime.now);S[1]=p.year-100*Math.trunc(p.year/100),S[2]=p.month,S[3]=p.day,this.getBytes(4,m.dataArrayLength)[Stimulsoft.System.StiObject.stimulsoft]().copyTo(S,4),this.getBytes(2,g)[Stimulsoft.System.StiObject.stimulsoft]().copyTo(S,8),this.getBytes(2,h)[Stimulsoft.System.StiObject.stimulsoft]().copyTo(S,10);for(let r=0;r<m.fields.length;r++){let t=32+32*r,e=m.fields[r].name.toUpperCase(),i=s.getBytes(e);i[Stimulsoft.System.StiObject.stimulsoft]().copyTo(S,t),S[t+11]="C".charCodeAt(0),m.fields[r].info[0]!=__.c.StiExportDataType.Int&&m.fields[r].info[0]!=__.c.StiExportDataType.Long&&m.fields[r].info[0]!=__.c.StiExportDataType.Float&&m.fields[r].info[0]!=__.c.StiExportDataType.Double||(S[t+11]="N".charCodeAt(0)),m.fields[r].info[0]==__.c.StiExportDataType.Date&&(S[t+11]="D".charCodeAt(0)),m.fields[r].info[0]==__.c.StiExportDataType.Bool&&(S[t+11]="L".charCodeAt(0)),S[t+16]=m.fields[r].info[1],S[t+17]=m.fields[r].info[2]}S[29]=lp.codePageCodes[o][0],S[g-1]=13,this.writer2=e,this.writer2.write(S,0,g),S=StiArray.create(Number,h),this.currentPassNumber=2;for(let a=0;a<m.dataArrayLength;a++){if(this.invokeExporting2(a,m.dataArrayLength,this.currentPassNumber,this.maximumPassNumber),this.isStopped)return;let n=1;for(let e=0;e<m.fields.length;e++){let i=m.fields[e].dataArray[a],r=(null==i&&(i=""),m.fields[e].info[1]);switch(m.fields[e].info[0]){case __.c.StiExportDataType.String:(i=i.length>r?i[Stimulsoft.System.StiObject.stimulsoft]().remove(r,i.length-r):i).length<r&&(i+=StiString.fill(" ",r-i.length));break;case __.c.StiExportDataType.Int:case __.c.StiExportDataType.Long:{let t=StiNumber.tryParse(i.split(".").join(",").split(",").join(this.separator),!1),e=t.result;t.successfully?(i=this.prepareData(e.toString())).length>r&&(i=i[Stimulsoft.System.StiObject.stimulsoft]().remove(0,i.length-r)):e=0}break;case __.c.StiExportDataType.Float:case __.c.StiExportDataType.Double:{let t=StiNumber.tryParse(i.split(".").join(",").split(",").join(this.separator)),e=t.result;t.successfully?(i=this.prepareData(e.toString().split(this.separator).join("."))).length>r&&(i=i[Stimulsoft.System.StiObject.stimulsoft]().remove(0,i.length-r)):e=0}break;case __.c.StiExportDataType.Date:{let t=" ";if(StiString.isNullOrEmpty(i)||StiString.isNullOrEmpty(i.trimEnd()))i=t;else{let t=DateTime.tryParse(i),e=t.result;t.successfully?i=this.prepareData(e.toString("yyyyMMdd")):e=DateTime.minValue}}break;case __.c.StiExportDataType.Bool:{let t=i[Stimulsoft.System.StiObject.stimulsoft]().toBoolean();i=t?"T":"F"}break}let t=s.getBytes(i);t[Stimulsoft.System.StiObject.stimulsoft]().copyTo(S,n);for(let t=i.length;t<m.fields[e].info[1];t++)S[n+t]=" ".charCodeAt(0);n+=m.fields[e].info[1]}S[0]=32,this.writer2.write(S,0,S.length)}S[0]=26,this.writer2.write(S,0,1),this.writer2.flush(),(s=null)!=m&&(m.clear(),m=null)}}lp.copePageNames=["Default","437 U.S. MS-DOS","620 Mazovia (Polish) MS-DOS","737 Greek MS-DOS (437G)","850 International MS-DOS","852 Eastern European MS-DOS","861 Icelandic MS-DOS","865 Nordic MS-DOS","866 Russian MS-DOS","895 Kamenicky (Czech) MS-DOS","857 Turkish MS-DOS","1250 EasternEuropean MS-DOS","1251 Russian Windows","1252 Windows ANSI","1253 Greek Windows","1254 Turkish Windows","10000 Standard Macintosh","10006 Greek Macintosh","10007 Russian Macintosh","10029 Eastern European Macintosh"],lp.codePageCodes=[[0,0],[1,437],[105,620],[106,737],[2,850],[100,852],[103,861],[102,865],[101,866],[104,895],[107,857],[200,1250],[201,1251],[3,1252],[203,1253],[202,1254],[4,1e4],[152,10006],[150,10007],[151,10029]],__.c.StiDbfExportService=lp}__.c.StiDifExportService=class extends StiExportService{implements(){let t=[__.c.IStiDifExportService];return(this.implements=()=>t)()}get defaultExtension(){return"dif"}get exportFormat(){return __.a.StiExportFormat.Dif}get groupCategory(){return"Data"}get position(){return __.c.StiExportPosition.Data}get exportNameInMenu(){return StiLocalization.get("Export","ExportTypeDifFile")}exportTo(t,e,i){this.exportDif(t,e,i[Stimulsoft.System.StiObject.stimulsoft]().as(__.c.StiDataExportSettings))}exportDif(t,e,i){if(__.a.StiLogService.write(this[Stimulsoft.System.StiObject.stimulsoft]().getType(),"Export report to Dif format"),null==Stimulsoft.Base[["St","iL","ic","en","se"].join("")].key&&console.warn("You are using a trial version of the Stimulsoft product!"),!t.isDocument&&t.getCurrentPage().is(IStiDashboard))return;if(null==i)throw"The 'settings' argument cannot be equal in null.";let r=i.pageRange,n=i.exportDataOnly,a=i.encoding,o=(this.writer=new StreamWriter(e,a),r.getSelectedPages(t.renderedPages)),s=(__.c.StiExportUtils.checkPassive(o),this.currentPassNumber=0,this.maximumPassNumber=3,n?__.c.StiDataExportMode.Data|__.c.StiDataExportMode.Headers:__.c.StiDataExportMode.AllBands),l=new __.c.StiMatrix(o,!0,this,null,s);if(l.scanComponentsPlacement(!1),this.isStopped)return;if(this.writer.writeLine("TABLE"),this.writer.writeLine("0,1"),this.writer.writeLine('"EXCEL"'),this.writer.writeLine("VECTORS"),this.writer.writeLine(StiString.format("0,{0}",l.coordX.countItems-1)),this.writer.writeLine('""'),this.writer.writeLine("TUPLES"),this.writer.writeLine(StiString.format("0,{0}",l.coordY.countItems-1)),this.writer.writeLine('""'),this.writer.writeLine("DATA"),this.writer.writeLine("0,0"),this.writer.writeLine('""'),this.currentPassNumber=2,n){l.prepareDocument(this,s);for(let r=0;r<l.dataArrayLength;r++){if(this.invokeExporting2(r,l.dataArrayLength-1,this.currentPassNumber,this.maximumPassNumber),this.isStopped)return;this.writer.writeLine("-1,0"),this.writer.writeLine("BOT");for(let i=0;i<l.fields.length;i++){let t=l.fields[i].dataArray[r],e=(null==t&&(t=""),l.fields[i].info[0]!=__.c.StiExportDataType.String);e?(this.writer.writeLine(`0,`+t),this.writer.writeLine("V")):(this.writer.writeLine("1,0"),this.writer.writeLine(`"${t}"`))}}}else for(let a=0;a<l.coordY.countItems-1;a++){if(this.invokeExporting2(a,l.coordY.countItems-1,this.currentPassNumber,this.maximumPassNumber),this.isStopped)return;this.writer.writeLine("-1,0"),this.writer.writeLine("BOT");for(let n=0;n<l.coordX.countItems-1;n++){let e=null,i="",r=l.cells[a][n];if(null!=r){null==(e=r.text)&&(e="");let t=r.component.as(StiText);null!=t&&(i=t.format)}null==e&&(e="");let t=!1;(t=StiString.isNullOrEmpty(i)||"C"!=i[0]&&"N"!=i[0]&&"P"!=i[0]&&"D"!=i[0]&&"T"!=i[0]?t:!0)?(this.writer.writeLine(`0,`+e),this.writer.writeLine("V")):(this.writer.writeLine("1,0"),this.writer.writeLine(`"{text}"`))}}this.writer.writeLine("-1,0"),this.writer.writeLine("EOD"),this.writer.flush(),null!=l&&(l.clear(),l=null)}},__.c.StiJsonExportService=class extends StiExportService{implements(){let t=[__.c.IStiJsonExportService];return(this.implements=()=>t)()}get defaultExtension(){return"json"}get exportFormat(){return __.a.StiExportFormat.Json}get groupCategory(){return"Data"}get position(){return __.c.StiExportPosition.Data}get exportNameInMenu(){return StiLocalization.get("Export","ExportTypeJsonFile")}exportTo(t,e,i){this.exportJson(t,e,i[Stimulsoft.System.StiObject.stimulsoft]().as(__.c.StiDataExportSettings))}exportJson(t,e,i){if(__.a.StiLogService.write(this[Stimulsoft.System.StiObject.stimulsoft]().getType(),"Export report to Json format"),null==Stimulsoft.Base[["St","iL","ic","en","se"].join("")].key&&console.warn("You are using a trial version of the Stimulsoft product!"),null==i)throw"The 'settings' argument cannot be equal in null.";let r=i.dataExportMode,a=CultureInfo.currentCulture.numberFormat.numberDecimalSeparator,n=(this.currentPassNumber=0,this.maximumPassNumber=3,__.a.StiPagesRange.All.getSelectedPages(t.renderedPages)),o=(__.c.StiExportUtils.checkPassive(n),new __.c.StiMatrix(n,!1,this));if(o.scanComponentsPlacement(!1),this.isStopped)return;o.prepareDocument(this,r);let s=new Hashtable;for(let r=0;r<o.fields.length;r++){let t=o.fields[r].name,e="",i=0;while(1){if(!s.contains(t+e))break;i++,e=i[Stimulsoft.System.StiObject.stimulsoft]().toString()}t+=e,o.fields[r].name=t,s.add(t,t)}let l=[];this.currentPassNumber=2;for(let t=0;t<o.dataArrayLength;t++){if(this.invokeExporting2(t,o.dataArrayLength,this.currentPassNumber,this.maximumPassNumber),this.isStopped)return;let n={};for(let r=0;r<o.fields.length;r++){let i=o.fields[r].dataArray[t];switch(o.fields[r].info[0]){case __.c.StiExportDataType.Long:case __.c.StiExportDataType.Int:{let t=StiNumber.tryParse(i,!1),e=t.result;if(t.successfully){n[o.fields[r].name]=e;continue}}break;case __.c.StiExportDataType.Float:case __.c.StiExportDataType.Double:{let t=StiNumber.tryParse(i.split(".").join(",").split(",").join(a)),e=t.result;if(t.successfully){n[o.fields[r].name]=e;continue}}break;case __.c.StiExportDataType.Date:{let t=DateTime.tryParse(i),e=t.result;if(t.successfully){n[o.fields[r].name]=e.toString();continue}}break}n[o.fields[r].name]=i}l.push(n)}let m={},h=__.a.StiNameValidator.correctName(StiString.isNullOrWhiteSpace(t.reportAlias)?t.reportName:t.reportAlias),c=(StiString.isNullOrWhiteSpace(i.tableName)||(h=i.tableName),StiString.isNullOrWhiteSpace(h)&&(h="Table1"),m[h]=l,JSON.stringify(m,null,4)),g=Encoding.UTF8.getBytes(c);e.write(g,0,g.length),e.flush(),null!=o&&(o.clear(),o=null)}};{class qr{equals(t){return this.name==t.name&&this.bold==t.bold&&this.italic==t.italic&&this.underlined==t.underlined&&this.height==t.height&&this.color==t.color}constructor(t,e,i,r,n,a){this.name=t,this.bold=e,this.italic=i,this.underlined=r,this.height=n,this.color=a}}__.c.StiSylkExportService=class extends StiExportService{constructor(){super(...arguments),this.formatList=null,this.fontList=null,this.colorHash=null,this.hiToTwips=14.4*1.02,this.twipsToColinfo=2.438*.921,this.twipsToSymbols=.0094563*.92,this.colorTableSize=64,this.colorTable=[0,16711422,16711680,65280,255,16776960,16711935,65535,0,16711422,16711680,65280,255,16776960,16711935,65535,8388608,32768,128,8421376,8388736,32896,12632256,8421504,10066431,10040166,16777164,13434879,6684774,16744576,26316,13421823,128,16711935,16776960,65535,8388736,8388608,32896,255,52479,13434879,13434828,16777113,10079487,16751052,13408767,16764057,3368703,3394764,10079232,16763904,16750848,16737792,6710937,9868950,13158,3381606,13056,3355392,10040064,10040166,3355545,3355443]}implements(){let t=[__.c.IStiSylkExportService];return(this.implements=()=>t)()}get defaultExtension(){return"slk"}get exportFormat(){return __.a.StiExportFormat.Sylk}get groupCategory(){return"Data"}get position(){return __.c.StiExportPosition.Data}get exportNameInMenu(){return StiLocalization.get("Export","ExportTypeSylkFile")}exportTo(t,e,i){this.exportSylk(t,e,i[Stimulsoft.System.StiObject.stimulsoft]().as(__.c.StiDataExportSettings))}getFontNumber(e){if(4<this.fontList.length)for(let t=4;t<this.fontList.length;t++)if(this.fontList[t].equals(e))return t;this.fontList.push(e);let t=this.fontList.length-1;return t}getFormatNumber(e){if(0<this.formatList.length)for(let t=0;t<this.formatList.length;t++)if(this.formatList[t]==e)return t;this.formatList.push(e);let t=this.formatList.length-1;return t}getColorIndex(r){if(Color.transparent.equals(r))return 0;let t=r.toArgb();if(this.colorHash.containsKey(t))return this.colorHash.get(t);let n=768,a=0;for(let i=0;i<this.colorTableSize;i++){let t=this.colorTable[i],e=Math.abs(r.r-(t>>16&255))+Math.abs(r.g-(t>>8&255))+Math.abs(r.b-(255&t));e<n&&(a=i,n=e)}return a++,this.colorHash.set(t,a),a}exportSylk(t,e,i){if(__.a.StiLogService.write(this[Stimulsoft.System.StiObject.stimulsoft]().getType(),"Export report to Sylk format"),null==Stimulsoft.Base[["St","iL","ic","en","se"].join("")].key&&console.warn("You are using a trial version of the Stimulsoft product!"),!t.isDocument&&t.getCurrentPage().is(IStiDashboard))return;if(null==i)throw"The 'settings' argument cannot be equal in null.";let r=i.pageRange,n=i.exportDataOnly,a=i.encoding,o=(this.fontList=[],new qr("Arial",!1,!1,!1,200,0)),s=(this.getFontNumber(o),this.getFontNumber(o),this.getFontNumber(o),this.getFontNumber(o),this.colorHash=new Hashtable,this.formatList=[],this.getFormatNumber("General"),new MemoryStream),l=(this.writer=new StreamWriter(s,a),r.getSelectedPages(t.renderedPages)),m=(__.c.StiExportUtils.checkPassive(l),this.currentPassNumber=0,this.maximumPassNumber=3,n?__.c.StiDataExportMode.Data|__.c.StiDataExportMode.Headers:__.c.StiDataExportMode.AllBands),h=new __.c.StiMatrix(l,!0,this,null,m);if(this.isStopped)return;if(n){h.scanComponentsPlacement(!0,!1);let e=0,n=new Hashtable,a=null;for(let r=0;r<h.coordY.countItems-1;r++){let t=!1;if(h.linePlacement[r]==__.c.StiTableLineInfo.HeaderD||h.linePlacement[r]==__.c.StiTableLineInfo.HeaderAP){let e=h.parentBandName[r],i=e.indexOf("");if(-1!=i){let t=e.substr(0,i);t!=a&&(a=t,n.clear())}n.containsKey(e)||(t=!0,n.add(e,e))}if(h.linePlacement[r]==__.c.StiTableLineInfo.Data||t){for(let t=0;t<h.coordX.countItems-1;t++)h.cells[e][t]=h.cells[r][t],null!=h.cells[e][t]&&(h.cells[e][t].top=e),0!=e&&null==h.bordersX[r][t]||(h.bordersX[e][t]=h.bordersX[r][t]),h.bordersX[e+1][t]=h.bordersX[r+1][t],h.bordersY[e][t]=h.bordersY[r][t],h.bookmarks[e][t]=h.bookmarks[r][t];h.bordersY[e][h.coordX.countItems-1]=h.bordersY[r][h.coordX.countItems-1];let t=h.coordY.getByIndex(r+1)-h.coordY.getByIndex(r);h.coordY.setByIndex(e+1,h.coordY.getByIndex(e)+t),e++}}let i=h.coordY.countItems-1-e;if(0<i)for(let t=0;t<i;t++)h.coordY.removeAt(e+1)}this.currentPassNumber=2;for(let o=0;o<h.coordY.countItems-1;o++){if(this.invokeExporting2(o,h.coordY.countItems-1,this.currentPassNumber,this.maximumPassNumber),this.isStopped)return;let P=0;for(let t=0;t<h.coordX.countItems-1;t++){let E=null,e=null,y=null,v=null,x=null,A=0,T=!1,F=!1,C=(0<P&&(F=!0,P--),h.cells[o][t]);if(null!=C){let n=C.component.as(StiText),i=(null==(E=StiString.isNullOrEmpty(C.text)?E:C.text)&&(E=""),"");for(let t=0;t<E.length;t++){let e=E.charCodeAt(t);if(e<32){let t=StiString.format("{0}{1}",String.fromCharCode(32+(e>>4&15)),String.fromCharCode(48+(15&e)));i+=t}else i+=String.fromCharCode(e)}E=__.c.StiExportUtils.trimEndWhiteSpace(i),x=C.cellStyle.font,A=this.getColorIndex(C.cellStyle.textColor),Color.transparent.equals(C.cellStyle.color)||C.cellStyle.color.r+C.cellStyle.color.g+C.cellStyle.color.b<544&&(F=!0,P=C.width);let r="",a=(null!=n&&(r=n.format),!1),t=!1,o=!1,s=!1,l=!1,m="",h=2,c=0,g="$",S=!1,p=!1,d=null!=n&&n.hideZeros,u=null,w=null,e=null!=r?r.indexOf("|"):-1;if(-1!=e&&(u=__.c.StiExportUtils.getPositivePattern(r.charCodeAt(e+1)-"A".charCodeAt(0)),w=__.c.StiExportUtils.getNegativePattern(r.charCodeAt(e+2)-"A".charCodeAt(0)),r=r.substr(0,e)),!StiString.isNullOrEmpty(r)&&("C"==r[0]&&(a=!0),"N"==r[0]&&(t=!0),"P"==r[0]&&(o=!0),"D"==r[0]&&(s=!0),"T"==r[0]&&(l=!0),1<r.length)&&(a||t||o)){let e=1;if(Char.isDigit(r[e])){let t="";while(e<r.length&&Char.isDigit(r[e]))t+=r[e],e++;h=Number.parseInt(t)}e<r.length&&"G"==r[e]&&(e++,c=3),e<r.length&&"("==r[e]&&(e++,p=!0),e<r.length&&("+"==r[e]||"-"==r[e])&&("+"==r[e]&&(S=!0),++e<r.length)&&(g=r.substr(e))}if(a||t||o)if(-1!=e){let t=new StringBuilder,e=(1<c&&(t.append("#,"),t.append("#",c-1)),t.append("0"),0<h&&(t.append("."),t.append("0",h)),t.toString()),i=u.split("n").join(e).split("$").join(`"${g}"`),r=w.split("n").join(e).split("$").join(`"${g}"`);m=i+";"+r+(d?";":"")}else{let t=new StringBuilder,e=(a&&1==S&&(t.append('"'),t.append(g),t.append('"')),1<c&&(t.append("#,"),t.append("#",c-1)),t.append("0"),0<h&&(t.append("."),t.append("0",h)),a&&0==S&&(t.append('"'),t.append(g),t.append('"')),o&&t.append("%"),m=t.toString(),(p?"(":"-")+m+(p?")":""));null!=n&&n.hideZeros?m=m+";"+e+";":p&&(m=m+";"+e)}s&&(m="dd/mm/yyyy"),""!=(m=l?"[$-F400]h:mm:ss\\ AM/PM":m)&&(v=StiString.format("P{0};",this.getFormatNumber(m)));let f="G0",b=(t&&(f=StiString.format("F{0}",h)),a&&(f=StiString.format("${0}",h)),o&&(f=StiString.format("%{0}",h)),"L");if(C.cellStyle.horAlignment==StiTextHorAlignment.Right&&(b="R"),C.cellStyle.horAlignment==StiTextHorAlignment.Center&&(b="C"),C.cellStyle.horAlignment==StiTextHorAlignment.Width&&(b="X"),y=StiString.format("F{0}{1};",f,b),null!=n&&null!=n.excelDataValue&&"-"!=n.excelDataValue){let i=0,t=n.excelDataValue,e=CultureInfo.currentCulture.numberFormat.numberDecimalSeparator,r=t.split(".").join(",").split(",").join(e);T=!0;try{if(s||l){let t=DateTime.tryParse(r),e=t.result;t.successfully?i=s?e.subtract(new DateTime(1900,1,1)).days+1+1:e.timeOfDay.totalSeconds/86400:T=!1}else{let t=StiNumber.tryParse(r);i=t.result,t.successfully||(T=!1)}}catch(t){T=!1}T&&(E=i.toString().split(",").join("."))}}let i=null!=h.bordersX[o][t],r=null!=h.bordersX[o][t+1],n=null!=h.bordersX[o][t],a=null!=h.bordersX[o+1][t];if(i||r||n||a||null!=x||F){let t=0;null!=x&&(t=this.getFontNumber(new qr(x.name,x.bold,x.italic,x.underline,Math.trunc(20*x.sizeInPoints),A))),e=StiString.format("S{0}{1}{2}{3}{4}{5}{6}{7};",null!=x&&x.bold?"D":"",null!=x&&x.italic?"I":"",i?"L":"",r?"R":"",n?"T":"",a?"B":"",F?"S":"",null!=x?StiString.format("M{0}",t+1):"")}null==y&&null==e&&null==E&&null==v||(this.writer.writeLine(StiString.format("F;{0}{1}{2}Y{3};X{4}",v,y,e,o+1,t+1)),StiString.isNullOrEmpty(E))||(T?this.writer.writeLine(`C;K`+E):this.writer.writeLine(`C;K"${E}"`))}}this.writer.flush(),this.writer=new StreamWriter(e,a),this.writer.writeLine("ID;PWXL;N;E");for(let t=0;t<this.formatList.length;t++)this.writer.writeLine(`P;P`+this.formatList[t]);for(let i=0;i<this.fontList.length;i++){let t=this.fontList[i],e="P;";e+=StiString.format("{0}{1};M{2}",i<4?"F":"E",t.name,t.height),(t.bold||t.italic||t.underlined)&&(e+=";S",t.bold&&(e+="B"),t.italic&&(e+="I"),t.underlined)&&(e+="U"),0!=t.color&&(e+=StiString.format(";L{0}",t.color)),this.writer.writeLine(e)}this.writer.writeLine("F;P0;DG0G8;M255"),this.writer.writeLine(StiString.format("B;Y{0};X{1};D0 0 {2} {3}",h.coordY.countItems-1,h.coordX.countItems-1,h.coordY.countItems-2,h.coordX.countItems-2));for(let r=1;r<h.coordX.countItems;r++){let t=h.coordX.getByIndex(r),e=h.coordX.getByIndex(r-1),i=Math.trunc(Math.round((t-e)*this.hiToTwips*this.twipsToSymbols));0==i&&i++,this.writer.writeLine(`F;W${r} ${r} `+i)}for(let e=1;e<h.coordY.countItems;e++){let t=Math.round((h.coordY.getByIndex(e)-h.coordY.getByIndex(e-1))*this.hiToTwips);0==t&&t++,this.writer.writeLine(`F;M${t};R`+e)}this.writer.flush(),s.writeTo(e),this.writer.writeLine("E"),this.writer.flush(),null!=h&&(h.clear(),h=null),this.formatList=null,this.fontList=null,this.colorHash=null}}}let DataSet=Stimulsoft.System.Data.DataSet,DataTable=Stimulsoft.System.Data.DataTable,DataColumn=Stimulsoft.System.Data.DataColumn;__.c.StiXmlExportService=class extends StiExportService{implements(){let t=[__.c.IStiXmlExportService];return(this.implements=()=>t)()}get defaultExtension(){return"xml"}get exportFormat(){return __.a.StiExportFormat.Xml}get groupCategory(){return"Data"}get position(){return __.c.StiExportPosition.Data}get exportNameInMenu(){return StiLocalization.get("Export","ExportTypeXmlFile")}exportTo(t,e,i){this.exportXml(t,e,i[Stimulsoft.System.StiObject.stimulsoft]().as(__.c.StiDataExportSettings))}exportXml(t,e,i){if(__.a.StiLogService.write(this[Stimulsoft.System.StiObject.stimulsoft]().getType(),"Export report to Xml format"),null==Stimulsoft.Base[["St","iL","ic","en","se"].join("")].key&&console.warn("You are using a trial version of the Stimulsoft product!"),!t.isDocument&&t.getCurrentPage().is(IStiDashboard))return;if(null==i)throw"The 'settings' argument cannot be equal in null.";let r=i.dataExportMode,a=CultureInfo.currentCulture.numberFormat.numberDecimalSeparator,n=(this.currentPassNumber=0,this.maximumPassNumber=3,__.a.StiPagesRange.All.getSelectedPages(t.renderedPages)),o=(__.c.StiExportUtils.checkPassive(n),new __.c.StiMatrix(n,!1,this));if(o.scanComponentsPlacement(!1),this.isStopped)return;o.prepareDocument(this,r);let s=new Hashtable;for(let r=0;r<o.fields.length;r++){let t=o.fields[r].name,e=(t=t.toUpperCase(),""),i=0;while(1){if(!s.contains(t+e))break;i++,e=i.toString()}t+=e,o.fields[r].name=t,s.add(t,t)}let l=__.a.StiNameValidator.correctName(StiString.isNullOrWhiteSpace(t.reportAlias)?t.reportName:t.reportAlias),m=(StiString.isNullOrWhiteSpace(l)&&(l="Report"),new DataSet(l)),h=(m.enforceConstraints=!1,new DataTable);StiString.isNullOrWhiteSpace(i.tableName)||(h.tableName=i.tableName);for(let t=0;t<o.fields.length;t++)switch(o.fields[t].info[0]){case __.c.StiExportDataType.String:h.columns.add(new DataColumn(o.fields[t].name,String));break;case __.c.StiExportDataType.Int:case __.c.StiExportDataType.Long:case __.c.StiExportDataType.Float:case __.c.StiExportDataType.Double:h.columns.add(new DataColumn(o.fields[t].name,Number));break;case __.c.StiExportDataType.Date:h.columns.add(new DataColumn(o.fields[t].name,DateTime));break}m.tables.add(h),this.currentPassNumber=2;for(let t=0;t<o.dataArrayLength;t++){if(this.invokeExporting2(t,o.dataArrayLength,this.currentPassNumber,this.maximumPassNumber),this.isStopped)return;let n=h.newRow();for(let r=0;r<o.fields.length;r++){let i=o.fields[r].dataArray[t];switch(o.fields[r].info[0]){case __.c.StiExportDataType.String:n.sett(r,i);break;case __.c.StiExportDataType.Int:case __.c.StiExportDataType.Long:{let t=StiNumber.tryParse(i.split(".").join(",").split(",").join(a),!1),e=t.result;t.successfully&&n.sett(r,e)}break;case __.c.StiExportDataType.Float:case __.c.StiExportDataType.Double:{let t=StiNumber.tryParse(i.split(".").join(",").split(",").join(a)),e=t.result;t.successfully&&n.sett(r,e)}break;case __.c.StiExportDataType.Date:{let t=DateTime.tryParse(i),e=t.result;t.successfully&&n.sett(r,e)}break}}h.rows.add(n)}this.writeDataSetToStream(m,e,i),null!=o&&(o.clear(),o=null)}writeDataSetToStream(t,e,i){let r=new XmlTextWriter(Encoding.UTF8,e);r.indentation=1,r.formatting=Formatting.Indented,r.writeRaw(t.writeXml(!1)),t.dispose(),r.flush()}},__.c.StiBmpHelper=class{static dwByte(t,e,i){t[e]=i}static dwByte2(t,e,i,r){this.dwByte(t,e,i),this.dwByte(t,e+1,r)}static dwWord(t,e,i){t[e+0]=255&i,t[e+1]=i>>8&255}static dwDWord(t,e,i){t[e+0]=255&i,t[e+1]=i>>8&255,t[e+2]=i>>16&255,t[e+3]=i>>24&255}static saveToStream(n,t,s,e){let l=n.width,m=n.height,i=4*l,h=[],a=0;for(let t=0;t<m;t++)for(let t=0;t<l;t++){let t=n.imageData[a++],e=n.imageData[a++],i=n.imageData[a++],r=n.imageData[a++];h.push(i),h.push(e),h.push(t),h.push(r)}let c=0,g=null,r;if(t==__.c.StiPcxPaletteType.Monochrome){let a=StiArray.create2(Number,m+1,l+1);for(let e=0;e<m;e++)for(let t=0;t<l;t++)a[e][t]=128;let o=[[1,9,3,11],[13,5,15,7],[4,12,2,10],[16,8,14,6]];for(let n=0;n<m;n++){let t=n*i;for(let r=0;r<l;r++){let e=Math.trunc(.3*h[t+2]+.59*h[t+1]+.11*h[t+0]),i=(t+=4,0);if(s==__.c.StiMonochromeDitheringType.None&&(i=128<=e?255:0),s==__.c.StiMonochromeDitheringType.FloydSteinberg){e+=a[n][r]-128,i=128<=e?255:0;let t=e-i;a[n][r+1]+=Math.trunc(7/16*t),0!=r&&(a[n+1][r-1]+=Math.trunc(3/16*t)),a[n+1][r+0]+=Math.trunc(5/16*t),a[n+1][r+1]+=Math.trunc(1/16*t)}s==__.c.StiMonochromeDitheringType.Ordered&&(i=Math.trunc(e>=255/17*o[3&r][3&n]?255:0)),a[n][r]=i}}c=4*(Math.trunc((l-1)/32)+1),r=c*m,g=[];for(let n=0;n<m;n++){let e=128,i=(m-1-n)*c,r=0;for(let t=0;t<l;t++)0!=a[n][t]&&(r|=e),0==(e>>=1)&&(g[i]=r,r=0,e=128,i++);128!=e&&(g[i]=r)}}if(t==__.c.StiPcxPaletteType.Color){let e=(4-3*l%4)%4,t=l<<2,r=m;g=[];do{let i=t*(r-1);for(let e=0;e<l;e++){let t=e<<2;g.push(h[i+t]),g.push(h[i+t+1]),g.push(h[i+t+2])}for(let t=0;t<e;t++)g.push(0)}while(--r)}let o=62,S=o+r,p=StiArray.create(Number,o);this.dwByte2(p,0,66,77),this.dwDWord(p,2,S),this.dwDWord(p,6,0),this.dwDWord(p,10,62),this.dwDWord(p,14,40),this.dwDWord(p,18,l),this.dwDWord(p,22,m),this.dwWord(p,26,1),t==__.c.StiPcxPaletteType.Monochrome&&this.dwWord(p,28,1),t==__.c.StiPcxPaletteType.Color&&this.dwByte(p,28,24),this.dwDWord(p,30,0),this.dwDWord(p,34,r),this.dwDWord(p,38,3937),this.dwDWord(p,42,3937),this.dwDWord(p,46,0),this.dwDWord(p,50,0),this.dwDWord(p,54,0),this.dwDWord(p,58,16777215),e.write(p,0,o),e.write(g,0,r),e.flush()}};{class ev{constructor(t,e,i){this.exports={},this.netsize=256,this.prime1=499,this.prime2=491,this.prime3=487,this.prime4=503,this.minpicturebytes=3*this.prime4,this.maxnetpos=this.netsize-1,this.netbiasshift=4,this.ncycles=100,this.intbiasshift=16,this.intbias=1<<this.intbiasshift,this.gammashift=10,this.gamma=1<<this.gammashift,this.betashift=10,this.beta=this.intbias>>this.betashift,this.betagamma=this.intbias<<this.gammashift-this.betashift,this.initrad=this.netsize>>3,this.radiusbiasshift=6,this.radiusbias=1<<this.radiusbiasshift,this.initradius=this.initrad*this.radiusbias,this.radiusdec=30,this.alphabiasshift=10,this.initalpha=1<<this.alphabiasshift,this.radbiasshift=8,this.radbias=1<<this.radbiasshift,this.alpharadbshift=this.alphabiasshift+this.radbiasshift,this.alpharadbias=1<<this.alpharadbshift,this.netindex=[],this.bias=[],this.freq=[],this.radpower=[];let r,n;for(this.thepicture=t,this.lengthcount=e,this.samplefac=i,this.network=new Array(this.netsize),r=0;r<this.netsize;r++)this.network[r]=new Array(4),(n=this.network[r])[0]=n[1]=n[2]=(r<<this.netbiasshift+8)/this.netsize,this.freq[r]=this.intbias/this.netsize,this.bias[r]=0}colorMap(){let i=[],r=new Array(this.netsize);for(let t=0;t<this.netsize;t++)r[this.network[t][3]]=t;let n=0;for(let e=0;e<this.netsize;e++){let t=r[e];i[n++]=this.network[t][0],i[n++]=this.network[t][1],i[n++]=this.network[t][2]}return i}inxbuild(){let t,e,i,r,n,a,o,s;for(o=0,s=0,t=0;t<this.netsize;t++){for(n=this.network[t],i=t,r=n[1],e=t+1;e<this.netsize;e++)(a=this.network[e])[1]<r&&(i=e,r=a[1]);if(a=this.network[i],t!=i&&(e=a[0],a[0]=n[0],n[0]=e,e=a[1],a[1]=n[1],n[1]=e,e=a[2],a[2]=n[2],n[2]=e,e=a[3],a[3]=n[3],n[3]=e),r!=o){for(this.netindex[o]=s+t>>1,e=o+1;e<r;e++)this.netindex[e]=t;o=r,s=t}}for(this.netindex[o]=s+this.maxnetpos>>1,e=o+1;e<256;e++)this.netindex[e]=this.maxnetpos}learn(){let t,e,i,r,n,a,o,s,l,m,h,c,g,S;for(this.lengthcount<this.minpicturebytes&&(this.samplefac=1),this.alphadec=30+(this.samplefac-1)/3,c=this.thepicture,g=0,S=this.lengthcount,h=this.lengthcount/(3*this.samplefac),m=h/this.ncycles|0,s=this.initalpha,a=this.initradius,(o=a>>this.radiusbiasshift)<=1&&(o=0),t=0;t<o;t++)this.radpower[t]=s*((o*o-t*t)*this.radbias/(o*o));l=this.lengthcount<this.minpicturebytes?3:this.lengthcount%this.prime1!=0?3*this.prime1:this.lengthcount%this.prime2!=0?3*this.prime2:this.lengthcount%this.prime3!=0?3*this.prime3:3*this.prime4,t=0;while(t<h)if(i=(255&c[g+0])<<this.netbiasshift,r=(255&c[g+1])<<this.netbiasshift,n=(255&c[g+2])<<this.netbiasshift,e=this.contest(i,r,n),this.altersingle(s,e,i,r,n),0!==o&&this.alterneigh(o,e,i,r,n),(g+=l)>=S&&(g-=this.lengthcount),t++,0===m&&(m=1),t%m==0)for(s-=s/this.alphadec,a-=a/this.radiusdec,(o=a>>this.radiusbiasshift)<=1&&(o=0),e=0;e<o;e++)this.radpower[e]=s*((o*o-e*e)*this.radbias/(o*o))}map(t,e,i){let r,n,a,o,s,l,m;s=1e3,m=-1,r=this.netindex[e],n=r-1;while(r<this.netsize||0<=n)r<this.netsize&&(l=this.network[r],(a=l[1]-e)>=s?r=this.netsize:(r++,a<0&&(a=-a),(o=l[0]-t)<0&&(o=-o),(a+=o)<s&&((o=l[2]-i)<0&&(o=-o),(a+=o)<s)&&(s=a,m=l[3]))),0<=n&&(l=this.network[n],(a=e-l[1])>=s?n=-1:(n--,a<0&&(a=-a),(o=l[0]-t)<0&&(o=-o),(a+=o)<s&&((o=l[2]-i)<0&&(o=-o),(a+=o)<s)&&(s=a,m=l[3])));return m}process(){return this.learn(),this.unbiasnet(),this.inxbuild(),this.colorMap()}unbiasnet(){let t;for(t=0;t<this.netsize;t++)this.network[t][0]>>=this.netbiasshift,this.network[t][1]>>=this.netbiasshift,this.network[t][2]>>=this.netbiasshift,this.network[t][3]=t}alterneigh(t,e,i,r,n){let a,o,s,l,m,h,c;(s=e-t)<-1&&(s=-1),(l=e+t)>this.netsize&&(l=this.netsize),a=e+1,o=e-1,h=1;while(a<l||o>s){if(m=this.radpower[h++],a<l){c=this.network[a++];try{c[0]-=m*(c[0]-i)/this.alpharadbias,c[1]-=m*(c[1]-r)/this.alpharadbias,c[2]-=m*(c[2]-n)/this.alpharadbias}catch(t){}}if(o>s){c=this.network[o--];try{c[0]-=m*(c[0]-i)/this.alpharadbias,c[1]-=m*(c[1]-r)/this.alpharadbias,c[2]-=m*(c[2]-n)/this.alpharadbias}catch(t){}}}}altersingle(t,e,i,r,n){let a=this.network[e];a[0]-=t*(a[0]-i)/this.initalpha,a[1]-=t*(a[1]-r)/this.initalpha,a[2]-=t*(a[2]-n)/this.initalpha}contest(t,e,i){let r,n,a,o,s,l,m,h,c,g;for(h=~(1<<31),c=h,l=-1,m=l,r=0;r<this.netsize;r++)g=this.network[r],(n=g[0]-t)<0&&(n=-n),(a=g[1]-e)<0&&(a=-a),n+=a,(a=g[2]-i)<0&&(a=-a),(n+=a)<h&&(h=n,l=r),(o=n-(this.bias[r]>>this.intbiasshift-this.netbiasshift))<c&&(c=o,m=r),s=this.freq[r]>>this.betashift,this.freq[r]-=s,this.bias[r]+=s<<this.gammashift;return this.freq[l]+=this.beta,this.bias[l]-=this.betagamma,m}}class fv{constructor(t,e,i,r){this.exports={},this.EOF=-1,this.BITS=12,this.HSIZE=5003,this.maxbits=this.BITS,this.maxmaxcode=1<<this.BITS,this.htab=[],this.codetab=[],this.hsize=this.HSIZE,this.free_ent=0,this.clear_flg=!1,this.cur_accum=0,this.cur_bits=0,this.masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],this.accum=[],this.imgW=t,this.imgH=e,this.pixAry=i,this.initCodeSize=Math.max(2,r)}char_out(t,e){this.accum[this.a_count++]=t,254<=this.a_count&&this.flush_char(e)}cl_block(t){this.cl_hash(this.hsize),this.free_ent=this.ClearCode+2,this.clear_flg=!0,this.output(this.ClearCode,t)}cl_hash(e){for(let t=0;t<e;++t)this.htab[t]=-1}compress(t,e){let i,r,n,a,o,s,l;for(this.g_init_bits=t,this.clear_flg=!1,this.n_bits=this.g_init_bits,this.maxcode=this.MAXCODE(this.n_bits),this.ClearCode=1<<t-1,this.EOFCode=this.ClearCode+1,this.free_ent=this.ClearCode+2,this.a_count=0,a=this.nextPixel(),l=0,i=this.hsize;i<65536;i*=2)++l;l=8-l,s=this.hsize,this.cl_hash(s),this.output(this.ClearCode,e);t:while((n=this.nextPixel())!=this.EOF){if(i=(n<<this.maxbits)+a,r=n<<l^a,this.htab[r]==i){a=this.codetab[r];continue}if(0<=this.htab[r]){o=s-r,0===r&&(o=1);do{if((r-=o)<0&&(r+=s),this.htab[r]==i){a=this.codetab[r];continue t}}while(0<=this.htab[r])}this.output(a,e),a=n,this.free_ent<this.maxmaxcode?(this.codetab[r]=this.free_ent++,this.htab[r]=i):this.cl_block(e)}this.output(a,e),this.output(this.EOFCode,e)}encode(t){t.writeByte(this.initCodeSize),this.remaining=this.imgW*this.imgH,this.curPixel=0,this.compress(this.initCodeSize+1,t),t.writeByte(0)}flush_char(t){0<this.a_count&&(t.writeByte(this.a_count),t.writeBytes(this.accum,0,this.a_count),this.a_count=0)}MAXCODE(t){return(1<<t)-1}nextPixel(){if(0===this.remaining)return this.EOF;--this.remaining;let t=this.pixAry[this.curPixel++];return 255&t}output(t,e){this.cur_accum&=this.masks[this.cur_bits],0<this.cur_bits?this.cur_accum|=t<<this.cur_bits:this.cur_accum=t,this.cur_bits+=this.n_bits;while(8<=this.cur_bits)this.char_out(255&this.cur_accum,e),this.cur_accum>>=8,this.cur_bits-=8;if((this.free_ent>this.maxcode||this.clear_flg)&&(this.clear_flg?(this.maxcode=this.MAXCODE(this.n_bits=this.g_init_bits),this.clear_flg=!1):(++this.n_bits,this.n_bits==this.maxbits?this.maxcode=this.maxmaxcode:this.maxcode=this.MAXCODE(this.n_bits))),t==this.EOFCode){while(0<this.cur_bits)this.char_out(255&this.cur_accum,e),this.cur_accum>>=8,this.cur_bits-=8;this.flush_char(e)}}}class gv{constructor(){this.chr={},this.bin=[];for(let t=0;t<256;t++)this.chr[t]=String.fromCharCode(t)}getData(){let e="",i=this.bin.length;for(let t=0;t<i;t++)e+=this.chr[this.bin[t]];return e}writeByte(t){this.bin.push(t)}writeUTFBytes(i){for(let t=i.length,e=0;e<t;e++)this.writeByte(i.charCodeAt(e))}writeBytes(i,r,n){for(let t=n||i.length,e=r||0;e<t;e++)this.writeByte(i[e])}}class hv{constructor(){this.exports={},this.transparent=null,this.repeat=-1,this.delay=0,this.started=!1,this.usedEntry=[],this.palSize=7,this.dispose=-1,this.closeStream=!1,this.firstFrame=!0,this.sizeSet=!1,this.sample=10,this.comment=""}setDelay(t){this.delay=Math.round(t/10)}setDispose(t){0<=t&&(this.dispose=t)}setRepeat(t){0<=t&&(this.repeat=t)}setTransparent(t){this.transparent=t}setComment(t){this.comment=t}addFrame(t,e){if(null===t||!this.started||null===this.out)throw new Error("Please call start method before calling addFrame");let i=!0;try{e?t instanceof Array?t.length==this.width*this.height*4?this.image=t:(console.log("Please set the correct size: ImageData length mismatch"),i=!1):(console.log("Please provide correct input"),i=!1):(this.image=t.getImageData(0,0,t.canvas.width,t.canvas.height).data,this.sizeSet||this.setSize(t.canvas.width,t.canvas.height)),this.getImagePixels(),this.analyzePixels(),this.firstFrame&&(this.writeLSD(),this.writePalette(),0<=this.repeat)&&this.writeNetscapeExt(),this.writeGraphicCtrlExt(),""!==this.comment&&this.writeCommentExt(),this.writeImageDesc(),this.firstFrame||this.writePalette(),this.writePixels(),this.firstFrame=!1}catch(t){i=!1}return i}download(e){if(null===this.out||0==this.closeStream)console.log("Please call start method and add frames and call finish method before calling download");else{e=void 0!==e?e.endsWith(".gif")?e:e+".gif":"download.gif";let t=document.createElement("a");t.download=e,t.href=URL.createObjectURL(new Blob([new Uint8Array(this.out.bin)],{type:"image/gif"})),t.click()}}finish(){if(!this.started)return!1;let e=!0;this.started=!1;try{this.out.writeByte(59),this.closeStream=!0}catch(t){e=!1}return e}reset(){this.transIndex=0,this.image=null,this.pixels=null,this.indexedPixels=null,this.colorTab=null,this.closeStream=!1,this.firstFrame=!0}setFrameRate(t){15!=t&&(this.delay=Math.round(100/t))}setQuality(t){this.sample=t=t<1?1:t}setSize(t,e){if(this.started&&!this.firstFrame)return;this.width=t,this.height=e,this.width<1&&(this.width=320),this.height<1&&(this.height=240),this.sizeSet=!0}start(){this.reset();let e=!0;this.closeStream=!1,this.out=new gv;try{this.out.writeUTFBytes("GIF89a")}catch(t){e=!1}return this.started=e}cont(){this.reset();let t=!0;return this.closeStream=!1,this.out=new gv,this.started=t}analyzePixels(){let t=this.pixels.length,i=t/3,r=(this.indexedPixels=[],new ev(this.pixels,t,this.sample)),n=(this.colorTab=r.process(),0);for(let e=0;e<i;e++){let t=r.map(255&this.pixels[n++],255&this.pixels[n++],255&this.pixels[n++]);this.usedEntry[t]=!0,this.indexedPixels[e]=t}this.pixels=null,this.colorDepth=8,this.palSize=7,null!==this.transparent&&(this.transIndex=this.findClosest(this.transparent))}findClosest(t){if(null===this.colorTab)return-1;let o=(16711680&t)>>16,s=(65280&t)>>8,l=255&t,m=0,h=256*256*256,e=this.colorTab.length;for(let a=0;a<e;){let t=o-(255&this.colorTab[a++]),e=s-(255&this.colorTab[a++]),i=l-(255&this.colorTab[a]),r=t*t+e*e+i*i,n=a/3;this.usedEntry[n]&&r<h&&(h=r,m=n),a++}return m}getImagePixels(){let r=this.width,t=this.height,n=(this.pixels=[],this.image),a=0;for(let i=0;i<t;i++)for(let e=0;e<r;e++){let t=i*r*4+4*e;this.pixels[a++]=n[t],this.pixels[a++]=n[t+1],this.pixels[a++]=n[t+2]}}writeGraphicCtrlExt(){this.out.writeByte(33),this.out.writeByte(249),this.out.writeByte(4);let t,e;e=null===this.transparent?t=0:(t=1,2),0<=this.dispose&&(e=7&this.dispose),e<<=2,this.out.writeByte(0|e|0|t),this.WriteShort(this.delay),this.out.writeByte(this.transIndex),this.out.writeByte(0)}writeCommentExt(){this.out.writeByte(33),this.out.writeByte(254),this.out.writeByte(this.comment.length),this.out.writeUTFBytes(this.comment),this.out.writeByte(0)}writeImageDesc(){this.out.writeByte(44),this.WriteShort(0),this.WriteShort(0),this.WriteShort(this.width),this.WriteShort(this.height),this.firstFrame?this.out.writeByte(0):this.out.writeByte(128|0|0|0|this.palSize)}writeLSD(){this.WriteShort(this.width),this.WriteShort(this.height),this.out.writeByte(128|112|0|this.palSize),this.out.writeByte(0),this.out.writeByte(0)}writeNetscapeExt(){this.out.writeByte(33),this.out.writeByte(255),this.out.writeByte(11),this.out.writeUTFBytes("NETSCAPE"+"2.0"),this.out.writeByte(3),this.out.writeByte(1),this.WriteShort(this.repeat),this.out.writeByte(0)}writePalette(){this.out.writeBytes(this.colorTab);let e=3*256-this.colorTab.length;for(let t=0;t<e;t++)this.out.writeByte(0)}WriteShort(t){this.out.writeByte(255&t),this.out.writeByte(t>>8&255)}writePixels(){let t=new fv(this.width,this.height,this.indexedPixels,this.colorDepth);t.encode(this.out)}stream(){return this.out}setProperties(t,e){this.started=t,this.firstFrame=e}}__.c.StiGifHelper=class{static saveToStream(n,t,s,e){let i=n.width,r=n.height,l=4*i,m=[],a=0;for(let t=0;t<r;t++)for(let t=0;t<i;t++){let t=n.imageData[a++],e=n.imageData[a++],i=n.imageData[a++],r=n.imageData[a++];m.push(i),m.push(e),m.push(t),m.push(r)}let h=null;if(t==__.c.StiPcxPaletteType.Monochrome){let a=StiArray.create2(Number,r+1,i+1);for(let e=0;e<r;e++)for(let t=0;t<i;t++)a[e][t]=128;let o=[[1,9,3,11],[13,5,15,7],[4,12,2,10],[16,8,14,6]];for(let n=0;n<r;n++){let t=n*l;for(let r=0;r<i;r++){let e=Math.trunc(.3*m[t+2]+.59*m[t+1]+.11*m[t+0]),i=(t+=4,0);if(s==__.c.StiMonochromeDitheringType.None&&(i=128<=e?255:0),s==__.c.StiMonochromeDitheringType.FloydSteinberg){e+=a[n][r]-128,i=128<=e?255:0;let t=e-i;a[n][r+1]+=Math.trunc(7/16*t),0!=r&&(a[n+1][r-1]+=Math.trunc(3/16*t)),a[n+1][r+0]+=Math.trunc(5/16*t),a[n+1][r+1]+=Math.trunc(1/16*t)}s==__.c.StiMonochromeDitheringType.Ordered&&(i=Math.trunc(e>=255/17*o[3&r][3&n]?255:0)),a[n][r]=i}}h=[];for(let e=0;e<r;e++)for(let t=0;t<i;t++)h.push(a[e][t]),h.push(a[e][t]),h.push(a[e][t]),h.push(0)}if(t==__.c.StiPcxPaletteType.Color){h=[];let n=0;for(let t=0;t<r;t++)for(let t=0;t<i;t++){let t=m[n++],e=m[n++],i=m[n++],r=m[n++];h.push(i),h.push(e),h.push(t),h.push(r)}}let o=new hv,c=(o.start(),o.width=n.width,o.height=n.height,o.addFrame(h,!0),o.finish(),o.stream().bin);e.writeBytes(c)}}}let BitConverter=__.a.Import.BitConverter,BinaryWriter=Stimulsoft.Base.CompoundDocument.BinaryWriter,CompoundDocument=Stimulsoft.Base.CompoundDocument.CompoundDocument;{class StiOfficeEncryptedPackageHelper{static EncryptPackage(t,e,i){let r=new __.d.StiOfficeEncryptionInfo,n=r.keyEncryptors[0],a=(r.keyData.saltValue=this.getRandomBytes(16),n.saltValue=this.getRandomBytes(16),n.keyValue=this.getRandomBytes(n.keyBits/8),this.GetHashProvider(n)),o=this.GetPasswordHashSpinPrepending(a,n.saltValue,e,n.spinCount,n.hashSize),s=this.EncryptData(t,r,a),l=this.getRandomBytes(64),m=(this.SetHMAC(r,a,l,s),n.verifierHashInput=this.getRandomBytes(16),n.verifierHash=a.computeHash(n.verifierHashInput),this.GetFinalHash(a,this.BlockKey_HashInput,o)),h=this.GetFinalHash(a,this.BlockKey_HashValue,o),c=this.GetFinalHash(a,this.BlockKey_KeyValue,o),g=new MemoryStream,S=(this.EncryptAgileFromKey(n,m,n.verifierHashInput,0,n.verifierHashInput.length,n.saltValue,g),n.encryptedVerifierHashInput=g.toArray(),g.close(),g=new MemoryStream,this.EncryptAgileFromKey(n,h,n.verifierHash,0,n.verifierHash.length,n.saltValue,g),n.encryptedVerifierHashValue=g.toArray(),g.close(),g=new MemoryStream,this.EncryptAgileFromKey(n,c,n.keyValue,0,n.keyValue.length,n.saltValue,g),n.encryptedKeyValue=g.toArray(),g.close(),new CompoundDocument);this.MakeDataSpaces(S),S.Storage.DataStreams.add("EncryptionInfo",r.saveToBinary()),S.Storage.DataStreams.add("EncryptedPackage",s),S.Save(i)}static EncryptData(r,n,a){let o=n.keyEncryptors[0],s=0,l=0,m=new MemoryStream;m.write(BitConverter.getBytesInt32(r.length),0,4),m.writeByte(0),m.writeByte(0),m.writeByte(0),m.writeByte(0);while(s<r.length){let t=4096<r.length-s?4096:r.length-s,e=[],i=(StiArray.copy2(n.keyData.saltValue,0,e,0,n.keyData.saltSize),StiArray.copy2(BitConverter.getBytesInt32(l),0,e,n.keyData.saltSize,4),a.computeHash(e));this.EncryptAgileFromKey(o,o.keyValue,r,s,t,i,m),s+=t,l++}return m.flush(),m.toArray()}static SetHMAC(t,e,i,r){let n=this.GetFinalHash(e,this.BlockKey_HmacKey,t.keyData.saltValue),a=new MemoryStream,o=(this.EncryptAgileFromKey(t.keyEncryptors[0],t.keyEncryptors[0].keyValue,i,0,i.length,n,a),t.dataIntegrity.encryptedHmacKey=a.toArray(),a.close(),this.GetHmacProvider(t.keyEncryptors[0],i)),s=o.computeHash(r);a=new MemoryStream,n=this.GetFinalHash(e,this.BlockKey_HmacValue,t.keyData.saltValue),this.EncryptAgileFromKey(t.keyEncryptors[0],t.keyEncryptors[0].keyValue,s,0,s.length,n,a),t.dataIntegrity.encryptedHmacValue=a.toArray(),a.close()}static MakeDataSpaces(t){let e=new Stimulsoft.Base.CompoundDocument.StoragePart,i=(t.Storage.SubStorage.add(""+"DataSpaces",e),e.DataStreams.add("Version",StiOfficeEncryptedPackageHelper.CreateVersionStream()),e.DataStreams.add("DataSpaceMap",this.CreateDataSpaceMap()),new Stimulsoft.Base.CompoundDocument.StoragePart),r=(e.SubStorage.add("DataSpaceInfo",i),i.DataStreams.add("StrongEncryptionDataSpace",StiOfficeEncryptedPackageHelper.CreateStrongEncryptionDataSpaceStream()),new Stimulsoft.Base.CompoundDocument.StoragePart),n=(e.SubStorage.add("TransformInfo",r),new Stimulsoft.Base.CompoundDocument.StoragePart);r.SubStorage.add("StrongEncryptionTransform",n),n.DataStreams.add("Primary",StiOfficeEncryptedPackageHelper.CreateTransformInfoPrimary())}static CreateStrongEncryptionDataSpaceStream(){let t="StrongEncryptionTransform",e=new BinaryWriter;return e.writeInt32(8),e.writeInt32(1),e.writeInt32(2*t.length),e.write(Stimulsoft.System.Text.Encoding.Unicode.getBytes(t+"\0")),e.flush(),e.toArray()}static CreateVersionStream(){let t=new BinaryWriter;return t.writeInt16(60),t.writeInt16(0),t.write(Encoding.Unicode.getBytes("Microsoft.Container.DataSpaces")),t.writeInt32(1),t.writeInt32(1),t.writeInt32(1),t.flush(),t.toArray()}static CreateDataSpaceMap(){let t=new BinaryWriter,e=(t.writeInt32(8),t.writeInt32(1),"EncryptedPackage"),i="StrongEncryptionDataSpace";return t.writeInt32(2*(e.length+i.length)+22),t.writeInt32(1),t.writeInt32(0),t.writeInt32(2*e.length),t.write(Encoding.Unicode.getBytes(e)),t.writeInt32(2*i.length),t.write(Encoding.Unicode.getBytes(i+"\0")),t.flush(),t.toArray()}static CreateTransformInfoPrimary(){let t=new BinaryWriter,e="{FF9A3F03-56EF-4613-BDD5-5A41C1D07246}",i="Microsoft.Container.EncryptionTransform";return t.writeInt32(2*e.length+12),t.writeInt32(1),t.writeInt32(2*e.length),t.write(Encoding.Unicode.getBytes(e)),t.writeInt32(2*i.length),t.write(Encoding.Unicode.getBytes(i+"\0")),t.writeInt32(1),t.writeInt32(1),t.writeInt32(1),t.writeInt32(0),t.writeInt32(0),t.writeInt32(0),t.writeInt32(4),t.flush(),t.toArray()}static GetHashProvider(t){switch(t.hashAlgorithm){case __.d.StiOfficeHashAlgorithm.SHA512:return new Stimulsoft.System.Crypt.SHA512;default:throw new Error(StiString.format("Hash provider is unsupported. {0}",t.hashAlgorithm))}}static GetHmacProvider(t,e){switch(t.hashAlgorithm){case __.d.StiOfficeHashAlgorithm.SHA512:return new Stimulsoft.System.Crypt.HMACSHA512(e);default:throw new Error(StiString.format("Hash method {0} not supported.",t.hashAlgorithm))}}static IsPasswordValid(t,e){let i=t.computeHash(e.verifierHashInput);for(let t=0;t<i.length;t++)if(e.verifierHash[t]!=i[t])return!1;return!0}static EncryptAgileFromKey(t,e,i,r,n,a,o){let s=new Stimulsoft.ExternalLibrary.aesjs.ModeOfOperation.cbc(this.FixHashSize(e,t.keyBits/8),this.FixHashSize(a,16,54)),l=n%t.blockSize==0?n:n+(t.blockSize-n%t.blockSize),m=StiArray.create(Number,l),h=(StiArray.copy2(i,r,m,0,n),s.encrypt(m)),c=[];for(let t=0;t<h.length;t++)c[t]=h[t];o.write(c)}static GetFinalHash(t,e,i){let r=StiArray.create(Number,i.length+e.length),n=(StiArray.copy3(i,r),StiArray.copy2(e,0,r,i.length,e.length),t.computeHash(r));return n}static GetPasswordHashSpinPrepending(e,t,i,r,n){let a=StiArray.create(Number,4+n),o=e.computeHash(this.CombinePassword(t,i));for(let t=0;t<r;t++)StiArray.copy(BitConverter.getBytesInt32(t),0,a,4),StiArray.copy2(o,0,a,4,o.length),o=e.computeHash(a);return o}static FixHashSize(i,r,n=0){if(i.length==r)return i;if(i.length<r){let e=[];StiArray.copy(i,0,e,i.length);for(let t=i.length;t<r;t++)e[t]=n;return e}{let t=[];return StiArray.copy(i,0,t,r),t}}static CombinePassword(t,e){""==e&&(e="VelvetSweatshop");let i=Encoding.Unicode.getBytes(e),r=[];return StiArray.copy(t,0,r,t.length),StiArray.copy2(i,0,r,t.length,i.length),r}static getRandomBytes(e){let i=[],r=0;for(let t=0;t<e;t++){do{r=65535*Math.random()&255}while(0==r);i.push(r)}return i}}StiOfficeEncryptedPackageHelper.BlockKey_HashInput=[254,167,210,118,59,75,158,121],StiOfficeEncryptedPackageHelper.BlockKey_HashValue=[215,170,15,109,48,97,52,78],StiOfficeEncryptedPackageHelper.BlockKey_KeyValue=[20,110,11,231,171,172,208,214],StiOfficeEncryptedPackageHelper.BlockKey_HmacKey=[95,178,173,1,12,185,225,246],StiOfficeEncryptedPackageHelper.BlockKey_HmacValue=[160,103,127,2,178,44,132,51],__.d.StiOfficeEncryptedPackageHelper=StiOfficeEncryptedPackageHelper}{let e;(t=>{t[t["AES"]=0]="AES",t[t["RC2"]=1]="RC2",t[t["RC4"]=2]="RC4",t[t["DES"]=3]="DES",t[t["DESX"]=4]="DESX",t[t["TRIPLE_DES"]=5]="TRIPLE_DES",t[t["TRIPLE_DES_112"]=6]="TRIPLE_DES_112"})(e=__.d.StiOfficeCipherAlgorithm||(__.d.StiOfficeCipherAlgorithm={}));let r;(t=>{t[t["ChainingModeCBC"]=0]="ChainingModeCBC",t[t["ChainingModeCFB"]=1]="ChainingModeCFB"})(r=__.d.StiOfficeChainingMode||(__.d.StiOfficeChainingMode={}));let i;(t=>{t[t["SHA1"]=0]="SHA1",t[t["SHA256"]=1]="SHA256",t[t["SHA384"]=2]="SHA384",t[t["SHA512"]=3]="SHA512",t[t["MD5"]=4]="MD5",t[t["MD4"]=5]="MD4",t[t["MD2"]=6]="MD2",t[t["RIPEMD128"]=7]="RIPEMD128",t[t["RIPEMD160"]=8]="RIPEMD160",t[t["WHIRLPOOL"]=9]="WHIRLPOOL"})(i=__.d.StiOfficeHashAlgorithm||(__.d.StiOfficeHashAlgorithm={}));class NA{constructor(){this.saltSize=16,this.blockSize=16,this.keyBits=256,this.hashSize=64,this.cipherAlgorithm=e.AES,this.cipherChaining=r.ChainingModeCBC,this.hashAlgorithm=i.SHA512,this.saltValue=null}}__.d.StiOfficeKeyDataInfo=NA;class OA{constructor(){this.encryptedHmacKey=null,this.encryptedHmacValue=null}}__.d.StiOfficeDataIntegrityInfo=OA;class PA extends NA{constructor(){super(...arguments),this.spinCount=1e5,this.encryptedVerifierHashInput=null,this.encryptedVerifierHashValue=null,this.encryptedKeyValue=null}}__.d.StiOfficeKeyEncryptorInfo=PA;class QA{saveToXml(){return Encoding.UTF8.getString(this.saveToBytes())}saveToBinary(){let t=this.saveToBytes(),e=0,i=(239==t[0]&&187==t[1]&&191==t[2]&&(e=3),StiArray.create(Number,8+t.length-e));return i[0]=4,i[2]=4,i[4]=64,StiArray.copy2(t,e,i,8,t.length-e),i}saveToBytes(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);e.indentation=0,e.formatting=Formatting.None,e.writeStartDocument(),e.writeStartElement("encryption"),e.writeAttributeString("xmlns","http://schemas.microsoft.com/office/2006/encryption"),e.writeAttributeString("xmlns:p","http://schemas.microsoft.com/office/2006/keyEncryptor/password"),e.writeAttributeString("xmlns:c","http://schemas.microsoft.com/office/2006/keyEncryptor/certificate"),e.writeStartElement("keyData"),e.writeAttributeString("saltSize",this.keyData.saltSize.toString()),e.writeAttributeString("blockSize",this.keyData.blockSize.toString()),e.writeAttributeString("keyBits",this.keyData.keyBits.toString()),e.writeAttributeString("hashSize",this.keyData.hashSize.toString()),e.writeAttributeString("cipherAlgorithm",QA.getCipherAlgorithmString(this.keyData.cipherAlgorithm)),e.writeAttributeString("cipherChaining",r[this.keyData.cipherChaining]),e.writeAttributeString("hashAlgorithm",QA.getHashAlgorithmString(this.keyData.hashAlgorithm)),e.writeAttributeString("saltValue",Stimulsoft.System.Convert.toBase64String(this.keyData.saltValue)),e.writeEndElement(),e.writeStartElement("dataIntegrity"),e.writeAttributeString("encryptedHmacKey",Stimulsoft.System.Convert.toBase64String(this.dataIntegrity.encryptedHmacKey)),e.writeAttributeString("encryptedHmacValue",Stimulsoft.System.Convert.toBase64String(this.dataIntegrity.encryptedHmacValue)),e.writeEndElement(),e.writeStartElement("keyEncryptors");for(let t of this.keyEncryptors)e.writeStartElement("keyEncryptor"),e.writeAttributeString("uri","http://schemas.microsoft.com/office/2006/keyEncryptor/password"),e.writeStartElement("p:encryptedKey"),e.writeAttributeString("spinCount",t.spinCount.toString()),e.writeAttributeString("saltSize",t.saltSize.toString()),e.writeAttributeString("blockSize",t.blockSize.toString()),e.writeAttributeString("keyBits",t.keyBits.toString()),e.writeAttributeString("hashSize",t.hashSize.toString()),e.writeAttributeString("cipherAlgorithm",QA.getCipherAlgorithmString(t.cipherAlgorithm)),e.writeAttributeString("cipherChaining",r[t.cipherChaining]),e.writeAttributeString("hashAlgorithm",QA.getHashAlgorithmString(t.hashAlgorithm)),e.writeAttributeString("saltValue",Stimulsoft.System.Convert.toBase64String(t.saltValue)),e.writeAttributeString("encryptedVerifierHashInput",Stimulsoft.System.Convert.toBase64String(t.encryptedVerifierHashInput)),e.writeAttributeString("encryptedVerifierHashValue",Stimulsoft.System.Convert.toBase64String(t.encryptedVerifierHashValue)),e.writeAttributeString("encryptedKeyValue",Stimulsoft.System.Convert.toBase64String(t.encryptedKeyValue)),e.writeEndElement(),e.writeEndElement();e.writeEndElement(),e.writeEndElement(),e.writeEndDocument(),e.flush();let i=t.toArray();return e.close(),i}static getCipherAlgorithmString(t){if(t==e.TRIPLE_DES)return"3DES";if(t==e.TRIPLE_DES_112)return"3DES_112";return e[t]}static getHashAlgorithmString(t){if(t==i.RIPEMD128)return"RIPEMD-128";if(t==i.RIPEMD160)return"RIPEMD-160";if(t==i.SHA1)return"SHA-1";return i[t]}constructor(t=!0){this.keyData=new NA,this.dataIntegrity=new OA,this.keyEncryptors=[new PA],this.keyData=new NA,this.dataIntegrity=new OA,this.keyEncryptors=[],t&&this.keyEncryptors.push(new PA)}}__.d.StiOfficeEncryptionInfo=QA}__.c.StiPcxHelper=class{static dwByte(t,e,i){t[e]=i}static dwByte2(t,e,i,r){this.dwByte(t,e,i),this.dwByte(t,e+1,r)}static dwByte3(t,e,i,r,n){this.dwByte2(t,e,i,r),this.dwByte(t,e+2,n)}static dwWord(t,e,i){t[e+0]=255&i,t[e+1]=i>>8&255}static dwEncodedData(t,e,i){1==i&&192!=(192&e)||t.writeByte(192|i),t.writeByte(e)}static saveToStream(n,t,s,i){let l=n.width,r=n.height,m=4*l,h=[],a=0;for(let t=0;t<r;t++)for(let t=0;t<l;t++){let t=n.imageData[a++],e=n.imageData[a++],i=n.imageData[a++],r=n.imageData[a++];h.push(i),h.push(e),h.push(t),h.push(r)}let c=0,g=null;if(t==__.c.StiPcxPaletteType.Monochrome){let a=StiArray.create2(Number,r+1,l+1);for(let e=0;e<r;e++)for(let t=0;t<l;t++)a[e][t]=128;let o=[[1,9,3,11],[13,5,15,7],[4,12,2,10],[16,8,14,6]];for(let n=0;n<r;n++){let t=n*m;for(let r=0;r<l;r++){let e=Math.trunc(.3*h[t+2]+.59*h[t+1]+.11*h[t+0]),i=(t+=4,0);if(s==__.c.StiMonochromeDitheringType.None&&(i=128<=e?255:0),s==__.c.StiMonochromeDitheringType.FloydSteinberg){e+=a[n][r]-128,i=128<=e?255:0;let t=e-i;a[n][r+1]+=Math.trunc(7/16*t),0!=r&&(a[n+1][r-1]+=Math.trunc(3/16*t)),a[n+1][r+0]+=Math.trunc(5/16*t),a[n+1][r+1]+=Math.trunc(1/16*t)}s==__.c.StiMonochromeDitheringType.Ordered&&(i=Math.trunc(e>=255/17*o[3&r][3&n]?255:0)),a[n][r]=i}}c=2*(Math.trunc((l-1)/16)+1),g=[];for(let n=0;n<r;n++){let e=128,i=n*c,r=0;for(let t=0;t<l;t++)0!=a[n][t]&&(r|=e),0==(e>>=1)&&(g[i]=r,r=0,e=128,i++);128!=e&&(g[i]=r)}}if(t==__.c.StiPcxPaletteType.Color){c=2*(Math.trunc((l-1)/2)+1),g=StiArray.create(Number,3*c*r);for(let t=0;t<r;t++){let e=t*m,i=3*c*t;for(let t=0;t<l;t++)g[i+0*c]=h[e+2],g[i+1*c]=h[e+1],g[i+2*c]=h[e+0],e+=4,i+=1}}let e=StiArray.create(Number,128),o=(this.dwByte(e,0,10),this.dwByte(e,1,5),this.dwByte(e,2,1),t==__.c.StiPcxPaletteType.Monochrome&&this.dwByte(e,3,1),t==__.c.StiPcxPaletteType.Color&&this.dwByte(e,3,8),this.dwWord(e,4,0),this.dwWord(e,6,0),this.dwWord(e,8,l-1),this.dwWord(e,10,r-1),this.dwWord(e,12,72),this.dwWord(e,14,72),this.dwByte3(e,16,0,0,0),this.dwByte3(e,19,255,255,255),this.dwByte(e,64,0),t==__.c.StiPcxPaletteType.Monochrome&&this.dwByte(e,65,1),t==__.c.StiPcxPaletteType.Color&&this.dwByte(e,65,3),this.dwWord(e,66,c),this.dwWord(e,68,1),i.write(e,0,128),1),S=g[0];for(let e=1;e<g.length;e++){let t=g[e];S==t?63!=++o&&(e+1)%c!=0||(this.dwEncodedData(i,S,o),o=0):(0!=o&&this.dwEncodedData(i,S,o),S=t,o=1)}0!=o&&this.dwEncodedData(i,S,o),i.flush()}},__.c.StiTiffHelper=class{static toTiffImage(t,e,i){let a=0,r=258,o=0,s=[],n,l="canvas-to-tiff 0.4\0",m=!1,h=96,c=96,g=t.length,S=r+g,p=new ArrayBuffer(S),d=new Uint8Array(p),u=new DataView(p),w=0,f=new Date,b;return y(m?18761:19789),y(42),v(8),F(),T(254,4,1,0),T(256,4,1,e),T(257,4,1,i),T(258,3,4,a,8),T(259,3,1,1),T(262,3,1,2),T(273,4,1,r,0),T(277,3,1,4),T(279,4,1,g),T(282,5,1,a,8),T(283,5,1,a,8),T(296,3,1,2),T(305,2,l.length,a,A(l)),T(306,2,20,a,20),T(338,3,1,2),C(),v(524296),v(524296),v(h),v(1),v(c),v(1),x(l),b=f.getFullYear()+":"+E(f.getMonth()+1)+":"+E(f.getDate())+" ",x(b+=E(f.getHours())+":"+E(f.getMinutes())+":"+E(f.getSeconds())),d.set(t,r),new Uint8Array(p);function E(t){return 1===(t+="").length?"0"+t:t}function y(t){u.setUint16(w,t,m),w+=2}function v(t){u.setUint32(w,t,m),w+=4}function x(t){let e=0;while(e<t.length)u.setUint8(w++,255&t.charCodeAt(e++));1&w&&w++}function A(t){let e=t.length;return 1&e?e+1:e}function T(t,e,i,r,n=null){y(t),y(e),v(i),n&&(a+=n,s.push(w)),1!==i||3!==e||n?v(r):(y(r),y(0)),o++}function F(t=null){n=t||w,w+=2}function C(){u.setUint16(n,o,m),v(0);let r=14+12*o;for(let t=0,e,i;t<s.length;t++)e=s[t],i=u.getUint32(e,m),u.setUint32(e,i+r,m)}}static saveToStream(n,t,s,e){let i=n.width,r=n.height,l=4*i,m=[],a=0;for(let t=0;t<r;t++)for(let t=0;t<i;t++){let t=n.imageData[a++],e=n.imageData[a++],i=n.imageData[a++],r=n.imageData[a++];m.push(i),m.push(e),m.push(t),m.push(r)}let h=null;if(t==__.c.StiPcxPaletteType.Monochrome){let a=StiArray.create2(Number,r+1,i+1);for(let e=0;e<r;e++)for(let t=0;t<i;t++)a[e][t]=128;let o=[[1,9,3,11],[13,5,15,7],[4,12,2,10],[16,8,14,6]];for(let n=0;n<r;n++){let t=n*l;for(let r=0;r<i;r++){let e=Math.trunc(.3*m[t+2]+.59*m[t+1]+.11*m[t+0]),i=(t+=4,0);if(s==__.c.StiMonochromeDitheringType.None&&(i=128<=e?255:0),s==__.c.StiMonochromeDitheringType.FloydSteinberg){e+=a[n][r]-128,i=128<=e?255:0;let t=e-i;a[n][r+1]+=Math.trunc(7/16*t),0!=r&&(a[n+1][r-1]+=Math.trunc(3/16*t)),a[n+1][r+0]+=Math.trunc(5/16*t),a[n+1][r+1]+=Math.trunc(1/16*t)}s==__.c.StiMonochromeDitheringType.Ordered&&(i=Math.trunc(e>=255/17*o[3&r][3&n]?255:0)),a[n][r]=i}}h=[];for(let e=0;e<r;e++)for(let t=0;t<i;t++)h.push(a[e][t]),h.push(a[e][t]),h.push(a[e][t]),h.push(255)}if(t==__.c.StiPcxPaletteType.Color){h=[];let n=0;for(let t=0;t<r;t++)for(let t=0;t<i;t++){let t=m[n++],e=m[n++],i=m[n++],r=m[n++];h.push(i),h.push(e),h.push(t),h.push(r)}}let o=this.toTiffImage(h,i,r);e.writeBytes(o)}};let ColorTranslator=Stimulsoft.System.Drawing.ColorTranslator,TextWriter=Stimulsoft.System.IO.TextWriter,StiOfficeEncryptedPackageHelper=(__.c.StiHtml5ExportService=class extends __.c.StiExportService{implements(){let t=[__.c.IStiHtml5ExportService];return(this.implements=()=>t)()}get defaultExtension(){if(this.compressToArchive)return"zip";return"html"}get exportFormat(){return __.a.StiExportFormat.Html5}get groupCategory(){return"Web"}get position(){return __.c.StiExportPosition.Html5}get exportNameInMenu(){return StiLocalization.get("Export","ExportTypeHtml5File")}exportTo(t,e,i){let r=new TextWriter,n=new __.c.StiHtmlTextWriter(r);this.exportHtml(t,n,i),e.write(Encoding.UTF8.getBytes(r.getStringBuilder().toString()))}getFilter(){if(this.compressToArchive)return StiLocalization.get("FileFilters","ZipArchives");return StiLocalization.get("FileFilters","HtmlFiles")}renderPage(t,e){let i=__.c.StiSvgHelper.saveToString(t,e,!1,this.imageResolution);this.htmlWriter.write(i),this.htmlWriter.flush()}renderStartDoc(t,e){this.htmlWriter.write("<!DOCTYPE html>"),this.htmlWriter.writeLine(),this.htmlWriter.indent++,this.htmlWriter.writeFullBeginTag("head"),this.htmlWriter.writeLine(),this.htmlWriter.indent++,this.htmlWriter.writeFullBeginTag("title"),this.htmlWriter.write(this.report.reportAlias),this.htmlWriter.writeEndTag("title"),this.htmlWriter.writeLine(),this.htmlWriter.writeBeginTag("meta"),this.htmlWriter.writeAttribute("charset",e.webName),this.htmlWriter.writeEndTag("meta"),this.htmlWriter.writeLine(),this.htmlWriter.indent--,this.htmlWriter.writeEndTag("head"),this.htmlWriter.writeLine(),this.htmlWriter.writeBeginTag("body"),this.htmlWriter.writeAttribute("bgcolor",ColorTranslator.toHtml(Color.lightBlue)),this.htmlWriter.writeAttribute("style","text-align:center;"),this.htmlWriter.write(">"),this.htmlWriter.indent++,this.htmlWriter.writeLine()}renderEndDoc(){this.htmlWriter.indent--,this.htmlWriter.writeEndTag("body"),this.htmlWriter.indent--,this.htmlWriter.writeLine(),this.htmlWriter.writeEndTag("html"),this.htmlWriter.writeLine(),this.htmlWriter.writeLine("\x3c!-- "+__.c.StiExportUtils.getReportVersion(this.report)+" --\x3e")}exportHtml(e,i,t){if(null==Stimulsoft.Base[["St","iL","ic","en","se"].join("")].key&&console.warn("You are using a trial version of the Stimulsoft product!"),__.a.StiLogService.write(this[Stimulsoft.System.StiObject.stimulsoft]().getType(),"Export report to Html format"),null==t)throw new Error("The 'settings' argument cannot be equal in null.");this.imageFormat=t.imageFormat,this.imageResolution=t.imageResolution,this.imageQuality=t.imageQuality,this.compressToArchive=t.compressToArchive;let r=t.continuousPages,n=(this.htmlWriter=i,t.pageRange.getSelectedPages(e.renderedPages));try{if(this.report=e,1==this.renderAsDocument&&this.renderStartDoc(n,t.encoding),!(Stimulsoft.Base.FslAA.wtLiI.aYwiY()||(Stimulsoft.Base.FslAA.wtLiI.DKlzG()||Stimulsoft.Base.FslAA.wtLiI.hatRb())&&Stimulsoft.System.NodeJs.isStandaloneVersion)){let t=StiString.format("{3}{0}{2}{4}{1}",String.fromCharCode(114),String.fromCharCode(108),String.fromCharCode(105),String.fromCharCode(84),String.fromCharCode(97));i.write('<div style="FONT-SIZE: 10px; COLOR: red; FONT-FAMILY: Arial"'+">"+"Stimulsoft Reports - "+t+" Version</div>")}this.htmlWriter.indent=0;for(let t of n.list)n.getPage(t),this.invokeExporting(t,n,0,1),this.renderPage(e,t),r&&this.htmlWriter.write("<br/>"),this.htmlWriter.writeLine();1==this.renderAsDocument&&this.renderEndDoc(),this.htmlWriter.flush()}finally{e=null}}constructor(){super(),this.renderAsDocument=!0,this.multipleFiles=!1,this.fileName="",this.htmlWriter=null,this.imageQuality=.75,this.imageResolution=96,this.compressToArchive=!1}},__.d.StiOfficeEncryptedPackageHelper),StiOfficeImageFormatHelper=__.d.StiOfficeImageFormatHelper,List=Stimulsoft.System.Collections.List,StiDashboardExport=__.a.Dashboard.StiDashboardExport,Image=Stimulsoft.System.Drawing.Image,Size=Stimulsoft.System.Drawing.Size,Rectangle=Stimulsoft.System.Drawing.Rectangle,StiImageRotation=__.a.Components.StiImageRotation;{class $D extends __.c.StiExportService{constructor(){super(...arguments),this.matrix=null,this.fontList=null,this.fillList=null,this.borderList=null,this.xfList=null,this.sstList=null,this.sstHash=null,this.sstHashIsTags=null,this.imageList=null,this.formatList=null,this.sstCount=0,this.sheetNameList=null,this.imageListOffset=0,this.printAreasList=null,this.matrixList=null,this.firstPageIndexList=null,this.hyperlinkList=null,this.minRowList=null,this.maxRowList=null,this.useOnePageHeaderAndFooter=!1,this.dataExportMode=__.c.StiDataExportMode.AllBands,this.exportObjectFormatting=!0,this.exportEachPageToSheet=!1,this.exportHorizontalPageBreaks=!1,this.imageResolution=1,this.imageQuality=.75,this.imageFormat=__.a.ImageFormat.Jpeg,this.imageResolutionMode=__.c.StiImageResolutionMode.Auto,this.imageCache=null,this.restrictEditing=__.c.StiExcelRestrictEditing.No,this.protectionPassword=null,this.exportCache=null,this.reportCulture=null,this.englishCulture=new CultureInfo("en-US"),this.docCompanyString=null,this.docLastModifiedString=null,this.xmlIndentation=1,this.wrongUrlSymbols=" \"#'*,;<>[^`{|}",this.netTicksPerDay=1e3*1e3*60*60*24,this.refChars="ABCDEFGHIJKLMNOPQRSTUVWXYZ",this.HiToTwips=14.4/20*1.01,this.TwipsToColinfo=2.438*.976*.075}implements(){let t=[__.c.IStiExcelExportService];return(this.implements=()=>t)()}get exportFormat(){return __.a.StiExportFormat.Excel}exportTo(e,t,i){if(null==this.exportCache){let t=i;this.exportCache=new __.c.StiExportImageCache(t.imageFormat,!0,new __.a.StiImageCache(Stimulsoft.StiOptions.Export.Excel.AllowImageComparer,!0,t.imageFormat,t.imageQuality,!1),Math.max(t.imageResolution,10)/100,e)}this.exportExcel(e,t,i)}exportToAsync(i,r,n,a){setTimeout(async()=>{var e;try{let t=a;if(this.exportCache=new __.c.StiExportImageCache(t.imageFormat,!0,new __.a.StiImageCache(Stimulsoft.StiOptions.Export.Excel.AllowImageComparer,!0,t.imageFormat,t.imageQuality,!1),Math.max(t.imageResolution,10)/100,r),await __.c.StiExportImageHelper.convertAllImages(r,Stimulsoft.System.Drawing.Imaging.ImageFormat.Jpeg,!1,this.exportFormat,this.exportCache),!r.isDocument&&null!=(e=r.getCurrentPage())&&e.is(IStiDashboard))return await StiDashboardExport.export(r,n,a),void i();this.exportTo(r,n,a),null!=r&&null!=r.preparedExportImages&&(r.preparedExportImages.clear(),r.preparedExportImages=null)}catch(t){if(Exception.log(t,r,`Export Error`).isImportant)return i(Exception.getMessage(t))}i()},0)}getLineStyle(t){let e=StiPenStyle.None,i=0,r=1.5,n=3;switch(null!=t&&(e=t.style,i=t.size),e){case StiPenStyle.Solid:if(i>n)return"thick";if(i>r)return"medium";return"thin";case StiPenStyle.Dot:if(i>r)return"dotted";return"hair";case StiPenStyle.Dash:if(i>r)return"mediumDashed";return"dashed";case StiPenStyle.DashDot:if(i>r)return"mediumDashDot";return"dashDot";case StiPenStyle.DashDotDot:if(i>r)return"mediumDashDotDot";return"dashDotDot";case StiPenStyle.Double:return"double";default:return null}}getRefString(t,e){let i=StiMath.trunc(t/26),r=StiMath.trunc(t%26),n=new StringBuilder;return 0<i&&n.append(this.refChars.charAt(i-1)),n.append(this.refChars.charAt(r)),n.append((e+1).toString()),n.toString()}getRefAbsoluteString(t,e){let i=StiMath.trunc(t/26),r=StiMath.trunc(t%26),n=new StringBuilder;return n.append("$"),0<i&&n.append(this.refChars.charAt(i-1)),n.append(this.refChars.charAt(r)),n.append("$"),n.append((e+1).toString()),n.toString()}floatToString(t){let e=t.toString()[Stimulsoft.System.StiObject.stimulsoft]().replaceAll(",",".");return e}stringToUrl(i){let r=new StringBuilder;for(let e=0;e<i.length;e++){let t=i.charAt(e);if("'"==t)continue;t.charCodeAt(0)<32||-1!=this.wrongUrlSymbols.indexOf(t)?r.append(StiString.format("%{0:x2}",t.charCodeAt(0))):r.append(t)}return r.toString()}getFontNumber(e){if(0<this.fontList.length)for(let t=0;t<this.fontList.length;t++)if(this.fontList[t][Stimulsoft.System.StiObject.stimulsoft]().equals(e))return t;this.fontList.push(e);let t=this.fontList.length-1;return t}getFillNumber(e){if(0<this.fillList.length)for(let t=0;t<this.fillList.length;t++)if(this.fillList[t][Stimulsoft.System.StiObject.stimulsoft]().equals(e))return t;this.fillList.push(e);let t=this.fillList.length-1;return t}getBorderNumber(e){if(0<this.borderList.length)for(let t=0;t<this.borderList.length;t++)if(this.borderList[t][Stimulsoft.System.StiObject.stimulsoft]().equals(e))return t;this.borderList.push(e);let t=this.borderList.length-1;return t}getXFNumber(e){if(0<this.xfList.length)for(let t=0;t<this.xfList.length;t++)if(this.xfList[t].equalDataXF(e))return t;this.xfList.push(e);let t=this.xfList.length-1;return t}getSSTNumber(t){if(this.sstCount++,0<this.sstList.length&&this.sstHash.containsKey(t))return this.sstHash.get(t);this.sstList.push(t);let e=this.sstList.length-1;return this.sstHash.add(t,e),e}getFormatNumber(e){if(0<this.formatList.length)for(let t=0;t<this.formatList.length;t++)if(this.formatList[t]==e)return t+164;this.formatList.push(e);let t=this.formatList.length-1;return t+164}convert(t){return t*this.HiToTwips}convertToEMU(t){return Math.round(914400*t/100*.93385)}compareExcellSheetNames(t,e){let i=t,r=(null!=i&&0!=i.length||(i=""),e);return null!=r&&0!=r.length||(r=""),i==r}prepareData(){this.fontList=new Array,this.fillList=new Array,this.borderList=new Array,this.xfList=new Array,this.sstList=[],this.sstHash=new Hashtable,this.sstHashIsTags=new Hashtable,this.imageList=[],this.formatList=[],this.sheetNameList=[],this.sstCount=0,this.printAreasList=[],this.matrixList=[],this.firstPageIndexList=[],this.minRowList=[],this.maxRowList=[],null!=this.exportCache?this.imageCache=this.exportCache.imageCache:this.imageCache=new __.a.StiImageCache(Stimulsoft.StiOptions.Export.Excel.AllowImageComparer,!0,this.imageFormat,this.imageQuality,!1);let t=new _D("Arial",!1,!1,!1,!1,10,Color.black,1,0),e=(this.getFontNumber(t),new aE("none",Color.transparent,Color.black)),i=(this.getFillNumber(e),e=new aE("gray125",Color.transparent,Color.black),this.getFillNumber(e),new bE(null,null,null,null)),r=(this.getBorderNumber(i),new cE(0,0,0,0,0,
8
+ StiTextHorAlignment.Left,StiVertAlignment.Bottom,0,!1,!1,!1));this.getXFNumber(r)}writeContentTypes(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);e.writeStartDocument(),e.writeStartElement("Types"),e.writeAttributeString("xmlns","http://schemas.openxmlformats.org/package/2006/content-types"),e.writeStartElement("Default"),e.writeAttributeString("Extension","rels"),e.writeAttributeString("ContentType","application/vnd.openxmlformats-package.relationships+xml"),e.writeEndElement(),e.writeStartElement("Default"),e.writeAttributeString("Extension","xml"),e.writeAttributeString("ContentType","application/xml"),e.writeEndElement(),e.writeStartElement("Default"),e.writeAttributeString("Extension","jpeg"),e.writeAttributeString("ContentType","image/jpeg"),e.writeEndElement(),e.writeStartElement("Default"),e.writeAttributeString("Extension","png"),e.writeAttributeString("ContentType","image/png"),e.writeEndElement(),e.writeStartElement("Default"),e.writeAttributeString("Extension","vml"),e.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.vmlDrawing"),e.writeEndElement(),e.writeStartElement("Override"),e.writeAttributeString("PartName","/docProps/app.xml"),e.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.extended-properties+xml"),e.writeEndElement(),e.writeStartElement("Override"),e.writeAttributeString("PartName","/docProps/core.xml"),e.writeAttributeString("ContentType","application/vnd.openxmlformats-package.core-properties+xml"),e.writeEndElement(),e.writeStartElement("Override"),e.writeAttributeString("PartName","/xl/workbook.xml"),e.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"),e.writeEndElement();for(let t=0;t<this.sheetNameList.length;t++)e.writeStartElement("Override"),e.writeAttributeString("PartName",StiString.format("/xl/worksheets/sheet{0}.xml",t+1)),e.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"),e.writeEndElement();e.writeStartElement("Override"),e.writeAttributeString("PartName","/xl/styles.xml"),e.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"),e.writeEndElement();for(let t=0;t<this.sheetNameList.length;t++)e.writeStartElement("Override"),e.writeAttributeString("PartName",StiString.format("/xl/drawings/drawing{0}.xml",t+1)),e.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.drawing+xml"),e.writeEndElement();return 0<this.sstList.length&&(e.writeStartElement("Override"),e.writeAttributeString("PartName","/xl/sharedStrings.xml"),e.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"),e.writeEndElement()),e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeMainRels(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);return e.writeStartDocument(),e.writeStartElement("Relationships"),e.writeAttributeString("xmlns","http://schemas.openxmlformats.org/package/2006/relationships"),e.writeStartElement("Relationship"),e.writeAttributeString("Id","rId1"),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"),e.writeAttributeString("Target","xl/workbook.xml"),e.writeEndElement(),e.writeStartElement("Relationship"),e.writeAttributeString("Id","rId2"),e.writeAttributeString("Type","http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties"),e.writeAttributeString("Target","docProps/core.xml"),e.writeEndElement(),e.writeStartElement("Relationship"),e.writeAttributeString("Id","rId3"),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties"),e.writeAttributeString("Target","docProps/app.xml"),e.writeEndElement(),e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeDocPropsApp(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);e.writeStartDocument(),e.writeStartElement("Properties"),e.writeAttributeString("xmlns","http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"),e.writeAttributeString("xmlns:vt","http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"),e.writeElementString("Application",__.c.StiExportUtils.getReportVersion(this.report)),e.writeElementString("DocSecurity","0"),e.writeElementString("ScaleCrop","false"),e.writeElementString("Company",null==this.docCompanyString?"":this.docCompanyString),e.writeElementString("LinksUpToDate","false"),e.writeElementString("SharedDoc","false"),e.writeElementString("HyperlinksChanged","false"),e.writeElementString("AppVersion","12.0000"),e.writeStartElement("HeadingPairs"),e.writeStartElement("vt:vector"),e.writeAttributeString("size","4"),e.writeAttributeString("baseType","variant"),e.writeStartElement("vt:variant"),e.writeElementString("vt:lpstr","Worksheets"),e.writeEndElement(),e.writeStartElement("vt:variant"),e.writeElementString("vt:i4",this.sheetNameList.length.toString()),e.writeEndElement(),e.writeStartElement("vt:variant"),e.writeElementString("vt:lpstr","Named Ranges"),e.writeEndElement(),e.writeStartElement("vt:variant"),e.writeElementString("vt:i4",this.sheetNameList.length.toString()),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("TitlesOfParts"),e.writeStartElement("vt:vector"),e.writeAttributeString("size",(2*this.sheetNameList.length).toString()),e.writeAttributeString("baseType","lpstr");for(let t=0;t<this.sheetNameList.length;t++)e.writeElementString("vt:lpstr",this.sheetNameList[t]);for(let t=0;t<this.sheetNameList.length;t++)e.writeElementString("vt:lpstr",StiString.format("'{0}'!Print_Area",this.sheetNameList[t]));return e.writeEndElement(),e.writeEndElement(),e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeDocPropsCore(){let t,e,i,r,n=new MemoryStream,a=new XmlTextWriter(Encoding.UTF8,n),o=(a.writeStartDocument(),a.writeStartElement("cp:coreProperties"),a.writeAttributeString("xmlns:cp","http://schemas.openxmlformats.org/package/2006/metadata/core-properties"),a.writeAttributeString("xmlns:dc","http://purl.org/dc/elements/1.1/"),a.writeAttributeString("xmlns:dcterms","http://purl.org/dc/terms/"),a.writeAttributeString("xmlns:dcmitype","http://purl.org/dc/dcmitype/"),a.writeAttributeString("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance"),StiString.format("{0}{1}",DateTime.now.toString("yyyy-MM-dd"),DateTime.now.toString("THH:mm:ssZ")));return a.writeElementString("dc:title",null!=(t=this.report.reportName)?t:""),a.writeElementString("dc:subject",null!=(e=this.report.reportAlias)?e:""),a.writeElementString("dc:creator",null!=(i=this.report.reportAuthor)?i:""),a.writeElementString("dc:description",null!=(r=this.report.reportDescription)?r:""),null!=this.docLastModifiedString&&a.writeElementString("cp:lastModifiedBy",this.docLastModifiedString),a.writeStartElement("dcterms:created"),a.writeAttributeString("xsi:type","dcterms:W3CDTF"),a.writeString(o),a.writeEndElement(),a.writeStartElement("dcterms:modified"),a.writeAttributeString("xsi:type","dcterms:W3CDTF"),a.writeString(o),a.writeEndElement(),a.writeElementString("cp:contentStatus",Stimulsoft.StiVersion.platform()),a.writeFullEndElement(),a.writeEndDocument(),a.flush(),n}writeWorkbookRels(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);e.writeStartDocument(),e.writeStartElement("Relationships"),e.writeAttributeString("xmlns","http://schemas.openxmlformats.org/package/2006/relationships");for(let t=0;t<this.sheetNameList.length;t++)e.writeStartElement("Relationship"),e.writeAttributeString("Id",StiString.format("rId{0}",t+1)),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet"),e.writeAttributeString("Target",StiString.format("worksheets/sheet{0}.xml",t+1)),e.writeEndElement();return e.writeStartElement("Relationship"),e.writeAttributeString("Id",StiString.format("rId{0}",this.sheetNameList.length+2)),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"),e.writeAttributeString("Target","styles.xml"),e.writeEndElement(),0<this.sstCount&&(e.writeStartElement("Relationship"),e.writeAttributeString("Id",StiString.format("rId{0}",this.sheetNameList.length+3)),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings"),e.writeAttributeString("Target","sharedStrings.xml"),e.writeEndElement()),e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeWorkbook(){let t=new MemoryStream,r=new XmlTextWriter(Encoding.UTF8,t);r.writeStartDocument(),r.writeStartElement("workbook"),r.writeAttributeString("xmlns","http://schemas.openxmlformats.org/spreadsheetml/2006/main"),r.writeAttributeString("xmlns:r","http://schemas.openxmlformats.org/officeDocument/2006/relationships"),r.writeStartElement("fileVersion"),r.writeAttributeString("appName","xl"),r.writeAttributeString("lastEdited","4"),r.writeAttributeString("lowestEdited","4"),r.writeAttributeString("rupBuild","4505"),r.writeEndElement(),r.writeStartElement("workbookPr"),r.writeAttributeString("defaultThemeVersion","124226"),r.writeEndElement(),r.writeStartElement("bookViews"),r.writeStartElement("workbookView"),r.writeAttributeString("xWindow","120"),r.writeAttributeString("yWindow","15"),r.writeAttributeString("windowWidth","18975"),r.writeAttributeString("windowHeight","11955"),r.writeEndElement(),r.writeEndElement(),r.writeStartElement("sheets");for(let t=0;t<this.sheetNameList.length;t++)r.writeStartElement("sheet"),r.writeAttributeString("name",this.sheetNameList[t]),r.writeAttributeString("sheetId",StiString.format("{0}",t+1)),r.writeAttributeString("r:id",StiString.format("rId{0}",t+1)),r.writeEndElement();r.writeEndElement(),r.writeStartElement("definedNames");for(let i=0;i<this.sheetNameList.length;i++){let t=this.printAreasList[i],e=(1048575<t.height&&(t.height=1048575),16383<t.width&&(t.width=16383),this.getRefAbsoluteString(t.width,t.height));r.writeStartElement("definedName"),r.writeAttributeString("name","_xlnm.Print_Area"),r.writeAttributeString("localSheetId",i.toString()),r.writeString(StiString.format("'{0}'!$A$1:{1}",this.sheetNameList[i],e)),r.writeEndElement()}return r.writeEndElement(),r.writeStartElement("calcPr"),r.writeAttributeString("calcId","124519"),r.writeEndElement(),r.writeFullEndElement(),r.writeEndDocument(),r.flush(),t}writeSheetRels(t){let e,i=new MemoryStream,r=new XmlTextWriter(Encoding.UTF8,i);if(r.writeStartDocument(),r.writeStartElement("Relationships"),r.writeAttributeString("xmlns","http://schemas.openxmlformats.org/package/2006/relationships"),0<this.imageList.length-this.imageListOffset&&(r.writeStartElement("Relationship"),r.writeAttributeString("Id","rId1"),r.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing"),r.writeAttributeString("Target",`../drawings/drawing${t+1}.xml`),r.writeEndElement()),0<this.hyperlinkList.length)for(let t=0;t<this.hyperlinkList.length;t++)r.writeStartElement("Relationship"),r.writeAttributeString("Id",StiString.format("rId{0}",2+t)),r.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink"),r.writeAttributeString("Target",this.hyperlinkList[t]),r.writeAttributeString("TargetMode","External"),r.writeEndElement();let n=null==(e=this.report.parentReport)?void 0:e.getCurrentPage(),a=this.report.isDocument&&null!=n&&n.is(IStiDashboard);return Stimulsoft.Base.FslAA.wtLiI.aYwiY()&&!a||Stimulsoft.Base.FslAA.wtLiI.dSiYV()&&a||(Stimulsoft.Base.FslAA.wtLiI.DKlzG()||Stimulsoft.Base.FslAA.wtLiI.hatRb()&&!a||Stimulsoft.Base.FslAA.wtLiI.kqAKB()&&a)&&Stimulsoft.System.NodeJs.isStandaloneVersion||(r.writeStartElement("Relationship"),r.writeAttributeString("Id","dId1"),r.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing"),r.writeAttributeString("Target","../drawings/vmlDrawingAdditional.vml"),r.writeEndElement()),r.writeFullEndElement(),r.writeEndDocument(),r.flush(),i}writeSheet(t,e){let _,N,M,H,i,r=new MemoryStream,O=new XmlTextWriter(Encoding.UTF8,r),W=(O.writeStartDocument(),O.writeStartElement("worksheet"),O.writeAttributeString("xmlns","http://schemas.openxmlformats.org/spreadsheetml/2006/main"),O.writeAttributeString("xmlns:r","http://schemas.openxmlformats.org/officeDocument/2006/relationships"),Stimulsoft.StiOptions.Export.Excel.FitToOnePageWide&&(O.writeStartElement("sheetPr"),O.writeStartElement("pageSetUpPr"),O.writeAttributeString("fitToPage","1"),O.writeEndElement(),O.writeEndElement()),this.matrix=this.matrixList[t],this.minRowList[t]),n=this.maxRowList[t],a=this.matrix.coordX.countItems,o=new Size(a-2,n-W-1),G=(o.width<0&&(o.width=0),o.height<0&&(o.height=0),this.printAreasList.push(o),[]),s=(O.writeStartElement("dimension"),O.writeAttributeString("ref",StiString.format("{0}:{1}",this.getRefString(0,0),this.getRefString(o.width,o.height))),O.writeEndElement(),0),l=0;if(Stimulsoft.StiOptions.Export.Excel.AllowFreezePanes)for(let i=W;i<n;i++)for(let t=0;t<a-1;t++){let e=this.matrix.cells[i][t];if(null!=e&&null!=e.component&&(e.component.locked||null!=e.component.tagValue&&e.component.tagValue.toString().contains("excelfreezepanes"))){let t=e.component.componentPlacement;if(null!=t&&0<t.length&&(t.startsWith("rt")||t.startsWith("ph")||t.startsWith("h"))){s=e.left,l=e.top+e.height+1;break}}}O.writeStartElement("sheetViews"),O.writeStartElement("sheetView"),Stimulsoft.StiOptions.Export.Excel.ColumnsRightToLeft&&O.writeAttributeString("rightToLeft","1"),Stimulsoft.StiOptions.Export.Excel.ShowGridLines||O.writeAttributeString("showGridLines","0"),O.writeAttributeString("tabSelected","1"),O.writeAttributeString("workbookViewId","0"),0==s&&0==l?(O.writeStartElement("selection"),O.writeAttributeString("activeCell","A1"),O.writeAttributeString("sqref","A1")):0==s?(O.writeStartElement("pane"),O.writeAttributeString("ySplit",l.toString()),O.writeAttributeString("topLeftCell",this.getRefString(s,l)),O.writeAttributeString("activePane","bottomLeft"),O.writeAttributeString("state","frozen"),O.writeEndElement(),O.writeStartElement("selection"),O.writeAttributeString("pane","bottomLeft"),O.writeAttributeString("activeCell",this.getRefString(0,l)),O.writeAttributeString("sqref",this.getRefString(0,l))):(O.writeStartElement("pane"),O.writeAttributeString("xSplit",s.toString()),O.writeAttributeString("ySplit",l.toString()),O.writeAttributeString("topLeftCell",this.getRefString(s,l)),O.writeAttributeString("activePane","bottomRight"),O.writeAttributeString("state","frozen"),O.writeEndElement(),O.writeStartElement("selection"),O.writeAttributeString("pane","topRight"),O.writeAttributeString("activeCell",this.getRefString(s,0)),O.writeAttributeString("sqref",this.getRefString(s,0)),O.writeEndElement(),O.writeStartElement("selection"),O.writeAttributeString("pane","bottomLeft"),O.writeAttributeString("activeCell",this.getRefString(0,l)),O.writeAttributeString("sqref",this.getRefString(0,l)),O.writeEndElement(),O.writeStartElement("selection"),O.writeAttributeString("pane","bottomRight"),O.writeAttributeString("activeCell",this.getRefString(s,l)),O.writeAttributeString("sqref",this.getRefString(s,l))),O.writeEndElement(),O.writeEndElement(),O.writeEndElement(),O.writeStartElement("sheetFormatPr"),O.writeAttributeString("defaultRowHeight","15"),O.writeEndElement();let z=0,m=StiBrush.toColor(e.brush);if(!m.equals(Color.white)&&0!=m.a){let t=new aE("solid",m,Color.transparent),e=this.getFillNumber(t),i=new cE(0,0,e,0,0,StiTextHorAlignment.Left,StiVertAlignment.Bottom,0,!1,!1,!1);z=this.getXFNumber(i)}let h=this.matrix.coordX.getKeys(),c=this.matrix.coordY.getKeys();if(this.exportObjectFormatting&&1<a){O.writeStartElement("cols");for(let r=0;r<a-1;r++){let t=this.matrix.coordX.getByIndex(r+1,h),e=this.matrix.coordX.getByIndex(r,h),i=this.convert(t-e)*this.TwipsToColinfo;O.writeStartElement("col"),O.writeAttributeString("min",(r+1).toString()),O.writeAttributeString("max",(r+1).toString()),O.writeAttributeString("width",i.toString()),O.writeAttributeString("customWidth","1"),0<z&&O.writeAttributeString("style",z.toString()),O.writeEndElement()}0<z&&(O.writeStartElement("col"),O.writeAttributeString("min",a.toString()),O.writeAttributeString("max","16384"),O.writeAttributeString("width","8.7265625"),O.writeAttributeString("style",z.toString()),O.writeEndElement()),O.writeEndElement()}let U=StiArray.create2(Boolean,n+1,a),V=StiArray.create2(Number,n+1,a),X=[],j=[];O.writeStartElement("sheetData");for(let R=W;R<n;R++){let t=this.matrix.coordY.getByIndex(R+1,c)-this.matrix.coordY.getByIndex(R,c);O.writeStartElement("row"),O.writeAttributeString("r",(R+1-W).toString()),O.writeAttributeString("spans",`1:`+(a-1)),this.exportObjectFormatting&&(O.writeAttributeString("ht",this.convert(t).toString()),O.writeAttributeString("customHeight","1"));for(let D=0;D<a-1;D++){let I=this.matrix.cells[R][D];if(U[R]&&0==U[R][D]&&null!=I){U[R][D]=!0;let S=I.component[Stimulsoft.System.StiObject.stimulsoft]().as(StiText),p=I.text,t=I.component[Stimulsoft.System.StiObject.stimulsoft]().as(StiCheckBox),d=!1,e=!1,r=(null!=t&&null!=t.excelDataValue&&0<t.excelDataValue.length&&(d=!0,p=t.excelDataValue),null);if(null!=I.component.hyperlinkValue&&0<(r=I.component.hyperlinkValue.toString().trim()).length&&!r.startsWith("javascript:")){let t=p,e=(null!=t&&0!=t.length||(t=r),new eE(R-W,R-W+I.height,D,D+I.width)),i=new fE(e,t,r);j.push(i)}let n=!1,i=!1,u=(i&&(n=!0),!1),a=I.component[Stimulsoft.System.StiObject.stimulsoft]().as(IStiExportImageExtended);if(!n&&!e&&null!=a&&a.isExportAsImage(this.exportFormat)){let a=new Rectangle,o=new Size(0,0),i=this.exportCache.getImageIndex(I.component,null,I.componentId);if(null!=i){o.width=this.imageCache.imageSizeStore[i].width,o.height=this.imageCache.imageSizeStore[i].height;let t=[],e=this.matrix.getRealImageData(I,new Image,t);null!=e&&0<t.length&&(a.x=t[0],a.y=t[1]),a.width=this.matrix.coordX.getByIndex(I.left+I.width+1)-this.matrix.coordX.getByIndex(I.left),a.height=this.matrix.coordY.getByIndex(I.top+I.height+1)-this.matrix.coordY.getByIndex(I.top)}else{let r=null,n=this.imageFormat;if(this.imageResolutionMode!=__.c.StiImageResolutionMode.Exactly&&I.component.is(StiImage)){let t=I.component.as(StiImage),i=t.getImage(this.imageResolution);if(null!=i){r=i,n=StiOfficeImageFormatHelper.correctImageFormat(this.imageFormat,r.imageFormat),o.width=r.width,o.height=r.height;let t=[],e=this.matrix.getRealImageData(I,i,t);null!=e&&0<t.length&&(a.x=t[0],a.y=t[1]),a.width=this.matrix.coordX.getByIndex(I.left+I.width+1)-this.matrix.coordX.getByIndex(I.left),a.height=this.matrix.coordY.getByIndex(I.top+I.height+1)-this.matrix.coordY.getByIndex(I.top)}}else{let e=__.d.StiOfficeImageFormatHelper.getImageAndTag(I.component,__.a.StiExportFormat.Excel,this.imageResolution,this.imageFormat,this.reportCulture,this.englishCulture);if(null!=e){let t=this.matrix.getRealImageData(I,e);null!=t&&(e=t),n=StiOfficeImageFormatHelper.correctImageFormat(this.imageFormat,e.imageFormat)}}null!=r&&(i=this.imageCache.addImageInt(r,n))}if(null!=i){let t=new dE(R-W,0,D,0,R-W+1+I.height,0,D+1+I.width,0,i,r,I.component,a,o);this.imageList.push(t),u=!0,n=!0}}let o=!1;if(null!=I.component&&null!=I.component.tagValue){let t=I.component.tagValue.toString().toLowerCase();-1!=t.indexOf("exceltext")&&(o=!0,G.push(this.getRefString(D,R)))}let s="",l=(null!=S&&(s=S.format),!1),m=!1,h=!1,c=!1,g=!1,w=!1,f=!1,b="",E=2,y=0,v=this.reportCulture.numberFormat.currencySymbol,x=0==this.reportCulture.numberFormat.currencyPositivePattern||2==this.reportCulture.numberFormat.currencyPositivePattern,A=!1,T=null!=S&&S.hideZeros,F=null,C=null,P=s.indexOf("|");if(-1!=P&&(F=__.c.StiExportUtils.getPositivePattern(s.charCodeAt(P+1)-65),C=__.c.StiExportUtils.getNegativePattern(s.charCodeAt(P+2)-65),s=s.substr(0,P)),null!=s&&0<s.length)if("C"==s[0]?l=!0:"N"==s[0]?m=!0:"P"==s[0]?h=!0:"D"==s[0]?c=!0:"T"==s[0]?g=!0:"U"==s[0]&&(w=!0),1==s.length)f=!0;else if(l||m||h){let e=1;if(Char.isDigit(s[e])){let t=new StringBuilder;while(e<s.length&&Char.isDigit(s[e]))t.append(s[e]),e++;E=parseInt(t.toString())}e<s.length&&"G"==s[e]&&(e++,y=3),e<s.length&&"("==s[e]&&(e++,A=!0),e<s.length&&("."==s[e]||","==s[e])&&e++,e<s.length&&("+"==s[e]||"-"==s[e])&&("+"==s[e]&&(x=!0),e++,v=e<s.length?s.substring(e):"")}if(l||m||h||c||g||(f=!0),l&&(f=f&&!1),T&&!StiString.isNullOrEmpty(s)&&(f&&m&&(y=3),f=!1),o&&(f=!0),c||g){let t=s.substring(1);switch(t){case"d":b=this.reportCulture.dateTimeFormat.shortDatePattern;break;case"D":b=this.reportCulture.dateTimeFormat.longDatePattern;break;case"f":b=this.reportCulture.dateTimeFormat.longDatePattern+" "+this.reportCulture.dateTimeFormat.shortTimePattern;break;case"F":b=this.reportCulture.dateTimeFormat.fullDateTimePattern;break;case"g":b=this.reportCulture.dateTimeFormat.shortDatePattern+" "+this.reportCulture.dateTimeFormat.shortTimePattern;break;case"G":b=this.reportCulture.dateTimeFormat.shortDatePattern+" "+this.reportCulture.dateTimeFormat.longTimePattern;break;case"m":case"M":b=this.reportCulture.name.includes("en")||this.reportCulture.name.includes("us")?"MMMM d":"d MMMM";break;case"s":b="yyyy-MM-dd\\THH:mm:ss";break;case"t":b=this.reportCulture.dateTimeFormat.shortTimePattern;break;case"T":b=this.reportCulture.dateTimeFormat.longTimePattern;break;case"u":b="yyyy-MM-dd HH:mm:ss\\Z";break;case"y":case"Y":b=this.reportCulture.dateTimeFormat.yearMonthPattern;break;default:b=t;break}let e=(b=b[Stimulsoft.System.StiObject.stimulsoft]().replaceAll(" ","\\ ")).indexOf("'");while(-1!=e){let t=b.indexOf("'",e+1);if(-1==t)break;b=b.substr(0,e)+b.substr(e+1,t-e-1)+b.substr(t+1),e=b.indexOf("'",t-2)}}else if(!f)if(-1!=P){let t=new StringBuilder,e=(1<y&&(t.append("#,"),t.appendCount("#",y-1)),t.append("0"),0<E&&(t.append("."),t.appendCount("0",E)),t.toString()),i=F[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("n",e)[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("$",'"'+v+'"'),r=C[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("n",e)[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("$",'"'+v+'"');b=i+";"+r+(T?";":"")}else{let t=new StringBuilder,e=(l&&1==x&&(t.append('"'),t.append(v),t.append('"')),1<y&&(t.append("#,"),t.appendCount("#",y-1)),t.append("0"),0<E&&(t.append("."),t.appendCount("0",E)),l&&0==x&&(t.append('"'),t.append(v),t.append('"')),h&&t.append("%"),b=t.toString(),(A?"(":"-")+b+(A?")":""));T?b=b+";"+e+";":A&&(b=b+";"+e)}let L=0,k=(f?(m&&(L=4),h&&(L=10),c&&(L=14),g&&(L=21),o&&(L=49)):L=this.getFormatNumber(b),z);if(this.exportObjectFormatting){let i=I.cellStyle,t=new _D(i.font.name,i.font.bold,i.font.italic,i.font.underline,i.font.strikeout,Math.round(i.font.sizeInPoints),i.textColor,1,0),r=(d&&(t=new _D(Stimulsoft.StiOptions.Export.CheckBoxReplacementForExcelValue.Font.name,Stimulsoft.StiOptions.Export.CheckBoxReplacementForExcelValue.Font.bold,Stimulsoft.StiOptions.Export.CheckBoxReplacementForExcelValue.Font.italic,Stimulsoft.StiOptions.Export.CheckBoxReplacementForExcelValue.Font.underline,Stimulsoft.StiOptions.Export.CheckBoxReplacementForExcelValue.Font.strikeout,Math.round(Stimulsoft.StiOptions.Export.CheckBoxReplacementForExcelValue.Font.sizeInPoints),i.textColor,1,0)),new aE("solid",i.color,i.color));if(u){let e=i.color;if(this.imageResolutionMode==__.c.StiImageResolutionMode.Exactly)((e=StiBrush.toColor(null==(N=null==(_=I.component)?void 0:_.page)?void 0:N.brush)).equals(Color.empty)||e.equals(Color.white))&&(e=Color.transparent);else if(e.equals(Color.empty)||e.equals(Color.transparent)){let t=StiBrush.toColor(null==(H=null==(M=I.component)?void 0:M.page)?void 0:H.brush);t.equals(Color.empty)||t.equals(Color.transparent)||(e=t)}r=new aE("solid",e,e)}let e=!0,n=!0;for(let t=0;t<I.height+1;t++)null==this.matrix.bordersY[I.top+t][I.left]&&(e=!1),null==this.matrix.bordersY[I.top+t][I.left+I.width+1]&&(n=!1);let a=!0,o=!0;for(let t=0;t<I.width+1;t++)null==this.matrix.bordersX[I.top][I.left+t]&&(a=!1),null==this.matrix.bordersX[I.top+I.height+1][I.left+t]&&(o=!1);let s=new bE(e?this.matrix.bordersY[I.top][I.left]:null,n?this.matrix.bordersY[I.top][I.left+I.width+1]:null,a?this.matrix.bordersX[I.top][I.left]:null,o?this.matrix.bordersX[I.top+I.height+1][I.left]:null),l=!1,m=(null!=i.textOptions&&(l=i.textOptions.rightToLeft),!1),h=(null!=i.textOptions&&(m=i.textOptions.wordWrap),StiString.isNullOrEmpty(p)||(-1==p.indexOf("\r")&&-1==p.indexOf("\n")||(m=!0),null==S)||!S.checkAllowHtmlTags()||-1==p.indexOf("<br")&&-1==p.indexOf("<ul")&&-1==p.indexOf("<ol")&&-1==p.indexOf("<p")||(m=!0),0);if(null!=i.textOptions){let t=Math.ceil(i.textOptions.angle);0<=t&&t<=90&&(h=t),270<=t&&t<360&&(h=360-t+90)}let c=this.restrictEditing==__.c.StiExcelRestrictEditing.ExceptEditableFields&&null!=I.component&&I.component.is(StiText)&&I.component.as(StiText).editable,g=new cE(L,this.getFontNumber(t),this.getFillNumber(r),this.getBorderNumber(s),0,d?Stimulsoft.StiOptions.Export.CheckBoxReplacementForExcelValue.HorAlignment:i.horAlignment,d?Stimulsoft.StiOptions.Export.CheckBoxReplacementForExcelValue.VertAlignment:i.vertAlignment,h,m,l,c);k=this.getXFNumber(g)}if(O.writeStartElement("c"),O.writeAttributeString("r",this.getRefString(D,R-W)),O.writeAttributeString("s",k.toString()),this.exportObjectFormatting){for(let e=0;e<=I.width;e++)for(let t=0;t<=I.height;t++)U[R+t][D+e]=!0,V[R+t][D+e]=k;if(0<I.width||0<I.height){let t=new eE(R-W,R-W+I.height,D,D+I.width);X.push(t)}}else U[R][D]=!0,V[R][D]=k;let B=null;if(null!=S&&(B=S.excelDataValue,m)&&""==B&&" "==p&&(p=""),!(n||StiString.isNullOrEmpty(p)&&StiString.isNullOrEmpty(B))){let n=!1,a=!1,o=0;if(!StiString.isNullOrEmpty(B)&&"-"!=B){let i=B,t=i,e=t.indexOf("."),r=t.indexOf(",");if(t=(t=-1!=e&&-1!=r?t[Stimulsoft.System.StiObject.stimulsoft]().replaceAll(r<e?",":".",""):t).trim()[Stimulsoft.System.StiObject.stimulsoft]().replaceAll(",","."),!StiString.isNullOrEmpty(t)){a=!0;try{if(c||g){if(a=!1,Stimulsoft.StiOptions.Export.Excel.AllowExportDateTime&&"Q"!=b&&"QI"!=b&&"YQ"!=b&&"YQI"!=b){let n=null;try{CultureInfo.currentCulture=this.reportCulture;let{result:t,successfully:e}=DateTime.tryParse(i);e&&(n=t)}finally{CultureInfo.currentCulture=this.englishCulture}if(null!=n){let t=new Date(1900,0,1,0,0,0),e=DateTime.dateToNetTicks(n.jsDate),i=DateTime.dateToNetTicks(t),r=(e-i)/this.netTicksPerDay;59<(o=r+1)&&o++,a=!0}}}else this.checkForNumber(t)&&(o=parseFloat(t),isNaN(o))&&(a=!1,o=0)}catch(t){a=!1}}w&&(a=!1),i!=p&&i.startsWith("=")&&(n=!0),a||null!=p||(p=i)}if(n){let t=S.excelDataValue[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("\r","")[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("\t"," ").substring(1);Stimulsoft.StiOptions.Export.Excel.TrimTrailingSpaces&&(t=__.c.StiExportUtils.trimEndWhiteSpace(t)),O.writeElementString("f",t)}else if(1==a)O.writeElementString("v",o.toString()[Stimulsoft.System.StiObject.stimulsoft]().replaceAll(",","."));else{let t=p[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("\r","")[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("\t"," "),e=(Stimulsoft.StiOptions.Export.Excel.TrimTrailingSpaces&&(t=__.c.StiExportUtils.trimEndWhiteSpace(t)),0);null!=S&&S.checkAllowHtmlTags()?(t=this.convertAllowHtmlTagsToExcelString(S,t),e=this.getSSTNumber(t),this.sstHashIsTags.add(e,null)):e=this.getSSTNumber(t),O.writeAttributeString("t","s"),O.writeElementString("v",e.toString())}}O.writeEndElement()}else{let n=z,a=(U[R][D]&&(n=V[R][D]),null!=this.matrix.bordersY[R+0][D+0]),o=null!=this.matrix.bordersY[R+0][D+1],s=null!=this.matrix.bordersX[R+0][D+0],l;try{l=null!=this.matrix.bordersX[R+1][D+0]}catch(t){}if(a||o||s||l||0!=n){let t=new bE(a?this.matrix.bordersY[R+0][D+0]:null,o?this.matrix.bordersY[R+0][D+1]:null,s?this.matrix.bordersX[R+0][D+0]:null,l?this.matrix.bordersX[R+1][D+0]:null),e=this.xfList[n],i=new cE(e.FormatIndex,e.FontIndex,e.FillIndex,this.getBorderNumber(t),e.XFId,e.HorAlign,e.VertAlign,e.TextRotationAngle,e.TextWrapped,e.RightToLeft,e.Editable),r=this.getXFNumber(i);this.exportObjectFormatting||(r=0),O.writeStartElement("c"),O.writeAttributeString("r",this.getRefString(D,R-W)),O.writeAttributeString("s",r.toString()),O.writeEndElement()}}}O.writeEndElement()}if(O.writeEndElement(),this.restrictEditing!=__.c.StiExcelRestrictEditing.No){let t=this.calculateHash(this.protectionPassword);O.writeStartElement("sheetProtection"),null!=t&&O.writeAttributeString("password",t),O.writeAttributeString("sheet","1"),O.writeAttributeString("objects","1"),O.writeAttributeString("scenarios","1"),O.writeEndElement()}if(0<X.length&&(this.dataExportMode==__.c.StiDataExportMode.AllBands||this.exportObjectFormatting)){O.writeStartElement("mergeCells"),O.writeAttributeString("count",X.length.toString());for(let e=0;e<X.length;e++){let t=X[e];O.writeStartElement("mergeCell"),O.writeAttributeString("ref",StiString.format("{0}:{1}",this.getRefString(t.FirstColumn,t.FirstRow),this.getRefString(t.LastColumn,t.LastRow))),O.writeEndElement()}O.writeEndElement()}if(0<j.length){let a=!1;for(let i=0;i<j.length;i++){let t=j[i],e=t.Bookmark;if(e.startsWith("#")){e=e.substring(1);for(let n=0;n<this.matrixList.length;n++){let t=this.matrixList[n].bookmarksTable;if(null!=t){let r=t.get(e);if(null!=r){let t=this.minRowList[n],e=this.maxRowList[n],i=r[Stimulsoft.System.StiObject.stimulsoft]().as(Size);if(i.height>=t&&i.height<e){a=!0;break}}}}}else a=!0;if(a)break}if(a){O.writeStartElement("hyperlinks");for(let t=0;t<j.length;t++){let e=j[t],o=e.Bookmark;if(o.startsWith("#")){o=o.substring(1);let a=!1;for(let n=0;n<this.matrixList.length;n++){let t=this.matrixList[n].bookmarksTable;if(null!=t){let r=t.get(o);if(null!=r){let t=this.minRowList[n],e=this.maxRowList[n],i=r[Stimulsoft.System.StiObject.stimulsoft]().as(Size);if(i.height>=t&&i.height<e){o=StiString.format("'{0}'!{1}",this.sheetNameList[n],this.getRefString(i.width,i.height-t)),a=!0;break}}}}a&&(O.writeStartElement("hyperlink"),O.writeAttributeString("ref",this.getRefString(e.Range.FirstColumn,e.Range.FirstRow)),O.writeAttributeString("location",o),O.writeAttributeString("display",e.Description),O.writeEndElement())}else{let t=o;o.startsWith("file:\\\\\\")&&(t=o.substring(8),o="file:///"+t),o.startsWith("http:")&&(o=o[Stimulsoft.System.StiObject.stimulsoft]().replaceAll(" ","")),O.writeStartElement("hyperlink"),O.writeAttributeString("ref",this.getRefString(e.Range.FirstColumn,e.Range.FirstRow)),O.writeAttributeString("r:id",StiString.format("rId{0}",2+this.hyperlinkList.length)),O.writeAttributeString("display",t),O.writeEndElement(),this.hyperlinkList.push(this.stringToUrl(o))}}O.writeEndElement()}}O.writeStartElement("pageMargins"),O.writeAttributeString("left",this.floatToString(e.convertToHInches(e.unit,e.margins.left)/100)),O.writeAttributeString("right",this.floatToString(e.convertToHInches(e.unit,e.margins.right)/100)),O.writeAttributeString("top",this.floatToString(e.convertToHInches(e.unit,e.margins.top)/100)),O.writeAttributeString("bottom",this.floatToString(e.convertToHInches(e.unit,e.margins.bottom)/100)),O.writeAttributeString("header",this.floatToString(0)),O.writeAttributeString("footer",this.floatToString(0)),O.writeEndElement(),O.writeStartElement("pageSetup"),O.writeAttributeString("paperSize",StiString.format("{0}",e.paperSize)),O.writeAttributeString("orientation",e.orientation==StiPageOrientation.Portrait?"portrait":"landscape"),Stimulsoft.StiOptions.Export.Excel.FitToOnePageWide&&O.writeAttributeString("fitToHeight","0"),O.writeEndElement();let g=null==(i=this.report.parentReport)?void 0:i.getCurrentPage(),S=this.report.isDocument&&null!=g&&g.is(IStiDashboard),p=(Stimulsoft.Base.FslAA.wtLiI.aYwiY()&&!S||Stimulsoft.Base.FslAA.wtLiI.dSiYV()&&S||(Stimulsoft.Base.FslAA.wtLiI.DKlzG()||Stimulsoft.Base.FslAA.wtLiI.hatRb()&&!S||Stimulsoft.Base.FslAA.wtLiI.kqAKB()&&S)&&Stimulsoft.System.NodeJs.isStandaloneVersion||(O.writeStartElement("headerFooter"),O.writeStartElement("oddHeader"),O.writeRaw("&amp;C\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n&amp;G"),O.writeEndElement(),O.writeEndElement()),this.matrix.horizontalPageBreaks.length);if(this.exportHorizontalPageBreaks&&0<p){O.writeStartElement("rowBreaks"),O.writeAttributeString("count",p.toString()),O.writeAttributeString("manualBreakCount",p.toString());for(let t=0;t<p;t++)O.writeStartElement("brk"),O.writeAttributeString("id",StiString.format("{0}",this.matrix.horizontalPageBreaks[t])),O.writeAttributeString("max",0==t?"16383":"8"),O.writeAttributeString("man","1"),O.writeEndElement();O.writeEndElement()}if(this.imageList.length>this.imageListOffset&&(O.writeStartElement("drawing"),O.writeAttributeString("r:id","rId1"),O.writeEndElement()),0<G.length){O.writeStartElement("ignoredErrors");for(let t in G)O.writeStartElement("ignoredError"),O.writeAttributeString("sqref",G[t]),O.writeAttributeString("numberStoredAsText","1"),O.writeEndElement();O.writeEndElement()}return Stimulsoft.Base.FslAA.wtLiI.aYwiY()&&!S||Stimulsoft.Base.FslAA.wtLiI.dSiYV()&&S||(Stimulsoft.Base.FslAA.wtLiI.DKlzG()||Stimulsoft.Base.FslAA.wtLiI.hatRb()&&!S||Stimulsoft.Base.FslAA.wtLiI.kqAKB()&&S)&&Stimulsoft.System.NodeJs.isStandaloneVersion||(O.writeStartElement("legacyDrawingHF"),O.writeAttributeString("r:id","dId1"),O.writeEndElement()),O.writeFullEndElement(),O.writeEndDocument(),O.flush(),r}checkForNumber(t){let e=t.match($D.regexCheckInteger1);if(null!=e)return!0;if(null!=(e=t.match($D.regexCheckFloat1)))return!0;return!1}calculateHash(t){if(StiString.isNullOrEmpty(t))return null;let e=Encoding.Windows1252.getBytes(t),i=0,r=e.length;while(0<r--)i=(i^=e[r])>>14&1|i<<1&32767;return(i=((i^=32768|78<<8|75)^e.length)&65535).toString(16).toUpperCase()}prepareMatrix(t){let e=this.dataExportMode;if(Stimulsoft.StiOptions.Export.Excel.AllowExportFootersInDataOnlyMode&&(e|=__.c.StiDataExportMode.Footers),this.matrix=new __.c.StiMatrix(t,Stimulsoft.StiOptions.Export.Excel.DivideBigCells,this,null,e),this.useOnePageHeaderAndFooter){this.matrix.scanComponentsPlacement(!0,this.exportObjectFormatting);let r=this.matrix.coordX.countItems,e=this.matrix.coordY.countItems,n=this.matrix.coordY.getKeys(),t=0;while(this.matrix.linePlacement[t]!=__.c.StiTableLineInfo.PageHeader&&t<e-1)t++;if(this.matrix.linePlacement[t]==__.c.StiTableLineInfo.PageHeader){while(this.matrix.linePlacement[t]==__.c.StiTableLineInfo.PageHeader&&t<e-1)t++;while(t<e-1)this.matrix.linePlacement[t]==__.c.StiTableLineInfo.PageHeader&&(this.matrix.linePlacement[t]=__.c.StiTableLineInfo.Trash),t++}t=e-1;while(this.matrix.linePlacement[t]!=__.c.StiTableLineInfo.PageFooter&&0<t)t--;if(this.matrix.linePlacement[t]==__.c.StiTableLineInfo.PageFooter){while(this.matrix.linePlacement[t]==__.c.StiTableLineInfo.PageFooter&&0<t)t--;while(0<t)this.matrix.linePlacement[t]==__.c.StiTableLineInfo.PageFooter&&(this.matrix.linePlacement[t]=__.c.StiTableLineInfo.Trash),t--}let a=0,o=0;for(let i=0;i<e-1;i++){if(this.matrix.linePlacement[i]!=__.c.StiTableLineInfo.Trash){for(let e=0;e<r-1;e++){this.matrix.cells[a][e]=this.matrix.cells[i][e];let t=this.matrix.cells[a][e];null!=t&&(t.top=a,t.exportImage),this.matrix.bordersX[a][e]=this.matrix.bordersX[i][e],this.matrix.bordersY[a][e]=this.matrix.bordersY[i][e],this.matrix.bookmarks[a][e]=this.matrix.bookmarks[i][e]}this.matrix.bordersY[a][r-1]=this.matrix.bordersY[i][r-1];let t=this.matrix.coordY.getByIndex(i+1,n)-this.matrix.coordY.getByIndex(i,n);this.matrix.coordY.setByIndex(a+1,this.matrix.coordY.getByIndex(a,n)+t,n),a++}else o++;if(this.exportHorizontalPageBreaks)for(let t=0;t<this.matrix.horizontalPageBreaks.length;t++)this.matrix.horizontalPageBreaks[t]==i&&(this.matrix.horizontalPageBreaks[t]=this.matrix.horizontalPageBreaks[t]-(o-1))}for(let t=0;t<r-1;t++)this.matrix.bordersX[a][t]=this.matrix.bordersX[e-1][t];n=this.matrix.coordY.getKeys();let i=e-1-a;if(0<i){let i=new List;for(let e=0;e<a+1;e++){let t=this.matrix.coordY.getByIndex(e,n);i.add(t)}this.matrix.coordY=i}}if(this.dataExportMode!=__.c.StiDataExportMode.AllBands){this.matrix.scanComponentsPlacement(!0,this.exportObjectFormatting);let n=this.matrix.coordX.countItems,t=this.matrix.coordY.countItems,a=this.matrix.coordY.getKeys(),o=0,s=new Hashtable,e=new Hashtable,l=null,m=!1;for(let r=0;r<t-1;r++){let t=!1,i=this.matrix.parentBandName[r];if(this.matrix.linePlacement[r]==__.c.StiTableLineInfo.HeaderAP&&(m&&this.getParentBandName(r)==this.getParentBandName(r-1)?(t=!0,e.containsKey(i)||e.add(i,i)):e.containsKey(i)||(e.add(i,i),t=!0)),this.matrix.linePlacement[r]==__.c.StiTableLineInfo.HeaderD)if(m&&this.getParentBandName(r)==this.getParentBandName(r-1))t=!0,s.containsKey(i)||s.add(i,i);else{let e=i.indexOf("");if(-1!=e){let t=i.substring(0,e);t!=l&&(l=t,s.clear())}s.containsKey(i)||(t=!0,s.add(i,i))}if(m=t,this.matrix.linePlacement[r]==__.c.StiTableLineInfo.Data||this.matrix.linePlacement[r]==__.c.StiTableLineInfo.FooterD||t){for(let e=0;e<n-1;e++){this.matrix.cells[o][e]=this.matrix.cells[r][e];let t=this.matrix.cells[o][e];null!=t&&(t.top=o,t.exportImage),0!=o&&null==this.matrix.bordersX[r][e]||(this.matrix.bordersX[o][e]=this.matrix.bordersX[r][e]),this.matrix.bordersX[o+1][e]=this.matrix.bordersX[r+1][e],this.matrix.bordersY[o][e]=this.matrix.bordersY[r][e],this.matrix.bookmarks[o][e]=this.matrix.bookmarks[r][e]}this.matrix.bordersY[o][n-1]=this.matrix.bordersY[r][n-1];let t=this.matrix.coordY.getByIndex(r+1,a)-this.matrix.coordY.getByIndex(r,a);this.matrix.coordY.setByIndex(o+1,this.matrix.coordY.getByIndex(o,a)+t,a),o++}}let i=t-1-o;if(0<i){let i=new List;for(let e=0;e<o+1;e++){let t=this.matrix.coordY.getByIndex(e,a);i.add(t)}this.matrix.coordY=i}}}getParentBandName(t){let e=this.matrix.parentBandName[t],i=e.indexOf("");if(-1==i)return e;return e.substr(0,i)}convertAllowHtmlTagsToExcelString(t,e){let r=new XmlTextWriter(Encoding.UTF8),i=new StiHtmlTagsState(t.font.bold,t.font.italic,t.font.underline,t.font.strikeout,t.font.sizeInPoints,t.font.name,StiBrush.toColor(t.textBrush),StiBrush.toColor(t.brush),!1,!1,0,0,1,t.horAlignment),n=new StiHtmlState(i,0),a=StiTextRenderer.parseHtmlToStates(t.text,n);for(let i=0;i<a.length;i++){let t=a[i],e=(r.writeStartElement("r"),r.writeStartElement("rPr"),t.ts.bold&&r.writeElementString("b",null),t.ts.italic&&r.writeElementString("i",null),t.ts.underline&&r.writeElementString("u",null),t.ts.strikeout&&r.writeElementString("strike",null),t.ts.superscript&&(r.writeStartElement("vertAlign"),r.writeAttributeString("val","superscript"),r.writeEndElement()),t.ts.subscript&&(r.writeStartElement("vertAlign"),r.writeAttributeString("val","subscript"),r.writeEndElement()),r.writeStartElement("sz"),r.writeAttributeString("val",t.ts.fontSize.toString()),r.writeEndElement(),r.writeStartElement("color"),r.writeAttributeString("rgb",StiString.format("{0:X8}",t.ts.fontColor.toArgb())),r.writeEndElement(),r.writeStartElement("rFont"),r.writeAttributeString("val",t.ts.fontName),r.writeEndElement(),r.writeEndElement(),StiTextRenderer.prepareStateText(t.text).toString());StiString.isNullOrEmpty(e)&&(e=" "),this.convertTextToExcelString(r,e),r.writeEndElement()}return r.flush(),r.close(),r.textWriter.getStringBuilder().toString()}convertTextToExcelString(t,e){t.writeStartElement("t"),0<e.length&&(Char.isWhitespace(e,e.length-1)||Char.isWhitespace(e,0)||-1!=e.indexOf("\n"))&&t.writeAttributeString("xml:space","preserve"),t.writeString(e),t.writeFullEndElement()}writeDrawingRels(t){let e=new MemoryStream,i=new XmlTextWriter(Encoding.UTF8,e);i.writeStartDocument(),i.writeStartElement("Relationships"),i.writeAttributeString("xmlns","http://schemas.openxmlformats.org/package/2006/relationships");for(let e=this.imageListOffset;e<this.imageList.length;e++){let t=this.imageList[e];i.writeStartElement("Relationship"),i.writeAttributeString("Id",StiString.format("rId{0}",e-this.imageListOffset+1)),i.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"),i.writeAttributeString("Target",StiString.format("../media/image{0:D5}.{1}",t.ImageIndex+1,StiOfficeImageFormatHelper.getImageFormatExtension(this.imageCache.imageFormatStore[t.ImageIndex]))),i.writeEndElement(),StiString.isNullOrWhiteSpace(t.Hyperlink)||(i.writeStartElement("Relationship"),i.writeAttributeString("Id",StiString.format("hId{0}",e-this.imageListOffset+1)),i.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink"),i.writeAttributeString("Target",t.Hyperlink),i.writeAttributeString("TargetMode","External"),i.writeEndElement())}return i.writeFullEndElement(),i.writeEndDocument(),i.flush(),e}writeDrawing(t){let i,e=new MemoryStream,r=new XmlTextWriter(Encoding.UTF8,e);r.writeStartDocument(),r.writeStartElement("xdr:wsDr"),r.writeAttributeString("xmlns:xdr","http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"),r.writeAttributeString("xmlns:a","http://schemas.openxmlformats.org/drawingml/2006/main");for(let t=this.imageListOffset;t<this.imageList.length;t++){let w=this.imageList[t],f=0,b=0,E=0,y=0,v=0,x=w.Component.as(StiImage);if(null!=x){let i=x.report.unit.convertToHInches(x.width),r=x.report.unit.convertToHInches(x.height);if(x.imageRotation==StiImageRotation.Rotate90CCW||x.imageRotation==StiImageRotation.Rotate90CW){let t=i;i=r,r=t}let n=w.ImageSize.width,a=w.ImageSize.height,o=w.OffsetAndSize.clone(),s=x.margins.left,l=x.margins.right,m=x.margins.top,h=x.margins.bottom,c=x.horAlignment,g=x.vertAlignment;if(x.imageRotation!=StiImageRotation.None){let t=StiHorAlignment.Center,e=StiVertAlignment.Center;x.imageRotation==StiImageRotation.Rotate90CW&&(c==StiHorAlignment.Left&&(e=StiVertAlignment.Bottom),c==StiHorAlignment.Right&&(e=StiVertAlignment.Top),g==StiVertAlignment.Top&&(t=StiHorAlignment.Left),g==StiVertAlignment.Bottom&&(t=StiHorAlignment.Right),s=x.margins.top,l=x.margins.bottom,m=x.margins.right,h=x.margins.left,v=-90,o.x=w.OffsetAndSize.y,o.y=r-(w.OffsetAndSize.x+w.OffsetAndSize.width),o.width=w.OffsetAndSize.height,o.height=w.OffsetAndSize.width),x.imageRotation==StiImageRotation.Rotate90CCW&&(c==StiHorAlignment.Left&&(e=StiVertAlignment.Top),c==StiHorAlignment.Right&&(e=StiVertAlignment.Bottom),g==StiVertAlignment.Top&&(t=StiHorAlignment.Right),g==StiVertAlignment.Bottom&&(t=StiHorAlignment.Left),s=x.margins.bottom,l=x.margins.top,m=x.margins.left,h=x.margins.right,v=90,o.x=i-(w.OffsetAndSize.y+w.OffsetAndSize.height),o.y=w.OffsetAndSize.x,o.width=w.OffsetAndSize.height,o.height=w.OffsetAndSize.width),x.imageRotation==StiImageRotation.Rotate180&&(c==StiHorAlignment.Left&&(t=StiHorAlignment.Right),c==StiHorAlignment.Right&&(t=StiHorAlignment.Left),g==StiVertAlignment.Top&&(e=StiVertAlignment.Bottom),g==StiVertAlignment.Bottom&&(e=StiVertAlignment.Top),s=x.margins.right,l=x.margins.left,m=x.margins.bottom,h=x.margins.top,v=180,o.x=i-(w.OffsetAndSize.x+w.OffsetAndSize.width),o.y=r-(w.OffsetAndSize.y+w.OffsetAndSize.height)),x.imageRotation==StiImageRotation.FlipHorizontal&&(c==StiHorAlignment.Left&&(t=StiHorAlignment.Right),c==StiHorAlignment.Right&&(t=StiHorAlignment.Left),e=g,s=x.margins.right,l=x.margins.left,o.x=i-(w.OffsetAndSize.x+w.OffsetAndSize.width)),x.imageRotation==StiImageRotation.FlipVertical&&(g==StiVertAlignment.Top&&(e=StiVertAlignment.Bottom),g==StiVertAlignment.Bottom&&(e=StiVertAlignment.Top),t=c,m=x.margins.bottom,h=x.margins.top,o.y=r-(w.OffsetAndSize.y+w.OffsetAndSize.height)),c=t,g=e}let S=i-s-l,p=r-m-h;if(x.stretch||null!=x.icon){if(x.aspectRatio){let t=Math.min(S/n,p/a),e=(S-n*t)/2,i=(p-a*t)/2;c==StiHorAlignment.Left&&(l+=2*e),c==StiHorAlignment.Right&&(s+=2*e),c==StiHorAlignment.Center&&(s+=e,l+=e),g==StiVertAlignment.Top&&(h+=2*i),g==StiVertAlignment.Bottom&&(m+=2*i),g==StiVertAlignment.Center&&(m+=i,h+=i),S-=2*e,p-=2*i}}else{S=n*x.multipleFactor,p=a*x.multipleFactor;let t=-(S-i)/2,e=-(p-r)/2;c==StiHorAlignment.Left&&(l+=2*t),c==StiHorAlignment.Right&&(s+=2*t),c==StiHorAlignment.Center&&(s+=t,l+=t),g==StiVertAlignment.Top&&(h+=2*e),g==StiVertAlignment.Bottom&&(m+=2*e),g==StiVertAlignment.Center&&(m+=e,h+=e)}let t=-o.x,e=o.x+o.width-i,d=-o.y,u=o.y+o.height-r;s+=t,l+=e,m+=d,h+=u,i-=t+e,r-=d+u,f=0|-Math.round(s/S*1e5),b=0|-Math.round(l/S*1e5),E=0|-Math.round(m/p*1e5),y=0|-Math.round(h/p*1e5)}r.writeStartElement("xdr:twoCellAnchor"),Stimulsoft.StiOptions.Export.Excel.ImageMoveAndSizeWithCells||r.writeAttributeString("editAs","oneCell"),r.writeStartElement("xdr:from"),r.writeElementString("xdr:col",StiString.format("{0}",w.FirstColumnIndex)),r.writeElementString("xdr:colOff",StiString.format("{0}",w.FirstColumnOffset)),r.writeElementString("xdr:row",StiString.format("{0}",w.FirstRowIndex)),r.writeElementString("xdr:rowOff",StiString.format("{0}",w.FirstRowOffset)),r.writeEndElement(),r.writeStartElement("xdr:to"),r.writeElementString("xdr:col",StiString.format("{0}",w.LastColumnIndex)),r.writeElementString("xdr:colOff",StiString.format("{0}",w.LastColumnOffset)),r.writeElementString("xdr:row",StiString.format("{0}",w.LastRowIndex)),r.writeElementString("xdr:rowOff",StiString.format("{0}",w.LastRowOffset)),r.writeEndElement(),r.writeStartElement("xdr:pic"),r.writeStartElement("xdr:nvPicPr"),r.writeStartElement("xdr:cNvPr"),r.writeAttributeString("id",StiString.format("{0}",t-this.imageListOffset+2)),r.writeAttributeString("name",StiString.format("Picture {0}",t-this.imageListOffset+1)),r.writeAttributeString("descr",StiString.format("image{0:D5}",t+1)),StiString.isNullOrWhiteSpace(w.Hyperlink)||(r.writeStartElement("a:hlinkClick"),r.writeAttributeString("xmlns:r","http://schemas.openxmlformats.org/officeDocument/2006/relationships"),r.writeAttributeString("r:id",StiString.format("hId{0}",t-this.imageListOffset+1)),r.writeEndElement()),r.writeEndElement(),r.writeStartElement("xdr:cNvPicPr"),r.writeStartElement("a:picLocks"),r.writeAttributeString("noChangeAspect","1"),r.writeEndElement(),r.writeEndElement(),r.writeEndElement(),r.writeStartElement("xdr:blipFill"),r.writeStartElement("a:blip"),r.writeAttributeString("xmlns:r","http://schemas.openxmlformats.org/officeDocument/2006/relationships"),r.writeAttributeString("r:embed",StiString.format("rId{0}",t-this.imageListOffset+1)),r.writeEndElement(),this.imageResolutionMode==__.c.StiImageResolutionMode.Exactly||null==x?(r.writeStartElement("a:stretch"),r.writeStartElement("a:fillRect"),r.writeEndElement()):(0==f&&0==b&&0==E&&0==y||(r.writeStartElement("a:srcRect"),0!=f&&r.writeAttributeString("l",f.toString()),0!=E&&r.writeAttributeString("t",E.toString()),0!=b&&r.writeAttributeString("r",b.toString()),0!=y&&r.writeAttributeString("b",y.toString()),r.writeEndElement()),r.writeStartElement("a:stretch")),r.writeEndElement(),r.writeEndElement(),r.writeStartElement("xdr:spPr"),r.writeStartElement("a:xfrm"),this.imageResolutionMode!=__.c.StiImageResolutionMode.Exactly&&null!=x&&(0!=v&&r.writeAttributeString("rot",(0|Math.round(6e4*-v)).toString()),x.imageRotation==StiImageRotation.FlipHorizontal&&r.writeAttributeString("flipH","1"),x.imageRotation==StiImageRotation.FlipVertical)&&r.writeAttributeString("flipV","1"),r.writeStartElement("a:off"),r.writeAttributeString("x","1"),r.writeAttributeString("y","1"),r.writeEndElement(),r.writeStartElement("a:ext"),r.writeAttributeString("cx","2"),r.writeAttributeString("cy","2"),r.writeEndElement(),r.writeEndElement(),r.writeStartElement("a:prstGeom"),r.writeAttributeString("prst","rect"),r.writeStartElement("a:avLst"),r.writeEndElement(),r.writeEndElement();let e=null==(i=w.Component.as(IStiBorder))?void 0:i.border;if(Stimulsoft.StiOptions.Export.Excel.AllowNativeImageBorders&&null!=e&&!e.is(StiAdvancedBorder)&&e.isAllBorderSidesPresent&&!e.color.equals(Color.transparent)&&e.style!=StiPenStyle.None){if(r.writeStartElement("a:ln"),r.writeAttributeString("w",StiString.format("{0}",this.convertToEMU(e.getSize()))),r.writeStartElement("a:solidFill"),r.writeStartElement("a:srgbClr"),r.writeAttributeString("val",StiString.format("{0:X8}",e.color.toArgb()).substr(2)),r.writeEndElement(),r.writeEndElement(),e.style!=StiPenStyle.Solid){let t=this.getLineStyle(new StiBorderSide(e.color,e.size,e.style));r.writeStartElement("a:prstDash"),r.writeAttributeString("val",t),r.writeEndElement()}r.writeStartElement("a:round"),r.writeEndElement(),r.writeStartElement("a:headEnd"),r.writeEndElement(),r.writeStartElement("a:tailEnd"),r.writeEndElement(),r.writeEndElement()}r.writeEndElement(),r.writeEndElement(),r.writeStartElement("xdr:clientData"),r.writeEndElement(),r.writeEndElement()}return r.writeFullEndElement(),r.writeEndDocument(),r.flush(),e}writeStyles(){let t=new MemoryStream,s=new XmlTextWriter(Encoding.UTF8,t);if(s.writeStartDocument(),s.writeStartElement("styleSheet"),s.writeAttributeString("xmlns","http://schemas.openxmlformats.org/spreadsheetml/2006/main"),0<this.formatList.length){s.writeStartElement("numFmts"),s.writeAttributeString("count",StiString.format("{0}",this.formatList.length));for(let t=0;t<this.formatList.length;t++)s.writeStartElement("numFmt"),s.writeAttributeString("numFmtId",StiString.format("{0}",164+t)),s.writeAttributeString("formatCode",this.formatList[t]),s.writeEndElement();s.writeEndElement()}s.writeStartElement("fonts"),s.writeAttributeString("count",StiString.format("{0}",this.fontList.length));for(let e=0;e<this.fontList.length;e++){let t=this.fontList[e];s.writeStartElement("font"),t.Bold&&s.writeElementString("b",""),t.Italic&&s.writeElementString("i",""),t.Underlined&&s.writeElementString("u",""),t.Strikeout&&s.writeElementString("strike",""),s.writeStartElement("sz"),s.writeAttributeString("val",StiString.format("{0}",t.Height)),s.writeEndElement(),s.writeStartElement("color"),s.writeAttributeString("rgb",StiString.format("{0:X8}",t.Color.toArgb())),s.writeEndElement(),s.writeStartElement("name"),s.writeAttributeString("val",t.Name),s.writeEndElement(),s.writeStartElement("charset"),s.writeAttributeString("val",StiString.format("{0}",t.Charset)),s.writeEndElement(),s.writeEndElement()}s.writeEndElement(),s.writeStartElement("fills"),s.writeAttributeString("count",StiString.format("{0}",this.fillList.length));for(let e=0;e<this.fillList.length;e++){let t=this.fillList[e];s.writeStartElement("fill"),s.writeStartElement("patternFill"),s.writeAttributeString("patternType",t.Type),"solid"==t.Type&&(s.writeStartElement("fgColor"),s.writeAttributeString("rgb",StiString.format("{0:X8}",t.FgColor.toArgb())),s.writeEndElement(),s.writeStartElement("bgColor"),s.writeAttributeString("indexed","64"),s.writeEndElement()),s.writeEndElement(),s.writeEndElement()}s.writeEndElement(),s.writeStartElement("borders"),s.writeAttributeString("count",StiString.format("{0}",this.borderList.length));for(let e=0;e<this.borderList.length;e++){let t=this.borderList[e];s.writeStartElement("border"),this.writeBorderData(s,"left",t.BorderLeft),this.writeBorderData(s,"right",t.BorderRight),this.writeBorderData(s,"top",t.BorderTop),this.writeBorderData(s,"bottom",t.BorderBottom),this.writeBorderData(s,"diagonal",null),s.writeEndElement()}s.writeEndElement(),s.writeStartElement("cellStyleXfs"),s.writeAttributeString("count","1"),s.writeStartElement("xf"),s.writeAttributeString("numFmtId","0"),s.writeAttributeString("fontId","0"),s.writeAttributeString("fillId","0"),s.writeAttributeString("borderId","0"),s.writeEndElement(),s.writeEndElement(),s.writeStartElement("cellXfs"),s.writeAttributeString("count",StiString.format("{0}",this.xfList.length));for(let o=0;o<this.xfList.length;o++){let i=this.xfList[o],t=this.fillList[i.FillIndex],e=i.FillIndex,r=(0==t.FgColor.a&&(e=0),s.writeStartElement("xf"),s.writeAttributeString("numFmtId",StiString.format("{0}",i.FormatIndex)),s.writeAttributeString("fontId",StiString.format("{0}",i.FontIndex)),s.writeAttributeString("fillId",StiString.format("{0}",e)),s.writeAttributeString("borderId",StiString.format("{0}",i.BorderIndex)),s.writeAttributeString("xfId",StiString.format("{0}",i.XFId)),0!=i.FormatIndex&&s.writeAttributeString("applyNumberFormat","1"),0!=i.FontIndex&&s.writeAttributeString("applyFont","1"),0!=e&&s.writeAttributeString("applyFill","1"),0!=i.BorderIndex&&s.writeAttributeString("applyBorder","1"),s.writeAttributeString("applyAlignment","1"),i.Editable&&s.writeAttributeString("applyProtection","1"),i.HorAlign),n=i.VertAlign;if(0!=i.TextRotationAngle){let t=i.HorAlign,e=i.VertAlign;if(r=StiTextHorAlignment.Center,n=StiVertAlignment.Center,90==i.TextRotationAngle){switch(t){case StiTextHorAlignment.Left:n=StiVertAlignment.Bottom;break;case StiTextHorAlignment.Right:n=StiVertAlignment.Top;break}switch(e){case StiVertAlignment.Top:r=StiTextHorAlignment.Left;break;case StiVertAlignment.Bottom:r=StiTextHorAlignment.Right;break}}if(180==i.TextRotationAngle){switch(t){case StiTextHorAlignment.Left:n=StiVertAlignment.Top;break;case StiTextHorAlignment.Right:n=StiVertAlignment.Bottom;break}switch(e){case StiVertAlignment.Top:r=StiTextHorAlignment.Right;break;case StiVertAlignment.Bottom:r=StiTextHorAlignment.Left;break}}}s.writeStartElement("alignment");let a="left";switch(r){case StiTextHorAlignment.Right:a="right";break;case StiTextHorAlignment.Center:a="center";break;case StiTextHorAlignment.Width:a="justify";break}if(s.writeAttributeString("horizontal",a),n!=StiVertAlignment.Bottom){let t="";switch(n){case StiVertAlignment.Top:t="top";break;case StiVertAlignment.Center:t="center";break}s.writeAttributeString("vertical",t)}0!=i.TextRotationAngle&&s.writeAttributeString("textRotation",i.TextRotationAngle.toString()),i.TextWrapped&&s.writeAttributeString("wrapText","1"),i.RightToLeft&&s.writeAttributeString("readingOrder","2"),s.writeEndElement(),i.Editable&&(s.writeStartElement("protection"),s.writeAttributeString("locked","0"),s.writeEndElement()),s.writeEndElement()}return s.writeEndElement(),s.writeStartElement("cellStyles"),s.writeAttributeString("count","1"),s.writeStartElement("cellStyle"),s.writeAttributeString("name","Normal"),s.writeAttributeString("xfId","0"),s.writeAttributeString("builtinId","0"),s.writeEndElement(),s.writeEndElement(),s.writeStartElement("dxfs"),s.writeAttributeString("count","0"),s.writeEndElement(),s.writeStartElement("tableStyles"),s.writeAttributeString("count","0"),s.writeAttributeString("defaultTableStyle","TableStyleMedium9"),s.writeAttributeString("defaultPivotStyle","PivotStyleLight16"),s.writeEndElement(),s.writeFullEndElement(),s.writeEndDocument(),s.flush(),t}writeBorderData(i,t,r){if(i.writeStartElement(t),null!=r){let t=this.getLineStyle(r),e=r.color;""!=t&&(i.writeAttributeString("style",t),i.writeStartElement("color"),i.writeAttributeString("rgb",StiString.format("{0:X8}",e.toArgb())),i.writeEndElement())}i.writeEndElement()}writeSST(){let t=new MemoryStream,r=new XmlTextWriter(Encoding.UTF8,t);r.writeStartDocument(),r.writeStartElement("sst"),r.writeAttributeString("xmlns","http://schemas.openxmlformats.org/spreadsheetml/2006/main"),r.writeAttributeString("count",StiString.format("{0}",this.sstCount)),r.writeAttributeString("uniqueCount",StiString.format("{0}",this.sstList.length));for(let t=0;t<this.sstList.length;t++){r.writeStartElement("si");let e=this.sstList[t],i=new StringBuilder;for(let t=0;t<e.length;t++)(32<=e.charCodeAt(t)||"\n"==e.charAt(t))&&i.append(e.charAt(t));e=i.toString(),this.sstHashIsTags.containsKey(t)?r.writeRaw(e):this.convertTextToExcelString(r,e),r.writeEndElement()}return r.writeFullEndElement(),r.writeEndDocument(),r.flush(),t}writeAdditionalData(t,e){let i=new MemoryStream,r=null;return r=e?Stimulsoft.System.Convert.fromBase64String(t):Encoding.ASCII.getBytes(t),i.write(r,0,r.length),i}writeImage(t){let e=new MemoryStream,i=this.imageCache.imagePackedStore[t];return null!=i&&e.write(i,0,i.length),e}exportExcel(m,a,t){var o;null==Stimulsoft.Base[["St","iL","ic","en","se"].join("")].key&&console.warn("You are using a trial version of the Stimulsoft product!"),__.a.StiLogService.write(this[Stimulsoft.System.StiObject.stimulsoft]().getType(),"Export report to Excel 2007 format");let h=t.pageRange,c=(this.useOnePageHeaderAndFooter=t.useOnePageHeaderAndFooter,this.dataExportMode=t.dataExportMode,this.exportObjectFormatting=t.exportObjectFormatting,this.exportEachPageToSheet=t.exportEachPageToSheet,this.exportHorizontalPageBreaks=t.exportPageBreaks,this.imageResolution=t.imageResolution,this.imageQuality=t.imageQuality,this.docCompanyString=t.companyString,this.docLastModifiedString=t.lastModifiedString,this.restrictEditing=t.restrictEditing,this.protectionPassword=t.protectionPassword,t.encryptionPassword),g=(this.xmlIndentation=-1,this.imageResolution<10&&(this.imageResolution=10),this.imageResolution=this.imageResolution/100,null!=this.imageFormat&&this.imageFormat!=__.a.ImageFormat.Jpeg&&(this.imageFormat=__.a.ImageFormat.Png),this.dataExportMode!=__.c.StiDataExportMode.AllBands?this.useOnePageHeaderAndFooter=!1:this.exportObjectFormatting=!0,Stimulsoft.StiOptions.Export.Excel.RestrictEditing>this.restrictEditing&&(this.restrictEditing=Stimulsoft.StiOptions.Export.Excel.RestrictEditing),this.report=m,CultureInfo.currentCulture);try{if(CultureInfo.currentCulture=this.englishCulture,this.reportCulture=g,!StiString.isNullOrWhiteSpace(m.culture))try{this.reportCulture=new CultureInfo(m.culture)}catch(t){}let s=h.getSelectedPages(m.renderedPages),l=(this.currentPassNumber=0,this.maximumPassNumber=3,this.prepareData(),0);while(l<s.length){let e=new StiPagesCollection(m,m.renderedPages),i=(e.cacheMode=m.renderedPages.cacheMode,e.addV2Internal(s.getPageWithoutCache(l)),l);if(!this.exportEachPageToSheet){let t=s.getPageWithoutCache(l).excelSheetValue;while(l<s.length-1&&this.compareExcellSheetNames(s.getPageWithoutCache(l+1).excelSheetValue,t))l++,e.addV2Internal(s.getPageWithoutCache(l))}let r=e.getByIndex(0).excelSheetValue,n=(null!=r&&""!=r||(r=StiString.format("Page {0}",this.sheetNameList.length+1)),""),a=1,o=(this.prepareMatrix(e),0);do{this.firstPageIndexList.push(i),this.matrixList.push(this.matrix);let t=this.matrix.coordY.countItems-1;t-o>Stimulsoft.StiOptions.Export.Excel.MaximumSheetHeight?t=o+Stimulsoft.StiOptions.Export.Excel.MaximumSheetHeight:this.matrix=null,this.minRowList.push(o),this.maxRowList.push(t),o=t,null!=this.matrix||0<n.length?(n=StiString.format(" part{0}",a++),24<r.length&&(r=r.substr(0,24))):30<r.length&&(r=r.substr(0,30)),this.sheetNameList.push(r+n)}while(null!=this.matrix);l++}let i=new Hashtable;for(let t=0;t<this.sheetNameList.length;t++){let e=this.sheetNameList[t];if(e=e[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("*","_")[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("\\","_")[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("/","_")[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("[","_")[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("]","_")[Stimulsoft.System.StiObject.stimulsoft]().replaceAll(":","_")[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("?","_"),i.contains(e)){let t=1;while(i.contains(e+"-"+t.toString()))t++;e=e+"-"+t.toString()}i.add(e,e),this.sheetNameList[t]=e}let e=new StiZipWriter20,t=null;StiString.isNullOrWhiteSpace(c)?e.begin(a,!0):(t=new MemoryStream,e.begin(t,!0)),this.currentPassNumber=2,this.imageListOffset=0;for(let t=0;t<this.matrixList.length;t++)this.hyperlinkList=[],e.addFile(StiString.format("xl/worksheets/sheet{0}.xml",t+1),this.writeSheet(t,s.getByIndex(this.firstPageIndexList[t]))),e.addFile(StiString.format("xl/worksheets/_rels/sheet{0}.xml.rels",t+1),this.writeSheetRels(t)),0<this.imageList.length-this.imageListOffset&&(e.addFile(StiString.format("xl/drawings/_rels/drawing{0}.xml.rels",t+1),this.writeDrawingRels(t)),e.addFile(StiString.format("xl/drawings/drawing{0}.xml",t+1),this.writeDrawing(t))),this.imageListOffset=this.imageList.length;if(e.addFile("[Content_Types].xml",this.writeContentTypes()),e.addFile("_rels/.rels",this.writeMainRels()),e.addFile("docProps/app.xml",this.writeDocPropsApp()),e.addFile("docProps/core.xml",this.writeDocPropsCore()),e.addFile("xl/_rels/workbook.xml.rels",this.writeWorkbookRels()),e.addFile("xl/workbook.xml",this.writeWorkbook()),e.addFile("xl/styles.xml",this.writeStyles()),0<this.sstList.length&&e.addFile("xl/sharedStrings.xml",this.writeSST()),0<this.imageCache.imagePackedStore.length)for(let t=0;t<this.imageCache.imagePackedStore.length;t++)e.addFile(StiString.format("xl/media/image{0:D5}.{1}",t+1,StiOfficeImageFormatHelper.getImageFormatExtension(this.imageCache.imageFormatStore[t])),this.writeImage(t));let r=null==(o=this.report.parentReport)?void 0:o.getCurrentPage(),n=this.report.isDocument&&null!=r&&r.is(IStiDashboard);Stimulsoft.Base.FslAA.wtLiI.aYwiY()&&!n||Stimulsoft.Base.FslAA.wtLiI.dSiYV()&&n||(Stimulsoft.Base.FslAA.wtLiI.DKlzG()||Stimulsoft.Base.FslAA.wtLiI.hatRb()&&!n||Stimulsoft.Base.FslAA.wtLiI.kqAKB()&&n)&&Stimulsoft.System.NodeJs.isStandaloneVersion||(e.addFile("xl/media/imageAdditional.png",this.writeAdditionalData(__.c.StiExportUtils.additionalData,!0)),e.addFile("xl/drawings/_rels/vmlDrawingAdditional.vml.rels",this.writeAdditionalData('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="dId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="../media/imageAdditional.png"/></Relationships>',!1)),e.addFile("xl/drawings/vmlDrawingAdditional.vml",this.writeAdditionalData('<xml xmlns:v="urn:schemas-microsoft-com:vml"\r\n xmlns:o="urn:schemas-microsoft-com:office:office"\r\n xmlns:x="urn:schemas-microsoft-com:office:excel">\r\n <o:shapelayout v:ext="edit">\r\n <o:idmap v:ext="edit" data="1"/>\r\n'+' </o:shapelayout><v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75"\r\n o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f">\r\n <v:stroke joinstyle="miter"/>\r\n <v:formulas>'+'\r\n <v:f eqn="if lineDrawn pixelLineWidth 0"/>\r\n <v:f eqn="sum @0 1 0"/>\r\n <v:f eqn="sum 0 0 @1"/>\r\n <v:f eqn="prod @2 1 2"/>\r\n <v:f eqn="prod @3 21600 pixelWidth"/>\r\n <v:f eqn="prod @3 21600 pixelHeight"/>\r\n <v:f eqn="sum @0 0 1"/>'+'\r\n <v:f eqn="prod @6 1 2"/>\r\n <v:f eqn="prod @7 21600 pixelWidth"/>\r\n <v:f eqn="sum @8 21600 0"/>\r\n <v:f eqn="prod @7 21600 pixelHeight"/>\r\n <v:f eqn="sum @10 21600 0"/>\r\n </v:formulas>\r\n <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>'+'\r\n <o:lock v:ext="edit" aspectratio="t"/>\r\n </v:shapetype><v:shape id="CH" o:spid="_x0000_s1027" type="#_x0000_t75"\r\n style=\'position:absolute;margin-left:0;margin-top:0;width:365pt;height:298pt;\r\n z-index:1\'>'+'\r\n <v:imagedata o:relid="dId1" o:title="additional"/>\r\n <o:lock v:ext="edit" rotation="t"/>\r\n </v:shape></xml>',!1))),e.end(),StiString.isNullOrWhiteSpace(c)||(t.flush(),StiOfficeEncryptedPackageHelper.EncryptPackage(t.toArray(),c,a),t.close())}catch(t){}finally{CultureInfo.currentCulture=g,null!=this.matrix&&(this.matrix.clear(),this.matrix=null),this.fontList=null,this.fillList=null,this.borderList=null,this.xfList=null,this.sstList=null,this.sstHash=null,this.sstHashIsTags=null,this.formatList=null,this.sheetNameList=null,this.imageList[Stimulsoft.System.StiObject.stimulsoft]().clear(),this.imageList=null,this.imageCache.clear(),this.printAreasList=null,this.matrixList=null,this.firstPageIndexList=null,this.hyperlinkList=null,this.minRowList=null,this.maxRowList=null}}}$D.regexCheckInteger1=new RegExp("^[+-]?d+$"),$D.regexCheckFloat1=new RegExp("^[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)$"),__.c.StiExcelExportService=$D;class _D{constructor(t,e,i,r,n,a,o,s,l){this.Name=t,this.Bold=e,this.Italic=i,this.Underlined=r,this.Strikeout=n,this.Height=a,this.Color=o,this.Charset=s,this.Family=l}equals(t){return this.Name==t.Name&&this.Bold==t.Bold&&this.Italic==t.Italic&&this.Underlined==t.Underlined&&this.Strikeout==t.Strikeout&&this.Height==t.Height&&this.Color.equals(t.Color)&&this.Charset==t.Charset&&this.Family==t.Family}}__.c.DataFont=_D;class aE{constructor(t,e,i){this.Type=t,this.FgColor=e,this.BgColor=i}equals(t){return this.Type==t.Type&&this.FgColor.equals(t.FgColor)&&this.BgColor.equals(t.BgColor)}}__.c.DataFill=aE;class bE{constructor(t,e,i,r){this.BorderLeft=t,this.BorderRight=e,this.BorderTop=i,this.BorderBottom=r}equals(t){return this.eq(this.BorderLeft,t.BorderLeft)&&this.eq(this.BorderRight,t.BorderRight)&&this.eq(this.BorderTop,t.BorderTop)&&this.eq(this.BorderBottom,t.BorderBottom)}eq(t,e){return null==t&&null==e||null!=t&&null!=e&&t[Stimulsoft.System.StiObject.stimulsoft]().equals(e)}}__.c.DataBorder=bE;class cE{equalDataXF(t){if(this.FormatIndex!=t.FormatIndex||this.FontIndex!=t.FontIndex||this.FillIndex!=t.FillIndex||this.BorderIndex!=t.BorderIndex||this.XFId!=t.XFId||this.HorAlign!=t.HorAlign||this.VertAlign!=t.VertAlign||this.TextRotationAngle!=t.TextRotationAngle||this.TextWrapped!=t.TextWrapped||this.RightToLeft!=t.RightToLeft||this.Editable!=t.Editable)return!1;return!0}constructor(t,e,i,r,n,a,o,s,l,m,h){this.FormatIndex=t,this.FontIndex=e,this.FillIndex=i,this.BorderIndex=r,this.XFId=n,this.HorAlign=a,this.VertAlign=o,this.TextRotationAngle=s,this.TextWrapped=l,this.RightToLeft=m,this.Editable=h}}__.c.DataXF=cE;class dE{constructor(t,e,i,r,n,a,o,s,l,m,h,c,g){this.FirstRowIndex=t,this.FirstRowOffset=e,this.FirstColumnIndex=i,this.FirstColumnOffset=r,this.LastRowIndex=n,this.LastRowOffset=a,this.LastColumnIndex=o,this.LastColumnOffset=s,this.ImageIndex=l,this.Hyperlink=m,this.Component=h,this.OffsetAndSize=c,this.ImageSize=g}}__.c.ExcelImageData=dE;class eE{constructor(t,e,i,r){this.FirstRow=t,this.LastRow=e,this.FirstColumn=i,this.LastColumn=r}}__.c.CellRangeAddress=eE;class fE{constructor(t,e,i){this.Range=t,this.Description=e,this.Bookmark=i}}__.c.HlinkData=fE,__.c.StiExcel2007ExportService=class extends $D{}}let ContentAlignment=Stimulsoft.System.Drawing.ContentAlignment,StiRoundedRectanglePrimitive=__.a.Components.StiRoundedRectanglePrimitive,StiCapStyle=Stimulsoft.Base.Drawing.StiCapStyle,StiVerticalLinePrimitive=__.a.Components.StiVerticalLinePrimitive,StiHorizontalLinePrimitive=__.a.Components.StiHorizontalLinePrimitive;{class mN extends __.c.StiExportService{constructor(){super(...arguments),this.imageSlide=[],this.imageResolution=1,this.imageQuality=.75,this.imageCache=null,this.imageFormat=null,this.idCounter=2,this.hyperlinkList=null,this.xmlIndentation=-1,this.currentCulture=null,this.newCulture=null,this.imageResolutionMode=__.c.StiImageResolutionMode.Auto,this.exportCache=null,this.wrongUrlSymbols=" \"#'*,;<>[^`{|}"}implements(){let t=[__.c.IStiPowerPointExportService];return(this.implements=()=>t)()}get exportFormat(){return __.a.StiExportFormat.PowerPoint}exportTo(e,t,i){if(null==this.exportCache){let t=i;this.exportCache=new __.c.StiExportImageCache(t.imageFormat,!0,new __.a.StiImageCache(Stimulsoft.StiOptions.Export.PowerPoint.AllowImageComparer,!0,t.imageFormat,t.imageQuality),Math.max(t.imageResolution,10)/100,e)}this.exportPowerPoint(e,t,i)}exportToAsync(i,r,n,a){setTimeout(async()=>{var e;try{let t=a;if(this.exportCache=new __.c.StiExportImageCache(t.imageFormat,!0,new __.a.StiImageCache(Stimulsoft.StiOptions.Export.PowerPoint.AllowImageComparer,!0,t.imageFormat,t.imageQuality),Math.max(t.imageResolution,10)/100,r),await __.c.StiExportImageHelper.convertAllImages(r,Stimulsoft.System.Drawing.Imaging.ImageFormat.Jpeg,!1,this.exportFormat,this.exportCache),!r.isDocument&&null!=(e=r.getCurrentPage())&&e.is(IStiDashboard))return await StiDashboardExport.export(r,n,a),void i();this.exportTo(r,n,a),null!=r&&null!=r.preparedExportImages&&(r.preparedExportImages.clear(),r.preparedExportImages=null)}catch(t){if(Exception.log(t,r,`Export Error`).isImportant)return i(Exception.getMessage(t))}i()},0)}getLineStyle(t){switch(t){case StiPenStyle.Solid:return"solid";case StiPenStyle.Dot:return"sysDot";case StiPenStyle.Dash:return"sysDash";case StiPenStyle.DashDot:return"sysDashDot";case StiPenStyle.DashDotDot:return"sysDashDotDot";case StiPenStyle.Double:return"solid";default:return"solid"}}stringToUrl(t){let i=Encoding.UTF8.getBytes(t),r=new StringBuilder;for(let e of i){let t=String.fromCharCode(e);e<32||127<e||-1!=this.wrongUrlSymbols.indexOf(t)?r.append(StiString.format("%{0:x2}",e)):r.append(t)}return r.toString()}convertToEmu(t){return 0|Math.round(t/100*914400)}writeColor(e,i){if(e.writeStartElement("a:srgbClr"),e.writeAttributeString("val",StiString.format("{0:X6}",16777215&i.toArgb())),255!=i.a){let t=i.a/256*1e5|0;e.writeStartElement("a:alpha"),e.writeAttributeString("val",t.toString()),e.writeEndElement()}e.writeEndElement()}writeContentTypes(e){let t=new MemoryStream,i=new XmlTextWriter(Encoding.UTF8,t);i.indentation=this.xmlIndentation<0?0:this.xmlIndentation,i.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,i.writeStartDocument(),i.writeStartElement("Types"),i.writeAttributeString("xmlns","http://schemas.openxmlformats.org/package/2006/content-types");for(let t=0;t<11;t++)i.writeStartElement("Override"),i.writeAttributeString("PartName",`/ppt/slideLayouts/slideLayout${t+1}.xml`),i.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"),i.writeEndElement();i.writeStartElement("Override"),i.writeAttributeString("PartName","/ppt/slideMasters/slideMaster1.xml"),i.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml"),i.writeEndElement(),i.writeStartElement("Override"),i.writeAttributeString("PartName","/ppt/presProps.xml"),i.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.presentationml.presProps+xml"),i.writeEndElement();for(let t=0;t<e;t++)i.writeStartElement("Override"),i.writeAttributeString("PartName",`/ppt/slides/slide${t+1}.xml`),i.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.presentationml.slide+xml"),i.writeEndElement();return i.writeStartElement("Override"),i.writeAttributeString("PartName","/ppt/theme/theme1.xml"),i.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.theme+xml"),i.writeEndElement(),i.writeStartElement("Default"),i.writeAttributeString("Extension","jpeg"),i.writeAttributeString("ContentType","image/jpeg"),i.writeEndElement(),i.writeStartElement("Default"),i.writeAttributeString("Extension","png"),i.writeAttributeString("ContentType","image/png"),i.writeEndElement(),i.writeStartElement("Default"),i.writeAttributeString("Extension","rels"),i.writeAttributeString("ContentType","application/vnd.openxmlformats-package.relationships+xml"),i.writeEndElement(),i.writeStartElement("Default"),i.writeAttributeString("Extension","xml"),i.writeAttributeString("ContentType","application/xml"),i.writeEndElement(),i.writeStartElement("Override"),i.writeAttributeString("PartName","/ppt/presentation.xml"),i.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml"),i.writeEndElement(),i.writeStartElement("Override"),i.writeAttributeString("PartName","/docProps/app.xml"),i.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.extended-properties+xml"),i.writeEndElement(),i.writeStartElement("Override"),i.writeAttributeString("PartName","/ppt/tableStyles.xml"),i.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml"),i.writeEndElement(),i.writeStartElement("Override"),i.writeAttributeString("PartName","/ppt/viewProps.xml"),i.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml"),i.writeEndElement(),i.writeStartElement("Override"),i.writeAttributeString("PartName","/docProps/core.xml"),i.writeAttributeString("ContentType","application/vnd.openxmlformats-package.core-properties+xml"),i.writeEndElement(),i.writeFullEndElement(),i.writeEndDocument(),i.flush(),t}writeMainRels(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);return e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),e.writeStartElement("Relationships"),e.writeAttributeString("xmlns","http://schemas.openxmlformats.org/package/2006/relationships"),e.writeStartElement("Relationship"),e.writeAttributeString("Id","rId1"),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"),e.writeAttributeString("Target","ppt/presentation.xml"),e.writeEndElement(),e.writeStartElement("Relationship"),e.writeAttributeString("Id","rId2"),e.writeAttributeString("Type","http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties"),e.writeAttributeString("Target","docProps/core.xml"),e.writeEndElement(),e.writeStartElement("Relationship"),e.writeAttributeString("Id","rId3"),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties"),e.writeAttributeString("Target","docProps/app.xml"),e.writeEndElement(),e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeDocPropsApp(e){let t=new MemoryStream,i=new XmlTextWriter(Encoding.UTF8,t);i.indentation=this.xmlIndentation<0?0:this.xmlIndentation,i.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,i.writeStartDocument(),i.writeStartElement("Properties"),i.writeAttributeString("xmlns","http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"),i.writeAttributeString("xmlns:vt","http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"),i.writeElementString("Application",__.c.StiExportUtils.getReportVersion(this.report)),i.writeElementString("Slides",e.toString()),i.writeElementString("PresentationFormat","On-screen Show (4:3)"),i.writeElementString("TotalTime","0"),i.writeElementString("Words","0"),i.writeElementString("Paragraphs","0"),i.writeElementString("Notes","0"),i.writeElementString("HiddenSlides","0"),i.writeElementString("MMClips","0"),i.writeElementString("ScaleCrop","false"),i.writeStartElement("HeadingPairs"),i.writeStartElement("vt:vector"),i.writeAttributeString("size","4"),i.writeAttributeString("baseType","variant"),i.writeStartElement("vt:variant"),i.writeElementString("vt:lpstr","Theme"),i.writeEndElement(),i.writeStartElement("vt:variant"),i.writeElementString("vt:i4",e.toString()),i.writeEndElement(),i.writeStartElement("vt:variant"),i.writeElementString("vt:lpstr","Slide Titles"),i.writeEndElement(),i.writeStartElement("vt:variant"),i.writeElementString("vt:i4",e.toString()),i.writeEndElement(),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("TitlesOfParts"),i.writeStartElement("vt:vector"),i.writeAttributeString("size",(1+e).toString()),i.writeAttributeString("baseType","lpstr"),i.writeElementString("vt:lpstr","Office Theme");for(let t=0;t<e;t++)i.writeElementString("vt:lpstr",`Slide `+(t+1));return i.writeEndElement(),i.writeEndElement(),i.writeElementString("Company","Stimulsoft"),i.writeElementString("LinksUpToDate","false"),i.writeElementString("SharedDoc","false"),i.writeElementString("HyperlinksChanged","false"),i.writeElementString("AppVersion","12.0000"),i.writeFullEndElement(),i.writeEndDocument(),i.flush(),t}writeDocPropsCore(){let t,e,i,r,n=new MemoryStream,a=new XmlTextWriter(Encoding.UTF8,n),o=(a.indentation=this.xmlIndentation<0?0:this.xmlIndentation,a.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,a.writeStartDocument(),a.writeStartElement("cp:coreProperties"),a.writeAttributeString("xmlns:cp","http://schemas.openxmlformats.org/package/2006/metadata/core-properties"),a.writeAttributeString("xmlns:dc","http://purl.org/dc/elements/1.1/"),a.writeAttributeString("xmlns:dcterms","http://purl.org/dc/terms/"),a.writeAttributeString("xmlns:dcmitype","http://purl.org/dc/dcmitype/"),a.writeAttributeString("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance"),DateTime.now.toString("yyyy-MM-ddTHH:mm:ssZ"));return a.writeElementString("dc:title",null!=(t=this.report.reportName)?t:""),a.writeElementString("dc:subject",null!=(e=this.report.reportAlias)?e:""),a.writeElementString("dc:creator",null!=(i=this.report.reportAuthor)?i:""),a.writeElementString("cp:keywords",""),a.writeElementString("dc:description",null!=(r=this.report.reportDescription)?r:""),a.writeElementString("cp:revision","1"),a.writeStartElement("dcterms:created"),a.writeAttributeString("xsi:type","dcterms:W3CDTF"),a.writeString(o),a.writeEndElement(),a.writeStartElement("dcterms:modified"),a.writeAttributeString("xsi:type","dcterms:W3CDTF"),a.writeString(o),a.writeEndElement(),a.writeFullEndElement(),a.writeEndDocument(),a.flush(),n}writeTableStyles(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);return e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),e.writeStartElement("a:tblStyleLst"),e.writeAttributeString("xmlns:a","http://schemas.openxmlformats.org/drawingml/2006/main"),e.writeAttributeString("def","{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}"),e.writeEndElement(),e.writeEndDocument(),e.flush(),t}writePresProps(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);return e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),e.writeStartElement("p:presentationPr"),e.writeAttributeString("xmlns:a","http://schemas.openxmlformats.org/drawingml/2006/main"),e.writeAttributeString("xmlns:r","http://schemas.openxmlformats.org/officeDocument/2006/relationships"),e.writeAttributeString("xmlns:p","http://schemas.openxmlformats.org/presentationml/2006/main"),e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeViewProps(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);return e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),e.writeStartElement("p:viewPr"),e.writeAttributeString("xmlns:a","http://schemas.openxmlformats.org/drawingml/2006/main"),e.writeAttributeString("xmlns:r","http://schemas.openxmlformats.org/officeDocument/2006/relationships"),e.writeAttributeString("xmlns:p","http://schemas.openxmlformats.org/presentationml/2006/main"),e.writeStartElement("p:normalViewPr"),e.writeAttributeString("showOutlineIcons","0"),e.writeStartElement("p:restoredLeft"),e.writeAttributeString("sz","15591"),e.writeAttributeString("autoAdjust","0"),e.writeEndElement(),e.writeStartElement("p:restoredTop"),e.writeAttributeString("sz","94675"),e.writeAttributeString("autoAdjust","0"),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("p:slideViewPr"),e.writeStartElement("p:cSldViewPr"),e.writeStartElement("p:cViewPr"),e.writeAttributeString("varScale","1"),e.writeStartElement("p:scale"),e.writeStartElement("a:sx"),e.writeAttributeString("n","107"),e.writeAttributeString("d","100"),e.writeEndElement(),e.writeStartElement("a:sy"),e.writeAttributeString("n","107"),e.writeAttributeString("d","100"),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("p:origin"),e.writeAttributeString("x","-1098"),e.writeAttributeString("y","-84"),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("p:guideLst"),e.writeStartElement("p:guide"),e.writeAttributeString("orient","horz"),e.writeAttributeString("pos","2160"),e.writeEndElement(),e.writeStartElement("p:guide"),e.writeAttributeString("pos","2880"),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("p:notesTextViewPr"),e.writeStartElement("p:cViewPr"),e.writeStartElement("p:scale"),e.writeStartElement("a:sx"),e.writeAttributeString("n","100"),e.writeAttributeString("d","100"),e.writeEndElement(),e.writeStartElement("a:sy"),e.writeAttributeString("n","100"),e.writeAttributeString("d","100"),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("p:origin"),e.writeAttributeString("x","0"),e.writeAttributeString("y","0"),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("p:gridSpacing"),e.writeAttributeString("cx","73736200"),e.writeAttributeString("cy","73736200"),e.writeEndElement(),e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeTheme(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t),i=(e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),'<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"><a:themeElements><a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000" /></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF" /></a:lt1><a:dk2><a:srgbClr val="1F497D" /></a:dk2><a:lt2><a:srgbClr val="EEECE1" /></a:lt2><a:accent1><a:srgbClr val="4F81BD" /></a:accent1><a:accent2><a:srgbClr val="C0504D" /></a:accent2><a:accent3><a:srgbClr val="9BBB59" /></a:accent3><a:accent4>'+'<a:srgbClr val="8064A2" /></a:accent4><a:accent5><a:srgbClr val="4BACC6" /></a:accent5><a:accent6><a:srgbClr val="F79646" /></a:accent6><a:hlink><a:srgbClr val="0000FF" /></a:hlink><a:folHlink><a:srgbClr val="800080" /></a:folHlink></a:clrScheme><a:fontScheme name="Office"><a:majorFont><a:latin typeface="Calibri" /><a:ea typeface="" /><a:cs typeface="" /><a:font script="Jpan" typeface="MS Pゴシック" /><a:font script="Hang" typeface="맑은 고딕" /><a:font script="Hans" typeface="宋体" /><a:font script="Hant" typeface="新細明體" />'+'<a:font script="Arab" typeface="Times New Roman" /><a:font script="Hebr" typeface="Times New Roman" /><a:font script="Thai" typeface="Angsana New" /><a:font script="Ethi" typeface="Nyala" /><a:font script="Beng" typeface="Vrinda" /><a:font script="Gujr" typeface="Shruti" /><a:font script="Khmr" typeface="MoolBoran" /><a:font script="Knda" typeface="Tunga" /><a:font script="Guru" typeface="Raavi" /><a:font script="Cans" typeface="Euphemia" /><a:font script="Cher" typeface="Plantagenet Cherokee" /><a:font script="Yiii" typeface="Microsoft Yi Baiti" />'+'<a:font script="Tibt" typeface="Microsoft Himalaya" /><a:font script="Thaa" typeface="MV Boli" /><a:font script="Deva" typeface="Mangal" /><a:font script="Telu" typeface="Gautami" /><a:font script="Taml" typeface="Latha" /><a:font script="Syrc" typeface="Estrangelo Edessa" /><a:font script="Orya" typeface="Kalinga" /><a:font script="Mlym" typeface="Kartika" /><a:font script="Laoo" typeface="DokChampa" /><a:font script="Sinh" typeface="Iskoola Pota" /><a:font script="Mong" typeface="Mongolian Baiti" /><a:font script="Viet" typeface="Times New Roman" />'+'<a:font script="Uigh" typeface="Microsoft Uighur" /></a:majorFont><a:minorFont><a:latin typeface="Calibri" /><a:ea typeface="" /><a:cs typeface="" /><a:font script="Jpan" typeface="MS Pゴシック" /><a:font script="Hang" typeface="맑은 고딕" /><a:font script="Hans" typeface="宋体" /><a:font script="Hant" typeface="新細明體" /><a:font script="Arab" typeface="Arial" /><a:font script="Hebr" typeface="Arial" /><a:font script="Thai" typeface="Cordia New" /><a:font script="Ethi" typeface="Nyala" /><a:font script="Beng" typeface="Vrinda" />'+'<a:font script="Gujr" typeface="Shruti" /><a:font script="Khmr" typeface="DaunPenh" /><a:font script="Knda" typeface="Tunga" /><a:font script="Guru" typeface="Raavi" /><a:font script="Cans" typeface="Euphemia" /><a:font script="Cher" typeface="Plantagenet Cherokee" /><a:font script="Yiii" typeface="Microsoft Yi Baiti" /><a:font script="Tibt" typeface="Microsoft Himalaya" /><a:font script="Thaa" typeface="MV Boli" /><a:font script="Deva" typeface="Mangal" /><a:font script="Telu" typeface="Gautami" /><a:font script="Taml" typeface="Latha" />'+'<a:font script="Syrc" typeface="Estrangelo Edessa" /><a:font script="Orya" typeface="Kalinga" /><a:font script="Mlym" typeface="Kartika" /><a:font script="Laoo" typeface="DokChampa" /><a:font script="Sinh" typeface="Iskoola Pota" /><a:font script="Mong" typeface="Mongolian Baiti" /><a:font script="Viet" typeface="Arial" /><a:font script="Uigh" typeface="Microsoft Uighur" /></a:minorFont></a:fontScheme><a:fmtScheme name="Office"><a:fillStyleLst><a:solidFill><a:schemeClr val="phClr" /></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0">'+'<a:schemeClr val="phClr"><a:tint val="50000" /><a:satMod val="300000" /></a:schemeClr></a:gs><a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000" /><a:satMod val="300000" /></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000" /><a:satMod val="350000" /></a:schemeClr></a:gs></a:gsLst><a:lin ang="16200000" scaled="1" /></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:shade val="51000" /><a:satMod val="130000" /></a:schemeClr></a:gs><a:gs pos="80000"><a:schemeClr val="phClr">'+'<a:shade val="93000" /><a:satMod val="130000" /></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="94000" /><a:satMod val="135000" /></a:schemeClr></a:gs></a:gsLst><a:lin ang="16200000" scaled="0" /></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000" /><a:satMod val="105000" /></a:schemeClr></a:solidFill><a:prstDash val="solid" /></a:ln><a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr" /></a:solidFill>'+'<a:prstDash val="solid" /></a:ln><a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr" /></a:solidFill><a:prstDash val="solid" /></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000" /></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000" /></a:srgbClr></a:outerShdw></a:effectLst>'+'</a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000" /></a:srgbClr></a:outerShdw></a:effectLst><a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0" /></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000" /></a:lightRig></a:scene3d><a:sp3d><a:bevelT w="63500" h="25400" /></a:sp3d></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr" /></a:solidFill><a:gradFill rotWithShape="1">'+'<a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000" /><a:satMod val="350000" /></a:schemeClr></a:gs><a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000" /><a:shade val="99000" /><a:satMod val="350000" /></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000" /><a:satMod val="255000" /></a:schemeClr></a:gs></a:gsLst><a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000" /></a:path></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000" /><a:satMod val="300000" /></a:schemeClr>'+'</a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000" /><a:satMod val="200000" /></a:schemeClr></a:gs></a:gsLst><a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000" /></a:path></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults /><a:extraClrSchemeLst /></a:theme>');return e.writeRaw(i),e.writeEndDocument(),e.flush(),t}writeSlideMasterRels(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),e.writeStartElement("Relationships"),e.writeAttributeString("xmlns","http://schemas.openxmlformats.org/package/2006/relationships");for(let t=0;t<11;t++)e.writeStartElement("Relationship"),e.writeAttributeString("Id",`rId`+(t+1)),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout"),e.writeAttributeString("Target",`../slideLayouts/slideLayout${t+1}.xml`),e.writeEndElement();return e.writeStartElement("Relationship"),e.writeAttributeString("Id","rId12"),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"),e.writeAttributeString("Target","../theme/theme1.xml"),e.writeEndElement(),e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeSlideMaster(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t),i=(e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),'<p:sldMaster xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"><p:cSld><p:bg><p:bgRef idx="1001"><a:schemeClr val="bg1" /></p:bgRef></p:bg><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name="" /><p:cNvGrpSpPr /><p:nvPr /></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0" /><a:ext cx="0" cy="0" />'+'<a:chOff x="0" y="0" /><a:chExt cx="0" cy="0" /></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title Placeholder 1" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="title" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="457200" y="274638" /><a:ext cx="8229600" cy="1143000" /></a:xfrm><a:prstGeom prst="rect"><a:avLst /></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0" anchor="ctr">'+'<a:normAutofit /></a:bodyPr><a:lstStyle /><a:p><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Click to edit Master title style</a:t></a:r><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Text Placeholder 2" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="body" idx="1" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="457200" y="1600200" /><a:ext cx="8229600" cy="4525963" /></a:xfrm><a:prstGeom prst="rect">'+'<a:avLst /></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0"><a:normAutofit /></a:bodyPr><a:lstStyle /><a:p><a:pPr lvl="0" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl="1" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl="2" /><a:r><a:rPr lang="en-US" smtClean="0" />'+'<a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl="3" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl="4" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Fifth level</a:t></a:r><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Date Placeholder 3" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="dt" sz="half" idx="2" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm>'+'<a:off x="457200" y="6356350" /><a:ext cx="2133600" cy="365125" /></a:xfrm><a:prstGeom prst="rect"><a:avLst /></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0" anchor="ctr" /><a:lstStyle><a:lvl1pPr algn="l"><a:defRPr sz="1200"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000" /></a:schemeClr></a:solidFill></a:defRPr></a:lvl1pPr></a:lstStyle><a:p>'+'<a:fld id="{BBCD0B08-7874-4091-A11F-B0CCB138CA98}" type="datetimeFigureOut"><a:rPr lang="ru-RU" smtClean="0" /><a:t>15.04.2009</a:t></a:fld><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Footer Placeholder 4" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="3" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="3124200" y="6356350" /><a:ext cx="2895600" cy="365125" /></a:xfrm>'+'<a:prstGeom prst="rect"><a:avLst /></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0" anchor="ctr" /><a:lstStyle><a:lvl1pPr algn="ctr"><a:defRPr sz="1200"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000" /></a:schemeClr></a:solidFill></a:defRPr></a:lvl1pPr></a:lstStyle><a:p><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="6" name="Slide Number Placeholder 5" />'+'<p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="4" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="6553200" y="6356350" /><a:ext cx="2133600" cy="365125" /></a:xfrm><a:prstGeom prst="rect"><a:avLst /></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0" anchor="ctr" /><a:lstStyle><a:lvl1pPr algn="r"><a:defRPr sz="1200"><a:solidFill><a:schemeClr val="tx1">'+'<a:tint val="75000" /></a:schemeClr></a:solidFill></a:defRPr></a:lvl1pPr></a:lstStyle><a:p><a:fld id="{F548980B-80A5-4AC9-8F15-D7D0FD0AEED9}" type="slidenum"><a:rPr lang="ru-RU" smtClean="0" /><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp></p:spTree></p:cSld><p:clrMap bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1" accent2="accent2" accent3="accent3" accent4="accent4" accent5="accent5" accent6="accent6" hlink="hlink" folHlink="folHlink" />'+'<p:sldLayoutIdLst><p:sldLayoutId id="2147483649" r:id="rId1" /><p:sldLayoutId id="2147483650" r:id="rId2" /><p:sldLayoutId id="2147483651" r:id="rId3" /><p:sldLayoutId id="2147483652" r:id="rId4" /><p:sldLayoutId id="2147483653" r:id="rId5" /><p:sldLayoutId id="2147483654" r:id="rId6" /><p:sldLayoutId id="2147483655" r:id="rId7" /><p:sldLayoutId id="2147483656" r:id="rId8" /><p:sldLayoutId id="2147483657" r:id="rId9" /><p:sldLayoutId id="2147483658" r:id="rId10" />'+'<p:sldLayoutId id="2147483659" r:id="rId11" /></p:sldLayoutIdLst><p:txStyles><p:titleStyle><a:lvl1pPr algn="ctr" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="0" /></a:spcBef><a:buNone /><a:defRPr sz="4400" kern="1200"><a:solidFill><a:schemeClr val="tx1" /></a:solidFill><a:latin typeface="+mj-lt" /><a:ea typeface="+mj-ea" /><a:cs typeface="+mj-cs" /></a:defRPr></a:lvl1pPr></p:titleStyle><p:bodyStyle>'+'<a:lvl1pPr marL="342900" indent="-342900" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000" /></a:spcBef><a:buFont typeface="Arial" pitchFamily="34" charset="0" /><a:buChar char="•" /><a:defRPr sz="3200" kern="1200"><a:solidFill><a:schemeClr val="tx1" /></a:solidFill><a:latin typeface="+mn-lt" /><a:ea typeface="+mn-ea" /><a:cs typeface="+mn-cs" /></a:defRPr></a:lvl1pPr>'+'<a:lvl2pPr marL="742950" indent="-285750" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000" /></a:spcBef><a:buFont typeface="Arial" pitchFamily="34" charset="0" /><a:buChar char="–" /><a:defRPr sz="2800" kern="1200"><a:solidFill><a:schemeClr val="tx1" /></a:solidFill><a:latin typeface="+mn-lt" /><a:ea typeface="+mn-ea" /><a:cs typeface="+mn-cs" /></a:defRPr></a:lvl2pPr>'+'<a:lvl3pPr marL="1143000" indent="-228600" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000" /></a:spcBef><a:buFont typeface="Arial" pitchFamily="34" charset="0" /><a:buChar char="•" /><a:defRPr sz="2400" kern="1200"><a:solidFill><a:schemeClr val="tx1" /></a:solidFill><a:latin typeface="+mn-lt" /><a:ea typeface="+mn-ea" /><a:cs typeface="+mn-cs" /></a:defRPr></a:lvl3pPr>'+'<a:lvl4pPr marL="1600200" indent="-228600" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000" /></a:spcBef><a:buFont typeface="Arial" pitchFamily="34" charset="0" /><a:buChar char="–" /><a:defRPr sz="2000" kern="1200"><a:solidFill><a:schemeClr val="tx1" /></a:solidFill><a:latin typeface="+mn-lt" /><a:ea typeface="+mn-ea" /><a:cs typeface="+mn-cs" /></a:defRPr></a:lvl4pPr>'+'<a:lvl5pPr marL="2057400" indent="-228600" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000" /></a:spcBef><a:buFont typeface="Arial" pitchFamily="34" charset="0" /><a:buChar char="»" /><a:defRPr sz="2000" kern="1200"><a:solidFill><a:schemeClr val="tx1" /></a:solidFill><a:latin typeface="+mn-lt" /><a:ea typeface="+mn-ea" /><a:cs typeface="+mn-cs" /></a:defRPr></a:lvl5pPr>'+'<a:lvl6pPr marL="2514600" indent="-228600" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000" /></a:spcBef><a:buFont typeface="Arial" pitchFamily="34" charset="0" /><a:buChar char="•" /><a:defRPr sz="2000" kern="1200"><a:solidFill><a:schemeClr val="tx1" /></a:solidFill><a:latin typeface="+mn-lt" /><a:ea typeface="+mn-ea" /><a:cs typeface="+mn-cs" /></a:defRPr></a:lvl6pPr>'+'<a:lvl7pPr marL="2971800" indent="-228600" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000" /></a:spcBef><a:buFont typeface="Arial" pitchFamily="34" charset="0" /><a:buChar char="•" /><a:defRPr sz="2000" kern="1200"><a:solidFill><a:schemeClr val="tx1" /></a:solidFill><a:latin typeface="+mn-lt" /><a:ea typeface="+mn-ea" /><a:cs typeface="+mn-cs" /></a:defRPr></a:lvl7pPr>'+'<a:lvl8pPr marL="3429000" indent="-228600" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000" /></a:spcBef><a:buFont typeface="Arial" pitchFamily="34" charset="0" /><a:buChar char="•" /><a:defRPr sz="2000" kern="1200"><a:solidFill><a:schemeClr val="tx1" /></a:solidFill><a:latin typeface="+mn-lt" /><a:ea typeface="+mn-ea" /><a:cs typeface="+mn-cs" /></a:defRPr></a:lvl8pPr>'+'<a:lvl9pPr marL="3886200" indent="-228600" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000" /></a:spcBef><a:buFont typeface="Arial" pitchFamily="34" charset="0" /><a:buChar char="•" /><a:defRPr sz="2000" kern="1200"><a:solidFill><a:schemeClr val="tx1" /></a:solidFill><a:latin typeface="+mn-lt" /><a:ea typeface="+mn-ea" /><a:cs typeface="+mn-cs" /></a:defRPr></a:lvl9pPr>'+'</p:bodyStyle><p:otherStyle><a:defPPr><a:defRPr lang="ru-RU" /></a:defPPr><a:lvl1pPr marL="0" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1800" kern="1200"><a:solidFill><a:schemeClr val="tx1" /></a:solidFill><a:latin typeface="+mn-lt" /><a:ea typeface="+mn-ea" /><a:cs typeface="+mn-cs" /></a:defRPr></a:lvl1pPr><a:lvl2pPr marL="457200" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1">'+'<a:defRPr sz="1800" kern="1200"><a:solidFill><a:schemeClr val="tx1" /></a:solidFill><a:latin typeface="+mn-lt" /><a:ea typeface="+mn-ea" /><a:cs typeface="+mn-cs" /></a:defRPr></a:lvl2pPr><a:lvl3pPr marL="914400" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1800" kern="1200"><a:solidFill><a:schemeClr val="tx1" /></a:solidFill><a:latin typeface="+mn-lt" /><a:ea typeface="+mn-ea" /><a:cs typeface="+mn-cs" /></a:defRPr></a:lvl3pPr>'+'<a:lvl4pPr marL="1371600" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1800" kern="1200"><a:solidFill><a:schemeClr val="tx1" /></a:solidFill><a:latin typeface="+mn-lt" /><a:ea typeface="+mn-ea" /><a:cs typeface="+mn-cs" /></a:defRPr></a:lvl4pPr><a:lvl5pPr marL="1828800" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1800" kern="1200"><a:solidFill><a:schemeClr val="tx1" /></a:solidFill>'+'<a:latin typeface="+mn-lt" /><a:ea typeface="+mn-ea" /><a:cs typeface="+mn-cs" /></a:defRPr></a:lvl5pPr><a:lvl6pPr marL="2286000" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1800" kern="1200"><a:solidFill><a:schemeClr val="tx1" /></a:solidFill><a:latin typeface="+mn-lt" /><a:ea typeface="+mn-ea" /><a:cs typeface="+mn-cs" /></a:defRPr></a:lvl6pPr>'+'<a:lvl7pPr marL="2743200" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1800" kern="1200"><a:solidFill><a:schemeClr val="tx1" /></a:solidFill><a:latin typeface="+mn-lt" /><a:ea typeface="+mn-ea" /><a:cs typeface="+mn-cs" /></a:defRPr></a:lvl7pPr><a:lvl8pPr marL="3200400" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1800" kern="1200"><a:solidFill><a:schemeClr val="tx1" /></a:solidFill>'+'<a:latin typeface="+mn-lt" /><a:ea typeface="+mn-ea" /><a:cs typeface="+mn-cs" /></a:defRPr></a:lvl8pPr><a:lvl9pPr marL="3657600" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1800" kern="1200"><a:solidFill><a:schemeClr val="tx1" /></a:solidFill><a:latin typeface="+mn-lt" /><a:ea typeface="+mn-ea" /><a:cs typeface="+mn-cs" /></a:defRPr></a:lvl9pPr></p:otherStyle></p:txStyles></p:sldMaster>');return e.writeRaw(i),e.writeEndDocument(),e.flush(),t}writeSlideLayoutRels(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);return e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),e.writeStartElement("Relationships"),e.writeAttributeString("xmlns","http://schemas.openxmlformats.org/package/2006/relationships"),e.writeStartElement("Relationship"),e.writeAttributeString("Id","rId1"),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster"),e.writeAttributeString("Target","../slideMasters/slideMaster1.xml"),e.writeEndElement(),e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeSlideLayout(t,n){let i,e=new MemoryStream,a=new XmlTextWriter(Encoding.UTF8,e);if(a.indentation=this.xmlIndentation<0?0:this.xmlIndentation,a.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,a.writeStartDocument(),a.writeStartElement("p:sldLayout"),a.writeAttributeString("xmlns:a","http://schemas.openxmlformats.org/drawingml/2006/main"),a.writeAttributeString("xmlns:r","http://schemas.openxmlformats.org/officeDocument/2006/relationships"),a.writeAttributeString("xmlns:p","http://schemas.openxmlformats.org/presentationml/2006/main"),1==t){a.writeAttributeString("type","title"),a.writeAttributeString("preserve","1");let t='<p:cSld name="Title Slide"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name="" /><p:cNvGrpSpPr /><p:nvPr /></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0" /><a:ext cx="0" cy="0" /><a:chOff x="0" y="0" /><a:chExt cx="0" cy="0" /></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="ctrTitle" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="685800" y="2130425" /><a:ext cx="7772400" cy="1470025" /></a:xfrm></p:spPr><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Click to edit Master title style</a:t></a:r><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Subtitle 2" />'+'<p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="subTitle" idx="1" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="1371600" y="3886200" /><a:ext cx="6400800" cy="1752600" /></a:xfrm></p:spPr><p:txBody><a:bodyPr /><a:lstStyle><a:lvl1pPr marL="0" indent="0" algn="ctr"><a:buNone /><a:defRPr><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000" /></a:schemeClr></a:solidFill></a:defRPr></a:lvl1pPr><a:lvl2pPr marL="457200" indent="0" algn="ctr"><a:buNone /><a:defRPr><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000" /></a:schemeClr></a:solidFill></a:defRPr></a:lvl2pPr><a:lvl3pPr marL="914400" indent="0" algn="ctr"><a:buNone /><a:defRPr><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000" />'+'</a:schemeClr></a:solidFill></a:defRPr></a:lvl3pPr><a:lvl4pPr marL="1371600" indent="0" algn="ctr"><a:buNone /><a:defRPr><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000" /></a:schemeClr></a:solidFill></a:defRPr></a:lvl4pPr><a:lvl5pPr marL="1828800" indent="0" algn="ctr"><a:buNone /><a:defRPr><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000" /></a:schemeClr></a:solidFill></a:defRPr></a:lvl5pPr><a:lvl6pPr marL="2286000" indent="0" algn="ctr"><a:buNone /><a:defRPr><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000" /></a:schemeClr></a:solidFill></a:defRPr></a:lvl6pPr><a:lvl7pPr marL="2743200" indent="0" algn="ctr"><a:buNone /><a:defRPr><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000" />'+'</a:schemeClr></a:solidFill></a:defRPr></a:lvl7pPr><a:lvl8pPr marL="3200400" indent="0" algn="ctr"><a:buNone /><a:defRPr><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000" /></a:schemeClr></a:solidFill></a:defRPr></a:lvl8pPr><a:lvl9pPr marL="3657600" indent="0" algn="ctr"><a:buNone /><a:defRPr><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000" /></a:schemeClr></a:solidFill></a:defRPr></a:lvl9pPr></a:lstStyle><a:p><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Click to edit Master subtitle style</a:t></a:r><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Date Placeholder 3" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="dt" sz="half" idx="10" /></p:nvPr></p:nvSpPr>'+'<p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:fld id="{BBCD0B08-7874-4091-A11F-B0CCB138CA98}" type="datetimeFigureOut"><a:rPr lang="ru-RU" smtClean="0" /><a:t>15.04.2009</a:t></a:fld><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Footer Placeholder 4" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="11" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="6" name="Slide Number Placeholder 5" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="12" /></p:nvPr></p:nvSpPr>'+'<p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:fld id="{F548980B-80A5-4AC9-8F15-D7D0FD0AEED9}" type="slidenum"><a:rPr lang="ru-RU" smtClean="0" /><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp></p:spTree></p:cSld>';a.writeRaw(t)}if(2==t){a.writeAttributeString("type","obj"),a.writeAttributeString("preserve","1");let t='<p:cSld name="Title and Content"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name="" /><p:cNvGrpSpPr /><p:nvPr /></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0" /><a:ext cx="0" cy="0" /><a:chOff x="0" y="0" /><a:chExt cx="0" cy="0" /></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="title" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Click to edit Master title style</a:t></a:r><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Content Placeholder 2" />'+'<p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph idx="1" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:pPr lvl="0" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl="1" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl="2" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl="3" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl="4" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Fifth level</a:t></a:r>'+'<a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Date Placeholder 3" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="dt" sz="half" idx="10" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:fld id="{BBCD0B08-7874-4091-A11F-B0CCB138CA98}" type="datetimeFigureOut"><a:rPr lang="ru-RU" smtClean="0" /><a:t>15.04.2009</a:t></a:fld><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Footer Placeholder 4" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="11" /></p:nvPr></p:nvSpPr>'+'<p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="6" name="Slide Number Placeholder 5" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="12" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:fld id="{F548980B-80A5-4AC9-8F15-D7D0FD0AEED9}" type="slidenum"><a:rPr lang="ru-RU" smtClean="0" /><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp></p:spTree></p:cSld>';a.writeRaw(t)}if(3==t){a.writeAttributeString("type","secHead"),a.writeAttributeString("preserve","1");let t='<p:cSld name="Section Header"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name="" /><p:cNvGrpSpPr /><p:nvPr /></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0" /><a:ext cx="0" cy="0" /><a:chOff x="0" y="0" /><a:chExt cx="0" cy="0" /></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="title" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="722313" y="4406900" /><a:ext cx="7772400" cy="1362075" /></a:xfrm></p:spPr><p:txBody><a:bodyPr anchor="t" /><a:lstStyle><a:lvl1pPr algn="l"><a:defRPr sz="4000" b="1" cap="all" /></a:lvl1pPr></a:lstStyle><a:p><a:r>'+'<a:rPr lang="en-US" smtClean="0" /><a:t>Click to edit Master title style</a:t></a:r><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Text Placeholder 2" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="body" idx="1" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="722313" y="2906713" /><a:ext cx="7772400" cy="1500187" /></a:xfrm></p:spPr><p:txBody><a:bodyPr anchor="b" /><a:lstStyle><a:lvl1pPr marL="0" indent="0"><a:buNone /><a:defRPr sz="2000"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000" /></a:schemeClr></a:solidFill></a:defRPr></a:lvl1pPr><a:lvl2pPr marL="457200" indent="0"><a:buNone />'+'<a:defRPr sz="1800"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000" /></a:schemeClr></a:solidFill></a:defRPr></a:lvl2pPr><a:lvl3pPr marL="914400" indent="0"><a:buNone /><a:defRPr sz="1600"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000" /></a:schemeClr></a:solidFill></a:defRPr></a:lvl3pPr><a:lvl4pPr marL="1371600" indent="0"><a:buNone /><a:defRPr sz="1400"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000" /></a:schemeClr></a:solidFill></a:defRPr></a:lvl4pPr><a:lvl5pPr marL="1828800" indent="0"><a:buNone /><a:defRPr sz="1400"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000" /></a:schemeClr></a:solidFill></a:defRPr></a:lvl5pPr>'+'<a:lvl6pPr marL="2286000" indent="0"><a:buNone /><a:defRPr sz="1400"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000" /></a:schemeClr></a:solidFill></a:defRPr></a:lvl6pPr><a:lvl7pPr marL="2743200" indent="0"><a:buNone /><a:defRPr sz="1400"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000" /></a:schemeClr></a:solidFill></a:defRPr></a:lvl7pPr><a:lvl8pPr marL="3200400" indent="0"><a:buNone /><a:defRPr sz="1400"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000" /></a:schemeClr></a:solidFill></a:defRPr></a:lvl8pPr><a:lvl9pPr marL="3657600" indent="0"><a:buNone /><a:defRPr sz="1400"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000" /></a:schemeClr></a:solidFill></a:defRPr></a:lvl9pPr></a:lstStyle>'+'<a:p><a:pPr lvl="0" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Click to edit Master text styles</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Date Placeholder 3" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="dt" sz="half" idx="10" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:fld id="{BBCD0B08-7874-4091-A11F-B0CCB138CA98}" type="datetimeFigureOut"><a:rPr lang="ru-RU" smtClean="0" /><a:t>15.04.2009</a:t></a:fld><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Footer Placeholder 4" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr>'+'<p:ph type="ftr" sz="quarter" idx="11" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="6" name="Slide Number Placeholder 5" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="12" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:fld id="{F548980B-80A5-4AC9-8F15-D7D0FD0AEED9}" type="slidenum"><a:rPr lang="ru-RU" smtClean="0" /><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp></p:spTree></p:cSld>';a.writeRaw(t)}if(4==t){a.writeAttributeString("type","twoObj"),a.writeAttributeString("preserve","1");let t='<p:cSld name="Two Content"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name="" /><p:cNvGrpSpPr /><p:nvPr /></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0" /><a:ext cx="0" cy="0" /><a:chOff x="0" y="0" /><a:chExt cx="0" cy="0" /></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="title" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Click to edit Master title style</a:t></a:r><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Content Placeholder 2" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr>'+'<p:nvPr><p:ph sz="half" idx="1" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="457200" y="1600200" /><a:ext cx="4038600" cy="4525963" /></a:xfrm></p:spPr><p:txBody><a:bodyPr /><a:lstStyle><a:lvl1pPr><a:defRPr sz="2800" /></a:lvl1pPr><a:lvl2pPr><a:defRPr sz="2400" /></a:lvl2pPr><a:lvl3pPr><a:defRPr sz="2000" /></a:lvl3pPr><a:lvl4pPr><a:defRPr sz="1800" /></a:lvl4pPr><a:lvl5pPr><a:defRPr sz="1800" /></a:lvl5pPr><a:lvl6pPr><a:defRPr sz="1800" /></a:lvl6pPr><a:lvl7pPr><a:defRPr sz="1800" /></a:lvl7pPr><a:lvl8pPr><a:defRPr sz="1800" /></a:lvl8pPr><a:lvl9pPr><a:defRPr sz="1800" /></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl="0" /><a:r><a:rPr lang="en-US" smtClean="0" />'+'<a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl="1" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl="2" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl="3" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl="4" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Fifth level</a:t></a:r><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Content Placeholder 3" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph sz="half" idx="2" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="4648200" y="1600200" />'+'<a:ext cx="4038600" cy="4525963" /></a:xfrm></p:spPr><p:txBody><a:bodyPr /><a:lstStyle><a:lvl1pPr><a:defRPr sz="2800" /></a:lvl1pPr><a:lvl2pPr><a:defRPr sz="2400" /></a:lvl2pPr><a:lvl3pPr><a:defRPr sz="2000" /></a:lvl3pPr><a:lvl4pPr><a:defRPr sz="1800" /></a:lvl4pPr><a:lvl5pPr><a:defRPr sz="1800" /></a:lvl5pPr><a:lvl6pPr><a:defRPr sz="1800" /></a:lvl6pPr><a:lvl7pPr><a:defRPr sz="1800" /></a:lvl7pPr><a:lvl8pPr><a:defRPr sz="1800" /></a:lvl8pPr><a:lvl9pPr><a:defRPr sz="1800" /></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl="0" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl="1" /><a:r><a:rPr lang="en-US" smtClean="0" />'+'<a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl="2" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl="3" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl="4" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Fifth level</a:t></a:r><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Date Placeholder 4" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="dt" sz="half" idx="10" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:fld id="{BBCD0B08-7874-4091-A11F-B0CCB138CA98}" type="datetimeFigureOut"><a:rPr lang="ru-RU" smtClean="0" />'+'<a:t>15.04.2009</a:t></a:fld><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="6" name="Footer Placeholder 5" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="11" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="7" name="Slide Number Placeholder 6" />'+'<p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="12" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:fld id="{F548980B-80A5-4AC9-8F15-D7D0FD0AEED9}" type="slidenum"><a:rPr lang="ru-RU" smtClean="0" /><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp></p:spTree></p:cSld>';a.writeRaw(t)}if(5==t){a.writeAttributeString("type","twoTxTwoObj"),a.writeAttributeString("preserve","1");let t='<p:cSld name="Comparison"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name="" /><p:cNvGrpSpPr /><p:nvPr /></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0" /><a:ext cx="0" cy="0" /><a:chOff x="0" y="0" /><a:chExt cx="0" cy="0" /></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="title" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle><a:lvl1pPr><a:defRPr /></a:lvl1pPr></a:lstStyle><a:p><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Click to edit Master title style</a:t></a:r><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Text Placeholder 2" />'+'<p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="body" idx="1" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="457200" y="1535113" /><a:ext cx="4040188" cy="639762" /></a:xfrm></p:spPr><p:txBody><a:bodyPr anchor="b" /><a:lstStyle><a:lvl1pPr marL="0" indent="0"><a:buNone /><a:defRPr sz="2400" b="1" /></a:lvl1pPr><a:lvl2pPr marL="457200" indent="0"><a:buNone /><a:defRPr sz="2000" b="1" /></a:lvl2pPr><a:lvl3pPr marL="914400" indent="0"><a:buNone /><a:defRPr sz="1800" b="1" /></a:lvl3pPr><a:lvl4pPr marL="1371600" indent="0"><a:buNone /><a:defRPr sz="1600" b="1" /></a:lvl4pPr><a:lvl5pPr marL="1828800" indent="0"><a:buNone /><a:defRPr sz="1600" b="1" /></a:lvl5pPr>'+'<a:lvl6pPr marL="2286000" indent="0"><a:buNone /><a:defRPr sz="1600" b="1" /></a:lvl6pPr><a:lvl7pPr marL="2743200" indent="0"><a:buNone /><a:defRPr sz="1600" b="1" /></a:lvl7pPr><a:lvl8pPr marL="3200400" indent="0"><a:buNone /><a:defRPr sz="1600" b="1" /></a:lvl8pPr><a:lvl9pPr marL="3657600" indent="0"><a:buNone /><a:defRPr sz="1600" b="1" /></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl="0" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Click to edit Master text styles</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Content Placeholder 3" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph sz="half" idx="2" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="457200" y="2174875" />'+'<a:ext cx="4040188" cy="3951288" /></a:xfrm></p:spPr><p:txBody><a:bodyPr /><a:lstStyle><a:lvl1pPr><a:defRPr sz="2400" /></a:lvl1pPr><a:lvl2pPr><a:defRPr sz="2000" /></a:lvl2pPr><a:lvl3pPr><a:defRPr sz="1800" /></a:lvl3pPr><a:lvl4pPr><a:defRPr sz="1600" /></a:lvl4pPr><a:lvl5pPr><a:defRPr sz="1600" /></a:lvl5pPr><a:lvl6pPr><a:defRPr sz="1600" /></a:lvl6pPr><a:lvl7pPr><a:defRPr sz="1600" /></a:lvl7pPr><a:lvl8pPr><a:defRPr sz="1600" /></a:lvl8pPr><a:lvl9pPr><a:defRPr sz="1600" /></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl="0" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl="1" /><a:r>'+'<a:rPr lang="en-US" smtClean="0" /><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl="2" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl="3" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl="4" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Fifth level</a:t></a:r><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Text Placeholder 4" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="body" sz="quarter" idx="3" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="4645025" y="1535113" /><a:ext cx="4041775" cy="639762" /></a:xfrm></p:spPr>'+'<p:txBody><a:bodyPr anchor="b" /><a:lstStyle><a:lvl1pPr marL="0" indent="0"><a:buNone /><a:defRPr sz="2400" b="1" /></a:lvl1pPr><a:lvl2pPr marL="457200" indent="0"><a:buNone /><a:defRPr sz="2000" b="1" /></a:lvl2pPr><a:lvl3pPr marL="914400" indent="0"><a:buNone /><a:defRPr sz="1800" b="1" /></a:lvl3pPr><a:lvl4pPr marL="1371600" indent="0"><a:buNone /><a:defRPr sz="1600" b="1" /></a:lvl4pPr><a:lvl5pPr marL="1828800" indent="0"><a:buNone /><a:defRPr sz="1600" b="1" /></a:lvl5pPr><a:lvl6pPr marL="2286000" indent="0"><a:buNone /><a:defRPr sz="1600" b="1" /></a:lvl6pPr><a:lvl7pPr marL="2743200" indent="0"><a:buNone /><a:defRPr sz="1600" b="1" /></a:lvl7pPr><a:lvl8pPr marL="3200400" indent="0">'+'<a:buNone /><a:defRPr sz="1600" b="1" /></a:lvl8pPr><a:lvl9pPr marL="3657600" indent="0"><a:buNone /><a:defRPr sz="1600" b="1" /></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl="0" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Click to edit Master text styles</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="6" name="Content Placeholder 5" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph sz="quarter" idx="4" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="4645025" y="2174875" /><a:ext cx="4041775" cy="3951288" /></a:xfrm></p:spPr><p:txBody><a:bodyPr /><a:lstStyle><a:lvl1pPr><a:defRPr sz="2400" /></a:lvl1pPr><a:lvl2pPr><a:defRPr sz="2000" /></a:lvl2pPr>'+'<a:lvl3pPr><a:defRPr sz="1800" /></a:lvl3pPr><a:lvl4pPr><a:defRPr sz="1600" /></a:lvl4pPr><a:lvl5pPr><a:defRPr sz="1600" /></a:lvl5pPr><a:lvl6pPr><a:defRPr sz="1600" /></a:lvl6pPr><a:lvl7pPr><a:defRPr sz="1600" /></a:lvl7pPr><a:lvl8pPr><a:defRPr sz="1600" /></a:lvl8pPr><a:lvl9pPr><a:defRPr sz="1600" /></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl="0" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl="1" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl="2" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl="3" /><a:r>'+'<a:rPr lang="en-US" smtClean="0" /><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl="4" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Fifth level</a:t></a:r><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="7" name="Date Placeholder 6" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="dt" sz="half" idx="10" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:fld id="{BBCD0B08-7874-4091-A11F-B0CCB138CA98}" type="datetimeFigureOut"><a:rPr lang="ru-RU" smtClean="0" /><a:t>15.04.2009</a:t></a:fld><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="8" name="Footer Placeholder 7" />'+'<p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="11" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="9" name="Slide Number Placeholder 8" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="12" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:fld id="{F548980B-80A5-4AC9-8F15-D7D0FD0AEED9}" type="slidenum"><a:rPr lang="ru-RU" smtClean="0" /><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp></p:spTree></p:cSld>';a.writeRaw(t)}if(6==t){a.writeAttributeString("type","titleOnly"),a.writeAttributeString("preserve","1");let t='<p:cSld name="Title Only"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name="" /><p:cNvGrpSpPr /><p:nvPr /></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0" /><a:ext cx="0" cy="0" /><a:chOff x="0" y="0" /><a:chExt cx="0" cy="0" /></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="title" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Click to edit Master title style</a:t></a:r><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Date Placeholder 2" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr>'+'<p:nvPr><p:ph type="dt" sz="half" idx="10" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:fld id="{BBCD0B08-7874-4091-A11F-B0CCB138CA98}" type="datetimeFigureOut"><a:rPr lang="ru-RU" smtClean="0" /><a:t>15.04.2009</a:t></a:fld><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Footer Placeholder 3" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="11" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Slide Number Placeholder 4" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr>'+'<p:nvPr><p:ph type="sldNum" sz="quarter" idx="12" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:fld id="{F548980B-80A5-4AC9-8F15-D7D0FD0AEED9}" type="slidenum"><a:rPr lang="ru-RU" smtClean="0" /><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp></p:spTree></p:cSld>';a.writeRaw(t)}if(7==t){a.writeAttributeString("type","blank"),a.writeAttributeString("preserve","1"),a.writeStartElement("p:cSld"),a.writeAttributeString("name","Blank"),a.writeStartElement("p:spTree"),a.writeStartElement("p:nvGrpSpPr"),a.writeStartElement("p:cNvPr"),a.writeAttributeString("id","1"),a.writeAttributeString("name",""),a.writeEndElement(),a.writeStartElement("p:cNvGrpSpPr"),a.writeEndElement(),a.writeStartElement("p:nvPr"),a.writeEndElement(),a.writeFullEndElement(),a.writeStartElement("p:grpSpPr"),a.writeStartElement("a:xfrm"),a.writeStartElement("a:off"),a.writeAttributeString("x","0"),a.writeAttributeString("y","0"),a.writeEndElement(),a.writeStartElement("a:ext"),a.writeAttributeString("cx","0"),a.writeAttributeString("cy","0"),a.writeEndElement(),a.writeStartElement("a:chOff"),a.writeAttributeString("x","0"),a.writeAttributeString("y","0"),a.writeEndElement(),a.writeStartElement("a:chExt"),a.writeAttributeString("cx","0"),a.writeAttributeString("cy","0"),a.writeEndElement(),a.writeFullEndElement(),a.writeFullEndElement(),a.writeStartElement("p:sp"),a.writeStartElement("p:nvSpPr"),a.writeStartElement("p:cNvPr"),a.writeAttributeString("id","2"),a.writeAttributeString("name","Date Placeholder 1"),a.writeEndElement(),a.writeStartElement("p:cNvSpPr"),a.writeStartElement("a:spLocks"),a.writeAttributeString("noGrp","1"),a.writeEndElement(),a.writeFullEndElement(),a.writeStartElement("p:nvPr"),a.writeStartElement("p:ph"),a.writeAttributeString("type","dt"),a.writeAttributeString("sz","half"),a.writeAttributeString("idx","10"),a.writeEndElement(),a.writeFullEndElement(),a.writeFullEndElement(),a.writeStartElement("p:spPr"),a.writeEndElement(),a.writeStartElement("p:txBody"),a.writeStartElement("a:bodyPr"),a.writeEndElement(),a.writeStartElement("a:lstStyle"),a.writeEndElement(),a.writeStartElement("a:p"),a.writeStartElement("a:fld"),a.writeAttributeString("id","{BBCD0B08-7874-4091-A11F-B0CCB138CA98}"),a.writeAttributeString("type","datetimeFigureOut"),a.writeStartElement("a:rPr"),a.writeAttributeString("lang","ru-RU"),a.writeAttributeString("smtClean","0"),a.writeEndElement(),a.writeStartElement("a:t"),a.writeString("15.04.2009"),a.writeFullEndElement(),a.writeFullEndElement(),a.writeStartElement("a:endParaRPr"),a.writeAttributeString("lang","ru-RU"),a.writeEndElement(),a.writeFullEndElement(),a.writeFullEndElement(),a.writeFullEndElement(),a.writeStartElement("p:sp"),a.writeStartElement("p:nvSpPr"),a.writeStartElement("p:cNvPr"),a.writeAttributeString("id","3"),a.writeAttributeString("name","Footer Placeholder 2"),a.writeEndElement(),a.writeStartElement("p:cNvSpPr"),a.writeStartElement("a:spLocks"),a.writeAttributeString("noGrp","1"),a.writeEndElement(),a.writeFullEndElement(),a.writeStartElement("p:nvPr"),a.writeStartElement("p:ph"),a.writeAttributeString("type","ftr"),a.writeAttributeString("sz","quarter"),a.writeAttributeString("idx","11"),a.writeEndElement(),a.writeFullEndElement(),a.writeFullEndElement(),a.writeStartElement("p:spPr"),a.writeEndElement(),a.writeStartElement("p:txBody"),a.writeStartElement("a:bodyPr"),a.writeEndElement(),a.writeStartElement("a:lstStyle"),a.writeEndElement(),a.writeStartElement("a:p"),a.writeStartElement("a:endParaRPr"),a.writeAttributeString("lang","ru-RU"),a.writeEndElement(),a.writeFullEndElement(),a.writeFullEndElement(),a.writeFullEndElement(),a.writeStartElement("p:sp"),a.writeStartElement("p:nvSpPr"),a.writeStartElement("p:cNvPr"),a.writeAttributeString("id","4"),a.writeAttributeString("name","Slide Number Placeholder 3"),a.writeEndElement(),a.writeStartElement("p:cNvSpPr"),a.writeStartElement("a:spLocks"),a.writeAttributeString("noGrp","1"),a.writeEndElement(),a.writeFullEndElement(),a.writeStartElement("p:nvPr"),a.writeStartElement("p:ph"),a.writeAttributeString("type","sldNum"),a.writeAttributeString("sz","quarter"),a.writeAttributeString("idx","12"),a.writeEndElement(),a.writeFullEndElement(),a.writeFullEndElement(),a.writeStartElement("p:spPr"),a.writeEndElement(),a.writeStartElement("p:txBody"),a.writeStartElement("a:bodyPr"),a.writeEndElement(),a.writeStartElement("a:lstStyle"),a.writeEndElement(),a.writeStartElement("a:p"),a.writeStartElement("a:fld"),a.writeAttributeString("id","{F548980B-80A5-4AC9-8F15-D7D0FD0AEED9}"),a.writeAttributeString("type","slidenum"),a.writeStartElement("a:rPr"),a.writeAttributeString("lang","ru-RU"),a.writeAttributeString("smtClean","0"),a.writeEndElement(),a.writeStartElement("a:t"),a.writeString("‹#›"),a.writeFullEndElement(),a.writeFullEndElement(),a.writeStartElement("a:endParaRPr"),a.writeAttributeString("lang","ru-RU"),a.writeEndElement(),a.writeFullEndElement(),a.writeFullEndElement(),a.writeFullEndElement();let t=null==(i=this.report.parentReport)?void 0:i.getCurrentPage(),e=this.report.isDocument&&null!=t&&t.is(IStiDashboard);if((!Stimulsoft.Base.FslAA.wtLiI.aYwiY()||e)&&(!Stimulsoft.Base.FslAA.wtLiI.dSiYV()||!e)&&(!(Stimulsoft.Base.FslAA.wtLiI.DKlzG()||Stimulsoft.Base.FslAA.wtLiI.hatRb()&&!e||Stimulsoft.Base.FslAA.wtLiI.kqAKB()&&e)||!Stimulsoft.System.NodeJs.isStandaloneVersion)){let t=n.unit.convertToHInches(n.pageWidth-n.margins.left-n.margins.right),e=n.unit.convertToHInches(n.pageHeight-n.margins.top-n.margins.bottom),i=n.unit.convertToHInches(n.margins.left),r=n.unit.convertToHInches(n.margins.top);a.writeRaw('<p:sp><p:nvSpPr><p:cNvPr id="67" name="TextBox Additional"/><p:cNvSpPr txBox="1"/><p:nvPr userDrawn="1"/></p:nvSpPr>'+'<p:spPr><a:xfrm rot="-2700000"><a:off x="'+this.convertToEmu(i)+'" y="'+this.convertToEmu(r+.45*e)+'"/><a:ext cx="'+this.convertToEmu(t)+'" cy="'+this.convertToEmu(.1*e)+'"/></a:xfrm>'+'<a:prstGeom prst="rect"><a:avLst/></a:prstGeom><a:noFill/></p:spPr>'+'<p:txBody><a:bodyPr wrap="square" rtlCol="0" anchor="ctr" anchorCtr="0"><a:spAutoFit/></a:bodyPr><a:lstStyle/><a:p><a:pPr algn="ctr"/><a:r><a:rPr lang="en-US" sz="9600" b="1" dirty="0" smtClean="0">'+'<a:solidFill><a:schemeClr val="tx1"><a:alpha val="12000"/></a:schemeClr></a:solidFill>'+'<a:latin typeface="Arial" panose="020B0604020202020204" pitchFamily="34" charset="0"/><a:cs typeface="Arial" panose="020B0604020202020204" pitchFamily="34" charset="0"/>'+"</a:rPr><a:t>Trial</a:t></a:r></a:p></p:txBody></p:sp>")}a.writeFullEndElement(),a.writeFullEndElement()}if(8==t){a.writeAttributeString("type","objTx"),a.writeAttributeString("preserve","1");let t='<p:cSld name="Content with Caption"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name="" /><p:cNvGrpSpPr /><p:nvPr /></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0" /><a:ext cx="0" cy="0" /><a:chOff x="0" y="0" /><a:chExt cx="0" cy="0" /></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="title" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="457200" y="273050" /><a:ext cx="3008313" cy="1162050" /></a:xfrm></p:spPr><p:txBody><a:bodyPr anchor="b" /><a:lstStyle><a:lvl1pPr algn="l"><a:defRPr sz="2000" b="1" /></a:lvl1pPr></a:lstStyle><a:p><a:r><a:rPr lang="en-US" smtClean="0" />'+'<a:t>Click to edit Master title style</a:t></a:r><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Content Placeholder 2" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph idx="1" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="3575050" y="273050" /><a:ext cx="5111750" cy="5853113" /></a:xfrm></p:spPr><p:txBody><a:bodyPr /><a:lstStyle><a:lvl1pPr><a:defRPr sz="3200" /></a:lvl1pPr><a:lvl2pPr><a:defRPr sz="2800" /></a:lvl2pPr><a:lvl3pPr><a:defRPr sz="2400" /></a:lvl3pPr><a:lvl4pPr><a:defRPr sz="2000" /></a:lvl4pPr><a:lvl5pPr><a:defRPr sz="2000" /></a:lvl5pPr><a:lvl6pPr><a:defRPr sz="2000" /></a:lvl6pPr><a:lvl7pPr>'+'<a:defRPr sz="2000" /></a:lvl7pPr><a:lvl8pPr><a:defRPr sz="2000" /></a:lvl8pPr><a:lvl9pPr><a:defRPr sz="2000" /></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl="0" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl="1" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl="2" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl="3" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl="4" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Fifth level</a:t></a:r><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp>'+'<p:sp><p:nvSpPr><p:cNvPr id="4" name="Text Placeholder 3" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="body" sz="half" idx="2" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="457200" y="1435100" /><a:ext cx="3008313" cy="4691063" /></a:xfrm></p:spPr><p:txBody><a:bodyPr /><a:lstStyle><a:lvl1pPr marL="0" indent="0"><a:buNone /><a:defRPr sz="1400" /></a:lvl1pPr><a:lvl2pPr marL="457200" indent="0"><a:buNone /><a:defRPr sz="1200" /></a:lvl2pPr><a:lvl3pPr marL="914400" indent="0"><a:buNone /><a:defRPr sz="1000" /></a:lvl3pPr><a:lvl4pPr marL="1371600" indent="0"><a:buNone /><a:defRPr sz="900" /></a:lvl4pPr><a:lvl5pPr marL="1828800" indent="0">'+'<a:buNone /><a:defRPr sz="900" /></a:lvl5pPr><a:lvl6pPr marL="2286000" indent="0"><a:buNone /><a:defRPr sz="900" /></a:lvl6pPr><a:lvl7pPr marL="2743200" indent="0"><a:buNone /><a:defRPr sz="900" /></a:lvl7pPr><a:lvl8pPr marL="3200400" indent="0"><a:buNone /><a:defRPr sz="900" /></a:lvl8pPr><a:lvl9pPr marL="3657600" indent="0"><a:buNone /><a:defRPr sz="900" /></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl="0" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Click to edit Master text styles</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Date Placeholder 4" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="dt" sz="half" idx="10" /></p:nvPr></p:nvSpPr><p:spPr />'+'<p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:fld id="{BBCD0B08-7874-4091-A11F-B0CCB138CA98}" type="datetimeFigureOut"><a:rPr lang="ru-RU" smtClean="0" /><a:t>15.04.2009</a:t></a:fld><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="6" name="Footer Placeholder 5" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="11" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="7" name="Slide Number Placeholder 6" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="12" /></p:nvPr></p:nvSpPr><p:spPr />'+'<p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:fld id="{F548980B-80A5-4AC9-8F15-D7D0FD0AEED9}" type="slidenum"><a:rPr lang="ru-RU" smtClean="0" /><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp></p:spTree></p:cSld>';a.writeRaw(t)}if(9==t){a.writeAttributeString("type","picTx"),a.writeAttributeString("preserve","1");let t='<p:cSld name="Picture with Caption"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name="" /><p:cNvGrpSpPr /><p:nvPr /></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0" /><a:ext cx="0" cy="0" /><a:chOff x="0" y="0" /><a:chExt cx="0" cy="0" /></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="title" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="1792288" y="4800600" /><a:ext cx="5486400" cy="566738" /></a:xfrm></p:spPr><p:txBody><a:bodyPr anchor="b" /><a:lstStyle><a:lvl1pPr algn="l"><a:defRPr sz="2000" b="1" /></a:lvl1pPr></a:lstStyle><a:p><a:r><a:rPr lang="en-US" smtClean="0" />'+'<a:t>Click to edit Master title style</a:t></a:r><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Picture Placeholder 2" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="pic" idx="1" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="1792288" y="612775" /><a:ext cx="5486400" cy="4114800" /></a:xfrm></p:spPr><p:txBody><a:bodyPr /><a:lstStyle><a:lvl1pPr marL="0" indent="0"><a:buNone /><a:defRPr sz="3200" /></a:lvl1pPr><a:lvl2pPr marL="457200" indent="0"><a:buNone /><a:defRPr sz="2800" /></a:lvl2pPr><a:lvl3pPr marL="914400" indent="0"><a:buNone /><a:defRPr sz="2400" /></a:lvl3pPr>'+'<a:lvl4pPr marL="1371600" indent="0"><a:buNone /><a:defRPr sz="2000" /></a:lvl4pPr><a:lvl5pPr marL="1828800" indent="0"><a:buNone /><a:defRPr sz="2000" /></a:lvl5pPr><a:lvl6pPr marL="2286000" indent="0"><a:buNone /><a:defRPr sz="2000" /></a:lvl6pPr><a:lvl7pPr marL="2743200" indent="0"><a:buNone /><a:defRPr sz="2000" /></a:lvl7pPr><a:lvl8pPr marL="3200400" indent="0"><a:buNone /><a:defRPr sz="2000" /></a:lvl8pPr><a:lvl9pPr marL="3657600" indent="0"><a:buNone /><a:defRPr sz="2000" /></a:lvl9pPr></a:lstStyle><a:p><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Text Placeholder 3" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr>'+'<p:nvPr><p:ph type="body" sz="half" idx="2" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="1792288" y="5367338" /><a:ext cx="5486400" cy="804862" /></a:xfrm></p:spPr><p:txBody><a:bodyPr /><a:lstStyle><a:lvl1pPr marL="0" indent="0"><a:buNone /><a:defRPr sz="1400" /></a:lvl1pPr><a:lvl2pPr marL="457200" indent="0"><a:buNone /><a:defRPr sz="1200" /></a:lvl2pPr><a:lvl3pPr marL="914400" indent="0"><a:buNone /><a:defRPr sz="1000" /></a:lvl3pPr><a:lvl4pPr marL="1371600" indent="0"><a:buNone /><a:defRPr sz="900" /></a:lvl4pPr><a:lvl5pPr marL="1828800" indent="0"><a:buNone /><a:defRPr sz="900" /></a:lvl5pPr><a:lvl6pPr marL="2286000" indent="0"><a:buNone /><a:defRPr sz="900" /></a:lvl6pPr>'+'<a:lvl7pPr marL="2743200" indent="0"><a:buNone /><a:defRPr sz="900" /></a:lvl7pPr><a:lvl8pPr marL="3200400" indent="0"><a:buNone /><a:defRPr sz="900" /></a:lvl8pPr><a:lvl9pPr marL="3657600" indent="0"><a:buNone /><a:defRPr sz="900" /></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl="0" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Click to edit Master text styles</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Date Placeholder 4" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="dt" sz="half" idx="10" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:fld id="{BBCD0B08-7874-4091-A11F-B0CCB138CA98}" type="datetimeFigureOut">'+'<a:rPr lang="ru-RU" smtClean="0" /><a:t>15.04.2009</a:t></a:fld><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="6" name="Footer Placeholder 5" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="11" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="7" name="Slide Number Placeholder 6" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="12" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle />'+'<a:p><a:fld id="{F548980B-80A5-4AC9-8F15-D7D0FD0AEED9}" type="slidenum"><a:rPr lang="ru-RU" smtClean="0" /><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp></p:spTree></p:cSld>';a.writeRaw(t)}if(10==t){a.writeAttributeString("type","vertTx"),a.writeAttributeString("preserve","1");let t='<p:cSld name="Title and Vertical Text"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name="" /><p:cNvGrpSpPr /><p:nvPr /></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0" /><a:ext cx="0" cy="0" /><a:chOff x="0" y="0" /><a:chExt cx="0" cy="0" /></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="title" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Click to edit Master title style</a:t></a:r><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr>'+'<p:cNvPr id="3" name="Vertical Text Placeholder 2" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="body" orient="vert" idx="1" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr vert="eaVert" /><a:lstStyle /><a:p><a:pPr lvl="0" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl="1" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl="2" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl="3" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl="4" />'+'<a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Fifth level</a:t></a:r><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Date Placeholder 3" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="dt" sz="half" idx="10" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:fld id="{BBCD0B08-7874-4091-A11F-B0CCB138CA98}" type="datetimeFigureOut"><a:rPr lang="ru-RU" smtClean="0" /><a:t>15.04.2009</a:t></a:fld><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Footer Placeholder 4" /><p:cNvSpPr>'+'<a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="11" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="6" name="Slide Number Placeholder 5" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="12" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:fld id="{F548980B-80A5-4AC9-8F15-D7D0FD0AEED9}" type="slidenum"><a:rPr lang="ru-RU" smtClean="0" /><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp></p:spTree></p:cSld>';a.writeRaw(t)}if(11==t){a.writeAttributeString("type","vertTitleAndTx"),a.writeAttributeString("preserve","1");let t='<p:cSld name="Vertical Title and Text"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name="" /><p:cNvGrpSpPr /><p:nvPr /></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0" /><a:ext cx="0" cy="0" /><a:chOff x="0" y="0" /><a:chExt cx="0" cy="0" /></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Vertical Title 1" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="title" orient="vert" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="6629400" y="274638" /><a:ext cx="2057400" cy="5851525" /></a:xfrm></p:spPr><p:txBody><a:bodyPr vert="eaVert" /><a:lstStyle /><a:p><a:r><a:rPr lang="en-US" smtClean="0" />'+'<a:t>Click to edit Master title style</a:t></a:r><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Vertical Text Placeholder 2" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="body" orient="vert" idx="1" /></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="457200" y="274638" /><a:ext cx="6019800" cy="5851525" /></a:xfrm></p:spPr><p:txBody><a:bodyPr vert="eaVert" /><a:lstStyle /><a:p><a:pPr lvl="0" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl="1" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Second level</a:t></a:r></a:p><a:p>'+'<a:pPr lvl="2" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl="3" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl="4" /><a:r><a:rPr lang="en-US" smtClean="0" /><a:t>Fifth level</a:t></a:r><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Date Placeholder 3" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="dt" sz="half" idx="10" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:fld id="{BBCD0B08-7874-4091-A11F-B0CCB138CA98}" type="datetimeFigureOut"><a:rPr lang="ru-RU" smtClean="0" />'+'<a:t>15.04.2009</a:t></a:fld><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Footer Placeholder 4" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="11" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle /><a:p><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="6" name="Slide Number Placeholder 5" /><p:cNvSpPr><a:spLocks noGrp="1" /></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="12" /></p:nvPr></p:nvSpPr><p:spPr /><p:txBody><a:bodyPr /><a:lstStyle />'+'<a:p><a:fld id="{F548980B-80A5-4AC9-8F15-D7D0FD0AEED9}" type="slidenum"><a:rPr lang="ru-RU" smtClean="0" /><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="ru-RU" /></a:p></p:txBody></p:sp></p:spTree></p:cSld>';a.writeRaw(t)}return a.writeStartElement("p:clrMapOvr"),a.writeStartElement("a:masterClrMapping"),a.writeEndElement(),a.writeFullEndElement(),a.writeFullEndElement(),a.writeEndDocument(),a.flush(),e}writePresentationRels(e){let t=new MemoryStream,i=new XmlTextWriter(Encoding.UTF8,t);i.indentation=this.xmlIndentation<0?0:this.xmlIndentation,i.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,i.writeStartDocument(),i.writeStartElement("Relationships"),i.writeAttributeString("xmlns","http://schemas.openxmlformats.org/package/2006/relationships"),i.writeStartElement("Relationship"),i.writeAttributeString("Id","rId1"),i.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles"),i.writeAttributeString("Target","tableStyles.xml"),i.writeEndElement(),i.writeStartElement("Relationship"),i.writeAttributeString("Id","rId2"),i.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps"),i.writeAttributeString("Target","viewProps.xml"),i.writeEndElement(),i.writeStartElement("Relationship"),i.writeAttributeString("Id","rId3"),i.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps"),i.writeAttributeString("Target","presProps.xml"),i.writeEndElement(),i.writeStartElement("Relationship"),i.writeAttributeString("Id","rId4"),i.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"),i.writeAttributeString("Target","theme/theme1.xml"),i.writeEndElement(),i.writeStartElement("Relationship"),i.writeAttributeString("Id","rId5"),i.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster"),i.writeAttributeString("Target","slideMasters/slideMaster1.xml"),i.writeEndElement();for(let t=0;t<e.count;t++)i.writeStartElement("Relationship"),i.writeAttributeString("Id",`rId`+(6+t)),i.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide"),i.writeAttributeString("Target",`slides/slide${t+1}.xml`),i.writeEndElement();return i.writeFullEndElement(),i.writeEndDocument(),i.flush(),t}writePresentation(e){let t=new MemoryStream,i=new XmlTextWriter(Encoding.UTF8,t);i.indentation=this.xmlIndentation<0?0:this.xmlIndentation,i.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,i.writeStartDocument(),i.writeStartElement("p:presentation"),i.writeAttributeString("xmlns:a","http://schemas.openxmlformats.org/drawingml/2006/main"),i.writeAttributeString("xmlns:r","http://schemas.openxmlformats.org/officeDocument/2006/relationships"),i.writeAttributeString("xmlns:p","http://schemas.openxmlformats.org/presentationml/2006/main"),i.writeAttributeString("saveSubsetFonts","1"),i.writeStartElement("p:sldMasterIdLst"),i.writeStartElement("p:sldMasterId"),i.writeAttributeString("id","2147483648"),i.writeAttributeString("r:id","rId5"),i.writeEndElement(),i.writeFullEndElement(),i.writeStartElement("p:sldIdLst");for(let t=0;t<e.count;t++)i.writeStartElement("p:sldId"),i.writeAttributeString("id",(256+t).toString()),i.writeAttributeString("r:id",`rId`+(6+t)),i.writeEndElement();i.writeEndElement();let r=e.getByIndex(0);return i.writeStartElement("p:sldSz"),i.writeAttributeString("cx",this.convertToEmu(r.unit.convertToHInches(r.width+r.margins.left+r.margins.right)).toString()),i.writeAttributeString("cy",this.convertToEmu(r.unit.convertToHInches(r.height+r.margins.top+r.margins.bottom)).toString()),i.writeEndElement(),i.writeStartElement("p:notesSz"),i.writeAttributeString("cx","6858000"),i.writeAttributeString("cy","9144000"),i.writeEndElement(),i.writeStartElement("p:defaultTextStyle"),i.writeStartElement("a:defPPr"),i.writeStartElement("a:defRPr"),i.writeAttributeString("lang","ru-RU"),i.writeEndElement(),i.writeFullEndElement(),i.writeStartElement("a:lvl1pPr"),i.writeAttributeString("marL","0"),i.writeAttributeString("algn","l"),i.writeAttributeString("defTabSz","914400"),i.writeAttributeString("rtl","0"),i.writeAttributeString("eaLnBrk","1"),i.writeAttributeString("latinLnBrk","0"),i.writeAttributeString("hangingPunct","1"),i.writeStartElement("a:defRPr"),i.writeAttributeString("sz","1800"),i.writeAttributeString("kern","1200"),i.writeStartElement("a:solidFill"),i.writeStartElement("a:schemeClr"),i.writeAttributeString("val","tx1"),i.writeEndElement(),i.writeFullEndElement(),i.writeStartElement("a:latin"),i.writeAttributeString("typeface","+mn-lt"),i.writeEndElement(),i.writeStartElement("a:ea"),i.writeAttributeString("typeface","+mn-ea"),i.writeEndElement(),i.writeStartElement("a:cs"),i.writeAttributeString("typeface","+mn-cs"),i.writeEndElement(),i.writeFullEndElement(),i.writeFullEndElement(),i.writeStartElement("a:lvl2pPr"),i.writeAttributeString("marL","457200"),i.writeAttributeString("algn","l"),i.writeAttributeString("defTabSz","914400"),i.writeAttributeString("rtl","0"),i.writeAttributeString("eaLnBrk","1"),i.writeAttributeString("latinLnBrk","0"),i.writeAttributeString("hangingPunct","1"),i.writeStartElement("a:defRPr"),i.writeAttributeString("sz","1800"),i.writeAttributeString("kern","1200"),i.writeStartElement("a:solidFill"),i.writeStartElement("a:schemeClr"),i.writeAttributeString("val","tx1"),i.writeEndElement(),i.writeFullEndElement(),i.writeStartElement("a:latin"),i.writeAttributeString("typeface","+mn-lt"),i.writeEndElement(),i.writeStartElement("a:ea"),i.writeAttributeString("typeface","+mn-ea"),i.writeEndElement(),i.writeStartElement("a:cs"),i.writeAttributeString("typeface","+mn-cs"),i.writeEndElement(),i.writeFullEndElement(),i.writeFullEndElement(),i.writeStartElement("a:lvl3pPr"),i.writeAttributeString("marL","914400"),i.writeAttributeString("algn","l"),i.writeAttributeString("defTabSz","914400"),i.writeAttributeString("rtl","0"),i.writeAttributeString("eaLnBrk","1"),i.writeAttributeString("latinLnBrk","0"),i.writeAttributeString("hangingPunct","1"),i.writeStartElement("a:defRPr"),i.writeAttributeString("sz","1800"),i.writeAttributeString("kern","1200"),i.writeStartElement("a:solidFill"),i.writeStartElement("a:schemeClr"),i.writeAttributeString("val","tx1"),i.writeEndElement(),i.writeFullEndElement(),i.writeStartElement("a:latin"),i.writeAttributeString("typeface","+mn-lt"),i.writeEndElement(),i.writeStartElement("a:ea"),i.writeAttributeString("typeface","+mn-ea"),i.writeEndElement(),i.writeStartElement("a:cs"),i.writeAttributeString("typeface","+mn-cs"),i.writeEndElement(),i.writeFullEndElement(),i.writeFullEndElement(),i.writeStartElement("a:lvl4pPr"),i.writeAttributeString("marL","1371600"),i.writeAttributeString("algn","l"),i.writeAttributeString("defTabSz","914400"),i.writeAttributeString("rtl","0"),i.writeAttributeString("eaLnBrk","1"),i.writeAttributeString("latinLnBrk","0"),i.writeAttributeString("hangingPunct","1"),i.writeStartElement("a:defRPr"),i.writeAttributeString("sz","1800"),i.writeAttributeString("kern","1200"),i.writeStartElement("a:solidFill"),i.writeStartElement("a:schemeClr"),i.writeAttributeString("val","tx1"),i.writeEndElement(),i.writeFullEndElement(),i.writeStartElement("a:latin"),i.writeAttributeString("typeface","+mn-lt"),i.writeEndElement(),i.writeStartElement("a:ea"),i.writeAttributeString("typeface","+mn-ea"),i.writeEndElement(),i.writeStartElement("a:cs"),i.writeAttributeString("typeface","+mn-cs"),i.writeEndElement(),i.writeFullEndElement(),i.writeFullEndElement(),i.writeStartElement("a:lvl5pPr"),i.writeAttributeString("marL","1828800"),i.writeAttributeString("algn","l"),i.writeAttributeString("defTabSz","914400"),i.writeAttributeString("rtl","0"),i.writeAttributeString("eaLnBrk","1"),i.writeAttributeString("latinLnBrk","0"),i.writeAttributeString("hangingPunct","1"),i.writeStartElement("a:defRPr"),i.writeAttributeString("sz","1800"),i.writeAttributeString("kern","1200"),i.writeStartElement("a:solidFill"),i.writeStartElement("a:schemeClr"),i.writeAttributeString("val","tx1"),i.writeEndElement(),i.writeFullEndElement(),i.writeStartElement("a:latin"),i.writeAttributeString("typeface","+mn-lt"),i.writeEndElement(),i.writeStartElement("a:ea"),i.writeAttributeString("typeface","+mn-ea"),i.writeEndElement(),i.writeStartElement("a:cs"),i.writeAttributeString("typeface","+mn-cs"),i.writeEndElement(),i.writeFullEndElement(),i.writeFullEndElement(),i.writeStartElement("a:lvl6pPr"),i.writeAttributeString("marL","2286000"),i.writeAttributeString("algn","l"),i.writeAttributeString("defTabSz","914400"),i.writeAttributeString("rtl","0"),i.writeAttributeString("eaLnBrk","1"),i.writeAttributeString("latinLnBrk","0"),i.writeAttributeString("hangingPunct","1"),i.writeStartElement("a:defRPr"),i.writeAttributeString("sz","1800"),i.writeAttributeString("kern","1200"),i.writeStartElement("a:solidFill"),i.writeStartElement("a:schemeClr"),i.writeAttributeString("val","tx1"),i.writeEndElement(),i.writeFullEndElement(),i.writeStartElement("a:latin"),i.writeAttributeString("typeface","+mn-lt"),i.writeEndElement(),i.writeStartElement("a:ea"),i.writeAttributeString("typeface","+mn-ea"),i.writeEndElement(),i.writeStartElement("a:cs"),i.writeAttributeString("typeface","+mn-cs"),i.writeEndElement(),i.writeFullEndElement(),i.writeFullEndElement(),i.writeStartElement("a:lvl7pPr"),i.writeAttributeString("marL","2743200"),i.writeAttributeString("algn","l"),i.writeAttributeString("defTabSz","914400"),i.writeAttributeString("rtl","0"),i.writeAttributeString("eaLnBrk","1"),i.writeAttributeString("latinLnBrk","0"),i.writeAttributeString("hangingPunct","1"),i.writeStartElement("a:defRPr"),i.writeAttributeString("sz","1800"),i.writeAttributeString("kern","1200"),i.writeStartElement("a:solidFill"),i.writeStartElement("a:schemeClr"),i.writeAttributeString("val","tx1"),i.writeEndElement(),i.writeFullEndElement(),i.writeStartElement("a:latin"),i.writeAttributeString("typeface","+mn-lt"),i.writeEndElement(),i.writeStartElement("a:ea"),i.writeAttributeString("typeface","+mn-ea"),i.writeEndElement(),i.writeStartElement("a:cs"),i.writeAttributeString("typeface","+mn-cs"),i.writeEndElement(),i.writeFullEndElement(),i.writeFullEndElement(),i.writeStartElement("a:lvl8pPr"),i.writeAttributeString("marL","3200400"),i.writeAttributeString("algn","l"),i.writeAttributeString("defTabSz","914400"),i.writeAttributeString("rtl","0"),i.writeAttributeString("eaLnBrk","1"),i.writeAttributeString("latinLnBrk","0"),i.writeAttributeString("hangingPunct","1"),i.writeStartElement("a:defRPr"),i.writeAttributeString("sz","1800"),i.writeAttributeString("kern","1200"),i.writeStartElement("a:solidFill"),i.writeStartElement("a:schemeClr"),i.writeAttributeString("val","tx1"),i.writeEndElement(),i.writeFullEndElement(),i.writeStartElement("a:latin"),i.writeAttributeString("typeface","+mn-lt"),i.writeEndElement(),i.writeStartElement("a:ea"),i.writeAttributeString("typeface","+mn-ea"),i.writeEndElement(),i.writeStartElement("a:cs"),i.writeAttributeString("typeface","+mn-cs"),i.writeEndElement(),i.writeFullEndElement(),i.writeFullEndElement(),i.writeStartElement("a:lvl9pPr"),i.writeAttributeString("marL","3657600"),i.writeAttributeString("algn","l"),i.writeAttributeString("defTabSz","914400"),i.writeAttributeString("rtl","0"),i.writeAttributeString("eaLnBrk","1"),i.writeAttributeString("latinLnBrk","0"),i.writeAttributeString("hangingPunct","1"),i.writeStartElement("a:defRPr"),i.writeAttributeString("sz","1800"),i.writeAttributeString("kern","1200"),i.writeStartElement("a:solidFill"),i.writeStartElement("a:schemeClr"),i.writeAttributeString("val","tx1"),i.writeEndElement(),i.writeFullEndElement(),i.writeStartElement("a:latin"),i.writeAttributeString("typeface","+mn-lt"),i.writeEndElement(),i.writeStartElement("a:ea"),i.writeAttributeString("typeface","+mn-ea"),i.writeEndElement(),i.writeStartElement("a:cs"),i.writeAttributeString("typeface","+mn-cs"),i.writeEndElement(),i.writeFullEndElement(),i.writeFullEndElement(),i.writeEndElement(),i.writeFullEndElement(),i.writeEndDocument(),i.flush(),t}writeSlideRels(t){let e=new MemoryStream,i=new XmlTextWriter(Encoding.UTF8,e);if(i.indentation=this.xmlIndentation<0?0:this.xmlIndentation,i.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,i.writeStartDocument(),i.writeStartElement("Relationships"),i.writeAttributeString("xmlns","http://schemas.openxmlformats.org/package/2006/relationships"),i.writeStartElement("Relationship"),i.writeAttributeString("Id","rId1"),i.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout"),i.writeAttributeString("Target","../slideLayouts/slideLayout7.xml"),i.writeEndElement(),0<this.imageSlide.length)for(let e=0;e<this.imageSlide.length;e++){let t=this.imageSlide[e];i.writeStartElement("Relationship"),i.writeAttributeString("Id",`rId`+(2+e)),i.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"),i.writeAttributeString("Target",StiString.format("../media/image{0:D5}.{1}",t+1,StiOfficeImageFormatHelper.getImageFormatExtension(this.imageCache.imageFormatStore[t]))),i.writeEndElement()}if(0<this.hyperlinkList[Stimulsoft.System.StiObject.stimulsoft]().countItems)for(let e=0;e<this.hyperlinkList[Stimulsoft.System.StiObject.stimulsoft]().countItems;e++){i.writeStartElement("Relationship"),i.writeAttributeString("Id",`hId`+(e+1));let t=this.hyperlinkList[Stimulsoft.System.StiObject.stimulsoft]().getByIndex(e);"string"==typeof t&&(i.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink"),i.writeAttributeString("Target",t),i.writeAttributeString("TargetMode","External")),"number"==typeof t&&(i.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide"),i.writeAttributeString("Target",`slide${t}.xml`)),i.writeEndElement()}return i.writeFullEndElement(),i.writeEndDocument(),i.flush(),e}writeSlide(t,e){let i=new MemoryStream,n=new XmlTextWriter(Encoding.UTF8,i),a=(n.indentation=this.xmlIndentation<0?0:this.xmlIndentation,n.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,n.writeStartDocument(),n.writeStartElement("p:sld"),n.writeAttributeString("xmlns:a","http://schemas.openxmlformats.org/drawingml/2006/main"),n.writeAttributeString("xmlns:r","http://schemas.openxmlformats.org/officeDocument/2006/relationships"),n.writeAttributeString("xmlns:p","http://schemas.openxmlformats.org/presentationml/2006/main"),n.writeStartElement("p:cSld"),e.getByIndex(t)),r=(e.getPage(a),StiBrush.toColor(a.brush));(r=Stimulsoft.StiOptions.Export.PowerPoint.ReplaceTransparentPageBackground&&r.equals(Color.transparent)?Color.white:r).equals(Color.white)||(n.writeStartElement("p:bg"),n.writeStartElement("p:bgPr"),n.writeStartElement("a:solidFill"),this.writeColor(n,r),n.writeFullEndElement(),n.writeStartElement("a:effectLst"),n.writeEndElement(),n.writeFullEndElement(),n.writeFullEndElement()),n.writeStartElement("p:spTree"),n.writeStartElement("p:nvGrpSpPr"),n.writeStartElement("p:cNvPr"),n.writeAttributeString("id","1"),n.writeAttributeString("name",""),n.writeEndElement(),n.writeStartElement("p:cNvGrpSpPr"),n.writeEndElement(),n.writeStartElement("p:nvPr"),n.writeEndElement(),n.writeEndElement(),n.writeStartElement("p:grpSpPr"),n.writeStartElement("a:xfrm"),n.writeStartElement("a:off"),n.writeAttributeString("x","0"),n.writeAttributeString("y","0"),n.writeEndElement(),n.writeStartElement("a:ext"),n.writeAttributeString("cx","0"),n.writeAttributeString("cy","0"),n.writeEndElement(),n.writeStartElement("a:chOff"),n.writeAttributeString("x","0"),n.writeAttributeString("y","0"),n.writeEndElement(),n.writeStartElement("a:chExt"),n.writeAttributeString("cx","0"),n.writeAttributeString("cy","0"),n.writeEndElement(),n.writeEndElement(),n.writeEndElement(),this.idCounter=2,this.writeWatermark(n,a,!0);for(let i of a.components.list)if(i.enabled&&0<i.width&&0<i.height){let e=(i=i.is(StiCheckBox)?__.c.StiExportUtils.checkBoxToTextBox(i):i)[Stimulsoft.System.StiObject.stimulsoft]().as(StiText);if(null==e||e.checkAllowHtmlTags())if(i.is(StiContainer)){let t=new StiText(i.clientRectangle);t.page=i.page,t.border=i.border,t.brush=i.brush,t.hyperlinkValue=i.hyperlinkValue,this.writeStiTextbox(n,t)}else i.is(StiRectanglePrimitive)?this.writeRoundRectangle(n,i):this.writeStiImage(n,i,i);else{let t=e.angle%360;if(0==(t=t<0?360+t:t)||90==t||270==t)this.writeStiTextbox(n,i);else{let t=e.clone(!0);t.text=null,t.angle=0,this.writeStiTextbox(n,t),(t=e.clone(!0)).border=null,t.brush=null,t.horAlignment=StiTextHorAlignment.Center,t.vertAlignment=StiVertAlignment.Center,this.writeStiTextbox(n,t)}}this.idCounter++}if(null!=a.border&&this.writeBorder(n,a),this.writeWatermark(n,a,!1),!(Stimulsoft.Base.FslAA.wtLiI.aYwiY()||Stimulsoft.Base.FslAA.wtLiI.dSiYV()||(Stimulsoft.Base.FslAA.wtLiI.DKlzG()||Stimulsoft.Base.FslAA.wtLiI.hatRb()||Stimulsoft.Base.FslAA.wtLiI.kqAKB())&&Stimulsoft.System.NodeJs.isStandaloneVersion)){let t=a.unit.convertToHInches(a.pageWidth-a.margins.left-a.margins.right),e=a.unit.convertToHInches(a.pageHeight-a.margins.top-a.margins.bottom),i=a.unit.convertToHInches(a.margins.left),r=a.unit.convertToHInches(a.margins.top);n.writeRaw('<p:sp><p:nvSpPr><p:cNvPr id="67" name="TextBox Additional"/><p:cNvSpPr txBox="1"/><p:nvPr userDrawn="1"/></p:nvSpPr>'+'<p:spPr><a:xfrm rot="-2700000"><a:off x="'+this.convertToEmu(i)+'" y="'+this.convertToEmu(r+.45*e)+'"/><a:ext cx="'+this.convertToEmu(t)+'" cy="'+this.convertToEmu(.1*e)+'"/></a:xfrm>'+'<a:prstGeom prst="rect"><a:avLst/></a:prstGeom><a:noFill/></p:spPr>'+'<p:txBody><a:bodyPr wrap="square" rtlCol="0" anchor="ctr" anchorCtr="0"><a:spAutoFit/></a:bodyPr><a:lstStyle/><a:p><a:pPr algn="ctr"/><a:r><a:rPr lang="en-US" sz="9600" b="1" dirty="0" smtClean="0">'+'<a:solidFill><a:schemeClr val="tx1"><a:alpha val="12000"/></a:schemeClr></a:solidFill>'+'<a:latin typeface="Arial" panose="020B0604020202020204" pitchFamily="34" charset="0"/><a:cs typeface="Arial" panose="020B0604020202020204" pitchFamily="34" charset="0"/>'+"</a:rPr><a:t>Trial</a:t></a:r></a:p></p:txBody></p:sp>")}return n.writeFullEndElement(),n.writeEndElement(),n.writeStartElement("p:clrMapOvr"),n.writeStartElement("a:masterClrMapping"),n.writeEndElement(),n.writeFullEndElement(),n.writeFullEndElement(),n.writeEndDocument(),n.flush(),i}writeStiTextbox(t,e){let i=e,r=(t.writeStartElement("p:sp"),t.writeStartElement("p:nvSpPr"),t.writeStartElement("p:cNvPr"),t.writeAttributeString("id",this.idCounter.toString()),t.writeAttributeString("name",`TextBox `+this.idCounter),this.writeHyperlinkInfo(t,e),t.writeEndElement(),t.writeStartElement("p:cNvSpPr"),t.writeAttributeString("txBox","1"),t.writeEndElement(),t.writeStartElement("p:nvPr"),t.writeEndElement(),t.writeEndElement(),this.writeSpPr(t,e)),n=(t.writeStartElement("p:txBody"),t.writeStartElement("a:bodyPr"),!1),a="";if(null!=i.textOptions){n=i.textOptions.wordWrap;let t=i.textOptions.angle%360;90==(t=t<0?360+t:t)&&(a="vert270"),270==t&&(a="vert")}0<a.length&&t.writeAttributeString("vert",a),t.writeAttributeString("horzOverflow","clip"),t.writeAttributeString("vertOverflow","clip");let o=this.convertToEmu(i.margins.left),s=this.convertToEmu(i.margins.right),l=this.convertToEmu(i.margins.top),m=this.convertToEmu(i.margins.bottom),h=(t.writeAttributeString("lIns",o.toString()),t.writeAttributeString("tIns",l.toString()),t.writeAttributeString("rIns",s.toString()),t.writeAttributeString("bIns",m.toString()),t.writeAttributeString("wrap",n?"square":"none"),t.writeAttributeString("rtlCol","0"),"t"),c=(i.vertAlignment==StiVertAlignment.Center&&(h="ctr"),i.vertAlignment==StiVertAlignment.Bottom&&(h="b"),t.writeAttributeString("anchor",h),t.writeAttributeString("anchorCtr","0"),t.writeStartElement("a:noAutofit"),t.writeEndElement(),t.writeEndElement(),t.writeStartElement("a:lstStyle"),t.writeEndElement(),t.writeStartElement("a:p"),!1),g=(null!=i.textOptions&&(c=i.textOptions.rightToLeft),t.writeStartElement("a:pPr"),""),S=(i.horAlignment==StiTextHorAlignment.Center&&(g="ctr"),(i.horAlignment==StiTextHorAlignment.Right&&!c||i.horAlignment==StiTextHorAlignment.Left&&c)&&(g="r"),0<(g=i.horAlignment==StiTextHorAlignment.Width?"just":g).length&&t.writeAttributeString("algn",g),c&&t.writeAttributeString("rtl","1"),t.writeStartElement("a:lnSpc"),t.writeStartElement("a:spcPct"),t.writeAttributeString("val",Math.round(.94*i.lineSpacing*1e5).toString()),t.writeEndElement(),t.writeEndElement(),t.writeEndElement(),t.writeStartElement("a:r"),t.writeStartElement("a:rPr"),t.writeAttributeString("lang","en-US"),t.writeAttributeString("sz",(100*i.font.sizeInPoints*.984|0).toString()),i.font.bold&&t.writeAttributeString("b","1"),i.font.italic&&t.writeAttributeString("i","1"),i.font.underline&&t.writeAttributeString("u","sng"),i.font.strikeout&&t.writeAttributeString("strike","sngStrike"),t.writeAttributeString("dirty","0"),t.writeAttributeString("smtClean","0"),t.writeStartElement("a:solidFill"),this.writeColor(t,StiBrush.toColor(i.textBrush)),t.writeFullEndElement(),"");null!=i.text&&(S=i.text.toString()),i.textQuality!=StiTextQuality.Wysiwyg&&i.horAlignment!=StiTextHorAlignment.Width||StiString.isNullOrEmpty(S)||!S.endsWith(StiTextRenderer.StiForceWidthAlignTag)||(S=S.substr(0,S.length-StiTextRenderer.StiForceWidthAlignTag.length)),t.writeStartElement("a:latin"),t.writeAttributeString("typeface",i.font.name),t.writeAttributeString("pitchFamily","18"),t.writeAttributeString("charset","0"),t.writeEndElement(),t.writeStartElement("a:cs"),t.writeAttributeString("typeface",i.font.name),t.writeAttributeString("pitchFamily","18"),t.writeAttributeString("charset","0"),t.writeEndElement(),t.writeEndElement(),t.writeElementString("a:t",S),t.writeEndElement(),t.writeEndElement(),t.writeEndElement(),t.writeEndElement(),r&&this.writeBorder(t,e)}writeStiImage(t,i,e){if(this.imageResolutionMode!=__.c.StiImageResolutionMode.Exactly&&i.is(StiImage))return void this.writeStiImageAuto(t,i,e);let r=!1,n=this.exportCache.getImageIndex(e);if(null==n){let t=i[Stimulsoft.System.StiObject.stimulsoft]().as(IStiExportImageExtended);if(null!=t){let t=__.d.StiOfficeImageFormatHelper.getImageAndTag(i,__.a.StiExportFormat.PowerPoint,this.imageResolution,this.imageFormat,this.currentCulture,this.newCulture),e=StiOfficeImageFormatHelper.correctImageFormat(this.imageFormat,t.imageFormat);n=this.imageCache.addImageInt(t,e)}}null!=n&&(this.imageSlide.push(n),t.writeStartElement("p:pic"),t.writeStartElement("p:nvPicPr"),t.writeStartElement("p:cNvPr"),t.writeAttributeString("id",this.idCounter.toString()),t.writeAttributeString("name",`Picture `+(this.idCounter+1)),t.writeAttributeString("descr",`Picture ${this.idCounter+1} description`),this.writeHyperlinkInfo(t,i),t.writeEndElement(),t.writeStartElement("p:cNvPicPr"),t.writeStartElement("a:picLocks"),t.writeAttributeString("noChangeAspect","1"),t.writeEndElement(),t.writeFullEndElement(),t.writeStartElement("p:nvPr"),t.writeEndElement(),t.writeFullEndElement(),t.writeStartElement("p:blipFill"),t.writeStartElement("a:blip"),t.writeAttributeString("r:embed",`rId`+(1+this.imageSlide.length)),t.writeEndElement(),t.writeStartElement("a:stretch"),t.writeStartElement("a:fillRect"),t.writeEndElement(),t.writeFullEndElement(),t.writeFullEndElement(),r=this.writeSpPr(t,i),t.writeFullEndElement()),(r||i.is(StiLinePrimitive))&&this.writeBorder(t,i)}writeStiImageAuto(f,b,t){let E,y=b.as(StiImage);if(null==y)return;let v=!1,x=this.exportCache.getImageIndex(t);if(null==x){let t={ref:this.imageResolution},e=y.getImage(t);if(null!=e){let t=StiOfficeImageFormatHelper.correctImageFormat(this.imageFormat,e.imageFormat);x=this.imageCache.addImageInt(e,t)}}if(null!=x){this.imageSlide.push(x);let i=y.multipleFactor,t=y.stretch,r=y.horAlignment,n=y.vertAlignment,a=(null!=y.icon&&(r=StiHorAlignment.Center,n=StiVertAlignment.Center,t=!0),(null==(E=y.imageToDraw)?void 0:E.imageFormat)==Stimulsoft.System.Drawing.Imaging.ImageFormat.Svg&&(i=1/this.imageResolution),this.imageCache.imageSizeStore[x].width),o=this.imageCache.imageSizeStore[x].height,s=b.report.unit.convertToHInches(b.width),l=b.report.unit.convertToHInches(b.height);if(y.imageRotation==StiImageRotation.Rotate90CCW||y.imageRotation==StiImageRotation.Rotate90CW){let t=s;s=l,l=t}let m=y.margins.left,h=y.margins.right,c=y.margins.top,g=y.margins.bottom;if(y.imageRotation!=StiImageRotation.None){let t=StiHorAlignment.Center,e=StiVertAlignment.Center;y.imageRotation==StiImageRotation.Rotate90CW&&(r==StiHorAlignment.Left&&(e=StiVertAlignment.Bottom),r==StiHorAlignment.Right&&(e=StiVertAlignment.Top),n==StiVertAlignment.Top&&(t=StiHorAlignment.Left),n==StiVertAlignment.Bottom&&(t=StiHorAlignment.Right),m=y.margins.top,h=y.margins.bottom,c=y.margins.right,g=y.margins.left),y.imageRotation==StiImageRotation.Rotate90CCW&&(r==StiHorAlignment.Left&&(e=StiVertAlignment.Top),r==StiHorAlignment.Right&&(e=StiVertAlignment.Bottom),n==StiVertAlignment.Top&&(t=StiHorAlignment.Right),n==StiVertAlignment.Bottom&&(t=StiHorAlignment.Left),m=y.margins.bottom,h=y.margins.top,c=y.margins.left,g=y.margins.right),y.imageRotation==StiImageRotation.Rotate180&&(r==StiHorAlignment.Left&&(t=StiHorAlignment.Right),r==StiHorAlignment.Right&&(t=StiHorAlignment.Left),n==StiVertAlignment.Top&&(e=StiVertAlignment.Bottom),n==StiVertAlignment.Bottom&&(e=StiVertAlignment.Top),m=y.margins.right,h=y.margins.left,c=y.margins.bottom,g=y.margins.top),y.imageRotation==StiImageRotation.FlipHorizontal&&(r==StiHorAlignment.Left&&(t=StiHorAlignment.Right),r==StiHorAlignment.Right&&(t=StiHorAlignment.Left),e=n,m=y.margins.right,h=y.margins.left),y.imageRotation==StiImageRotation.FlipVertical&&(n==StiVertAlignment.Top&&(e=StiVertAlignment.Bottom),n==StiVertAlignment.Bottom&&(e=StiVertAlignment.Top),t=r,c=y.margins.bottom,g=y.margins.top),r=t,n=e}let S=s-m-h,p=l-c-g;if(t){if(y.aspectRatio){let t=Math.min(S/a,p/o),e=(S-a*t)/2,i=(p-o*t)/2;r==StiHorAlignment.Left&&(h+=2*e),r==StiHorAlignment.Right&&(m+=2*e),r==StiHorAlignment.Center&&(m+=e,h+=e),n==StiVertAlignment.Top&&(g+=2*i),n==StiVertAlignment.Bottom&&(c+=2*i),n==StiVertAlignment.Center&&(c+=i,g+=i),S-=2*e,p-=2*i}}else{S=a*i,p=o*i;let t=-(S-s)/2,e=-(p-l)/2;r==StiHorAlignment.Left&&(h+=2*t),r==StiHorAlignment.Right&&(m+=2*t),r==StiHorAlignment.Center&&(m+=t,h+=t),n==StiVertAlignment.Top&&(g+=2*e),n==StiVertAlignment.Bottom&&(c+=2*e),n==StiVertAlignment.Center&&(c+=e,g+=e)}let e=-Math.round(m/S*1e5),d=-Math.round(h/S*1e5),u=-Math.round(c/p*1e5),w=-Math.round(g/p*1e5);f.writeStartElement("p:pic"),f.writeStartElement("p:nvPicPr"),f.writeStartElement("p:cNvPr"),f.writeAttributeString("id",StiString.format("{0}",this.idCounter)),f.writeAttributeString("name",StiString.format("Picture {0}",this.idCounter+1)),f.writeAttributeString("descr",StiString.format("Picture {0} description",this.idCounter+1)),this.writeHyperlinkInfo(f,b),f.writeEndElement(),f.writeStartElement("p:cNvPicPr"),f.writeStartElement("a:picLocks"),f.writeAttributeString("noChangeAspect","1"),f.writeEndElement(),f.writeFullEndElement(),f.writeStartElement("p:nvPr"),f.writeEndElement(),f.writeFullEndElement(),f.writeStartElement("p:blipFill"),f.writeStartElement("a:blip"),f.writeAttributeString("r:embed",StiString.format("rId{0}",1+this.imageSlide.length)),f.writeEndElement(),0==e&&0==d&&0==u&&0==w||(f.writeStartElement("a:srcRect"),0!=e&&f.writeAttributeString("l",e.toString()),0!=u&&f.writeAttributeString("t",u.toString()),0!=d&&f.writeAttributeString("r",d.toString()),0!=w&&f.writeAttributeString("b",w.toString()),f.writeEndElement()),f.writeStartElement("a:stretch"),f.writeFullEndElement(),f.writeFullEndElement(),v=this.writeSpPr(f,b),f.writeFullEndElement()}v&&this.writeBorder(f,b)}writeSpPr(t,e){let n=this.convertToEmu(e.report.unit.convertToHInches(e.left+e.page.margins.left)),a=this.convertToEmu(e.report.unit.convertToHInches(e.top+e.page.margins.top)),o=this.convertToEmu(e.report.unit.convertToHInches(e.right+e.page.margins.left)),s=this.convertToEmu(e.report.unit.convertToHInches(e.bottom+e.page.margins.top)),i=0,r=e.as(IStiTextOptions),l=(null==r||null==r.textOptions||90!=(i=r.textOptions.angle%360)&&270!=i&&-90!=i&&-270!=i||(i=0),e.as(StiImage)),m=0<=(i=null!=l&&(l.imageRotation==StiImageRotation.Rotate180&&(i=180),l.imageRotation==StiImageRotation.Rotate90CCW&&(i=90),l.imageRotation==StiImageRotation.Rotate90CW)?-90:i)?i:360+i;if(45<m&&m<135||225<m&&m<315){let t=o-n,e=s-a,i=(o+n)/2-e/2,r=(s+a)/2-t/2;n=i,o=i+e,a=r,s=r+t}t.writeStartElement("p:spPr"),t.writeStartElement("a:xfrm"),0!=i&&t.writeAttributeString("rot",(0|Math.round(6e4*-i)).toString()),null!=l&&(l.imageRotation==StiImageRotation.FlipHorizontal&&t.writeAttributeString("flipH","1"),l.imageRotation==StiImageRotation.FlipVertical)&&t.writeAttributeString("flipV","1"),t.writeStartElement("a:off"),t.writeAttributeString("x",n.toString()),t.writeAttributeString("y",a.toString()),t.writeEndElement(),t.writeStartElement("a:ext"),t.writeAttributeString("cx",(o-n).toString()),t.writeAttributeString("cy",(s-a).toString()),t.writeEndElement(),t.writeEndElement(),t.writeStartElement("a:prstGeom"),t.writeAttributeString("prst","rect"),t.writeStartElement("a:avLst"),t.writeEndElement(),t.writeEndElement();let h=e.is(StiShape),c=Color.transparent,g=(0==(c=e.is(IStiBrush)?StiBrush.toColor(e.brush):c).a||h?(t.writeStartElement("a:noFill"),t.writeEndElement()):(t.writeStartElement("a:solidFill"),this.writeColor(t,c),t.writeFullEndElement()),!1),S=null;return null!=(S=e.is(IStiBorder)?e.border:S)&&S.side!=StiBorderSides.None&&S.style!=StiPenStyle.None&&(S.side!=StiBorderSides.All||S.is(StiAdvancedBorder)?g=!0:(t.writeStartElement("a:ln"),t.writeAttributeString("w",this.convertToEmu(S.size).toString()),t.writeStartElement("a:solidFill"),this.writeColor(t,S.color),t.writeFullEndElement(),t.writeStartElement("a:prstDash"),t.writeAttributeString("val",this.getLineStyle(S.style)),t.writeEndElement(),t.writeStartElement("a:miter"),t.writeAttributeString("lim","800000"),t.writeEndElement(),t.writeFullEndElement())),t.writeEndElement(),g}writeBorder(e,i){let r=i.as(IStiBorder).border;if(r.is(StiAdvancedBorder)){let t=r;t.isLeftBorderSidePresent&&this.writeLine(e,i,new Rectangle(i.left,i.top,0,i.height),t.leftSide.size,t.leftSide.style,t.leftSide.color),t.isRightBorderSidePresent&&this.writeLine(e,i,new Rectangle(i.right,i.top,0,i.height),t.rightSide.size,t.rightSide.style,t.rightSide.color),t.isTopBorderSidePresent&&this.writeLine(e,i,new Rectangle(i.left,i.top,i.width,0),t.topSide.size,t.topSide.style,t.topSide.color),t.isBottomBorderSidePresent&&this.writeLine(e,i,new Rectangle(i.left,i.bottom,i.width,0),t.bottomSide.size,t.bottomSide.style,t.bottomSide.color)}else r.isLeftBorderSidePresent&&this.writeLine(e,i,new Rectangle(i.left,i.top,0,i.height),r.size,r.style,r.color),r.isRightBorderSidePresent&&this.writeLine(e,i,new Rectangle(i.right,i.top,0,i.height),r.size,r.style,r.color),r.isTopBorderSidePresent&&this.writeLine(e,i,new Rectangle(i.left,i.top,i.width,0),r.size,r.style,r.color),r.isBottomBorderSidePresent&&this.writeLine(e,i,new Rectangle(i.left,i.bottom,i.width,0),r.size,r.style,r.color)}writeLine(r,t,e,i,n,a){if(n==StiPenStyle.None||0==a.a)return;r.writeStartElement("p:cxnSp"),r.writeStartElement("p:nvCxnSpPr"),r.writeStartElement("p:cNvPr"),r.writeAttributeString("id",this.idCounter.toString()),r.writeAttributeString("name",`Line `+this.idCounter),r.writeEndElement(),r.writeStartElement("p:cNvCxnSpPr"),r.writeEndElement(),r.writeStartElement("p:nvPr"),r.writeEndElement(),r.writeEndElement();let o=this.convertToEmu(t.report.unit.convertToHInches(e.left+t.page.margins.left)),s=this.convertToEmu(t.report.unit.convertToHInches(e.top+t.page.margins.top)),l=this.convertToEmu(t.report.unit.convertToHInches(e.right+t.page.margins.left)),m=this.convertToEmu(t.report.unit.convertToHInches(e.bottom+t.page.margins.top)),h=(r.writeStartElement("p:spPr"),r.writeStartElement("a:xfrm"),r.writeStartElement("a:off"),r.writeAttributeString("x",o.toString()),r.writeAttributeString("y",s.toString()),r.writeEndElement(),r.writeStartElement("a:ext"),r.writeAttributeString("cx",(l-o).toString()),r.writeAttributeString("cy",(m-s).toString()),r.writeEndElement(),r.writeEndElement(),r.writeStartElement("a:prstGeom"),r.writeAttributeString("prst","line"),r.writeStartElement("a:avLst"),r.writeEndElement(),r.writeEndElement(),r.writeStartElement("a:ln"),r.writeAttributeString("w",this.convertToEmu(i).toString()),r.writeStartElement("a:solidFill"),this.writeColor(r,a),r.writeFullEndElement(),r.writeStartElement("a:prstDash"),r.writeAttributeString("val",this.getLineStyle(n)),r.writeEndElement(),t.as(StiLinePrimitive));if(null!=h){let e=null,i=null;if(h.is(StiHorizontalLinePrimitive)&&(e=h.startCap,i=h.endCap),h.is(StiVerticalLinePrimitive)&&(e=h.startCap,i=h.endCap),null!=e){let t=this.capStyleToPptStyle(e.style);StiString.isNullOrEmpty(t)||(r.writeStartElement("a:headEnd"),r.writeAttributeString("type",t),r.writeEndElement())}if(null!=i){let t=this.capStyleToPptStyle(i.style);StiString.isNullOrEmpty(t)||(r.writeStartElement("a:tailEnd"),r.writeAttributeString("type",t),r.writeEndElement())}}r.writeFullEndElement(),r.writeEndElement(),r.writeEndElement()}writeRoundRectangle(n,a){let t=a.as(StiRectanglePrimitive);if(null==t)return;if(t.style==StiPenStyle.None||t.color.equals(Color.transparent))return;let o=a.as(StiRoundedRectanglePrimitive),s=a.clientRectangle,e=(n.writeStartElement("p:sp"),n.writeStartElement("p:nvSpPr"),n.writeStartElement("p:cNvPr"),n.writeAttributeString("id",StiString.format("{0}",this.idCounter)),n.writeAttributeString("name",StiString.format("{0}Rectangle {1}",null!=o?"Round":"",this.idCounter)),n.writeEndElement(),n.writeStartElement("p:cNvSpPr"),n.writeEndElement(),n.writeStartElement("p:nvPr"),n.writeEndElement(),n.writeEndElement(),this.convertToEmu(a.report.unit.convertToHInches(s.left+a.page.margins.left))),i=this.convertToEmu(a.report.unit.convertToHInches(s.top+a.page.margins.top)),r=this.convertToEmu(a.report.unit.convertToHInches(s.right+a.page.margins.left)),l=this.convertToEmu(a.report.unit.convertToHInches(s.bottom+a.page.margins.top));if(n.writeStartElement("p:spPr"),n.writeStartElement("a:xfrm"),n.writeStartElement("a:off"),n.writeAttributeString("x",StiString.format("{0}",e)),n.writeAttributeString("y",StiString.format("{0}",i)),n.writeEndElement(),n.writeStartElement("a:ext"),n.writeAttributeString("cx",StiString.format("{0}",r-e)),n.writeAttributeString("cy",StiString.format("{0}",l-i)),n.writeEndElement(),n.writeEndElement(),n.writeStartElement("a:prstGeom"),n.writeAttributeString("prst",null!=o?"roundRect":"rect"),n.writeStartElement("a:avLst"),null!=o){let t=a.report.unit.convertToHInches(s.width),e=a.report.unit.convertToHInches(s.height),i=Math.max(e<t?e:t,1),r=Math.min(1,100/i);n.writeStartElement("a:gd"),n.writeAttributeString("name","adj"),n.writeAttributeString("fmla",StiString.format("val {0}",0|Math.round(o.round*r*1e5))),n.writeEndElement()}n.writeEndElement(),n.writeEndElement(),n.writeStartElement("a:noFill"),n.writeEndElement(),n.writeStartElement("a:ln"),n.writeAttributeString("w",StiString.format("{0}",this.convertToEmu(t.size))),t.style==StiPenStyle.Double&&n.writeAttributeString("cmpd","dbl"),n.writeStartElement("a:solidFill"),this.writeColor(n,t.color),n.writeFullEndElement(),n.writeStartElement("a:prstDash"),n.writeAttributeString("val",this.getLineStyle(t.style)),n.writeEndElement(),n.writeFullEndElement(),n.writeEndElement(),n.writeEndElement()}capStyleToPptStyle(t){switch(t){case StiCapStyle.Arrow:return"triangle";case StiCapStyle.Diamond:return"diamond";case StiCapStyle.Square:return"diamond";case StiCapStyle.Open:return"arrow";case StiCapStyle.Oval:return"oval";case StiCapStyle.Stealth:return"stealth"}return null}writeWatermark(e,i,t){if(null!=i.watermark&&(null!=i.watermark.image||!StiString.isNullOrWhiteSpace(i.watermark.imageHyperlink))&&i.watermark.showImageBehind==t){let t=new StiImage;switch(t.page=i,t.image=i.watermark.image,t.left=-i.margins.left,t.top=-i.margins.top,t.width=i.pageWidth,t.height=i.pageHeight,t.stretch=i.watermark.imageStretch,t.aspectRatio=i.watermark.aspectRatio,t.multipleFactor=i.watermark.imageMultipleFactor,t.horAlignment=StiHorAlignment.Left,t.vertAlignment=StiVertAlignment.Bottom,i.watermark.imageAlignment){case ContentAlignment.TopCenter:case ContentAlignment.MiddleCenter:case ContentAlignment.BottomCenter:t.horAlignment=StiHorAlignment.Center;break;case ContentAlignment.TopRight:case ContentAlignment.MiddleRight:case ContentAlignment.BottomRight:t.horAlignment=StiHorAlignment.Right;break}switch(i.watermark.imageAlignment){case ContentAlignment.TopLeft:case ContentAlignment.TopCenter:case ContentAlignment.TopRight:t.vertAlignment=StiVertAlignment.Top;break;case ContentAlignment.MiddleLeft:case ContentAlignment.MiddleCenter:case ContentAlignment.MiddleRight:t.vertAlignment=StiVertAlignment.Center;break}this.writeStiImage(e,t,i)}}writeHyperlinkInfo(r,t){if(null!=t.hyperlinkValue){let e=t.hyperlinkValue.toString().trim(),i;if(0<e.length&&!e.startsWith("javascript:")&&!e.startsWith("#")){let t=this.stringToUrl(e);-1==(i=this.hyperlinkList.indexOf(t))&&(this.hyperlinkList.push(t),i=this.hyperlinkList[Stimulsoft.System.StiObject.stimulsoft]().countItems),r.writeStartElement("a:hlinkClick"),r.writeAttributeString("r:id",`hId`+i),r.writeEndElement()}}}writeImage(t){let e=new MemoryStream,i=this.imageCache.imagePackedStore[Stimulsoft.System.StiObject.stimulsoft]().getByIndex(t);return null==i&&(i=[]),e.write(i,0,i.length),e}exportPowerPoint(e,n,t){null==Stimulsoft.Base[["St","iL","ic","en","se"].join("")].key&&console.warn("You are using a trial version of the Stimulsoft product!"),__.a.StiLogService.write(this[Stimulsoft.System.StiObject.stimulsoft]().getType(),"Export report to PowerPoint 2007 format"),this.report=e;let a=t.pageRange,o=(this.imageResolution=t.imageResolution,this.imageQuality=t.imageQuality,t.encryptionPassword);this.imageFormat=t.imageFormat,this.xmlIndentation=-1,this.imageResolution<10&&(this.imageResolution=10),this.imageResolution=this.imageResolution/100,null!=this.imageFormat&&this.imageFormat!=__.a.ImageFormat.Jpeg&&(this.imageFormat=__.a.ImageFormat.Png),this.currentCulture=CultureInfo.currentCulture,this.newCulture=CultureInfo.cultures["en-US"];try{CultureInfo.currentCulture=this.newCulture;let i=a.getSelectedPages(e.renderedPages);if(this.isStopped)return;null!=this.exportCache?this.imageCache=this.exportCache.imageCache:this.imageCache=new __.a.StiImageCache(Stimulsoft.StiOptions.Export.PowerPoint.AllowImageComparer,!0,this.imageFormat,this.imageQuality);let r=new StiZipWriter20,t=null;StiString.isNullOrWhiteSpace(o)?r.begin(n,!0):(t=new MemoryStream,r.begin(t,!0)),r.addFile("[Content_Types].xml",this.writeContentTypes(i.count)),r.addFile("_rels/.rels",this.writeMainRels()),r.addFile("docProps/app.xml",this.writeDocPropsApp(i.count)),r.addFile("docProps/core.xml",this.writeDocPropsCore()),r.addFile("ppt/tableStyles.xml",this.writeTableStyles()),r.addFile("ppt/presProps.xml",this.writePresProps()),r.addFile("ppt/viewProps.xml",this.writeViewProps()),r.addFile("ppt/theme/theme1.xml",this.writeTheme()),r.addFile("ppt/slideMasters/slideMaster1.xml",this.writeSlideMaster()),r.addFile("ppt/slideMasters/_rels/slideMaster1.xml.rels",this.writeSlideMasterRels());for(let t=0;t<11;t++)r.addFile(`ppt/slideLayouts/slideLayout${t+1}.xml`,this.writeSlideLayout(t+1,i.getByIndex(0))),r.addFile(`ppt/slideLayouts/_rels/slideLayout${t+1}.xml.rels`,this.writeSlideLayoutRels());r.addFile("ppt/presentation.xml",this.writePresentation(i)),r.addFile("ppt/_rels/presentation.xml.rels",this.writePresentationRels(i)),this.hyperlinkList=[];for(let e=0;e<i.count;e++){if(this.invokeExporting2(e,i.count,0,1),this.isStopped)return;let t=i.getByIndex(e);i.getPage(t),this.imageSlide=[],r.addFile(`ppt/slides/slide${e+1}.xml`,this.writeSlide(e,i)),r.addFile(`ppt/slides/_rels/slide${e+1}.xml.rels`,this.writeSlideRels(e)),this.hyperlinkList[Stimulsoft.System.StiObject.stimulsoft]().clear()}if(0<this.imageCache.imagePackedStore[Stimulsoft.System.StiObject.stimulsoft]().countItems)for(let t=0;t<this.imageCache.imagePackedStore[Stimulsoft.System.StiObject.stimulsoft]().countItems;t++)r.addFile(StiString.format("ppt/media/image{0:D5}.{1}",t+1,StiOfficeImageFormatHelper.getImageFormatExtension(this.imageCache.imageFormatStore[t])),this.writeImage(t));r.end(),StiString.isNullOrWhiteSpace(o)||(t.flush(),StiOfficeEncryptedPackageHelper.EncryptPackage(t.toArray(),o,n),t.close())}finally{CultureInfo.currentCulture=this.currentCulture,this.imageCache.clear(),this.hyperlinkList=null}}}__.c.StiPowerPointExportService=mN,__.c.StiPpt2007ExportService=class extends mN{}}let StiImageHelper=__.a.Components.StiImageHelper,Graphics=Stimulsoft.System.Drawing.Graphics;{class OR{}class PR extends __.c.StiExportService{constructor(){super(...arguments),this.multipleFiles=!1,this.matrix=null,this.removeEmptySpaceAtBottom=Stimulsoft.StiOptions.Export.Word.removeEmptySpaceAtBottom,this.fontList=null,this.styleList=null,this.imageCache=null,this.bookmarkList=null,this.hyperlinkList=null,this.embedsList=null,this.xmlIndentation=1,this.imageQuality=.75,this.imageResolution=96,this.imageFormat=__.a.ImageFormat.Jpeg,this.imageResolutionMode=__.c.StiImageResolutionMode.Auto,this.lineSpace=null,this.lineSpace2=null,this.usePageHeadersAndFooters=!1,this.restrictEditing=__.c.StiWordRestrictEditing.No,this.protectionPassword=null,this.headersData=null,this.headersRels=null,this.footersData=null,this.footersRels=null,this.shiftHeader=!1,this.shiftFooter=!1,this.hasHeader=!1,this.hasFooter=!1,this.additionalIndex=0,this.spriteIndex=0,this.needEmptyParagraph=!1,this.bkmRefText=null,this.bkmRefId=-1,this.hypRefText=null,this.hypRefId=-1,this.exportCache=null,this.englishCulture=new CultureInfo("en-US"),this.docCompanyString=null,this.docLastModifiedString=null,this.wrongUrlSymbols=" \"#'*,;<>[^`{|}",this.initialCodeArray=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163],this.encryptionMatrix=[[44796,19929,39858,10053,20106,40212,10761],[31585,63170,64933,60267,50935,40399,11199],[17763,35526,1453,2906,5812,11624,23248],[885,1770,3540,7080,14160,28320,56640],[55369,41139,20807,41614,21821,43642,17621],[28485,56970,44341,19019,38038,14605,29210],[60195,50791,40175,10751,21502,43004,24537],[18387,36774,3949,7898,15796,31592,63184],[47201,24803,49606,37805,14203,28406,56812],[17824,35648,1697,3394,6788,13576,27152],[43601,17539,35078,557,1114,2228,4456],[30388,60776,51953,34243,7079,14158,28316],[14128,28256,56512,43425,17251,34502,7597],[13105,26210,52420,35241,883,1766,3532],[4129,8258,16516,33032,4657,9314,18628]]}implements(){let t=[__.c.IStiWordExportService];return(this.implements=()=>t)()}get exportFormat(){return __.a.StiExportFormat.Word}exportTo(e,t,i){if(null==this.exportCache){let t=i;this.exportCache=new __.c.StiExportImageCache(t.imageFormat,!0,new __.a.StiImageCache(Stimulsoft.StiOptions.Export.Word.allowImageComparer,!0,t.imageFormat,t.imageQuality,!1),Math.max(t.imageResolution,10)/100,e)}this.exportWord(e,t,i)}exportToAsync(e,i,r,n){setTimeout(async()=>{try{let t=n;this.exportCache=new __.c.StiExportImageCache(t.imageFormat,!0,new __.a.StiImageCache(Stimulsoft.StiOptions.Export.Word.allowImageComparer,!0,t.imageFormat,t.imageQuality,!1),Math.max(t.imageResolution,10)/100,i),await __.c.StiExportImageHelper.convertAllImages(i,Stimulsoft.System.Drawing.Imaging.ImageFormat.Jpeg,!1,this.exportFormat,this.exportCache),this.exportTo(i,r,n),null!=i&&null!=i.preparedExportImages&&(i.preparedExportImages.clear(),i.preparedExportImages=null)}catch(t){if(Exception.log(t,i,`Export Error`).isImportant)return e(Exception.getMessage(t))}e()},0)}getFilter(){return StiLocalization.get("FileFilters","WordFiles")}static checkFontsToCorrectHeight(t){return null==this.fontsToCorrectHeight&&(this.fontsToCorrectHeight=new Hashtable,this.fontsToCorrectHeight.add("Arial Unicode MS",null),this.fontsToCorrectHeight.add("Cascadia Code ExtraLight",null),this.fontsToCorrectHeight.add("Cascadia Code SemiBold",null),this.fontsToCorrectHeight.add("Cascadia Code SemiLight",null),this.fontsToCorrectHeight.add("Cascadia Mono ExtraLight",null),this.fontsToCorrectHeight.add("Cascadia Mono Light",null),this.fontsToCorrectHeight.add("Cascadia Mono SemiBold",null),this.fontsToCorrectHeight.add("Cascadia Mono SemiLight",null),this.fontsToCorrectHeight.add("Malgun Gothic",null),this.fontsToCorrectHeight.add("Malgun Gothic Semilight",null),this.fontsToCorrectHeight.add("Microsoft JhengHei",null),this.fontsToCorrectHeight.add("Microsoft JhengHei Light",null),this.fontsToCorrectHeight.add("Microsoft JhengHei UI",null),this.fontsToCorrectHeight.add("Microsoft JhengHei UI Light",null),this.fontsToCorrectHeight.add("Microsoft YaHei",null),this.fontsToCorrectHeight.add("Microsoft YaHei Light",null),this.fontsToCorrectHeight.add("Microsoft YaHei UI",null),this.fontsToCorrectHeight.add("Microsoft YaHei UI Light",null),this.fontsToCorrectHeight.add("MingLiU_HKSCS-ExtB",null),this.fontsToCorrectHeight.add("MingLiU-ExtB",null),this.fontsToCorrectHeight.add("MS Gothic",null),this.fontsToCorrectHeight.add("MS PGothic",null),this.fontsToCorrectHeight.add("MS UI Gothic",null),this.fontsToCorrectHeight.add("NSimSun",null),this.fontsToCorrectHeight.add("PMingLiU-ExtB",null),this.fontsToCorrectHeight.add("Segoe MDL2 Assets",null),this.fontsToCorrectHeight.add("SimSun",null),this.fontsToCorrectHeight.add("SimSun-ExtB",null),this.fontsToCorrectHeight.add("Yu Gothic",null),this.fontsToCorrectHeight.add("Yu Gothic Light",null),this.fontsToCorrectHeight.add("Yu Gothic Medium",null),this.fontsToCorrectHeight.add("Yu Gothic UI",null),this.fontsToCorrectHeight.add("Yu Gothic UI Light",null),this.fontsToCorrectHeight.add("Yu Gothic UI Semibold",null),this.fontsToCorrectHeight.add("Yu Gothic UI Semilight",null),this.fontsToCorrectHeight.add("微软雅黑",null)),this.fontsToCorrectHeight.containsKey(t)}getLineStyle(t){switch(t){case StiPenStyle.Solid:return"single";case StiPenStyle.Dot:return"dotted";case StiPenStyle.Dash:return"dashSmallGap";case StiPenStyle.DashDot:return"dotDash";case StiPenStyle.DashDotDot:return"dotDotDash";case StiPenStyle.Double:return"double";default:return""}}getColorString(t){if(0==t.a)return"auto";if(t.a<32)return"FFFFFF";return StiString.format("{0:X8}",t.toArgb()).substr(2)}getStyleNumber(i,r){if(0<i.length)for(let e=0;e<i.length;e++){let t=i[e];if(t.alignment==r.alignment&&t.name==r.name&&t.fontName==r.fontName&&t.fontSize==r.fontSize&&t.bold==r.bold&&t.italic==r.italic&&t.underline==r.underline&&t.textColor.equals(r.textColor)&&t.rightToLeft==r.rightToLeft)return e}i.push(r);let t=i.length-1;return t}getStyleFromComponent(a){if(null!=a&&!StiString.isNullOrEmpty(a.componentStyle)){let t=a[Stimulsoft.System.StiObject.stimulsoft]().as(IStiFont),e=a[Stimulsoft.System.StiObject.stimulsoft]().as(IStiTextBrush),i=a[Stimulsoft.System.StiObject.stimulsoft]().as(IStiTextHorAlignment),r=a[Stimulsoft.System.StiObject.stimulsoft]().as(IStiTextOptions),n=new OR;return n.name=a.componentStyle,null!=t&&(n.fontName=t.font.name,n.fontSize=StiMath.round2(2*t.font.sizeInPoints,0),n.bold=t.font.bold,n.italic=t.font.italic,n.underline=t.font.underline),null!=e&&(n.textColor=StiBrush.toColor(e.textBrush)),null!=i&&(n.alignment=i.horAlignment),null!=r&&(n.rightToLeft=r.textOptions.rightToLeft),this.getStyleNumber(this.styleList,n)}return-1}stringToUrl(e){if(StiString.isNullOrEmpty(e))return"";let i=new StringBuilder;if(e.startsWith("file:"))for(let t of e.split(""))t.charCodeAt(0)<32||'"'==t?i.append(StiString.format("%{0:x2}",t)):i.append(t);else for(let t of e.split(""))t.charCodeAt(0)<32||-1!=this.wrongUrlSymbols.indexOf(t)?i.append("_"):i.append(t);return i.toString()}getHyperlinkRefId(t){t.startsWith("www.")&&(t="http:\\"+t);let e;return this.hyperlinkList.containsKey(t)?e=this.hyperlinkList[t]:(e=this.hyperlinkList.count,this.hyperlinkList.add(t,e)),e}static get hiToTwips(){return 14.4*.995}convert(t){return StiMath.round2(t*PR.hiToTwips)}convertHiToTwips(t){return StiMath.round2(14.4*t)}convertTwipsToEmu(t){return StiMath.round2(t/14.4/100*914400)}convertStringToBookmark(e){let i=new StringBuilder;for(let t of e.split(""))Char.isLetterOrDigit(t)&&i.append(t);return 0<i.length&&null!=i.toString()[0]&&Char.isDigit(i.toString()[0])&&i.insert(0,"b"),i.toString()}concatByteArrays(t,e){let i=[];return StiArray.copy2(e,0,i,0,e.length),StiArray.copy2(t,0,i,e.length,t.length),i}generateDocumentProtection(t,a){let e=StiOfficeEncryptedPackageHelper.getRandomBytes(16),o=[0,0,0,0],s=15;if(!StiString.isNullOrEmpty(a)){a=a.substr(0,Math.min(a.length,s));let r=[];for(let e=0;e<a.length;e++){let t=a.charCodeAt(e);r[e]=255&t,0==r[e]&&(r[e]=(65280&t)>>8)}let n=this.initialCodeArray[r.length-1];for(let i=0;i<r.length;i++){let e=s-r.length+i;for(let t=0;t<7;t++)0!=(r[i]&1<<t)&&(n^=this.encryptionMatrix[e][t])}let e=0;for(let t=r.length-1;0<=t;t--)e=(e>>14&1|e<<1&32767)^r[t];e=(e>>14&1|e<<1&32767)^r.length^52811;let i=(n<<16)+e;for(let t=0;t<4;t++)o[t]=(i&255<<8*t)>>8*t}let i=new StringBuilder;for(let t=0;t<4;t++)i.append(__.c.StiExportUtils.toHex(o[t]));o=Encoding.Unicode.getBytes(i.toString().toUpperCase()),o=this.concatByteArrays(o,e);let r=5e4,n=new Stimulsoft.System.Crypt.SHA1,l=(o=n.bytes(o),[0,0,0,0]);for(let t=0;t<r;t++)l[0]=(255&t)>>0,l[1]=(65280&t)>>8,l[2]=(16711680&t)>>16,l[3]=(4278190080&t)>>24,o=this.concatByteArrays(l,o),o=n.bytes(o);t.writeStartElement("w:documentProtection"),t.writeAttributeString("w:edit","readOnly"),t.writeAttributeString("w:enforcement","1"),t.writeAttributeString("w:cryptProviderType","rsaFull"),t.writeAttributeString("w:cryptAlgorithmClass","hash"),t.writeAttributeString("w:cryptAlgorithmType","typeAny"),t.writeAttributeString("w:cryptAlgorithmSid","4"),t.writeAttributeString("w:cryptSpinCount",r.toString()),t.writeAttributeString("w:hash",Stimulsoft.System.Convert.toBase64String(o)),t.writeAttributeString("w:salt",Stimulsoft.System.Convert.toBase64String(e)),t.writeEndElement()}writeFromMatrix(m,e,o,h,t=null){let c=63,g=this.matrix.coordX.countItems,S=this.matrix.coordY.countItems,p=StiArray.create(Number,g),i=this.matrix.coordX.getKeys();for(let e=0;e<g;e++){let t=this.matrix.coordX.getByIndex(e,i);p[e]=this.convert(t)}let d=StiArray.create(Number,S),r=this.matrix.coordY.getKeys();for(let e=0;e<S;e++){let t=this.matrix.coordY.getByIndex(e,r);d[e]=this.convert(t)}let u=!1,w=0;if(null!=t&&t.watermark.enabled&&!Stimulsoft.StiOptions.Export.Word.watermarkOnlyBehind&&this.writeWatermark(m,t,!t.watermark.showImageBehind,!t.watermark.showBehind,!0)&&m.writeEndElement(),!(Stimulsoft.Base.FslAA.wtLiI.aYwiY()||Stimulsoft.Base.FslAA.wtLiI.dSiYV()||this.usePageHeadersAndFooters||(Stimulsoft.Base.FslAA.wtLiI.DKlzG()||Stimulsoft.Base.FslAA.wtLiI.hatRb()||Stimulsoft.Base.FslAA.wtLiI.kqAKB())&&Stimulsoft.System.NodeJs.isStandaloneVersion||null==t)){let t=(this.spriteIndex++).toString(),e='<v:shapetype id="_x0000_t'+t+'" coordsize="21600,21600" o:spt="'+t+'" adj="10800" path="m@7,l@8,m@5,21600l@6,21600e">'+'<v:formulas><v:f eqn="sum #0 0 10800"/><v:f eqn="prod #0 2 1"/><v:f eqn="sum 21600 0 @1"/><v:f eqn="sum 0 0 @2"/>'+'<v:f eqn="sum 21600 0 @3"/><v:f eqn="if @0 @3 0"/><v:f eqn="if @0 21600 @1"/><v:f eqn="if @0 0 @2"/><v:f eqn="if @0 @4 21600"/>'+'<v:f eqn="mid @5 @6"/><v:f eqn="mid @8 @5"/><v:f eqn="mid @7 @8"/><v:f eqn="mid @6 @7"/><v:f eqn="sum @6 0 @5"/></v:formulas>'+'<v:path textpathok="t" o:connecttype="custom" o:connectlocs="@9,0;@10,10800;@11,21600;@12,10800" o:connectangles="270,180,90,0"/>'+'<v:textpath on="t" fitshape="t"/><v:handles><v:h position="#0,bottomRight" xrange="6629,14971"/></v:handles>'+'<o:lock v:ext="edit" text="t" shapetype="t"/></v:shapetype>',i=new StringBuilder;i.append("position:absolute;margin-left:0;margin-top:0;"),i.append("width:5.5in;height:2.51in;z-index:281656192;rotation:315;"),i.append("mso-position-horizontal:center;mso-position-horizontal-relative:page;mso-position-vertical:center;mso-position-vertical-relative:page;"),m.writeStartElement("w:p"),m.writeStartElement("w:r"),m.writeStartElement("w:rPr"),m.writeStartElement("w:noProof"),m.writeEndElement(),m.writeEndElement(),m.writeStartElement("w:pict"),m.writeRaw(e),m.writeStartElement("v:shape"),m.writeAttributeString("id","PowerPlusWaterMarkObject264"+t),m.writeAttributeString("o:spid","_x0000_s20"+t),m.writeAttributeString("type","#_x0000_t"+t),m.writeAttributeString("style",i.toString()),m.writeAttributeString("o:allowincell","f"),m.writeAttributeString("fillcolor","#000000"),m.writeAttributeString("stroked","f"),m.writeStartElement("v:fill"),m.writeAttributeString("opacity","0.2"),m.writeEndElement(),m.writeStartElement("v:textpath"),m.writeAttributeString("style",'font-family:"Arial";font-weight:bold'),m.writeAttributeString("string","Trial"),m.writeEndElement(),m.writeEndElement(),m.writeEndElement(),m.writeEndElement(),m.writeEndElement()}let f=StiArray.create2(Boolean,S,g),b=StiArray.create2(Boolean,S,g),E="";this.currentPassNumber=2+(Stimulsoft.StiOptions.Export.Word.divideSegmentPages?1:0);for(let l=1;l<S;l++){this.invokeExporting2(l,S,this.currentPassNumber,this.maximumPassNumber);let i=l-1>=e&&l-1<=o,r=(0!=h||this.matrix.linePlacement[l-1]!=__.c.StiTableLineInfo.PageHeader&&this.matrix.linePlacement[l-1]!=__.c.StiTableLineInfo.PageFooter&&this.matrix.linePlacement[l-1]!=__.c.StiTableLineInfo.Trash||(i=!1),0<w&&(w--,i=!1),100005),n=[],a=!1;if(i)for(let t=1;t<g;t++){let e=this.matrix.cells[l-1][t-1];if(0==f[l][t]&&null!=e&&null!=e.component){if(null!=e.component.tagValue){let t=e.component.tagValue.toString().toLowerCase();-1!=t.indexOf("rtfparagraph")&&(n.push(e),i=!1),-1!=t.indexOf("rtfnewpage")&&(a=!0)}let t=null;e.component.is(StiText)&&(t=e.component.margins),null!=(t=e.component.is(StiRichText)?e.component.margins:t)&&(t.top<r&&(r=t.top),0<e.height)&&(r=0)}}r*=PR.hiToTwips;let s=StiMath.round2(r);if(a&&(u&&(m.writeFullEndElement(),u=!1),m.writeStartElement("w:p"),m.writeStartElement("w:r"),m.writeStartElement("w:br"),m.writeAttributeString("w:type","page"),m.writeEndElement(),m.writeEndElement(),m.writeEndElement()),i){if(this.usePageHeadersAndFooters&&this.matrix.linePlacement[l-1]==__.c.StiTableLineInfo.HeaderAP){let t=this.matrix.parentBandName[l-1],e=t.indexOf("");(t=-1!=e?t.substr(0,e):t)!=E&&(E=t,u&&m.writeFullEndElement(),m.writeStartElement("w:p"),m.writeEndElement(),m.writeStartElement("w:tbl"),this.writeTableInfo(m,p,g),u=!0)}u||(m.writeStartElement("w:tbl"),this.writeTableInfo(m,p,g),u=!0),m.writeStartElement("w:tr");let t=d[l]-d[l-1];m.writeStartElement("w:trPr"),this.usePageHeadersAndFooters&&!Stimulsoft.StiOptions.Export.Word.forceLineHeight||(m.writeStartElement("w:trHeight"),(!this.usePageHeadersAndFooters&&Stimulsoft.StiOptions.Export.Word.lineHeightExactly||this.usePageHeadersAndFooters&&Stimulsoft.StiOptions.Export.Word.lineHeightExactlyForPHFMode)&&m.writeAttributeString("w:hRule","exact"),m.writeAttributeString("w:val",t.toString()),m.writeEndElement()),this.usePageHeadersAndFooters&&this.matrix.linePlacement[l-1]==__.c.StiTableLineInfo.HeaderAP&&(m.writeStartElement("w:tblHeader"),m.writeEndElement()),m.writeEndElement()}let t=0;for(let o=1;o<g;o++){let a=this.matrix.cells[l-1][o-1];if(!f[l][o]||b[l][o]){t++;let n=!0;if(b[l][o]){let t=l;while(b[t][o])t--;a=this.matrix.cells[t-1][o-1],n=!1}if(null!=a&&n){for(let e=0;e<=a.height;e++)for(let t=0;t<=a.width;t++)f[l+e][o+t]=!0;if(0<a.height)for(let t=1;t<=a.height;t++)b[l+t][o]=!0}if(i){if(m.writeStartElement("w:tc"),null!=a){m.writeStartElement("w:tcPr");let e=0;for(let t=0;t<a.width+1;t++)e+=p[o+t]-p[o-1+t];if(m.writeStartElement("w:tcW"),m.writeAttributeString("w:w",e.toString()),m.writeAttributeString("w:type","dxa"),m.writeEndElement(),0<a.width&&(m.writeStartElement("w:gridSpan"),m.writeAttributeString("w:val",(a.width+1).toString()),m.writeEndElement()),0<a.height&&(b[l][o]?m.writeStartElement("w:vMerge"):(m.writeStartElement("w:vMerge"),m.writeAttributeString("w:val","restart")),m.writeEndElement()),null!=a.cellStyle.textOptions){let t=a.cellStyle.textOptions.angle,e=225<t&&t<315?"tbRl":45<t&&t<135?"btLr":"";""!=e&&(m.writeStartElement("w:textDirection"),m.writeAttributeString("w:val",e),m.writeEndElement())}let t=a.component.is(StiText)&&a.component.checkAllowHtmlTags()&&!Stimulsoft.StiOptions.Export.Word.renderHtmlTagsAsImage;if(n&&a.component.is(StiText)&&(!a.component.isExportAsImage(this.exportFormat)||t)){let t=a.component,e=this.convert(t.margins.left),i=this.convert(t.margins.right-Stimulsoft.StiOptions.Export.Word.rightMarginCorrection),r=this.convert(t.margins.top);r>s&&(r=s),(0<e||0<i||0<r)&&(m.writeStartElement("w:tcMar"),0<r&&(m.writeStartElement("w:top"),m.writeAttributeString("w:w",r.toString()),m.writeAttributeString("w:type","dxa"),m.writeEndElement()),0<e&&(m.writeStartElement("w:left"),m.writeAttributeString("w:w",e.toString()),m.writeAttributeString("w:type","dxa"),m.writeEndElement()),0<i&&(m.writeStartElement("w:right"),m.writeAttributeString("w:w",i.toString()),m.writeAttributeString("w:type","dxa"),m.writeEndElement()),m.writeEndElement())}let i="";switch(a.cellStyle.vertAlignment){case StiVertAlignment.Center:i="center";break;case StiVertAlignment.Bottom:i="bottom";break}if(""!=i&&(m.writeStartElement("w:vAlign"),m.writeAttributeString("w:val",i),m.writeEndElement()),this.writeBorders(m,a.top,a.left,a.height+1,a.width+1),null!=a.component){let t=a.component.as(StiImage);a.component.isExportAsImage(__.a.StiExportFormat.Word)&&(null==t||this.imageResolutionMode==__.c.StiImageResolutionMode.Exactly)||a.cellStyle.color.equals(Color.empty)||a.cellStyle.color.equals(Color.transparent)||(m.writeStartElement("w:shd"),m.writeAttributeString("w:val","clear"),m.writeAttributeString("w:color","auto"),m.writeAttributeString("w:fill",this.getColorString(a.cellStyle.color)),m.writeEndElement())}m.writeEndElement();let r=this.restrictEditing==__.c.StiWordRestrictEditing.ExceptEditableFields&&null!=a.component&&a.component.is(StiText)&&a.component.editable;r&&(m.writeStartElement("w:permStart"),m.writeAttributeString("w:id","0"),m.writeEndElement()),this.needEmptyParagraph=!0,n&&this.writeCellContent(m,a,l,o,p,d),this.needEmptyParagraph&&(m.writeStartElement("w:p"),m.writeFullEndElement()),r&&(m.writeStartElement("w:permEnd"),m.writeAttributeString("w:id","0"),m.writeEndElement())}else{let r=null,t={ref:r},n=this.renderBorder2TableGetValues(l,o,t),a=0;if(0==(n&StiBorderSides.Right)){while(o+a+1<g&&null==this.matrix.cells[l-1][o+a+1-1]&&0==f[l][o+a+1]&&0==b[l][o+a+1]){let t=null,e={ref:t},i=this.renderBorder2TableGetValues(l,o+a+1,e);if(0<(i&StiBorderSides.Left))break;if((i&(StiBorderSides.Top|StiBorderSides.Bottom))!=(n&(StiBorderSides.Top|StiBorderSides.Bottom)))break;if(r!=t)break;if(a++,0<(i&StiBorderSides.Right))break}if(0<a)for(let t=1;t<=a;t++)f[l][o+t]=!0}m.writeStartElement("w:tcPr");let e=p[o+a]-p[o-1];m.writeStartElement("w:tcW"),m.writeAttributeString("w:w",e.toString()),m.writeAttributeString("w:type","dxa"),m.writeEndElement(),0<a&&(m.writeStartElement("w:gridSpan"),m.writeAttributeString("w:val",(a+1).toString()),m.writeEndElement()),this.writeBorders(m,l-1,o-1,1,a+1),m.writeEndElement(),m.writeStartElement("w:p"),m.writeFullEndElement()}m.writeFullEndElement()}}if(t>=c)break}i&&m.writeFullEndElement();for(let t of n)u&&m.writeEndElement(),u=!1,w=t.height,this.writeCellContent(m,t,t.top+1,t.left+1,p,d)}u&&m.writeEndElement()}writeCellContent(l,m,i,r,n,a){var t;this.bkmRefText=null,this.bkmRefId=-1;let e=this.matrix.bookmarks[i-1][r-1];if(null==e||this.bookmarkList.containsKey(e)||(this.bkmRefId=this.bookmarkList.count,this.bkmRefText=this.convertStringToBookmark(e),this.bookmarkList.set(e,this.bkmRefId)),this.hypRefText=null,this.hypRefId=-1,null!=m.component&&null!=m.component.hyperlinkValue){let t=m.component.hyperlinkValue.toString().trim();0<t.length&&!t.startsWith("javascript:")&&(t.startsWith("#")?this.hypRefText=this.convertStringToBookmark(t.substr(1)):(this.hypRefText=this.stringToUrl(t),this.hyperlinkList.containsKey(this.hypRefText)?this.hypRefId=StiMath.trunc(this.hyperlinkList.get(this.hypRefText)):(this.hypRefId=this.hyperlinkList.count,this.hyperlinkList.add(this.hypRefText,this.hypRefId))))}let h=null==(t=m.component)?void 0:t.as(StiText);if(null==h||h.isExportAsImage(this.exportFormat)||h.checkAllowHtmlTags()){if(!m.component.is(StiRichText)||Stimulsoft.StiOptions.Export.Word.renderRichTextAsImage)if(m.component.is(StiText)&&m.component.checkAllowHtmlTags()&&!Stimulsoft.StiOptions.Export.Word.renderHtmlTagsAsImage)StiString.isNullOrWhiteSpace(m.text)||(this.writeHtmlTags(l,m),this.needEmptyParagraph=!1);else if(m.component.isExportAsImage(this.exportFormat)){let t=a[i-1+m.height+1]-a[i-1],e=n[r-1+m.width+1]-n[r-1];this.imageResolutionMode!=__.c.StiImageResolutionMode.Exactly&&m.component.is(StiImage)?this.writeStiImageAuto(l,m,e,t):this.writeStiImage(l,m,e,t)}else-1!=this.bkmRefId&&(l.writeStartElement("w:bookmarkStart"),l.writeAttributeString("w:id",this.bkmRefId.toString()),l.writeAttributeString("w:name",this.bkmRefText),l.writeEndElement(),l.writeStartElement("w:bookmarkEnd"),l.writeAttributeString("w:id",this.bkmRefId.toString()),l.writeEndElement())}else{let e=new StringBuilder(m.text);if(this.usePageHeadersAndFooters){let t=h.tagValue;StiString.isNullOrEmpty(t)||-1!=t.toLowerCase().indexOf("rtfnewpage")||-1==t.indexOf("#PageNumber#")&&-1==t.indexOf("#TotalPageCount#")&&-1==t.indexOf("#PageRef")||(e=new StringBuilder(t))}let o=[],i="";for(let t of e.toString().split(""))Char.isControl(t)&&"\t"!=t?"\n"==t&&(o.push(i),i=""):i+=t;""!=i&&o.push(i),0==o.length&&o.push(i),0<o.length&&(this.needEmptyParagraph=!1);let s=this.getStyleFromComponent(m.component);for(let a=0;a<o.length;a++){let r=o[a],i=(l.writeStartElement("w:p"),l.writeStartElement("w:pPr"),h.lineSpacing);if(null!=this.lineSpace||1!=i){let t=this.lineSpace,e=(1!=i&&(t=StiMath.round2(240*Stimulsoft.StiOptions.Export.Word.lineSpacing*i).toString()),m.component[Stimulsoft.System.StiObject.stimulsoft]().as(IStiFont));null!=e&&null!=e.font&&PR.checkFontsToCorrectHeight(e.font.name)&&(t=this.lineSpace2,1!=i)&&(t=StiMath.round2(240*Stimulsoft.StiOptions.Export.Word.lineSpacing*.772*i).toString()),l.writeStartElement("w:spacing"),l.writeAttributeString("w:line",t),l.writeEndElement()}if(!h.wordWrap&&h.horAlignment==StiTextHorAlignment.Left){let t=this.convert(this.report.unit.convertToHInches(m.component.right+m.component.page.margins.left)-2100);t<0&&(l.writeStartElement("w:ind"),l.writeAttributeString("w:right",t.toString()),l.writeEndElement())}-1!=s&&(l.writeStartElement("w:pStyle"),l.writeAttributeString("w:val",`Style`+s),l.writeEndElement());let t=m.cellStyle.horAlignment,e=!1,n=(null!=m.cellStyle.textOptions&&(e=m.cellStyle.textOptions.rightToLeft),"");if((t==StiTextHorAlignment.Left&&1==e||t==StiTextHorAlignment.Right&&0==e)&&(n="right"),t==StiTextHorAlignment.Center&&(n="center"),""!=(n=t==StiTextHorAlignment.Width?"both":n)&&(l.writeStartElement("w:jc"),l.writeAttributeString("w:val",n),l.writeEndElement()),-1==s&&this.writeRunProperties(l,m),l.writeEndElement(),null!=this.hypRefText&&(l.writeStartElement("w:hyperlink"),-1==this.hypRefId?l.writeAttributeString("w:anchor",this.hypRefText):l.writeAttributeString("r:id",`hId`+this.hypRefId)),-1!=this.bkmRefId&&(l.writeStartElement("w:bookmarkStart"),l.writeAttributeString("w:id",this.bkmRefId.toString()),l.writeAttributeString("w:name",this.bkmRefText),l.writeEndElement()),""!=r)if(this.usePageHeadersAndFooters){r=r[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("#PageNumber#","")[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("#TotalPageCount#","");let i=[],e=new StringBuilder;for(let t of r.split(""))""==t||""==t?(0<e.length&&i.push(e.toString()),i.push(t.toString()),e=new StringBuilder):e.append(t);0<e.length&&i.push(e.toString()),0==i.length&&i.push(r);for(let e=0;e<i.length;e++){let t=i[e];if(0<t.length&&(""==t[0]||""==t[0])){switch(l.writeStartElement("w:r"),-1==s&&this.writeRunProperties(l,m),l.writeStartElement("w:fldChar"),l.writeAttributeString("w:fldCharType","begin"),l.writeEndElement(),l.writeEndElement(),l.writeStartElement("w:r"),this.writeRunProperties(l,m),l.writeStartElement("w:instrText"),t.charAt(0)){case"":l.writeString("PAGE \\* MERGEFORMAT");break;case"":l.writeString("NUMPAGES");break}l.writeEndElement(),l.writeEndElement(),l.writeStartElement("w:r"),this.writeRunProperties(l,m),l.writeStartElement("w:fldChar"),l.writeAttributeString("w:fldCharType","separate"),l.writeEndElement(),l.writeEndElement(),l.writeStartElement("w:r"),this.writeRunProperties(l,m),l.writeStartElement("w:t"),l.writeString("1"),l.writeEndElement(),l.writeEndElement(),l.writeStartElement("w:r"),this.writeRunProperties(l,m),l.writeStartElement("w:fldChar"),l.writeAttributeString("w:fldCharType","end")}else l.writeStartElement("w:r"),-1==s&&this.writeRunProperties(l,m),l.writeStartElement("w:t"),l.writeAttributeString("xml:space","preserve"),l.writeString(t);l.writeEndElement(),l.writeEndElement()}}else l.writeStartElement("w:r"),-1==s&&this.writeRunProperties(l,m),l.writeStartElement("w:t"),l.writeAttributeString("xml:space","preserve"),l.writeString(r),l.writeEndElement(),l.writeEndElement();-1!=this.bkmRefId&&(l.writeStartElement("w:bookmarkEnd"),l.writeAttributeString("w:id",this.bkmRefId.toString()),l.writeEndElement()),null!=this.hypRefText&&l.writeEndElement(),l.writeEndElement()}}}writeStiImage(n,a,o,s){let t=a.component[Stimulsoft.System.StiObject.stimulsoft]().as(IStiExportImageExtended);if(null==t)return;let l=this.exportCache.getImageIndex(a.component,null,a.componentId);if(null==l){let t=__.d.StiOfficeImageFormatHelper.getImageAndTag(a.component,__.a.StiExportFormat.Word,this.imageResolution,this.imageFormat,null,null);null!=t&&(l=this.imageCache.addImageIntRaw(t,t.imageFormat))}if(null!=l){this.needEmptyParagraph=!1;let t=__.d.StiOfficeImageFormatHelper.getImageFormatExtension(this.imageCache.imageFormatStore[l]),e=(n.writeStartElement("w:p"),n.writeStartElement("w:pPr"),a.cellStyle.horAlignment),i=!1;if(null!=a.cellStyle.textOptions&&(i=a.cellStyle.textOptions.rightToLeft),null==a.component[Stimulsoft.System.StiObject.stimulsoft]().as(IStiTextHorAlignment)){let t=a.component[Stimulsoft.System.StiObject.stimulsoft]().as(IStiHorAlignment);null!=t&&(t.horAlignment==StiHorAlignment.Left&&(e=StiTextHorAlignment.Left),t.horAlignment==StiHorAlignment.Center&&(e=StiTextHorAlignment.Center),t.horAlignment==StiHorAlignment.Right)&&(e=StiTextHorAlignment.Right)}let r="";(e==StiTextHorAlignment.Left&&1==i||e==StiTextHorAlignment.Right&&0==i)&&(r="right"),e==StiTextHorAlignment.Center&&(r="center"),""!=(r=e==StiTextHorAlignment.Width?"both":r)&&(n.writeStartElement("w:jc"),n.writeAttributeString("w:val",r),n.writeEndElement()),n.writeEndElement(),-1!=this.bkmRefId&&(n.writeStartElement("w:bookmarkStart"),n.writeAttributeString("w:id",this.bkmRefId.toString()),n.writeAttributeString("w:name",this.bkmRefText),n.writeEndElement()),n.writeStartElement("w:r"),n.writeStartElement("w:rPr"),n.writeElementString("w:noProof",""),n.writeEndElement(),n.writeStartElement("w:drawing"),n.writeStartElement("wp:inline"),n.writeAttributeString("distT","0"),n.writeAttributeString("distB","0"),n.writeAttributeString("distL","0"),n.writeAttributeString("distR","0"),n.writeStartElement("wp:extent"),n.writeAttributeString("cx",this.convertTwipsToEmu(o).toString()),n.writeAttributeString("cy",this.convertTwipsToEmu(s).toString()),n.writeEndElement(),n.writeStartElement("wp:effectExtent"),n.writeAttributeString("l","0"),n.writeAttributeString("t","0"),n.writeAttributeString("r","0"),n.writeAttributeString("b","0"),n.writeEndElement(),n.writeStartElement("wp:docPr"),n.writeAttributeString("id",(l+2).toString()),n.writeAttributeString("name",`Picture `+(l+1)),n.writeAttributeString("descr",StiString.format("Image{0:D5}.{1}",l+1,t)),null!=this.hypRefText&&(-1==this.hypRefId&&(this.hypRefText="#"+this.hypRefText,this.hypRefId=this.getHyperlinkRefId(this.hypRefText)),n.writeStartElement("a:hlinkClick"),n.writeAttributeString("xmlns:a","http://schemas.openxmlformats.org/drawingml/2006/main"),n.writeAttributeString("r:id",`hId`+this.hypRefId),n.writeEndElement()),n.writeEndElement(),n.writeStartElement("wp:cNvGraphicFramePr"),n.writeStartElement("a:graphicFrameLocks"),n.writeAttributeString("xmlns:a","http://schemas.openxmlformats.org/drawingml/2006/main"),n.writeAttributeString("noChangeAspect","1"),n.writeEndElement(),n.writeEndElement(),n.writeStartElement("a:graphic"),n.writeAttributeString("xmlns:a","http://schemas.openxmlformats.org/drawingml/2006/main"),n.writeStartElement("a:graphicData"),n.writeAttributeString("uri","http://schemas.openxmlformats.org/drawingml/2006/picture"),n.writeStartElement("pic:pic"),n.writeAttributeString("xmlns:pic","http://schemas.openxmlformats.org/drawingml/2006/picture"),n.writeStartElement("pic:nvPicPr"),n.writeStartElement("pic:cNvPr"),n.writeAttributeString("id","0"),n.writeAttributeString("name",StiString.format("Image{0:D5}.{1}",l+1,t)),n.writeEndElement(),n.writeStartElement("pic:cNvPicPr"),n.writeEndElement(),n.writeEndElement(),n.writeStartElement("pic:blipFill"),n.writeStartElement("a:blip"),n.writeAttributeString("r:embed",`rId`+(5+l)),n.writeAttributeString("cstate","print"),n.writeEndElement(),n.writeStartElement("a:stretch"),n.writeStartElement("a:fillRect"),n.writeEndElement(),n.writeEndElement(),n.writeEndElement(),n.writeStartElement("pic:spPr"),n.writeStartElement("a:xfrm"),n.writeStartElement("a:off"),n.writeAttributeString("x","0"),n.writeAttributeString("y","0"),n.writeEndElement(),n.writeStartElement("a:ext"),n.writeAttributeString("cx",this.convertTwipsToEmu(o).toString()),n.writeAttributeString("cy",this.convertTwipsToEmu(s).toString()),n.writeEndElement(),n.writeEndElement(),n.writeStartElement("a:prstGeom"),n.writeAttributeString("prst","rect"),n.writeStartElement("a:avLst"),n.writeEndElement(),n.writeEndElement(),n.writeEndElement(),n.writeEndElement(),n.writeEndElement(),n.writeEndElement(),n.writeEndElement(),n.writeEndElement(),n.writeEndElement(),-1!=this.bkmRefId&&(n.writeStartElement("w:bookmarkEnd"),n.writeAttributeString("w:id",this.bkmRefId.toString()),n.writeEndElement()),n.writeEndElement()}}writeStiImageAuto(t,e,i,r){let n=e.component.as(StiImage);if(null==n)return;let a,o=0,s=0,l=this.exportCache.getImageIndex(e.component,null,e.componentId);if(null!=l)a=new Stimulsoft.System.Drawing.Image,o=this.imageCache.imageSizeStore[l].width,s=this.imageCache.imageSizeStore[l].height;else{let t={ref:this.imageResolution};if(null==(a=n.getImage(t)))return;let e=a.imageFormat,i=(o=a.width,s=a.height,__.d.StiOfficeImageFormatHelper.correctImageFormat(this.imageFormat,e));l=this.imageCache.addImageInt(a,i)}this.needEmptyParagraph=!1;let m=e.component.report.unit.convertToHInches(e.component.width),h=e.component.report.unit.convertToHInches(e.component.height);if(n.imageRotation==StiImageRotation.Rotate90CCW||n.imageRotation==StiImageRotation.Rotate90CW){let t=m;m=h,h=t}let c=new Rectangle,g=[],S=this.matrix.getRealImageData(e,a,g),p=(null!=S&&0<g.length&&(c.x=g[0],c.y=g[1]),c.width=this.matrix.coordX.getByIndex(e.left+e.width+1)-this.matrix.coordX.getByIndex(e.left),c.height=this.matrix.coordY.getByIndex(e.top+e.height+1)-this.matrix.coordY.getByIndex(e.top),c.clone()),d=n.margins.left,u=n.margins.right,w=n.margins.top,f=n.margins.bottom,b=n.horAlignment,E=n.vertAlignment,y=0;if(n.imageRotation!=StiImageRotation.None){let t=StiHorAlignment.Center,e=StiVertAlignment.Center;n.imageRotation==StiImageRotation.Rotate90CW&&(b==StiHorAlignment.Left&&(e=StiVertAlignment.Bottom),b==StiHorAlignment.Right&&(e=StiVertAlignment.Top),E==StiVertAlignment.Top&&(t=StiHorAlignment.Left),E==StiVertAlignment.Bottom&&(t=StiHorAlignment.Right),d=n.margins.top,u=n.margins.bottom,w=n.margins.right,f=n.margins.left,y=-90,p.x=c.y,p.y=h-(c.x+c.width),p.width=c.height,p.height=c.width),n.imageRotation==StiImageRotation.Rotate90CCW&&(b==StiHorAlignment.Left&&(e=StiVertAlignment.Top),b==StiHorAlignment.Right&&(e=StiVertAlignment.Bottom),E==StiVertAlignment.Top&&(t=StiHorAlignment.Right),E==StiVertAlignment.Bottom&&(t=StiHorAlignment.Left),d=n.margins.bottom,u=n.margins.top,w=n.margins.left,f=n.margins.right,y=90,p.x=m-(c.y+c.height),p.y=c.x,p.width=c.height,p.height=c.width),n.imageRotation==StiImageRotation.Rotate180&&(b==StiHorAlignment.Left&&(t=StiHorAlignment.Right),b==StiHorAlignment.Right&&(t=StiHorAlignment.Left),E==StiVertAlignment.Top&&(e=StiVertAlignment.Bottom),E==StiVertAlignment.Bottom&&(e=StiVertAlignment.Top),d=n.margins.right,u=n.margins.left,w=n.margins.bottom,f=n.margins.top,y=180,p.x=m-(c.x+c.width),p.y=h-(c.y+c.height)),n.imageRotation==StiImageRotation.FlipHorizontal&&(b==StiHorAlignment.Left&&(t=StiHorAlignment.Right),b==StiHorAlignment.Right&&(t=StiHorAlignment.Left),e=E,d=n.margins.right,u=n.margins.left,p.x=m-(c.x+c.width)),n.imageRotation==StiImageRotation.FlipVertical&&(E==StiVertAlignment.Top&&(e=StiVertAlignment.Bottom),E==StiVertAlignment.Bottom&&(e=StiVertAlignment.Top),t=b,w=n.margins.bottom,f=n.margins.top,p.y=h-(c.y+c.height)),b=t,E=e}let v=m-d-u,x=h-w-f;if(n.stretch||null!=n.icon){if(n.aspectRatio){let t=Math.min(v/o,x/s),e=(v-o*t)/2,i=(x-s*t)/2;b==StiHorAlignment.Left&&(u+=2*e),b==StiHorAlignment.Right&&(d+=2*e),b==StiHorAlignment.Center&&(d+=e,u+=e),E==StiVertAlignment.Top&&(f+=2*i),E==StiVertAlignment.Bottom&&(w+=2*i),E==StiVertAlignment.Center&&(w+=i,f+=i),v-=2*e,x-=2*i}}else{v=o*n.multipleFactor,x=s*n.multipleFactor;let t=-(v-m)/2,e=-(x-h)/2;b==StiHorAlignment.Left&&(u+=2*t),b==StiHorAlignment.Right&&(d+=2*t),b==StiHorAlignment.Center&&(d+=t,u+=t),E==StiVertAlignment.Top&&(f+=2*e),E==StiVertAlignment.Bottom&&(w+=2*e),E==StiVertAlignment.Center&&(w+=e,f+=e)}let A=-p.x,T=p.x+p.width-m,F=-p.y,C=p.y+p.height-h,P=(d+=A,u+=T,w+=F,f+=C,m+=A+T,h+=F+C,0|-Math.round(d/v*1e5)),L=0|-Math.round(u/v*1e5),k=0|-Math.round(w/x*1e5),B=0|-Math.round(f/x*1e5),I=__.d.StiOfficeImageFormatHelper.getImageFormatExtension(this.imageCache.imageFormatStore[l]),D=(t.writeStartElement("w:p"),t.writeStartElement("w:pPr"),null);b==StiHorAlignment.Right&&(D="right"),b==StiHorAlignment.Center&&(D="center"),StiString.isNullOrEmpty(D)||(t.writeStartElement("w:jc"),t.writeAttributeString("w:val",D),t.writeEndElement()),t.writeEndElement(),-1!=this.bkmRefId&&(t.writeStartElement("w:bookmarkStart"),t.writeAttributeString("w:id",this.bkmRefId.toString()),t.writeAttributeString("w:name",this.bkmRefText),t.writeEndElement()),t.writeStartElement("w:r"),t.writeStartElement("w:rPr"),t.writeElementString("w:noProof",""),t.writeEndElement(),t.writeStartElement("w:drawing"),t.writeStartElement("wp:inline"),t.writeAttributeString("distT","0"),t.writeAttributeString("distB","0"),t.writeAttributeString("distL","0"),t.writeAttributeString("distR","0"),t.writeStartElement("wp:extent"),t.writeAttributeString("cx",StiString.format("{0}",this.convertTwipsToEmu(m*PR.hiToTwips))),t.writeAttributeString("cy",StiString.format("{0}",this.convertTwipsToEmu(h*PR.hiToTwips))),t.writeEndElement(),t.writeStartElement("wp:effectExtent"),t.writeAttributeString("l","0"),t.writeAttributeString("t","0"),t.writeAttributeString("r","0"),t.writeAttributeString("b","0"),t.writeEndElement(),t.writeStartElement("wp:docPr"),t.writeAttributeString("id",``+(l+2)),t.writeAttributeString("name",StiString.format("Picture {0}",l+1)),t.writeAttributeString("descr",StiString.format("Image{0:D5}.{1}",l+1,I)),null!=this.hypRefText&&(-1==this.hypRefId&&(this.hypRefText="#"+this.hypRefText,this.hypRefId=this.getHyperlinkRefId(this.hypRefText)),t.writeStartElement("a:hlinkClick"),t.writeAttributeString("xmlns:a","http://schemas.openxmlformats.org/drawingml/2006/main"),t.writeAttributeString("r:id",StiString.format("hId{0}",this.hypRefId)),t.writeEndElement()),t.writeEndElement(),t.writeStartElement("wp:cNvGraphicFramePr"),t.writeStartElement("a:graphicFrameLocks"),t.writeAttributeString("xmlns:a","http://schemas.openxmlformats.org/drawingml/2006/main"),t.writeAttributeString("noChangeAspect","1"),t.writeEndElement(),t.writeEndElement(),t.writeStartElement("a:graphic"),t.writeAttributeString("xmlns:a","http://schemas.openxmlformats.org/drawingml/2006/main"),t.writeStartElement("a:graphicData"),t.writeAttributeString("uri","http://schemas.openxmlformats.org/drawingml/2006/picture"),t.writeStartElement("pic:pic"),t.writeAttributeString("xmlns:pic","http://schemas.openxmlformats.org/drawingml/2006/picture"),t.writeStartElement("pic:nvPicPr"),t.writeStartElement("pic:cNvPr"),t.writeAttributeString("id","0"),t.writeAttributeString("name",StiString.format("Image{0:D5}.{1}",l+1,I)),t.writeEndElement(),t.writeStartElement("pic:cNvPicPr"),t.writeEndElement(),t.writeEndElement(),t.writeStartElement("pic:blipFill"),t.writeAttributeString("rotWithShape","1"),t.writeStartElement("a:blip"),t.writeAttributeString("r:embed",StiString.format("rId{0}",5+l)),t.writeAttributeString("cstate","print"),t.writeStartElement("a:extLst"),t.writeStartElement("a:ext"),t.writeAttributeString("uri","{28A0092B-C50C-407E-A947-70E740481C1C}"),t.writeStartElement("a14:useLocalDpi"),t.writeAttributeString("xmlns:a14","http://schemas.microsoft.com/office/drawing/2010/main"),t.writeAttributeString("val","0"),t.writeEndElement(),t.writeEndElement(),t.writeEndElement(),t.writeEndElement(),0==P&&0==L&&0==k&&0==B||(t.writeStartElement("a:srcRect"),0!=P&&t.writeAttributeString("l",P.toString()),0!=k&&t.writeAttributeString("t",k.toString()),0!=L&&t.writeAttributeString("r",L.toString()),0!=B&&t.writeAttributeString("b",B.toString()),t.writeEndElement()),t.writeStartElement("a:stretch"),t.writeEndElement(),t.writeEndElement(),t.writeStartElement("pic:spPr"),t.writeStartElement("a:xfrm"),0!=y&&t.writeAttributeString("rot",StiString.format("{0}",0|Math.round(6e4*-y))),n.imageRotation==StiImageRotation.FlipHorizontal&&t.writeAttributeString("flipH","1"),n.imageRotation==StiImageRotation.FlipVertical&&t.writeAttributeString("flipV","1"),t.writeStartElement("a:off"),t.writeAttributeString("x","0"),t.writeAttributeString("y","0"),t.writeEndElement(),t.writeStartElement("a:ext"),t.writeAttributeString("cx",StiString.format("{0}",this.convertTwipsToEmu(m*PR.hiToTwips))),t.writeAttributeString("cy",StiString.format("{0}",this.convertTwipsToEmu(h*PR.hiToTwips))),t.writeEndElement(),t.writeEndElement(),t.writeStartElement("a:prstGeom"),t.writeAttributeString("prst","rect"),t.writeStartElement("a:avLst"),t.writeEndElement(),t.writeEndElement(),t.writeStartElement("a:ln"),t.writeStartElement("a:noFill"),t.writeEndElement(),t.writeEndElement(),t.writeStartElement("a:extLst"),t.writeStartElement("a:ext"),t.writeAttributeString("uri","{53640926-AAD7-44D8-BBD7-CCE9431645EC}"),t.writeStartElement("a14:shadowObscured"),t.writeAttributeString("xmlns:a14","http://schemas.microsoft.com/office/drawing/2010/main"),t.writeEndElement(),t.writeEndElement(),t.writeEndElement(),t.writeEndElement(),t.writeEndElement(),t.writeEndElement(),t.writeEndElement(),t.writeEndElement(),t.writeEndElement(),t.writeEndElement(),-1!=this.bkmRefId&&(t.writeStartElement("w:bookmarkEnd"),t.writeAttributeString("w:id",this.bkmRefId.toString()),t.writeEndElement()),t.writeEndElement()}writeTableInfo(i,r,t){i.writeStartElement("w:tblPr"),i.writeStartElement("w:tblStyle"),i.writeAttributeString("w:val","a1"),i.writeEndElement(),i.writeStartElement("w:tblW"),i.writeAttributeString("w:w","0"),i.writeAttributeString("w:type","dxa"),i.writeEndElement(),i.writeStartElement("w:tblLayout"),i.writeAttributeString("w:type","fixed"),i.writeEndElement(),i.writeStartElement("w:tblCellMar"),i.writeStartElement("w:top"),i.writeAttributeString("w:w","0"),i.writeAttributeString("w:type","dxa"),i.writeEndElement(),i.writeStartElement("w:left"),i.writeAttributeString("w:w","0"),i.writeAttributeString("w:type","dxa"),i.writeEndElement(),i.writeStartElement("w:bottom"),i.writeAttributeString("w:w","0"),i.writeAttributeString("w:type","dxa"),i.writeEndElement(),i.writeStartElement("w:right"),i.writeAttributeString("w:w","0"),i.writeAttributeString("w:type","dxa"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("w:tblLook"),i.writeAttributeString("w:val","04A0"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("w:tblGrid");for(let e=1;e<t;e++){let t=r[e]-r[e-1];i.writeStartElement("w:gridCol"),i.writeAttributeString("w:w",t.toString()),i.writeEndElement()}i.writeFullEndElement()}writeHtmlTags(a,o){let t=o.component,e=o.text,s=new StiHtmlTagsState(t.font.bold,t.font.italic,t.font.underline,t.font.strikeout,t.font.sizeInPoints,t.font.name,StiBrush.toColor(t.textBrush),StiBrush.toColor(t.brush),!1,!1,0,0,t.lineSpacing,t.horAlignment),i=new StiHtmlState(s,0),l=Stimulsoft.Base.Drawing.StiTextRenderer.parseHtmlToStates(e,i),m=this.getStyleFromComponent(o.component);this.writeParagraphBegin(a,o,m,l,0);for(let n=0;n<l.length;n++){let t=l[n],e=t.ts;if("\n"==t.text.toString()&&n<l[Stimulsoft.System.StiObject.stimulsoft]().countItems-1){a.writeEndElement(),this.writeParagraphBegin(a,o,m,l,n+1);continue}a.writeStartElement("w:r"),a.writeStartElement("w:rPr"),e.bold&&(a.writeStartElement("w:b"),a.writeEndElement()),e.italic&&(a.writeStartElement("w:i"),a.writeEndElement()),e.underline&&(a.writeStartElement("w:u"),a.writeAttributeString("w:val","single"),a.writeEndElement()),e.strikeout&&(a.writeStartElement("w:strike"),a.writeEndElement()),e.superscript&&(a.writeStartElement("w:vertAlign"),a.writeAttributeString("w:val","superscript"),a.writeEndElement()),e.subscript&&(a.writeStartElement("w:vertAlign"),a.writeAttributeString("w:val","subscript"),a.writeEndElement()),e.fontColor.toArgb()!=s.fontColor.toArgb()&&(a.writeStartElement("w:color"),a.writeAttributeString("w:val",this.getColorString(e.fontColor)),a.writeEndElement()),e.backColor.toArgb()!=s.backColor.toArgb()&&(a.writeStartElement("w:shd"),a.writeAttributeString("w:val","clear"),a.writeAttributeString("w:color","auto"),a.writeAttributeString("w:fill",this.getColorString(e.backColor)),a.writeEndElement()),a.writeStartElement("w:sz"),a.writeAttributeString("w:val",(2*e.fontSize).toString()),a.writeEndElement(),a.writeStartElement("w:szCs"),a.writeAttributeString("w:val",(2*e.fontSize).toString()),a.writeEndElement(),a.writeStartElement("w:rFonts");let i=e.fontName,r=(this.fontList.set(i,i),a.writeAttributeString("w:ascii",i),a.writeAttributeString("w:hAnsi",i),a.writeAttributeString("w:eastAsia",i),a.writeAttributeString("w:cs",i),a.writeEndElement(),e.letterSpacing*e.fontSize*18.8+Stimulsoft.StiOptions.Export.Word.spaceBetweenCharacters);0!=r&&(a.writeStartElement("w:spacing"),a.writeAttributeString("w:val",r.toString()),a.writeEndElement()),null!=o.cellStyle.textOptions&&o.cellStyle.textOptions.rightToLeft&&(a.writeStartElement("w:rtl"),a.writeEndElement()),a.writeEndElement(),a.writeStartElement("w:t"),a.writeAttributeString("xml:space","preserve"),a.writeString(Stimulsoft.Base.Drawing.StiTextRenderer.prepareStateText(t.text).toString()),a.writeEndElement(),a.writeEndElement()}a.writeEndElement()}writeParagraphBegin(t,e,i,r,n){t.writeStartElement("w:p"),t.writeStartElement("w:pPr"),-1!=i?(t.writeStartElement("w:pStyle"),t.writeAttributeString("w:val",`Style`+i),t.writeEndElement()):this.writeRunProperties(t,e);let a=r[n];if("\n"!=a.text.toString()){let t=n+1;while(t<r.length&&"\n"!=r[t].text.toString())a=r[t],t++}let o=Stimulsoft.StiOptions.Export.Word.lineSpacing*a.ts.lineHeight,s=(PR.checkFontsToCorrectHeight(a.ts.fontName)&&(o*=.772),1!=o&&(t.writeStartElement("w:spacing"),t.writeAttributeString("w:line",StiMath.round2(240*o).toString()),t.writeEndElement()),null);a.ts.textAlign==StiTextHorAlignment.Center&&(s="center"),a.ts.textAlign==StiTextHorAlignment.Right&&(s="right"),null!=(s=a.ts.textAlign==StiTextHorAlignment.Width?"both":s)&&(t.writeStartElement("w:jc"),t.writeAttributeString("w:val",s),t.writeEndElement()),t.writeEndElement()}writeRunProperties(t,e){t.writeStartElement("w:rPr"),t.writeStartElement("w:rFonts");let i=e.cellStyle.font.name;this.fontList.set(i,i),t.writeAttributeString("w:ascii",i),t.writeAttributeString("w:hAnsi",i),t.writeAttributeString("w:eastAsia",i),t.writeAttributeString("w:cs",i),t.writeEndElement(),e.cellStyle.font.bold&&(t.writeStartElement("w:b"),t.writeEndElement()),e.cellStyle.font.italic&&(t.writeStartElement("w:i"),t.writeEndElement()),e.cellStyle.font.underline&&(t.writeStartElement("w:u"),t.writeAttributeString("w:val","single"),t.writeEndElement()),t.writeStartElement("w:color"),t.writeAttributeString("w:val",this.getColorString(e.cellStyle.textColor)),t.writeEndElement(),t.writeStartElement("w:sz"),t.writeAttributeString("w:val",(2*e.cellStyle.font.sizeInPoints).toString()),t.writeEndElement(),0!=Stimulsoft.StiOptions.Export.Word.spaceBetweenCharacters&&(t.writeStartElement("w:spacing"),t.writeAttributeString("w:val",Stimulsoft.StiOptions.Export.Word.spaceBetweenCharacters.toString()),t.writeEndElement()),null!=e.cellStyle.textOptions&&e.cellStyle.textOptions.rightToLeft&&(e.cellStyle.font.bold&&(t.writeStartElement("w:bCs"),t.writeEndElement()),e.cellStyle.font.italic&&(t.writeStartElement("w:iCs"),t.writeEndElement()),t.writeStartElement("w:szCs"),t.writeAttributeString("w:val",(2*e.cellStyle.font.sizeInPoints).toString()),t.writeEndElement(),t.writeStartElement("w:rtl"),t.writeEndElement()),t.writeEndElement()}renderBorder2TableGetValues(t,e,i){let r=i.ref,n=StiBorderSides.None,a=new StringBuilder;return null!=this.matrix.bordersY[t-1][e-1]&&(n|=StiBorderSides.Left),null!=this.matrix.bordersY[t-1][e-1+1]&&(n|=StiBorderSides.Right),null!=this.matrix.bordersX[t-1][e-1]&&(a.append("\\t"+this.getLineStyle2TableGetValues(this.matrix.bordersX[t-1][e-1])),n|=StiBorderSides.Top),null!=this.matrix.bordersX[t-1+1][e-1]&&(a.append("\\b"+this.getLineStyle2TableGetValues(this.matrix.bordersX[t-1+1][e-1])),n|=StiBorderSides.Bottom),r=a.toString(),i.ref=r,n}getLineStyle2TableGetValues(t){let e=new StringBuilder;return e.append(this.getLineStyle(t.style)),e.append(StiMath.trunc(15*t.size)),e.append(StiString.format("c{0}",this.getColorString(t.color))),e.toString()}writeDocument(o,s,t,l){let e=new MemoryStream,m=new XmlTextWriter(Encoding.UTF8,e),i=(m.indentation=this.xmlIndentation<0?0:this.xmlIndentation,m.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,m.writeStartDocument(),m.writeStartElement("w:document"),m.writeAttributeString("xmlns:ve","http://schemas.openxmlformats.org/markup-compatibility/2006"),m.writeAttributeString("xmlns:o","urn:schemas-microsoft-com:office:office"),m.writeAttributeString("xmlns:r","http://schemas.openxmlformats.org/officeDocument/2006/relationships"),m.writeAttributeString("xmlns:m","http://schemas.openxmlformats.org/officeDocument/2006/math"),m.writeAttributeString("xmlns:v","urn:schemas-microsoft-com:vml"),m.writeAttributeString("xmlns:wp","http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"),m.writeAttributeString("xmlns:w10","urn:schemas-microsoft-com:office:word"),m.writeAttributeString("xmlns:w","http://schemas.openxmlformats.org/wordprocessingml/2006/main"),m.writeAttributeString("xmlns:wne","http://schemas.microsoft.com/office/word/2006/wordml"),this.getPagesBackColor(o)),r=(i.equals(Color.white)||0==i.a||(m.writeStartElement("w:background"),m.writeAttributeString("w:color",this.getColorString(i)),m.writeEndElement()),m.writeStartElement("w:body"),o),n=(o=null,0),h=0;while(n<r.count){(o=new StiPagesCollection(s,r)).cacheMode=s.renderedPages.cacheMode,o.addV2Internal(r.getPageWithoutCache(n));while(n<r.count-1&&this.comparePages(r.getPageWithoutCache(n+1),r.getPageWithoutCache(n)))n++,o.addV2Internal(r.getPageWithoutCache(n));let a=o.getByIndex(0);if(null!=a){if(o.getPage(a),this.usePageHeadersAndFooters){let t=new StiPagesCollection(s,s.renderedPages),e=(t.cacheMode=s.renderedPages.cacheMode,t.add(o.getByIndex(0)),this.matrix=new __.c.StiMatrix(t,Stimulsoft.StiOptions.Export.Word.divideBigCells,this),this.matrix.scanComponentsPlacement(!1),0),i=0,r=!1;i=this.matrix.coordY.countItems-1-1;while(0<i&&this.matrix.linePlacement[i]!=__.c.StiTableLineInfo.PageHeader)i--;if(0<=i&&this.matrix.linePlacement[i]==__.c.StiTableLineInfo.PageHeader){e=0;while(this.matrix.linePlacement[e]!=__.c.StiTableLineInfo.PageHeader)e++;r=!0}this.headersData.push(this.writeHeader(e,i,r,a,l)),null!=this.headersData[h]&&(0<this.imageCache.imagePackedStore.length||l)?this.headersRels.push(this.writeHeaderFooterRels(l)):this.headersRels.push(null);let n=!1;e=0;while(this.matrix.linePlacement[e]!=__.c.StiTableLineInfo.PageFooter&&e<this.matrix.coordY.countItems-1-1)e++;if(this.matrix.linePlacement[e]==__.c.StiTableLineInfo.PageFooter){i=this.matrix.coordY.countItems-1-1;while(this.matrix.linePlacement[i]!=__.c.StiTableLineInfo.PageFooter)i--;n=!0}this.footersData.push(this.writeFooter(e,i,n,a,l)),null!=this.footersData[h]&&0<this.imageCache.imagePackedStore.length?this.footersRels.push(this.writeHeaderFooterRels(!1)):this.footersRels.push(null),this.matrix=new __.c.StiMatrix(o,Stimulsoft.StiOptions.Export.Word.divideBigCells,this),this.matrix.scanComponentsPlacement(!0),i=this.matrix.coordY.countItems-1-1,this.writeFromMatrix(m,0,i,!1,a)}else this.headersData.push(this.writeHeader(0,0,!1,a,l)),this.footersData.push(this.writeFooter(0,0,!1,a,l)),null!=this.headersData[h]&&(0<this.imageCache.imagePackedStore.length||l)?this.headersRels.push(this.writeHeaderFooterRels(l)):this.headersRels.push(null),null!=this.footersData[h]&&0<this.imageCache.imagePackedStore.length?this.footersRels.push(this.writeHeaderFooterRels(!1)):this.footersRels.push(null),this.matrix=new __.c.StiMatrix(o,Stimulsoft.StiOptions.Export.Word.divideBigCells,this,null,__.c.StiDataExportMode.AllBands,t),this.writeFromMatrix(m,0,this.matrix.coordY.countItems-1-1,!0,a);n<r.count-1&&(m.writeStartElement("w:p"),m.writeStartElement("w:pPr"),this.writePageInfo(m,o.getByIndex(0),h),m.writeEndElement(),m.writeEndElement())}n++,h++}return 0<o.count&&this.writePageInfo(m,o.getByIndex(0),h-1),m.writeFullEndElement(),m.writeFullEndElement(),m.writeEndDocument(),m.flush(),e}getPagesBackColor(r){let n=Color.transparent;if(0<r.count){let t=r.getPageWithoutCache(0);n=StiBrush.toColor(t.brush);for(let i=1;i<r.count;i++){let t=r.getPageWithoutCache(i),e=StiBrush.toColor(t.brush);if(!n.equals(e)){n=Color.transparent;break}}}return n}comparePages(t,e){let i=t.excelSheetValue,r=(StiString.isNullOrEmpty(i)&&(i=""),e.excelSheetValue);if(StiString.isNullOrEmpty(r)&&(r=""),i!=r)return!1;if(t.orientation!=e.orientation)return!1;if(!t.margins.equals(e.margins))return!1;if(t.unlimitedHeight!=e.unlimitedHeight)return!1;return!0}writePageInfo(t,e,i){let r=this.convertHiToTwips(e.unit.convertToHInches(e.pageHeight*(this.usePageHeadersAndFooters?1:e.segmentPerHeight))),n=this.convertHiToTwips(e.unit.convertToHInches(e.pageWidth*(this.usePageHeadersAndFooters?1:e.segmentPerWidth))),a=this.convertHiToTwips(e.unit.convertToHInches(e.margins.left)),o=this.convertHiToTwips(e.unit.convertToHInches(e.margins.right)),s=this.convertHiToTwips(e.unit.convertToHInches(e.margins.top)),l=this.convertHiToTwips(e.unit.convertToHInches(e.margins.bottom))-Stimulsoft.StiOptions.Export.Word.bottomMarginCorrection,m=this.shiftHeader?.4*s:s,h=this.shiftFooter?.4*l:l;l<0&&(l=0),31500<n&&(n=31500),31500<r&&(r=31500),t.writeStartElement("w:sectPr"),null!=this.headersData[i]&&(t.writeStartElement("w:headerReference"),t.writeAttributeString("w:type","default"),t.writeAttributeString("r:id",`rIdh`+(i+1)),t.writeEndElement()),null!=this.footersData[i]&&(t.writeStartElement("w:footerReference"),t.writeAttributeString("w:type","default"),t.writeAttributeString("r:id",`rIdf`+(i+1)),t.writeEndElement()),t.writeStartElement("w:pgSz"),t.writeAttributeString("w:w",n.toString()),t.writeAttributeString("w:h",r.toString()),e.orientation==StiPageOrientation.Landscape&&t.writeAttributeString("w:orient","landscape"),t.writeEndElement(),t.writeStartElement("w:pgMar"),t.writeAttributeString("w:top",s.toString()),t.writeAttributeString("w:right",o.toString()),t.writeAttributeString("w:bottom",l.toString()),t.writeAttributeString("w:left",a.toString()),t.writeAttributeString("w:header",m.toString()),t.writeAttributeString("w:footer",h.toString()),t.writeAttributeString("w:gutter","0"),t.writeEndElement(),t.writeEndElement()}writeBorders(t,e,i,r,n){let a=!0,o=!0;for(let t=0;t<r;t++)null==this.matrix.bordersY[e+t][i]&&(a=!1),null==this.matrix.bordersY[e+t][i+n]&&(o=!1);let s=!0,l=!0;for(let t=0;t<n;t++)null==this.matrix.bordersX[e][i+t]&&(s=!1),null==this.matrix.bordersX[e+r][i+t]&&(l=!1);(s||a||l||o)&&(t.writeStartElement("w:tcBorders"),s&&this.writeBorderData(t,"w:top",this.matrix.bordersX[e][i]),a&&this.writeBorderData(t,"w:left",this.matrix.bordersY[e][i]),l&&this.writeBorderData(t,"w:bottom",this.matrix.bordersX[e+r][i]),o&&this.writeBorderData(t,"w:right",this.matrix.bordersY[e][i+n]),t.writeEndElement())}writeBorderData(e,i,r){if(null!=r){let t=this.getLineStyle(r.style);""!=t&&(e.writeStartElement(i),e.writeAttributeString("w:val",t),e.writeAttributeString("w:sz",StiMath.trunc(5*r.size).toString()),e.writeAttributeString("w:space","0"),e.writeAttributeString("w:color",this.getColorString(r.color)),e.writeEndElement())}}writeFootNotes(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);return e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),e.writeStartElement("w:footnotes"),e.writeAttributeString("xmlns:ve","http://schemas.openxmlformats.org/markup-compatibility/2006"),e.writeAttributeString("xmlns:o","urn:schemas-microsoft-com:office:office"),e.writeAttributeString("xmlns:r","http://schemas.openxmlformats.org/officeDocument/2006/relationships"),e.writeAttributeString("xmlns:m","http://schemas.openxmlformats.org/officeDocument/2006/math"),e.writeAttributeString("xmlns:v","urn:schemas-microsoft-com:vml"),e.writeAttributeString("xmlns:wp","http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"),e.writeAttributeString("xmlns:w10","urn:schemas-microsoft-com:office:word"),e.writeAttributeString("xmlns:w","http://schemas.openxmlformats.org/wordprocessingml/2006/main"),e.writeAttributeString("xmlns:wne","http://schemas.microsoft.com/office/word/2006/wordml"),e.writeStartElement("w:footnote"),e.writeAttributeString("w:type","separator"),e.writeAttributeString("w:id","0"),e.writeStartElement("w:p"),e.writeStartElement("w:r"),e.writeStartElement("w:separator"),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeFullEndElement(),e.writeStartElement("w:footnote"),e.writeAttributeString("w:type","continuationSeparator"),e.writeAttributeString("w:id","1"),e.writeStartElement("w:p"),e.writeStartElement("w:r"),e.writeStartElement("w:continuationSeparator"),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeFullEndElement(),e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeEndNotes(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);return e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),e.writeStartElement("w:endnotes"),e.writeAttributeString("xmlns:ve","http://schemas.openxmlformats.org/markup-compatibility/2006"),e.writeAttributeString("xmlns:o","urn:schemas-microsoft-com:office:office"),e.writeAttributeString("xmlns:r","http://schemas.openxmlformats.org/officeDocument/2006/relationships"),e.writeAttributeString("xmlns:m","http://schemas.openxmlformats.org/officeDocument/2006/math"),e.writeAttributeString("xmlns:v","urn:schemas-microsoft-com:vml"),e.writeAttributeString("xmlns:wp","http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"),e.writeAttributeString("xmlns:w10","urn:schemas-microsoft-com:office:word"),e.writeAttributeString("xmlns:w","http://schemas.openxmlformats.org/wordprocessingml/2006/main"),e.writeAttributeString("xmlns:wne","http://schemas.microsoft.com/office/word/2006/wordml"),e.writeStartElement("w:endnote"),e.writeAttributeString("w:type","separator"),e.writeAttributeString("w:id","0"),e.writeStartElement("w:p"),e.writeStartElement("w:r"),e.writeStartElement("w:separator"),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeFullEndElement(),e.writeStartElement("w:endnote"),e.writeAttributeString("w:type","continuationSeparator"),e.writeAttributeString("w:id","1"),e.writeStartElement("w:p"),e.writeStartElement("w:r"),e.writeStartElement("w:continuationSeparator"),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeFullEndElement(),e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeHeader(t,e,i,r,n){let a=new MemoryStream,o=new XmlTextWriter(Encoding.UTF8,a),s=(o.indentation=this.xmlIndentation<0?0:this.xmlIndentation,o.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,o.writeStartDocument(),o.writeStartElement("w:hdr"),o.writeAttributeString("xmlns:ve","http://schemas.openxmlformats.org/markup-compatibility/2006"),o.writeAttributeString("xmlns:o","urn:schemas-microsoft-com:office:office"),o.writeAttributeString("xmlns:r","http://schemas.openxmlformats.org/officeDocument/2006/relationships"),o.writeAttributeString("xmlns:m","http://schemas.openxmlformats.org/officeDocument/2006/math"),o.writeAttributeString("xmlns:v","urn:schemas-microsoft-com:vml"),o.writeAttributeString("xmlns:wp","http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"),o.writeAttributeString("xmlns:w10","urn:schemas-microsoft-com:office:word"),o.writeAttributeString("xmlns:w","http://schemas.openxmlformats.org/wordprocessingml/2006/main"),o.writeAttributeString("xmlns:wne","http://schemas.microsoft.com/office/word/2006/wordml"),i&&this.writeFromMatrix(o,t,e,!0),this.writeWatermark(o,r,!0,!0,!0));if(n){0==this.additionalIndex&&(this.additionalIndex=5+this.imageCache.addImageInt(StiImageHelper.getImageFromObject(__.c.StiExportUtils.additionalData),__.a.ImageFormat.Png));let t=(this.spriteIndex++).toString();s||(o.writeStartElement("w:p"),s=!0),o.writeRaw('<w:pPr><w:pStyle w:val="a3"/></w:pPr><w:r><w:rPr><w:noProof/><w:lang w:eastAsia="ru-RU"/></w:rPr><w:pict>'+'<v:shapetype id="_x0000_t'+t+'" coordsize="21600,21600" o:spt="'+t+'" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"> <v:stroke joinstyle="miter"/> <v:formulas>'+'<v:f eqn="if lineDrawn pixelLineWidth 0"/><v:f eqn="sum @0 1 0"/><v:f eqn="sum 0 0 @1"/><v:f eqn="prod @2 1 2"/><v:f eqn="prod @3 21600 pixelWidth"/><v:f eqn="prod @3 21600 pixelHeight"/><v:f eqn="sum @0 0 1"/>'+'<v:f eqn="prod @6 1 2"/><v:f eqn="prod @7 21600 pixelWidth"/><v:f eqn="sum @8 21600 0"/><v:f eqn="prod @7 21600 pixelHeight"/><v:f eqn="sum @10 21600 0"/></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>'+'<o:lock v:ext="edit" aspectratio="t"/></v:shapetype><v:shape id="WordPictureWatermark117770'+t+'" o:spid="_x0000_s20'+t+'" type="#_x0000_t'+t+'" '+'style="position:absolute;margin-left:0;margin-top:0;width:467.45pt;height:381pt;z-index:282657216;mso-position-horizontal:center;mso-position-horizontal-relative:page;mso-position-vertical:center;mso-position-vertical-relative:page" '+'o:allowincell="f"><v:imagedata r:id="rId'+this.additionalIndex.toString()+'" o:title="additional"/></v:shape></w:pict></w:r>')}if(s&&o.writeEndElement(),this.shiftHeader=!i,!s&&!i){if(!this.hasHeader)return o.close(),null;o.writeStartElement("w:p"),o.writeStartElement("w:r"),o.writeEndElement(),o.writeEndElement()}return this.hasHeader=!0,o.writeFullEndElement(),o.writeEndDocument(),o.flush(),a}writeFooter(t,e,i,r,n){let a=new MemoryStream,o=new XmlTextWriter(Encoding.UTF8,a);if(o.indentation=this.xmlIndentation<0?0:this.xmlIndentation,o.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,o.writeStartDocument(),o.writeStartElement("w:ftr"),o.writeAttributeString("xmlns:ve","http://schemas.openxmlformats.org/markup-compatibility/2006"),o.writeAttributeString("xmlns:o","urn:schemas-microsoft-com:office:office"),o.writeAttributeString("xmlns:r","http://schemas.openxmlformats.org/officeDocument/2006/relationships"),o.writeAttributeString("xmlns:m","http://schemas.openxmlformats.org/officeDocument/2006/math"),o.writeAttributeString("xmlns:v","urn:schemas-microsoft-com:vml"),o.writeAttributeString("xmlns:wp","http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"),o.writeAttributeString("xmlns:w10","urn:schemas-microsoft-com:office:word"),o.writeAttributeString("xmlns:w","http://schemas.openxmlformats.org/wordprocessingml/2006/main"),o.writeAttributeString("xmlns:wne","http://schemas.microsoft.com/office/word/2006/wordml"),this.shiftFooter=!i,i)this.writeFromMatrix(o,t,e,!0);else{if(!this.hasFooter)return o.close(),null;o.writeStartElement("w:p"),o.writeStartElement("w:r"),o.writeEndElement(),o.writeEndElement()}return this.hasFooter=!0,o.writeFullEndElement(),o.writeEndDocument(),o.flush(),a}writeWatermark(c,g,t,e,S){let p=!1;if(!g.watermark.enabled)return p;if(t){let h=this.exportCache.getImageIndex(g);if(null==h){let t=g.watermark.getImage(g.report);null!=t&&(h=this.imageCache.addImageIntRaw(t,t.imageFormat))}if(null!=h){p=!0;let r=this.imageCache.imageSizeStore[h].width,n=this.imageCache.imageSizeStore[h].height,t=g.watermark.showImageBehind?-251656192:251656192,e=(this.spriteIndex++).toString(),a=r*g.watermark.imageMultipleFactor/100,o=n*g.watermark.imageMultipleFactor/100;if(g.watermark.imageStretch&&(a=g.unit.convertToHInches(g.pageWidth)/100,o=g.unit.convertToHInches(g.pageHeight)/100,g.watermark.aspectRatio)){let t=g.unit.convertToHInches(g.pageWidth)/r,e=g.unit.convertToHInches(g.pageHeight)/n,i=Math.min(t,e);a=r*i/100,o=n*i/100}let i="center",s="center",l=(g.watermark.imageAlignment!=ContentAlignment.TopLeft&&g.watermark.imageAlignment!=ContentAlignment.MiddleLeft&&g.watermark.imageAlignment!=ContentAlignment.BottomLeft||(i="left"),g.watermark.imageAlignment!=ContentAlignment.TopRight&&g.watermark.imageAlignment!=ContentAlignment.MiddleRight&&g.watermark.imageAlignment!=ContentAlignment.BottomRight||(i="right"),g.watermark.imageAlignment!=ContentAlignment.TopLeft&&g.watermark.imageAlignment!=ContentAlignment.TopCenter&&g.watermark.imageAlignment!=ContentAlignment.TopRight||(s="top"),g.watermark.imageAlignment!=ContentAlignment.BottomLeft&&g.watermark.imageAlignment!=ContentAlignment.BottomCenter&&g.watermark.imageAlignment!=ContentAlignment.BottomRight||(s="bottom"),'<v:shapetype id="_x0000_t'+e+'" coordsize="21600,21600" o:spt="'+e+'" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f">'+'<v:stroke joinstyle="miter"/><v:formulas>'+'<v:f eqn="if lineDrawn pixelLineWidth 0"/><v:f eqn="sum @0 1 0"/><v:f eqn="sum 0 0 @1"/><v:f eqn="prod @2 1 2"/>'+'<v:f eqn="prod @3 21600 pixelWidth"/><v:f eqn="prod @3 21600 pixelHeight"/><v:f eqn="sum @0 0 1"/><v:f eqn="prod @6 1 2"/>'+'<v:f eqn="prod @7 21600 pixelWidth"/><v:f eqn="sum @8 21600 0"/><v:f eqn="prod @7 21600 pixelHeight"/><v:f eqn="sum @10 21600 0"/></v:formulas>'+'<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/><o:lock v:ext="edit" aspectratio="t"/></v:shapetype>'),m=new StringBuilder;m.append("position:absolute;margin-left:0;margin-top:0;"),m.appendFormat("width:{0}in;height:{1}in;z-index:{2};",a,o,t),m.appendFormat("mso-position-horizontal:{0};mso-position-horizontal-relative:page;mso-position-vertical:{1};mso-position-vertical-relative:page;",i,s),S&&c.writeStartElement("w:p"),c.writeStartElement("w:r"),c.writeStartElement("w:rPr"),c.writeStartElement("w:noProof"),c.writeEndElement(),c.writeEndElement(),c.writeStartElement("w:pict"),c.writeRaw(l),c.writeStartElement("v:shape"),c.writeAttributeString("id","WordPictureWatermark12345"+e),c.writeAttributeString("o:spid","_x0000_s20"+e),c.writeAttributeString("type","#_x0000_t"+e),c.writeAttributeString("style",m.toString()),c.writeAttributeString("o:allowincell","f"),c.writeStartElement("v:imagedata"),c.writeAttributeString("r:id","rId"+(h+5).toString()),c.writeEndElement(),c.writeStartElement("w10:wrap"),c.writeAttributeString("anchorx","page"),c.writeAttributeString("anchory","page"),c.writeEndElement(),c.writeEndElement(),c.writeEndElement(),c.writeEndElement()}}if(e&&!StiString.isNullOrWhiteSpace(g.watermark.text)){let t=g.watermark.showBehind?-241656192:271656192,e=(this.spriteIndex++).toString(),i=Graphics.measureString(g.watermark.text,g.watermark.font),r=i.width*__.a.StiDpiHelper.deviceCapsScale/100,n=i.height*__.a.StiDpiHelper.deviceCapsScale/100,a=-g.watermark.angle,o=(a<0&&(a=360+a),'<v:shapetype id="_x0000_t'+e+'" coordsize="21600,21600" o:spt="'+e+'" adj="10800" path="m@7,l@8,m@5,21600l@6,21600e">'+'<v:formulas><v:f eqn="sum #0 0 10800"/><v:f eqn="prod #0 2 1"/><v:f eqn="sum 21600 0 @1"/><v:f eqn="sum 0 0 @2"/>'+'<v:f eqn="sum 21600 0 @3"/><v:f eqn="if @0 @3 0"/><v:f eqn="if @0 21600 @1"/><v:f eqn="if @0 0 @2"/><v:f eqn="if @0 @4 21600"/>'+'<v:f eqn="mid @5 @6"/><v:f eqn="mid @8 @5"/><v:f eqn="mid @7 @8"/><v:f eqn="mid @6 @7"/><v:f eqn="sum @6 0 @5"/></v:formulas>'+'<v:path textpathok="t" o:connecttype="custom" o:connectlocs="@9,0;@10,10800;@11,21600;@12,10800" o:connectangles="270,180,90,0"/>'+'<v:textpath on="t" fitshape="t"/><v:handles><v:h position="#0,bottomRight" xrange="6629,14971"/></v:handles>'+'<o:lock v:ext="edit" text="t" shapetype="t"/></v:shapetype>'),s=new StringBuilder,l=(s.append("position:absolute;margin-left:0;margin-top:0;"),s.appendFormat("width:{0}in;height:{1}in;z-index:{2};rotation:{3};",r,n,t,a),s.append("mso-position-horizontal:center;mso-position-horizontal-relative:page;mso-position-vertical:center;mso-position-vertical-relative:page;"),new StringBuilder);l.append('font-family:"'+g.watermark.font.name+'"'),g.watermark.font.bold&&l.append(";font-weight:bold"),g.watermark.font.italic&&l.append(";font-style:italic"),S&&!p&&c.writeStartElement("w:p"),c.writeStartElement("w:r"),c.writeStartElement("w:rPr"),c.writeStartElement("w:noProof"),c.writeEndElement(),c.writeEndElement(),c.writeStartElement("w:pict"),c.writeRaw(o),c.writeStartElement("v:shape"),c.writeAttributeString("id","PowerPlusWaterMarkObject264"+e),c.writeAttributeString("o:spid","_x0000_s20"+e),c.writeAttributeString("type","#_x0000_t"+e),c.writeAttributeString("style",s.toString()),c.writeAttributeString("o:allowincell","f"),c.writeAttributeString("fillcolor","#"+StiString.format("{0:X8}",StiBrush.toColor(g.watermark.textBrush).toArgb()).substr(2)),c.writeAttributeString("stroked","f"),c.writeStartElement("v:fill"),c.writeAttributeString("opacity",StiMath.round2(StiBrush.toColor(g.watermark.textBrush).a/255,3).toString()),c.writeEndElement(),c.writeStartElement("v:textpath"),c.writeAttributeString("style",l.toString()),c.writeAttributeString("string",g.watermark.text[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("\r","")),c.writeEndElement(),c.writeEndElement(),c.writeEndElement(),c.writeEndElement(),p=!0}return p}writeContentTypes(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),e.writeStartElement("Types"),e.writeAttributeString("xmlns","http://schemas.openxmlformats.org/package/2006/content-types"),e.writeStartElement("Default"),e.writeAttributeString("Extension","rels"),e.writeAttributeString("ContentType","application/vnd.openxmlformats-package.relationships+xml"),e.writeEndElement(),e.writeStartElement("Default"),e.writeAttributeString("Extension","xml"),e.writeAttributeString("ContentType","application/xml"),e.writeEndElement(),e.writeStartElement("Default"),e.writeAttributeString("Extension","jpeg"),e.writeAttributeString("ContentType","image/jpeg"),e.writeEndElement(),e.writeStartElement("Default"),e.writeAttributeString("Extension","emf"),e.writeAttributeString("ContentType","image/x-emf"),e.writeEndElement(),e.writeStartElement("Default"),e.writeAttributeString("Extension","rtf"),e.writeAttributeString("ContentType","application/rtf"),e.writeEndElement(),e.writeStartElement("Default"),e.writeAttributeString("Extension","png"),e.writeAttributeString("ContentType","image/png"),e.writeEndElement(),e.writeStartElement("Override"),e.writeAttributeString("PartName","/docProps/app.xml"),e.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.extended-properties+xml"),e.writeEndElement(),e.writeStartElement("Override"),e.writeAttributeString("PartName","/docProps/core.xml"),e.writeAttributeString("ContentType","application/vnd.openxmlformats-package.core-properties+xml"),e.writeEndElement(),e.writeStartElement("Override"),e.writeAttributeString("PartName","/word/document.xml"),e.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"),e.writeEndElement(),e.writeStartElement("Override"),e.writeAttributeString("PartName","/word/styles.xml"),e.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"),e.writeEndElement(),e.writeStartElement("Override"),e.writeAttributeString("PartName","/word/settings.xml"),e.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"),e.writeEndElement(),e.writeStartElement("Override"),e.writeAttributeString("PartName","/word/webSettings.xml"),e.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml"),e.writeEndElement(),e.writeStartElement("Override"),e.writeAttributeString("PartName","/word/fontTable.xml"),e.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"),e.writeEndElement(),e.writeStartElement("Override"),e.writeAttributeString("PartName","/word/footnotes.xml"),e.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml"),e.writeEndElement(),e.writeStartElement("Override"),e.writeAttributeString("PartName","/word/endnotes.xml"),e.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml"),e.writeEndElement();for(let t=0;t<this.headersData.length;t++)null!=this.footersData[t]&&(e.writeStartElement("Override"),e.writeAttributeString("PartName",StiString.format("/word/footer{0}.xml",t+1)),e.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml"),e.writeEndElement()),null!=this.headersData[t]&&(e.writeStartElement("Override"),e.writeAttributeString("PartName",StiString.format("/word/header{0}.xml",t+1)),e.writeAttributeString("ContentType","application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml"),e.writeEndElement());return e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeMainRels(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);return e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),e.writeStartElement("Relationships"),e.writeAttributeString("xmlns","http://schemas.openxmlformats.org/package/2006/relationships"),e.writeStartElement("Relationship"),e.writeAttributeString("Id","rId1"),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"),e.writeAttributeString("Target","word/document.xml"),e.writeEndElement(),e.writeStartElement("Relationship"),e.writeAttributeString("Id","rId2"),e.writeAttributeString("Type","http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties"),e.writeAttributeString("Target","docProps/core.xml"),e.writeEndElement(),e.writeStartElement("Relationship"),e.writeAttributeString("Id","rId3"),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties"),e.writeAttributeString("Target","docProps/app.xml"),e.writeEndElement(),e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeDocPropsApp(){let t,e=new MemoryStream,i=new XmlTextWriter(Encoding.UTF8,e);return i.indentation=this.xmlIndentation<0?0:this.xmlIndentation,i.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,i.writeStartDocument(),i.writeStartElement("Properties"),i.writeAttributeString("xmlns","http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"),i.writeAttributeString("xmlns:vt","http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"),i.writeElementString("Application",__.c.StiExportUtils.getReportVersion(this.report)),i.writeElementString("Company",null!=(t=this.docCompanyString)?t:""),i.writeElementString("Template","Normal.dotm"),i.writeElementString("TotalTime","0"),i.writeElementString("Pages","1"),i.writeElementString("Words","1"),i.writeElementString("Characters","1"),i.writeElementString("DocSecurity",this.restrictEditing==__.c.StiWordRestrictEditing.No?"0":"8"),i.writeElementString("Lines","1"),i.writeElementString("Paragraphs","1"),i.writeElementString("ScaleCrop","false"),i.writeElementString("LinksUpToDate","false"),i.writeElementString("CharactersWithSpaces","1"),i.writeElementString("SharedDoc","false"),i.writeElementString("HyperlinksChanged","false"),i.writeElementString("AppVersion","12.0000"),i.writeFullEndElement(),i.writeEndDocument(),i.flush(),e}writeDocPropsCore(){let t,e,i,r,n=new MemoryStream,a=new XmlTextWriter(Encoding.UTF8,n),o=(a.indentation=this.xmlIndentation<0?0:this.xmlIndentation,a.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,a.writeStartDocument(),a.writeStartElement("cp:coreProperties"),a.writeAttributeString("xmlns:cp","http://schemas.openxmlformats.org/package/2006/metadata/core-properties"),a.writeAttributeString("xmlns:dc","http://purl.org/dc/elements/1.1/"),a.writeAttributeString("xmlns:dcterms","http://purl.org/dc/terms/"),a.writeAttributeString("xmlns:dcmitype","http://purl.org/dc/dcmitype/"),a.writeAttributeString("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance"),StiString.format("{0}{1}",DateTime.now.toString("yyyy-MM-dd"),DateTime.now.toString("THH:mm:ssZ")));return a.writeElementString("dc:title",null!=(t=this.report.reportName)?t:""),a.writeElementString("dc:subject",null!=(e=this.report.reportAlias)?e:""),a.writeElementString("dc:creator",null!=(i=this.report.reportAuthor)?i:""),a.writeElementString("cp:keywords",""),a.writeElementString("dc:description",null!=(r=this.report.reportDescription)?r:""),null!=this.docLastModifiedString&&a.writeElementString("cp:lastModifiedBy",this.docLastModifiedString),a.writeElementString("cp:revision","1"),a.writeStartElement("dcterms:created"),a.writeAttributeString("xsi:type","dcterms:W3CDTF"),a.writeString(o),a.writeEndElement(),a.writeStartElement("dcterms:modified"),a.writeAttributeString("xsi:type","dcterms:W3CDTF"),a.writeString(o),a.writeEndElement(),a.writeElementString("cp:contentStatus",Stimulsoft.StiVersion.platform()),a.writeFullEndElement(),a.writeEndDocument(),a.flush(),n}writeSettings(t){let e=new MemoryStream,i=new XmlTextWriter(Encoding.UTF8,e),r=(i.indentation=this.xmlIndentation<0?0:this.xmlIndentation,i.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,i.writeStartDocument(),i.writeStartElement("w:settings"),i.writeAttributeString("xmlns:o","urn:schemas-microsoft-com:office:office"),i.writeAttributeString("xmlns:r","http://schemas.openxmlformats.org/officeDocument/2006/relationships"),i.writeAttributeString("xmlns:m","http://schemas.openxmlformats.org/officeDocument/2006/math"),i.writeAttributeString("xmlns:v","urn:schemas-microsoft-com:vml"),i.writeAttributeString("xmlns:w10","urn:schemas-microsoft-com:office:word"),i.writeAttributeString("xmlns:w","http://schemas.openxmlformats.org/wordprocessingml/2006/main"),i.writeAttributeString("xmlns:sl","http://schemas.openxmlformats.org/schemaLibrary/2006/main"),this.restrictEditing!=__.c.StiWordRestrictEditing.No&&this.generateDocumentProtection(i,this.protectionPassword),i.writeStartElement("w:zoom"),i.writeAttributeString("w:percent","100"),i.writeEndElement(),this.getPagesBackColor(t));return r.equals(Color.white)||0==r.a||(i.writeStartElement("w:displayBackgroundShape"),i.writeEndElement()),i.writeStartElement("w:proofState"),i.writeAttributeString("w:spelling","clean"),i.writeAttributeString("w:grammar","clean"),i.writeEndElement(),i.writeStartElement("w:defaultTabStop"),i.writeAttributeString("w:val","708"),i.writeEndElement(),i.writeStartElement("w:characterSpacingControl"),i.writeAttributeString("w:val","doNotCompress"),i.writeEndElement(),this.usePageHeadersAndFooters&&(i.writeStartElement("w:footnotePr"),i.writeStartElement("w:footnote"),i.writeAttributeString("w:id","0"),i.writeEndElement(),i.writeStartElement("w:footnote"),i.writeAttributeString("w:id","1"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("w:endnotePr"),i.writeStartElement("w:endnote"),i.writeAttributeString("w:id","0"),i.writeEndElement(),i.writeStartElement("w:endnote"),i.writeAttributeString("w:id","1"),i.writeEndElement(),i.writeEndElement()),i.writeStartElement("w:compat"),12<Stimulsoft.StiOptions.Export.Word.compatibilityModeValue&&(i.writeStartElement("w:compatSetting"),i.writeAttributeString("w:name","compatibilityMode"),i.writeAttributeString("w:uri","http://schemas.microsoft.com/office/word"),i.writeAttributeString("w:val",Stimulsoft.StiOptions.Export.Word.compatibilityModeValue.toString()),i.writeEndElement()),i.writeEndElement(),i.writeStartElement("m:mathPr"),i.writeStartElement("m:mathFont"),i.writeAttributeString("m:val","Cambria Math"),i.writeEndElement(),i.writeStartElement("m:brkBin"),i.writeAttributeString("m:val","before"),i.writeEndElement(),i.writeStartElement("m:brkBinSub"),i.writeAttributeString("m:val","--"),i.writeEndElement(),i.writeStartElement("m:smallFrac"),i.writeAttributeString("m:val","off"),i.writeEndElement(),i.writeStartElement("m:dispDef"),i.writeEndElement(),i.writeStartElement("m:lMargin"),i.writeAttributeString("m:val","0"),i.writeEndElement(),i.writeStartElement("m:rMargin"),i.writeAttributeString("m:val","0"),i.writeEndElement(),i.writeStartElement("m:defJc"),i.writeAttributeString("m:val","centerGroup"),i.writeEndElement(),i.writeStartElement("m:wrapIndent"),i.writeAttributeString("m:val","1440"),i.writeEndElement(),i.writeStartElement("m:intLim"),i.writeAttributeString("m:val","subSup"),i.writeEndElement(),i.writeStartElement("m:naryLim"),i.writeAttributeString("m:val","undOvr"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("w:themeFontLang"),i.writeAttributeString("w:val","en-EN"),i.writeEndElement(),i.writeStartElement("w:clrSchemeMapping"),i.writeAttributeString("w:bg1","light1"),i.writeAttributeString("w:t1","dark1"),i.writeAttributeString("w:bg2","light2"),i.writeAttributeString("w:t2","dark2"),i.writeAttributeString("w:accent1","accent1"),i.writeAttributeString("w:accent2","accent2"),i.writeAttributeString("w:accent3","accent3"),i.writeAttributeString("w:accent4","accent4"),i.writeAttributeString("w:accent5","accent5"),i.writeAttributeString("w:accent6","accent6"),i.writeAttributeString("w:hyperlink","hyperlink"),i.writeAttributeString("w:followedHyperlink","followedHyperlink"),i.writeEndElement(),i.writeStartElement("w:shapeDefaults"),i.writeStartElement("o:shapedefaults"),i.writeAttributeString("v:ext","edit"),i.writeAttributeString("spidmax","2050"),i.writeEndElement(),i.writeStartElement("o:shapelayout"),i.writeAttributeString("v:ext","edit"),i.writeStartElement("o:idmap"),i.writeAttributeString("v:ext","edit"),i.writeAttributeString("data","1"),i.writeEndElement(),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("w:decimalSymbol"),i.writeAttributeString("w:val",","),i.writeEndElement(),i.writeStartElement("w:listSeparator"),i.writeAttributeString("w:val",";"),i.writeEndElement(),i.writeFullEndElement(),i.writeEndDocument(),i.flush(),e}writeWebSettings(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);return e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),e.writeStartElement("w:webSettings"),e.writeAttributeString("xmlns:r","http://schemas.openxmlformats.org/officeDocument/2006/relationships"),e.writeAttributeString("xmlns:w","http://schemas.openxmlformats.org/wordprocessingml/2006/main"),e.writeStartElement("w:optimizeForBrowser"),e.writeEndElement(),e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeFontTable(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),e.writeStartElement("w:fonts"),e.writeAttributeString("xmlns:r","http://schemas.openxmlformats.org/officeDocument/2006/relationships"),e.writeAttributeString("xmlns:w","http://schemas.openxmlformats.org/wordprocessingml/2006/main"),this.fontList.set("Calibri","Calibri"),this.fontList.set("Cambria","Cambria");for(let t of this.fontList.values)e.writeStartElement("w:font"),e.writeAttributeString("w:name",t),e.writeFullEndElement();return e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeDocumentRels(){let t=new MemoryStream,e=new XmlTextWriter(Encoding.UTF8,t);e.indentation=this.xmlIndentation<0?0:this.xmlIndentation,e.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,e.writeStartDocument(),e.writeStartElement("Relationships"),e.writeAttributeString("xmlns","http://schemas.openxmlformats.org/package/2006/relationships"),e.writeStartElement("Relationship"),e.writeAttributeString("Id","rId1"),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"),e.writeAttributeString("Target","styles.xml"),e.writeEndElement(),e.writeStartElement("Relationship"),e.writeAttributeString("Id","rId2"),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings"),e.writeAttributeString("Target","settings.xml"),e.writeEndElement(),e.writeStartElement("Relationship"),e.writeAttributeString("Id","rId3"),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings"),e.writeAttributeString("Target","webSettings.xml"),e.writeEndElement(),e.writeStartElement("Relationship"),e.writeAttributeString("Id","rId4"),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable"),e.writeAttributeString("Target","fontTable.xml"),e.writeEndElement();for(let t=0;t<this.imageCache.imagePackedStore.length;t++)e.writeStartElement("Relationship"),e.writeAttributeString("Id",`rId`+(5+t)),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"),e.writeAttributeString("Target",StiString.format("media/image{0:D5}.{1}",t+1,__.d.StiOfficeImageFormatHelper.getImageFormatExtension(this.imageCache.imageFormatStore[t]))),e.writeEndElement();e.writeStartElement("Relationship"),e.writeAttributeString("Id",StiString.format("rId{0}",5+this.imageCache.imagePackedStore.length+0)),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes"),e.writeAttributeString("Target","footnotes.xml"),e.writeEndElement(),e.writeStartElement("Relationship"),e.writeAttributeString("Id",StiString.format("rId{0}",5+this.imageCache.imagePackedStore.length+1)),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes"),e.writeAttributeString("Target","endnotes.xml"),e.writeEndElement();for(let t=0;t<this.headersData.length;t++)null!=this.headersData[t]&&(e.writeStartElement("Relationship"),e.writeAttributeString("Id",StiString.format("rIdh{0}",t+1)),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/header"),e.writeAttributeString("Target",StiString.format("header{0}.xml",t+1)),e.writeEndElement()),null!=this.footersData[t]&&(e.writeStartElement("Relationship"),e.writeAttributeString("Id",StiString.format("rIdf{0}",t+1)),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer"),e.writeAttributeString("Target",StiString.format("footer{0}.xml",t+1)),e.writeEndElement());if(0<this.hyperlinkList.count)for(let t of this.hyperlinkList.keys)e.writeStartElement("Relationship"),e.writeAttributeString("Id",`hId`+StiMath.trunc(this.hyperlinkList.get(t))),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink"),e.writeAttributeString("Target",t),e.writeAttributeString("TargetMode","External"),e.writeEndElement();if(0<this.embedsList.length)for(let t=0;t<this.embedsList.length;t++)e.writeStartElement("Relationship"),e.writeAttributeString("Id",`reId`+(1+t)),e.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk"),e.writeAttributeString("Target",StiString.format("embeddings/richtext{0:D5}.rtf",t+1)),e.writeAttributeString("TargetMode","Internal"),e.writeEndElement();return e.writeFullEndElement(),e.writeEndDocument(),e.flush(),t}writeHeaderFooterRels(t){let e=new MemoryStream,i=new XmlTextWriter(Encoding.UTF8,e);i.indentation=this.xmlIndentation<0?0:this.xmlIndentation,i.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,i.writeStartDocument(),i.writeStartElement("Relationships"),i.writeAttributeString("xmlns","http://schemas.openxmlformats.org/package/2006/relationships");for(let t=0;t<this.imageCache.imagePackedStore.length;t++)i.writeStartElement("Relationship"),i.writeAttributeString("Id",`rId`+(5+t)),i.writeAttributeString("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"),i.writeAttributeString("Target",StiString.format("media/image{0:D5}.{1}",t+1,__.d.StiOfficeImageFormatHelper.getImageFormatExtension(this.imageCache.imageFormatStore[t]))),i.writeEndElement();return i.writeFullEndElement(),i.writeEndDocument(),i.flush(),e}writeStyles(){let t=new MemoryStream,i=new XmlTextWriter(Encoding.UTF8,t);i.indentation=this.xmlIndentation<0?0:this.xmlIndentation,i.formatting=this.xmlIndentation<0?Formatting.None:Formatting.Indented,i.writeStartDocument(),i.writeStartElement("w:styles"),i.writeAttributeString("xmlns:r","http://schemas.openxmlformats.org/officeDocument/2006/relationships"),i.writeAttributeString("xmlns:w","http://schemas.openxmlformats.org/wordprocessingml/2006/main"),i.writeStartElement("w:style"),i.writeAttributeString("w:type","paragraph"),i.writeAttributeString("w:default","1"),i.writeAttributeString("w:styleId","a"),i.writeStartElement("w:name"),i.writeAttributeString("w:val","Normal"),i.writeEndElement(),i.writeStartElement("w:qFormat"),i.writeEndElement(),i.writeStartElement("w:pPr"),i.writeStartElement("w:spacing"),i.writeAttributeString("w:after","0"),i.writeAttributeString("w:line","240"),i.writeAttributeString("w:lineRule","auto"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("w:rPr"),i.writeStartElement("w:sz"),i.writeAttributeString("w:val",StiMath.round2(2*Stimulsoft.StiOptions.Export.Word.normalStyleDefaultFontSize).toString()),i.writeEndElement(),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("w:style"),i.writeAttributeString("w:type","character"),i.writeAttributeString("w:default","1"),i.writeAttributeString("w:styleId","a0"),i.writeStartElement("w:name"),i.writeAttributeString("w:val","Default Paragraph Font"),i.writeEndElement(),i.writeStartElement("w:uiPriority"),i.writeAttributeString("w:val","1"),i.writeEndElement(),i.writeStartElement("w:semiHidden"),i.writeEndElement(),i.writeStartElement("w:unhideWhenUsed"),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("w:style"),i.writeAttributeString("w:type","table"),i.writeAttributeString("w:default","1"),i.writeAttributeString("w:styleId","a1"),i.writeStartElement("w:name"),i.writeAttributeString("w:val","Normal Table"),i.writeEndElement(),i.writeStartElement("w:uiPriority"),i.writeAttributeString("w:val","99"),i.writeEndElement(),i.writeStartElement("w:semiHidden"),i.writeEndElement(),i.writeStartElement("w:unhideWhenUsed"),i.writeEndElement(),i.writeStartElement("w:qFormat"),i.writeEndElement(),i.writeStartElement("w:tblPr"),i.writeStartElement("w:tblInd"),i.writeAttributeString("w:w","0"),i.writeAttributeString("w:type","dxa"),i.writeEndElement(),i.writeStartElement("w:tblCellMar"),i.writeStartElement("w:top"),i.writeAttributeString("w:w","0"),i.writeAttributeString("w:type","dxa"),i.writeEndElement(),i.writeStartElement("w:left"),i.writeAttributeString("w:w","0"),i.writeAttributeString("w:type","dxa"),i.writeEndElement(),i.writeStartElement("w:bottom"),i.writeAttributeString("w:w","0"),i.writeAttributeString("w:type","dxa"),i.writeEndElement(),i.writeStartElement("w:right"),i.writeAttributeString("w:w","0"),i.writeAttributeString("w:type","dxa"),i.writeEndElement(),i.writeEndElement(),i.writeEndElement(),i.writeEndElement(),i.writeStartElement("w:style"),i.writeAttributeString("w:type","numbering"),i.writeAttributeString("w:default","1"),i.writeAttributeString("w:styleId","a2"),i.writeStartElement("w:name"),i.writeAttributeString("w:val","No List"),i.writeEndElement(),i.writeStartElement("w:uiPriority"),i.writeAttributeString("w:val","99"),i.writeEndElement(),i.writeStartElement("w:semiHidden"),i.writeEndElement(),i.writeStartElement("w:unhideWhenUsed"),i.writeEndElement(),i.writeEndElement();for(let e=0;e<this.styleList.length;e++){let t=this.styleList[e];i.writeStartElement("w:style"),i.writeAttributeString("w:type","paragraph"),i.writeAttributeString("w:customStyle","1"),i.writeAttributeString("w:styleId",`Style`+e),i.writeStartElement("w:name"),i.writeAttributeString("w:val",t.name),i.writeEndElement(),i.writeStartElement("w:basedOn"),i.writeAttributeString("w:val","a"),i.writeEndElement(),i.writeStartElement("w:rPr"),i.writeStartElement("w:rFonts"),i.writeAttributeString("w:ascii",t.fontName),i.writeAttributeString("w:hAnsi",t.fontName),i.writeAttributeString("w:cs",t.fontName),i.writeEndElement(),t.bold&&(i.writeStartElement("w:b"),i.writeEndElement()),t.italic&&(i.writeStartElement("w:i"),i.writeEndElement()),t.underline&&(i.writeStartElement("w:u"),i.writeAttributeString("w:val","single"),i.writeEndElement()),i.writeStartElement("w:color"),i.writeAttributeString("w:val",this.getColorString(t.textColor)),i.writeEndElement(),i.writeStartElement("w:sz"),i.writeAttributeString("w:val",t.fontSize.toString()),i.writeEndElement(),0!=Stimulsoft.StiOptions.Export.Word.spaceBetweenCharacters&&(i.writeStartElement("w:spacing"),i.writeAttributeString("w:val",Stimulsoft.StiOptions.Export.Word.spaceBetweenCharacters.toString()),i.writeEndElement()),t.rightToLeft&&(t.bold&&(i.writeStartElement("w:bCs"),i.writeEndElement()),t.italic&&(i.writeStartElement("w:iCs"),i.writeEndElement()),i.writeStartElement("w:szCs"),i.writeAttributeString("w:val",t.fontSize.toString()),i.writeEndElement(),i.writeStartElement("w:rtl"),i.writeEndElement()),i.writeEndElement(),i.writeEndElement()}return i.writeFullEndElement(),i.writeEndDocument(),i.flush(),t}writeImage(t){let e=new MemoryStream,i=this.imageCache.imagePackedStore[t];return null!=i&&e.write(i,0,i.length),e}exportWord(a,o,t){if(null==Stimulsoft.Base[["St","iL","ic","en","se"].join("")].key&&console.warn("You are using a trial version of the Stimulsoft product!"),__.a.StiLogService.write(this[Stimulsoft.System.StiObject.stimulsoft]().getType(),"Export report to Word 2007 format"),null==t)throw new Error("The 'settings' argument cannot be equal in null.");let s=t.pageRange,l=(this.usePageHeadersAndFooters=t.usePageHeadersAndFooters,this.removeEmptySpaceAtBottom=t.removeEmptySpaceAtBottom,this.imageResolution=t.imageResolution,this.imageQuality=t.imageQuality,this.imageFormat=t.imageFormat,this.docCompanyString=t.companyString,this.docLastModifiedString=t.lastModifiedString,this.restrictEditing=t.restrictEditing,this.protectionPassword=t.protectionPassword,t.encryptionPassword),e=(this.xmlIndentation=-1,this.imageQuality<0&&(this.imageQuality=0),1<this.imageQuality&&(this.imageQuality=1),this.imageResolution<10&&(this.imageResolution=10),this.imageResolution=this.imageResolution/100,1!=Stimulsoft.StiOptions.Export.Word.lineSpacing&&(this.lineSpace=StiMath.round2(240*Stimulsoft.StiOptions.Export.Word.lineSpacing).toString(),this.lineSpace2=StiMath.round2(.772*Stimulsoft.StiOptions.Export.Word.lineSpacing*240).toString()),Stimulsoft.StiOptions.Export.Word.restrictEditing>this.restrictEditing&&(this.restrictEditing=Stimulsoft.StiOptions.Export.Word.restrictEditing),this.report=a,CultureInfo.currentCulture);try{CultureInfo.currentCulture=this.englishCulture,this.styleList=[],this.fontList=new Hashtable,this.bookmarkList=new Hashtable,this.hyperlinkList=new Hashtable,this.embedsList=[],null!=this.exportCache?this.imageCache=this.exportCache.imageCache:this.imageCache=new __.a.StiImageCache(Stimulsoft.StiOptions.Export.Word.allowImageComparer,!0,this.imageFormat,this.imageQuality,!1),this.currentPassNumber=0,this.maximumPassNumber=3+(Stimulsoft.StiOptions.Export.Word.divideSegmentPages?1:0);let e=!1,i=s.getSelectedPages(a.renderedPages);if(Stimulsoft.StiOptions.Export.Word.divideSegmentPages){let t=!0;if(t=this.usePageHeadersAndFooters&&0<i.count&&i.getByIndex(0).unlimitedHeight&&1==i.getByIndex(0).segmentPerWidth?!1:t){let t=__.c.StiSegmentPagesDivider.divide(i,this,this.exportCache);i!=t&&(e=!0),i=t,this.currentPassNumber++}}let r=new StiZipWriter20,t=null,n=(StiString.isNullOrWhiteSpace(l)?r.begin(o,!0):(t=new MemoryStream,r.begin(t,!0)),this.headersData=[],this.headersRels=[],this.footersData=[],this.footersRels=[],this.hasHeader=!1,this.hasFooter=!1,this.additionalIndex=0,this.spriteIndex=75,!(Stimulsoft.Base.FslAA.wtLiI.aYwiY()||Stimulsoft.Base.FslAA.wtLiI.dSiYV()||this.usePageHeadersAndFooters||(Stimulsoft.Base.FslAA.wtLiI.DKlzG()||Stimulsoft.Base.FslAA.wtLiI.hatRb()||Stimulsoft.Base.FslAA.wtLiI.kqAKB())&&Stimulsoft.System.NodeJs.isStandaloneVersion));r.addFile("word/document.xml",this.writeDocument(i,a,e,n),!0);for(let t=0;t<this.headersData.length;t++)null!=this.headersData[t]&&r.addFile(StiString.format("word/header{0}.xml",t+1),this.headersData[t]),null!=this.headersRels[t]&&r.addFile(StiString.format("word/_rels/header{0}.xml.rels",t+1),this.headersRels[t]),null!=this.footersData[t]&&r.addFile(StiString.format("word/footer{0}.xml",t+1),this.footersData[t]),null!=this.footersRels[t]&&r.addFile(StiString.format("word/_rels/footer{0}.xml.rels",t+1),this.footersRels[t]);if(r.addFile("word/footnotes.xml",this.writeFootNotes()),r.addFile("word/endnotes.xml",this.writeEndNotes()),r.addFile("[Content_Types].xml",this.writeContentTypes()),r.addFile("_rels/.rels",this.writeMainRels()),r.addFile("docProps/app.xml",this.writeDocPropsApp()),r.addFile("docProps/core.xml",this.writeDocPropsCore()),r.addFile("word/settings.xml",this.writeSettings(i)),r.addFile("word/webSettings.xml",this.writeWebSettings()),r.addFile("word/fontTable.xml",this.writeFontTable()),r.addFile("word/_rels/document.xml.rels",this.writeDocumentRels()),r.addFile("word/styles.xml",this.writeStyles()),0<this.imageCache.imagePackedStore.length)for(let t=0;t<this.imageCache.imagePackedStore.length;t++)r.addFile(StiString.format("word/media/image{0:D5}.{1}",t+1,__.d.StiOfficeImageFormatHelper.getImageFormatExtension(this.imageCache.imageFormatStore[t])),this.writeImage(t));r.end(),StiString.isNullOrWhiteSpace(l)||(t.flush(),StiOfficeEncryptedPackageHelper.EncryptPackage(t.toArray(),l,o),t.close())}finally{CultureInfo.currentCulture=e,null!=this.matrix&&(this.matrix.clear(),this.matrix=null),this.fontList.clear(),this.fontList=null,this.imageCache.clear(),this.imageCache=null,this.styleList[Stimulsoft.System.StiObject.stimulsoft]().clear(),this.styleList=null,this.bookmarkList.clear(),this.bookmarkList=null,this.hyperlinkList.clear(),this.hyperlinkList=null,this.embedsList[Stimulsoft.System.StiObject.stimulsoft]().clear(),this.embedsList=null,this.usePageHeadersAndFooters&&(this.headersData[Stimulsoft.System.StiObject.stimulsoft]().clear(),this.headersData=null,this.headersRels[Stimulsoft.System.StiObject.stimulsoft]().clear(),this.headersRels=null,this.footersData[Stimulsoft.System.StiObject.stimulsoft]().clear(),this.footersData=null,this.footersRels[Stimulsoft.System.StiObject.stimulsoft]().clear(),this.footersRels=null),a.renderedPages.cacheMode&&__.c.StiMatrix.GCCollect()}}}PR.fontsToCorrectHeight=null,__.c.StiWordExportService=PR,__.c.StiWord2007ExportService=class extends PR{}}let Point=Stimulsoft.System.Drawing.Point;{class yZ{static convertArcToCubicBezier(t,e,i,r){let n=i*this.PiDiv180,a=r*this.PiDiv180,o=n+a,s=t.x+e*Math.cos(n),l=t.y+e*Math.sin(n),m=t.x+e*Math.cos(o),h=t.y+e*Math.sin(o),c=e*this.FourDivThree*Math.tan(.25*a),g=Math.atan(c/e),S=e/Math.cos(g),p=(g+=n,t.x+S*Math.cos(g)),d=t.y+S*Math.sin(g),u=(g=Math.atan(-c/e),g+=o,t.x+S*Math.cos(g)),w=t.y+S*Math.sin(g),f=[];return f.push(new Point(s,l)),f.push(new Point(p,d)),f.push(new Point(u,w)),f.push(new Point(m,h)),f}static convertArcToCubicBezier2(t,e,i,r,n){let a=r*this.PiDiv180,o=n*this.PiDiv180,s=a+o,l=t.x+e*Math.cos(a),m=t.y+e*Math.sin(a),h=t.x+i*Math.cos(s),c=t.y+i*Math.sin(s),g=(e-i)/3,S=(i+=g,(e-=g)*this.FourDivThree*Math.tan(.25*o)),p=Math.atan(S/e),d=e/Math.cos(p),u=(p+=a,t.x+d*Math.cos(p)),w=t.y+d*Math.sin(p),f=(p=Math.atan(-S/e),p+=s,t.x+d*Math.cos(p)),b=t.y+d*Math.sin(p),E=[];return E.push(new Point(l,m)),E.push(new Point(u,w)),E.push(new Point(f,b)),E.push(new Point(h,c)),E}}yZ.PiDiv180=Math.PI/180,yZ.FourDivThree=4/3,__.c.StiGaugeDrawingHelper=yZ}let StiCornerRadius=Stimulsoft.Base.Drawing.StiCornerRadius,StiTableCell=__.a.Components.Table.StiTableCell,StiPrimitive=__.a.Components.StiPrimitive,StiMargins=__.a.Components.StiMargins,StiSignatureFontsHelper=Stimulsoft.Base.StiSignatureFontsHelper,StiSolidBrush=Stimulsoft.Base.Drawing.StiSolidBrush,StiImageConverter=Stimulsoft.Base.Drawing.StiImageConverter,StiSignatureMode=__.a.Components.StiSignatureMode,StiElectronicSignature=__.a.Components.StiElectronicSignature,StiPdfDigitalSignature=__.a.Components.StiPdfDigitalSignature,IStiGauge=__.a.Components.Gauge.IStiGauge,StiHtmlTextRender=__.a.Components.StiHtmlTextRender,StiPdfEmbeddedFileData=__.c.StiPdfEmbeddedFileData,StiSparkline=__.a.Components.StiSparkline,StiColorUtils=Stimulsoft.Base.Drawing.StiColorUtils,StiDataBarIndicator=__.a.Components.StiDataBarIndicator,StiIconSetHelper=__.a.Components.StiIconSetHelper,StiIcon=__.a.Components.StiIcon,StiIconSetIndicator=__.a.Components.StiIconSetIndicator,StiBookmarksCollection=__.a.Components.StiBookmarksCollection,StiBookmark=__.a.Components.StiBookmark,StiHtmlTag=Stimulsoft.Base.Drawing.StiHtmlTag,StiLinearGradientBrush=Stimulsoft.Base.Drawing.StiLinearGradientBrush,StiGlareBrush=Stimulsoft.Base.Drawing.StiGlareBrush,StiHatchBrush=Stimulsoft.Base.Drawing.StiHatchBrush,StiGlassBrush=Stimulsoft.Base.Drawing.StiGlassBrush,StiPage=__.a.Components.StiPage,IStiChart=__.a.Chart.IStiChart,StiBarCode=__.a.BarCodes.StiBarCode,Matrix=Stimulsoft.System.Drawing.Drawing2D.Matrix,StiResourceType=__.a.Dictionary.StiResourceType,StiDataBarTextPlacement=__.a.Components.StiDataBarTextPlacement;{let F=Stimulsoft.System.Drawing.Rectangle;class m${get Right(){return this.X+this.Width}get Top(){return this.Y+this.Height}clone(){let t=new m$(this.service);return t.X=this.X,t.Y=this.Y,t.Width=this.Width,t.Height=this.Height,t.Component=this.Component,t}constructor(t){this.X=0,this.Y=0,this.Width=0,this.Height=0,this.Component=null,this.service=null,this.service=t}}__.c.StiPdfData=m$;class n${}__.c.StiImageData=n$;class o${}__.c.StiShadingData=o$;class p${}__.c.StiShadingFunctionData=p$;class q${constructor(){this.FontColor=Color.black}}__.c.StiEditableObject=q$;class r${}__.c.StiLinkObject=r$;class s${}class t$ extends __.c.StiExportService{constructor(){super(...arguments),this.multipleFiles=!1,this.imageQuality=.75,this.imageResolutionMain=1,this.imageResolutionMode=__.c.StiImageResolutionMode.Auto,this.sw=null,this.pageStream=null,this.imageList=null,this.imageCache=null,this.exportCache=null,this.imageInterpolationTable=null,this.imageCacheIndexToList=null,this.imageInfoList=null,this.imageInfoCounter=0,this.colorTable=StiArray.create(String,256),this.alphaTable=StiArray.create(Boolean,256),this.pdfFont=null,this.standardPdfFonts=!0,this.embeddedFonts=!1,this.useUnicodeMode=!1,this.reduceFontSize=!0,this.compressed=!1,this.compressedFonts=!1,this.encrypted=!1,this.usePdfA=!1,this.pdfComplianceMode=__.c.StiPdfComplianceMode.None,this.exportRtfTextAsImage=!1,this.autoPrint=__.c.StiPdfAutoPrintMode.None,this.imageCompressionMethod=__.c.StiPdfImageCompressionMethod.Jpeg,this.imageFormat=__.c.StiImageFormat.Color,this.monochromeDitheringType=__.c.StiMonochromeDitheringType.FloydSteinberg,this.allowEditable=__.c.StiPdfAllowEditable.No,this.useTransparency=!0,this.embeddedFiles=null,this.zugferdComplianceMode=__.c.StiPdfZUGFeRDComplianceMode.None,this.zugferdConformanceLevel="BASIC",this.fontGlyphsReduceNotNeed=null,this.bookmarksTree=null,this.bookmarksTreeTemp=null,this.linksArray=null,this.tagsArray=null,this.tooltipsArray=null,this.shadingArray=null,this.hatchArray=null,this.shadingFunctionArray=null,this.haveBookmarks=!1,this.haveLinks=!1,this.haveAnnots=!1,this.haveTooltips=!1,this.CodePage1252part80AF=[8364,8226,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,8226,381,8226,8226,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,8226,382,376],this.CodePage1252=StiArray.create(Number,256),this.hiToTwips=.72,this.precision_digits_font=3,this.pdfCKT=.55228,this.IDValue=null,this.IDValueString="",this.IDValueStringMeta="",this.currentDateTime="",this.currentDateTimeMeta="",this.producerName="Stimulsoft Reports",this.creatorName="",this.keywords="",this.keyLength=__.c.StiPdfEncryptionKeyLength.Bit40,this.lastColorStrokeA=255,this.lastColorNonStrokeA=255,this.colorStack=null,this.info=null,this.haveDigitalSignature=!1,this.pdfSecurity=null,this.tempGeomWriter=null,this.lastProcessedComponent=null,this.colorHash1=new Hashtable,this.colorHash2=new Hashtable,this._gsTable=null}implements(){let t=[__.c.IStiPdfExportService];return(this.implements=()=>t)()}get exportFormat(){return __.a.StiExportFormat.Pdf}exportTo(i,t,r){if(null==this.exportCache){let t=r,e=t.imageCompressionMethod==__.c.StiPdfImageCompressionMethod.Jpeg?__.a.ImageFormat.Jpeg:__.a.ImageFormat.MemoryBmp;this.exportCache=new __.c.StiExportImageCache(e,!0,new __.a.StiImageCache(Stimulsoft.StiOptions.Export.Pdf.allowImageComparer,!0,e,t.imageQuality),Math.max(t.imageResolution,10)/100,i)}this.exportPdf1(i,t,r)}exportToAsync(r,n,a,o){setTimeout(async()=>{var i;try{let t=o,e=t.imageCompressionMethod==__.c.StiPdfImageCompressionMethod.Jpeg?__.a.ImageFormat.Jpeg:__.a.ImageFormat.MemoryBmp;if(this.exportCache=new __.c.StiExportImageCache(e,!0,new __.a.StiImageCache(Stimulsoft.StiOptions.Export.Pdf.allowImageComparer,!0,e,t.imageQuality),Math.max(t.imageResolution,10)/100,n),await __.c.StiExportImageHelper.convertAllImages(n,Stimulsoft.System.Drawing.Imaging.ImageFormat.Jpeg,!0,this.exportFormat,this.exportCache),!n.isDocument&&null!=(i=n.getCurrentPage())&&i.is(IStiDashboard))return await StiDashboardExport.export(n,a,o),void r();this.exportTo(n,a,o),await __.c.StiExportImageHelper.restoreImagesWithMask(n),null!=n&&null!=n.preparedExportImages&&(n.preparedExportImages.clear(),n.preparedExportImages=null)}catch(t){if(Exception.log(t,n,`Export Error`).isImportant)return r(Exception.getMessage(t))}r()},0)}stringReplace(t,e,i){e=e.replace(t$.regexEscape,"\\$1");let r=new RegExp(e,"g");return t.replace(r,i)}getHatchNumber(i){if(0<this.hatchArray.length)for(let e=0;e<this.hatchArray.length;e++){let t=this.hatchArray[e];if(i.style==t.style&&i.backColor.equals(t.backColor)&&i.foreColor.equals(t.foreColor))return e}return this.hatchArray.push(i),this.hatchArray.length-1}getShadingFunctionNumber(i){if(0<this.shadingFunctionArray.length)for(let e=0;e<this.shadingFunctionArray.length;e++){let t=this.shadingFunctionArray[e];if(this.isColorArraysEquals(t.Colors,i))return e}let t=new p$;return t.Colors=i,this.shadingFunctionArray.push(t),this.shadingFunctionArray.length-1}isColorArraysEquals(e,i){if(e.length!=i.length)return!1;for(let t=0;t<e.length;t++)if(!e[t].equals(i[t]))return!1;return!0}addXref(t){let e=this.sw.position;this.xref[t]=e.toString()[Stimulsoft.System.StiObject.stimulsoft]().padLeft(10,"0")+" 00000 n",this.currentObjectNumber=t,this.currentGenerationNumber=0}convertToString(t,e=2){let i=StiMath.round2(t,e);return i.toString().split(",").join(Stimulsoft.System.Globalization.CultureInfo.currentCulture.numberFormat.numberDecimalSeparator)}static convertToEscapeSequence(i){let r=[40,41,92,13,10,8,12],n="()\\rnbf",a,o;if(null==i)return"";o=new StringBuilder;for(let e=0;e<i.length;e++){a=!1;for(let t=0;t<r.length;t++)if(i.charCodeAt(e)==r[t]){o.append("\\"+n[t]),a=!0;break}a||o.append(i.charAt(e))}return o.toString()}static convertToEscapeSequencePlusTabs(i){let r=[40,41,92,13,10,9,8,12],n="()\\rntbf",a,o;if(null==i)return"";o="";for(let e=0;e<i.length;e++){a=!1;for(let t=0;t<r.length;t++)if(i.charCodeAt(e)==r[t]){o+="\\"+n[t],a=!0;break}a||(o+=i.charAt(e))}return o}setStrokeColor(t){let e=this.colorHash1.get(t),i=(null==e&&(e=StiString.format("{0} {1} {2} RG",this.colorTable[t.r],this.colorTable[t.g],this.colorTable[t.b]),this.colorHash1.set(t,e)),this.pageStream.writeLine(e),t.a);i!=this.lastColorStrokeA&&Stimulsoft.StiOptions.Export.Pdf.allowExtGState&&!this.usePdfA&&(this.pageStream.writeLine(this.gsTable[i][0]),this.lastColorStrokeA=i,this.alphaTable[i]=!0)}setNonStrokeColor(t){let e=this.colorHash2.get(t),i=(null==e&&(e=StiString.format("{0} {1} {2} rg",this.colorTable[t.r],this.colorTable[t.g],this.colorTable[t.b]),this.colorHash2.set(t,e)),this.pageStream.writeLine(e),t.a);i!=this.lastColorNonStrokeA&&Stimulsoft.StiOptions.Export.Pdf.allowExtGState&&!this.usePdfA&&(this.pageStream.writeLine(this.gsTable[i][1]),this.lastColorNonStrokeA=i,this.alphaTable[i]=!0)}get gsTable(){if(null==this._gsTable){this._gsTable=StiArray.create2(String,256,2);for(let t=0;t<256;t++)this._gsTable[t][0]=StiString.format("/GS{0:X2}S gs",t),this._gsTable[t][1]=StiString.format("/GS{0:X2}N gs",t)}return this._gsTable}pushColorToStack(){this.colorStack.push(this.lastColorStrokeA),this.colorStack.push(this.lastColorNonStrokeA)}popColorFromStack(){this.lastColorNonStrokeA=this.colorStack.pop(),this.lastColorStrokeA=this.colorStack.pop()}fillRectBrush(e,i,r=null){let n=StiBrush.toColor(e);if(this.setNonStrokeColor(n),this.storeShadingData2(i.x,i.y,i.width,i.height,e),(e.is(StiGradientBrush)||e.is(StiGlareBrush)||e.is(StiLinearGradientBrush))&&this.pageStream.writeLine1("/Pattern cs /P{0} scn",1+this.shadingCurrent),e.is(StiHatchBrush)){let t=e;this.pageStream.writeLine1("/Cs1 cs /PH{0} scn",this.getHatchNumber(t)+1)}if(e.is(StiGlassBrush)){let t=e;this.setNonStrokeColor(t.getTopColor()),null==r?this.pageStream.writeLine(this.tempGeomWriter.getRectString4(i.x,i.y+i.height/2,i.width,i.height/2)+"f"):this.pageStream.writeLine(this.tempGeomWriter.getRectWithCornersString(new F(i.x,i.y+i.height/2,i.width,i.height/2),new StiCornerRadius(r.bottomLeft,r.bottomRight,0,0))+"f"),this.setNonStrokeColor(t.getBottomColor()),null==r?this.pageStream.writeLine(this.tempGeomWriter.getRectString4(i.x,i.y,i.width,i.height/2)+"f"):this.pageStream.writeLine(this.tempGeomWriter.getRectWithCornersString(new F(i.x,i.y,i.width,i.height/2),new StiCornerRadius(0,0,r.topRight,r.topLeft))+"f"),n=Color.transparent}if(0!=n.a){let t=null==r?null:new StiCornerRadius(r.bottomLeft,r.bottomRight,r.topRight,r.topLeft);this.pageStream.writeLine(this.tempGeomWriter.getRectWithCornersString(i,t)+"f")}}storeStringLine(t,e,i=!1){let r=t+this.convertToHexString(e,i);this.storeString(r),this.sw.writeLine()}storeString(e){let i=[];for(let t=0;t<e.length;t++)i.push(e.charCodeAt(t));this.sw.write(i)}convertToHexString(a,t,e=!1){let o="";if(StiString.isNullOrEmpty(a))if(this.encrypted){let e=this.pdfSecurity.encryptData([],this.currentObjectNumber,this.currentGenerationNumber),i="";for(let t=0;t<e.length;t++)i+=String.fromCharCode(e[t]);o+="("+t$.convertToEscapeSequencePlusTabs(i)+")"}else o+="()";else{let n=e;for(let t=0;t<a.length;t++)127<a.charCodeAt(t)&&(n=!0);if(this.encrypted){let i=null;if(1==n){i=[];for(let e=0;e<a.length;e++){let t=a.charCodeAt(e);i[2+2*e+0]=t>>8&255,i[2+2*e+1]=255&t}i[0]=254,i[1]=255}else{i=[];for(let t=0;t<a.length;t++)i[t]=a.charCodeAt(t)}let e=this.pdfSecurity.encryptData(i,this.currentObjectNumber,this.currentGenerationNumber),r="";for(let t=0;t<e.length;t++)r+=String.fromCharCode(e[t]);o+="("+t$.convertToEscapeSequencePlusTabs(r)+")"}else if(1==n){o+="<FEFF";for(let t=0;t<a.length;t++)o+=StiString.format("{0:X4}",a.charCodeAt(t));o+=">"}else o+=t?"("+t$.convertToEscapeSequencePlusTabs(a)+")":"("+a+")"}return o}storeMemoryStream2(e,i){if(this.encrypted){let t=this.pdfSecurity.encryptData(e.toArray(),this.currentObjectNumber,this.currentGenerationNumber);this.sw.writeLine1(StiString.format(i,t.length)),this.sw.writeLine(">>"),this.sw.writeLine("stream"),this.sw.write(t,0,t.length)}else this.sw.writeLine1(StiString.format(i,e.length)),this.sw.writeLine(">>"),this.sw.writeLine("stream"),e.writeTo(this.sw);e.close()}storeMemoryStream3(e,t){let i=new MemoryStream;for(let t=0;t<e.length;t++)i.writeByte(e[t]);this.storeMemoryStream2(i,t),i.close()}storeMemoryStream4(e,t){let i=new MemoryStream;for(let t=0;t<e.length;t++)i.writeByte(e[t]);this.storeMemoryStream2(i,t),i.close()}storeWysiwygSymbols(t,a=-1){let e=[],o=[],i=t.text,s=t.rightToLeft;if(StiHtmlTextRender.drawTextForOutput(t,e,o),this.pdfFont.storeUnicodeSymbolsInMap(i),Stimulsoft.StiOptions.Export.Pdf.useProperCaseFontNamesFromHtml)for(let r of o){let e=r.fontName,i=!1;for(let t=0;t<e.length;t++)if(Char.isUpper(e,t)){i=!0;break}if(!i){let t=Stimulsoft.System.Globalization.CultureInfo.ivariantCulture.textInfo.toTitleCase(e),i=null;if(-1!=t.indexOf(",")){let e=t.split(",");for(let t of e)if((i=new Font(t,r.fontBase.size,r.fontBase.style)).name.toLowerCase()==t.toLowerCase())break}else i=new Font(t,r.fontBase.size,r.fontBase.style);r.fontBase=i,r.fontName=i.name}}for(let n of e){let t=o[n.fontIndex].fontBase,e=this.pdfFont.getFontNumber(t),i=(this.pdfFont.currentFont=e,new StringBuilder),r=(i.append(String.fromCharCode(65535)),__.c.StiBidirectionalConvert2.convertString(n.text,s));if(this.pdfFont.storeGlyphsInMap(i.toString()),this.pdfFont.storeUnicodeSymbolsInMap(r),-1!=a&&!StiString.isNullOrWhiteSpace(n.href)&&!n.href.trim().startsWith("javascript:")&&!this.usePdfA){let t=new r$;t.Link=n.href,t.Page=a,this.linksArray.push(t)}}}renderStartDoc(n,a){this.sw.writeLine("%PDF-1.7"),this.sw.write([37,226,227,207,211],0,5),this.sw.writeLine(),this.addXref(1),this.sw.writeLine("1 0 obj"),this.sw.writeLine("<<"),this.keyLength==__.c.StiPdfEncryptionKeyLength.Bit256_r5&&this.sw.writeLine("/Extensions<</ADBE<</BaseVersion/1.7/ExtensionLevel 3>>>>"),this.keyLength==__.c.StiPdfEncryptionKeyLength.Bit256_r6&&this.sw.writeLine("/Extensions<</ADBE<</BaseVersion/1.7/ExtensionLevel 8>>>>"),this.sw.writeLine("/Type /Catalog"),this.sw.writeLine1("/Pages {0} 0 R",this.info.pages.ref),this.sw.writeLine("/MarkInfo<</Marked true>>"),this.sw.writeLine1("/Metadata {0} 0 R",this.info.metadata.ref),this.sw.writeLine1("/OutputIntents {0} 0 R",this.info.outputIntents.ref),this.sw.writeLine1("/StructTreeRoot {0} 0 R",this.info.structTreeRoot.ref),this.haveBookmarks?(this.sw.writeLine1("/Outlines {0} 0 R",this.info.outlines.ref),this.sw.writeLine("/PageMode /UseOutlines")):this.sw.writeLine("/PageMode /UseNone"),t$.printScaling||(this.sw.writeLine("/ViewerPreferences"),this.sw.writeLine("<<"),this.sw.writeLine("/PrintScaling /None"),this.sw.writeLine(">>")),(this.haveAnnots||this.haveDigitalSignature)&&this.sw.writeLine1("/AcroForm {0} 0 R",this.info.acroForm.ref);let t=this.autoPrint!=__.c.StiPdfAutoPrintMode.None,e=0<this.info.embeddedFilesList.length;if(t||e){if(this.sw.writeLine("/Names <<"),t&&this.sw.writeLine1("/JavaScript {0} 0 R",this.info.embeddedJS.ref),e){this.sw.writeLine("/EmbeddedFiles <<"),this.sw.writeString("/Names [ ");for(let i=0;i<this.info.embeddedFilesList.length;i++){let t=this.embeddedFiles[i],e=StiString.format("{0} {1} 0 R ",this.convertToHexString(t.name,!0,!0),this.info.embeddedFilesList[i].ref);this.sw.writeString(e)}this.sw.writeLine("]"),this.sw.writeLine(">>")}this.sw.writeLine(">>")}if(this.zugferdComplianceMode!=__.c.StiPdfZUGFeRDComplianceMode.None||this.pdfComplianceMode==__.c.StiPdfComplianceMode.A3){this.sw.writeString("/AF [ ");for(let t=0;t<this.info.embeddedFilesList.length;t++)this.sw.writeString(StiString.format("{0} 0 R ",
9
+ this.info.embeddedFilesList[t].ref));this.sw.writeLine("]")}this.usePdfA||this.sw.writeLine1("/OCProperties << /OCGs [{0} 0 R] /D << /ON [{0} 0 R] /AS [<</Event /Print /OCGs [{0} 0 R] /Category [/Print]>>] >> >>",this.info.optionalContentGroup.ref),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(2),this.sw.writeLine("2 0 obj"),this.sw.writeLine("<<"),this.storeStringLine("/Producer ",this.producerName,!0),this.storeStringLine("/Creator ",this.creatorName,!0),StiString.isNullOrEmpty(n.reportAuthor)||this.storeStringLine("/Author ",n.reportAuthor,!0),StiString.isNullOrEmpty(n.reportAlias)||this.storeStringLine("/Subject ",n.reportAlias,!0),StiString.isNullOrEmpty(n.reportName)||this.storeStringLine("/Title ",n.reportName,!0),StiString.isNullOrEmpty(this.keywords)||this.storeStringLine("/Keywords ",this.keywords,!0),this.storeStringLine("/CreationDate ","D:"+this.currentDateTime),this.storeStringLine("/ModDate ","D:"+this.currentDateTime);for(let t of n.metaTags.list)t.name.startsWith("pdf:")&&this.storeStringLine(StiString.format("/{0} ",__.a.StiNameValidator.correctName(t.name.substr(4),!1)),t.tag);this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(3),this.sw.writeLine("3 0 obj"),this.sw.writeLine("<<"),this.sw.writeLine("/Cs1 [/Pattern /DeviceRGB]"),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(this.info.pages.ref),this.sw.writeLine1("{0} 0 obj",this.info.pages.ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /Pages"),this.sw.writeString("/Kids [ ");for(let t=0;t<a.count;t++)this.sw.writeString(StiString.format("{0} 0 R ",this.info.pageList[t].ref));if(this.sw.writeLine("]"),this.sw.writeLine1("/Count {0}",a.count),Stimulsoft.StiOptions.Export.Pdf.allowInheritedPageResources){let e=[];e.push("/Resources"),e.push("<<"),e.push("/ProcSet [/PDF /Text /ImageC]"),e.push("/Font"),e.push("<<");for(let t=0;t<this.fontsCounter;t++)e.push(StiString.format("/F{0} {1} 0 R",t,this.info.fontList[t].ref));if(e.push(">>"),0<this.imageCache.imageStore.length){e.push("/XObject"),e.push("<<");for(let t=0;t<this.imageCache.imageStore.length;t++)e.push(StiString.format("/Image{0} {1} 0 R",t,this.info.xObjectList[t].ref));e.push(">>")}e.push("/Pattern"),e.push("<<"),e.push(StiString.format("/P1 {0} 0 R",this.info.patterns.first.ref));for(let t=0;t<this.hatchArray.length;t++)e.push(StiString.format("/PH{0} {1} 0 R",1+t,this.info.patterns.hatchItems[t].ref));for(let t=0;t<this.shadingArray.length;t++)e.push(StiString.format("/P{0} {1} 0 R",2+t,this.info.patterns.shadingItems[t].ref));e.push(">>"),e.push("/ColorSpace 3 0 R"),Stimulsoft.StiOptions.Export.Pdf.allowExtGState&&this.useTransparency&&e.push(StiString.format("/ExtGState {0} 0 R",this.info.extGState.ref)),this.usePdfA||e.push(StiString.format("/Properties << /oc1 {0} 0 R >>",this.info.optionalContentGroup.ref)),e.push(">>");for(let t=0;t<e.length;t++)this.sw.writeLine(e[t])}this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(5),this.sw.writeLine("5 0 obj"),this.sw.writeLine("<<"),this.sw.writeLine("/Type /StructTreeRoot"),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(6),this.sw.writeLine("6 0 obj"),this.sw.writeLine("<<"),this.sw.writeLine("/Type /OCG"),this.sw.writeLine("/Name (Printable off)"),this.sw.writeLine("/Usage <<"),this.sw.writeLine("/Print << /PrintState /OFF >>"),this.sw.writeLine("/View << /ViewState /ON >>"),this.sw.writeLine(">>"),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine("");for(let r=0;r<a.count;r++){this.addXref(this.info.pageList[r].ref),this.sw.writeLine1("{0} 0 obj",this.info.pageList[r].ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /Page"),this.sw.writeLine("/Parent 4 0 R");let t=a.getByIndex(r),e=this.hiToTwips*n.unit.convertToHInches(t.pageHeight*t.segmentPerHeight),i=this.hiToTwips*n.unit.convertToHInches(t.pageWidth*t.segmentPerWidth);if(14400<e&&(e=14400),14400<i&&(i=14400),this.sw.writeLine1("/MediaBox [ 0 0 {0} {1} ]",this.convertToString(i),this.convertToString(e)),!Stimulsoft.StiOptions.Export.Pdf.allowInheritedPageResources){let e=[];e.push("/Resources"),e.push("<<"),e.push("/ProcSet [/PDF /Text /ImageC]"),e.push("/Font"),e.push("<<");for(let t=0;t<this.fontsCounter;t++)e.push(StiString.format("/F{0} {1} 0 R",t,this.info.fontList[t].ref));if(e.push(">>"),0<this.imageCache.imageStore.length){e.push("/XObject"),e.push("<<");for(let t=0;t<this.imageCache.imageStore.length;t++)e.push(StiString.format("/Image{0} {1} 0 R",t,this.info.xObjectList[t].ref));e.push(">>")}let i=new StringBuilder;i.append(StiString.format("/P1 {0} 0 R",this.info.patterns.first.ref));for(let t=0;t<this.hatchArray.length;t++)i.append(StiString.format("/PH{0} {1} 0 R",1+t,this.info.patterns.hatchItems[t].ref));for(let e=0;e<this.shadingArray.length;e++){let t=this.shadingArray[e];t.Page==r&&i.append(StiString.format("/P{0} {1} 0 R",2+e,this.info.patterns.shadingItems[e].ref))}e.push("/Pattern << "+i.toString()+" >>"),e.push("/ColorSpace 3 0 R"),Stimulsoft.StiOptions.Export.Pdf.allowExtGState&&this.useTransparency&&e.push(StiString.format("/ExtGState {0} 0 R",this.info.extGState.ref)),this.usePdfA||e.push(StiString.format("/Properties << /oc1 {0} 0 R >>",this.info.optionalContentGroup.ref)),e.push(">>");for(let t=0;t<e.length;t++)this.sw.writeLine(e[t])}if(this.sw.writeLine1("/Contents {0} 0 R",this.info.pageList[r].content.ref),this.usePdfA||(this.sw.writeLine("/Group"),this.sw.writeLine("<<"),this.sw.writeLine("/Type /Group"),this.sw.writeLine("/S /Transparency"),this.sw.writeLine("/CS /DeviceRGB"),this.sw.writeLine(">>")),this.haveLinks||this.haveAnnots||this.haveDigitalSignature||this.haveTooltips){if(this.sw.writeLine("/Annots ["),this.haveLinks)for(let e=0;e<this.linksCounter;e++){let t=this.linksArray[e];t.Page==r&&this.sw.writeLine1("{0} 0 R ",this.info.linkList[e].ref)}if(this.haveAnnots){for(let e=0;e<this.annotsCounter;e++){let t=this.annotsArray[e];t.Page==r&&this.sw.writeLine1("{0} 0 R ",this.info.acroForm.annots[e].ref)}for(let e=0;e<this.annots2Counter;e++){let t=this.annots2Array[e];if(t.Page==r)for(let t=0;t<this.info.acroForm.checkBoxes[e].items.length;t++)this.sw.writeLine1("{0} 0 R ",this.info.acroForm.checkBoxes[e].items[t].ref)}for(let e=0;e<this.unsignedSignaturesCounter;e++){let t=this.unsignedSignaturesArray[e];t.Page==r&&this.sw.writeLine1("{0} 0 R ",this.info.acroForm.unsignedSignatures[e].ref)}}this.sw.writeLine("]")}this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine("")}}renderEndDoc(){let t=this.sw.position;this.sw.writeLine("xref"),this.sw.writeLine1("0 {0}",this.xref[Stimulsoft.System.StiObject.stimulsoft]().countItems+1),this.sw.writeLine("0000000000 65535 f");for(let t=0;t<this.xref[Stimulsoft.System.StiObject.stimulsoft]().countItems;t++)this.sw.writeLine(this.xref[t+1]);this.sw.writeLine("trailer"),this.sw.writeLine("<<"),this.sw.writeLine1("/Size {0}",this.xref[Stimulsoft.System.StiObject.stimulsoft]().countItems+1),this.sw.writeLine("/Root 1 0 R"),this.sw.writeLine("/Info 2 0 R"),this.encrypted&&this.sw.writeLine1("/Encrypt {0} 0 R",this.info.encode.ref),this.sw.writeLine1("/ID[<{0}><{0}>]",this.IDValueString),this.sw.writeLine(">>"),this.sw.writeLine("%"+__.c.StiExportUtils.getReportVersion(this.report)),this.sw.writeLine("%"+Stimulsoft.StiVersion.platform()),this.sw.writeLine("startxref"),this.sw.writeLine1("{0}",t),this.sw.writeLine("%%EOF")}getCreatorString(){if(!StiString.isNullOrEmpty(Stimulsoft.StiOptions.Export.Pdf.creatorString))return Stimulsoft.StiOptions.Export.Pdf.creatorString;return __.c.StiExportUtils.getReportVersion(this.report)}renderPageHeader(t){this.addXref(this.info.pageList[t].content.ref),this.sw.writeLine1("{0} 0 obj",this.info.pageList[t].content.ref),this.sw.writeLine("<<"),this.pageStream=new MemoryStream,this.pageStream.writeLine("2 J")}renderPageFooter(i,r){let t,e=null==(t=this.report.parentReport)?void 0:t.getCurrentPage(),n=this.report.isDocument&&null!=e&&e.is(IStiDashboard);if((!Stimulsoft.Base.FslAA.wtLiI.aYwiY()||n)&&(!Stimulsoft.Base.FslAA.wtLiI.dSiYV()||!n)&&(!(Stimulsoft.Base.FslAA.wtLiI.DKlzG()||Stimulsoft.Base.FslAA.wtLiI.hatRb()&&!n||Stimulsoft.Base.FslAA.wtLiI.kqAKB()&&n)||!Stimulsoft.System.NodeJs.isStandaloneVersion)){let t=r/596*1.4,e=i/840*1.4;t>e?t=e:e=t,this.pageStream.writeLine("q"),this.pushColorToStack(),this.pageStream.writeLine("1 J 1 j 20 w"),this.setStrokeColor(Color.fromArgb(64,100,100,100)),this.pageStream.writeLine1("{0} 0 0 {1} {2} {3} cm 0.707 0.707 -0.707 0.707 0 0 cm 1 0 0 1 -155 -50 cm",this.convertToString(t),this.convertToString(e),this.convertToString(r/2),this.convertToString(i/2)),this.pageStream.writeLine("40 0 m 40 100 l 0 100 m 80 100 l S"),this.pageStream.writeLine("100 0 m 100 70 l 100 45 m 120 65 l 130 72 l 140 68 l S"),this.pageStream.writeLine("170 0 m 170 70 l 169 100 m 171 100 l S"),this.pageStream.writeLine("215 60 m 222 69 l 232 71 l 255 70 l 265 60 l 265 5 l 270 0 l 265 44 m 220 31 l 212 20 l 212 10 l 225 0 l 235 0 l 250 5 l 265 18 l S"),this.pageStream.writeLine("310 0 m 310 100 l S"),this.pageStream.writeLine("Q"),this.popColorFromStack()}if(this.pageStream.position<this.pageStream.length&&this.pageStream.setLength(this.pageStream.position),1==this.compressed){let t=this.pageStream.toArray(),e=__.c.StiExportUtils.makePdfDeflateStream(t);this.storeMemoryStream2(e,"/Filter [/FlateDecode] /Length {0}")}else this.storeMemoryStream2(this.pageStream,"/Filter [] /Length {0}");this.sw.writeLine(),this.pageStream.close(),this.sw.writeLine("endstream"),this.sw.writeLine("endobj"),this.sw.writeLine("")}renderFontTable(){for(let b=0;b<this.fontsCounter;b++){let d=new StringBuilder,u=(this.pdfFont.currentFont=b,this.pdfFont.fontList[b]),w=u.Name,f=(Stimulsoft.StiOptions.Export.useAlternativeFontNames&&Stimulsoft.StiOptions.Export.alternativeFontNames.containsKey(w)&&(w=Stimulsoft.StiOptions.Export.alternativeFontNames.get(w)),this.embeddedFonts||__.c.PdfFonts.isFontStimulsoft(u.Name));if(this.pdfFont.UseUnicode){d=new StringBuilder(w[Stimulsoft.System.StiObject.stimulsoft]().replaceAll(" ","#20")),(u.Bold||u.Italic)&&(d.append(","),u.Bold&&d.append("Bold"),u.Italic)&&d.append("Italic"),f&&d.insert(0,StiString.format("SR{0}{1}{2}{3}+",String.fromCharCode(24*Math.random()+65),String.fromCharCode(24*Math.random()+65),String.fromCharCode(24*Math.random()+65),String.fromCharCode(24*Math.random()+65))),this.addXref(this.info.fontList[b].ref),this.sw.writeLine1("{0} 0 obj",this.info.fontList[b].ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /Font"),this.sw.writeLine("/Subtype /Type0"),this.sw.writeLine1("/BaseFont /{0}",d),this.sw.writeLine1("/DescendantFonts [{0} 0 R]",this.info.fontList[b].descendantFont.ref),this.sw.writeLine("/Encoding /Identity-H"),this.sw.writeLine1("/ToUnicode {0} 0 R",this.info.fontList[b].toUnicode.ref),this.sw.writeLine1("/Name /F{0}",b),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(this.info.fontList[b].descendantFont.ref),this.sw.writeLine1("{0} 0 obj",this.info.fontList[b].descendantFont.ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /Font"),this.sw.writeLine("/Subtype /CIDFontType2"),this.sw.writeLine1("/BaseFont /{0}",d),this.sw.writeLine("/CIDSystemInfo"),this.sw.writeLine("<<"),this.storeStringLine("/Registry","Adobe"),this.storeStringLine("/Ordering","Identity"),this.sw.writeLine("/Supplement 0"),this.sw.writeLine(">>"),this.sw.writeLine1("/FontDescriptor {0} 0 R",this.info.fontList[b].fontDescriptor.ref),this.usePdfA&&this.sw.writeLine("/CIDToGIDMap /Identity"),this.sw.writeString("/W [");let e=this.pdfFont.GlyphList,i=e.length,n=StiArray.create(Number,i),a=StiArray.create(Number,i);for(let t=32;t<i;t++)n[t]=e[t],a[t]=t;for(let r=32;r<n.length-1;r++)for(let i=r+1;i<n.length;i++)if(n[r]>n[i]){let t=n[r],e=(n[r]=n[i],n[i]=t,a[r]);a[r]=a[i],a[i]=e}let r=this.pdfFont.GlyphMapsList[b];for(let e=0;e<r.length-1;e++)if(0<r[e]){let t=new StringBuilder;t.append(StiString.format("{0} [{1}",e,this.pdfFont.GlyphWidths[e]));while(0<r[e+1])t.append(" "),e++,t.append(this.pdfFont.GlyphWidths[e].toString());t.append("]"),this.sw.writeLine(t.toString())}this.sw.writeLine("]"),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(this.info.fontList[b].toUnicode.ref);let t="SR+F"+b.toString(),o=(this.sw.writeLine1("{0} 0 obj",this.info.fontList[b].toUnicode.ref),this.sw.writeLine("<<"),new MemoryStream),s=(o.writeLine("/CIDInit /ProcSet findresource begin"),o.writeLine("12 dict begin"),o.writeLine("begincmap"),o.writeLine("/CIDSystemInfo"),o.writeLine("<<"),o.writeLine("/Registry (Adobe)"),o.writeLine1("/Ordering ({0})",t),o.writeLine("/Supplement 0"),o.writeLine(">> def"),o.writeLine1("/CMapName /{0} def",t),o.writeLine("/CMapType 2 def"),o.writeLine("1 begincodespacerange"),o.writeLine("<0000> <FFFF>"),o.writeLine("endcodespacerange"),this.pdfFont.MappedSymbolsCount-32),l=32;while(0<s){let e=s;100<e&&(e=100),o.writeLine1("{0} beginbfchar",e);for(let t=0;t<e;t++)o.writeLine1("<{0:X4}> <{1:X4}>",this.pdfFont.GlyphList[l],this.pdfFont.UnicodeMapBack[l]),l++;o.writeLine("endbfchar"),s-=e}o.writeLine("endcmap"),o.writeLine("CMapName currentdict /CMap defineresource pop"),o.writeLine("end"),o.writeLine("end"),o.flush();let m=o.toArray();if(o.close(),1==this.compressed){let t=__.c.StiExportUtils.makePdfDeflateStream(m);this.storeMemoryStream2(t,"/Length {0} /Filter [/FlateDecode] /Length1 "+m.length.toString())}else this.storeMemoryStream4(m,"/Length {0} /Filter [] /Length1 {0}");this.sw.writeLine(""),this.sw.writeLine("endstream"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(this.info.fontList[b].cIDSet.ref),this.sw.writeLine1("{0} 0 obj",this.info.fontList[b].cIDSet.ref),this.sw.writeLine("<<");let h=StiArray.create(Boolean,65536+32),c=0;for(let e=0;e<this.pdfFont.GlyphList.length;e++){let t=this.pdfFont.GlyphList[e];65535!=t&&(h[t]=!0,t>c)&&(c=t)}if(0!=r[65535])for(let t=0;t<65535;t++)0<r[t]&&(h[t]=!0,t>c)&&(c=t);let g=StiMath.trunc(c/8)+1,S=StiArray.create(Number,g+1),p=0;while(p<g){let t=8*p,e=0;h[t]&&(e|=128),h[t+1]&&(e|=64),h[t+2]&&(e|=32),h[t+3]&&(e|=16),h[t+4]&&(e|=8),h[t+5]&&(e|=4),h[t+6]&&(e|=2),h[t+7]&&(e|=1),S[p]=e,p++}if(1==this.compressed){let t=__.c.StiExportUtils.makePdfDeflateStream(S);this.storeMemoryStream2(t,"/Length {0} /Filter [/FlateDecode] /Length1 "+S.length.toString())}else this.storeMemoryStream4(S,"/Length {0} /Filter [] /Length1 "+S.length.toString());this.sw.writeLine(""),this.sw.writeLine("endstream")}else{this.addXref(this.info.fontList[b].ref),this.sw.writeLine1("{0} 0 obj",this.info.fontList[b].ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /Font"),1==this.standardPdfFonts?(this.sw.writeLine("/Subtype /Type1"),this.sw.writeLine1("/BaseFont /{0}",u.PdfName)):(this.sw.writeLine("/Subtype /TrueType"),d=new StringBuilder(this.stringReplace(w," ","#20")),1!=u.Bold&&1!=u.Italic||(d.append(","),1==u.Bold&&d.append("Bold"),1==u.Italic&&d.append("Italic")),this.sw.writeLine1("/BaseFont /{0}",d),this.sw.writeLine1("/FontDescriptor {0} 0 R",this.info.fontList[b].fontDescriptor.ref)),this.sw.writeLine1("/Encoding {0} 0 R",this.info.fontList[b].encoding.ref);let e=new StringBuilder(" ");for(let t=32;t<this.pdfFont.MappedSymbolsCount;t++)e.append(this.pdfFont.Widths[t-32].toString()+" ");if(this.sw.writeLine1("/FirstChar {0}",32),this.sw.writeLine1("/LastChar {0}",this.pdfFont.MappedSymbolsCount-1),this.sw.writeLine1("/Widths [{0}]",e),this.sw.writeLine1("/Name /F{0}",b),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(this.info.fontList[b].encoding.ref),this.sw.writeLine1("{0} 0 obj",this.info.fontList[b].encoding.ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /Encoding"),this.sw.writeLine("/BaseEncoding /WinAnsiEncoding"),this.pdfFont.MappedSymbolsCount>this.pdfFont.firstMappedSymbol){let e=new StringBuilder(this.pdfFont.firstMappedSymbol.toString()+" ");for(let t=this.pdfFont.firstMappedSymbol;t<this.pdfFont.MappedSymbolsCount;t++)e.append("/"+this.pdfFont.CharPdfNames[t]);this.sw.writeLine1("/Differences [{0}]",e)}this.sw.writeLine(">>")}this.sw.writeLine("endobj"),this.sw.writeLine("");let i=null;if(f&&(i=this.pdfFont.getFontDataBuf(u.Font,this.report)),0==this.standardPdfFonts){this.addXref(this.info.fontList[b].fontDescriptor.ref),this.sw.writeLine1("{0} 0 obj",this.info.fontList[b].fontDescriptor.ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /FontDescriptor"),this.sw.writeLine1("/FontName /{0}",d),this.sw.writeLine("/Flags 32"),this.sw.writeLine1("/Ascent {0}",this.pdfFont.tmASC),this.sw.writeLine1("/CapHeight {0}",this.pdfFont.CH),this.sw.writeLine1("/Descent {0}",this.pdfFont.tmDESC),this.sw.writeLine1("/FontBBox [{0} {1} {2} {3}]",this.pdfFont.LLX,this.pdfFont.LLY,this.pdfFont.URX,this.pdfFont.URY),this.sw.writeLine1("/ItalicAngle {0}",this.pdfFont.ItalicAngle),this.sw.writeLine1("/StemV {0}",this.pdfFont.StemV),f&&null!=i&&this.sw.writeLine1("/FontFile2 {0} 0 R",this.info.fontList[-1==u.ParentFontNumber?b:u.ParentFontNumber].fontFile2.ref);let t=this.pdfFont.UseUnicode;(t=this.pdfComplianceMode!=__.c.StiPdfComplianceMode.A2&&this.pdfComplianceMode!=__.c.StiPdfComplianceMode.A3?t:!1)&&this.sw.writeLine1("/CIDSet {0} 0 R",this.info.fontList[b].cIDSet.ref),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine("")}if(f){if(null!=i&&0<i.length&&-1==u.ParentFontNumber){if(this.reduceFontSize){let t=this.pdfFont.reduceFontSize(i,u.Name,!this.fontGlyphsReduceNotNeed[b]);null!=t&&(i=t)}if(this.addXref(this.info.fontList[b].fontFile2.ref),this.sw.writeLine1("{0} 0 obj",this.info.fontList[b].fontFile2.ref),this.sw.writeLine("<<"),1==this.compressedFonts){if(i instanceof Uint8Array){let t=__.c.StiExportUtils.makePdfDeflateStream(i);this.storeMemoryStream2(t,"/Length {0} /Filter [/FlateDecode] /Length1 "+i.length.toString())}if(i instanceof MemoryStream){let t=i.toArray(),e=__.c.StiExportUtils.makePdfDeflateStream(t);this.storeMemoryStream2(e,"/Length {0} /Filter [/FlateDecode] /Length1 "+i.length.toString())}}else i instanceof Uint8Array&&this.storeMemoryStream3(i,"/Length {0} /Filter [] /Length1 "+i.length.toString()),i instanceof MemoryStream&&this.storeMemoryStream2(i,"/Length {0} /Filter [] /Length1 "+i.length.toString());this.sw.writeLine(""),this.sw.writeLine("endstream")}else this.addXref(this.info.fontList[b].fontFile2.ref),this.sw.writeLine1("{0} 0 obj",this.info.fontList[b].fontFile2.ref),this.sw.writeLine("<< >>");this.sw.writeLine("endobj"),this.sw.writeLine("")}}}renderImageTable(){if(0<this.imageCache.imageStore.length)for(let s=0;s<this.imageCache.imageStore.length;s++){let t=this.imageCache.imagePackedStore[s],i=this.imageCache.imageMaskStore[s],r=this.imageCacheIndexToList.get(s),e=(null==r&&((r=new n$).Name=`Name`+s,r.Width=0,r.Height=0),r.ImageFormat),n=(this.addXref(this.info.xObjectList[s].ref),this.sw.writeLine1("{0} 0 obj",this.info.xObjectList[s].ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /XObject"),this.sw.writeLine("/Subtype /Image"),this.sw.writeLine1("/ColorSpace /{0}",e==__.c.StiImageFormat.Monochrome?"DeviceGray":"DeviceRGB"),this.sw.writeLine1("/Width {0}",r.Width),this.sw.writeLine1("/Height {0}",r.Height),this.sw.writeLine1("/BitsPerComponent {0}",e==__.c.StiImageFormat.Monochrome?"1":"8"),!this.usePdfA&&this.imageInterpolationTable.containsKey(s)&&this.sw.writeLine("/Interpolate true"),null!=i&&this.sw.writeLine1("/SMask {0} 0 R",this.info.xObjectList[s].mask.ref),this.sw.writeLine1("/Name /{0}",r.Name),"DCTDecode"),a=(this.imageCompressionMethod==__.c.StiPdfImageCompressionMethod.Flate&&(n="FlateDecode"),null==t&&(t=[56,48,56,48,56,48],n="ASCIIHexDecode"),"/Length {0} "+StiString.format("/Filter [/{0}]",n)),o=new MemoryStream;if(o.write(t,0,t.length),this.storeMemoryStream2(o,a),this.sw.writeLine(""),this.sw.writeLine("endstream"),this.sw.writeLine("endobj"),this.sw.writeLine(""),null!=i){this.addXref(this.info.xObjectList[s].mask.ref),this.sw.writeLine1("{0} 0 obj",this.info.xObjectList[s].mask.ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /XObject"),this.sw.writeLine("/Subtype /Image"),this.sw.writeLine("/ColorSpace /DeviceGray"),this.sw.writeLine("/Matte [ 0 0 0 ]"),this.sw.writeLine1("/Width {0}",r.Width),this.sw.writeLine1("/Height {0}",r.Height),this.sw.writeLine("/BitsPerComponent 8"),!this.usePdfA&&this.imageInterpolationTable.containsKey(s)&&this.sw.writeLine("/Interpolate true");let t="/Length {0} /Filter /FlateDecode",e=new MemoryStream;e.write(i,0,i.length),this.storeMemoryStream2(e,t),this.sw.writeLine(""),this.sw.writeLine("endstream"),this.sw.writeLine("endobj"),this.sw.writeLine("")}}}renderBookmarksTable(){if(this.haveBookmarks){this.addXref(this.info.outlines.ref),this.sw.writeLine1("{0} 0 obj",this.info.outlines.ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /Outlines"),this.sw.writeLine1("/First {0} 0 R",this.info.outlines.items[0].ref),this.sw.writeLine1("/Last {0} 0 R",this.info.outlines.items[0].ref),this.sw.writeLine1("/Count {0}",1),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine("");for(let e=0;e<this.bookmarksCounter;e++){this.addXref(this.info.outlines.items[e].ref);let t=this.bookmarksTree[e];this.sw.writeLine1("{0} 0 obj",this.info.outlines.items[e].ref),this.sw.writeLine("<<"),this.storeStringLine("/Title ",t.Title,!0),-1!=t.Parent&&this.sw.writeLine1("/Parent {0} 0 R",this.info.outlines.items[t.Parent].ref),-1!=t.Prev&&this.sw.writeLine1("/Prev {0} 0 R",this.info.outlines.items[t.Prev].ref),-1!=t.Next&&this.sw.writeLine1("/Next {0} 0 R",this.info.outlines.items[t.Next].ref),-1!=t.First&&this.sw.writeLine1("/First {0} 0 R",this.info.outlines.items[t.First].ref),-1!=t.Last&&this.sw.writeLine1("/Last {0} 0 R",this.info.outlines.items[t.Last].ref),0<t.Count&&(0==e?this.sw.writeLine1("/Count {0}",t.Count):this.sw.writeLine1("/Count {0}",-t.Count)),-1<t.Y&&this.sw.writeLine1("/Dest [{0} 0 R /XYZ null {1} null]",this.info.pageList[t.Page].ref,this.convertToString(t.Y)),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine("")}}}renderPatternTable(){if(this.addXref(this.info.patterns.resources.ref),this.sw.writeLine1("{0} 0 obj",this.info.patterns.resources.ref),this.sw.writeLine("<< /ProcSet [/PDF] >>"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(this.info.patterns.first.ref),this.sw.writeLine1("{0} 0 obj",this.info.patterns.first.ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /Pattern"),this.sw.writeLine("/PatternType 1"),this.sw.writeLine("/PaintType 1"),this.sw.writeLine("/TilingType 1"),this.sw.writeLine("/BBox [0 0 2 2]"),this.sw.writeLine("/XStep 3"),this.sw.writeLine("/YStep 3"),this.sw.writeLine1("/Resources {0} 0 R",this.info.patterns.resources.ref),this.pageStream=new MemoryStream,this.pageStream.writeLine("1 J 1 j 1 w"),this.pageStream.writeLine("1 0 0 RG"),this.pageStream.writeString("1 1 m 1.1 1.1 l S"),this.storeMemoryStream2(this.pageStream,"/Length {0}"),this.sw.writeLine(""),this.sw.writeLine("endstream"),this.sw.writeLine("endobj"),this.sw.writeLine(""),0<this.hatchArray.length)for(let t=0;t<this.hatchArray.length;t++)this.writeHatchPattern(t);if(0<this.shadingArray.length)for(let t=0;t<this.shadingArray.length;t++)this.writeShadingPattern(t);if(0<this.shadingFunctionArray.length){for(let t=0;t<this.shadingFunctionArray.length;t++)this.writeShadingFunction(t);this.sw.writeLine("")}this.pageStream.close()}writeHatchPattern(t){let e=this.hatchArray[t],i=e.style,r=(53<i&&(i=53),this.addXref(this.info.patterns.hatchItems[t].ref),this.sw.writeLine1("{0} 0 obj",this.info.patterns.hatchItems[t].ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /Pattern"),this.sw.writeLine("/PatternType 1"),this.sw.writeLine("/PaintType 1"),this.sw.writeLine("/TilingType 1"),this.sw.writeLine("/BBox [0 0 1 1]"),this.sw.writeLine("/XStep 1"),this.sw.writeLine("/YStep 1"),this.sw.writeLine1("/Resources {0} 0 R",this.info.patterns.resources.ref),this.sw.writeLine("/Matrix [5.5 0 0 5.5 0 0]"),new MemoryStream);0!=e.backColor.a&&(r.writeLine1("{0} {1} {2} rg",this.colorTable[e.backColor.r],this.colorTable[e.backColor.g],this.colorTable[e.backColor.b]),r.writeLine("0 0 1 1 re f")),r.writeLine1("{0} {1} {2} rg",this.colorTable[e.foreColor.r],this.colorTable[e.foreColor.g],this.colorTable[e.foreColor.b]),r.writeLine("BI"),r.writeLine("/W 8"),r.writeLine("/H 8"),r.writeLine("/BPC 1"),r.writeLine("/IM true"),r.writeLine("/D [1 0]"),r.writeLine("/F [/AHx]"),r.writeLine("ID"),r.writeLine(__.c.StiPdfResources.hatchData[i]+">"),r.writeLine("EI"),r.flush(),this.storeMemoryStream2(r,"/Length {0}"),this.sw.writeLine("endstream"),this.sw.writeLine("endobj"),this.sw.writeLine("")}writeShadingPattern(t){let e=this.shadingArray[t],i=1,r=1,n=e.Angle,a=(n<0&&(n+=360),270<=n&&n<360&&(n=360-n,r=-1),180<=n&&n<270&&(n-=180,r=-1,i=-1),90<=n&&n<180&&(n=180-n,i=-1),n=n*Math.PI/180,e.X+e.Width/2),o=e.Y+e.Height/2,s=Math.sqrt(e.Width*e.Width+e.Height*e.Height)/2,l=Math.atan2(e.Height,e.Width),m=Math.PI/2-n+l,h=s*Math.sin(m),c=h*Math.cos(n)*i,g=h*Math.sin(n)*r,S=a-c,p=a+c,d=o+g,u=o-g;this.addXref(this.info.patterns.shadingItems[t].ref),this.sw.writeLine1("{0} 0 obj",this.info.patterns.shadingItems[t].ref),this.sw.writeString("<<"),this.sw.writeString("/PatternType 2"),this.sw.writeString("/Shading <<"),this.sw.writeString("/ColorSpace /DeviceRGB"),this.sw.writeString("/ShadingType 2"),this.sw.writeString(StiString.format("/Coords [{0} {1} {2} {3}]",this.convertToString(S),this.convertToString(d),this.convertToString(p),this.convertToString(u))),this.sw.writeString("/Extend [true true]"),this.sw.writeString(StiString.format("/Function {0} 0 R",this.info.patterns.shadingFunctionItems[e.FunctionIndex].ref)),this.sw.writeString(">> "),this.sw.writeLine(">>"),this.sw.writeLine("endobj")}writeShadingFunction(t){let e=this.shadingFunctionArray[t],i=(this.addXref(this.info.patterns.shadingFunctionItems[t].ref),this.sw.writeLine1("{0} 0 obj",this.info.patterns.shadingFunctionItems[t].ref),this.sw.writeString("<<"),this.sw.writeString("/FunctionType 0"),this.sw.writeString(StiString.format("/Size [{0}]",e.Colors.length)),this.sw.writeString("/Decode [0 1 0 1 0 1]"),this.sw.writeString("/Range [0 1 0 1 0 1]"),this.sw.writeString("/BitsPerSample 8"),this.sw.writeString("/Domain [0 1]"),this.sw.writeString(StiString.format("/Encode [0 {0}]",e.Colors.length-1)),this.sw.writeString("/Order 1"),new MemoryStream);for(let t of e.Colors)i.writeByte(t.r),i.writeByte(t.g),i.writeByte(t.b);this.storeMemoryStream2(i,"/Length {0}"),this.sw.writeLine(""),this.sw.writeLine("endstream"),this.sw.writeLine("endobj")}renderLinkTable(){if(this.haveLinks)for(let t=0;t<this.linksCounter;t++){let r=this.linksArray[t];if(r.Link.startsWith("##")&&0<this.tagsArray[Stimulsoft.System.StiObject.stimulsoft]().countItems){let i=r.Link.substr(2);for(let e=0;e<this.tagsArray[Stimulsoft.System.StiObject.stimulsoft]().countItems;e++){let t=this.tagsArray[e];if(t.Link==i){r.DestPage=t.Page,r.DestY=t.Y+t.Height;break}}}else if("#"==r.Link.charAt(0)&&this.haveBookmarks){let i=r.Link.substr(1);if("%"==i.charAt(0)&&2<i.length){let t=i.lastIndexOf(i.charAt(1));t<i.length-1&&(i=i.substr(t+1))}for(let e=0;e<this.bookmarksCounter;e++){let t=this.bookmarksTree[e];if(t.Title==i){r.DestPage=t.Page,r.DestY=t.Y;break}}}if(this.linksArray[t]=r,this.addXref(this.info.linkList[t].ref),this.sw.writeLine1("{0} 0 obj",this.info.linkList[t].ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /Annot"),this.sw.writeLine("/Subtype /Link"),this.sw.writeLine1("/Rect [{0} {1} {2} {3}]",this.convertToString(r.X),this.convertToString(r.Y),this.convertToString(r.X+r.Width),this.convertToString(r.Y+r.Height)),this.sw.writeLine("/Border [0 0 0]"),"#"==r.Link.charAt(0))-1<r.DestY?this.sw.writeLine1("/Dest [{0} 0 R /XYZ null {1} null]",this.info.pageList[r.DestPage].ref,this.convertToString(r.DestY)):this.sw.writeLine1("/Dest [{0} 0 R /XYZ null null null]",this.info.pageList[0].ref);else{let t=this.stringReplace(r.Link,"\\","/"),e=6<t.length&&Char.isLetter(t,0)&&":"==t.charAt(1)&&"/"==t.charAt(2)||"/"==t.charAt(0)&&Char.isLetter(t,1)&&"/"==t.charAt(2);e&&":"==t.charAt(1)&&(t="/"+t.charAt(0)+t.substr(2)),this.sw.writeLine("/A <<"),this.sw.writeLine("/Type /Action"),e?(this.sw.writeLine("/S /Launch"),this.sw.writeLine("/F <<"),this.sw.writeLine("/Type /Filespec"),this.storeStringLine("/F ",t),this.storeStringLine("/UF ",t),this.sw.writeLine(">>")):(this.sw.writeLine("/S /URI"),this.storeStringLine("/URI ",__.c.StiExportUtils.stringToUrl(t))),this.sw.writeLine(">>")}this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine("")}}renderAnnotTable(){if(this.haveAnnots||this.haveDigitalSignature||this.haveTooltips){this.addXref(this.info.acroForm.ref),this.sw.writeLine1("{0} 0 obj",this.info.acroForm.ref),this.sw.writeLine("<<"),this.sw.writeLine("/Fields [");for(let t=0;t<this.annotsCounter;t++)this.sw.writeLine1("{0} 0 R",this.info.acroForm.annots[t].ref);for(let e=0;e<this.annots2Counter;e++)for(let t=0;t<this.info.acroForm.checkBoxes[e].items.length;t++)this.sw.writeLine1("{0} 0 R",this.info.acroForm.checkBoxes[e].items[t].ref);for(let t=0;t<this.unsignedSignaturesCounter;t++)this.sw.writeLine1("{0} 0 R",this.info.acroForm.unsignedSignatures[t].ref);this.haveDigitalSignature&&this.sw.writeLine1("{0} 0 R",this.info.acroForm.signatures[0].ref);for(let t=0;t<this.tooltipsCounter;t++)this.sw.writeLine1("{0} 0 R",this.info.acroForm.tooltips[t].ref);if(this.sw.writeLine("]"),this.sw.writeLine("/DR <<"),0<this.annotsCounter||0<this.annots2Counter){this.sw.writeLine("/Font <<"),this.sw.writeLine1("/Helv {0} 0 R",this.info.acroForm.fontHelvetica.ref);for(let t=0;t<this.fontsCounter;t++)this.sw.writeLine1("/FA{0} {1} 0 R",t,this.info.acroForm.annotFontItems[t].ref);this.sw.writeLine(">>")}if(this.sw.writeLine(">>"),this.haveAnnots&&0<this.fontsCounter&&this.storeStringLine("/DA ","/Helv 0 Tf 0 g"),this.haveDigitalSignature&&this.sw.writeLine("/SigFlags 3"),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(this.info.acroForm.fontHelvetica.ref),this.sw.writeLine1("{0} 0 obj",this.info.acroForm.fontHelvetica.ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /Font"),this.sw.writeLine("/Subtype /Type1"),this.sw.writeLine("/BaseFont /Helvetica"),this.sw.writeLine("/Encoding /WinAnsiEncoding"),this.sw.writeLine("/Name /Helv"),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.haveAnnots){let l=new Hashtable;for(let a=0;a<this.annotsCounter;a++){let t=this.annotsArray[a],i="";if(Stimulsoft.StiOptions.Export.Pdf.useEditableFieldName&&(i=t.Component.name),Stimulsoft.StiOptions.Export.Pdf.useEditableFieldAlias&&(i=t.Component.alias),Stimulsoft.StiOptions.Export.Pdf.useEditableFieldTag&&(i=t.Component.tagValue),StiString.isNullOrEmpty(i)&&(i=`Field`+a),l.containsKey(i)){let t=2,e="";while(l.containsKey(i+e))e="_"+t.toString(),t++;i+=e}l.add(i,i),this.addXref(this.info.acroForm.annots[a].ref),this.sw.writeLine1("{0} 0 obj",this.info.acroForm.annots[a].ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /Annot"),this.sw.writeLine("/Subtype /Widget"),this.sw.writeLine1("/Rect [{0} {1} {2} {3}]",this.convertToString(t.X),this.convertToString(t.Y),this.convertToString(t.X+t.Width),this.convertToString(t.Y+t.Height)),this.sw.writeLine("/F 4"),this.sw.writeLine1("/P {0} 0 R",this.info.pageList[t.Page].ref),this.sw.writeLine("/FT /Tx"),this.sw.writeLine("/BS << /W 0 >>"),this.storeStringLine("/T ",i),this.sw.writeLine("/MK << /TP 2 >>"),this.sw.writeLine("/H /P"),this.sw.writeLine1("/AP << /N {0} 0 R >>",this.info.acroForm.annots[a].aP.ref);let e=t.Multiline?4096:0;null!=t.Component.as(StiText)&&null!=t.Component.as(StiText).textOptions&&t.Component.as(StiText).textOptions.lineLimit&&(e|=8388608),this.sw.writeLine1("/Ff {0}",e),this.storeStringLine("/DA ",StiString.format("/FA{0} {1} Tf {2} {3} {4} rg",t.FontNumber,this.convertToString(t.FontSize,this.precision_digits_font),this.colorTable[t.FontColor.r],this.colorTable[t.FontColor.g],this.colorTable[t.FontColor.b])),this.storeStringLine("/V ",t.Text,!0),this.storeStringLine("/DV ",t.Text,!0),this.sw.writeLine1("/Q {0}",(t.Alignment==Stimulsoft.Base.Drawing.StiTextHorAlignment.Center?1:0)+(t.Alignment==Stimulsoft.Base.Drawing.StiTextHorAlignment.Right?2:0)),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(this.info.acroForm.annots[a].aP.ref),this.sw.writeLine1("{0} 0 obj",this.info.acroForm.annots[a].aP.ref),this.sw.writeLine("<<"),this.sw.writeLine("/Subtype /Form"),this.sw.writeLine1("/BBox [{0} {1} {2} {3}]",this.convertToString(0),this.convertToString(0),this.convertToString(t.Width),this.convertToString(t.Height)),this.sw.writeLine("/Resources <<"),this.sw.writeLine("/ProcSet [ /PDF /Text ]"),this.sw.writeString("/Font << ");for(let t=0;t<this.fontsCounter;t++)this.sw.writeString(StiString.format("/F{0} {1} 0 R ",t,this.info.fontList[t].ref));this.sw.writeLine(">> >>");let r=new MemoryStream,n=(r.writeLine("/Tx BMC"),r.writeLine("q"),1);r.writeLine1("{0} {1} {2} {3} re W n",this.convertToString(n),this.convertToString(n),this.convertToString(t.Width-n),this.convertToString(t.Height-n)),r.flush(),r.write(t.Content,0,t.Content.length),r.writeLine("Q"),r.writeLine("EMC"),r.flush(),this.storeMemoryStream2(r,"/Filter [] /Length {0}"),this.sw.writeLine(""),r.close(),this.sw.writeLine("endstream"),this.sw.writeLine("endobj"),this.sw.writeLine("")}for(let a=0;a<this.fontsCounter;a++){this.pdfFont.currentFont=a;let t=this.pdfFont.fontList[a],e=t.Name,i=(Stimulsoft.StiOptions.Export.useAlternativeFontNames&&Stimulsoft.StiOptions.Export.alternativeFontNames.containsKey(e)&&(e=Stimulsoft.StiOptions.Export.alternativeFontNames.get(e)),new StringBuilder(this.stringReplace(e," ","#20")));if((t.Bold||t.Italic)&&(i.append(","),t.Bold&&i.append("Bold"),t.Italic)&&i.append("Italic"),this.addXref(this.info.acroForm.annotFontItems[a].ref),this.sw.writeLine1("{0} 0 obj",this.info.acroForm.annotFontItems[a].ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /Font"),this.sw.writeLine("/Subtype /TrueType"),this.sw.writeLine1("/Name /FA{0}",a),this.sw.writeLine1("/BaseFont /{0}",i),this.sw.writeLine("/Encoding /WinAnsiEncoding"),this.sw.writeLine1("/FontDescriptor {0} 0 R",this.info.acroForm.annotFontItems[a].fontDescriptor.ref),this.fontGlyphsReduceNotNeed[a]){let e=new StringBuilder(" ");for(let t=32;t<256;t++)e.append(this.pdfFont.Widths[this.pdfFont.UnicodeMap[this.CodePage1252[t]]-32].toString()+" ");this.sw.writeLine("/FirstChar 32"),this.sw.writeLine("/LastChar 255"),this.sw.writeLine1("/Widths [{0}]",e)}this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine("");let r=null,n=this.embeddedFonts||__.c.PdfFonts.isFontStimulsoft(t.Name);n&&(r=this.pdfFont.getFontDataBuf(t.Font,this.report)),this.addXref(this.info.acroForm.annotFontItems[a].fontDescriptor.ref),this.sw.writeLine1("{0} 0 obj",this.info.acroForm.annotFontItems[a].fontDescriptor.ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /FontDescriptor"),this.sw.writeLine1("/FontName /{0}",i),this.sw.writeLine("/Flags 32"),this.sw.writeLine1("/Ascent {0}",this.pdfFont.tmASC),this.sw.writeLine1("/CapHeight {0}",this.pdfFont.CH),this.sw.writeLine1("/Descent {0}",-this.pdfFont.tmDESC),this.sw.writeLine1("/FontBBox [{0} {1} {2} {3}]",-500,-200,1500,1e3),this.sw.writeLine1("/ItalicAngle {0}",this.pdfFont.ItalicAngle),this.sw.writeLine1("/StemV {0}",this.pdfFont.StemV),n&&null!=r&&this.sw.writeLine1("/FontFile2 {0} 0 R",this.info.fontList[a].fontFile2.ref),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine("")}for(let s=0;s<this.annots2Counter;s++){let r=this.annots2Array[s],n="";if(Stimulsoft.StiOptions.Export.Pdf.useEditableFieldName&&(n=r.Component.name),Stimulsoft.StiOptions.Export.Pdf.useEditableFieldAlias&&(n=r.Component.alias),Stimulsoft.StiOptions.Export.Pdf.useEditableFieldTag&&(n=r.Component.tagValue),StiString.isNullOrEmpty(n)&&(n=`Checkbox`+(s+1)),l.containsKey(n)){let t=2,e="";while(l.containsKey(n+e))e="_"+t.toString(),t++;n+=e}l.add(n,n);let a=.01,e=r.Component.as(StiCheckBox),o=__.c.StiPdfRenderPrimitives.getCheckBoxValue(e);if(null==o&&(o=!1),1<this.info.acroForm.checkBoxes[s].items.length){let t=this.info.acroForm.checkBoxes[s].items[0];this.addXref(t.ref),this.sw.writeLine1("{0} 0 obj",t.ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /Annot"),this.sw.writeLine("/Subtype /Widget"),this.sw.writeLine("/FT /Btn"),this.sw.writeLine1("/Rect [{0} {1} {2} {3}]",this.convertToString(r.X),this.convertToString(r.Y),this.convertToString(r.X+r.Width-a),this.convertToString(r.Y+r.Height-a)),this.sw.writeLine1("/F {0}",4+(3==this.info.acroForm.checkBoxes[s].items.length||0==o?2:0)),this.sw.writeLine1("/P {0} 0 R",this.info.pageList[r.Page].ref),this.storeStringLine("/T ",n+"Yes"),this.sw.writeLine("/MK << >>"),this.sw.writeLine("/Ff 65536"),this.sw.writeLine1("/A {0} 0 R",t.aA[0].ref),this.sw.writeLine1("/AP << /N {0} 0 R >>",t.aP.ref),this.sw.writeLine("/H /O"),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(t.aP.ref),this.sw.writeLine1("{0} 0 obj",t.aP.ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /XObject"),this.sw.writeLine("/Subtype /Form"),this.sw.writeLine("/FormType 1"),this.sw.writeLine1("/BBox [{0} {1} {2} {3}]",this.convertToString(0),this.convertToString(0),this.convertToString(r.Width),this.convertToString(r.Height)),this.sw.writeLine("/Matrix [ 1 0 0 1 0 0 ]"),this.sw.writeLine("/Resources <<"),this.sw.writeLine("/ProcSet [ /PDF ]"),this.sw.writeLine("/Pattern"),this.sw.writeLine("<<");for(let t=0;t<this.hatchArray.length;t++)this.sw.writeLine1(StiString.format("/PH{0} {1} 0 R",1+t,this.info.patterns.hatchItems[t].ref));for(let t=0;t<this.shadingArray.length;t++)this.sw.writeLine1(StiString.format("/P{0} {1} 0 R",2+t,this.info.patterns.shadingItems[t].ref));this.sw.writeLine(">>"),this.sw.writeLine("/ColorSpace 3 0 R"),this.sw.writeLine(">>");let e=new MemoryStream,i=(e.writeLine("/Tx BMC"),e.writeLine("q"),1);e.writeLine1("{0} {1} {2} {3} re W n",this.convertToString(i),this.convertToString(i),this.convertToString(r.Width-i),this.convertToString(r.Height-i)),e.flush(),e.write(r.Content,0,r.Content.length),e.writeLine("Q"),e.writeLine("EMC"),e.flush(),this.storeMemoryStream2(e,"/Filter [] /Length {0}"),this.sw.writeLine(""),e.close(),this.sw.writeLine("endstream"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(t.aA[0].ref),this.sw.writeLine1("{0} 0 obj",t.aA[0].ref),this.sw.writeLine("<<"),this.sw.writeLine1("/Next {0} 0 R",t.aA[1].ref),this.sw.writeLine("/S /Hide"),this.sw.writeLine1("/T ({0})",n+"Yes"),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(t.aA[1].ref),this.sw.writeLine1("{0} 0 obj",t.aA[1].ref),this.sw.writeLine("<<"),this.sw.writeLine("/H false"),this.sw.writeLine("/S /Hide"),this.sw.writeLine1("/T ({0})",n+"No"),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine(""),t=this.info.acroForm.checkBoxes[s].items[1],this.addXref(t.ref),this.sw.writeLine1("{0} 0 obj",t.ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /Annot"),this.sw.writeLine("/Subtype /Widget"),this.sw.writeLine("/FT /Btn"),this.sw.writeLine1("/Rect [{0} {1} {2} {3}]",this.convertToString(r.X),this.convertToString(r.Y),this.convertToString(r.X+r.Width-a),this.convertToString(r.Y+r.Height-a)),this.sw.writeLine1("/F {0}",4+(3==this.info.acroForm.checkBoxes[s].items.length||1==o?2:0)),this.sw.writeLine1("/P {0} 0 R",this.info.pageList[r.Page].ref),this.storeStringLine("/T ",n+"No"),this.sw.writeLine("/MK << >>"),this.sw.writeLine("/Ff 65536"),this.sw.writeLine1("/A {0} 0 R",t.aA[0].ref),this.sw.writeLine1("/AP << /N {0} 0 R >>",t.aP.ref),this.sw.writeLine("/H /O"),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(t.aP.ref),this.sw.writeLine1("{0} 0 obj",t.aP.ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /XObject"),this.sw.writeLine("/Subtype /Form"),this.sw.writeLine("/FormType 1"),this.sw.writeLine1("/BBox [{0} {1} {2} {3}]",this.convertToString(0),this.convertToString(0),this.convertToString(r.Width),this.convertToString(r.Height)),this.sw.writeLine("/Matrix [ 1 0 0 1 0 0 ]"),this.sw.writeLine("/Resources <<"),this.sw.writeLine("/ProcSet [ /PDF ]"),this.sw.writeLine("/Pattern"),this.sw.writeLine("<<");for(let t=0;t<this.hatchArray.length;t++)this.sw.writeLine1(StiString.format("/PH{0} {1} 0 R",1+t,this.info.patterns.hatchItems[t].ref));for(let t=0;t<this.shadingArray.length;t++)this.sw.writeLine1(StiString.format("/P{0} {1} 0 R",2+t,this.info.patterns.shadingItems[t].ref));this.sw.writeLine(">>"),this.sw.writeLine("/ColorSpace 3 0 R"),this.sw.writeLine(">>"),(e=new MemoryStream).writeLine("/Tx BMC"),e.writeLine("q"),i=1,e.writeLine1("{0} {1} {2} {3} re W n",this.convertToString(i),this.convertToString(i),this.convertToString(r.Width-i),this.convertToString(r.Height-i)),e.flush(),e.write(r.Content2,0,r.Content2.length),e.writeLine("Q"),e.writeLine("EMC"),e.flush(),this.storeMemoryStream2(e,"/Filter [] /Length {0}"),this.sw.writeLine(""),e.close(),this.sw.writeLine("endstream"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(t.aA[0].ref),this.sw.writeLine1("{0} 0 obj",t.aA[0].ref),this.sw.writeLine("<<"),this.sw.writeLine("/H false"),this.sw.writeLine1("/Next {0} 0 R",t.aA[1].ref),this.sw.writeLine("/S /Hide"),this.sw.writeLine1("/T ({0})",n+"Yes"),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(t.aA[1].ref),this.sw.writeLine1("{0} 0 obj",t.aA[1].ref),this.sw.writeLine("<<"),this.sw.writeLine("/S /Hide"),this.sw.writeLine1("/T ({0})",n+"No"),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine("")}if(3==this.info.acroForm.checkBoxes[s].items.length){let t=this.info.acroForm.checkBoxes[s].items[2];this.addXref(t.ref),this.sw.writeLine1("{0} 0 obj",t.ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /Annot"),this.sw.writeLine("/Subtype /Widget"),this.sw.writeLine("/FT /Btn"),this.sw.writeLine1("/Rect [{0} {1} {2} {3}]",this.convertToString(r.X),this.convertToString(r.Y),this.convertToString(r.X+r.Width-a),this.convertToString(r.Y+r.Height-a)),this.sw.writeLine("/F 4"),this.sw.writeLine1("/P {0} 0 R",this.info.pageList[r.Page].ref),this.storeStringLine("/T ",n+"None"),this.sw.writeLine("/MK << >>"),this.sw.writeLine("/Ff 65536"),this.sw.writeLine1("/A {0} 0 R",t.aA[0].ref),this.sw.writeLine("/H /O"),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(t.aA[0].ref),this.sw.writeLine1("{0} 0 obj",t.aA[0].ref),this.sw.writeLine("<<"),this.sw.writeLine1("/Next {0} 0 R",t.aA[1].ref),this.sw.writeLine("/S /Hide"),this.sw.writeLine1("/T ({0})",n+"None"),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(t.aA[1].ref),this.sw.writeLine1("{0} 0 obj",t.aA[1].ref),this.sw.writeLine("<<"),this.sw.writeLine("/H false"),this.sw.writeLine("/S /Hide"),this.sw.writeLine1("/T ({0})",n+(e.checkStyleForTrue==__.a.Components.StiCheckStyle.None?"No":"Yes")),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine("")}}for(let r=0;r<this.unsignedSignaturesCounter;r++){let t=this.unsignedSignaturesArray[r],i="";if(Stimulsoft.StiOptions.Export.Pdf.useEditableFieldName&&(i=t.Component.name),Stimulsoft.StiOptions.Export.Pdf.useEditableFieldAlias&&(i=t.Component.alias),Stimulsoft.StiOptions.Export.Pdf.useEditableFieldTag&&(i=t.Component.tagValue),StiString.isNullOrEmpty(i)&&(i=`UnsignedSignature`+r),l.containsKey(i)){let t=2,e="";while(l.containsKey(i+e))e="_"+t.toString(),t++;i+=e}l.add(i,i);let e=this.info.acroForm.unsignedSignatures[r].ref;this.addXref(e),this.sw.writeLine1("{0} 0 obj",e),this.sw.writeLine("<<"),this.sw.writeLine("/Type /Annot"),this.sw.writeLine("/Subtype /Widget"),this.sw.writeLine1("/Rect [{0} {1} {2} {3}]",this.convertToString(t.X),this.convertToString(t.Y),this.convertToString(t.X+t.Width),this.convertToString(t.Y+t.Height)),this.sw.writeLine("/F 4"),this.sw.writeLine1("/P {0} 0 R",this.info.pageList[t.Page].ref),this.sw.writeLine("/FT /Sig"),this.storeStringLine("/T ",i),this.sw.writeLine("/MK << >>"),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine("")}}}}renderTooltipTable(){if(this.haveTooltips)for(let t=0;t<this.tooltipsCounter;t++){let e=this.tooltipsArray[t],i=!1,r=new r$;for(let t=0;t<this.linksCounter;t++)if((r=this.linksArray[t]).X==e.X&&r.Y==e.Y&&r.Width==e.Width&&r.Height==e.Height&&r.Page-1==e.Page){i=!0;break}this.addXref(this.info.acroForm.tooltips[t].ref),this.sw.writeLine1("{0} 0 obj",this.info.acroForm.tooltips[t].ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /Annot"),this.sw.writeLine("/Subtype /Widget"),this.sw.writeLine1("/Rect [{0} {1} {2} {3}]",this.convertToString(e.X),this.convertToString(e.Y),this.convertToString(e.X+e.Width),this.convertToString(e.Y+e.Height)),this.storeStringLine("/TU ",e.Link,!0),this.sw.writeLine("/F 0"),this.sw.writeLine1("/P {0} 0 R",this.info.pageList[e.Page].ref),this.storeStringLine("/T ",`Tooltip`+t),this.sw.writeLine("/FT /Btn"),this.sw.writeLine("/Ff 65536"),this.sw.writeLine("/H /N"),this.sw.writeLine("/AP <<"),this.sw.writeLine(">>"),i&&("#"==r.Link.charAt(0)?-1<r.DestY?this.sw.writeLine1("/Dest [{0} 0 R /XYZ null {1} null]",this.info.pageList[r.DestPage].ref,this.convertToString(r.DestY)):this.sw.writeLine1("/Dest [{0} 0 R /XYZ null null null]",this.info.pageList[0].ref):(this.sw.writeLine("/A <<"),this.sw.writeLine("/Type /Action"),this.sw.writeLine("/S /URI"),this.storeStringLine("/URI ",__.c.StiExportUtils.stringToUrl(this.stringReplace(r.Link,"\\","/"))),this.sw.writeLine(">>"))),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine("")}}renderEncodeRecord(){this.encrypted&&(this.addXref(this.info.encode.ref),this.sw.writeLine1("{0} 0 obj",this.info.encode.ref),this.sw.writeLine("<<"),this.pdfSecurity.renderEncodeRecord(this.sw,this),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine(""))}renderExtGStateRecord(){this.addXref(this.info.extGState.ref),this.sw.writeLine1("{0} 0 obj",this.info.extGState.ref),this.sw.writeLine("<<");for(let e=0;e<256;e++)if(this.alphaTable[e]){let t=StiString.format("{0:X2}",e).toUpperCase();this.sw.writeLine1("/GS{0}S <</Type /ExtGState /BM /Normal /CA {1}>>",t,this.colorTable[e]),this.sw.writeLine1("/GS{0}N <</Type /ExtGState /BM /Normal /ca {1}>>",t,this.colorTable[e])}this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine("")}storeImageData(t,e,i,r,n=null){let a,o=(null!=t&&(a=t.imageFormat,t.tryConvertSync(Stimulsoft.System.Drawing.Imaging.ImageFormat.Jpeg)),this.exportCache.getImageIndex(r,n)),s=(null==o&&(o=this.imageCache.addImageInt(t)),new n$);return null!=t&&null!=t.bytes?(s.Width=t.width,s.Height=t.height):(s.Width=1,s.Height=1),s.Name=StiString.format("Image{0}",o),s.ImageFormat=this.imageFormat,this.imageList.push(s),this.imageCacheIndexToList.set(o,s),i&&this.imageInterpolationTable.set(o,!0),null!=t&&(t.imageFormat=a),e}storeImageDataForGeom(t){let e=t.imageToDraw.horizontalResolution/100;this.imageResolutionMode==__.c.StiImageResolutionMode.NoMoreThan&&(e=t.stretch?t.imageToDraw.width/this.report.unit.convertToHInches(t.width):1/t.multipleFactor),e=this.storeImageData(t.imageToDraw,e,t.smoothing,this.lastProcessedComponent),this.imageInfoList.set(this.imageInfoCounter,e)}writeImageInfo(s,t,e=!1){let i=this.imageList[this.imagesCurrent],l=(this.imagesCurrent++,s.Component.as(StiImage)),r=this.imageResolutionMode;if((r=e?__.c.StiImageResolutionMode.Auto:r)!=__.c.StiImageResolutionMode.Exactly&&null!=l&&!l.margins.isEmpty){let t=this.hiToTwips*l.margins.left,e=this.hiToTwips*l.margins.right,i=this.hiToTwips*l.margins.top,r=this.hiToTwips*l.margins.bottom;0!=t&&(s.X+=t,s.Width-=t),0!=r&&(s.Y+=r,s.Height-=r),0!=e&&(s.Width-=e),0!=i&&(s.Height-=i)}let n=StiImageRotation.None,m=(null!=l&&(n=l.imageRotation),i.Width),h=i.Height,c=(n!=StiImageRotation.Rotate90CCW&&n!=StiImageRotation.Rotate90CW||(m=i.Height,h=i.Width),s.X),g=s.Y,S=this.hiToTwips*(m-1)/t,p=this.hiToTwips*(h-1)/t,d=!1;if(r!=__.c.StiImageResolutionMode.Exactly&&null!=l&&null!=l.imageToDraw){let n=l.imageToDraw,a=l.getPaintRectangle(!0,!1),o=(a=l.convertImageMargins(a,!1),new F(0,0,a.width,a.height));if(l.stretch){let i=m,r=h;if(null==n&&(i=1,r=1),l.aspectRatio){let t=o.width/i,e=o.height/r;switch(e<t?o.width=i*e:o.height=r*t,l.vertAlignment){case StiVertAlignment.Center:o.y=(a.height-o.height)/2;break;case StiVertAlignment.Top:o.y=a.height-o.height;break}switch(l.horAlignment){case StiHorAlignment.Center:o.x=(a.width-o.width)/2;break;case StiHorAlignment.Right:o.x=a.width-o.width;break}c+=o.x*this.hiToTwips,g+=o.y*this.hiToTwips,S=o.width*this.hiToTwips,p=o.height*this.hiToTwips}else S=s.Width,p=s.Height}else{let t=m*l.multipleFactor,e=h*l.multipleFactor;switch(null!=n&&null!=n.bytes||(t=1,e=1),o.width=t,o.height=e,l.horAlignment){case StiHorAlignment.Center:o.x=(a.width-t)/2;break;case StiHorAlignment.Right:o.x=a.width-t;break}switch(l.vertAlignment){case StiVertAlignment.Center:o.y=(a.height-e)/2;break;case StiVertAlignment.Top:o.y=a.height-e;break}c+=o.x*this.hiToTwips,g+=o.y*this.hiToTwips,S=o.width*this.hiToTwips,p=o.height*this.hiToTwips,d=!0}}this.pageStream.writeLine("q"),this.pushColorToStack(),this.setNonStrokeColor(Color.black),d&&this.pageStream.writeLine1("{0} {1} {2} {3} re W n",this.convertToString(s.X),this.convertToString(s.Y),this.convertToString(s.Width),this.convertToString(s.Height)),n==StiImageRotation.None?this.pageStream.writeLine1("{0} 0 0 {1} {2} {3} cm",this.convertToString(S),this.convertToString(p),this.convertToString(c),this.convertToString(g)):(this.pageStream.writeLine1("1 0 0 1 {0} {1} cm",this.convertToString(c+S/2),this.convertToString(g+p/2)),n==StiImageRotation.Rotate90CCW&&this.pageStream.writeLine("0 1 -1 0 0 0 cm"),n==StiImageRotation.Rotate90CW&&this.pageStream.writeLine("0 -1 1 0 0 0 cm"),n==StiImageRotation.Rotate180&&this.pageStream.writeLine("-1 0 0 -1 0 0 cm"),n==StiImageRotation.FlipHorizontal&&this.pageStream.writeLine("-1 0 0 1 0 0 cm"),n==StiImageRotation.FlipVertical&&this.pageStream.writeLine("1 0 0 -1 0 0 cm"),n==StiImageRotation.Rotate90CCW||n==StiImageRotation.Rotate90CW?this.pageStream.writeLine1("{0} 0 0 {1} {2} {3} cm",this.convertToString(p),this.convertToString(S),this.convertToString(-p/2),this.convertToString(-S/2)):this.pageStream.writeLine1("{0} 0 0 {1} {2} {3} cm",this.convertToString(S),this.convertToString(p),this.convertToString(-S/2),this.convertToString(-p/2))),this.pageStream.writeLine1("/{0} Do",i.Name),this.pageStream.writeLine("Q"),this.popColorFromStack()}writeImageInfo2(t,e,i){let r=this.imageList[this.imagesCurrent];this.imagesCurrent++,this.pageStream.writeLine("q"),this.pushColorToStack(),this.setNonStrokeColor(Color.black),this.pageStream.writeLine1("{0} 0 0 {1} {2} {3} cm",this.convertToString(this.hiToTwips*r.Width/e),this.convertToString(this.hiToTwips*r.Height/i),this.convertToString(t.X),this.convertToString(t.Y)),this.pageStream.writeLine1("/{0} Do",r.Name),this.pageStream.writeLine("Q"),this.popColorFromStack()}renderImage(n,a,o=!1){if(this.imageInfoList.containsKey(this.imageInfoCounter)){let t=this.imageInfoList.get(this.imageInfoCounter);this.writeImageInfo(n,t,o)}else{let r=n.Component.as(IStiExportImageExtended);if(null!=r&&n.Component.isExportAsImage(__.a.StiExportFormat.Pdf)){let t=a,e={ref:t},i=r.getImage(e,__.a.StiExportFormat.Pdf);null!=i&&this.writeImageInfo(n,t=e.ref,o)}}}renderIcon(r){let t=r.Component.as(StiImage),e=__.a.StiFontIconsHelper.getContent(t.icon),n=Math.min(r.Width,r.Height)/this.hiToTwips,i=1,a=new Font("Stimulsoft",i),o=Graphics.measureString(e,a),s=Math.max(o.height,o.width),l=Graphics.measureString(" ",a),m=(s+=l.width,i=Math.floor(n/s),r.clone()),h=new StiText;if(h.text=e,h.textBrush=new StiSolidBrush(t.iconColor),h.font=new Font("Stimulsoft",i),h.horAlignment=t.horAlignment==StiHorAlignment.Left?StiTextHorAlignment.Left:t.horAlignment==StiHorAlignment.Center?StiTextHorAlignment.Center:StiTextHorAlignment.Right,h.vertAlignment=t.vertAlignment,h.page=r.Component.page,h.textQuality=StiTextQuality.Standard,h.margins=new StiMargins(1,1,10,7),m.Component=h,t.aspectRatio)__.c.StiPdfRenderText.renderTextFont(m),__.c.StiPdfRenderText.renderText(m,null,!1);else{h.horAlignment=StiTextHorAlignment.Center,h.vertAlignment=StiVertAlignment.Center,h.margins=new StiMargins(0,0,1,0);let t=r.Width/r.Height,e=1<t?t:1,i=1<t?1:1/t;this.pageStream.writeLine("q"),this.pushColorToStack(),this.pageStream.writeLine1("1 0 0 1 {0} {1} cm",this.convertToString(r.X),this.convertToString(r.Y)),this.pageStream.writeLine1("{0} 0 0 {1} 0 0 cm",this.convertToString(e),this.convertToString(i)),m.X=0,m.Y=0,n=Math.min(r.Width,r.Height),m.Width=m.Height=n,__.c.StiPdfRenderText.renderTextFont(m),__.c.StiPdfRenderText.renderText(m,null,!1),this.pageStream.writeLine("Q"),this.popColorFromStack()}}renderWatermark(i,t,m,h,e){let c=i.watermark;if(null!=c&&c.enabled){if(null!=c.image&&c.showImageBehind==t){let i=this.imageList[this.imagesCurrent],r=i.Width*this.hiToTwips*c.imageMultipleFactor,n=i.Height*this.hiToTwips*c.imageMultipleFactor,a=0,o=0,s=1,t=1,e=c.imageAlignment,l=c.imageTiling;if(c.imageStretch){let t=n/r;r=m,n=h,l=!1,c.aspectRatio&&(t<h/m?n=r*t:r=n/t)}switch((c.imageStretch||1<c.imageMultipleFactor)&&this.imageInterpolationTable.set(this.imageCache.imageIndex[this.imagesCurrent],!0),l&&(e=Stimulsoft.System.Drawing.ContentAlignment.TopLeft,s=StiMath.round2(m/r)+1,t=StiMath.round2(h/n)+1),e){case Stimulsoft.System.Drawing.ContentAlignment.TopCenter:case Stimulsoft.System.Drawing.ContentAlignment.MiddleCenter:case Stimulsoft.System.Drawing.ContentAlignment.BottomCenter:a=(m-r)/2;break;case Stimulsoft.System.Drawing.ContentAlignment.TopRight:case Stimulsoft.System.Drawing.ContentAlignment.MiddleRight:case Stimulsoft.System.Drawing.ContentAlignment.BottomRight:a=m-r;break}switch(e){case Stimulsoft.System.Drawing.ContentAlignment.TopLeft:case Stimulsoft.System.Drawing.ContentAlignment.TopCenter:case Stimulsoft.System.Drawing.ContentAlignment.TopRight:o=h-n;break;case Stimulsoft.System.Drawing.ContentAlignment.MiddleLeft:case Stimulsoft.System.Drawing.ContentAlignment.MiddleCenter:case Stimulsoft.System.Drawing.ContentAlignment.MiddleRight:o=(h-n)/2;break}this.setNonStrokeColor(Color.fromArgb3(255-c.imageTransparency,Color.black));for(let e=0;e<t;e++)for(let t=0;t<s;t++)this.pageStream.writeLine("q"),this.pushColorToStack(),this.pageStream.writeLine1("{0} 0 0 {1} {2} {3} cm",this.convertToString(r),this.convertToString(n),this.convertToString(a+r*t),this.convertToString(o-n*e)),this.pageStream.writeLine1("/{0} Do",i.Name),this.pageStream.writeLine("Q"),this.popColorFromStack();this.imagesCurrent++}if(!StiString.isNullOrEmpty(c.text)&&c.showBehind==t){let t=new m$(this),e=(t.X=0,t.Y=0,t.Width=m,t.Height=h,new StiText(new F(t.X,t.Y,t.Width,t.Height)));e.text=c.text,e.textBrush=c.textBrush,e.font=c.font,e.textOptions=new Stimulsoft.Base.Drawing.StiTextOptions,e.textOptions.angle=c.angle,e.horAlignment=Stimulsoft.Base.Drawing.StiTextHorAlignment.Center,e.vertAlignment=StiVertAlignment.Center,e.page=i,e.textQuality=__.a.Components.StiTextQuality.Standard,t.Component=e,__.c.StiPdfRenderText.renderTextFont(t),__.c.StiPdfRenderText.renderText(t)}}}storeShadingData1(i,r){if(null!=i){if(i.is(StiGradientBrush)){let t=i,e=new o$;e.Angle=t.angle,e.Page=r,e.FunctionIndex=this.getShadingFunctionNumber([t.startColor,t.endColor]),this.shadingArray.push(e)}if(i.is(StiGlareBrush)){let t=i,e=new o$;e.Angle=t.angle,e.FunctionIndex=this.getShadingFunctionNumber([t.startColor,t.endColor,t.startColor]),e.Page=r,this.shadingArray.push(e)}if(i.is(StiLinearGradientBrush)){let t=i,e=new o$;e.Angle=t.angle,e.FunctionIndex=this.getShadingFunctionNumber(t.colors),e.Page=r,this.shadingArray.push(e)}}}storeShadingData2(e,i,r,n,a,o=0){if(null!=a&&(a.is(StiGradientBrush)||a.is(StiGlareBrush)||a.is(StiLinearGradientBrush))){let t=this.shadingArray[this.shadingCurrent];t.X=e,t.Y=i,t.Width=r,t.Height=n,0==t.Angle&&0<r&&0<n&&a.is(StiGradientBrush)&&(t.Angle=180*Math.atan2(n,r)/Math.PI),t.Angle+=o,this.shadingArray[this.shadingCurrent]=t,this.shadingCurrent++}return this.shadingCurrent}storeHatchData(e){if(null!=e&&(e.is(StiHatchBrush)&&this.getHatchNumber(e),e.is(StiGlassBrush))){let t=e.as(StiGlassBrush);t.drawHatch}}renderMetadata(e){let t=new MemoryStream,i='<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>\r\n',r=(t.writeString(i),new MemoryStream),n=new XmlTextWriter(Stimulsoft.System.Text.Encoding.UTF8,r);if(n.formatting=Stimulsoft.System.Xml.Formatting.Indented,n.writeStartElement("x:xmpmeta"),n.writeAttributeString("xmlns:x","adobe:ns:meta/"),n.writeAttributeString("x:xmptk","Adobe XMP Core 4.0-c316 44.253921, Sun Oct 01 2006 17:14:39"),n.writeStartElement("rdf:RDF"),n.writeAttributeString("xmlns:rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#"),n.writeStartElement("rdf:Description"),n.writeAttributeString("rdf:about",""),n.writeAttributeString("xmlns:xap","http://ns.adobe.com/xap/1.0/"),n.writeElementString("xap:ModifyDate",this.currentDateTimeMeta),n.writeElementString("xap:CreateDate",this.currentDateTimeMeta),n.writeElementString("xap:MetadataDate",this.currentDateTimeMeta),n.writeElementString("xap:CreatorTool",this.getCreatorString()),n.writeFullEndElement(),n.writeStartElement("rdf:Description"),n.writeAttributeString("rdf:about",""),n.writeAttributeString("xmlns:dc","http://purl.org/dc/elements/1.1/"),n.writeElementString("dc:format","application/pdf"),n.writeStartElement("dc:title"),n.writeStartElement("rdf:Alt"),StiString.isNullOrEmpty(e.reportName)||(n.writeStartElement("rdf:li"),n.writeAttributeString("xml:lang","x-default"),n.writeString(e.reportName),n.writeFullEndElement()),n.writeEndElement(),n.writeFullEndElement(),n.writeStartElement("dc:description"),n.writeStartElement("rdf:Alt"),StiString.isNullOrEmpty(e.reportAlias)||(n.writeStartElement("rdf:li"),n.writeAttributeString("xml:lang","x-default"),n.writeString(e.reportAlias),n.writeFullEndElement()),n.writeEndElement(),n.writeFullEndElement(),n.writeStartElement("dc:creator"),n.writeStartElement("rdf:Seq"),StiString.isNullOrEmpty(e.reportAuthor)||(n.writeStartElement("rdf:li"),n.writeAttributeString("xml:lang","x-default"),n.writeString(e.reportAuthor),n.writeFullEndElement()),n.writeEndElement(),n.writeFullEndElement(),n.writeStartElement("dc:subject"),n.writeStartElement("rdf:Bag"),!StiString.isNullOrEmpty(this.keywords)){let e=this.keywords.split(";");for(let t of e)n.writeStartElement("rdf:li"),n.writeString(t.trim()),n.writeFullEndElement()}n.writeEndElement(),n.writeFullEndElement(),n.writeFullEndElement(),n.writeStartElement("rdf:Description"),n.writeAttributeString("rdf:about",""),n.writeAttributeString("xmlns:xapMM","http://ns.adobe.com/xap/1.0/mm/"),n.writeElementString("xapMM:DocumentID",this.IDValueStringMeta),n.writeElementString("xapMM:InstanceID",this.IDValueStringMeta),n.writeFullEndElement(),n.writeStartElement("rdf:Description"),n.writeAttributeString("rdf:about",""),n.writeAttributeString("xmlns:pdf","http://ns.adobe.com/pdf/1.3/"),n.writeAttributeString("xmlns:pdfx","http://ns.adobe.com/pdf/1.3/"),n.writeElementString("pdf:Producer",this.producerName),n.writeElementString("pdf:Keywords",this.keywords);for(let t of e.metaTags.list)t.name.startsWith("pdf:")&&n.writeElementString("pdfx:"+t.name.substr(4),t.tag);if(n.writeFullEndElement(),this.zugferdComplianceMode!=__.c.StiPdfZUGFeRDComplianceMode.None&&(n.writeStartElement("rdf:Description"),n.writeAttributeString("xmlns:pdfaExtension","http://www.aiim.org/pdfa/ns/extension/"),n.writeAttributeString("xmlns:pdfaField","http://www.aiim.org/pdfa/ns/field#"),n.writeAttributeString("xmlns:pdfaProperty","http://www.aiim.org/pdfa/ns/property#"),n.writeAttributeString("xmlns:pdfaSchema","http://www.aiim.org/pdfa/ns/schema#"),n.writeAttributeString("xmlns:pdfaType","http://www.aiim.org/pdfa/ns/type#"),n.writeAttributeString("rdf:about",""),n.writeStartElement("pdfaExtension:schemas"),n.writeStartElement("rdf:Bag"),n.writeStartElement("rdf:li"),n.writeAttributeString("rdf:parseType","Resource"),this.zugferdComplianceMode==__.c.StiPdfZUGFeRDComplianceMode.V1&&(n.writeElementString("pdfaSchema:schema","ZUGFeRD PDFA Extension Schema"),n.writeElementString("pdfaSchema:namespaceURI","urn:ferd:pdfa:CrossIndustryDocument:invoice:1p0#"),n.writeElementString("pdfaSchema:prefix","zf")),this.zugferdComplianceMode==__.c.StiPdfZUGFeRDComplianceMode.V2&&(n.writeElementString("pdfaSchema:schema","ZUGFeRD PDFA Extension Schema"),n.writeElementString("pdfaSchema:namespaceURI","urn:zugferd:pdfa:CrossIndustryDocument:invoice:2p0#"),n.writeElementString("pdfaSchema:prefix","zf")),this.zugferdComplianceMode==__.c.StiPdfZUGFeRDComplianceMode.V2_1&&(n.writeElementString("pdfaSchema:schema","Factur-X/ZUGFeRD PDF/A Extension Schema"),n.writeElementString("pdfaSchema:namespaceURI","urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#"),n.writeElementString("pdfaSchema:prefix","fx")),n.writeStartElement("pdfaSchema:property"),n.writeStartElement("rdf:Seq"),n.writeStartElement("rdf:li"),n.writeAttributeString("rdf:parseType","Resource"),n.writeElementString("pdfaProperty:name","DocumentFileName"),n.writeElementString("pdfaProperty:valueType","Text"),n.writeElementString("pdfaProperty:category","external"),n.writeElementString("pdfaProperty:description","Name of the embedded XML invoice file"),n.writeFullEndElement(),n.writeStartElement("rdf:li"),n.writeAttributeString("rdf:parseType","Resource"),n.writeElementString("pdfaProperty:name","DocumentType"),n.writeElementString("pdfaProperty:valueType","Text"),n.writeElementString("pdfaProperty:category","external"),n.writeElementString("pdfaProperty:description","INVOICE"),n.writeFullEndElement(),n.writeStartElement("rdf:li"),n.writeAttributeString("rdf:parseType","Resource"),n.writeElementString("pdfaProperty:name","Version"),n.writeElementString("pdfaProperty:valueType","Text"),n.writeElementString("pdfaProperty:category","external"),this.zugferdComplianceMode==__.c.StiPdfZUGFeRDComplianceMode.V2_1?n.writeElementString("pdfaProperty:description","Version of the Factur-X/ZUGFeRD XML schema"):n.writeElementString("pdfaProperty:description","The actual version of the ZUGFeRD data"),n.writeFullEndElement(),n.writeStartElement("rdf:li"),n.writeAttributeString("rdf:parseType","Resource"),n.writeElementString("pdfaProperty:name","ConformanceLevel"),n.writeElementString("pdfaProperty:valueType","Text"),n.writeElementString("pdfaProperty:category","external"),this.zugferdComplianceMode==__.c.StiPdfZUGFeRDComplianceMode.V2_1?n.writeElementString("pdfaProperty:description","Conformance level of the embedded Factur-X/ZUGFeRD XML invoice data"):n.writeElementString("pdfaProperty:description","The conformance level of the ZUGFeRD data"),n.writeFullEndElement(),n.writeFullEndElement(),n.writeFullEndElement(),n.writeFullEndElement(),n.writeFullEndElement(),n.writeFullEndElement(),n.writeFullEndElement(),n.writeStartElement("rdf:Description"),this.zugferdComplianceMode==__.c.StiPdfZUGFeRDComplianceMode.V1&&(n.writeAttributeString("xmlns:zf","urn:ferd:pdfa:CrossIndustryDocument:invoice:1p0#"),n.writeAttributeString("zf:DocumentFileName","ZUGFeRD-invoice.xml"),n.writeAttributeString("zf:ConformanceLevel",this.zugferdConformanceLevel),n.writeAttributeString("zf:DocumentType","INVOICE"),n.writeAttributeString("zf:Version","1.0")),this.zugferdComplianceMode==__.c.StiPdfZUGFeRDComplianceMode.V2&&(n.writeAttributeString("xmlns:zf","urn:zugferd:pdfa:CrossIndustryDocument:invoice:2p0#"),n.writeAttributeString("zf:DocumentFileName","zugferd-invoice.xml"),n.writeAttributeString("zf:ConformanceLevel",this.zugferdConformanceLevel),n.writeAttributeString("zf:DocumentType","INVOICE"),n.writeAttributeString("zf:Version","1.0")),this.zugferdComplianceMode==__.c.StiPdfZUGFeRDComplianceMode.V2_1&&(n.writeAttributeString("xmlns:fx","urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#"),n.writeAttributeString("fx:DocumentFileName","factur-x.xml"),n.writeAttributeString("fx:ConformanceLevel",this.zugferdConformanceLevel),n.writeAttributeString("fx:DocumentType","INVOICE"),n.writeAttributeString("fx:Version","1.0")),n.writeAttributeString("rdf:about",""),n.writeFullEndElement()),this.usePdfA){n.writeStartElement("rdf:Description"),n.writeAttributeString("rdf:about",""),n.writeAttributeString("xmlns:pdfaid","http://www.aiim.org/pdfa/ns/id/");let t="1";switch(this.pdfComplianceMode){case __.c.StiPdfComplianceMode.A1:t="1";break;case __.c.StiPdfComplianceMode.A2:t="2";break;case __.c.StiPdfComplianceMode.A3:t="3";break}let e="A";switch(this.zugferdComplianceMode){case __.c.StiPdfZUGFeRDComplianceMode.V1:e="A";break;case __.c.StiPdfZUGFeRDComplianceMode.V2:e="B";break;case __.c.StiPdfZUGFeRDComplianceMode.V2_1:e="B";break}n.writeElementString("pdfaid:part",t),n.writeElementString("pdfaid:conformance",e),n.writeFullEndElement()}n.writeFullEndElement(),n.writeFullEndElement(),n.writeString(" \r\n"),n.writeString(" \r\n"),n.writeString(" \r\n"),n.writeString(" \r\n"),n.writeString(" \r\n");let a=r.toArray();n.close(),r.close(),t.write(a,0,a.length),t.writeString('<?xpacket end="w"?>'),this.addXref(this.info.metadata.ref),this.sw.writeLine1("{0} 0 obj",this.info.metadata.ref),this.sw.writeLine("<<"),this.sw.writeLine("/Type /Metadata"),this.sw.writeLine("/Subtype /XML"),this.storeMemoryStream2(t,"/Length {0}"),this.sw.writeLine(""),this.sw.writeLine("endstream"),this.sw.writeLine("endobj"),this.sw.writeLine("")}renderColorSpace(){this.addXref(this.info.destOutputProfile.ref),this.sw.writeLine1("{0} 0 obj",this.info.destOutputProfile.ref),this.sw.writeLine("<<"),this.sw.writeLine("/N 3");let t=null,e=null;e=1==this.compressed?(t=__.c.StiExportUtils.makePdfDeflateStream(__.c.StiPdfResources.sRGBprofile),"/Length {0} /Filter [/FlateDecode] /Length1 "+__.c.StiPdfResources.sRGBprofile.length.toString()):((t=new MemoryStream).write(__.c.StiPdfResources.sRGBprofile,0,__.c.StiPdfResources.sRGBprofile.length),"/Length {0}"),this.storeMemoryStream2(t,e),this.sw.writeLine(""),this.sw.writeLine("endstream"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(this.info.outputIntents.ref),this.sw.writeLine1("{0} 0 obj",this.info.outputIntents.ref),this.sw.writeLine("[<<"),this.storeStringLine("/Info","sRGB IEC61966-2.1"),this.storeStringLine("/OutputConditionIdentifier","Custom"),this.storeStringLine("/OutputCondition",""),this.storeStringLine("/RegistryName",""),this.sw.writeLine("/S /GTS_PDFA1"),this.sw.writeLine1("/DestOutputProfile {0} 0 R",this.info.destOutputProfile.ref),this.sw.writeLine("/Type /OutputIntent"),this.sw.writeLine(">>]"),this.sw.writeLine("endobj"),this.sw.writeLine("")}renderAutoPrint(){this.autoPrint!=__.c.StiPdfAutoPrintMode.None&&(this.addXref(this.info.embeddedJS.ref),this.sw.writeLine1("{0} 0 obj",this.info.embeddedJS.ref),this.sw.writeLine("<<"),this.sw.writeLine1("/Names [(EmbeddedJS) {0} 0 R]",this.info.embeddedJS.content.ref),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(this.info.embeddedJS.content.ref),this.sw.writeLine1("{0} 0 obj",this.info.embeddedJS.content.ref),this.sw.writeLine("<<"),this.sw.writeLine("/S /JavaScript"),this.sw.writeLine1("/JS (print\\({0}\\);)",this.autoPrint==__.c.StiPdfAutoPrintMode.Dialog?"true":"false"),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine(""))}renderEmbeddedFiles(){for(let t=0;t<this.info.embeddedFilesList.length;t++){let e=this.embeddedFiles[t];if(this.addXref(this.info.embeddedFilesList[t].ref),this.sw.writeLine1("{0} 0 obj",this.info.embeddedFilesList[t].ref),this.sw.writeLine("<<"),this.storeStringLine("/F",e.name,!0),this.sw.writeLine("/Type /Filespec"),this.sw.writeLine("/EF <<"),this.sw.writeLine1("/F {0} 0 R",this.info.embeddedFilesList[t].content.ref),this.sw.writeLine(">>"),this.zugferdComplianceMode==__.c.StiPdfZUGFeRDComplianceMode.None&&this.pdfComplianceMode!=__.c.StiPdfComplianceMode.A3||this.sw.writeLine("/AFRelationship /Alternative"),this.storeStringLine("/UF",e.name,!0),this.storeStringLine("/Desc",e.description,!0),this.sw.writeLine(">>"),this.sw.writeLine("endobj"),this.sw.writeLine(""),this.addXref(this.info.embeddedFilesList[t].content.ref),this.sw.writeLine1("{0} 0 obj",this.info.embeddedFilesList[t].content.ref),this.sw.writeLine("<<"),this.sw.writeLine1("/Subtype /{0}",e.MIMEType[Stimulsoft.System.StiObject.stimulsoft]().replaceAll("/","#2F")),this.sw.writeLine("/Type /EmbeddedFile"),this.sw.writeLine("/Params <<"),this.storeStringLine("/ModDate ","D:"+this.currentDateTime),this.sw.writeLine1("/Size {0}",e.data.length),this.sw.writeLine(">>"),this.compressed){let t=__.c.StiExportUtils.makePdfDeflateStream(e.data);this.storeMemoryStream2(t,"/Filter [/FlateDecode] /Length {0}")}else if(e.data instanceof Uint8Array)this.storeMemoryStream3(e.data,"/Length {0}");else if(e.data instanceof Array)this.storeMemoryStream4(e.data,"/Length {0}");else{let t=Stimulsoft.System.Text.Encoding.UTF8.getBytes(e.data);this.storeMemoryStream4(t,"/Length {0}")}this.sw.writeLine(""),this.sw.writeLine("endstream"),this.sw.writeLine("endobj"),this.sw.writeLine("")}}addBookmarkNode(a,t){let e=new s$,o=(e.Parent=-1,e.First=-1,e.Last=-1,e.Prev=-1,e.Next=-1,e.Count=-1,e.Page=-1,e.Y=-1,e.Title="",e.Guid="",e.Used=-1==t,this.bookmarksTree.push(e),this.bookmarksTree[Stimulsoft.System.StiObject.stimulsoft]().countItems-1);if(e.Parent=t,e.Title=a.text,e.Guid=a.componentGuid,0==a.bookmarks.count)e.Count=0;else{let n=-1;for(let r=0;r<=a.bookmarks.count-1;r++){let t=this.bookmarksTree[Stimulsoft.System.StiObject.stimulsoft]().countItems,e=a.bookmarks.list[r],i=(this.addBookmarkNode(e,o),this.bookmarksTree[t]);r<a.bookmarks.count-1&&(i.Next=this.bookmarksTree[Stimulsoft.System.StiObject.stimulsoft]().countItems),0<r&&(i.Prev=n),this.bookmarksTree[t]=i,n=t}e.First=o+1,e.Last=this.bookmarksTree[Stimulsoft.System.StiObject.stimulsoft]().countItems-1,e.Count=this.bookmarksTree[Stimulsoft.System.StiObject.stimulsoft]().countItems-o-1}this.bookmarksTree[o]=e}makeBookmarkFromTree(i,e){if(i.text=e.Title,i.bookmarks=new StiBookmarksCollection,0<e.Count){let t=e.First;while(-1!=t){let e=this.bookmarksTree[t];if(e.Used){let t=new StiBookmark;i.bookmarks.add(t),this.makeBookmarkFromTree(t,e)}t=e.Next}}}exportPdf(t,e,i){try{this.exportPdf1(t,e,i)}finally{}}exportPdf1(g,t,e){var s,l,r,S,p,d;if(null==Stimulsoft.Base[["St","iL","ic","en","se"].join("")].key&&console.warn("You are using a trial version of the Stimulsoft product!"),__.a.StiLogService.write(this[Stimulsoft.System.StiObject.stimulsoft]().getType(),"Export report to Pdf format"),null==e)throw new Error("The 'settings' argument cannot be equal in null.");this.report=g;let i=e.pageRange,u=e.imageResolution,n=(this.imageResolutionMode=e.imageResolutionMode,this.imageQuality=e.imageQuality,this.embeddedFonts=e.embeddedFonts,this.standardPdfFonts=!!e.standardPdfFonts,this.compressed=!!e.compressed,this.useUnicodeMode=e.useUnicode,e.passwordInputUser),a=e.passwordInputOwner,o=e.userAccessPrivileges,m=(this.keyLength=e.keyLength,this.pdfComplianceMode=e.pdfComplianceMode,this.autoPrint=e.autoPrintMode,this.imageCompressionMethod=e.imageCompressionMethod,this.allowEditable=e.allowEditable,this.embeddedFiles=e.embeddedFiles,this.zugferdComplianceMode=e.ZUGFeRDComplianceMode,this.zugferdConformanceLevel=e.ZUGFeRDConformanceLevel,e.ZUGFeRDInvoiceData);if(this.creatorName=this.getCreatorString(),this.keywords=Stimulsoft.StiOptions.Export.Pdf.keywordsString,StiString.isNullOrEmpty(e.creatorString)||(this.creatorName=e.creatorString),StiString.isNullOrEmpty(e.keywordsString)||(this.keywords=e.keywordsString),StiString.isNullOrEmpty(this.creatorName)&&(this.creatorName=this.producerName),null==this.embeddedFiles&&(this.embeddedFiles=new List),null!=g.dictionary.resources)for(let i of g.dictionary.resources.list){if(i.availableInTheViewer){let t=i.alias!=i.name?i.alias:"",e=new StiPdfEmbeddedFileData(i.name+i.getFileExt(),t,i.content,i.getContentType());this.embeddedFiles.add(e)}i.type==StiResourceType.Xml&&("ZUGFeRD-invoice"==i.name?(this.zugferdComplianceMode=__.c.StiPdfZUGFeRDComplianceMode.V1,this.embeddedFiles.add(new StiPdfEmbeddedFileData("ZUGFeRD-invoice.xml","ZUGFeRD Invoice",i.content,"text/xml"))):"zugferd-invoice"==i.name.toLowerCase()?(this.zugferdComplianceMode=__.c.StiPdfZUGFeRDComplianceMode.V2,this.embeddedFiles.add(new StiPdfEmbeddedFileData("zugferd-invoice.xml","ZUGFeRD Invoice",i.content,"text/xml"))):"factur-x"==i.name.toLowerCase()&&(this.zugferdComplianceMode=__.c.StiPdfZUGFeRDComplianceMode.V2_1,this.embeddedFiles.add(new StiPdfEmbeddedFileData("factur-x.xml","Factur-X/ZUGFeRD",i.content,"text/xml"))))}if(this.zugferdComplianceMode!=__.c.StiPdfZUGFeRDComplianceMode.None&&(this.pdfComplianceMode=__.c.StiPdfComplianceMode.A3,null!=m)){let i=!1;for(let e of this.embeddedFiles){let t=e.name.toLowerCase();"zugferd-invoice.xml"!=t&&"factur-x.xml"!=t||(i=!0)}i||(this.zugferdComplianceMode==__.c.StiPdfZUGFeRDComplianceMode.V1&&this.embeddedFiles.add(new StiPdfEmbeddedFileData("ZUGFeRD-invoice.xml","ZUGFeRD Rechnung",m)),this.zugferdComplianceMode==__.c.StiPdfZUGFeRDComplianceMode.V2&&this.embeddedFiles.add(new StiPdfEmbeddedFileData("zugferd-invoice.xml","ZUGFeRD Rechnung",m)),this.zugferdComplianceMode==__.c.StiPdfZUGFeRDComplianceMode.V2_1&&this.embeddedFiles.add(new StiPdfEmbeddedFileData("factur-x.xml","Factur-X/ZUGFeRD",m)))}1<this.embeddedFiles.countItems&&(this.embeddedFiles=this.embeddedFiles.orderBy(t=>t.name).toList()),this.usePdfA=this.pdfComplianceMode!=__.c.StiPdfComplianceMode.None,this.useTransparency=this.pdfComplianceMode!=__.c.StiPdfComplianceMode.A1,this.embeddedFonts||(this.useUnicodeMode=!1),this.compressedFonts=!0,this.usePdfA&&(this.standardPdfFonts=!1,this.embeddedFonts=!0,this.useUnicodeMode=!0);let h=i.rangeType!=__.a.StiRangeType.All,c=!this.usePdfA;this.embeddedFonts&&(this.standardPdfFonts=!1),this.imageQuality<0&&(this.imageQuality=0),1<this.imageQuality&&(this.imageQuality=1),this.useUnicodeMode&&(this.standardPdfFonts=!1),u<10&&(u=10),u/=100,this.imageResolutionMain=u,this.pdfFont=new __.c.PdfFonts,this.pdfFont.standardPdfFonts=this.standardPdfFonts,this.pdfFont.forceUseUnicode=this.useUnicodeMode,this.fontGlyphsReduceNotNeed=null;for(let i=0;i<=255;i++){let t=StiMath.round2(i/255,3),e=t.toString().split(",").join(Stimulsoft.System.Globalization.CultureInfo.currentCulture.numberFormat.numberDecimalSeparator);this.colorTable[i]=e,this.alphaTable[i]=!1}if(this.lastColorStrokeA=255,this.lastColorNonStrokeA=255,this.colorStack=new Array,this.imageList=new Array,null!=this.exportCache)this.imageCache=this.exportCache.imageCache;else switch(this.imageCompressionMethod){case __.c.StiPdfImageCompressionMethod.Flate:this.imageCache=new __.a.StiImageCache(!0,!0,__.a.ImageFormat.MemoryBmp,this.imageQuality,c);break;default:this.imageCache=new __.a.StiImageCache(!0,!0,__.a.ImageFormat.Jpeg,this.imageQuality,c);break}this.imageInterpolationTable=new Hashtable,this.imageCacheIndexToList=new Hashtable,this.imageInfoList=new Hashtable,this.imageInfoCounter=0,this.pdfFont.fontList=new Array,this.xref=new Array,this.bookmarksTree=new Array,this.haveBookmarks=!1,this.linksArray=new Array,this.annotsArray=new Array,this.annots2Array=new Array,this.unsignedSignaturesArray=new Array,this.shadingArray=new Array,this.shadingFunctionArray=new Array,this.hatchArray=new Array,this.tooltipsArray=new Array,this.sw=t,this.fontsCounter=0,this.bookmarksCounter=0,this.linksCounter=0,this.annotsCounter=0,this.annots2Counter=0,this.tooltipsCounter=0;for(let t=0;t<256;t++)this.CodePage1252[t]=t;for(let t=0;t<32;t++)this.CodePage1252[128+t]=this.CodePage1252part80AF[t];this.fontGlyphsReduceNotNeed=StiArray.create(Boolean,256),this.tempGeomWriter=new __.c.StiPdfGeomWriter(null,this);let w=DateTime.now,f=w.toString("yyyyMMddHHmmsszzz"),b=(this.currentDateTime=f.substr(0,17)+"'"+f.substr(18,2)+"'",this.currentDateTimeMeta=w.toString("yyyy-MM-ddTHH:mm:sszzz"),w.toString("yyyyMMddHHmmssffff")),E=(b=(b=(b=(b+=this.producerName)+this.creatorName)+g.reportAuthor)+g.reportAlias+g.reportName,"");for(let t=0;t<b.length;t++)E+=String.fromCharCode(255&b.charCodeAt(t));this.IDValue=Stimulsoft.Base.StiMD5Helper.MD5(E,!1);let y="";for(let t=0;t<this.IDValue.length;t++)y+=__.c.StiExportUtils.toHex(this.IDValue[t]);this.IDValueString=y,this.IDValueStringMeta=StiString.format("uuid:{0}-{1}-{2}-{3}-{4}",this.IDValueString.substring(0,8),this.IDValueString.substring(8,4),this.IDValueString.substring(12,4),this.IDValueString.substring(16,4),this.IDValueString.substring(20,12)).toLowerCase(),this.pdfSecurity=new __.c.StiPdfSecurity(this),this.usePdfA||(this.encrypted=this.pdfSecurity.computingCryptoValues(o,a,n,this.keyLength,this.IDValue)),this.encrypted&&this.useUnicodeMode&&(this.embeddedFonts=!0),this.currentPassNumber=0,this.maximumPassNumber=Stimulsoft.StiOptions.Export.Pdf.divideSegmentPages?3:2;let v=i.getSelectedPages(g.renderedPages),x=(Stimulsoft.StiOptions.Export.Pdf.divideSegmentPages&&(v=__.c.StiSegmentPagesDivider.divide(v,this,this.exportCache),this.currentPassNumber++),0==v.length&&v.add(new StiPage),null!=g.bookmark&&0!=g.bookmark.bookmarks.count&&(this.addBookmarkNode(g.bookmark,-1),this.haveBookmarks=!0,this.bookmarksCounter=this.bookmarksTree[Stimulsoft.System.StiObject.stimulsoft]().countItems),0);for(let r of v.list){if(v.getPage(r),this.storeShadingData1(r.brush,x),this.storeHatchData(r.brush),null!=r.hyperlinkValue&&0<r.hyperlinkValue.toString().trim().length&&!r.hyperlinkValue.toString().trim().startsWith("javascript:")&&!this.usePdfA){let t=new r$;t.Link=r.hyperlinkValue.ToString(),t.Page=x,this.linksArray.push(t)}null!=r.watermark&&r.watermark.enabled&&(StiString.isNullOrEmpty(r.watermark.text)||(null!=r.watermark.font&&this.pdfFont.getFontNumber(r.watermark.font),this.pdfFont.storeUnicodeSymbolsInMap(r.watermark.text),this.pdfFont.storeUnicodeSymbolsInMap(__.c.StiBidirectionalConvert2.convertString(r.watermark.text,!1)),this.storeShadingData1(r.watermark.textBrush,x),this.storeHatchData(r.watermark.textBrush)),1==r.watermark.showImageBehind)&&null!=r.watermark.image&&this.storeImageData(r.watermark.image,u,!1,r);let e=[],i=[];for(let t of r.components.list)(t.is(StiPrimitive)?i:e).push(t);e.push(...i),i.length=0;for(let o of e)if(o.enabled&&(!g.isPrinting||o.printable)){this.imageInfoCounter+=2;let t=0<(this.lastProcessedComponent=o).width&&0<o.height;if(t){let t=o.as(IStiBrush),e=(null!=t&&(this.storeShadingData1(t.brush,x),this.storeHatchData(t.brush)),o.isExportAsImage(__.a.StiExportFormat.Pdf)),i=o.as(StiShape);if(null!=i&&__.c.StiPdfRenderPrimitives.checkShape(i)&&(e=!1),(o.is(StiElectronicSignature)||o.is(StiPdfDigitalSignature))&&(e=!1),o.is(StiCheckBox)){let t=o;if(this.storeShadingData1(t.textBrush,x),this.storeHatchData(t.textBrush),this.allowEditable==__.c.StiPdfAllowEditable.Yes&&t.editable){let t=new q$;t.Page=x,t.Component=o,this.annots2Array.push(t)}continue}let r=o.as(StiImage);if(null!=r&&null!=r.icon){e=!1;let t=new Font("Stimulsoft",8);this.pdfFont.getFontNumber(t),this.pdfFont.storeUnicodeSymbolsInMap(__.a.StiFontIconsHelper.getContent(r.icon))}if(e){let e=!1,i=o;if(this.imageResolutionMode!=__.c.StiImageResolutionMode.Exactly&&null!=i&&null!=i.imageToDraw&&null!=i.imageToDraw.bytes){e=!0;let t=i.imageToDraw.horizontalResolution/100;this.imageResolutionMode==__.c.StiImageResolutionMode.NoMoreThan&&(t=i.stretch?i.imageToDraw.width/g.unit.convertToHInches(o.width):1/i.multipleFactor),t=this.storeImageData(i.imageToDraw,t,i.smoothing,o),this.imageInfoList.set(this.imageInfoCounter,t)}if(!e){let r=o.as(IStiExportImageExtended);if(null!=r){let t=u,e={ref:t},i=r.getImage(e,__.a.StiExportFormat.Pdf);t=e.ref,null!=i&&(this.storeImageData(i,t,!1,o),this.imageInfoList.set(this.imageInfoCounter,t))}}}let n=o.as(IStiFont),a=(null!=n&&this.pdfFont.getFontNumber(n.font),o[Stimulsoft.System.StiObject.stimulsoft]().as(IStiTextOptions));if(o.is(StiText)&&!e){let n=o,t=null!=a&&null!=a.textOptions&&a.textOptions.rightToLeft,r=new StringBuilder(n.text);if(n.allowHtmlTags)if(Stimulsoft.StiOptions.Engine.useNewHtmlEngine)this.storeWysiwygSymbols(n,x);else{let t=new Stimulsoft.Base.Drawing.StiHtmlTagsState(n.font.bold,n.font.italic,n.font.underline,n.font.strikeout,n.font.size,n.font.name,StiBrush.toColor(n.textBrush),StiBrush.toColor(n.brush),!1,!1,0,0,1,n.horAlignment),e=new Stimulsoft.Base.Drawing.StiHtmlState(t,0),i=Stimulsoft.Base.Drawing.StiTextRenderer.parseHtmlToStates(n.text,e);r=new StringBuilder;for(let e=0;e<i.length;e++){let t=i[e];r.append(Stimulsoft.Base.Drawing.StiTextRenderer.prepareStateText(t.text))}}this.pdfFont.storeUnicodeSymbolsInMap(r.toString()),this.pdfFont.storeUnicodeSymbolsInMap(__.c.StiBidirectionalConvert2.convertString(r.toString(),t));let e=o.as(IStiTextBrush);if(null!=n&&null!=e&&(this.storeShadingData1(e.textBrush,x),this.storeHatchData(e.textBrush)),this.allowEditable==__.c.StiPdfAllowEditable.Yes&&n.editable){let t=new q$;t.Page=x,this.annotsArray.push(t),this.fontGlyphsReduceNotNeed[this.pdfFont.currentFont]=!0}if(null!=n.indicator){let i=n.indicator[Stimulsoft.System.StiObject.stimulsoft]().as(StiIconSetIndicator);if(null!=i&&(i.icon!=StiIcon.None||null!=i.customIcon)){let t=StiIconSetHelper.getIcon(i),e=1;e=this.storeImageData(t,e,!0,o,"indicator_icon"),this.imageInfoList[this.imageInfoCounter]=e}let r=n.indicator[Stimulsoft.System.StiObject.stimulsoft]().as(StiDataBarIndicator);if(null!=r&&(r.textPlacement==StiDataBarTextPlacement.Inside||0!=r.value)&&r.brushType==__.a.Components.StiBrushType.Gradient){let t=r.value<0?r.negativeColor:r.positiveColor,e=StiColorUtils.light(t,200),i=new o$;i.Page=x,i.FunctionIndex=this.getShadingFunctionNumber([t,e]),this.shadingArray.push(i)}}}if(null==i||e||StiString.isNullOrWhiteSpace(i.getParsedText())||(this.pdfFont.storeUnicodeSymbolsInMap(i.getParsedText()),this.pdfFont.storeUnicodeSymbolsInMap(__.c.StiBidirectionalConvert2.convertString(i.getParsedText(),!1))),o.is(StiBarCode)&&!e){let t=new __.c.StiPdfGeomWriter(this.pageStream,this,!0),e=(t.pageNumber=x,__.c.StiBarCodeExportPainter.createNew(t)),i=o;if(!StiString.isNullOrEmpty(i.codeValue)&&null!=i.page){let t=g.unit.convertRectangleToHInches(i.clientRectangle);i.barCodeType.draw(e,i,t,1)}}else if(o.is(IStiChart)&&!e){let t=new m$(this);t.Component=o,__.c.StiPdfRenderChart.renderChart(t,!0,x)}else if(o.is(IStiGauge)&&!e){let t=new m$(this);t.Component=o,__.c.StiPdfRenderGauge.renderGauge(t,!0,x)}else if(o.is(StiSparkline)&&!e){let t=new m$(this);t.Component=o,__.c.StiPdfRenderChart.renderSparkline(t,!0,x)}if(o.is(StiElectronicSignature)){e=!1;let i=o.as(StiElectronicSignature);if(i.mode==StiSignatureMode.Draw){if(null!=(null==(s=i.image)?void 0:s.image)&&0<i.image.image.length){let t=null!=i.bitmapImageForExport?i.bitmapImageForExport:StiImageConverter.bytesToImage(i.image.image),e=t.horizontalResolution/100;e=this.storeImageData(t,e,!0,o,"signature_image"),this.imageInfoList.set(this.imageInfoCounter,e)}if(null!=i.draw.image){let t=null!=i.bitmapDrawForExport?i.bitmapDrawForExport:StiImageConverter.bytesToImage(i.draw.image);this.storeImageData(t,1,!0,o,"signature_draw"),this.imageInfoList.set(this.imageInfoCounter,1)}StiString.isNullOrWhiteSpace(null==(l=i.text)?void 0:l.text)||(this.pdfFont.getFontNumber(i.text.font),this.pdfFont.storeUnicodeSymbolsInMap(i.text.text),this.pdfFont.storeUnicodeSymbolsInMap(__.c.StiBidirectionalConvert2.convertString(i.text.text,!1)))}if(i.mode==StiSignatureMode.Type){let e=" "+i.type.fullName+" "+i.type.initials;if(!StiString.isNullOrWhiteSpace(e)){let t=new Font(Stimulsoft.Base.StiSignatureFontsHelper.getFontName(i.type.style),16);this.pdfFont.getFontNumber(t),this.pdfFont.storeUnicodeSymbolsInMap(e),this.pdfFont.storeUnicodeSymbolsInMap(__.c.StiBidirectionalConvert2.convertString(e,!1))}}}if(o.is(StiPdfDigitalSignature)){e=!1;let t=o.as(StiPdfDigitalSignature);StiString.isNullOrWhiteSpace(t.placeholder)||(this.pdfFont.getFontNumber(new Font("Segoe UI",10)),this.pdfFont.storeUnicodeSymbolsInMap(t.placeholder),this.pdfFont.storeUnicodeSymbolsInMap(__.c.StiBidirectionalConvert2.convertString(t.placeholder,!1)))}}if(null!=o.hyperlinkValue&&0<o.hyperlinkValue.toString().trim().length&&!o.hyperlinkValue.toString().trim().startsWith("javascript:")){let t=new r$;t.Link=o.hyperlinkValue.toString(),t.Page=x,this.linksArray.push(t)}if(null!=o.toolTipValue&&0<o.toolTipValue.toString().trim().length&&!this.usePdfA){let t=new r$;t.Page=x,this.tooltipsArray.push(t)}if(o.is(StiPdfDigitalSignature)){let t=new q$;t.Page=x,this.unsignedSignaturesArray.push(t)}if(null!=o.tagValue&&"pdfunsignedsignaturefield"==o.tagValue.toString().toLowerCase()&&!this.usePdfA){let t=new q$;t.Page=x,this.unsignedSignaturesArray.push(t)}}x++,null!=r.watermark&&r.watermark.enabled&&0==r.watermark.showImageBehind&&null!=r.watermark.image&&this.storeImageData(r.watermark.image,u,!1,r)}for(let t=0;t<this.pdfFont.fontList.length;t++)this.pdfFont.currentFont=t,this.pdfFont.storeUnicodeSymbolsInMap("…");if(0<this.unsignedSignaturesArray[Stimulsoft.System.StiObject.stimulsoft]().countItems&&(0<this.annotsArray[Stimulsoft.System.StiObject.stimulsoft]().countItems||0<this.annots2Array[Stimulsoft.System.StiObject.stimulsoft]().countItems))for(let e=0;e<this.pdfFont.fontList[Stimulsoft.System.StiObject.stimulsoft]().countItems;e++){let t=this.pdfFont.fontList[e];"Arial"==t.Name&&(this.fontGlyphsReduceNotNeed[e]=!0)}let A="";for(let t=32;t<256;t++)A+=String.fromCharCode(this.CodePage1252[t]);for(let t=0;t<this.pdfFont.fontList.length;t++)this.fontGlyphsReduceNotNeed[t]&&(this.pdfFont.currentFont=t,this.pdfFont.storeUnicodeSymbolsInMap(A));this.imagesCurrent=0,this.annotsCurrent=0,this.annots2Current=0,this.shadingCurrent=0,this.linksCounter=this.linksArray[Stimulsoft.System.StiObject.stimulsoft]().countItems,this.haveLinks=0<this.linksCounter,this.annotsCounter=this.annotsArray.length,this.annots2Counter=this.annots2Array.length,this.unsignedSignaturesCounter=this.unsignedSignaturesArray.length,this.haveAnnots=0<this.annotsCounter||0<this.annots2Counter||0<this.unsignedSignaturesCounter,this.tooltipsCounter=this.tooltipsArray[Stimulsoft.System.StiObject.stimulsoft]().countItems,this.haveTooltips=0<this.tooltipsCounter,this.pdfFont.InitFontsData(g),this.fontsCounter=this.pdfFont.fontList.length,this.info=new __.c.StiPdfStructure;for(let t=0;t<v.count;t++)this.info.pageList.push(this.info.createContentObject(!0));for(let t=0;t<this.imageCache.imagePackedStore.length;t++)this.info.xObjectList.push(this.info.createXObject(!0,null!=this.imageCache.imageMaskStore[t]));for(let e=0;e<this.pdfFont.fontList.length;e++){let t=this.pdfFont.fontList[e];this.info.fontList.push(this.info.createFontObject(!0,t.UseUnicode,this.standardPdfFonts,this.embeddedFonts||__.c.PdfFonts.isFontStimulsoft(t.Name)))}if(this.info.outlines=this.info.createOutlinesObject(this.haveBookmarks),this.haveBookmarks)for(let t=0;t<this.bookmarksCounter;t++)this.info.outlines.items.push(this.info.createObject(!0));this.info.patterns=this.info.createPatternsObject(!0);for(let t=0;t<this.hatchArray.length;t++)this.info.patterns.hatchItems.push(this.info.createObject(!0));for(let t=0;t<this.shadingArray.length;t++)this.info.patterns.shadingItems.push(this.info.createObject(!0));for(let t=0;t<this.shadingFunctionArray.length;t++)this.info.patterns.shadingFunctionItems.push(this.info.createObject(!0));for(let t=0;t<this.linksCounter;t++)this.info.linkList.push(this.info.createObject(!0));if(this.info.encode=this.info.createObject(this.encrypted),this.info.extGState=this.info.createObject(!0),this.info.acroForm=this.info.createAcroFormObject(this.haveAnnots||this.haveTooltips),this.haveAnnots){for(let t=0;t<this.annotsCounter;t++)this.info.acroForm.annots.push(this.info.createAnnotObject(!0,!0,0));for(let t=0;t<this.fontsCounter;t++)this.info.acroForm.annotFontItems.push(this.info.createFontObject(!0,!1,!1,!1,!0));for(let t=0;t<this.annots2Counter;t++)this.info.acroForm.checkBoxes.push(new __.c.StiPdfCheckBoxObjInfo),this.info.acroForm.checkBoxes[t].items=[],this.info.acroForm.checkBoxes[t].items.push(this.info.createAnnotObject(!0,!0,2)),this.info.acroForm.checkBoxes[t].items.push(this.info.createAnnotObject(!0,!0,2)),null==this.annots2Array[t].Component.as(StiCheckBox).checkedValue&&this.info.acroForm.checkBoxes[t].items.push(this.info.createAnnotObject(!0,!1,2));for(let t=0;t<this.unsignedSignaturesCounter;t++)this.info.acroForm.unsignedSignatures.push(this.info.createAnnotObject(!0,!1,0))}for(let t=0;t<this.tooltipsCounter;t++)this.info.acroForm.tooltips.push(this.info.createAnnotObject(!0,!1,0));this.info.metadata=this.info.createObject(!0),this.info.destOutputProfile=this.info.createObject(!0),this.info.outputIntents=this.info.createObject(!0),this.info.embeddedJS=this.info.createContentObject(this.autoPrint!=__.c.StiPdfAutoPrintMode.None),null!=this.embeddedFiles&&0<this.embeddedFiles.countItems&&this.embeddedFiles.forEach(t=>this.info.embeddedFilesList.push(this.info.createContentObject(!0))),this.renderStartDoc(g,v);let T=0;this.linksArray[Stimulsoft.System.StiObject.stimulsoft]().clear(),this.tagsArray=new Array,this.tooltipsArray[Stimulsoft.System.StiObject.stimulsoft]().clear(),this.unsignedSignaturesArray[Stimulsoft.System.StiObject.stimulsoft]().clear(),this.imageInfoCounter=0,this.currentPassNumber++;for(let c of v.list){if(v.getPage(c),this.isStopped)return;this.renderPageHeader(T++);let a=this.hiToTwips*g.unit.convertToHInches(c.pageHeight*c.segmentPerHeight),n=this.hiToTwips*g.unit.convertToHInches(c.pageWidth*c.segmentPerWidth),o=this.hiToTwips*g.unit.convertToHInches(c.margins.left),s=this.hiToTwips*g.unit.convertToHInches(c.margins.right),m=this.hiToTwips*g.unit.convertToHInches(c.margins.top),l=this.hiToTwips*g.unit.convertToHInches(c.margins.bottom);if(14400<a&&(a=14400),this.haveBookmarks&&(!StiString.isNullOrEmpty(c.guid)||null!=c.bookmarkValue&&""!=c.bookmarkValue.toString())){let i=0;while(i<this.bookmarksCounter){let e=this.bookmarksTree[i];if(0==e.Used&&-1==e.Page){let t=!1;if(StiString.isNullOrEmpty(e.Guid)?StiString.isNullOrEmpty(e.Title)||null!=c.bookmarkValue&&0<c.bookmarkValue.length&&e.Title==c.bookmarkValue&&(t=!0):StiString.isNullOrEmpty(c.guid)||e.Guid!=c.guid||(t=!0),t){e.Page=T-1,e.Y=a,e.Used=!0,this.bookmarksTree[i]=e;break}}i++}}if(null!=c.hyperlinkValue&&0<c.hyperlinkValue.toString().trim().length&&!c.hyperlinkValue.toString().trim().startsWith("javascript:")&&!this.usePdfA){let t=new r$;t.Link=c.hyperlinkValue.toString(),t.X=0,t.Y=0,t.Width=n,t.Height=a,t.Page=T,t.DestPage=-1,t.DestY=-1,this.linksArray.push(t)}if(null!=c.brush){let t=new m$(this),e=(t.X=0,t.Y=0,t.Width=n,t.Height=a,new StiContainer);e.brush=c.brush,e.border=null,t.Component=e,__.c.StiPdfRenderPrimitives.renderBorder1(t)}this.renderWatermark(c,!0,n,a,u);let t=null==(r=c.tagValue)?void 0:r[Stimulsoft.System.StiObject.stimulsoft]().as(String);if(!StiString.isNullOrWhiteSpace(t)&&t.startsWith("Segments:")){let r=Stimulsoft.System.StiNumber.tryParse(t.substring(9));if(r.successfully){let t=r.result,e=new Rectangle(0,0,n,a),i=1;0<(t&StiBorderSides.Left)&&(e.x+=o-i,e.width-=o-i),0<(t&StiBorderSides.Right)&&(e.width-=s-i),0<(t&StiBorderSides.Top)&&(e.height-=m-i),0<(t&StiBorderSides.Bottom)&&(e.y+=l-i,e.height-=l-i),this.pageStream.writeLine1("{0} {1} {2} {3} re W n",this.convertToString(e.x),this.convertToString(e.y),this.convertToString(e.width),this.convertToString(e.height))}}let h=new Array,e=[],i=[];for(let t of c.components.list)(t.is(StiPrimitive)?i:e).push(t);e.push(...i),i.length=0;for(let l of e)if(l.enabled&&(!g.isPrinting||l.printable)){this.imageInfoCounter+=2;let t=this.hiToTwips*g.unit.convertToHInches(l.left),e=this.hiToTwips*g.unit.convertToHInches(l.top),i=this.hiToTwips*g.unit.convertToHInches(l.right),r=this.hiToTwips*g.unit.convertToHInches(l.bottom),s=new m$(this),n=(s.X=t+o,s.Y=e+m,s.Width=i-t,s.Height=r-e,s.Y=a-(s.Y+s.Height),0<(s.Component=l).width&&0<l.height);if(n){let t=l.isExportAsImage(__.a.StiExportFormat.Pdf);if(this.usePdfA||l.printable||this.pageStream.writeLine("/OC /oc1 BDC"),l.is(StiShape)||__.c.StiPdfRenderPrimitives.renderBorder1(s),l.is(StiText)&&!t){let a=l,r=0,o=(this.haveAnnots&&a.editable&&(r=this.pageStream.position,this.pushColorToStack(),this.lastColorStrokeA=255,this.lastColorNonStrokeA=255),__.c.StiPdfRenderIndicators.renderIndicators(s));if(a.allowHtmlTags){if(__.c.StiPdfRenderText.renderTextFont(o),Stimulsoft.StiOptions.Engine.useNewHtmlEngine)__.c.StiPdfRenderText.renderText2(s,T);else{let t=new Stimulsoft.Base.Drawing.StiHtmlTagsState(a.font.bold,a.font.italic,a.font.underline,a.font.strikeout,a.font.size,a.font.name,StiBrush.toColor(a.textBrush),StiBrush.toColor(a.brush),!1,!1,0,0,1,a.horAlignment),e=new Stimulsoft.Base.Drawing.StiHtmlState(t,0),i=Stimulsoft.Base.Drawing.StiTextRenderer.parseHtmlToStates(a.text,e),r="";for(let e=0;e<i.length;e++){let t=i[e];if(t.ts.tag.tag==StiHtmlTag.P&&"\n"==t.text.toString())continue;r+=Stimulsoft.Base.Drawing.StiTextRenderer.prepareStateText(t.text)}let n=a.clone(!0);n.text=r,s.Component=n,__.c.StiPdfRenderText.renderTextFont(o),__.c.StiPdfRenderText.renderText(o)}if(this.haveAnnots&&a.editable){let i=this.annotsArray[this.annotsCurrent],r=(i.Multiline=a.wordWrap,i.X=s.X,i.Y=s.Y,i.Width=s.Width,i.Height=s.Height,i.Component=s.Component,i.Alignment=Stimulsoft.Base.Drawing.StiTextHorAlignment.Left,s.Component.as(IStiTextHorAlignment));if(null!=r){let t=r.horAlignment,e=s.Component.as(IStiTextOptions);null!=e&&null!=e.textOptions&&e.textOptions.rightToLeft&&(t==Stimulsoft.Base.Drawing.StiTextHorAlignment.Left?t=Stimulsoft.Base.Drawing.StiTextHorAlignment.Right:t==Stimulsoft.Base.Drawing.StiTextHorAlignment.Right&&(t=Stimulsoft.Base.Drawing.StiTextHorAlignment.Left)),i.Alignment=t}i.Text=s.Component.as(StiText).text.toString().split("\n").join("")}}else __.c.StiPdfRenderText.renderTextFont(o),__.c.StiPdfRenderText.renderText(o);if((0<this.annotsCounter||0<this.annots2Counter)&&a.editable){this.pageStream.flush();let t=this.pageStream.position,e=(this.pageStream.seek(r,Stimulsoft.System.IO.SeekOrigin.Begin),[]),i=(this.pageStream.read(e,0,t-r),this.pageStream.seek(r,Stimulsoft.System.IO.SeekOrigin.Begin),this.pageStream.setLength(r),this.annotsArray[this.annotsCurrent]);i.Content=e,this.annotsCurrent++,this.popColorFromStack()}}if(l.is(StiShape))__.c.StiPdfRenderPrimitives.renderShape(s,u);else if(l.is(StiBarCode)&&!t){let i=new __.c.StiPdfGeomWriter(this.pageStream,this),r=__.c.StiBarCodeExportPainter.createNew(i),n=l;if(i.componentAngle=-n.angle,!StiString.isNullOrEmpty(n.codeValue)&&null!=n.page){this.pageStream.writeLine("q"),this.pushColorToStack(),this.pageStream.writeLine1("{0} {1} {2} {3} re W n",this.convertToString(s.X),this.convertToString(s.Y),this.convertToString(s.Width),this.convertToString(s.Height)),this.pageStream.writeLine1("1 0 0 1 {0} {1} cm",this.convertToString(o),this.convertToString(a-m)),this.pageStream.writeLine("1 0 0 -1 0 0 cm"),this.pageStream.writeLine1("{0} 0 0 {0} 0 0 cm",this.convertToString(this.hiToTwips));let t=new Matrix(1,0,0,1,0,0),e=(t.translate(o,a-m),t.scale(1,-1),t.scale(this.hiToTwips,this.hiToTwips),i.pageNumber=T,i.matrixCache.push(t),g.unit.convertRectangleToHInches(n.clientRectangle));n.barCodeType.draw(r,n,e,1),this.pageStream.writeLine("Q"),this.popColorFromStack()}}else if(l.is(IStiChart)&&!t)this.pageStream.writeLine("q"),this.pushColorToStack(),this.pageStream.writeLine1("1 0 0 1 {0} {1} cm",this.convertToString(s.X),this.convertToString(s.Y+s.Height)),this.pageStream.writeLine("1 0 0 -1 0 0 cm"),this.pageStream.writeLine1("{0} 0 0 {0} 0 0 cm",this.convertToString(this.hiToTwips/.96)),__.c.StiPdfRenderChart.renderChart(s,!1,T-1),this.pageStream.writeLine("Q"),this.popColorFromStack();else if(l.is(IStiGauge)&&!t)this.pageStream.writeLine("q"),this.pushColorToStack(),this.pageStream.writeLine1("1 0 0 1 {0} {1} cm",this.convertToString(s.X),this.convertToString(s.Y+s.Height)),this.pageStream.writeLine("1 0 0 -1 0 0 cm"),this.pageStream.writeLine1("{0} 0 0 {0} 0 0 cm",this.convertToString(this.hiToTwips/.96)),__.c.StiPdfRenderGauge.renderGauge(s,!1,T-1),this.pageStream.writeLine("Q"),this.popColorFromStack();else if(l.is(StiSparkline)&&!t)this.pageStream.writeLine("q"),this.pushColorToStack(),this.pageStream.writeLine1("1 0 0 1 {0} {1} cm",this.convertToString(s.X),this.convertToString(s.Y+s.Height)),this.pageStream.writeLine("1 0 0 -1 0 0 cm"),this.pageStream.writeLine1("{0} 0 0 {0} 0 0 cm",this.convertToString(this.hiToTwips/.96)),__.c.StiPdfRenderChart.renderSparkline(s,!1,T-1),this.pageStream.writeLine("Q"),this.popColorFromStack();else if(l.is(StiElectronicSignature)){t=!1;let r=l,n=s.clone();if(r.mode==StiSignatureMode.Draw){if(null!=(null==(S=r.image)?void 0:S.image)&&0<r.image.image.length){let t=new StiImage(new F(l.left,l.top,l.width,l.height));t.image=null!=r.bitmapImageForExport?r.bitmapImageForExport:StiImageConverter.bytesToImage(r.image.image),t.horAlignment=r.image.horAlignment,t.vertAlignment=r.image.vertAlignment,t.stretch=r.image.stretch,t.aspectRatio=r.image.aspectRatio,t.page=c,n.Component=t,this.renderImage(n,u,!0)}if(null!=r.draw.image){let t=new StiImage(new F(l.left,l.top,l.width,l.height));t.image=null!=r.bitmapDrawForExport?r.bitmapDrawForExport:StiImageConverter.bytesToImage(r.draw.image),t.horAlignment=r.draw.horAlignment,t.vertAlignment=r.draw.vertAlignment,t.stretch=r.draw.stretch,t.aspectRatio=r.draw.aspectRatio,t.page=c,n.Component=t,this.imageInfoCounter++,this.renderImage(n,u,!0),this.imageInfoCounter--}if(!StiString.isNullOrWhiteSpace(null==(p=r.text)?void 0:p.text)){let t=new StiText(new F(l.left,l.top,l.width,l.height));t.text=null==(d=r.text)?void 0:d.text,t.textBrush=new StiSolidBrush(r.text.color),t.font=r.text.font,t.horAlignment=r.text.horAlignment,t.vertAlignment=r.text.vertAlignment,t.page=c,t.textQuality=StiTextQuality.Standard,n.Component=t,__.c.StiPdfRenderText.renderTextFont(n),__.c.StiPdfRenderText.renderText(n)}}if(r.mode==StiSignatureMode.Type){let i=" "+r.type.fullName+" "+r.type.initials+" ";if(!StiString.isNullOrWhiteSpace(i)){let t=new Font(StiSignatureFontsHelper.getFontName(r.type.style),16),e=new StiText(new F(l.left,l.top,l.width,l.height));e.text=i,e.textBrush=new StiSolidBrush(Color.black),e.font=t,e.horAlignment=StiTextHorAlignment.Left,e.vertAlignment=StiVertAlignment.Center,e.page=c,e.textQuality=StiTextQuality.Standard,n.Component=e,__.c.StiPdfRenderText.renderTextFont(n),__.c.StiPdfRenderText.renderText(n)}}}else if(l.is(StiPdfDigitalSignature)){t=!1;let i=l.as(StiPdfDigitalSignature);if(!StiString.isNullOrWhiteSpace(i.placeholder)){let t=new StiText(new F(l.left,l.top,l.width,l.height)),e=(t.text=i.placeholder,t.textBrush=new StiSolidBrush(Color.red),t.font=new Font("Segoe UI",10),t.horAlignment=StiTextHorAlignment.Center,t.vertAlignment=StiVertAlignment.Center,t.page=c,t.textQuality=StiTextQuality.Standard,s.clone());e.Component=t,__.c.StiPdfRenderText.renderTextFont(e),__.c.StiPdfRenderText.renderText(e)}}else if(l.is(StiCheckBox)){let e=l;if(this.haveAnnots&&e.editable){let t=this.annots2Array[this.annots2Current],e=(t.Multiline=!1,t.X=s.X,t.Y=s.Y,t.Width=s.Width,t.Height=s.Height,t.Component=s.Component,t.Alignment=Stimulsoft.Base.Drawing.StiTextHorAlignment.Center,t.Text="",s.X),i=s.Y,r=(s.X=0,s.Y=0,this.pageStream.flush(),this.pageStream.position),n=(this.pushColorToStack(),this.lastColorStrokeA=255,this.lastColorNonStrokeA=255,__.c.StiPdfRenderPrimitives.renderCheckbox(s,!0),this.pageStream.flush(),this.pageStream.position),a=(this.pageStream.seek(r,Stimulsoft.System.IO.SeekOrigin.Begin),[]);this.pageStream.read(a,0,n-r),this.pageStream.seek(r,Stimulsoft.System.IO.SeekOrigin.Begin),t.Content=a,this.popColorFromStack(),this.pageStream.flush(),r=this.pageStream.position,this.pushColorToStack(),this.lastColorStrokeA=255,this.lastColorNonStrokeA=255,__.c.StiPdfRenderPrimitives.renderCheckbox(s,!1,!1),this.pageStream.flush(),n=this.pageStream.position,this.pageStream.seek(r,Stimulsoft.System.IO.SeekOrigin.Begin),this.pageStream.read(a=[],0,n-r),this.pageStream.seek(r,Stimulsoft.System.IO.SeekOrigin.Begin),t.Content2=a,this.popColorFromStack(),this.annots2Current++,s.X=e,s.Y=i}else{let t=__.c.StiPdfRenderPrimitives.getCheckBoxValue(e);null!=t&&__.c.StiPdfRenderPrimitives.renderCheckbox(s,t)}}else if(t){let t=l.as(StiImage);null!=t&&null!=t.icon?this.renderIcon(s):this.renderImage(s,u)}if(l.is(StiRectanglePrimitive))__.c.StiPdfRenderPrimitives.renderRoundedRectanglePrimitive(s);else{let t=s.Component.as(IStiBorder);null!=t&&null!=t.border&&(t.border.topmost||s.Component.is(StiTableCell))?h.push(s):__.c.StiPdfRenderPrimitives.renderBorder2(s)}this.usePdfA||l.printable||this.pageStream.writeLine("EMC")}if(this.haveBookmarks&&(!StiString.isNullOrEmpty(l.guid)||null!=l.bookmarkValue&&""!=l.bookmarkValue)){let i=0;while(i<this.bookmarksCounter){let e=this.bookmarksTree[i];if(0==e.Used&&-1==e.Page){let t=!1;if(StiString.isNullOrEmpty(e.Guid)?StiString.isNullOrEmpty(e.Title)||null!=l.bookmarkValue&&0<l.bookmarkValue.length&&e.Title==l.bookmarkValue&&(t=!0):StiString.isNullOrEmpty(l.guid)||e.Guid!=l.guid||(t=!0),t){e.Page=T-1,e.Y=s.Y+s.Height,e.Used=!0,this.bookmarksTree[i]=e;break}}i++}}if(null!=l.hyperlinkValue&&0<l.hyperlinkValue.toString().trim().length&&!l.hyperlinkValue.toString().trim().startsWith("javascript:")){let t=new r$;t.Link=l.hyperlinkValue.toString(),t.X=s.X,t.Y=s.Y,t.Width=s.Width,t.Height=s.Height,t.Page=T,t.DestPage=-1,t.DestY=-1,this.linksArray.push(t)}if(null!=l.tagValue&&0<l.tagValue.toString().trim().length){let e=new r$;if(e.Link=l.tagValue.toString(),e.X=s.X,e.Y=s.Y,e.Width=s.Width,e.Height=s.Height,e.Page=T-1,e.DestPage=-1,e.DestY=-1,this.tagsArray.push(e),"pdfunsignedsignaturefield"==e.Link.trim().toLowerCase()&&!this.usePdfA){let t=new q$;t.X=e.X,t.Y=e.Y,t.Width=e.Width,t.Height=e.Height,t.Page=e.Page,t.Component=l,this.unsignedSignaturesArray.push(t)}}if(null!=l.pointerValue&&!StiString.isNullOrWhiteSpace(l.pointerValue)&&!StiString.isNullOrWhiteSpace(l.guid)){let t="#"+l.pointerValue+"#GUID#"+l.guid,e=new r$;e.Link=t,e.X=s.X,e.Y=s.Y,e.Width=s.Width,e.Height=s.Height,e.Page=T-1,e.DestPage=-1,e.DestY=-1,this.tagsArray.push(e)}if(null!=l.toolTipValue&&0<l.toolTipValue.toString().trim().length&&!this.usePdfA){let t=new r$;t.Link=l.toolTipValue.toString().trim(),t.X=s.X,t.Y=s.Y,t.Width=s.Width,t.Height=s.Height,t.Page=T-1,t.DestPage=-1,t.DestY=-1,this.tooltipsArray.push(t)}if(l.is(StiPdfDigitalSignature)){let t=new q$;t.X=s.X,t.Y=s.Y,t.Width=s.Width,t.Height=s.Height,t.Page=T-1,t.Component=l,this.unsignedSignaturesArray.push(t)}}for(let t of h)__.c.StiPdfRenderPrimitives.renderBorder2(t);if(h[Stimulsoft.System.StiObject.stimulsoft]().clear(),null!=c.border){let t=new m$(this),e=(t.X=o,t.Y=l,t.Width=n-o-s,t.Height=a-m-l,new StiContainer);e.border=c.border,t.Component=e,__.c.StiPdfRenderPrimitives.renderBorder2(t)}this.renderWatermark(c,!1,n,a,u),this.renderPageFooter(a,n)}if(this.bookmarksTreeTemp=null,this.haveBookmarks&&h){for(let e=0;e<this.bookmarksTree[Stimulsoft.System.StiObject.stimulsoft]().countItems;e++){let t=this.bookmarksTree[e];if(t.Used)while(-1!=t.Parent)(t=this.bookmarksTree[t.Parent]).Used=!0}let t=new StiBookmark,i=(this.makeBookmarkFromTree(t,this.bookmarksTree[0]),this.bookmarksTreeTemp=this.bookmarksTree,this.bookmarksTree=new Array,this.addBookmarkNode(t,-1),this.bookmarksCounter-this.bookmarksTree[Stimulsoft.System.StiObject.stimulsoft]().countItems);if(0<i){let e=new s$;e.Parent=-1,e.First=-1,e.Last=-1,e.Prev=-1,e.Next=-1,e.Count=-1,e.Page=-1,e.Y=-1,e.Title="";for(let t=0;t<i;t++)this.bookmarksTree.push(e)}let r=new Hashtable;for(let e=0;e<this.bookmarksTreeTemp[Stimulsoft.System.StiObject.stimulsoft]().countItems;e++){let t=this.bookmarksTreeTemp[e];r.set(t.Title,t)}for(let t=0;t<this.bookmarksTree[Stimulsoft.System.StiObject.stimulsoft]().countItems;t++){let e=this.bookmarksTree[t];if(!StiString.isNullOrEmpty(e.Title)){let t=r.get(e.Title);e.Page=t.Page,e.Y=t.Y}}this.bookmarksTreeTemp=null}this.renderImageTable(),this.renderFontTable(),this.renderBookmarksTable(),this.renderPatternTable(),this.renderLinkTable(),this.renderEncodeRecord(),this.renderExtGStateRecord(),this.renderAnnotTable(),this.renderTooltipTable(),this.renderMetadata(g),this.renderColorSpace(),this.renderAutoPrint(),this.renderEmbeddedFiles(),this.renderEndDoc(),this.xref=null,this.bookmarksTree=null,this.linksArray=null,this.tagsArray=null,this.tooltipsArray=null,this.annotsArray=null,this.annots2Array=null,this.unsignedSignaturesArray=null,this.shadingArray=null,this.hatchArray=null,this.colorStack=null,this.pdfFont.clear(),this.pdfFont=null,this.imageCache.clear(),this.tempGeomWriter=null}}t$.printScaling=!0,t$.regexEscape=new RegExp("([{}()^$&.*?/+|[\\\\]|]|-)","g"),__.c.StiPdfExportService=t$}let FontStyle=Stimulsoft.System.Drawing.FontStyle;{class Ofa{}__.c.PdfFontInfo=Ofa;class Pfa{}__.c.pfontInfo=Pfa;class Qfa{constructor(){this.TagString=null,this.Tag=0,this.CheckSum=0,this.Offset=0,this.Length=0,this.NewOffset=0,this.NewLength=0,this.Required=!1,this.NewTable=null}}class Rfa{constructor(){this.HeaderOffset=0,this.NumTables=0,this.NumTablesRequired=0,this.SfntVersion=0,this.Tables=null,this.HeadCheckSumOffset=0,this.NumGlyphs=0,this.IndexToLocFormat=0,this.IndexLocaTable=0,this.IndexGlyfTable=0,this.IndexCmapTable=0,this.IndexCFFTable=-1,this.FontName=null,this.HeaderOffset=0,this.NumTables=0,this.NumTablesRequired=0,this.SfntVersion=0,this.Tables=null,this.HeadCheckSumOffset=0,this.NumGlyphs=0,this.IndexToLocFormat=0,this.IndexLocaTable=0,this.IndexGlyfTable=0,this.FontName=new Hashtable}}class Sfa extends Ofa{getFontMetrics(t,n,a,e){if(this.WIDTHS=StiArray.create(Number,this.maxSymbols+1),null==t)return;let i=new Font(t.name,1024,t.style,Stimulsoft.System.Drawing.GraphicsUnit.Pixel),r=(StiArray.copy(n.UnicodeMapBack,0,this.WIDTHS,n.MappedSymbolsCount),Stimulsoft.System.Drawing.Graphics.measureChars(this.WIDTHS,n.MappedSymbolsCount,i)),o=r.height,s=r.width;n.CH=0,n.tmASC=StiMath.round2(.8*o*this.factor),n.tmDESC=StiMath.round2(.2*o*this.factor),n.tmExternal=StiMath.round2((s-o)*this.factor),n.LLX=0,n.LLY=0,n.URX=0,n.URY=0,n.StemV=0,n.ItalicAngle=0,n.UnderscoreSize=StiMath.round2(o*(t.bold?.08:.06)*this.factor),n.UnderscorePosition=StiMath.round2(.1*-o*this.factor),n.StrikeoutSize=StiMath.round2(.045*o*this.factor),n.StrikeoutPosition=StiMath.round2(.25*o*this.factor),Sfa.isFontStimulsoft(i.name)&&(n.tmASC=StiMath.round2(.86*o*this.factor),n.tmDESC=StiMath.round2(.14*o*this.factor));for(let t=0;t<n.MappedSymbolsCount;t++)this.WIDTHS[t]=StiMath.round2(this.WIDTHS[t]*this.factor,0);let l=this.getFontDataBuf(t,e);if(l instanceof Uint8Array&&0<l.byteLength){let r=this.getCharToGlyphTable(l,t.name);if(null!=r){let i=0;"Wingdings"!=t.name&&"Wingdings 2"!=t.name&&"Wingdings 3"!=t.name||(i=61440);for(let e=0;e<n.MappedSymbolsCount;e++){let t=n.UnicodeMapBack[e];32<=t&&t<=255&&(t+=i),n.GlyphList[e]=r[t]}}}let m=Graphics.getCustomFont(t.name,t.style);if(null!=m){n.GlyphWidths=StiArray.create(Number,m.numGlyphs+1);for(let t=0;t<a.length-1;t++)0<a[t]&&(n.GlyphWidths[t]=Math.round(m.getGlyph(t).advanceWidth/m.unitsPerEm*1e3));let t=m.ascent,e=m.descent,i=t/(t-e),r=.938;n.tmASC=StiMath.round2(o*i*r),n.tmDESC=StiMath.round2(o*(1-i)*r)}n.NeedSyntBold=this.NeedSyntBold,n.NeedSyntItalic=this.NeedSyntItalic}static isFontStimulsoft(t){return"Stimulsoft"==t}get currentFont(){return this._currentFont}set currentFont(t){this._currentFont!=t&&(this._currentFont=t,null!=this.fonts)&&0<this.fonts.length&&(this.Widths=this.fonts[this._currentFont].Widths,this.CH=this.fonts[this._currentFont].CH,this.XH=this.fonts[this._currentFont].XH,this.ASC=this.fonts[this._currentFont].ASC,this.DESC=this.fonts[this._currentFont].DESC,this.tmASC=this.fonts[this._currentFont].tmASC,this.tmDESC=this.fonts[this._currentFont].tmDESC,this.tmExternal=this.fonts[this._currentFont].tmExternal,this.MacAscend=this.fonts[this._currentFont].MacAscend,this.MacDescend=this.fonts[this._currentFont].MacDescend,this.MacLineGap=this.fonts[this._currentFont].MacLineGap,this.LLX=this.fonts[this._currentFont].LLX,this.LLY=this.fonts[this._currentFont].LLY,this.URX=this.fonts[this._currentFont].URX,this.URY=this.fonts[this._currentFont].URY,this.StemV=this.fonts[this._currentFont].StemV,this.ItalicAngle=this.fonts[this._currentFont].ItalicAngle,this.LineGap=this.fonts[this._currentFont].LineGap,this.NtmFlags=this.fonts[this._currentFont].NtmFlags,this.UnderscoreSize=this.fonts[this._currentFont].UnderscoreSize,this.UnderscorePosition=this.fonts[this._currentFont].UnderscorePosition,this.StrikeoutSize=this.fonts[this._currentFont].StrikeoutSize,this.StrikeoutPosition=this.fonts[this._currentFont].StrikeoutPosition,this.UnicodeMap=this.fonts[this._currentFont].UnicodeMap,this.UnicodeMapBack=this.fonts[this._currentFont].UnicodeMapBack,this.GlyphList=this.fonts[this._currentFont].GlyphList,this.GlyphBackList=this.fonts[this._currentFont].GlyphBackList,this.GlyphMap=this.fonts[this._currentFont].GlyphMap,this.SymsToPDF=this.fonts[this._currentFont].SymsToPDF,this.CharPdfNames=this.fonts[this._currentFont].CharPdfNames,this.MappedSymbolsCount=this.fonts[this._currentFont].MappedSymbolsCount,this.NeedSyntBold=this.fonts[this._currentFont].NeedSyntBold,this.NeedSyntItalic=this.fonts[this._currentFont].NeedSyntItalic,this.GlyphWidths=this.fonts[this._currentFont].GlyphWidths,this.ChildFontsMap=this.fonts[this._currentFont].ChildFontsMap,this.UseUnicode=this.fonts[this._currentFont].UseUnicode)}InitFontsData(o){let t=this.fontList.length;for(let m=0;m<t;m++){let s=this.fontList[m],l=this.forceUseUnicode;if(l){let t=null;null!=(t=this.getFontDataBuf(s.Font,o))&&0!=t.Length||(l=!1)}if(s.UseUnicode=l,this.fontList[m]=s,!l){let a=this.UnicodeMapsList[m],o=this.firstMappedSymbol;for(let t=this.firstMappedSymbol;t<65536;t++)0<a[t]&&o++;if(255<o){s=this.fontList[m];let e=null,i=StiArray.create(Number,65536),r=this.fontList.length;for(let t=0;t<this.firstMappedSymbol;t++)i[t]=r;let n=!0;o=this.firstMappedSymbol;for(let t=this.firstMappedSymbol;t<65536;t++){if(n){let t=new Pfa;t.Name=s.Name,t.PdfName=s.PdfName,t.Bold=s.Bold,t.Italic=s.Italic,t.Number=s.Number,t.Font=s.Font,t.ParentFontNumber=m,t.UseUnicode=l,this.fontList.push(t),e=StiArray.create(Number,65536),StiArray.copy(a,0,e,64),this.UnicodeMapsList.push(e),this.GlyphMapsList.push(StiArray.create(Number,65536)),r=this.fontList.length-1,o=this.firstMappedSymbol,n=!1}0<a[t]&&(e[t]=1,i[t]=r,254==++o)&&(n=!0)}s.ChildFontsMap=i,this.fontList[m]=s}}}this.fonts=StiArray.create(Ofa,this.fontList.length);for(let a=0;a<this.fontList.length;a++){this.fonts[a]=new Ofa;let r=this.fonts[a],t=(r.UnicodeMap=this.UnicodeMapsList[a],r.UnicodeMapBack=StiArray.create(Number,this.maxSymbols+1),r.UseUnicode=this.fontList[a].UseUnicode,this.GlyphMapsList[a]),e=(t[0]=1,t[3]=1,r.GlyphMap=t,this.firstMappedSymbol);for(let t=this.firstMappedSymbol;t<65536;t++)0!=r.UnicodeMap[t]&&(r.UnicodeMap[t]=e,r.UnicodeMapBack[e]=t,++e>this.maxSymbols&&(e=this.maxSymbols),r.UseUnicode||92!=e||(r.UnicodeMapBack[e]=t,e++));let i=8226;r.UnicodeMap[i]=e,r.UnicodeMapBack[e]=i,e++,r.MappedSymbolsCount=e;for(let t=0;t<this.firstMappedSymbol;t++)r.UnicodeMap[t]=t,r.UnicodeMapBack[t]=t;r.CharPdfNames=StiArray.create(String,e),r.SymsToPDF=StiArray.create(Number,e);for(let i=32;i<r.MappedSymbolsCount;i++){let t=-1;for(let t=0;t<this.standardFontNumWidths;t++);r.SymsToPDF[i]=t;let e=__.c.StiPdfResources.standardFontCharsNames[r.UnicodeMapBack[i]];null==e&&(e="uni"+r.UnicodeMapBack[i].toString(16).toUpperCase()[Stimulsoft.System.StiObject.stimulsoft]().padLeft(4,"0")),r.CharPdfNames[i]=e}r.GlyphList=StiArray.create(Number,e);let n=this.fontList[a];this.fonts[a].Widths=StiArray.create(Number,e),this.getFontMetrics(n.Font,r,t,o);for(let t=0;t<e-32;t++)this.fonts[a].Widths[t]=this.WIDTHS[32+t];this.standardPdfFonts,null!=this.fontList[a].ChildFontsMap&&(r.MappedSymbolsCount=255,r.ChildFontsMap=this.fontList[a].ChildFontsMap)}this._currentFont=-1,this.currentFont=0}constructor(){super(),this.standardFontQuantity=12,this.standardFontNumWidths=310,this.standardFontNumChars=3680+189,this.firstMappedSymbol=64,this.factor=1,this.maxSymbols=32767,this.forceUseUnicode=!0,this.WIDTHS=null,this.fonts=null,this.UnicodeMapsList=null,this.GlyphMapsList=null,this.standardPdfFonts=!0,this.fontsInfoStore=null,this.family_Helvetica=["Arial","Arial Black","Arial Narrow","Century Gothic","Comic Sans MS","Impact","Microsoft Sans Serif","Tahoma","Verdana"],this.family_Courier=["Courier New","Lucida Console"],this.family_Times_Roman=["Book Antiqua","Bookman Old Style","Garamond","Georgia","Times New Roman"],this.family_Symbol=["Symbol"],this.family_ZapfDingbats=["Wingdings 2"],this.PdfFontName=["Helvetica","Helvetica-Bold","Helvetica-Oblique","Helvetica-BoldOblique","Times-Roman","Times-Bold","Times-Italic","Times-BoldItalic","Courier","Courier-Bold","Courier-Oblique","Courier-BoldOblique","Symbol","ZapfDingbats"],this._currentFont=-1,this.TtfHeaderSize=12,this.ARG_1_AND_2_ARE_WORDS=1,this.ARGS_ARE_XY_VALUES=2,this.ROUND_XY_TO_GRID=4,this.WE_HAVE_A_SCALE=8,this.MORE_COMPONENTS=32,this.WE_HAVE_AN_X_AND_Y_SCALE=64,this.WE_HAVE_A_TWO_BY_TWO=128,this.WE_HAVE_INSTRUCTIONS=256,this.USE_MY_METRICS=512,this.OVERLAP_COMPOUND=1024,this.SCALED_COMPONENT_OFFSET=2048,this.UNSCALED_COMPONENT_OFFSET=4096,this.TablesNames=["head","hhea","hmtx","maxp","cmap","OS/2","post","cvt ","fpgm","glyf","loca","prep","name"],this.fontList=new Array,this.UnicodeMapsList=new Array,this.GlyphMapsList=new Array,this.fontsInfoStore=new Tfa}getFontNumber(i){let r=-1;if(0<this.fontList.length)for(let e=0;e<this.fontList.length;e++){let t=this.fontList[e];if(t.Name==i.name&&t.Bold==i.bold&&t.Italic==i.italic){r=e;break}}if(-1==r){let e=new Pfa;e.Name=i.name,e.Bold=i.bold,e.Italic=i.italic,e.Font=i,e.ParentFontNumber=-1,r=0;for(let t of this.family_Helvetica)e.Name==t&&(r=0);for(let t of this.family_Times_Roman)e.Name==t&&(r=4);for(let t of this.family_Courier)e.Name==t&&(r=8);r<12&&(1==e.Bold&&(r+=1),1==e.Italic)&&(r+=2),e.Number=r,e.PdfName=this.PdfFontName[r],this.fontList.push(e),r=this.fontList.length-1,this.UnicodeMapsList.push(StiArray.create(Number,65536)),this.GlyphMapsList.push(StiArray.create(Number,65536)),e.FontKitObject=Graphics.getCustomFont(i.name,i.style),null!=e.FontKitObject&&(e.UseUnicode=!0)}return this.currentFont=r}storeUnicodeSymbolsInMap(r){if(!StiString.isNullOrEmpty(r)&&-1!=this.currentFont){let e=this.UnicodeMapsList[this.currentFont];for(let t=0;t<r.length;t++)e[r.charCodeAt(t)]=1;let t=this.fontList[this.currentFont].FontKitObject;if(null!=t){let e=this.GlyphMapsList[this.currentFont],i=t.layout(r);for(let t=0;t<i.glyphs.length;t++)e[i.glyphs[t].id]=1;e[65535]=1}}}storeGlyphsInMap(i){if(0<i.length&&-1!=this.currentFont){let e=this.GlyphMapsList[this.currentFont];for(let t=0;t<i.length;t++)e[i.charCodeAt(t)]=1;e[65535]=1}}getCharToGlyphTable(t,e){let i=this.scanFontFile(t,e);if(null!=i)return this.getCmapTable(t,i);return null}reduceFontSize(p,t,s){let d=this.scanFontFile(p,t),l=null;if(null!=d){if(d.IndexLocaTable==d.IndexGlyfTable&&-1!=d.IndexCFFTable&&(d.Tables[d.IndexCFFTable].Required=!0,d.NumTablesRequired++,s=!1),s){let n=StiArray.create(Boolean,d.NumGlyphs),r=StiArray.create(Boolean,d.NumGlyphs);for(let e=0;e<this.GlyphList.length;e++){let t=this.GlyphList[e];t<d.NumGlyphs&&(n[t]=!0,r[t]=!0)}if(null!=this.GlyphMap)for(let t=0;t<this.GlyphMap.length;t++)0<this.GlyphMap[t]&&(n[t]=!0,r[t]=!0);n[0]=!0,n[1]=!0,n[2]=!0,n[3]=!0,r[0]=!0,r[1]=!0,r[2]=!0,r[3]=!0;let a=d.Tables[d.IndexLocaTable].Offset,o=d.Tables[d.IndexGlyfTable].Offset,s=!0;while(s){s=!1;for(let e=0;e<d.NumGlyphs;e++)if(1==r[e]){r[e]=!1;let t=a+e*(1==d.IndexToLocFormat?4:2),i=0;if(i=1==d.IndexToLocFormat?this.GetUInt32(p,t):2*this.GetUInt16(p,t),i+=o,-1==this.GetInt16(p,i)){s=!0,i+=10;let e=0;do{e=this.GetUInt16(p,i);let t=this.GetUInt16(p,i+2);t<d.NumGlyphs&&(n[t]=!0,r[t]=!0),i+=4,0<(e&this.ARG_1_AND_2_ARE_WORDS)?i=i+2+2:i+=2,0<(e&this.WE_HAVE_A_SCALE)?i+=2:0<(e&this.WE_HAVE_AN_X_AND_Y_SCALE)?i=i+2+2:0<(e&this.WE_HAVE_A_TWO_BY_TWO)&&(i=(i=i+2+2)+2+2)}while(0<(e&this.MORE_COMPONENTS))}}}let l=0,m=a;for(let i=0;i<d.NumGlyphs;i++){let t=0,e=0;1==d.IndexToLocFormat?(t=this.GetUInt32(p,m),e=this.GetUInt32(p,m+4),m+=4):(t=2*this.GetUInt16(p,m),e=2*this.GetUInt16(p,m+2),m+=2),n[i]&&(l+=e-t)}let h=new Uint8Array(l+4),c=new Uint8Array(d.Tables[d.IndexLocaTable].Length+4),g=0,S=(m=a,0);for(let r=0;r<d.NumGlyphs;r++){let e=0,t=0,i=(1==d.IndexToLocFormat?(e=this.GetUInt32(p,m),t=this.GetUInt32(p,m+4),m+=4):(e=2*this.GetUInt16(p,m),t=2*this.GetUInt16(p,m+2),m+=2),t-e);if(1==n[r])for(let t=0;t<i;t++)h[g+t]=p[o+e+t];else i=0;0==d.IndexToLocFormat?this.SetUInt16(c,S,g/2):this.SetUInt32(c,S,g),g+=i,S+=1==d.IndexToLocFormat?4:2}0==d.IndexToLocFormat?this.SetUInt16(c,S,g/2):this.SetUInt32(c,S,g),d.Tables[d.IndexGlyfTable].NewLength=g,d.Tables[d.IndexGlyfTable].NewTable=h,d.Tables[d.IndexLocaTable].NewTable=c}let r=new Uint8Array(this.TtfHeaderSize+16*d.NumTablesRequired),t=(this.copyUint8Array(p,d.HeaderOffset,r,0,r.length),1);while(2<<t-1<=d.NumTablesRequired)t++;let e=16*(2<<--t-1),i=t,n=16*d.NumTablesRequired-e,a=(this.SetUInt16(r,4,d.NumTablesRequired),this.SetUInt16(r,6,e),this.SetUInt16(r,8,i),this.SetUInt16(r,10,n),0),o=this.TtfHeaderSize+16*d.NumTablesRequired;for(let i=0;i<d.NumTables;i++)if(d.Tables[i].Required){d.Tables[i].NewOffset=o;let t=(o+=d.Tables[i].NewLength)%4,e=(0<t&&(o+=4-t),this.TtfHeaderSize+16*a);this.SetUInt32(r,e,d.Tables[i].Tag),this.SetUInt32(r,e+4,d.Tables[i].CheckSum),this.SetUInt32(r,e+8,d.Tables[i].NewOffset),this.SetUInt32(r,e+12,d.Tables[i].NewLength),a++}(l=new MemoryStream).writeBytes(r,0,r.length);for(let e=0;e<d.NumTables;e++)if(d.Tables[e].Required){null!=d.Tables[e].NewTable?l.writeBytes(d.Tables[e].NewTable,0,d.Tables[e].NewLength):l.writeBytes(p,d.Tables[e].Offset,d.Tables[e].NewLength);let t=d.Tables[e].NewLength%4;0<t&&l.write(StiArray.create(Number,4-t),0,4-t)}l.flush()}return l}scanFontFile(r,n){let a=null,e=this.GetUInt32(r,0);if(65536==e||1330926671==e)a=this.getTtfInfo(r,0);else{let t=this.GetUInt32(r,4);if(1953784678==e&&(65536==t||131072==t)){let t=this.GetUInt32(r,8);for(let i=t-1;0<=i;i--){let t=this.GetUInt32(r,12+4*i),e=this.GetUInt32(r,t);if(65536==e&&(a=this.getTtfInfo(r,t)).FontName.contains(n))break}}}return a}getCmapTable(m,t){let h=null,n=t.Tables[t.IndexCmapTable].Offset,e=this.GetUInt16(m,n+2);for(let r=0;r<e;r++){let t=n+4+8*r,e=this.GetUInt16(m,t),i=this.GetUInt16(m,t+2),l=n+this.GetUInt32(m,t+4);if(3==e&&(1==i||0==i)){let t=this.GetUInt16(m,l);if(4==t){h=StiArray.create(Number,65536);for(let t=0;t<65536;t++)h[t]=65535;let s=this.GetUInt16(m,l+6);for(let e=0;e<s;e+=2){let r=l+14+e,t=this.GetUInt16(m,r),n=this.GetUInt16(m,r+2+s),a=this.GetInt16(m,r+2+2*s),o=this.GetUInt16(m,r+2+3*s);if(65535!=n)for(let i=n;i<=t;i++){let e=65535;if(0==o)e=a+i&65535;else{let t=o+2*(i-n)+(r+2+3*s);0!=(e=this.GetUInt16(m,t))&&(e+=a)}h[i]=e}}}}}return h}copyUint8Array(e,i,r,n,a){for(let t=0;t<a;t++)r[n+t]=e[i+t]}getTtfInfo(m,t){let h=new Rfa;h.HeaderOffset=t,h.SfntVersion=this.GetUInt32(m,h.HeaderOffset),h.NumTables=this.GetUInt16(m,h.HeaderOffset+4),h.NumTablesRequired=0,h.Tables=[];for(let t=0;t<h.NumTables;t++)h.Tables[t]=new Qfa;for(let r=0;r<h.NumTables;r++){let e=h.HeaderOffset+this.TtfHeaderSize+16*r,i=new StringBuilder;for(let t=0;t<4;t++)i.append(String.fromCharCode(this.GetUInt8(m,e+t)));h.Tables[r].Tag=this.GetUInt32(m,e),h.Tables[r].TagString=i.toString(),h.Tables[r].CheckSum=this.GetUInt32(m,e+4),h.Tables[r].Offset=this.GetUInt32(m,e+8),h.Tables[r].Length=this.GetUInt32(m,e+12),h.Tables[r].NewLength=h.Tables[r].Length;for(let t=0;t<this.TablesNames.length;t++)if(h.Tables[r].TagString==this.TablesNames[t]){h.Tables[r].Required=!0,h.NumTablesRequired++;break}switch(h.Tables[r].TagString){case"head":h.IndexToLocFormat=this.GetUInt16(m,h.Tables[r].Offset+50);break;case"maxp":h.NumGlyphs=this.GetUInt16(m,h.Tables[r].Offset+4);break;case"loca":h.IndexLocaTable=r;break;case"glyf":h.IndexGlyfTable=r;break;case"cmap":h.IndexCmapTable=r;break;case"CFF ":h.IndexCFFTable=r;break;case"name":{let s=h.Tables[r].Offset,t=this.GetUInt16(m,s+2),l=this.GetUInt16(m,s+4);for(let o=0;o<t;o++){let t=s+6+12*o,e=this.GetUInt16(m,t),i=this.GetUInt16(m,t+2),r=this.GetUInt16(m,t+6),n=this.GetUInt16(m,t+8),a=this.GetUInt16(m,t+10);if(3==e&&1==i&&1==r||0==e&&3==i&&1==r){let e=new StringBuilder;for(let t=0;t<n/2;t++)e.append(String.fromCharCode(this.GetUInt16(m,s+l+a+2*t)));let t=e.toString();h.FontName.set(t,t)}}break}}}return h}GetUInt8(t,e){return t[e]}GetUInt16(t,e){return(t[e]<<8)+t[e+1]}GetUInt32(t,e){return(t[e]<<24)+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3]}GetInt16(t,e){let i=(t[e]<<8)+t[e+1];return 32767<i?i-65536:i}SetUInt16(t,e,i){t[e+0]=i>>>8&255,t[e+1]=255&i}SetUInt32(t,e,i){t[e+0]=i>>>24&255,t[e+1]=i>>>16&255,t[e+2]=i>>>8&255,t[e+3]=255&i}clear(){this.fonts=null,this.fontList=null,this.UnicodeMapsList=null,this.GlyphMapsList=null,this.Widths=null,this.CharPdfNames=null,this.UnicodeMap=null,this.UnicodeMapBack=null,this.GlyphList=null,this.GlyphBackList=null,this.GlyphMap=null,this.SymsToPDF=null,this.GlyphWidths=null,this.fontsInfoStore.clear()}getFontDataBuf(t,e){return this.getFontDataFromGdi(t,e)}getFontDataFromGdi(i,e){let r=null;if(Sfa.isFontStimulsoft(i.name)){let t=__.a.Resources.StimulsoftFont.getContent();return new Uint8Array(t)}let n=Stimulsoft.Base.StiFontCollection.getBinFont(i.name,i.style);if(null==(r=(r=null!=n?n.data:null)instanceof Uint8Array?r:null)){let t=0<(i.style&FontStyle.Bold),e=0<(i.style&FontStyle.Italic);t&&e?null!=(n=Stimulsoft.Base.StiFontCollection.getBinFont(i.name,FontStyle.Italic))&&null!=n.data?(r=n.data,this.NeedSyntBold=!0):null!=(n=Stimulsoft.Base.StiFontCollection.getBinFont(i.name,FontStyle.Bold))&&null!=n.data?(r=n.data,this.NeedSyntItalic=!0):null!=(n=Stimulsoft.Base.StiFontCollection.getBinFont(i.name,FontStyle.Regular))&&null!=n.data&&(r=n.data,this.NeedSyntItalic=!0,this.NeedSyntBold=!0):(t&&null!=(n=Stimulsoft.Base.StiFontCollection.getBinFont(i.name,FontStyle.Regular))&&null!=n.data&&(r=n.data,this.NeedSyntBold=!0),e&&null!=(n=Stimulsoft.Base.StiFontCollection.getBinFont(i.name,FontStyle.Regular))&&null!=n.data&&(r=n.data,this.NeedSyntItalic=!0))}if(null==r){let t=e.dictionary.resources.getByName(i.name);null!=(t=null==t?e.dictionary.resources.getByAlias(i.name):t)&&null!=t.content&&0<t.content.length&&(r=new Uint8Array(t.content),this.NeedSyntBold=!0,this.NeedSyntItalic=!0,Graphics.addCustomFontBytes(r,i.name))}return r}}__.c.PdfFonts=Sfa;class Tfa{clear(){}}__.c.FontsInfoStore=Tfa}let StiPenGeom=Stimulsoft.Base.Context.StiPenGeom,StiPenUtils=Stimulsoft.Base.Drawing.StiPenUtils,DashStyle=Stimulsoft.System.Drawing.Drawing2D.DashStyle,StringFormat=Stimulsoft.System.Drawing.StringFormat,StringAlignment=Stimulsoft.System.Drawing.StringAlignment,StringFormatFlags=Stimulsoft.System.Drawing.StringFormatFlags,Pen=Stimulsoft.System.Drawing.Pen,SizeD=Stimulsoft.System.Drawing.Size;{let s=Stimulsoft.System.Drawing.Rectangle;__.c.StiPdfGeomWriter=class{calculateMinMax(t){null==this.xmin?this.xmin=t.x:this.xmin=Math.min(this.xmin,t.x),null==this.xmax?this.xmax=t.x:this.xmax=Math.max(this.xmax,t.x),null==this.ymin?this.ymin=t.y:this.ymin=Math.min(this.ymin,t.y),null==this.ymax?this.ymax=t.y:this.ymax=Math.max(this.ymax,t.y)}convertToString(t){return StiMath.round2(t,this.precision_digits).toString()[Stimulsoft.System.StiObject.stimulsoft]().replaceAll(",",Stimulsoft.System.Globalization.CultureInfo.currentCulture.numberFormat.numberDecimalSeparator)}setPen(n,a=!1){if(null==n)return!1;let o=!1;if(n.is(Pen)){let t=n,e=(this.pdfService.setStrokeColor(t.color),1<t.width?t.width:t.width*this.hiToTwips),i=(0==e&&(e=this.penWidthDefault),this.pageStream.writeLine1("{0} w",this.convertToString(e)),(o=a&&t.dashStyle!=DashStyle.Solid)&&this.pageStream.writeLine("q"),this.getPenStyleDashString(t.dashStyle,.025*t.width));null!=i&&this.pageStream.writeLine(i)}if(n.is(StiPenGeom)){let t=n,e=Color.transparent,i=(e=t.brush instanceof Color?t.brush:StiBrush.toColor(t.brush.as(StiBrush)),this.pdfService.setStrokeColor(e),1<t.thickness?t.thickness:t.thickness*this.hiToTwips),r=(0==i&&(i=this.penWidthDefault),this.pageStream.writeLine1("{0} w",this.convertToString(i)),(o=a&&t.penStyle!=StiPenStyle.Solid)&&this.pageStream.writeLine("q"),this.getPenStyleDashString(StiPenUtils.getPenStyle(t.penStyle),.025*t.thickness));null!=r&&this.pageStream.writeLine(r)}return o}setBrush(o,s,t=!1,e=null){if(null!=e&&(e.ref=!1),null==o)return!1;if(this.assembleData)return o instanceof Color||!(o.is(StiGradientBrush)||o.is(StiGlareBrush)||o.is(StiLinearGradientBrush)||o.is(StiHatchBrush)||o.is(StiGlassBrush))||(this.pdfService.storeShadingData1(o.as(StiBrush),this.pageNumber),this.pdfService.storeHatchData(o.as(StiBrush))),!1;let l=!1,i=Color.transparent;if(o instanceof Color?i=o:0==(i=StiBrush.toColor(o.as(StiBrush))).a&&o.is(StiHatchBrush)&&(i=o.as(StiHatchBrush).backColor),this.pdfService.setNonStrokeColor(i),0==i.a&&null!=e&&(e.ref=!0),!(o instanceof Color)&&(o.is(StiGradientBrush)||o.is(StiGlareBrush)||o.is(StiLinearGradientBrush)||o.is(StiHatchBrush)||o.is(StiGlassBrush))){let t=this.matrixCache[Stimulsoft.System.StiObject.stimulsoft]().peek(),e=new Point(s.x,s.bottom),i=new Point(s.right,s.y),r=[e,i],n=(t.transformPoints(r),new Rectangle(r[0].x,r[0].y,r[1].x-r[0].x,r[1].y-r[0].y)),a=this.pdfService.storeShadingData2(Math.min(n.x,n.right),Math.min(n.y,n.bottom),Math.abs(n.width),Math.abs(n.height),o.as(StiBrush),this.componentAngle);if((o.is(StiGradientBrush)||o.is(StiGlareBrush)||o.is(StiLinearGradientBrush))&&this.pageStream.writeLine1("/Pattern cs /P{0} scn",1+a),o.is(StiHatchBrush)){let t=o;this.pageStream.writeLine1("/Cs1 cs /PH{0} scn",this.pdfService.getHatchNumber(t)+1)}if(o.is(StiGlassBrush)){let t=o.as(StiGlassBrush);this.pdfService.setNonStrokeColor(t.getTopColor()),this.pdfService.setNonStrokeColor(t.getBottomColor())}l=!0}return(l=l&&t)&&this.pageStream.writeLine("q"),l}outputLineString(e,i){if(null!=i){let t=this.setPen(i,!0);this.pageStream.writeLine(e),t&&this.pageStream.writeLine("Q")}}convertArcToBezierPoints(t,i,e){let r=t.x+t.width/2,n=t.y+t.height/2,a=t.width/2,o=t.height/2,s=(i*=Math.PI/180,Math.ceil(Math.abs(e*=Math.PI/180)/(Math.PI/2))),l=StiArray.create(Point,3*s+1,!0),m=e/s,h=Math.sin(m/2),c=Math.cos(m/2),g=4*(1-c)/3,S=h-g*c/(h+1e-4),p=[],d=[],u=(p[0]=c,d[0]=-h,p[1]=c+g,d[1]=-S,p[2]=c+g,d[2]=S,p[3]=c,d[3]=h,Math.sin(i+m/2)),w=Math.cos(i+m/2);l[0].x=r+a*(p[0]*w-d[0]*u),l[0].y=n+o*(p[0]*u+d[0]*w);for(let e=0;e<s;e++){let t=i+m*e;u=Math.sin(t+m/2),w=Math.cos(t+m/2);for(let t=1;t<=3;t++)l[t+3*e].x=r+a*(p[t]*w-d[t]*u),l[t+3*e].y=n+o*(p[t]*u+d[t]*w)}return l}convertSplineToCubicBezier(i,r){let t=i.length,e=3*t-2,n=[];r*=.3,n[0]=i[0],n[1]=this.calculateCurveBezierEndPoints(i[0],i[1],r);for(let e=0;e<t-2;e++){let t=this.calculateCurveBezier(i,e,r);n[3*e+2]=t[0],n[3*e+3]=i[e+1],n[3*e+4]=t[1]}return n[e-2]=this.calculateCurveBezierEndPoints(i[t-1],i[t-2],r),n[e-1]=i[t-1],n}calculateCurveBezier(t,e,i){let r=t[e+2].x-t[e+0].x,n=t[e+2].y-t[e+0].y,a=new Point(t[e+1].x-i*r,t[e+1].y-i*n),o=new Point(t[e+1].x+i*r,t[e+1].y+i*n);return[a,o]}calculateCurveBezierEndPoints(t,e,i){return new Point(i*(e.x-t.x)+t.x,i*(e.y-t.y)+t.y)}getPointString(t){return this.calculateMinMax(t),StiString.format("{0} {1} {2} ",this.convertToString(t.x),this.convertToString(t.y),this.makepath&&0<this.path.length&&!this.forceNewPoint?"l":"m")}getLineToString(t){return this.calculateMinMax(t),StiString.format("{0} {1} l ",this.convertToString(t.x),this.convertToString(t.y))}getRectString4(t,e,i,r){return this.getRectString(new Rectangle(t,e,i,r))}getRectString(t){return StiString.format("{0} {1} {2} {3} re ",this.convertToString(t.x),this.convertToString(t.top),this.convertToString(t.right-t.x),this.convertToString(t.bottom-t.y))}getRectWithCornersString(t,e){if(null==e)return this.getRectString(t);this.beginPath();let i=2*e.topLeft*this.hiToTwips;return 0==e.topLeft?this.moveTo(new Point(t.x,t.top)):this.drawArc(new Rectangle(t.x,t.top,i,i),180,90),i=2*e.topRight*this.hiToTwips,0==e.topRight?this.moveTo(new Point(t.right,t.top)):this.drawArc(new Rectangle(t.right-i,t.top,i,i),270,90),i=2*e.bottomRight*this.hiToTwips,0==e.bottomRight?this.moveTo(new Point(t.right,t.bottom)):this.drawArc(new Rectangle(t.right-i,t.bottom-i,i,i),0,90),i=2*e.bottomLeft*this.hiToTwips,0==e.bottomLeft?this.moveTo(new Point(t.x,t.bottom)):this.drawArc(new Rectangle(t.x,t.bottom-i,i,i),90,90),this.closeFigure(),this.endPath(),this.path.toString()}getBezierString(t,e,i){return this.calculateMinMax(t),this.calculateMinMax(e),this.calculateMinMax(i),StiString.format("{0} {1} {2} {3} {4} {5} c ",this.convertToString(t.x),this.convertToString(t.y),this.convertToString(e.x),this.convertToString(e.y),this.convertToString(i.x),this.convertToString(i.y))}getBezierString2(t,e,i,r,n,a){return this.calculateMinMax(new Point(t,e)),this.calculateMinMax(new Point(i,r)),this.calculateMinMax(new Point(n,a)),StiString.format("{0} {1} {2} {3} {4} {5} c ",this.convertToString(t),this.convertToString(e),this.convertToString(i),this.convertToString(r),this.convertToString(n),this.convertToString(a))}getPolylineString(e,t,i){let r=new StringBuilder;i||r.append(this.getPointString(e[0]));for(let t=i?0:1;t<e.length;t++)r.append(this.getLineToString(e[t]));return t&&r.append("h "),r.toString()}getEllipseString4(t,e,i,r){return this.getEllipseString(new Rectangle(t,e,i,r))}getEllipseString(t){let e=t.width/2*(1-this.pdfCKT),i=t.height/2*(1-this.pdfCKT),r=new StringBuilder;return r.appendFormat("{0} {1} m ",this.convertToString(t.x),this.convertToString(t.y+t.height/2)),r.append(this.getBezierString2(t.x,t.y+t.height-i,t.x+e,t.y+t.height,t.x+t.width/2,t.y+t.height)),r.append(this.getBezierString2(t.x+t.width-e,t.y+t.height,t.x+t.width,t.y+t.height-i,t.x+t.width,t.y+t.height/2)),r.append(this.getBezierString2(t.x+t.width,t.y+i,t.x+t.width-e,t.y,t.x+t.width/2,t.y)),r.append(this.getBezierString2(t.x+e,t.y,t.x,t.y+i,t.x,t.y+t.height/2)),r.toString()}getPenStyleDashString(t,e){switch(t){case DashStyle.Dot:return StiString.format("[{0} {1}] 0 d",this.convertToString(e),this.convertToString(58*e));case DashStyle.Dash:return StiString.format("[{0} {1}] 0 d",this.convertToString(49.5*e),this.convertToString(62*e));case DashStyle.DashDot:return StiString.format("[{0} {1} {2} {1}] 0 d",this.convertToString(50*e),this.convertToString(55*e),this.convertToString(e));case DashStyle.DashDotDot:return StiString.format("[{0} {1} {2} {1} {2} {1}] 0 d",this.convertToString(50*e),this.convertToString(55*e),this.convertToString(e))}return null}beginPath(){if(this.assembleData)return;this.path=new StringBuilder,this.makepath=!0,this.pathClosed=!1,this.xmin=null,this.xmax=null,this.ymin=null,this.ymax=null,this.forceNewPoint=!1}closeFigure(){if(this.assembleData)return;this.path.append("h "),this.pathClosed=!0}endPath(){if(this.assembleData)return;this.makepath=!1}fillPath(t){let e=this.assembleData?new Rectangle:new Rectangle(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),i={ref:!1},r=this.setBrush(t,e,!0,i),n=i.ref;if(this.assembleData)return;this.pathClosed||this.endPath(),n||(this.pageStream.writeString(this.path.toString()),this.pageStream.writeLine("f")),r&&this.pageStream.writeLine("Q")}strokePath(t){if(this.assembleData)return;this.setPen(t),this.pageStream.writeString(this.path.toString()),this.pageStream.writeLine("S")}moveTo(t){if(this.assembleData)return;this.lastPoint=t;let e=this.getPointString(t);this.makepath?this.path.appendLine(e):this.pageStream.writeLine(e)}drawLine(t,e,i){if(this.assembleData)return;let r=this.getPointString(t)+this.getLineToString(e);this.makepath?this.path.appendLine(r):this.outputLineString(r+"S",i),this.lastPoint=e}drawLineTo(t,e){if(this.assembleData)return;let i=this.getLineToString(t);this.makepath?this.path.appendLine(i):this.outputLineString(i+"S",e),this.lastPoint=t}drawRectangle(t,e,i){if(this.assembleData)return;this.outputLineString(this.getRectWithCornersString(t,i)+"S",e)}fillRectangle(e,i,r){let t={ref:!1},n=this.setBrush(i,e,!0,t),a=t.ref;if(this.assembleData)return;if(null!=i&&!a){let t=i.as(StiGlassBrush);null!=t?(this.pdfService.setNonStrokeColor(t.getTopColor()),null==r?this.pageStream.writeLine(this.getRectString4(e.x,e.y,e.width,e.height/2)+"f"):this.pageStream.writeLine(this.getRectWithCornersString(new Rectangle(e.x,e.y,e.width,e.height/2),new StiCornerRadius(r.topLeft,r.topRight,0,0))+"f"),this.pdfService.setNonStrokeColor(t.getBottomColor()),null==r?this.pageStream.writeLine(this.getRectString4(e.x,e.y+e.height/2,e.width,e.height/2)+"f"):this.pageStream.writeLine(this.getRectWithCornersString(new Rectangle(e.x,e.y+e.height/2,e.width,e.height/2),new StiCornerRadius(0,0,r.bottomRight,r.bottomLeft))+"f")):this.pageStream.writeLine(this.getRectWithCornersString(e,r)+"f")}n&&this.pageStream.writeLine("Q")}drawPolygon(t,e){this.drawPolyline(t,e,!0)}drawPolyline(t,e,i=!1,r=!1){if(this.assembleData)return;let n=this.getPolylineString(t,i,r);this.makepath?this.path.appendLine(n):this.outputLineString(n+"S",e),this.lastPoint=t[t.length-1]}drawPolylineTo(t,e){this.drawPolyline(t,e,!1,!0)}fillPolygon(e,t){for(let t of e)this.calculateMinMax(t);let i=new Rectangle(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),r={ref:!1},n=this.setBrush(t,i,!0,r),a=r.ref;if(this.assembleData)return;if(null!=t&&!a){let t=this.getPolylineString(e,!0,!1);this.pageStream.writeLine(t+"f")}n&&this.pageStream.writeLine("Q")}fillPolygons(t,e){for(let e of t)for(let t of e)this.calculateMinMax(t);let i=new s(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),r={ref:!1},n=this.setBrush(e,i,!0,r),a=r.ref;if(this.assembleData)return;if(this.makepath)throw new Error;if(null!=e&&!a)for(let e of t){let t=this.getPolylineString(e,!0,!1);this.pageStream.writeLine(t+"f")}n&&this.pageStream.writeLine("Q")}drawBezier(t,e,i,r,n){if(this.assembleData)return;let a=this.getPointString(t)+this.getBezierString(e,i,r);this.makepath?this.path.appendLine(a):this.outputLineString(a+"S",n),this.lastPoint=r}drawBezierTo(t,e,i,r){if(this.assembleData)return;let n=this.getBezierString(t,e,i);this.makepath?this.path.appendLine(n):this.outputLineString(n+"S",r),this.lastPoint=i}drawSpline(t,e,i){if(this.assembleData)return;let r=this.convertSplineToCubicBezier(t,e),n=(r.length-1)/3,a=new StringBuilder;a.append(this.getPointString(r[0])+this.getBezierString(r[1],r[2],r[3]));for(let t=1;t<n;t++)a.append(this.getBezierString(r[3*t+1],r[3*t+2],r[3*t+3]));this.makepath?this.path.appendLine(a.toString()):this.outputLineString(a.toString()+"S",i),this.lastPoint=r[r.length-1]}drawArc(t,e,i){if(this.assembleData)return;let r=this.convertArcToBezierPoints(t,e,i),n=(r.length-1)/3;this.drawBezier(r[0],r[1],r[2],r[3],null);for(let t=1;t<n;t++)this.drawBezierTo(r[3*t+1],r[3*t+2],r[3*t+3],null)}drawEllipse(t,e){if(this.assembleData)return;this.outputLineString(this.getEllipseString(t)+"S",e)}fillEllipse(t,e){let i={ref:!1},r=this.setBrush(e,t,!0,i),n=i.ref;if(this.assembleData)return;null==e||n||this.pageStream.writeLine(this.getEllipseString(t)+"f"),r&&this.pageStream.writeLine("Q")}drawPie(t,e,i){if(this.assembleData)return;let r=this.convertArcToBezierPoints(t,e,i),n=(r.length-1)/3,a=t.x+t.width/2,o=t.y+t.height/2;this.drawBezier(r[0],r[1],r[2],r[3],null);for(let t=1;t<n;t++)this.drawBezierTo(r[3*t+1],r[3*t+2],r[3*t+3],null);this.drawLineTo(new Point(a,o),null),this.drawLineTo(r[0],null)}drawString(t,e,i,r,n){if(this.assembleData)return null!=e&&this.pdfService.pdfFont.getFontNumber(e),this.pdfService.pdfFont.storeUnicodeSymbolsInMap(t),this.pdfService.storeShadingData1(i,this.pageNumber),void this.pdfService.storeHatchData(i);let a=new StiText,o=(a.clientRectangle=new s(r.x,r.y,r.width,r.height),a.text=t,a.font=e,a.textBrush=i,(n=n||new StringFormat).alignment==StringAlignment.Center&&(a.horAlignment=StiTextHorAlignment.Center),n.alignment==StringAlignment.Far&&(a.horAlignment=StiTextHorAlignment.Right),n.lineAlignment==StringAlignment.Center&&(a.vertAlignment=StiVertAlignment.Center),n.lineAlignment==StringAlignment.Far&&(a.vertAlignment=StiVertAlignment.Bottom),0==(n.formatFlags&StringFormatFlags.NoWrap)&&(a.wordWrap=!0),new __.c.StiPdfData(this.pdfService));o.Component=a,o.Width=r.width*this.hiToTwips,o.Height=r.height*this.hiToTwips,this.pageStream.writeLine("q"),this.pdfService.pushColorToStack(),this.pageStream.writeLine1("1 0 0 1 {0} {1} cm",this.convertToString(r.x),this.convertToString(r.y+r.height)),this.pageStream.writeLine("1.39 0 0 -1.39 0 0 cm"),__.c.StiPdfRenderText.renderTextFont(o),__.c.StiPdfRenderText.renderText(o),this.pageStream.writeLine("Q"),this.pdfService.popColorFromStack()}saveState(){if(this.assembleData)return;this.pageStream.writeLine("q"),this.pdfService.pushColorToStack(),0<this.matrixCache.length&&this.matrixCache.push(this.matrixCache[Stimulsoft.System.StiObject.stimulsoft]().peek().clone())}restoreState(){if(this.assembleData)return;this.pageStream.writeLine("Q"),this.pdfService.popColorFromStack(),0<this.matrixCache.length&&this.matrixCache.pop()}translateTransform(t,e){if(this.assembleData)return;this.pageStream.writeLine1("1 0 0 1 {0} {1} cm",this.convertToString(t),this.convertToString(e)),0<this.matrixCache.length&&this.matrixCache[Stimulsoft.System.StiObject.stimulsoft]().peek().translate(t,e)}rotateTransform(t){if(this.assembleData)return;let e=t*Math.PI/180;this.pageStream.writeLine1("{0} {1} {2} {3} 0 0 cm",this.convertToString(Math.cos(e)),this.convertToString(Math.sin(e)),this.convertToString(-Math.sin(e)),this.convertToString(Math.cos(e))),0<this.matrixCache.length&&this.matrixCache[Stimulsoft.System.StiObject.stimulsoft]().peek().rotate(t)}rotateTransform2(t,e,i){if(this.assembleData)return;let r=t*Math.PI/180;this.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} cm",this.convertToString(Math.cos(r)),this.convertToString(Math.sin(r)),this.convertToString(-Math.sin(r)),this.convertToString(Math.cos(r)),this.convertToString(e),this.convertToString(i)),0<this.matrixCache.length&&this.matrixCache[Stimulsoft.System.StiObject.stimulsoft]().peek().translate(e,i).rotate(t)}setClip(t){if(this.assembleData)return;this.pageStream.writeLine(this.getRectString(t)+"W n")}drawArc2(t,e,i,r){}drawText(t,e,i,r,n,a,o){}setPixel(t,e){}measureString(t,e){return new SizeD(0,0)}drawImage(t,e){let i=new StiImage;if(i.clientRectangle=e,i.imageToDraw=t,i.smoothing=!0,i.stretch=!0,this.assembleData)return void this.pdfService.storeImageDataForGeom(i);let r=new __.c.StiPdfData(this.pdfService);r.Component=i,r.Width=e.width,r.Height=e.height,this.pageStream.writeLine("q"),this.pdfService.pushColorToStack(),this.pageStream.writeLine1("1 0 0 1 {0} {1} cm",this.convertToString(e.x),this.convertToString(e.y+e.height)),this.pageStream.writeLine("1 0 0 -1 0 0 cm"),this.pdfService.renderImage(r,100),this.pageStream.writeLine("Q"),this.pdfService.popColorFromStack()}constructor(t,e,i=!1){this.penWidthDefault=.1,this.precision_digits=3,this.hiToTwips=.72,this.pdfCKT=.55228,this.makepath=!1,this.pathClosed=!1,this.path=null,this.pageStream=null,this.pdfService=null,this.assembleData=!1,this.pageNumber=0,this.matrixCache=null,this.componentAngle=0,this.forceNewPoint=!1,this.xmin=null,this.xmax=null,this.ymin=null,this.ymax=null,this.pageStream=t,this.pdfService=e,this.assembleData=i,this.matrixCache=new Array}}}let StiSparklinePainter=__.a.Painters.StiSparklinePainter,StiContext=Stimulsoft.Base.Context.StiContext,StiContextPainter=Stimulsoft.Base.Context.StiContextPainter,StiRotationMode=Stimulsoft.Base.Drawing.StiRotationMode,StiPushTranslateTransformGeom=Stimulsoft.Base.Context.StiPushTranslateTransformGeom,StiPushRotateTransformGeom=Stimulsoft.Base.Context.StiPushRotateTransformGeom,StiPopTransformGeom=Stimulsoft.Base.Context.StiPopTransformGeom,StiBorderGeom=Stimulsoft.Base.Context.StiBorderGeom,StiLineGeom=Stimulsoft.Base.Context.StiLineGeom,StiLinesGeom=Stimulsoft.Base.Context.StiLinesGeom,StiPushClipGeom=Stimulsoft.Base.Context.StiPushClipGeom,StiPopClipGeom=Stimulsoft.Base.Context.StiPopClipGeom,StiPushSmothingModeToAntiAliasGeom=Stimulsoft.Base.Context.StiPushSmothingModeToAntiAliasGeom,StiPopSmothingModeGeom=Stimulsoft.Base.Context.StiPopSmothingModeGeom,StiPushTextRenderingHintToAntiAliasGeom=Stimulsoft.Base.Context.StiPushTextRenderingHintToAntiAliasGeom,StiPopTextRenderingHintGeom=Stimulsoft.Base.Context.StiPopTextRenderingHintGeom,StiCurveGeom=Stimulsoft.Base.Context.StiCurveGeom,StiEllipseGeom=Stimulsoft.Base.Context.StiEllipseGeom,StiCachedShadowGeom=Stimulsoft.Base.Context.StiCachedShadowGeom,StiShadowSides=Stimulsoft.Base.Drawing.StiShadowSides,StiTextGeom=Stimulsoft.Base.Context.StiTextGeom,StiPathGeom=Stimulsoft.Base.Context.StiPathGeom,StiPieSegmentGeom=Stimulsoft.Base.Context.StiPieSegmentGeom,StiArcSegmentGeom=Stimulsoft.Base.Context.StiArcSegmentGeom,StiLineSegmentGeom=Stimulsoft.Base.Context.StiLineSegmentGeom,StiLinesSegmentGeom=Stimulsoft.Base.Context.StiLinesSegmentGeom,StiCurveSegmentGeom=Stimulsoft.Base.Context.StiCurveSegmentGeom,StiCloseFigureSegmentGeom=Stimulsoft.Base.Context.StiCloseFigureSegmentGeom,StiTextGaugeGeom=(__.c.StiPdfRenderChart=class{static renderChart(e,t,i){let r=e.Component.as(IStiChart),n=.96,a=e.service.report.unit.convertToHInches(e.Component.width)*n,o=e.service.report.unit.convertToHInches(e.Component.height)*n,s=0,l=0,m=0,h=1,c=1;switch(r.rotation){case StiImageRotation.Rotate90CCW:s=-90,m=o;break;case StiImageRotation.Rotate90CW:s=90,l=a;break;case StiImageRotation.Rotate180:s=-180,l=a,m=o;break;case StiImageRotation.FlipVertical:c=-1,m=o;break;case StiImageRotation.FlipHorizontal:h=-1,l=a;break}switch(r.rotation){case StiImageRotation.Rotate90CCW:case StiImageRotation.Rotate90CW:{let t=a;a=o,o=t;break}}if(!t&&r.rotation!=StiImageRotation.None){let t=new Matrix(1,0,0,1,0,0);t.translate(l,m),t.scale(h,c),t.rotate(s),e.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} cm",e.service.convertToString(t.elements[0]),e.service.convertToString(t.elements[1]),e.service.convertToString(t.elements[2]),e.service.convertToString(t.elements[3]),e.service.convertToString(t.elements[4]),e.service.convertToString(t.elements[5]))}let g=new StiContextPainter,S=new StiContext(g,!0,!1,!1,1),p=r.isAnimation,d=(r.isAnimation=!1,r.core.render(S,new Rectangle(0,0,a,o),!0));d.drawGeom(S),r.isAnimation=p,this.renderContext(e,t,i,S)}static renderSparkline(t,e,i){let r=t.Component.as(StiSparkline),n=.96,a=t.service.report.unit.convertToHInches(t.Component.width)*n,o=t.service.report.unit.convertToHInches(t.Component.height)*n,s=new StiContextPainter,l=new StiContext(s,!0,!1,!1,1);StiSparklinePainter.renderSparkline(l,new Rectangle(0,0,a,o),r,1),this.renderContext(t,e,i,l)}static renderContext(t,e,i,r){let n,a,o,s,l=new Matrix(1,0,0,1,0,0),m=t.service.hiToTwips/.96,h=(l.translate(t.X,t.Y+t.Height),l.scale(1,-1),l.scale(m,m),new __.c.StiPdfGeomWriter(t.service.pageStream,t.service,e));h.pageNumber=i,h.matrixCache.push(l);for(let e of r.geoms){if(e.is(StiPushTranslateTransformGeom)){let t=e;h.saveState(),h.translateTransform(t.x,t.y)}if(e.is(StiPushRotateTransformGeom)){let t=e;h.saveState(),h.rotateTransform(t.angle)}if(e.is(StiPopTransformGeom)&&h.restoreState(),e.is(StiPushClipGeom)){let t=e;h.saveState(),h.setClip(t.clipRectangle)}if(e.is(StiPopClipGeom)&&h.restoreState(),e.is(StiPushSmothingModeToAntiAliasGeom)&&h.saveState(),e.is(StiPopSmothingModeGeom)&&h.restoreState(),e.is(StiPushTextRenderingHintToAntiAliasGeom)&&h.saveState(),e.is(StiPopTextRenderingHintGeom)&&h.restoreState(),e.is(StiBorderGeom)){let t=e;null!=t.background&&h.fillRectangle(this.rectToRectangle(t.rect),t.background,t.cornerRadius),this.checkPenGeom(t.borderPen)&&h.drawRectangle(this.rectToRectangle(t.rect),t.borderPen,t.cornerRadius)}if(e.is(StiLineGeom)){let t=e;this.checkPenGeom(t.pen)&&h.drawLine(new Point(t.x1,t.y1),new Point(t.x2,t.y2),t.pen)}if(e.is(StiLinesGeom)){let t=e;this.checkPenGeom(t.pen)&&h.drawPolyline(t.points,t.pen)}if(e.is(StiCurveGeom)){let t=e;this.checkPenGeom(t.pen)&&h.drawSpline(t.points,t.tension,t.pen)}if(e.is(StiEllipseGeom)){let t=e;null!=t.background&&h.fillEllipse(this.rectToRectangle(t.rect),t.background),this.checkPenGeom(t.borderPen)&&h.drawEllipse(this.rectToRectangle(t.rect),t.borderPen)}if(e.is(StiCachedShadowGeom)){let t=e,r=t.rect,n=t.sides,a=r.y+8,o=r.x+8,s=0<(n&StiShadowSides.Edge)?4:0;0<(n&StiShadowSides.Top)&&(a=r.y+4),0<(n&StiShadowSides.Left)&&(o=r.x+4);for(let i=0;i<3;i++){let t=new Array,e=(0<(n&StiShadowSides.Right)?(t.push(new Point(r.right,a)),0<(n&StiShadowSides.Bottom)?(t.push(new Point(r.right,r.bottom)),t.push(new Point(o,r.bottom)),t.push(new Point(o,r.bottom+i+1)),t.push(new Point(r.right+i+1,r.bottom+i+1))):(t.push(new Point(r.right,r.bottom+s)),t.push(new Point(r.right+i+1,r.bottom+s))),t.push(new Point(r.right+i+1,a))):(t.push(new Point(o,r.bottom)),t.push(new Point(r.right+s,r.bottom)),t.push(new Point(r.right+s,r.bottom+i+1)),t.push(new Point(o,r.bottom+i+1))),new StiSolidBrush(Color.fromArgb3(40-10*i,Color.black)));h.fillPolygon(t,e)}}if(e.is(StiTextGeom)){let n=e,a=new Font(n.font.fontName,n.font.fontSize,n.font.fontStyle,n.font.unit),o=new StringFormat,s=(o.alignment=n.stringFormat.alignment,o.formatFlags=n.stringFormat.formatFlags,o.hotkeyPrefix=n.stringFormat.hotkeyPrefix,o.lineAlignment=n.stringFormat.lineAlignment,o.trimming=n.stringFormat.trimming,this.brushToStiBrush(n.brush));if(n.isRotatedText){let e=new Point;if(n.location instanceof Point)e=n.location;else{let t=this.rectToRectangle(n.location);e=new Point(t.x+t.width/2,t.y+t.height/2)}let t=Graphics.measureString(n.text,a,n.maximalWidth),i=new Rectangle(0,0,t.width,t.height),r=this.getStartPoint(n.rotationMode,i);i.x-=r.x,i.y-=r.y,o.alignment==Stimulsoft.System.Drawing.StringAlignment.Center&&--i.x,o.alignment==Stimulsoft.System.Drawing.StringAlignment.Far&&(i.x-=2),i.width+=2.5,h.saveState(),h.translateTransform(e.x,e.y),0!=n.angle&&h.rotateTransform(n.angle),h.drawString(n.text,a,s,i,o),h.restoreState()}else h.drawString(n.text,a,s,this.rectToRectangle(n.location),o)}if(e.is(StiPathGeom)){let t=e;h.beginPath();for(let r of t.geoms){if(r.is(StiPieSegmentGeom)){let t=r,e=null!=(n=t.realStartAngle)?n:t.startAngle,i=null!=(a=t.realSweepAngle)?a:t.sweepAngle;h.drawPie(t.rect,e,i)}if(r.is(StiArcSegmentGeom)){let t=r,e=null!=(o=t.realStartAngle)?o:t.startAngle,i=null!=(s=t.realSweepAngle)?s:t.sweepAngle;h.drawArc(t.rect,e,i)}if(r.is(StiLineSegmentGeom)){let t=r;h.drawLine(new Point(t.x1,t.y1),new Point(t.x2,t.y2),null)}if(r.is(StiLinesSegmentGeom)){let t=r;h.drawPolyline(t.points,null)}if(r.is(StiCurveSegmentGeom)){let t=r;h.drawSpline(t.points,t.tension,null)}r.is(StiCloseFigureSegmentGeom)&&h.closeFigure()}h.closeFigure(),h.endPath(),null!=t.background&&h.fillPath(t.background),this.checkPenGeom(t.pen)&&h.strokePath(t.pen)}}}static getStartPoint(t,e){let i=new Point(e.x+e.width/2,e.y+e.height/2);switch(t){case StiRotationMode.LeftCenter:return new Point(e.x,i.y);case StiRotationMode.LeftBottom:return new Point(e.x,e.bottom);case StiRotationMode.CenterTop:return new Point(i.x,e.top);case StiRotationMode.CenterCenter:return i;case StiRotationMode.CenterBottom:return new Point(i.x,e.bottom);case StiRotationMode.RightTop:return new Point(e.right,e.top);case StiRotationMode.RightCenter:return new Point(e.right,i.y);case StiRotationMode.RightBottom:return new Point(e.right,e.bottom);default:return new Point(e.x,e.y)}}static rectToRectangle(t){if(null==t)return new Rectangle;if(t instanceof Rectangle)return t;return new Rectangle}static brushToStiBrush(t){if(null==t)return null;return t instanceof Color?new StiSolidBrush(t):t}static checkPenGeom(t){return!(null==t||null==t.brush||t.penStyle==StiPenStyle.None)}},__.a.Gauge.GaugeGeoms.StiTextGaugeGeom),StiRadialRangeGaugeGeom=__.a.Gauge.GaugeGeoms.StiRadialRangeGaugeGeom,StiGraphicsPathLinesGaugeGeom=__.a.Gauge.GaugeGeoms.StiGraphicsPathLinesGaugeGeom,StiGraphicsPathLineGaugeGeom=__.a.Gauge.GaugeGeoms.StiGraphicsPathLineGaugeGeom,StiGraphicsPathArcGaugeGeom=__.a.Gauge.GaugeGeoms.StiGraphicsPathArcGaugeGeom,StiGraphicsArcGeometryGaugeGeom=__.a.Gauge.GaugeGeoms.StiGraphicsArcGeometryGaugeGeom,StiPieGaugeGeom=__.a.Gauge.GaugeGeoms.StiPieGaugeGeom,StiEllipseGaugeGeom=__.a.Gauge.GaugeGeoms.StiEllipseGaugeGeom,StiGraphicsPathGaugeGeom=__.a.Gauge.GaugeGeoms.StiGraphicsPathGaugeGeom,StiRectangleGaugeGeom=__.a.Gauge.GaugeGeoms.StiRectangleGaugeGeom,StiRoundedRectangleGaugeGeom=__.a.Gauge.GaugeGeoms.StiRoundedRectangleGaugeGeom,StiGaugeGeomType=__.a.Gauge.StiGaugeGeomType,StiPopTranformGaugeGeom=__.a.Gauge.GaugeGeoms.StiPopTranformGaugeGeom,StiPushMatrixGaugeGeom=__.a.Gauge.GaugeGeoms.StiPushMatrixGaugeGeom,StiGaugeContextPainter=__.a.Painters.StiGaugeContextPainter,StiDataBarDirection=(__.c.StiPdfRenderGauge=class{static renderGauge(t,e,i){let r=t.Component.as(IStiGauge),n=r.isAnimation,a=(r.isAnimation=!1,.96),o=new StiGaugeContextPainter(r,new Rectangle(0,0,t.service.report.unit.convertToHInches(t.Component.width)*a,t.service.report.unit.convertToHInches(t.Component.height)*a),a),s=(r.drawGauge(o),r.isAnimation=n,new Matrix(1,0,0,1,0,0)),l=t.service.hiToTwips/.96,u=(s.translate(t.X,t.Y+t.Height),s.scale(1,-1),s.scale(l,l),new __.c.StiPdfGeomWriter(t.service.pageStream,t.service,e));u.pageNumber=i,u.matrixCache.push(s),u.saveState();for(let d of o.geoms){if(d.is(StiPushMatrixGaugeGeom)){let t=d;u.saveState(),u.rotateTransform2(t.angle,t.centerPoint.x,t.centerPoint.y),u.saveState(),u.translateTransform(-t.centerPoint.x,-t.centerPoint.y);continue}if(d.is(StiPopTranformGaugeGeom)&&(u.restoreState(),u.restoreState()),d.type==StiGaugeGeomType.RoundedRectangle){let t=d.as(StiRoundedRectangleGaugeGeom),e=(u.beginPath(),1),i=t.rightTop,r=t.leftTop,n=t.rightBottom,a=t.leftBottom,o=t.rect,s=o.x+o.width-e,l=o.y+o.height-e,m=(u.moveTo(new Point(o.x+r,o.y)),0!=i?(u.drawLineTo(new Point(s-i,o.y),null),u.drawArc(new Rectangle(s-i,o.y,2*i,2*i),270,90)):u.drawLineTo(new Point(s,o.y),null),0!=n?(u.drawLineTo(new Point(s,l-n),null),u.drawArc(new Rectangle(s-n,l-n,2*n,2*n),0,90)):u.drawLineTo(new Point(s,l),null),0!=a?(u.drawLineTo(new Point(o.x+a,l),null),u.drawArc(new Rectangle(o.x-a,l-a,2*a,2*a),90,90)):u.drawLineTo(new Point(o.x,l),null),u.closeFigure(),u.endPath(),StiBrush.isTransparent(t.background)||u.fillPath(t.background),this.getPenGeom(t));this.checkPenGeom(m)&&u.strokePath(m)}else if(d.type==StiGaugeGeomType.Rectangle){let t=d.as(StiRectangleGaugeGeom),e=(null!=t.background&&u.fillRectangle(t.rect,t.background,null),this.getPenGeom(t));this.checkPenGeom(e)&&u.drawRectangle(t.rect,e,null)}else if(d.type==StiGaugeGeomType.GraphicsPath){let t=d.as(StiGraphicsPathGaugeGeom),i=(u.beginPath(),!1);for(let e of t.geoms)if(e.type==StiGaugeGeomType.GraphicsPathArc){let t=e.as(StiGraphicsPathArcGaugeGeom);u.drawArc(new Rectangle(t.x,t.y,t.width,t.height),t.startAngle,t.sweepAngle)}else if(e.type==StiGaugeGeomType.GraphicsPathLine){let t=e.as(StiGraphicsPathLineGaugeGeom);u.drawLine(t.p1,t.p2,null)}else if(e.type==StiGaugeGeomType.GraphicsPathLines){let t=e.as(StiGraphicsPathLinesGaugeGeom);u.drawPolyline(t.points,null),u.closeFigure(),i=!0}else e.type==StiGaugeGeomType.GraphicsPathCloseFigure&&(u.closeFigure(),i=!0);u.endPath(),i&&null!=t.background&&u.fillPath(t.background);let e=this.getPenGeom(t);this.checkPenGeom(e)&&0<t.borderWidth&&u.strokePath(e)}else if(d.type==StiGaugeGeomType.Pie){let t=d.as(StiPieGaugeGeom),e=(u.beginPath(),u.drawPie(t.rect,t.startAngle,t.sweepAngle),u.closeFigure(),u.endPath(),this.getPenGeom(t));this.checkPenGeom(e)&&u.strokePath(e)}else if(d.type==StiGaugeGeomType.Ellipse){let t=d.as(StiEllipseGaugeGeom),e=(null!=t.background&&u.fillEllipse(t.rect,t.background),this.getPenGeom(t));this.checkPenGeom(e)&&u.drawEllipse(t.rect,e)}else if(d.type==StiGaugeGeomType.GraphicsArcGeometry){let i=d.as(StiGraphicsArcGeometryGaugeGeom),m=new Point(i.rect.left+i.rect.width/2,i.rect.top+i.rect.height/2),h=Math.min(i.rect.width/2,i.rect.height/2),c=h-i.rect.width*i.startWidth,t=h-i.rect.width*i.endWidth;if(0<c&&0<t){let e=this.round(Math.abs(i.sweepAngle/90)),r=i.sweepAngle/e,n=i.startAngle,a=(u.beginPath(),!0);for(let t=0;t<e;t++){let t=__.c.StiGaugeDrawingHelper.convertArcToCubicBezier(m,h,n,r);a&&(u.moveTo(t[0]),a=!1),u.drawBezierTo(t[1],t[2],t[3],null),n+=r}let o=c-t,s=1/e,l=0;a=!0,n=i.startAngle+i.sweepAngle;for(let t=0;t<e;t++){let t=c-o*l,e=c-o*(l+s),i=__.c.StiGaugeDrawingHelper.convertArcToCubicBezier2(m,t,e,n,-r);a&&(u.drawLineTo(i[0],null),a=!1),u.drawBezierTo(i[1],i[2],i[3],null),n-=r,l+=s}if(u.closeFigure(),u.endPath(),0<e){StiBrush.isTransparent(i.background)||u.fillPath(i.background);let t=this.getPenGeom(i);this.checkPenGeom(t)&&u.strokePath(t)}}}else if(d.type==StiGaugeGeomType.Text){let t=d.as(StiTextGaugeGeom),e=new Font(t.font.name,t.font.size,t.font.style,t.font.unit),i=new StringFormat;i.alignment=t.stringFormat.alignment,i.formatFlags=t.stringFormat.formatFlags,i.hotkeyPrefix=t.stringFormat.hotkeyPrefix,i.lineAlignment=t.stringFormat.lineAlignment,i.trimming=t.stringFormat.trimming,u.drawString(t.text,e,t.foreground,t.rect,i)}else if(d.type==StiGaugeGeomType.RadialRange){let e=d.as(StiRadialRangeGaugeGeom),r=e.centerPoint,t=e.startAngle,i=e.sweepAngle,n=e.radius1,a=e.radius2,o=e.radius3,s=e.radius4,l=this.round(Math.abs(i/90)),m=i/l,h=(u.beginPath(),n-a),c=1/l,g=0,S=!0,p=t+i;for(let t=0;t<l;t++){let t=n-h*g,e=n-h*(g+c),i=__.c.StiGaugeDrawingHelper.convertArcToCubicBezier2(r,t,e,p,-m);S&&(u.moveTo(i[0]),S=!1),u.drawBezierTo(i[1],i[2],i[3],null),p-=m,g+=c}h=o-s,g=0,S=!0,p=t;for(let t=0;t<l;t++){let t=o-h*g,e=o-h*(g+c),i=__.c.StiGaugeDrawingHelper.convertArcToCubicBezier2(r,t,e,p,m);S&&(u.drawLineTo(i[0],null),S=!1),u.drawBezierTo(i[1],i[2],i[3],null),p+=m,g+=c}if(u.closeFigure(),u.endPath(),0<l){StiBrush.isTransparent(e.background)||u.fillPath(e.background);let t=this.getPenGeom(e);this.checkPenGeom(t)&&u.strokePath(t)}}}u.restoreState()}static checkPenGeom(t){return!(null==t||null==t.brush||t.penStyle==StiPenStyle.None)}static getPenGeom2(t,e){return new StiPenGeom(t,e)}static getPenGeom(t){if(t.is(StiRectangleGaugeGeom))return this.getPenGeom2(t.borderBrush,t.borderWidth);if(t.is(StiRoundedRectangleGaugeGeom))return this.getPenGeom2(t.borderBrush,t.borderWidth);if(t.is(StiEllipseGaugeGeom))return this.getPenGeom2(t.borderBrush,t.borderWidth);if(t.is(StiGraphicsPathGaugeGeom))return this.getPenGeom2(t.borderBrush,t.borderWidth);if(t.is(StiPieGaugeGeom))return this.getPenGeom2(t.borderBrush,t.borderWidth);if(t.is(StiGraphicsArcGeometryGaugeGeom))return this.getPenGeom2(t.borderBrush,t.borderWidth);if(t.is(StiRadialRangeGaugeGeom))return this.getPenGeom2(t.borderBrush,t.borderWidth);return null}static round(t){let e=Math.trunc(t),i=t-e;return 0<i?e+1:e}},__.a.Components.StiDataBarDirection),IStiCornerRadius=(__.c.StiPdfRenderIndicators=class{static renderIndicators(d){let u=d.Component.as(StiText);if(null==u||null==u.indicator)return d;let w=new Rectangle(d.X,d.Y,d.Width,d.Height),o=u.indicator.as(StiIconSetIndicator);if(null!=o&&(o.icon!=StiIcon.None||null!=o.customIcon)){let t=d.service.imageList[d.service.imagesCurrent],e=t.Width*d.service.hiToTwips,i=t.Height*d.service.hiToTwips,r=w.clone(),n=d.service.hiToTwips;switch(r.inflate(-n,-n),o.alignment){case ContentAlignment.TopLeft:r=new Rectangle(r.x,r.bottom-i,e,i),w.x+=r.width+1,w.width-=r.width+1;break;case ContentAlignment.TopCenter:r=new Rectangle(r.x+(r.width-e)/2,r.bottom-i,e,i);break;case ContentAlignment.TopRight:r=new Rectangle(r.right-e,r.bottom-i,e,i),w.width-=r.width+1;break;case ContentAlignment.MiddleLeft:r=new Rectangle(r.x,r.y+(r.height-i)/2,e,i),w.x+=r.width+1,w.width-=r.width+1;break;case ContentAlignment.MiddleCenter:r=new Rectangle(r.x+(r.width-e)/2,r.y+(r.height-i)/2,e,i);break;case ContentAlignment.MiddleRight:r=new Rectangle(r.right-e,r.y+(r.height-i)/2,e,i),w.width-=r.width+1;break;case ContentAlignment.BottomLeft:r=new Rectangle(r.x,r.y,e,i),w.x+=r.width+1,w.width-=r.width+1;break;case ContentAlignment.BottomCenter:r=new Rectangle(r.x+(r.width-e)/2,r.y,e,i);break;case ContentAlignment.BottomRight:r=new Rectangle(r.right-e,r.y,e,i),w.width-=r.width+1;break}let a=new __.c.StiPdfData(d.service);a.X=r.x,a.Y=r.y,a.Width=r.width,a.Height=r.height,d.service.writeImageInfo2(a,1,1)}let f=u.indicator.as(StiDataBarIndicator);if(null!=f&&(f.textPlacement==StiDataBarTextPlacement.Inside||0!=f.value)){let a=w.clone(),t=d.service.hiToTwips,e=(a.inflate(-2*t,-2*t),f.textPlacement==StiDataBarTextPlacement.Inside),i=f.maximum+Math.abs(f.minimum),o=f.value,r=a.width*Math.abs(f.minimum)/i,s=a.width*f.maximum/i,n=a.width*Math.abs(o)/i;if(e){let t=u.autoWidth;try{u.autoWidth=!0;let t=0==o?2:4,e=u.report.unit.convertToHInches(u.getActualSize().width)+t;e>n&&(n=e>a.width?a.width:e),0==o&&(o=n/i,0==s)&&(o=-o)}finally{u.autoWidth=t}}0<o&&n>s&&(n=s),o<0&&n>r&&(n=r);let l=f.direction,m=0,h=((l=l==StiDataBarDirection.Default?null!=u.textOptions&&u.textOptions.rightToLeft?StiDataBarDirection.RighToLeft:StiDataBarDirection.LeftToRight:l)==StiDataBarDirection.LeftToRight?a.x+=0<o?r:r-n:(m=180,a.x=0<o?a.right-r-n:a.right-r),a.width=n,a.clone()),c=(0<f.padding&&a.inflate(-f.padding*d.service.hiToTwips,-f.padding*d.service.hiToTwips),f.cornerRadius),g=Math.max(.48*Math.min(a.width,a.height),.5),S=0<(c=c*d.service.hiToTwips>g?g/d.service.hiToTwips:c)?new StiCornerRadius(c):null,p=(o<0&&(m+=180),!1);if(0<a.width&&0<a.height){if(f.brushType==__.a.Components.StiBrushType.Gradient){let n;if(n=l==StiDataBarDirection.LeftToRight?0<o?new Rectangle(w.left+r,w.top,s,w.height):new Rectangle(w.left,w.top,r,w.height):o<0?new Rectangle(w.left+s,w.top,r,w.height):new Rectangle(w.left,w.top,s,w.height),0<a.width&&a.width<1&&(a.width=1),0<n.width&&n.width<1&&(n.width=1),0<n.width&&0<a.width){let t=o<0?f.negativeColor:f.positiveColor,e=StiColorUtils.light(t,200),i=(n.x-=.1*n.width,n.width+=.2*n.width,new StiGradientBrush(t,e,m)),r=(d.service.fillRectBrush(i,a,S),d.service.shadingArray[d.service.shadingCurrent-1]);r.Angle=m,r.X=n.x,r.Y=n.y,r.Width=n.width,r.Height=n.height,r.FunctionIndex=d.service.getShadingFunctionNumber([t,e]),d.service.shadingArray[d.service.shadingCurrent-1]=r,p=!0}}else{let t=new StiSolidBrush(o<0?f.negativeColor:f.positiveColor);d.service.fillRectBrush(t,a,S)}f.showBorder&&(d.service.pageStream.writeLine("q"),d.service.pushColorToStack(),d.service.setStrokeColor(o<0?f.negativeBorderColor:f.positiveBorderColor),d.service.pageStream.writeLine1("{0} {1} {2} {3} re S",d.service.convertToString(h.x),d.service.convertToString(h.y),d.service.convertToString(h.width),d.service.convertToString(h.height)),d.service.pageStream.writeLine("Q"),d.service.popColorFromStack())}e&&(w=a),p||f.brushType!=__.a.Components.StiBrushType.Gradient||d.service.shadingCurrent++}let t=new __.c.StiPdfData(d.service);return t.X=w.x,t.Y=d.Y,t.Width=w.width,t.Height=d.Height,t.Component=d.Component,t}},__.a.Components.IStiCornerRadius),StiRoundedRectangleShapeType=__.a.Components.StiRoundedRectangleShapeType,StiTriangleShapeType=__.a.Components.StiTriangleShapeType,StiArrowShapeType=__.a.Components.StiArrowShapeType,StiOctagonShapeType=__.a.Components.StiOctagonShapeType,StiComplexArrowShapeType=__.a.Components.StiComplexArrowShapeType,StiBentArrowShapeType=__.a.Components.StiBentArrowShapeType,StiChevronShapeType=__.a.Components.StiChevronShapeType,StiDivisionShapeType=__.a.Components.StiDivisionShapeType,StiEqualShapeType=__.a.Components.StiEqualShapeType,StiFlowchartCardShapeType=__.a.Components.StiFlowchartCardShapeType,StiFlowchartCollateShapeType=__.a.Components.StiFlowchartCollateShapeType,StiFlowchartDecisionShapeType=__.a.Components.StiFlowchartDecisionShapeType,StiFlowchartManualInputShapeType=__.a.Components.StiFlowchartManualInputShapeType,StiFlowchartOffPageConnectorShapeType=__.a.Components.StiFlowchartOffPageConnectorShapeType,StiFlowchartPreparationShapeType=__.a.Components.StiFlowchartPreparationShapeType,StiFlowchartSortShapeType=__.a.Components.StiFlowchartSortShapeType,StiFrameShapeType=__.a.Components.StiFrameShapeType,StiMinusShapeType=__.a.Components.StiMinusShapeType,StiMultiplyShapeType=__.a.Components.StiMultiplyShapeType,StiParallelogramShapeType=__.a.Components.StiParallelogramShapeType,StiPlusShapeType=__.a.Components.StiPlusShapeType,StiRegularPentagonShapeType=__.a.Components.StiRegularPentagonShapeType,StiTrapezoidShapeType=__.a.Components.StiTrapezoidShapeType,StiSnipSameSideCornerRectangleShapeType=__.a.Components.StiSnipSameSideCornerRectangleShapeType,StiSnipDiagonalSideCornerRectangleShapeType=__.a.Components.StiSnipDiagonalSideCornerRectangleShapeType,StiShapeDirection=__.a.Components.StiShapeDirection,StiCheckStyle=__.a.Components.StiCheckStyle;__.c.StiPdfRenderPrimitives=class{static renderBorder1(t){let e,i=null,r=t.Component.as(IStiBrush);null!=(i=null!=r&&null!=r.brush?r.brush:i)&&t.service.fillRectBrush(i,new Rectangle(t.X,t.Y,t.Width,t.Height),null==(e=t.Component.as(IStiCornerRadius))?void 0:e.cornerRadius)}static renderBorder2(h){let c,g=h.Component.as(IStiBorder);if(null!=g){let t=null==(c=h.Component.as(IStiCornerRadius))?void 0:c.cornerRadius;if(null!=t)return void this.renderBorderWithCorners2(h,t);if(g.border.dropShadow&&null!=g.border.shadowBrush){let e=StiBrush.toColor(g.border.shadowBrush);if(0!=e.a){let t=.8*g.border.shadowSize;h.service.setNonStrokeColor(e),h.service.pageStream.writeLine1("{0} {1} {2} {3} re f",h.service.convertToString(h.X+t),h.service.convertToString(h.Y-t),h.service.convertToString(h.Width-t),h.service.convertToString(t)),h.service.pageStream.writeLine1("{0} {1} {2} {3} re f",h.service.convertToString(h.X+h.Width),h.service.convertToString(h.Y-t),h.service.convertToString(t),h.service.convertToString(h.Height))}}let e=new StiBorderSide(g.border.color,g.border.size,g.border.style),i=g.border.as(StiAdvancedBorder),r=null!=i,n=g.border.isLeftBorderSidePresent,a=g.border.isRightBorderSidePresent,o=g.border.isTopBorderSidePresent,s=g.border.isBottomBorderSidePresent,l=g.border.style!=StiPenStyle.None&&g.border.style!=StiPenStyle.Solid,m=g.border.side!=StiBorderSides.None&&g.border.style!=StiPenStyle.None;if(m=r?i.side!=StiBorderSides.None:m){let t=0;r||(l&&(h.service.pageStream.writeLine("q"),h.service.pushColorToStack()),t=this.storeBorderSideData(e,h)),r||g.border.side!=StiBorderSides.All?(n&&(r&&((e=i.leftSide).style!=StiPenStyle.Solid&&(h.service.pageStream.writeLine("q"),h.service.pushColorToStack()),t=this.storeBorderSideData(e,h)),h.service.pageStream.writeLine1("{0} {1} m",h.service.convertToString(h.X-t),h.service.convertToString(h.Y-t)),h.service.pageStream.writeLine1("{0} {1} l S",h.service.convertToString(h.X-t),h.service.convertToString(h.Y+h.Height+t)),e.style==StiPenStyle.Double&&(h.service.pageStream.writeLine1("{0} {1} m",h.service.convertToString(h.X+t),h.service.convertToString(h.Y+(s?t:-t))),h.service.pageStream.writeLine1("{0} {1} l S",h.service.convertToString(h.X+t),h.service.convertToString(h.Y+h.Height+(o?-t:t)))),r)&&e.style!=StiPenStyle.Solid&&(h.service.pageStream.writeLine("Q"),h.service.popColorFromStack()),a&&(r&&((e=i.rightSide).style!=StiPenStyle.Solid&&(h.service.pageStream.writeLine("q"),h.service.pushColorToStack()),t=this.storeBorderSideData(e,h)),h.service.pageStream.writeLine1("{0} {1} m",h.service.convertToString(h.X+h.Width+t),h.service.convertToString(h.Y-t)),h.service.pageStream.writeLine1("{0} {1} l S",h.service.convertToString(h.X+h.Width+t),h.service.convertToString(h.Y+h.Height+t)),e.style==StiPenStyle.Double&&(h.service.pageStream.writeLine1("{0} {1} m",h.service.convertToString(h.X+h.Width-t),h.service.convertToString(h.Y+(s?t:-t))),h.service.pageStream.writeLine1("{0} {1} l S",h.service.convertToString(h.X+h.Width-t),h.service.convertToString(h.Y+h.Height+(o?-t:t)))),r)&&e.style!=StiPenStyle.Solid&&(h.service.pageStream.writeLine("Q"),h.service.popColorFromStack()),o&&(r&&((e=i.topSide).style!=StiPenStyle.Solid&&(h.service.pageStream.writeLine("q"),h.service.pushColorToStack()),t=this.storeBorderSideData(e,h)),h.service.pageStream.writeLine1("{0} {1} m",h.service.convertToString(h.X-t),h.service.convertToString(h.Y+h.Height+t)),h.service.pageStream.writeLine1("{0} {1} l S",h.service.convertToString(h.X+h.Width+t),h.service.convertToString(h.Y+h.Height+t)),e.style==StiPenStyle.Double&&(h.service.pageStream.writeLine1("{0} {1} m",h.service.convertToString(h.X+(n?t:-t)),h.service.convertToString(h.Y+h.Height-t)),h.service.pageStream.writeLine1("{0} {1} l S",h.service.convertToString(h.X+h.Width+(a?-t:t)),h.service.convertToString(h.Y+h.Height-t))),r)&&e.style!=StiPenStyle.Solid&&(h.service.pageStream.writeLine("Q"),h.service.popColorFromStack()),s&&(r&&((e=i.bottomSide).style!=StiPenStyle.Solid&&(h.service.pageStream.writeLine("q"),h.service.pushColorToStack()),t=this.storeBorderSideData(e,h)),h.service.pageStream.writeLine1("{0} {1} m",h.service.convertToString(h.X-t),h.service.convertToString(h.Y-t)),h.service.pageStream.writeLine1("{0} {1} l S",h.service.convertToString(h.X+h.Width+t),h.service.convertToString(h.Y-t)),e.style==StiPenStyle.Double&&(h.service.pageStream.writeLine1("{0} {1} m",h.service.convertToString(h.X+(n?t:-t)),h.service.convertToString(h.Y+t)),h.service.pageStream.writeLine1("{0} {1} l S",h.service.convertToString(h.X+h.Width+(a?-t:t)),h.service.convertToString(h.Y+t))),r)&&e.style!=StiPenStyle.Solid&&(h.service.pageStream.writeLine("Q"),h.service.popColorFromStack())):(h.service.pageStream.writeLine1("{0} {1} {2} {3} re S",h.service.convertToString(h.X-t),h.service.convertToString(h.Y-t),h.service.convertToString(h.Width+2*t),h.service.convertToString(h.Height+2*t)),g.border.style==StiPenStyle.Double&&h.service.pageStream.writeLine1("{0} {1} {2} {3} re S",h.service.convertToString(h.X+t),h.service.convertToString(h.Y+t),h.service.convertToString(h.Width-2*t),h.service.convertToString(h.Height-2*t))),!r&&l&&(h.service.pageStream.writeLine("Q"),h.service.popColorFromStack())}}}static renderBorderWithCorners2(r,n){let a=r.Component.as(IStiBorder);if(null!=a){if(r.service.tempGeomWriter.pageStream=r.service.pageStream,a.border.dropShadow&&null!=a.border.shadowBrush){let e=StiBrush.toColor(a.border.shadowBrush);if(0!=e.a){let t=.8*a.border.shadowSize;r.service.setNonStrokeColor(e),r.service.pageStream.writeLine(r.service.tempGeomWriter.getRectString4(r.X+t,r.Y-t,r.Width-t,t)+"f"),r.service.pageStream.writeLine(r.service.tempGeomWriter.getRectString4(r.X+r.Width,r.Y-t,t,r.Height)+"f")}}let t=a.border.side!=StiBorderSides.None&&a.border.style!=StiPenStyle.None;if(t){let t=a.border.style!=StiPenStyle.Solid,e=(t&&(r.service.pageStream.writeLine("q"),r.service.pushColorToStack()),new StiBorderSide(a.border.color,a.border.size,a.border.style)),i=this.storeBorderSideData(e,r);if(this.writeBorderWithCorners2(r,new Rectangle(r.X,r.Y,r.Width,r.Height),n),a.border.style==StiPenStyle.Double){let t=2*i;this.writeBorderWithCorners2(r,new Rectangle(r.X+2*i,r.Y+2*i,r.Width-4*i,r.Height-4*i),new StiCornerRadius(n.topLeft-t,n.topRight-t,n.bottomRight-t,n.bottomLeft-t))}t&&(r.service.pageStream.writeLine("Q"),r.service.popColorFromStack())}}}static writeBorderWithCorners2(l,m,h){let t=l.Component.as(IStiBorder);if(null!=t){let n=t.border.isLeftBorderSidePresent,a=t.border.isRightBorderSidePresent,o=t.border.isTopBorderSidePresent,s=t.border.isBottomBorderSidePresent;if(t.border.side==StiBorderSides.All)l.service.pageStream.writeLine(l.service.tempGeomWriter.getRectWithCornersString(m,new StiCornerRadius(h.bottomLeft,h.bottomRight,h.topRight,h.topLeft))+"S");else{let t=h.topLeft*l.service.hiToTwips,e=h.topRight*l.service.hiToTwips,i=h.bottomRight*l.service.hiToTwips,r=h.bottomLeft*l.service.hiToTwips;l.service.tempGeomWriter.beginPath(),l.service.tempGeomWriter.forceNewPoint=!0,n&&(l.service.tempGeomWriter.moveTo(new Point(m.x,m.y+r)),l.service.tempGeomWriter.drawLineTo(new Point(m.x,m.y+m.height-t),null)),o&&(n&&0<t&&l.service.tempGeomWriter.drawArc(new Rectangle(m.x,m.y+m.height-2*t,2*t,2*t),180,-90),l.service.tempGeomWriter.moveTo(new Point(m.x+t,m.y+m.height)),l.service.tempGeomWriter.drawLineTo(new Point(m.x+m.width-e,m.y+m.height),null),a)&&0<e&&l.service.tempGeomWriter.drawArc(new Rectangle(m.x+m.width-2*e,m.y+m.height-2*e,2*e,2*e),90,-90),a&&(l.service.tempGeomWriter.moveTo(new Point(m.x+m.width,m.y+m.height-e)),l.service.tempGeomWriter.drawLineTo(new Point(m.x+m.width,m.y+i),null)),s&&(a&&0<i&&l.service.tempGeomWriter.drawArc(new Rectangle(m.x+m.width-2*i,m.y,2*i,2*i),0,-90),l.service.tempGeomWriter.moveTo(new Point(m.x+m.width-i,m.y)),l.service.tempGeomWriter.drawLineTo(new Point(m.x+r,m.y),null),n)&&0<r&&l.service.tempGeomWriter.drawArc(new Rectangle(m.x,m.y,2*r,2*r),270,-90),l.service.tempGeomWriter.endPath(),l.service.pageStream.writeLine(l.service.tempGeomWriter.path.toString()+"S")}}}static storeBorderSideData(t,e){let i=t.size,r=(i<.5&&(i=.5),(i=t.style==StiPenStyle.Double?1:i)*e.service.hiToTwips*.955),n=(e.service.pageStream.writeLine1("{0} w",e.service.convertToString(r)),this.getPenStyleDashString(t.style,.04*r,e));return null!=n&&e.service.pageStream.writeLine(n),e.service.setStrokeColor(t.color),t.style==StiPenStyle.Double?r:0}static getPenStyleDashString(t,e,i){switch(t){case StiPenStyle.Dot:return StiString.format("[{0} {1}] 0 d",i.service.convertToString(e),i.service.convertToString(58*e));case StiPenStyle.Dash:return StiString.format("[{0} {1}] 0 d",i.service.convertToString(49.5*e),i.service.convertToString(62*e));case StiPenStyle.DashDot:return StiString.format("[{0} {1} {2} {1}] 0 d",i.service.convertToString(50*e),i.service.convertToString(55*e),i.service.convertToString(e));case StiPenStyle.DashDotDot:return StiString.format("[{0} {1} {2} {1} {2} {1}] 0 d",i.service.convertToString(50*e),i.service.convertToString(55*e),i.service.convertToString(e))}return null}static checkShape(t){if(t.shapeType.is2(StiVerticalLineShapeType)||t.shapeType.is2(StiHorizontalLineShapeType)||t.shapeType.is2(StiTopAndBottomLineShapeType)||t.shapeType.is2(StiLeftAndRightLineShapeType)||t.shapeType.is2(StiRectangleShapeType)||t.shapeType.is2(StiRoundedRectangleShapeType)||t.shapeType.is2(StiDiagonalDownLineShapeType)||t.shapeType.is2(StiDiagonalUpLineShapeType)||t.shapeType.is2(StiTriangleShapeType)||t.shapeType.is2(StiOvalShapeType)||t.shapeType.is2(StiArrowShapeType)||t.shapeType.is2(StiOctagonShapeType)||t.shapeType.is2(StiComplexArrowShapeType)||t.shapeType.is2(StiBentArrowShapeType)||t.shapeType.is2(StiChevronShapeType)||t.shapeType.is2(StiDivisionShapeType)||t.shapeType.is2(StiEqualShapeType)||t.shapeType.is2(StiFlowchartCardShapeType)||t.shapeType.is2(StiFlowchartCollateShapeType)||t.shapeType.is2(StiFlowchartDecisionShapeType)||t.shapeType.is2(StiFlowchartManualInputShapeType)||t.shapeType.is2(StiFlowchartOffPageConnectorShapeType)||t.shapeType.is2(StiFlowchartPreparationShapeType)||t.shapeType.is2(StiFlowchartSortShapeType)||t.shapeType.is2(StiFrameShapeType)||t.shapeType.is2(StiMinusShapeType)||t.shapeType.is2(StiMultiplyShapeType)||t.shapeType.is2(StiParallelogramShapeType)||t.shapeType.is2(StiPlusShapeType)||t.shapeType.is2(StiRegularPentagonShapeType)||t.shapeType.is2(StiTrapezoidShapeType)||t.shapeType.is2(StiSnipSameSideCornerRectangleShapeType)||t.shapeType.is2(StiSnipDiagonalSideCornerRectangleShapeType))return!0;return!1}static renderShape(m,t){let h=m.Component.as(StiShape);if(null!=h&&1==this.checkShape(h)){let e=m.Component.as(IStiBrush),i=new __.c.StiPdfGeomWriter(m.service.pageStream,m.service,!1),t=Color.transparent;if(0!=(t=null!=e?StiBrush.toColor(e.brush):t).a&&m.service.setNonStrokeColor(t),null!=e&&((e.brush.is(StiGradientBrush)||e.brush.is(StiGlareBrush)||e.brush.is(StiLinearGradientBrush))&&(m.service.storeShadingData2(m.X,m.Y,m.Width,m.Height,e.brush),m.service.pageStream.writeLine1("/Pattern cs /P{0} scn",1+m.service.shadingCurrent)),e.brush.is(StiHatchBrush))){let t=e.brush;m.service.pageStream.writeLine1("/Cs1 cs /PH{0} scn",m.service.getHatchNumber(t)+1)}let r=h.borderColor,n=(m.service.setStrokeColor(r),0<t.a),a=h.style!=StiPenStyle.None;if(!n&&!a)return;let o=n?a?"B":"f":a?"S":"n",s=(m.service.pageStream.writeLine1("{0} w",m.service.convertToString(h.size*m.service.hiToTwips)),m.service.pageStream.writeLine("q"),h.size*m.service.hiToTwips*.04);switch(h.style){case StiPenStyle.Dot:m.service.pageStream.writeLine1("[{0} {1}] 0 d",m.service.convertToString(s),m.service.convertToString(55*s));break;case StiPenStyle.Dash:m.service.pageStream.writeLine1("[{0} {1}] 0 d",m.service.convertToString(50*s),m.service.convertToString(55*s));break;case StiPenStyle.DashDot:m.service.pageStream.writeLine1("[{0} {1} {2} {1}] 0 d",m.service.convertToString(50*s),m.service.convertToString(55*s),m.service.convertToString(s));break;case StiPenStyle.DashDotDot:m.service.pageStream.writeLine1("[{0} {1} {2} {1} {2} {1}] 0 d",m.service.convertToString(50*s),m.service.convertToString(55*s),m.service.convertToString(s));break}if(h.shapeType.is(StiVerticalLineShapeType)&&(n&&m.service.pageStream.writeLine1("{0} {1} {2} {3} re f",m.service.convertToString(m.X),m.service.convertToString(m.Y),m.service.convertToString(m.Width),m.service.convertToString(m.Height)),a)&&(m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l S",m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Y+m.Height))),h.shapeType.is(StiHorizontalLineShapeType)&&(n&&m.service.pageStream.writeLine1("{0} {1} {2} {3} re f",m.service.convertToString(m.X),m.service.convertToString(m.Y),m.service.convertToString(m.Width),m.service.convertToString(m.Height)),a)&&(m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X),m.service.convertToString(m.Y+m.Height/2)),m.service.pageStream.writeLine1("{0} {1} l S",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y+m.Height/2))),h.shapeType.is(StiTopAndBottomLineShapeType)&&(n&&m.service.pageStream.writeLine1("{0} {1} {2} {3} re f",m.service.convertToString(m.X),m.service.convertToString(m.Y),m.service.convertToString(m.Width),m.service.convertToString(m.Height)),a)&&(m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X),m.service.convertToString(m.Y+m.Height)),m.service.pageStream.writeLine1("{0} {1} l S",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y+m.Height)),m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l S",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y))),h.shapeType.is(StiLeftAndRightLineShapeType)&&(n&&m.service.pageStream.writeLine1("{0} {1} {2} {3} re f",m.service.convertToString(m.X),m.service.convertToString(m.Y),m.service.convertToString(m.Width),m.service.convertToString(m.Height)),a)&&(m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l S",m.service.convertToString(m.X),m.service.convertToString(m.Y+m.Height)),m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l S",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y+m.Height))),h.shapeType.is(StiRectangleShapeType)&&(m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X),m.service.convertToString(m.Y+m.Height)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y+m.Height)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l "+o,m.service.convertToString(m.X),m.service.convertToString(m.Y))),h.shapeType.is(StiDiagonalDownLineShapeType)&&(n&&m.service.pageStream.writeLine1("{0} {1} {2} {3} re f",m.service.convertToString(m.X),m.service.convertToString(m.Y),m.service.convertToString(m.Width),m.service.convertToString(m.Height)),a)&&(m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X),m.service.convertToString(m.Y+m.Height)),m.service.pageStream.writeLine1("{0} {1} l S",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y))),h.shapeType.is(StiDiagonalUpLineShapeType)&&(n&&m.service.pageStream.writeLine1("{0} {1} {2} {3} re f",m.service.convertToString(m.X),m.service.convertToString(m.Y),m.service.convertToString(m.Width),m.service.convertToString(m.Height)),a)&&(m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l S",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y+m.Height))),h.shapeType.is(StiTriangleShapeType)){let t=h.shapeType.direction;t==StiShapeDirection.Up&&(m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Y+m.Height)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l "+o,m.service.convertToString(m.X),m.service.convertToString(m.Y))),t==StiShapeDirection.Down&&(o=n?a?"B*":"f*":a?"S":"n",m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X),m.service.convertToString(m.Y+m.Height)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y+m.Height)),m.service.pageStream.writeLine1("{0} {1} l "+o,m.service.convertToString(m.X),m.service.convertToString(m.Y+m.Height))),t==StiShapeDirection.Left&&(m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X),m.service.convertToString(m.Y+m.Height/2)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y+m.Height)),m.service.pageStream.writeLine1("{0} {1} l "+o,m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y))),t==StiShapeDirection.Right&&(o=n?a?"B*":"f*":a?"S":"n",m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y+m.Height/2)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X),m.service.convertToString(m.Y+m.Height)),m.service.pageStream.writeLine1("{0} {1} l "+o,m.service.convertToString(m.X),m.service.convertToString(m.Y)))}if(h.shapeType.is(StiOvalShapeType)&&m.service.pageStream.writeLine1(i.getEllipseString(new Rectangle(m.X,m.Y,m.Width,m.Height))+o),h.shapeType.is(StiRoundedRectangleShapeType)){let t=h.shapeType.round,e=m.Width,i=(e>m.Height&&(e=m.Height),Math.min(e,70)*t),r=i*(1-m.service.pdfCKT);m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X),m.service.convertToString(m.Y+i)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X),m.service.convertToString(m.Y+m.Height-i)),m.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} c",m.service.convertToString(m.X),m.service.convertToString(m.Y+m.Height-r),m.service.convertToString(m.X+r),m.service.convertToString(m.Y+m.Height),m.service.convertToString(m.X+i),m.service.convertToString(m.Y+m.Height)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width-i),m.service.convertToString(m.Y+m.Height)),m.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} c",m.service.convertToString(m.X+m.Width-r),m.service.convertToString(m.Y+m.Height),m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y+m.Height-r),m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y+m.Height-i)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y+i)),m.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} c",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y+r),m.service.convertToString(m.X+m.Width-r),m.service.convertToString(m.Y),m.service.convertToString(m.X+m.Width-i),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+i),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} c "+o,m.service.convertToString(m.X+r),m.service.convertToString(m.Y),m.service.convertToString(m.X),m.service.convertToString(m.Y+r),m.service.convertToString(m.X),m.service.convertToString(m.Y+i))}if(h.shapeType.is(StiArrowShapeType)){let t=h.shapeType.direction,e=h.shapeType.arrowWidth,i=h.shapeType.arrowHeight,r=m.Width*e,n=m.Height*i;t!=StiShapeDirection.Left&&t!=StiShapeDirection.Right||(r=m.Height*e,n=m.Width*i),0==i&&(n=Math.min(m.Width/2,m.Height/2)),t==StiShapeDirection.Up&&(m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X+r),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+r),m.service.convertToString(m.Y+m.Height-n)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X),m.service.convertToString(m.Y+m.Height-n)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Y+m.Height)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y+m.Height-n)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width-r),m.service.convertToString(m.Y+m.Height-n)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width-r),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l "+o,m.service.convertToString(m.X+r),m.service.convertToString(m.Y))),t==StiShapeDirection.Down&&(m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X+m.Width-r),m.service.convertToString(m.Y+m.Height)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width-r),m.service.convertToString(m.Y+n)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y+n)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X),m.service.convertToString(m.Y+n)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+r),m.service.convertToString(m.Y+n)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+r),m.service.convertToString(m.Y+m.Height)),m.service.pageStream.writeLine1("{0} {1} l "+o,m.service.convertToString(m.X+m.Width-r),m.service.convertToString(m.Y+m.Height))),t==StiShapeDirection.Left&&(m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y+r)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+n),m.service.convertToString(m.Y+r)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+n),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X),m.service.convertToString(m.Y+m.Height/2)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+n),m.service.convertToString(m.Y+m.Height)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+n),m.service.convertToString(m.Y+m.Height-r)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y+m.Height-r)),m.service.pageStream.writeLine1("{0} {1} l "+o,m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y+r))),t==StiShapeDirection.Right&&(m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X),m.service.convertToString(m.Y+m.Height-r)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width-n),m.service.convertToString(m.Y+m.Height-r)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width-n),m.service.convertToString(m.Y+m.Height)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y+m.Height/2)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width-n),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width-n),m.service.convertToString(m.Y+r)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X),m.service.convertToString(m.Y+r)),m.service.pageStream.writeLine1("{0} {1} l "+o,m.service.convertToString(m.X),m.service.convertToString(m.Y+m.Height-r)))}if(h.shapeType.is(StiOctagonShapeType)){let t=h.shapeType,e=(null!=h.report?h.report.unit.convertToHInches(t.bevel):t.bevel)*m.service.hiToTwips,i=e;t.autoSize&&(e=m.Width/(2.414*1.414),i=m.Height/(2.414*1.414)),e>m.Width/2&&(e=m.Width/2),i>m.Height/2&&(i=m.Height/2),m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X+e),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width-e),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y+i)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width),m.service.convertToString(m.Y+m.Height-i)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width-e),m.service.convertToString(m.Y+m.Height)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+e),m.service.convertToString(m.Y+m.Height)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X),m.service.convertToString(m.Y+m.Height-i)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X),m.service.convertToString(m.Y+i)),m.service.pageStream.writeLine1("{0} {1} l "+o,m.service.convertToString(m.X+e),m.service.convertToString(m.Y))}if(h.shapeType.is(StiComplexArrowShapeType)){let t=m.Width<m.Height?m.Width/2:m.Height/2,e=m.Height/3.8,i=m.Width/3.8,r=m.Height<m.Width?m.Height/2:m.Width/2;switch(h.shapeType.direction){case StiShapeDirection.Left:case StiShapeDirection.Right:m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X),m.service.convertToString(m.Y+m.Height/2)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+t),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+t),m.service.convertToString(m.Y+e)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right-t),m.service.convertToString(m.Y+e)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right-t),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right),m.service.convertToString(m.Y+m.Height/2)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right-t),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right-t),m.service.convertToString(m.Top-e)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+t),m.service.convertToString(m.Top-e)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+t),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l h "+o,m.service.convertToString(m.X),m.service.convertToString(m.Y+m.Height/2));break;case StiShapeDirection.Down:case StiShapeDirection.Up:m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X),m.service.convertToString(m.Y+r)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right),m.service.convertToString(m.Y+r)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right-i),m.service.convertToString(m.Y+r)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right-i),m.service.convertToString(m.Top-r)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right),m.service.convertToString(m.Top-r)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X),m.service.convertToString(m.Top-r)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+i),m.service.convertToString(m.Top-r)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+i),m.service.convertToString(m.Y+r)),m.service.pageStream.writeLine1("{0} {1} l h "+o,m.service.convertToString(m.X),m.service.convertToString(m.Y+r));break}}if(h.shapeType.is(StiBentArrowShapeType)){let t=0,e=0,i=0;switch(i=(m.Height>m.Width?(e=m.Width/4,t=e):(t=Math.floor(m.Height/4),e=t),e/2),h.shapeType.direction){case StiShapeDirection.Up:m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X),m.service.convertToString(m.Y+t)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right-(i+t)),m.service.convertToString(m.Y+t)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right-(i+t)),m.service.convertToString(m.Top-e)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right-2*e),m.service.convertToString(m.Top-e)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right-e),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right),m.service.convertToString(m.Top-e)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right-i),m.service.convertToString(m.Top-e)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right-i),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l h "+o,m.service.convertToString(m.X),m.service.convertToString(m.Y));break;case StiShapeDirection.Left:m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.Right),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right),m.service.convertToString(m.Top-i)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+e),m.service.convertToString(m.Top-i)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+e),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X),m.service.convertToString(m.Top-e)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+e),m.service.convertToString(m.Top-2*e)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+e),m.service.convertToString(m.Top-e-i)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right-t),m.service.convertToString(m.Top-e-i)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right-t),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l h "+o,m.service.convertToString(m.Right),m.service.convertToString(m.Y));break;case StiShapeDirection.Down:m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.Right),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+i),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+i),m.service.convertToString(m.Y+e)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X),m.service.convertToString(m.Y+e)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+e),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+2*e),m.service.convertToString(m.Y+e)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+e+i),m.service.convertToString(m.Y+e)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+e+i),m.service.convertToString(m.Top-t)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right),m.service.convertToString(m.Top-t)),m.service.pageStream.writeLine1("{0} {1} l h "+o,m.service.convertToString(m.Right),m.service.convertToString(m.Top));break;case StiShapeDirection.Right:m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X),m.service.convertToString(m.Y+i)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right-e),m.service.convertToString(m.Y+i)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right-e),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right),m.service.convertToString(m.Y+e)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right-e),m.service.convertToString(m.Y+2*e)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right-e),m.service.convertToString(m.Y+e+i)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+t),m.service.convertToString(m.Y+e+i)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+t),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l h "+o,m.service.convertToString(m.X),m.service.convertToString(m.Top));break}}if(h.shapeType.is(StiChevronShapeType)){let t=m.Width>m.Height?m.Height/2:m.Width/2;switch(h.shapeType.direction){case StiShapeDirection.Right:m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+t),m.service.convertToString(m.Top-m.Height/2)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right-t),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right),m.service.convertToString(m.Top-m.Height/2)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right-t),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l h "+o,m.service.convertToString(m.X),m.service.convertToString(m.Top));break;case StiShapeDirection.Left:m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.Right),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+t),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X),m.service.convertToString(m.Top-m.Height/2)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+t),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right-t),m.service.convertToString(m.Top-m.Height/2)),m.service.pageStream.writeLine1("{0} {1} l h "+o,m.service.convertToString(m.Right),m.service.convertToString(m.Top));break;case StiShapeDirection.Up:m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X),m.service.convertToString(m.Top-t)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right),m.service.convertToString(m.Top-t)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Y+t)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l h "+o,m.service.convertToString(m.X),m.service.convertToString(m.Top-t));break;case StiShapeDirection.Down:m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Top-t)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.Right),m.service.convertToString(m.Y+t)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l",m.service.convertToString(m.X),m.service.convertToString(m.Y+t)),m.service.pageStream.writeLine1("{0} {1} l h "+o,m.service.convertToString(m.X),m.service.convertToString(m.Top));break}}if(h.shapeType.is(StiDivisionShapeType)){let t=m.Height/3,e=4*m.service.hiToTwips;m.service.pageStream.writeLine1(i.getRectString4(m.X,m.Y+t+e,m.Width,t-2*e)+o),m.service.pageStream.writeLine1(i.getEllipseString4(m.X+m.Width/2-t/2,m.Top-m.service.hiToTwips-t,t,t)+o),m.service.pageStream.writeLine1(i.getEllipseString4(m.X+m.Width/2-t/2,m.Y+2*m.service.hiToTwips,t,t)+o)}if(h.shapeType.is(StiEqualShapeType)){let t=(m.Height-m.Height/6)/2;m.service.pageStream.writeLine1(i.getRectString4(m.X,m.Top-t,m.Width,t)+o),m.service.pageStream.writeLine1(i.getRectString4(m.X,m.Y,m.Width,t)+o)}if(h.shapeType.is(StiFlowchartCardShapeType)&&(m.service.pageStream.writeLine1("{0} {1} m {2} {3} l",m.service.convertToString(m.Right),m.service.convertToString(m.Top),m.service.convertToString(m.Right),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} l {2} {3} l {4} {5} l {6} {7} l h "+o,m.service.convertToString(m.X),m.service.convertToString(m.Y),m.service.convertToString(m.X),m.service.convertToString(m.Top-m.Height/5),m.service.convertToString(m.X+m.Width/5),m.service.convertToString(m.Top),m.service.convertToString(m.Right),m.service.convertToString(m.Top))),h.shapeType.is(StiFlowchartCollateShapeType))switch(h.shapeType.direction){case StiShapeDirection.Down:case StiShapeDirection.Up:m.service.pageStream.writeLine1("{0} {1} m {2} {3} l {4} {5} l h "+o,m.service.convertToString(m.X),m.service.convertToString(m.Top),m.service.convertToString(m.Right),m.service.convertToString(m.Top),m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Y+m.Height/2)),m.service.pageStream.writeLine1("{0} {1} m {2} {3} l {4} {5} l h "+o,m.service.convertToString(m.X),m.service.convertToString(m.Y),m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Y+m.Height/2),m.service.convertToString(m.Right),m.service.convertToString(m.Y));break;case StiShapeDirection.Left:case StiShapeDirection.Right:m.service.pageStream.writeLine1("{0} {1} m {2} {3} l {4} {5} l h "+o,m.service.convertToString(m.X),m.service.convertToString(m.Y),m.service.convertToString(m.X),m.service.convertToString(m.Top),m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Y+m.Height/2)),m.service.pageStream.writeLine1("{0} {1} m {2} {3} l {4} {5} l h "+o,m.service.convertToString(m.Right),m.service.convertToString(m.Y),m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Y+m.Height/2),m.service.convertToString(m.Right),m.service.convertToString(m.Top));break}if(h.shapeType.is(StiFlowchartDecisionShapeType)&&(m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X),m.service.convertToString(m.Top-m.Height/2)),m.service.pageStream.writeLine1("{0} {1} l {2} {3} l {4} {5} l {6} {7} l h "+o,m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Top),m.service.convertToString(m.Right),m.service.convertToString(m.Top-m.Height/2),m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Y),m.service.convertToString(m.X),m.service.convertToString(m.Top-m.Height/2))),h.shapeType.is(StiFlowchartManualInputShapeType)&&(m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X),m.service.convertToString(m.Top-m.Height/5)),m.service.pageStream.writeLine1("{0} {1} l {2} {3} l {4} {5} l {6} {7} l h "+o,m.service.convertToString(m.Right),m.service.convertToString(m.Top),m.service.convertToString(m.Right),m.service.convertToString(m.Y),m.service.convertToString(m.X),m.service.convertToString(m.Y),m.service.convertToString(m.X),m.service.convertToString(m.Top-m.Height/5))),h.shapeType.is(StiFlowchartOffPageConnectorShapeType)){let t=m.Height/5,e=m.Width/5;switch(h.shapeType.direction){case StiShapeDirection.Down:m.service.pageStream.writeLine1("{0} {1} m {2} {3} l",m.service.convertToString(m.X),m.service.convertToString(m.Top),m.service.convertToString(m.Right),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l {2} {3} l {4} {5} l {6} {7} l h "+o,m.service.convertToString(m.Right),m.service.convertToString(m.Y+t),m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Y),m.service.convertToString(m.X),m.service.convertToString(m.Y+t),m.service.convertToString(m.X),m.service.convertToString(m.Top));break;case StiShapeDirection.Up:m.service.pageStream.writeLine1("{0} {1} m {2} {3} l",m.service.convertToString(m.X),m.service.convertToString(m.Y),m.service.convertToString(m.X),m.service.convertToString(m.Top-t)),m.service.pageStream.writeLine1("{0} {1} l {2} {3} l {4} {5} l {6} {7} l h "+o,m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Top),m.service.convertToString(m.Right),m.service.convertToString(m.Top-t),m.service.convertToString(m.Right),m.service.convertToString(m.Y),m.service.convertToString(m.X),m.service.convertToString(m.Y));break;case StiShapeDirection.Left:m.service.pageStream.writeLine1("{0} {1} m {2} {3} l",m.service.convertToString(m.X+e),m.service.convertToString(m.Top),m.service.convertToString(m.Right),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l {2} {3} l {4} {5} l {6} {7} l h "+o,m.service.convertToString(m.Right),m.service.convertToString(m.Y),m.service.convertToString(m.X+e),m.service.convertToString(m.Y),m.service.convertToString(m.X),m.service.convertToString(m.Top-m.Height/2),m.service.convertToString(m.X+e),m.service.convertToString(m.Top));break;case StiShapeDirection.Right:m.service.pageStream.writeLine1("{0} {1} m {2} {3} l",m.service.convertToString(m.X),m.service.convertToString(m.Top),m.service.convertToString(m.Right-e),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l {2} {3} l {4} {5} l {6} {7} l h "+o,m.service.convertToString(m.Right),m.service.convertToString(m.Top-m.Height/2),m.service.convertToString(m.Right-e),m.service.convertToString(m.Y),m.service.convertToString(m.X),m.service.convertToString(m.Y),m.service.convertToString(m.X),m.service.convertToString(m.Top));break}}if(h.shapeType.is(StiFlowchartPreparationShapeType)){let t=m.Width/5,e=m.Height/5,i=m.Width/2,r=m.Height/2;switch(h.shapeType.direction){case StiShapeDirection.Left:case StiShapeDirection.Right:m.service.pageStream.writeLine1("{0} {1} m {2} {3} l {4} {5} l",m.service.convertToString(m.X),m.service.convertToString(m.Top-r),m.service.convertToString(m.X+t),m.service.convertToString(m.Top),m.service.convertToString(m.Right-t),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l {2} {3} l {4} {5} l {6} {7} l h "+o,m.service.convertToString(m.Right),m.service.convertToString(m.Top-r),m.service.convertToString(m.Right-t),m.service.convertToString(m.Y),m.service.convertToString(m.X+t),m.service.convertToString(m.Y),m.service.convertToString(m.X),m.service.convertToString(m.Top-r));break;case StiShapeDirection.Down:case StiShapeDirection.Up:m.service.pageStream.writeLine1("{0} {1} m {2} {3} l {4} {5} l",m.service.convertToString(m.X+i),m.service.convertToString(m.Top),m.service.convertToString(m.Right),m.service.convertToString(m.Top-e),m.service.convertToString(m.Right),m.service.convertToString(m.Y+e)),m.service.pageStream.writeLine1("{0} {1} l {2} {3} l {4} {5} l {6} {7} l h "+o,m.service.convertToString(m.X+i),m.service.convertToString(m.Y),m.service.convertToString(m.X),m.service.convertToString(m.Y+e),m.service.convertToString(m.X),m.service.convertToString(m.Top-e),m.service.convertToString(m.X+i),m.service.convertToString(m.Top));break}}if(h.shapeType.is(StiFlowchartSortShapeType)&&(m.service.pageStream.writeLine1("{0} {1} m {2} {3} l",m.service.convertToString(m.X),m.service.convertToString(m.Top-m.Height/2),m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l {2} {3} l {4} {5} l {6} {7} l h "+o,m.service.convertToString(m.Right),m.service.convertToString(m.Top-m.Height/2),m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Y),m.service.convertToString(m.X),m.service.convertToString(m.Top-m.Height/2),m.service.convertToString(m.Right),m.service.convertToString(m.Top-m.Height/2))),h.shapeType.is(StiFrameShapeType)){let t=m.Width/7,e=m.Height/7;m.service.pageStream.writeLine1("{0} {1} m {2} {3} l {4} {5} l {6} {7} l h",m.service.convertToString(m.X),m.service.convertToString(m.Top),m.service.convertToString(m.Right),m.service.convertToString(m.Top),m.service.convertToString(m.Right),m.service.convertToString(m.Y),m.service.convertToString(m.X),m.service.convertToString(m.Y)),m.service.pageStream.writeLine1("{0} {1} m {2} {3} l {4} {5} l {6} {7} l h "+o,m.service.convertToString(m.X+t),m.service.convertToString(m.Top-e),m.service.convertToString(m.X+t),m.service.convertToString(m.Y+e),m.service.convertToString(m.Right-t),m.service.convertToString(m.Y+e),m.service.convertToString(m.Right-t),m.service.convertToString(m.Top-e))}if(h.shapeType.is(StiMinusShapeType)){let t=m.Height/3;m.service.pageStream.writeLine1(i.getRectString4(m.X,m.Y+t,m.Width,t)+o)}if(h.shapeType.is(StiMultiplyShapeType)){let t=m.Width/4,e=m.Height/4;m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X),m.service.convertToString(m.Top-e)),m.service.pageStream.writeLine1("{0} {1} l {2} {3} l {4} {5} l {6} {7} l",m.service.convertToString(m.X+t),m.service.convertToString(m.Top),m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Top-e),m.service.convertToString(m.Right-t),m.service.convertToString(m.Top),m.service.convertToString(m.Right),m.service.convertToString(m.Top-e)),m.service.pageStream.writeLine1("{0} {1} l {2} {3} l {4} {5} l {6} {7} l",m.service.convertToString(m.Right-t),m.service.convertToString(m.Top-m.Height/2),m.service.convertToString(m.Right),m.service.convertToString(m.Y+e),m.service.convertToString(m.Right-t),m.service.convertToString(m.Y),m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Y+e)),m.service.pageStream.writeLine1("{0} {1} l {2} {3} l {4} {5} l h "+o,m.service.convertToString(m.X+t),m.service.convertToString(m.Y),m.service.convertToString(m.X),m.service.convertToString(m.Y+e),m.service.convertToString(m.X+t),m.service.convertToString(m.Top-m.Height/2))}if(h.shapeType.is(StiParallelogramShapeType)&&m.service.pageStream.writeLine1("{0} {1} m {2} {3} l {4} {5} l {6} {7} l h "+o,m.service.convertToString(m.X),m.service.convertToString(m.Y),m.service.convertToString(m.X+m.Width/5),m.service.convertToString(m.Top),m.service.convertToString(m.Right),m.service.convertToString(m.Top),m.service.convertToString(m.Right-m.Width/5),m.service.convertToString(m.Y)),h.shapeType.is(StiPlusShapeType)){let t=m.Width/3,e=m.Height/3;m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(m.X+t),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l {2} {3} l {4} {5} l {6} {7} l",m.service.convertToString(m.Right-t),m.service.convertToString(m.Top),m.service.convertToString(m.Right-t),m.service.convertToString(m.Top-e),m.service.convertToString(m.Right),m.service.convertToString(m.Top-e),m.service.convertToString(m.Right),m.service.convertToString(m.Y+e)),m.service.pageStream.writeLine1("{0} {1} l {2} {3} l {4} {5} l {6} {7} l",m.service.convertToString(m.Right-t),m.service.convertToString(m.Y+e),m.service.convertToString(m.Right-t),m.service.convertToString(m.Y),m.service.convertToString(m.X+t),m.service.convertToString(m.Y),m.service.convertToString(m.X+t),m.service.convertToString(m.Y+e)),m.service.pageStream.writeLine1("{0} {1} l {2} {3} l {4} {5} l {6} {7} l h "+o,m.service.convertToString(m.X),m.service.convertToString(m.Y+e),m.service.convertToString(m.X),m.service.convertToString(m.Top-e),m.service.convertToString(m.X+t),m.service.convertToString(m.Top-e),m.service.convertToString(m.X+t),m.service.convertToString(m.Top))}if(h.shapeType.is(StiRegularPentagonShapeType)){let t=m.Height/2.6,e=m.Width/5.5;m.service.pageStream.writeLine1("{0} {1} m {2} {3} l",m.service.convertToString(m.X),m.service.convertToString(m.Top-t),m.service.convertToString(m.X+m.Width/2),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l {2} {3} l {4} {5} l {6} {7} l h "+o,m.service.convertToString(m.Right),m.service.convertToString(m.Top-t),m.service.convertToString(m.Right-e),m.service.convertToString(m.Y),m.service.convertToString(m.X+e),m.service.convertToString(m.Y),m.service.convertToString(m.X),m.service.convertToString(m.Top-t))}if(h.shapeType.is(StiTrapezoidShapeType)){let t=m.Width/4.75;m.service.pageStream.writeLine1("{0} {1} m {2} {3} l {4} {5} l {6} {7} l h "+o,m.service.convertToString(m.X),m.service.convertToString(m.Y),m.service.convertToString(m.X+t),m.service.convertToString(m.Top),m.service.convertToString(m.Right-t),m.service.convertToString(m.Top),m.service.convertToString(m.Right),m.service.convertToString(m.Y))}if(h.shapeType.is(StiSnipSameSideCornerRectangleShapeType)){let t=m.Width/7.2,e=m.Height/4.6;m.service.pageStream.writeLine1("{0} {1} m {2} {3} l {4} {5} l",m.service.convertToString(m.X),m.service.convertToString(m.Top-e),m.service.convertToString(m.X+t),m.service.convertToString(m.Top),m.service.convertToString(m.Right-t),m.service.convertToString(m.Top)),m.service.pageStream.writeLine1("{0} {1} l {2} {3} l {4} {5} l h "+o,m.service.convertToString(m.Right),m.service.convertToString(m.Top-e),m.service.convertToString(m.Right),m.service.convertToString(m.Y),m.service.convertToString(m.X),m.service.convertToString(m.Y))}if(h.shapeType.is(StiSnipDiagonalSideCornerRectangleShapeType)){let t=m.Width/7.2,e=m.Height/4.6;m.service.pageStream.writeLine1("{0} {1} m {2} {3} l {4} {5} l",m.service.convertToString(m.X),m.service.convertToString(m.Top),m.service.convertToString(m.Right-t),m.service.convertToString(m.Top),m.service.convertToString(m.Right),m.service.convertToString(m.Top-e)),m.service.pageStream.writeLine1("{0} {1} l {2} {3} l {4} {5} l h "+o,m.service.convertToString(m.Right),m.service.convertToString(m.Y),m.service.convertToString(m.X+t),m.service.convertToString(m.Y),m.service.convertToString(m.X),m.service.convertToString(m.Y+e))}m.service.pageStream.writeLine("Q");let l=h.getParsedText();if(!StiString.isNullOrWhiteSpace(l)){let t=new StiText(h.clientRectangle),e=(t.text=l,t.font=h.font,t.textBrush=new StiSolidBrush(h.foreColor),t.horAlignment=h.horAlignment,t.vertAlignment=h.vertAlignment,t.margins=h.margins,t.wordWrap=!0,t.textQuality=__.a.Components.StiTextQuality.Typographic,t.page=h.page,m.clone());e.Component=t,__.c.StiPdfRenderText.renderTextFont(e),__.c.StiPdfRenderText.renderText(e)}}}static renderRoundedRectanglePrimitive(S){let i=S.Component.as(IStiBorder);if(null!=i){let t=new StiBorderSide(i.border.color,i.border.size,i.border.style),n=S.Component.as(StiRoundedRectanglePrimitive);if(n.style==StiPenStyle.None)return;let e=i.border.style!=StiPenStyle.None&&i.border.style!=StiPenStyle.Solid,a=(e&&(S.service.pageStream.writeLine("q"),S.service.pushColorToStack()),this.storeBorderSideData(t,S)),o=Math.min(S.Width<S.Height?S.Width:S.Height,100*S.Component.page.zoom)*n.round,s=o*(1-S.service.pdfCKT),l=S.X-a,m=S.X+S.Width+a,h=S.X+S.Width/2,c=S.Y-a,g=S.Y+S.Height+a;if(n.leftSide&&(n.bottomSide?(S.service.pageStream.writeLine1("{0} {1} m",S.service.convertToString(n.rightSide?h:m),S.service.convertToString(c)),S.service.pageStream.writeLine1("{0} {1} l",S.service.convertToString(l+o),S.service.convertToString(c)),S.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} c",S.service.convertToString(l+s),S.service.convertToString(c),S.service.convertToString(l),S.service.convertToString(c+s),S.service.convertToString(l),S.service.convertToString(c+o))):S.service.pageStream.writeLine1("{0} {1} m",S.service.convertToString(l),S.service.convertToString(c)),n.topSide?(S.service.pageStream.writeLine1("{0} {1} l",S.service.convertToString(l),S.service.convertToString(g-o)),S.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} c",S.service.convertToString(l),S.service.convertToString(g-s),S.service.convertToString(l+s),S.service.convertToString(g),S.service.convertToString(l+o),S.service.convertToString(g)),S.service.pageStream.writeLine1("{0} {1} l S",S.service.convertToString(n.rightSide?h:m),S.service.convertToString(g))):S.service.pageStream.writeLine1("{0} {1} l S",S.service.convertToString(l),S.service.convertToString(g))),n.rightSide&&(n.bottomSide?(S.service.pageStream.writeLine1("{0} {1} m",S.service.convertToString(n.leftSide?h:l),S.service.convertToString(c)),S.service.pageStream.writeLine1("{0} {1} l",S.service.convertToString(m-o),S.service.convertToString(c)),S.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} c",S.service.convertToString(m-s),S.service.convertToString(c),S.service.convertToString(m),S.service.convertToString(c+s),S.service.convertToString(m),S.service.convertToString(c+o))):S.service.pageStream.writeLine1("{0} {1} m",S.service.convertToString(m),S.service.convertToString(c)),n.topSide?(S.service.pageStream.writeLine1("{0} {1} l",S.service.convertToString(m),S.service.convertToString(g-o)),S.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} c",S.service.convertToString(m),S.service.convertToString(g-s),S.service.convertToString(m-s),S.service.convertToString(g),S.service.convertToString(m-o),S.service.convertToString(g)),S.service.pageStream.writeLine1("{0} {1} l S",S.service.convertToString(n.leftSide?h:l),S.service.convertToString(g))):S.service.pageStream.writeLine1("{0} {1} l S",S.service.convertToString(m),S.service.convertToString(g))),!n.topSide||n.leftSide||n.rightSide||(S.service.pageStream.writeLine1("{0} {1} m",S.service.convertToString(l),S.service.convertToString(g)),S.service.pageStream.writeLine1("{0} {1} l S",S.service.convertToString(m),S.service.convertToString(g))),!n.bottomSide||n.leftSide||n.rightSide||(S.service.pageStream.writeLine1("{0} {1} m",S.service.convertToString(l),S.service.convertToString(c)),S.service.pageStream.writeLine1("{0} {1} l S",S.service.convertToString(m),S.service.convertToString(c))),t.style==StiPenStyle.Double){s=(o-=2*a)*(1-S.service.pdfCKT);let t=S.X+a,e=S.X+S.Width-a,i=S.Y+a,r=S.Y+S.Height-a;n.leftSide&&(n.bottomSide?(S.service.pageStream.writeLine1("{0} {1} m",S.service.convertToString(n.rightSide?h:m),S.service.convertToString(i)),S.service.pageStream.writeLine1("{0} {1} l",S.service.convertToString(t+o),S.service.convertToString(i)),S.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} c",S.service.convertToString(t+s),S.service.convertToString(i),S.service.convertToString(t),S.service.convertToString(i+s),S.service.convertToString(t),S.service.convertToString(i+o))):S.service.pageStream.writeLine1("{0} {1} m",S.service.convertToString(t),S.service.convertToString(c)),n.topSide?(S.service.pageStream.writeLine1("{0} {1} l",S.service.convertToString(t),S.service.convertToString(r-o)),S.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} c",S.service.convertToString(t),S.service.convertToString(r-s),S.service.convertToString(t+s),S.service.convertToString(r),S.service.convertToString(t+o),S.service.convertToString(r)),S.service.pageStream.writeLine1("{0} {1} l S",S.service.convertToString(n.rightSide?h:m),S.service.convertToString(r))):S.service.pageStream.writeLine1("{0} {1} l S",S.service.convertToString(t),S.service.convertToString(g))),n.rightSide&&(n.bottomSide?(S.service.pageStream.writeLine1("{0} {1} m",S.service.convertToString(n.leftSide?h:l),S.service.convertToString(i)),S.service.pageStream.writeLine1("{0} {1} l",S.service.convertToString(e-o),S.service.convertToString(i)),S.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} c",S.service.convertToString(e-s),S.service.convertToString(i),S.service.convertToString(e),S.service.convertToString(i+s),S.service.convertToString(e),S.service.convertToString(i+o))):S.service.pageStream.writeLine1("{0} {1} m",S.service.convertToString(e),S.service.convertToString(c)),n.topSide?(S.service.pageStream.writeLine1("{0} {1} l",S.service.convertToString(e),S.service.convertToString(r-o)),S.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} c",S.service.convertToString(e),S.service.convertToString(r-s),S.service.convertToString(e-s),S.service.convertToString(r),S.service.convertToString(e-o),S.service.convertToString(r)),S.service.pageStream.writeLine1("{0} {1} l S",S.service.convertToString(n.leftSide?h:l),S.service.convertToString(r))):S.service.pageStream.writeLine1("{0} {1} l S",S.service.convertToString(e),S.service.convertToString(g))),!n.topSide||n.leftSide||n.rightSide||(S.service.pageStream.writeLine1("{0} {1} m",S.service.convertToString(l),S.service.convertToString(r)),S.service.pageStream.writeLine1("{0} {1} l S",S.service.convertToString(m),S.service.convertToString(r))),!n.bottomSide||n.leftSide||n.rightSide||(S.service.pageStream.writeLine1("{0} {1} m",S.service.convertToString(l),S.service.convertToString(i)),S.service.pageStream.writeLine1("{0} {1} l S",S.service.convertToString(m),S.service.convertToString(i)))}e&&(S.service.pageStream.writeLine("Q"),S.service.popColorFromStack())}}static renderCheckbox(n,a,o=!0){let s=n.Component.as(StiCheckBox);if(null!=s){let t=null;switch(a?s.checkStyleForTrue:s.checkStyleForFalse){case StiCheckStyle.Cross:t="62.568 52.024 m 62.018 52.166 60.405 52.537 58.984 52.848 c 55.336 53.645 49.313 58.685 44.741 64.767 c 40.839 69.958 l 45.919 71.092 l \r\n"+"53.272 72.735 59.559 76.81 67.746 85.239 c 74.954 92.661 l 68.543 100.174 l 56.77 113.972 54.196 123.193 59.915 131.088 c 62.809 135.083 71.734 143.458 73.097 143.458 c \r\n"+"73.509 143.458 74.16 141.77 74.546 139.708 c 75.526 134.457 81.002 122.942 85.482 116.708 c 87.557 113.82 89.473 111.458 89.74 111.458 c \r\n"+"90.006 111.458 93.515 114.945 97.537 119.208 c 113.934 136.584 127.211 138.972 135.818 126.095 c 139.973 119.877 140.004 118.024 135.958 117.739 c \r\n"+"130.11 117.329 118.795 109.205 110.443 99.42 c 105.812 93.994 l 110.69 89.679 l 117.241 83.884 129.589 77.786 136.531 76.919 c \r\n"+"139.576 76.539 142.068 75.813 142.068 75.307 c 142.068 72.526 132.802 60.889 129.038 58.942 c 121.077 54.825 112.668 58.23 96.273 72.209 c \r\n"+"91.287 76.46 l 84.2 67.488 l 80.303 62.554 75.379 57.368 73.259 55.965 c 69.353 53.38 64.393 51.552 62.568 52.024 c h";break;case StiCheckStyle.Check:t="60.972 37.503 m 51.173 63.277 43.562 76.623 35.37 82.397 c 30.912 85.54 l 33.664 88.435 l 37.539 92.513 43.698 95.935 48.566 96.713 c \r\n"+"52.426 97.33 53.024 97.093 57.102 93.334 c 59.763 90.882 63.368 85.726 66.269 80.223 c 68.899 75.234 71.18 71.153 71.337 71.153 c \r\n"+"71.493 71.153 73.65 74.19 76.13 77.903 c 96.259 108.044 129.683 141.214 157.565 158.718 c 166.414 164.274 l 168.677 161.643 l \r\n"+"170.941 159.012 l 163.178 152.717 l 139.859 133.81 108.017 94.486 89.043 61.164 c 82.362 49.432 81.87 48.851 73.952 43.345 c \r\n"+"69.45 40.214 64.908 37.04 63.858 36.292 c 62.149 35.074 61.848 35.2 60.972 37.503 c h";break;case StiCheckStyle.CrossRectangle:t="24.153 97.958 m 24.153 170.458 l 98.653 170.458 l 173.153 170.458 l 173.153 97.958 l 173.153 25.458 l 98.653 25.458 l 24.153 25.458 l 24.153 97.958 l h \r\n"+"157.911 97.708 m 157.653 154.958 l 98.653 154.958 l 39.653 154.958 l 39.393 98.958 l 39.25 68.158 39.348 42.395 39.611 41.708 c \r\n"+"39.987 40.727 52.819 40.458 99.129 40.458 c 158.169 40.458 l 157.911 97.708 l h \r\n"+"67.337 54.521 m 65.513 54.912 62.41 56.378 60.442 57.778 c 57.123 60.14 48.153 70.186 48.153 71.541 c 48.153 71.87 50.57 72.68 53.525 73.342 c \r\n"+"60.71 74.95 67.272 79.277 75.328 87.718 c 82.003 94.713 l 75.624 102.027 l 64.931 114.288 61.644 123.705 65.472 131.108 c \r\n"+"67.054 134.168 78.562 145.458 80.098 145.458 c 80.556 145.458 81.245 143.77 81.63 141.708 c 82.611 136.457 88.086 124.942 92.567 118.708 c \r\n"+"94.642 115.82 96.558 113.458 96.824 113.458 c 97.091 113.458 100.6 116.945 104.622 121.208 c 121.019 138.584 134.296 140.972 142.903 128.095 c \r\n"+"147.058 121.877 147.089 120.024 143.043 119.739 c 137.213 119.33 124.806 110.39 117.127 101.066 c 113.226 96.33 113.155 96.112 114.876 94.198 c \r\n"+"118.066 90.648 128.579 83.654 133.847 81.578 c 136.682 80.461 141.285 79.244 144.077 78.873 c 146.868 78.503 149.153 77.878 149.153 77.484 c \r\n"+"149.153 75.37 140.777 64.275 137.501 62.048 c 129.107 56.344 120.869 59.278 103.358 74.209 c 98.372 78.46 l 91.285 69.488 l \r\n"+"81.563 57.18 74.76 52.928 67.337 54.521 c h";break;case StiCheckStyle.CheckRectangle:t="19.915 96.5 m 19.915 169 l 91.857 169 l 163.8 169 l 170.357 173.111 l 176.914 177.223 l 178.882 174.861 l 179.963 173.563 180.864 172.217 180.882 171.872 c \r\n"+"180.9 171.526 178.44 169.334 175.415 167 c 169.915 162.757 l 169.915 93.378 l 169.915 24 l 94.915 24 l 19.915 24 l 19.915 96.5 l h \r\n"+"153.915 92.622 m 153.915 141.962 153.786 146.137 152.294 144.899 c 149.513 142.592 136.609 126.998 127.965 115.5 c 117.473 101.544 104.486 81.963 98.451 71 c \r\n"+"93.993 62.903 93.316 62.192 84.16 56 c 78.873 52.425 74.256 49.375 73.9 49.223 c 73.544 49.07 71.988 52.22 70.441 56.223 c \r\n"+"68.895 60.225 65.183 68.635 62.192 74.911 c 57.906 83.903 55.515 87.56 50.914 92.161 c 47.703 95.372 44.364 98 43.495 98 c \r\n"+"40.697 98 41.79 99.66 47.479 104.049 c 53.073 108.365 60.662 111.14 64.28 110.194 c 67.84 109.263 73.689 102.039 78.2 93.002 c \r\n"+"82.663 84.062 l 87.207 90.895 l 95.518 103.394 108.214 118.311 125.807 136.25 c 143.215 154 l 89.565 154 l 35.915 154 l 35.915 96.5 l \r\n"+"35.915 39 l 94.915 39 l 153.915 39 l 153.915 92.622 l h";break;case StiCheckStyle.CrossCircle:t="83.347 26.864 m 61.07 31.95 42.193 47.128 32.202 67.986 c 23.401 86.36 23.68 110.034 32.919 128.958 c 41.882 147.315 60.868 162.86 80.847 168.201 c \r\n"+"91.083 170.936 112.112 170.628 121.812 167.6 c 147.999 159.425 167.881 138.673 173.432 113.721 c 175.869 102.768 175 85.662 171.452 74.743 c \r\n"+"164.795 54.256 145.804 35.792 124.126 28.729 c 117.735 26.647 113.94 26.133 102.847 25.845 c 93.814 25.61 87.363 25.947 83.347 26.864 c h \r\n"+"112.414 41.542 m 129.545 44.672 146.131 57.503 153.827 73.579 c 168.725 104.698 152.719 141.239 119.425 152.119 c 112.712 154.313 109.49 154.763 100.347 154.781 c \r\n"+"90.993 154.8 88.185 154.404 81.579 152.131 c 64.423 146.231 51.91 134.6 45.14 118.265 c 42.988 113.072 42.446 109.911 42.069 100.368 c \r\n"+"41.551 87.229 42.811 81.166 48.181 70.958 c 52.288 63.15 63.613 51.864 71.549 47.67 c 83.611 41.295 98.688 39.034 112.414 41.542 c h \r\n"+"69.097 66.583 m 66.21 69.342 63.847 71.942 63.847 72.361 c 63.847 72.78 69.506 78.671 76.422 85.451 c 88.996 97.78 l 76.198 110.607 l 63.4 123.434 l \r\n"+"68.336 128.446 l 71.051 131.202 73.641 133.458 74.091 133.458 c 74.542 133.458 80.666 127.846 87.7 120.988 c 100.49 108.517 l 104.919 113.071 l \r\n"+"107.354 115.575 113.31 121.259 118.154 125.701 c 126.961 133.777 l 132.308 128.496 l 137.656 123.215 l 124.694 110.658 l 111.733 98.1 l 124.866 84.939 l \r\n"+"137.999 71.779 l 132.815 67.118 l 129.964 64.555 127.11 62.458 126.474 62.458 c 125.837 62.458 119.93 67.858 113.347 74.458 c \r\n"+"106.765 81.058 100.96 86.458 100.449 86.458 c 99.938 86.458 93.856 80.857 86.933 74.013 c 74.347 61.567 l 69.097 66.583 l h";break;case StiCheckStyle.DotCircle:t="81.653 29.406 m 59.375 34.493 40.499 49.67 30.507 70.529 c 21.706 88.903 21.985 112.576 31.224 131.5 c 40.187 149.857 59.173 165.402 79.153 170.743 c \r\n"+"89.388 173.479 110.417 173.17 120.117 170.142 c 146.304 161.968 166.186 141.215 171.737 116.263 c 174.174 105.311 173.305 88.205 169.757 77.285 c \r\n"+"163.1 56.798 144.109 38.334 122.431 31.271 c 116.04 29.189 112.245 28.675 101.153 28.387 c 92.119 28.152 85.668 28.49 81.653 29.406 c h \r\n"+"111.653 44.504 m 132.341 48.848 149.671 64.959 155.751 85.5 c 158.113 93.481 158.113 107.519 155.751 115.5 c 150.089 134.629 134.635 149.703 114.653 155.588 c \r\n"+"106.553 157.973 90.741 157.974 82.695 155.589 c 62.46 149.592 46.687 133.961 41.605 114.869 c 39.656 107.547 39.74 91.753 41.764 84.932 c \r\n"+"50.494 55.507 80.736 38.013 111.653 44.504 c h \r\n"+"90.005 77.33 m 76.55 82.362 69.825 98.176 75.898 110.5 c 78.035 114.836 83.045 119.856 87.653 122.277 c 93.231 125.208 104.066 125.204 109.705 122.27 c \r\n"+"127.735 112.887 128.781 89.485 111.62 79.428 c 106.047 76.162 95.789 75.166 90.005 77.33 c h";break;case StiCheckStyle.DotRectangle:t="23.847 98.805 m 23.847 171.305 l 98.347 171.305 l 172.847 171.305 l 172.847 98.805 l 172.847 26.305 l 98.347 26.305 l 23.847 26.305 l 23.847 98.805 l h \r\n"+"157.847 98.813 m 157.847 156.321 l 98.597 156.063 l 39.347 155.805 l 39.089 98.555 l 38.831 41.305 l 98.339 41.305 l 157.847 41.305 l 157.847 98.813 l h \r\n"+"63.527 64.959 m 63.153 65.333 62.847 80.638 62.847 98.972 c 62.847 132.305 l 98.361 132.305 l 133.874 132.305 l 133.611 98.555 l 133.347 64.805 l \r\n"+"98.777 64.542 l 79.763 64.398 63.901 64.585 63.527 64.959 c h";break;case StiCheckStyle.NoneCircle:t="83.5 29.406 m 61.222 34.493 42.346 49.67 32.355 70.529 c 23.554 88.903 23.832 112.576 33.071 131.5 c 42.034 149.857 61.02 165.402 81 170.743 c \r\n"+"91.235 173.479 112.265 173.17 121.965 170.142 c 148.151 161.968 168.034 141.215 173.585 116.263 c 176.022 105.311 175.152 88.205 171.605 77.285 c \r\n"+"164.948 56.798 145.957 38.334 124.278 31.271 c 117.887 29.189 114.092 28.675 103 28.387 c 93.966 28.152 87.515 28.49 83.5 29.406 c h \r\n"+"113.5 44.504 m 134.189 48.848 151.519 64.959 157.598 85.5 c 159.961 93.481 159.961 107.519 157.598 115.5 c 151.937 134.629 136.483 149.703 116.5 155.588 c \r\n"+"108.401 157.973 92.589 157.974 84.543 155.589 c 64.308 149.592 48.534 133.961 43.453 114.869 c 41.504 107.547 41.588 91.753 43.612 84.932 c \r\n"+"52.342 55.507 82.583 38.013 113.5 44.504 c h";break;case StiCheckStyle.NoneRectangle:t="24.153 97.958 m 24.153 170.458 l 98.653 170.458 l 173.153 170.458 l 173.153 97.958 l 173.153 25.458 l 98.653 25.458 l 24.153 25.458 l 24.153 97.958 l h \r\n"+"157.911 97.708 m 157.653 154.958 l 98.653 154.958 l 39.653 154.958 l 39.393 98.958 l 39.25 68.158 39.348 42.395 39.611 41.708 c \r\n"+"39.987 40.727 52.819 40.458 99.129 40.458 c 158.169 40.458 l 157.911 97.708 l h";break}n.service.pageStream.writeLine("q"),n.service.pushColorToStack();let e=StiBrush.toColor(s.textBrush);if(0!=e.a&&n.service.setNonStrokeColor(e),(s.textBrush.is(StiGradientBrush)||s.textBrush.is(StiGlareBrush)||s.textBrush.is(StiLinearGradientBrush))&&(o&&n.service.storeShadingData2(n.X,n.Y,n.Width,n.Height,s.textBrush),n.service.pageStream.writeLine1("/Pattern cs /P{0} scn",1+n.service.shadingCurrent)),s.textBrush.is(StiHatchBrush)){let t=s.textBrush;n.service.pageStream.writeLine1("/Cs1 cs /PH{0} scn",n.service.getHatchNumber(t)+1)}n.service.setStrokeColor(s.contourColor),n.service.pageStream.writeLine1("{0} w",n.service.convertToString(s.size)),n.service.pageStream.writeLine1("1 0 0 1 {0} {1} cm",n.service.convertToString(n.X+n.Width/2),n.service.convertToString(n.Y+n.Height/2));let i=Math.min(n.Width,n.Height),r=i/200;n.service.pageStream.writeLine1("{0} 0 0 {0} 0 0 cm",n.service.convertToString(r)),n.service.pageStream.writeLine("1 0 0 1 -98 -98 cm"),n.service.pageStream.writeLine(t),n.service.pageStream.writeLine("B"),n.service.pageStream.writeLine("Q"),n.service.popColorFromStack()}}static getCheckBoxValue(t){let r=null;if(null!=t&&null!=t.checkedValue){r=!1;let e=t.checkedValue.toString().trim().toLowerCase(),i=t.values.split("/");if(null!=(i=1==(i=1==i.length?t.values.split(";"):i).length?t.values.split(","):i)&&0<i.length){let t=i[0].trim().toLowerCase();r=e==t}}return r}};{class opa{static renderText(H,t=null,b=!0){if(H.service.pdfFont.UseUnicode)return void this.renderText3(H,null);let O=H.Component.as(IStiTextBrush),E=H.Component.as(IStiText),W=H.Component.as(IStiTextOptions),G=H.Component.as(IStiTextHorAlignment),z=H.Component.as(IStiVertAlignment),U=H.Component.as(StiText),V=null!=W&&W.textOptions.wordWrap,X=null!=G&&G.horAlignment==StiTextHorAlignment.Width,y=(0<H.service.annotsCounter||0<H.service.annots2Counter)&&U.editable,j=null!=W&&null!=W.textOptions&&W.textOptions.rightToLeft,v=null,Y=0,q=0,K=U.textQuality==__.a.Components.StiTextQuality.Wysiwyg,Q=(X&&(V=!0),H.service.pdfFont.UseUnicode);if(null!=E){let t=U.margins,e=this.hiToTwips*t.left,i=this.hiToTwips*t.right,r=this.hiToTwips*t.top,n=this.hiToTwips*t.bottom,A=H.X+e,T=H.Y+n,F=H.Width-e-i,o=H.Height-r-n,a=0,s=0,l=0,m=0;if(U.border.style!=StiPenStyle.None){let t=U.border.getSizeOffset();U.border.isLeftBorderSidePresent&&(a=t),U.border.isRightBorderSidePresent&&(s=t),U.border.isTopBorderSidePresent&&(l=t),U.border.isBottomBorderSidePresent&&(m=t)}let h=U.border.as(StiAdvancedBorder),c=(null!=h&&(a=h.leftSide.getSizeOffset(),s=h.rightSide.getSizeOffset(),l=h.topSide.getSizeOffset(),m=h.bottomSide.getSizeOffset()),.94),g=(A+=this.hiToTwips*c*a,T+=this.hiToTwips*c*m,F-=this.hiToTwips*c*(a+s),o-=this.hiToTwips*c*(l+m),y||(H.service.pageStream.writeLine("q"),H.service.pushColorToStack(),b?H.service.pageStream.writeLine1("{0} {1} {2} {3} re W n",H.service.convertToString(A),H.service.convertToString(T),H.service.convertToString(F),H.service.convertToString(o)):H.service.pageStream.writeLine1("{0} {1} {2} {3} re W n",H.service.convertToString(H.X),H.service.convertToString(H.Y),H.service.convertToString(H.Width),H.service.convertToString(H.Height))),Color.transparent);if(null!=O){if(g=StiBrush.toColor(O.textBrush),H.service.setNonStrokeColor(g),H.service.storeShadingData2(H.X,H.Y,H.Width,H.Height,O.textBrush),(O.textBrush.is(StiGradientBrush)||O.textBrush.is(StiGlareBrush)||O.textBrush.is(StiLinearGradientBrush))&&H.service.pageStream.writeLine1("/Pattern cs /P{0} scn",1+H.service.shadingCurrent),O.textBrush.is(StiHatchBrush)){let t=O.textBrush.as(StiHatchBrush);H.service.pageStream.writeLine1("/Cs1 cs /PH{0} scn",H.service.getHatchNumber(t)+1)}if(y){let t=H.service.annotsArray[H.service.annotsCurrent];t.FontColor=g}}let C=1,P=H.Component.as(IStiFont),S=1,p=(C=null!=P?P.font.sizeInPoints:C)*this.fontCorrectValue*H.service.pdfFont.tmASC/1e3*S,d=C*this.fontCorrectValue*H.service.pdfFont.tmDESC/1e3*-1*S,u=C*this.fontCorrectValue*H.service.pdfFont.tmExternal/1e3*S,w=C*this.fontCorrectValue*H.service.pdfFont.UnderscoreSize/1e3*S,f=C*this.fontCorrectValue*H.service.pdfFont.UnderscorePosition/1e3*S,L=C*this.fontCorrectValue*H.service.pdfFont.StrikeoutSize/1e3*S,k=C*this.fontCorrectValue*H.service.pdfFont.StrikeoutPosition/1e3*S,B=p-d+u,I=B*U.lineSpacing,D=p,R=d,_=!1,N=(null!=W&&(q=W.textOptions.angle,_=45<q&&q<135||225<q&&q<315),y&&(A-=H.X,T-=H.Y),0);if(null==H.service.report||H.service.report.renderedWith==__.a.StiRenderedWith.JS){let t=H.service.pdfFont.Widths[0]/2048*C/11;_?(T+=t,o-=2*t):(A+=t,F-=2*t)}else{if(U.textQuality==__.a.Components.StiTextQuality.Standard){let t=.35-.04*(14-C),e=(N=137.61)*(C*this.fontCorrectValue)/1e3;_?(T+=t+e,o-=2*(t+e)):(A+=t+e,F-=2*(t+e))}if(U.textQuality==__.a.Components.StiTextQuality.Typographic){let t=.05+.009*(8-C);_?(T+=t,o-=2*t):(A+=t,F-=2*t)}}let M=E.text;if(null==M&&(M=""),M=H.service.stringReplace(M,"\r",""),M=H.service.stringReplace(M,"",""),X&&(M=M.trimEnd()).endsWith("\n")&&(M=M.substr(0,M.length-1)),y&&(v=H.service.stringReplace(E.text,"\n","")),0<F&&0<M.length){let i=A,r=T,n=F,a=o;if(null!=W&&0!=(q=W.textOptions.angle)){if(_){let t=F;F=o,o=t}A=-F/2,T=-o/2}let b=__.c.StiExportUtils.splitString(M,!1);if(V)for(let h=0;h<b.length;h++){let r=b[h];if(r.length<2)continue;let n=new StringBuilder,a=0;while(a<r.length)if(Char.isWhitespace(r,a))n.append(r.charAt(a)),a++;else{let t=new StringBuilder;while(a<r.length&&!Char.isWhitespace(r,a))t.append(r.charAt(a)),a++;let e=new StringBuilder(__.c.StiBidirectionalConvert2.convertString(t.toString(),!1)),i=(n.append(e),t.length-e.length);0<i&&n.append(StiString.repeat(String.fromCharCode(0),i))}let e=[],o=n.toString();for(let t=0;t<r.length;t++)e[t]=H.service.pdfFont.UnicodeMap[o.charCodeAt(t)];let s=StiArray.create(Number,r.length),l=StiArray.create(Number,r.length),i=0,m=0;for(let t=0;t<e.length;t++)32<=e[t]&&(m+=H.service.pdfFont.Widths[e[t]-32]),9==e[t]&&(m+=this.getTabsSize(W,C,m+N)+N),s[t]=StiMath.trunc(m),this.isWordWrapSymbol(o,t)&&0<t&&i++,l[t]=i;let t=m*(C*this.fontCorrectValue)/1e3;if(t>F){let t=r.length-1,e=StiMath.trunc(1e3*F/(C*this.fontCorrectValue));while(s[t]>e&&0<t)t--;let i=t;if(0<l[t]){if(l[t]!=l[t+1])i=t++;else{while(!this.isWordWrapSymbol(o,t))t--;i=t-1;while(Char.isWhitespace(o,i)&&0<i)i--}while(Char.isWhitespace(o,t)&&"\t"!=o.charAt(t))t++}else t++;b[h]=X?r.substr(0,i+1)+this.charCode07:r.substr(0,i+1),b.splice(h+1,0,r.substr(t,r.length-t).trimStart())}}Y=b.length;let t=-1;for(let r=0;r<b.length;r++){let t=b[r],e=(0!=H.service.pdfFont.UnicodeMap[160]&&65535==H.service.pdfFont.GlyphList[H.service.pdfFont.UnicodeMap[160]]&&(t=H.service.stringReplace(t," "," ")),__.c.StiBidirectionalConvert2.convertString(t,j)),i="";for(let t=0;t<e.length;t++)i+=String.fromCharCode(H.service.pdfFont.UnicodeMap[e.charCodeAt(t)]);b[r]=i}if(null!=z){let t=(Y-1)*I+B,e=z.vertAlignment;(e=0!=q&&90!=q&&180!=q&&270!=q?StiVertAlignment.Center:e)==StiVertAlignment.Top&&(T+=o-t+(B-D)),e==StiVertAlignment.Center&&(U.textQuality==__.a.Components.StiTextQuality.Typographic?T+=(o-t)/2-R:T+=(o-t)/2+1.2*(B-D)),e==StiVertAlignment.Bottom&&(U.textQuality==__.a.Components.StiTextQuality.Typographic?T+=-R:T+=1.4*(B-D))}H.service.pageStream.writeLine("BT");let E=0,y=0,v=StiArray.create2(Number,b.length,3),x=null;if(0!=q){let t=q*Math.PI/180;x=new Matrix(Math.cos(t),Math.sin(t),-Math.sin(t),Math.cos(t),i+n/2,r+a/2),H.service.pdfFont.NeedSyntItalic&&null!=P&&P.font.italic||H.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} Tm",H.service.convertToString(x.elements[0]),H.service.convertToString(x.elements[1]),H.service.convertToString(x.elements[2]),H.service.convertToString(x.elements[3]),H.service.convertToString(x.elements[4]),H.service.convertToString(x.elements[5]))}H.service.pdfFont.NeedSyntBold&&null!=P&&P.font.bold&&(H.service.pageStream.writeLine1("{0} w 2 Tr",H.service.convertToString(this.boldFontStrokeWidthValue*C,3)),H.service.setStrokeColor(g));for(let f=0;f<Y;f++){let a=b[f],r=StiArray.create(Number,a.length),n=0,o=0,i=0,s=1e3*F/(C*this.fontCorrectValue),l=H.service.pdfFont.Widths[H.service.pdfFont.UnicodeMap["…".charCodeAt(0)]],m=0;for(let e=0;e<a.length;e++){let t=a.charCodeAt(e);if(32<=t&&(o+=H.service.pdfFont.Widths[t-32]),9==t){let t=this.getTabsSize(W,C,o);o+=t,r[n++]=t}o+l<s&&(i=o,m=e)}if(o=o*(C*this.fontCorrectValue)/1e3,-1!=t&&(f==Y-1&&t<b.length||o>F)&&(a=a.substr(0,m)+String.fromCharCode(H.service.pdfFont.UnicodeMap["…".charCodeAt(0)]),o=(i+l)*(C*this.fontCorrectValue)/1e3),Q){let i=new StringBuilder;for(let t=0;t<a.length;t++){t%121==120&&i.appendLine("\r");let e=a.charCodeAt(t);if(32==e||9==e||7==e)i.append(a.charAt(t));else{let t=H.service.pdfFont.GlyphList[e];65535==t&&(t=0),i.appendFormat("{0:X4}",t)}}a=i.toString()}else a=__.c.StiPdfExportService.convertToEscapeSequence(a);let e=A,h=T+I*(Y-f-1),c=!1,g=!1;if(null!=G){let t=G.horAlignment;if(X&&(0<a.length&&7===a.charCodeAt(a.length-1)?a=a.substr(0,a.length-1):t=StiTextHorAlignment.Left),0!=q&&90!=q&&180!=q&&270!=q&&(t=StiTextHorAlignment.Center),null!=W&&null!=W.textOptions&&W.textOptions.rightToLeft&&(t==StiTextHorAlignment.Left?t=StiTextHorAlignment.Right:t==StiTextHorAlignment.Right&&(t=StiTextHorAlignment.Left)),t==StiTextHorAlignment.Center&&(e+=(F-o)/2),t==StiTextHorAlignment.Right&&(e+=F-o),t==StiTextHorAlignment.Width){let e=0;for(let t=0;t<a.length;t++)32===a.charCodeAt(t)&&e++;if(0<e&&(f!=b.length-1||K&&o>F)){g=!0;let i=(F-o)/e*1e3/(C*this.fontCorrectValue);if(0<i||K){c=!0,(i+=H.service.pdfFont.Widths[0])<.5*H.service.pdfFont.Widths[0]&&(i=.5*H.service.pdfFont.Widths[0]);let e=Q?"<":"(";for(let t=0;t<a.length;t++)32===a.charCodeAt(t)?e+=Q?">-"+H.service.convertToString(i)+"<":")-"+H.service.convertToString(i)+"(":e+=a[t];e+=Q?">":")",a=e}}}}if(0<n){let e=0,i="";0==g&&(i+=Q?"<":"(");for(let t=0;t<a.length;t++)if("\t"==a[t]){let t=r[e++];i+=Q?">-"+H.service.convertToString(t)+"<":")-"+H.service.convertToString(t)+"("}else i+=a[t];0==g&&(i+=Q?">":")"),a=i}Q&&(a=H.service.stringReplace(a," ",H.service.pdfFont.GlyphList[32].toString(16).toUpperCase()[Stimulsoft.System.StiObject.stimulsoft]().padLeft(4,"0"))[Stimulsoft.System.StiObject.stimulsoft]().replaceAll(this.charCode07,"0000"));let S=null!=H.service.pdfFont.ChildFontsMap,p=0,d=StiArray.create(Number,a.length),u=new Array;for(let n=0;n<a.length;n++){let i=a.charCodeAt(n),r=!1;if(13==(d[n]=i)&&(u.push(n),r=!0),S){let t=H.service.pdfFont.UnicodeMapBack[i],e=(92==i&&(t=H.service.pdfFont.UnicodeMapBack[a.charCodeAt(n+1)]),H.service.pdfFont.ChildFontsMap[t]);t<64&&(0<n?e=p:1<a.length&&(e=H.service.pdfFont.ChildFontsMap[H.service.pdfFont.UnicodeMapBack[a.charCodeAt(1)]])),92!=i&&(d[n]=H.service.pdfFont.fonts[e].UnicodeMap[t]),e==p||r||0==n||u.push(n),p=e}}if(u.push(a.length),v[f][0]=e,v[f][1]=h,v[f][2]=o,H.service.pdfFont.NeedSyntItalic&&null!=P&&P.font.italic){let t=new Matrix(1,0,this.italicAngleTanValue,1,e,h);null!=x&&t.multiplyAppend(t),H.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} Tm",H.service.convertToString(t.elements[0]),H.service.convertToString(t.elements[1]),H.service.convertToString(t.elements[2]),H.service.convertToString(t.elements[3]),H.service.convertToString(t.elements[4]),H.service.convertToString(t.elements[5]))}else H.service.pageStream.writeLine1("{0} {1} Td",H.service.convertToString(e-E),H.service.convertToString(h-y)),E=e,y=h;let w=0;for(let i=0;i<u.length;i++){if(S&&0<a.length){let t=a.charCodeAt(w)<64&&a.length>w+1?w+1:w,e=H.service.pdfFont.ChildFontsMap[H.service.pdfFont.UnicodeMapBack[a.charCodeAt(t)]];H.service.pageStream.writeLine1("/F{0} {1} Tf",e,H.service.convertToString(C*this.fontCorrectValue,this.precision_digits_font))}let t=u[i],e=t-w;0<e&&(c||0<n?(H.service.pageStream.writeString("["),0<i&&H.service.pageStream.writeString(Q?"<":"("),H.service.pageStream.write(d,w,e),i<u.length-1&&H.service.pageStream.writeString(Q?">":")"),H.service.pageStream.writeLine("] TJ")):(H.service.pageStream.writeString(Q?"<":"("),H.service.pageStream.write(d,w,e),H.service.pageStream.writeLine1("{0} Tj",Q?">":")"))),(w=t)<d.length-1&&13==d[t]&&w++}}if(H.service.pdfFont.NeedSyntBold&&null!=P&&P.font.bold&&H.service.pageStream.writeLine("0 Tr"),H.service.pageStream.writeLine("ET"),null!=P&&P.font.underline){H.service.pageStream.writeLine("q"),H.service.pushColorToStack();let t=.07*C,e=.1*-C;if(0!=H.service.pdfFont.UnderscoreSize&&(t=w,e=f),t<.1&&(t=.1),H.service.pageStream.writeLine1("{0} w",H.service.convertToString(t)),0!=q){let t=q*Math.PI/180;H.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} cm",H.service.convertToString(Math.cos(t)),H.service.convertToString(Math.sin(t)),H.service.convertToString(-Math.sin(t)),H.service.convertToString(Math.cos(t)),H.service.convertToString(i+n/2),H.service.convertToString(r+a/2))}null!=O&&H.service.setStrokeColor(g);for(let t=0;t<b.length;t++)0!=v[t][2]&&(H.service.pageStream.writeLine1("{0} {1} m",H.service.convertToString(v[t][0]),H.service.convertToString(v[t][1]+e)),H.service.pageStream.writeLine1("{0} {1} l S",H.service.convertToString(v[t][0]+v[t][2]),H.service.convertToString(v[t][1]+e)));H.service.pageStream.writeLine("Q"),H.service.popColorFromStack()}if(null!=P&&P.font.strikeout){H.service.pageStream.writeLine("q"),H.service.pushColorToStack();let t=.045*C,e=.25*C;if(0!=H.service.pdfFont.StrikeoutSize&&(t=L,e=k),t<.1&&(t=.1),H.service.pageStream.writeLine1("{0} w",H.service.convertToString(t)),0!=q){let t=q*Math.PI/180;H.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} cm",H.service.convertToString(Math.cos(t)),H.service.convertToString(Math.sin(t)),H.service.convertToString(-Math.sin(t)),H.service.convertToString(Math.cos(t)),H.service.convertToString(i+n/2),H.service.convertToString(r+a/2))}null!=O&&H.service.setStrokeColor(g);for(let t=0;t<b.length;t++)0!=v[t][2]&&(H.service.pageStream.writeLine1("{0} {1} m",H.service.convertToString(v[t][0]),H.service.convertToString(v[t][1]+e)),H.service.pageStream.writeLine1("{0} {1} l S",H.service.convertToString(v[t][0]+v[t][2]),H.service.convertToString(v[t][1]+e)));H.service.pageStream.writeLine("Q"),H.service.popColorFromStack()}}if(y){let e=H.service.annotsArray[H.service.annotsCurrent];if(e.Multiline=V,e.X=H.X,e.Y=H.Y,e.Width=H.Width,e.Height=H.Height,e.Text=v,e.Component=H.Component,e.Alignment=StiTextHorAlignment.Left,null!=G){let t=G.horAlignment;null!=W&&null!=W.textOptions&&W.textOptions.rightToLeft&&(t==StiTextHorAlignment.Left?t=StiTextHorAlignment.Right:t==StiTextHorAlignment.Right&&(t=StiTextHorAlignment.Left)),e.Alignment=t}}y||(H.service.pageStream.writeLine("Q"),H.service.popColorFromStack())}}static isWordWrapSymbol(i,r){let t=i.charCodeAt(r),e=i.charAt(r);if(12288<=t&&t<=55215||Char.isWhitespace(i,r)&&160!=t||6016<=t&&t<=6050||"("==e||"{"==e)return!0;if(0<r){let t=i.charCodeAt(r-1);if(12288<=t&&t<=55215)return!0;let e=i.charAt(r-1);if("!"==e||"%"==e||")"==e||"}"==e||"-"==e||"?"==e)return!0}return!1}static getTabsSize(n,a,o){if(null!=n&&null!=n.textOptions){let e=o,t=750/a,i=t*n.textOptions.distanceBetweenTabs,r=t*n.textOptions.firstTabOffset+i;if(o<r)e=r;else if(0<n.textOptions.distanceBetweenTabs){let t=StiMath.trunc((o-r)/i);t++,e=r+t*i}return e-o}return 0}static renderTextFont(r){let t=r.Component.as(IStiFont);if(null!=t){let e=r.service.pdfFont.getFontNumber(t.font),i=t.font.sizeInPoints*this.fontCorrectValue;if(r.service.pageStream.writeLine1("/F{0} {1} Tf",e,r.service.convertToString(i,this.precision_digits_font)),r.service.pdfFont.currentFont=e,(0<r.service.annotsCounter||0<r.service.annots2Counter)&&r.Component.as(StiText).editable){let t=r.service.annotsArray[r.service.annotsCurrent];t.FontNumber=e,t.FontSize=i}}}static renderText2(A,T=-1){let t=A.Component.as(IStiText),e=A.Component.as(IStiTextOptions),F=A.Component.as(StiText);if(null==t||A.Width<=0)return;if(StiString.isNullOrWhiteSpace(t.text))return;let i=(0<A.service.annotsCounter||0<A.service.annots2Counter)&&F.editable,r=null!=e&&null!=e.textOptions&&e.textOptions.rightToLeft,C=0,n=F.margins,a=0,o=a*n.left,s=a*n.right,l=a*n.top,m=a*n.bottom,P=A.X+o,L=A.Y+m,h=A.Width-o-s,k=A.Height-l-m;if(h<=0)return;i||(A.service.pageStream.writeLine("q"),A.service.pushColorToStack(),A.service.pageStream.writeLine1("{0} {1} {2} {3} re W n",A.service.convertToString(A.X),A.service.convertToString(A.Y),A.service.convertToString(A.Width),A.service.convertToString(A.Height)));let B=!1,I=(null!=e&&(C=e.textOptions.angle,B=45<C&&C<135||225<C&&C<315),i&&(P-=A.X,L-=A.Y),P),D=L,R=h,_=k;if(null!=e&&0!=C){if(B){let t=h;h=k,k=t}P=-h/2,L=-k/2}let N=null;if(0!=C){let t=C*Math.PI/180;N=new Matrix(Math.cos(t),Math.sin(t),-Math.sin(t),Math.cos(t),I+R/2,D+_/2)}let c=[],M=[];StiHtmlTextRender.drawTextForOutput(F,c,M);for(let e=0;e<c.length;e++){let t=c[e];t.text=__.c.StiBidirectionalConvert2.convertString(t.text,r,!0,!0)}if(Stimulsoft.StiOptions.Export.Pdf.useProperCaseFontNamesFromHtml)for(let r of M){let e=r.fontName,i=!1;for(let t=0;t<e.length;t++)if(Char.isUpper(e,t)){i=!0;break}if(!i){let t=Stimulsoft.System.Globalization.CultureInfo.ivariantCulture.textInfo.toTitleCase(e),i=null;if(-1!=t.indexOf(",")){let e=t.split(",");for(let t of e)if((i=new Font(t,r.fontBase.size,r.fontBase.style)).name.toLowerCase()==t.toLowerCase())break}else i=new Font(t,r.fontBase.size,r.fontBase.style);r.fontBase=i,r.fontName=i.name}}let H=StiBrush.toColor(F.brush),O=!1,W=F.page.unit.convertRectangleToHInches(A.Component.componentToPage(A.Component.clientRectangle)),G=F.convertTextMargins(W,!1);G=F.convertTextBorders(G,!1);for(let x of c){let r=P+this.hiToTwips*(G.left+x.xPos-W.left),n=L+this.hiToTwips*(W.bottom-(G.top+x.yPos)),s=(B&&(r=P+this.hiToTwips*(W.bottom-G.bottom+x.xPos),n=L+this.hiToTwips*(W.right-(G.left+x.yPos))),A.service.pageStream.writeLine("q"),A.service.pushColorToStack(),M[x.fontIndex].fontBase),t=A.service.pdfFont.getFontNumber(s),e=s.sizeInPoints*this.fontCorrectValue,l=(A.service.pageStream.writeLine1("/F{0} {1} Tf",t,A.service.convertToString(e,this.precision_digits_font)),A.service.pdfFont.currentFont=t,A.service.pdfFont.UseUnicode),m=s.sizeInPoints,i=1,a=m*this.fontCorrectValue*A.service.pdfFont.tmASC/1e3*i,o=m*this.fontCorrectValue*A.service.pdfFont.tmDESC/1e3*-1*i,h=m*this.fontCorrectValue*A.service.pdfFont.tmExternal/1e3*i,c=m*this.fontCorrectValue*A.service.pdfFont.UnderscoreSize/1e3*i,g=m*this.fontCorrectValue*A.service.pdfFont.UnderscorePosition/1e3*i,S=m*this.fontCorrectValue*A.service.pdfFont.StrikeoutSize/1e3*i,p=m*this.fontCorrectValue*A.service.pdfFont.StrikeoutPosition/1e3*i,d=(a-o+h)*F.lineSpacing,u=a,w=o,f=!0;if(l&&-1==x.glyphIndexList[0]){f=!1;for(let t=0;t<x.text.length;t++)x.glyphIndexList[t]=A.service.pdfFont.GlyphList[A.service.pdfFont.UnicodeMap[x.text.charCodeAt(t)]]}n-=u;let b=0,E=0;for(let r=0;r<x.glyphIndexList.length;r++){let t=x.text.charCodeAt(r),e=(l&&f&&(t=x.glyphIndexList[r],t=A.service.pdfFont.GlyphBackList[t]),A.service.pdfFont.UnicodeMap[t]),i=1e3;32<=e&&(i=A.service.pdfFont.Widths[e-32]),0==t&&null!=A.service.pdfFont.GlyphWidths&&(i=A.service.pdfFont.GlyphWidths[x.glyphIndexList[r]]),i*=x.scaleList[r],l?0<x.glyphWidths[r]&&(b+=x.glyphWidths[r],E+=i):(b+=x.widths[r],E+=i)}let y=b*this.hiToTwips,v=y/(m*this.fontCorrectValue/1e3)/E;if((O=O||x.backColor.equals(H)?O:!0)&&0!=x.backColor.a&&(A.service.setNonStrokeColor(x.backColor),A.service.pageStream.writeLine1("{0} {1} {2} {3} re f",A.service.convertToString(r),A.service.convertToString(n- -o),A.service.convertToString(y),A.service.convertToString(d))),A.service.setNonStrokeColor(x.textColor),l){let t=new Rectangle(r,n,y,k),e=Graphics.getCustomFont(s.name,s.style);this.renderTextLine(A,x.text,t,s,e,F.horAlignment==StiTextHorAlignment.Width?StiTextHorAlignment.Width:F.rightToLeft?StiTextHorAlignment.Right:StiTextHorAlignment.Left,F.rightToLeft,N,x.textColor)}else{let a=new StringBuilder,o=(b=0,E=0);a.append(l?"<":"(");for(let n=0;n<x.glyphIndexList.length;n++){let t=x.text.charCodeAt(n),e=(l&&f&&(t=x.glyphIndexList[n],t=A.service.pdfFont.GlyphBackList[t]),A.service.pdfFont.UnicodeMap[t]),i=1e3,r=(32<=e&&(i=A.service.pdfFont.Widths[e-32]),0);if(0<(l?x.glyphWidths:x.widths)[n]?(E+=i*x.scaleList[n],o+=i,r=-(E*v-o),o+=-r):r=i,l){let t=x.glyphIndexList[n];65535==t&&(t=0),a.appendFormat("{0:X4}",t),n<x.glyphIndexList.length-1&&a.append(">"+A.service.convertToString(r)+"<")}else a.append(__.c.StiPdfExportService.convertToEscapeSequencePlusTabs(String.fromCharCode(e))),n<x.glyphIndexList.length-1&&a.append(")"+A.service.convertToString(r)+"(")}a.append(l?">":")");let e=StiArray.create(Number,a.length);for(let t=0;t<a.length;t++)e[t]=a.charCodeAt(t);A.service.pageStream.writeLine("BT");let i=null;if(0!=C){let t=C*Math.PI/180,e=(i=new Matrix(Math.cos(t),Math.sin(t),-Math.sin(t),Math.cos(t),I+R/2,D+_/2),new Matrix(1,0,0,1,r,n));i.multiplyPrepend(e)}if(A.service.pdfFont.NeedSyntItalic&&s.italic)if(null!=i){let t=new Matrix(1,0,this.italicAngleTanValue,1,0,0);i.multiplyPrepend(t)}else{let t=new Matrix(1,0,this.italicAngleTanValue,1,r,n);i=t}if(null!=i?A.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} Tm",A.service.convertToString(i.elements[0],7),A.service.convertToString(i.elements[1],7),A.service.convertToString(i.elements[2],7),A.service.convertToString(i.elements[3],7),A.service.convertToString(i.elements[4],6),A.service.convertToString(i.elements[5],6)):A.service.pageStream.writeLine1("{0} {1} Td",A.service.convertToString(r),A.service.convertToString(n)),A.service.pdfFont.NeedSyntBold&&s.bold&&(A.service.pageStream.writeLine1("{0} w 2 Tr",A.service.convertToString(this.boldFontStrokeWidthValue*m*this.fontCorrectValue,this.precision_digits_font)),A.service.setStrokeColor(x.textColor)),A.service.pageStream.writeString("["),A.service.pageStream.flush(),A.service.pageStream.write(e,0,e.length),A.service.pageStream.writeLine("] TJ"),A.service.pageStream.writeLine("ET"),A.service.pdfFont.NeedSyntBold&&s.bold&&A.service.pageStream.writeLine("0 Tr"),s.underline){A.service.pageStream.writeLine("q"),A.service.pushColorToStack();let t=.09*m,e=.115*-m;if(0!=A.service.pdfFont.UnderscoreSize&&(t=c,e=g),t<.1&&(t=.1),A.service.pageStream.writeLine1("{0} w",A.service.convertToString(t)),0!=C){let t=C*Math.PI/180;A.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} cm",A.service.convertToString(Math.cos(t),7),A.service.convertToString(Math.sin(t),7),A.service.convertToString(-Math.sin(t),7),A.service.convertToString(Math.cos(t),7),A.service.convertToString(I+R/2,6),A.service.convertToString(D+_/2,6))}A.service.setStrokeColor(x.textColor),A.service.pageStream.writeLine1("{0} {1} m",A.service.convertToString(r),A.service.convertToString(n+e)),A.service.pageStream.writeLine1("{0} {1} l S",A.service.convertToString(r+y),A.service.convertToString(n+e)),A.service.pageStream.writeLine("Q"),A.service.popColorFromStack()}if(s.strikeout){A.service.pageStream.writeLine("q"),A.service.pushColorToStack();let t=.09*m,e=.4*m;if(0!=A.service.pdfFont.StrikeoutSize&&(t=S,e=p),t<.1&&(t=.1),A.service.pageStream.writeLine1("{0} w",A.service.convertToString(t)),0!=C){let t=C*Math.PI/180;A.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} cm",A.service.convertToString(Math.cos(t),7),A.service.convertToString(Math.sin(t),7),A.service.convertToString(-Math.sin(t),7),A.service.convertToString(Math.cos(t),7),A.service.convertToString(I+R/2,6),A.service.convertToString(D+_/2,6))}A.service.setStrokeColor(x.textColor),A.service.pageStream.writeLine1("{0} {1} m",A.service.convertToString(r),A.service.convertToString(n+e)),A.service.pageStream.writeLine1("{0} {1} l S",A.service.convertToString(r+y),A.service.convertToString(n+e)),A.service.pageStream.writeLine("Q"),A.service.popColorFromStack()}}if(A.service.pageStream.writeLine("Q"),A.service.popColorFromStack(),-1!=T&&!StiString.isNullOrWhiteSpace(x.href)&&!x.href.trim().startsWith("javascript:")&&!A.service.usePdfA){let t=new __.c.StiLinkObject;t.Link=x.href,t.X=r,t.Y=n+w,t.Width=y,t.Height=d,t.Page=T,t.DestPage=-1,t.DestY=-1,A.service.linksArray.push(t)}}t.linesOfUnderline,StiPenStyle.None,i||(A.service.pageStream.writeLine("Q"),A.service.popColorFromStack())}static renderText3(h,N=-1){let t=h.Component.as(IStiText),i=h.Component.as(IStiTextOptions),r=h.Component.as(StiText);if(null==t||h.Width<=0)return;let e=(0<h.service.annotsCounter||0<h.service.annots2Counter)&&r.editable,n=0,a=null,o=r.margins,s=this.hiToTwips*o.left,M=this.hiToTwips*o.right,H=this.hiToTwips*o.top,l=this.hiToTwips*o.bottom,m=h.X+s,c=h.Y+l,g=h.Width-s-M,S=h.Height-H-l,p=0,d=0,u=0,w=0;if(r.border.style!=StiPenStyle.None){let t=r.border.getSizeOffset();r.border.isLeftBorderSidePresent&&(p=t),r.border.isRightBorderSidePresent&&(d=t),r.border.isTopBorderSidePresent&&(u=t),r.border.isBottomBorderSidePresent&&(w=t)}let f=r.border.as(StiAdvancedBorder),b=(null!=f&&(p=f.leftSide.getSizeOffset(),d=f.rightSide.getSizeOffset(),u=f.topSide.getSizeOffset(),w=f.bottomSide.getSizeOffset()),.94);if(m+=this.hiToTwips*b*p,c+=this.hiToTwips*b*w,g-=this.hiToTwips*b*(p+d),S-=this.hiToTwips*b*(u+w),g<=0)return;e||(h.service.pageStream.writeLine("q"),h.service.pushColorToStack(),h.service.pageStream.writeLine1("{0} {1} {2} {3} re W n",h.service.convertToString(h.X),h.service.convertToString(h.Y),h.service.convertToString(h.Width),h.service.convertToString(h.Height)));let O=m,W=c,G=g,z=S,E=(e&&(m-=h.X,c-=h.Y),!1);if(null!=i&&(n=i.textOptions.angle,E=45<n&&n<135||225<n&&n<315,0!=n)){if(E){let t=g;g=S,S=t}m=-g/2,c=-S/2}let y=null;if(0!=n){let t=n*Math.PI/180;y=new Matrix(Math.cos(t),Math.sin(t),-Math.sin(t),Math.cos(t),O+G/2,W+z/2)}let U=40,v=U*(r.font.sizeInPoints*this.fontCorrectValue)/1e3,x=(E?(c+=v,S-=2*v):(m+=v,g-=2*v),Color.transparent),A=h.Component.as(IStiTextBrush);if(null!=A){if(x=StiBrush.toColor(A.textBrush),h.service.setNonStrokeColor(x),h.service.storeShadingData2(h.X,h.Y,h.Width,h.Height,A.textBrush),(A.textBrush.is(StiGradientBrush)||A.textBrush.is(StiGlareBrush)||A.textBrush.is(StiLinearGradientBrush))&&h.service.pageStream.writeLine1("/Pattern cs /P{0} scn",1+h.service.shadingCurrent),A.textBrush.is(StiHatchBrush)){let t=A.textBrush.as(StiHatchBrush);h.service.pageStream.writeLine1("/Cs1 cs /PH{0} scn",h.service.getHatchNumber(t)+1)}if(e){let t=h.service.annotsArray[h.service.annotsCurrent];t.FontColor=x}}let T=r.font.sizeInPoints,F=1,C=T*this.fontCorrectValue*h.service.pdfFont.tmASC/1e3*F,V=T*this.fontCorrectValue*h.service.pdfFont.tmDESC/1e3*-1*F,X=T*this.fontCorrectValue*h.service.pdfFont.tmExternal/1e3*F,P=C-V+X,L=P*r.lineSpacing,k=Graphics.getCustomFont(r.font.name,r.font.style),j=T*this.fontCorrectValue/1e3,Y=1e3/k.unitsPerEm,q=g/(j*Y),B=null!=i&&i.textOptions.wordWrap,I=(r.horAlignment==StiTextHorAlignment.Width&&(B=!0),t.text),K=(null==I&&(I=""),e&&(a=h.service.stringReplace(I,"\n","")),__.c.StiExportUtils.splitString(I,!0)),D=[],R=[];for(let e=0;e<K.length;e++){let t=K[e];if(B){let s=[],l=0,i=0;while(l<=t.length){while(l<t.length&&Char.isWhitespace(t,l))l++;while(l<t.length&&!this.isWordWrapSymbol(t,l))l++;l>i&&(s.push(t.substring(i,l)),i=l),l++}let m=[];for(l=0;l<s.length;l++){let t=s[l],e=k.layout(t),i=0;for(let t of e.glyphs)i+=t.advanceWidth;m.push(i)}i=0,l=0;while(l<s.length){let t=0;while(l<s.length&&t+m[l]<q)t+=m[l],l++;if(l==i){let r=s[l].trimStart(),i=!1;for(let e=0;e<r.length;e++){let t=r.charCodeAt(e);if(6016<=t&&t<=6143){i=!0;break}}let n=0,a=T*this.fontCorrectValue/1e3,o=0;for(;o<r.length;o++){let t=h.service.pdfFont.UnicodeMap[r.charCodeAt(o)],e=h.service.pdfFont.Widths[t-32]*a;if(!(n+e<g))break;n+=e}if(i){let e=o;for(;0<e;e--){let t=r.charCodeAt(e);if(6016<=t&&t<=6050)break}0<e&&(o=e)}if(!(o>=r.length)){D.push(r.substring(0,o)),R.push(!1);let t=r.substring(o),e=t,i=k.layout(e);s[l]=t,m[l]=i.advanceWidth;continue}l++}let e="";for(let t=i;t<l;t++)e+=s[t];0<i&&(e=e.trimStart()),D.push(e.trimEnd()),R.push(l<s.length),i=l}}else D.push(t.trimEnd()),R.push(!1)}let Q=(D.length-1)*L+P,_=r.vertAlignment,Z=((_=0!=n&&90!=n&&180!=n&&270!=n?StiVertAlignment.Center:_)==StiVertAlignment.Top&&(c+=S),_==StiVertAlignment.Center&&(c+=S-(S-Q)/2),_==StiVertAlignment.Bottom&&(c+=Q),c+=-C,new Rectangle(m,c,g,S));for(let e=0;e<D.length;e++){let t=r.horAlignment!=StiTextHorAlignment.Width||R[e]?r.horAlignment:StiTextHorAlignment.Left;this.renderTextLine(h,D[e],Z,r.font,k,t,r.rightToLeft,y,x),Z.y-=L}if(e){let t=h.service.annotsArray[h.service.annotsCurrent],e=(t.Multiline=B,t.X=h.X,t.Y=h.Y,t.Width=h.Width,t.Height=h.Height,t.Text=a,t.Component=h.Component,t.Alignment=StiTextHorAlignment.Left,r.horAlignment);null!=i&&null!=i.textOptions&&i.textOptions.rightToLeft&&(e==StiTextHorAlignment.Left?e=StiTextHorAlignment.Right:e==StiTextHorAlignment.Right&&(e=StiTextHorAlignment.Left)),t.Alignment=e}e||(h.service.pageStream.writeLine("Q"),h.service.popColorFromStack())}static renderTextLine(m,t,e,i,r,n,a,o,s){let l=i.sizeInPoints,h=1,c=l*this.fontCorrectValue*m.service.pdfFont.UnderscoreSize/1e3*h,g=l*this.fontCorrectValue*m.service.pdfFont.UnderscorePosition/1e3*h,S=l*this.fontCorrectValue*m.service.pdfFont.StrikeoutSize/1e3*h,p=l*this.fontCorrectValue*m.service.pdfFont.StrikeoutPosition/1e3*h,d=l*this.fontCorrectValue/1e3,u=1e3/r.unitsPerEm,w=[],f=(__.c.StiBidirectionalConvert2.logicalToVisual(t,a,null,w),0==w.length&&w.push(t),0),b=0,E=[];for(let i of w){let e=r.layout(i);for(let t of e.glyphs)f+=t.advanceWidth;E.push(e);for(let t=0;t<i.length;t++)Char.isWhitespace(i,t)&&b++}let y=f*u*d,v=0;if((!a&&n==StiTextHorAlignment.Right||a&&n==StiTextHorAlignment.Left)&&(v=e.width-y),n==StiTextHorAlignment.Center&&(v=(e.width-y)/2),n==StiTextHorAlignment.Width&&0<b){let r=(e.width-y)/b/(u*d);for(let i=0;i<E.length;i++){let e=w[i];for(let t=0;t<e.length;t++)Char.isWhitespace(e,t)&&(E[i].positions[t].xAdvance+=r)}y=e.width}let x=e.left+v,A=e.y,T=(m.service.pageStream.writeLine("BT"),null);if(null!=o){T=o.clone();let t=new Matrix(1,0,0,1,x,A);T.multiplyPrepend(t)}if(m.service.pdfFont.NeedSyntItalic&&i.italic)if(null!=T){let t=new Matrix(1,0,this.italicAngleTanValue,1,0,0);T.multiplyPrepend(t)}else{let t=new Matrix(1,0,this.italicAngleTanValue,1,x,A);T=t}null!=T?m.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} Tm",m.service.convertToString(T.elements[0],7),m.service.convertToString(T.elements[1],7),m.service.convertToString(T.elements[2],7),m.service.convertToString(T.elements[3],7),m.service.convertToString(T.elements[4],6),m.service.convertToString(T.elements[5],6)):m.service.pageStream.writeLine1("{0} {1} Td",m.service.convertToString(x),m.service.convertToString(A)),m.service.pdfFont.NeedSyntBold&&i.bold&&(m.service.pageStream.writeLine1("{0} w 2 Tr",m.service.convertToString(this.boldFontStrokeWidthValue*l*this.fontCorrectValue,this.precision_digits_font)),m.service.setStrokeColor(s));let F=0,C=0,P=0;for(let l of E){let o=0,s=0;while(s<l.glyphs.length){let t=F*u*d,e=0;while(s<l.glyphs.length&&0==l.positions[s].xOffset&&0==l.positions[s].yOffset)F+=l.positions[s].xAdvance,s++;s==o&&(F+=l.positions[s].xAdvance,t+=l.positions[s].xOffset*u*d,e+=l.positions[s].yOffset*u*d,s++);let i=t-C,r=e-P,n=(0==i&&0==r||m.service.pageStream.writeLine1("{0} {1} Td",m.service.convertToString(i),m.service.convertToString(r)),new StringBuilder);n.append("<");for(let i=o;i<s;i++){let t=l.glyphs[i],e=-Math.round(l.positions[i].xAdvance*u-m.service.pdfFont.GlyphWidths[t.id]);n.appendFormat("{0:X4}",t.id),0!=e&&i<s-1&&n.append(">"+m.service.convertToString(e)+"<")}n.append(">");let a=StiArray.create(Number,n.length);for(let t=0;t<n.length;t++)a[t]=n.charCodeAt(t);m.service.pageStream.writeString("["),m.service.pageStream.flush(),m.service.pageStream.write(a,0,a.length),m.service.pageStream.writeLine("] TJ"),o=s,C=t,P=e}}if(m.service.pageStream.writeLine("ET"),m.service.pdfFont.NeedSyntBold&&i.bold&&m.service.pageStream.writeLine("0 Tr"),i.underline){m.service.pageStream.writeLine("q"),m.service.pushColorToStack(),m.service.setStrokeColor(s);let t=.09*l,e=.115*-l;0!=m.service.pdfFont.UnderscoreSize&&(t=c,e=g),t<.1&&(t=.1),m.service.pageStream.writeLine1("{0} w",m.service.convertToString(t)),null!=o&&m.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} Tm",m.service.convertToString(o.elements[0],7),m.service.convertToString(o.elements[1],7),m.service.convertToString(o.elements[2],7),m.service.convertToString(o.elements[3],7),m.service.convertToString(o.elements[4],6),m.service.convertToString(o.elements[5],6)),m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(x),m.service.convertToString(A+e)),m.service.pageStream.writeLine1("{0} {1} l S",m.service.convertToString(x+y),m.service.convertToString(A+e)),m.service.pageStream.writeLine("Q"),m.service.popColorFromStack()}if(i.strikeout){m.service.pageStream.writeLine("q"),m.service.pushColorToStack(),m.service.setStrokeColor(s);let t=.09*l,e=.4*l;0!=m.service.pdfFont.StrikeoutSize&&(t=S,e=p),t<.1&&(t=.1),m.service.pageStream.writeLine1("{0} w",m.service.convertToString(t)),null!=o&&m.service.pageStream.writeLine1("{0} {1} {2} {3} {4} {5} Tm",m.service.convertToString(o.elements[0],7),m.service.convertToString(o.elements[1],7),m.service.convertToString(o.elements[2],7),m.service.convertToString(o.elements[3],7),m.service.convertToString(o.elements[4],6),m.service.convertToString(o.elements[5],6)),m.service.pageStream.writeLine1("{0} {1} m",m.service.convertToString(x),m.service.convertToString(A+e)),m.service.pageStream.writeLine1("{0} {1} l S",m.service.convertToString(x+y),m.service.convertToString(A+e)),m.service.pageStream.writeLine("Q"),m.service.popColorFromStack()}}}opa.hiToTwips=.72,opa.precision_digits_font=3,opa.fontCorrectValue=1,opa.boldFontStrokeWidthValue=.031,opa.italicAngleTanValue=.325,opa.charCode07=String.fromCharCode(7),__.c.StiPdfRenderText=opa}{class Wwa{static get standardFontCharsNames(){if(null==this._standardFontCharsNames){let i=["0020space","0021exclam","0022quotedbl","0023numbersign","0024dollar","0025percent","0026ampersand","0027quotesingle","0028parenleft","0029parenright","002Aasterisk","002Bplus","002Ccomma","002Dhyphen","002Eperiod","002Fslash","0030zero","0031one","0032two","0033three","0034four","0035five","0036six","0037seven","0038eight","0039nine","003Acolon","003Bsemicolon","003Cless","003Dequal","003Egreater","003Fquestion","0040at","0041A","0042B","0043C","0044D","0045E","0046F","0047G","0048H","0049I","004AJ","004BK","004CL","004DM","004EN","004FO","0050P","0051Q","0052R","0053S","0054T","0055U","0056V","0057W","0058X","0059Y","005AZ","005Bbracketleft","005Cbackslash","005Dbracketright","005Easciicircum","005Funderscore","0060grave","0061a","0062b","0063c","0064d","0065e","0066f","0067g","0068h","0069i","006Aj","006Bk","006Cl","006Dm","006En","006Fo","0070p","0071q","0072r","0073s","0074t","0075u","0076v","0077w","0078x","0079y","007Az","007Bbraceleft","007Cbar","007Dbraceright","007Easciitilde","007FcontrolDEL","00A0nbspace","00A1exclamdown","00A2cent","00A3sterling","00A4currency","00A5yen","00A6brokenbar","00A7section","00A8dieresis","00A9copyright","00AAordfeminine","00ABguillemotleft","00AClogicalnot","00ADsofthyphen","00AEregistered","00AFmacron","00B0degree","00B1plusminus","00B2twosuperior","00B3threesuperior","00B4acute","00B5mu","00B6paragraph","00B7periodcentered","00B8cedilla","00B9onesuperior","00BAordmasculine","00BBguillemotright","00BConequarter","00BDonehalf","00BEthreequarters","00BFquestiondown","00C0Agrave","00C1Aacute","00C2Acircumflex","00C3Atilde","00C4Adieresis","00C5Aring","00C6AE","00C7Ccedilla","00C8Egrave","00C9Eacute","00CAEcircumflex","00CBEdieresis","00CCIgrave","00CDIacute","00CEIcircumflex","00CFIdieresis","00D0Eth","00D1Ntilde","00D2Ograve","00D3Oacute","00D4Ocircumflex","00D5Otilde","00D6Odieresis","00D7multiply","00D8Oslash","00D9Ugrave","00DAUacute","00DBUcircumflex","00DCUdieresis","00DDYacute","00DEThorn","00DFgermandbls","00E0agrave","00E1aacute","00E2acircumflex","00E3atilde","00E4adieresis","00E5aring","00E6ae","00E7ccedilla","00E8egrave","00E9eacute","00EAecircumflex","00EBedieresis","00ECigrave","00EDiacute","00EEicircumflex","00EFidieresis","00F0eth","00F1ntilde","00F2ograve","00F3oacute","00F4ocircumflex","00F5otilde","00F6odieresis","00F7divide","00F8oslash","00F9ugrave","00FAuacute","00FBucircumflex","00FCudieresis","00FDyacute","00FEthorn","00FFydieresis","0100Amacron","0101amacron","0102Abreve","0103abreve","0104Aogonek","0105aogonek","0106Cacute","0107cacute","0108Ccircumflex","0109ccircumflex","010ACdotaccent","010Bcdotaccent","010CCcaron","010Dccaron","010EDcaron","010Fdcaron","0110Dcroat","0111dcroat","0112Emacron","0113emacron","0114Ebreve","0115ebreve","0116Edotaccent","0117edotaccent","0118Eogonek","0119eogonek","011AEcaron","011Becaron","011CGcircumflex","011Dgcircumflex","011EGbreve","011Fgbreve","0120Gdotaccent","0121gdotaccent","0122Gcommaaccent","0123gcommaaccent","0124Hcircumflex","0125hcircumflex","0126Hbar","0127hbar","0128Itilde","0129itilde","012AImacron","012Bimacron","012CIbreve","012Dibreve","012EIogonek","012Fiogonek","0130Idotaccent","0131dotlessi","0132IJ","0133ij","0134Jcircumflex","0135jcircumflex","0136Kcommaaccent","0137kcommaaccent","0138kgreenlandic","0139Lacute","013Alacute","013BLcommaaccent","013Clcommaaccent","013DLcaron","013Elcaron","013FLdot","0140ldot","0141Lslash","0142lslash","0143Nacute","0144nacute","0145Ncommaaccent","0146ncommaaccent","0147Ncaron","0148ncaron","0149napostrophe","014AEng","014Beng","014COmacron","014Domacron","014EObreve","014Fobreve","0150Ohungarumlaut","0151ohungarumlaut","0152OE","0153oe","0154Racute","0155racute","0156Rcommaaccent","0157rcommaaccent","0158Rcaron","0159rcaron","015ASacute","015Bsacute","015CScircumflex","015Dscircumflex","015EScedilla","015Fscedilla","0160Scaron","0161scaron","0162Tcommaaccent","0163tcommaaccent","0164Tcaron","0165tcaron","0166Tbar","0167tbar","0168Utilde","0169utilde","016AUmacron","016Bumacron","016CUbreve","016Dubreve","016EUring","016Furing","0170Uhungarumlaut","0171uhungarumlaut","0172Uogonek","0173uogonek","0174Wcircumflex","0175wcircumflex","0176Ycircumflex","0177ycircumflex","0178Ydieresis","0179Zacute","017Azacute","017BZdotaccent","017Czdotaccent","017DZcaron","017Ezcaron","017Flongs","0180bstroke","0181Bhook","0182Btopbar","0183btopbar","0184Tonesix","0185tonesix","0186Oopen","0187Chook","0188chook","0189Dafrican","018ADhook","018BDtopbar","018Cdtopbar","018Ddeltaturned","018EEreversed","018FSchwa","0190Eopen","0191Fhook","0192florin","0193Ghook","0194Gammaafrican","0195hv","0196Iotaafrican","0197Istroke","0198Khook","0199khook","019Albar","019Blambdastroke","019CMturned","019DNhookleft","019Enlegrightlong","019FOcenteredtilde","01A0Ohorn","01A1ohorn","01A2Oi","01A3oi","01A4Phook","01A5phook","01A6yr","01A7Tonetwo","01A8tonetwo","01A9Esh","01AAeshreversedloop","01ABtpalatalhook","01ACThook","01ADthook","01AETretroflexhook","01AFUhorn","01B0uhorn","01B1Upsilonafrican","01B2Vhook","01B3Yhook","01B4yhook","01B5Zstroke","01B6zstroke","01B7Ezh","01B8Ezhreversed","01B9ezhreversed","01BAezhtail","01BBtwostroke","01BCTonefive","01BDtonefive","01BEglottalinvertedstroke","01BFwynn","01C0clickdental","01C1clicklateral","01C2clickalveolar","01C3clickretroflex","01C4DZcaron","01C5Dzcaron","01C6dzcaron","01C7LJ","01C8Lj","01C9lj","01CANJ","01CBNj","01CCnj","01CDAcaron","01CEacaron","01CFIcaron","01D0icaron","01D1Ocaron","01D2ocaron","01D3Ucaron","01D4ucaron","01D5Udieresismacron","01D6udieresismacron","01D7Udieresisacute","01D8udieresisacute","01D9Udieresiscaron","01DAudieresiscaron","01DBUdieresisgrave","01DCudieresisgrave","01DDeturned","01DEAdieresismacron","01DFadieresismacron","01E0Adotmacron","01E1adotmacron","01E2AEmacron","01E3aemacron","01E4Gstroke","01E5gstroke","01E6Gcaron","01E7gcaron","01E8Kcaron","01E9kcaron","01EAOogonek","01EBoogonek","01ECOogonekmacron","01EDoogonekmacron","01EEEzhcaron","01EFezhcaron","01F0jcaron","01F1DZ","01F2Dz","01F3dz","01F4Gacute","01F5gacute","01FAAringacute","01FBaringacute","01FCAEacute","01FDaeacute","01FEOslashacute","01FFoslashacute","0200Adblgrave","0201adblgrave","0202Ainvertedbreve","0203ainvertedbreve","0204Edblgrave","0205edblgrave","0206Einvertedbreve","0207einvertedbreve","0208Idblgrave","0209idblgrave","020AIinvertedbreve","020Biinvertedbreve","020COdblgrave","020Dodblgrave","020EOinvertedbreve","020Foinvertedbreve","0210Rdblgrave","0211rdblgrave","0212Rinvertedbreve","0213rinvertedbreve","0214Udblgrave","0215udblgrave","0216Uinvertedbreve","0217uinvertedbreve","0218Scommaaccent","0219scommaaccent","0250aturned","0251ascript","0252ascriptturned","0253bhook","0254oopen","0255ccurl","0256dtail","0257dhook","0258ereversed","0259schwa","025Aschwahook","025Beopen","025Ceopenreversed","025Deopenreversedhook","025Eeopenreversedclosed","025Fjdotlessstroke","0260ghook","0261gscript","0263gammalatinsmall","0264ramshorn","0265hturned","0266hhook","0267henghook","0268istroke","0269iotalatin","026Blmiddletilde","026Clbelt","026Dlhookretroflex","026Elezh","026Fmturned","0270mlonglegturned","0271mhook","0272nhookleft","0273nhookretroflex","0275obarred","0277omegalatinclosed","0278philatin","0279rturned","027Arlonglegturned","027Brhookturned","027Crlongleg","027Drhook","027Erfishhook","027Frfishhookreversed","0281Rsmallinverted","0282shook","0283esh","0284dotlessjstrokehook","0285eshsquatreversed","0286eshcurl","0287tturned","0288tretroflexhook","0289ubar","028Aupsilonlatin","028Bvhook","028Cvturned","028Dwturned","028Eyturned","0290zretroflexhook","0291zcurl","0292ezh","0293ezhcurl","0294glottalstop","0295glottalstopreversed","0296glottalstopinverted","0297cstretched","0298bilabialclick","029Aeopenclosed","029BGsmallhook","029Djcrossedtail","029Ekturned","02A0qhook","02A1glottalstopstroke","02A2glottalstopstrokereversed","02A3dzaltone","02A4dezh","02A5dzcurl","02A6ts","02A7tesh","02A8tccurl","02B0hsuperior","02B1hhooksuperior","02B2jsuperior","02B4rturnedsuperior","02B5rhookturnedsuperior","02B6Rsmallinvertedsuperior","02B7wsuperior","02B8ysuperior","02B9primemod","02BAdblprimemod","02BBcommaturnedmod","02BCafii57929","02BDafii64937","02BEringhalfright","02BFringhalfleft","02C0glottalstopmod","02C1glottalstopreversedmod","02C2arrowheadleftmod","02C3arrowheadrightmod","02C4arrowheadupmod","02C5arrowheaddownmod","02C6circumflex","02C7caron","02C8verticallinemod","02C9firsttonechinese","02CAsecondtonechinese","02CBfourthtonechinese","02CCverticallinelowmod","02CDmacronlowmod","02CEgravelowmod","02CFacutelowmod","02D0colontriangularmod","02D1colontriangularhalfmod","02D2ringhalfrightcentered","02D3ringhalfleftcentered","02D4uptackmod","02D5downtackmod","02D6plusmod","02D7minusmod","02D8breve","02D9dotaccent","02DAring","02DBogonek","02DCtilde","02DDhungarumlaut","02DErhotichookmod","02E0gammasuperior","02E3xsuperior","02E4glottalstopreversedsuperior","02E5tonebarextrahighmod","02E6tonebarhighmod","02E7tonebarmidmod","02E8tonebarlowmod","02E9tonebarextralowmod","0300gravecomb","0301acutecomb","0302circumflexcmb","0303tildecomb","0304macroncmb","0305overlinecmb","0306brevecmb","0307dotaccentcmb","0308dieresiscmb","0309hookabovecomb","030Aringcmb","030Bhungarumlautcmb","030Ccaroncmb","030Dverticallineabovecmb","030Edblverticallineabovecmb","030Fdblgravecmb","0310candrabinducmb","0311breveinvertedcmb","0312commaturnedabovecmb","0313commaabovecmb","0314commareversedabovecmb","0315commaaboverightcmb","0316gravebelowcmb","0317acutebelowcmb","0318lefttackbelowcmb","0319righttackbelowcmb","031Aleftangleabovecmb","031Bhorncmb","031Cringhalfleftbelowcmb","031Duptackbelowcmb","031Edowntackbelowcmb","031Fplusbelowcmb","0320minusbelowcmb","0321hookpalatalizedbelowcmb","0322hookretroflexbelowcmb","0323dotbelowcomb","0324dieresisbelowcmb","0325ringbelowcmb","0327cedillacmb","0328ogonekcmb","0329verticallinebelowcmb","032Abridgebelowcmb","032Bdblarchinvertedbelowcmb","032Ccaronbelowcmb","032Dcircumflexbelowcmb","032Ebrevebelowcmb","032Fbreveinvertedbelowcmb","0330tildebelowcmb","0331macronbelowcmb","0332lowlinecmb","0333dbllowlinecmb","0334tildeoverlaycmb","0335strokeshortoverlaycmb","0336strokelongoverlaycmb","0337solidusshortoverlaycmb","0338soliduslongoverlaycmb","0339ringhalfrightbelowcmb","033Abridgeinvertedbelowcmb","033Bsquarebelowcmb","033Cseagullbelowcmb","033Dxabovecmb","033Etildeverticalcmb","033Fdbloverlinecmb","0340gravetonecmb","0341acutetonecmb","0342perispomenigreekcmb","0343koroniscmb","0344dialytikatonoscmb","0345ypogegrammenigreekcmb","0360tildedoublecmb","0361breveinverteddoublecmb","0374numeralsigngreek","0375numeralsignlowergreek","037Aypogegrammeni","037Equestiongreek","0384tonos","0385dieresistonos","0386Alphatonos","0387anoteleia","0388Epsilontonos","0389Etatonos","038AIotatonos","038COmicrontonos","038EUpsilontonos","038FOmegatonos","0390iotadieresistonos","0391Alpha","0392Beta","0393Gamma","0394Deltagreek","0395Epsilon","0396Zeta","0397Eta","0398Theta","0399Iota","039AKappa","039BLambda","039CMu","039DNu","039EXi","039FOmicron","03A0Pi","03A1Rho","03A3Sigma","03A4Tau","03A5Upsilon","03A6Phi","03A7Chi","03A8Psi","03A9Omegagreek","03AAIotadieresis","03ABUpsilondieresis","03ACalphatonos","03ADepsilontonos","03AEetatonos","03AFiotatonos","03B0upsilondieresistonos","03B1alpha","03B2beta","03B3gamma","03B4delta","03B5epsilon","03B6zeta","03B7eta","03B8theta","03B9iota","03BAkappa","03BBlambda","03BCmu","03BDnu","03BExi","03BFomicron","03C0pi","03C1rho","03C2sigma1","03C3sigma","03C4tau","03C5upsilon","03C6phi","03C7chi","03C8psi","03C9omega","03CAiotadieresis","03CBupsilondieresis","03CComicrontonos","03CDupsilontonos","03CEomegatonos","03D0betasymbolgreek","03D1theta1","03D2Upsilon1","03D3Upsilonacutehooksymbolgreek","03D4Upsilondieresishooksymbolgreek","03D5phi1","03D6omega1","03DAStigmagreek","03DCDigammagreek","03DEKoppagreek","03E0Sampigreek","03E2Sheicoptic","03E3sheicoptic","03E4Feicoptic","03E5feicoptic","03E6Kheicoptic","03E7kheicoptic","03E8Horicoptic","03E9horicoptic","03EAGangiacoptic","03EBgangiacoptic","03ECShimacoptic","03EDshimacoptic","03EEDeicoptic","03EFdeicoptic","03F0kappasymbolgreek","03F1rhosymbolgreek","03F2sigmalunatesymbolgreek","03F3yotgreek","0401afii10023","0402afii10051","0403afii10052","0404afii10053","0405afii10054","0406afii10055","0407afii10056","0408afii10057","0409afii10058","040Aafii10059","040Bafii10060","040Cafii10061","040Eafii10062","040Fafii10145","0410afii10017","0411afii10018","0412afii10019","0413afii10020","0414afii10021","0415afii10022","0416afii10024","0417afii10025","0418afii10026","0419afii10027","041Aafii10028","041Bafii10029","041Cafii10030","041Dafii10031","041Eafii10032","041Fafii10033","0420afii10034","0421afii10035","0422afii10036","0423afii10037","0424afii10038","0425afii10039","0426afii10040","0427afii10041","0428afii10042","0429afii10043","042Aafii10044","042Bafii10045","042Cafii10046","042Dafii10047","042Eafii10048","042Fafii10049","0430afii10065","0431afii10066","0432afii10067","0433afii10068","0434afii10069","0435afii10070","0436afii10072","0437afii10073","0438afii10074","0439afii10075","043Aafii10076","043Bafii10077","043Cafii10078","043Dafii10079","043Eafii10080","043Fafii10081","0440afii10082","0441afii10083","0442afii10084","0443afii10085","0444afii10086","0445afii10087","0446afii10088","0447afii10089","0448afii10090","0449afii10091","044Aafii10092","044Bafii10093","044Cafii10094","044Dafii10095","044Eafii10096","044Fafii10097","0451afii10071","0452afii10099","0453afii10100","0454afii10101","0455afii10102","0456afii10103","0457afii10104","0458afii10105","0459afii10106","045Aafii10107","045Bafii10108","045Cafii10109","045Eafii10110","045Fafii10193","0460Omegacyrillic","0461omegacyrillic","0462afii10146","0463afii10194","0464Eiotifiedcyrillic","0465eiotifiedcyrillic","0466Yuslittlecyrillic","0467yuslittlecyrillic","0468Yuslittleiotifiedcyrillic","0469yuslittleiotifiedcyrillic","046AYusbigcyrillic","046Byusbigcyrillic","046CYusbigiotifiedcyrillic","046Dyusbigiotifiedcyrillic","046EKsicyrillic","046Fksicyrillic","0470Psicyrillic","0471psicyrillic","0472afii10147","0473afii10195","0474afii10148","0475afii10196","0476Izhitsadblgravecyrillic","0477izhitsadblgravecyrillic","0478Ukcyrillic","0479ukcyrillic","047AOmegaroundcyrillic","047Bomegaroundcyrillic","047COmegatitlocyrillic","047Domegatitlocyrillic","047EOtcyrillic","047Fotcyrillic","0480Koppacyrillic","0481koppacyrillic","0482thousandcyrillic","0483titlocyrilliccmb","0484palatalizationcyrilliccmb","0485dasiapneumatacyrilliccmb","0486psilipneumatacyrilliccmb","0490afii10050","0491afii10098","0492Ghestrokecyrillic","0493ghestrokecyrillic","0494Ghemiddlehookcyrillic","0495ghemiddlehookcyrillic","0496Zhedescendercyrillic","0497zhedescendercyrillic","0498Zedescendercyrillic","0499zedescendercyrillic","049AKadescendercyrillic","049Bkadescendercyrillic","049CKaverticalstrokecyrillic","049Dkaverticalstrokecyrillic","049EKastrokecyrillic","049Fkastrokecyrillic","04A0Kabashkircyrillic","04A1kabashkircyrillic","04A2Endescendercyrillic","04A3endescendercyrillic","04A4Enghecyrillic","04A5enghecyrillic","04A6Pemiddlehookcyrillic","04A7pemiddlehookcyrillic","04A8Haabkhasiancyrillic","04A9haabkhasiancyrillic","04AAEsdescendercyrillic","04ABesdescendercyrillic","04ACTedescendercyrillic","04ADtedescendercyrillic","04AEUstraightcyrillic","04AFustraightcyrillic","04B0Ustraightstrokecyrillic","04B1ustraightstrokecyrillic","04B2Hadescendercyrillic","04B3hadescendercyrillic","04B4Tetsecyrillic","04B5tetsecyrillic","04B6Chedescendercyrillic","04B7chedescendercyrillic","04B8Cheverticalstrokecyrillic","04B9cheverticalstrokecyrillic","04BAShhacyrillic","04BBshhacyrillic","04BCCheabkhasiancyrillic","04BDcheabkhasiancyrillic","04BEChedescenderabkhasiancyrillic","04BFchedescenderabkhasiancyrillic","04C0palochkacyrillic","04C1Zhebrevecyrillic","04C2zhebrevecyrillic","04C3Kahookcyrillic","04C4kahookcyrillic","04C7Enhookcyrillic","04C8enhookcyrillic","04CBChekhakassiancyrillic","04CCchekhakassiancyrillic","04D0Abrevecyrillic","04D1abrevecyrillic","04D2Adieresiscyrillic","04D3adieresiscyrillic","04D4Aiecyrillic","04D5aiecyrillic","04D6Iebrevecyrillic","04D7iebrevecyrillic","04D8Schwacyrillic","04D9afii10846","04DASchwadieresiscyrillic","04DBschwadieresiscyrillic","04DCZhedieresiscyrillic","04DDzhedieresiscyrillic","04DEZedieresiscyrillic","04DFzedieresiscyrillic","04E0Dzeabkhasiancyrillic","04E1dzeabkhasiancyrillic","04E2Imacroncyrillic","04E3imacroncyrillic","04E4Idieresiscyrillic","04E5idieresiscyrillic","04E6Odieresiscyrillic","04E7odieresiscyrillic","04E8Obarredcyrillic","04E9obarredcyrillic","04EAObarreddieresiscyrillic","04EBobarreddieresiscyrillic","04EEUmacroncyrillic","04EFumacroncyrillic","04F0Udieresiscyrillic","04F1udieresiscyrillic","04F2Uhungarumlautcyrillic","04F3uhungarumlautcyrillic","04F4Chedieresiscyrillic","04F5chedieresiscyrillic","04F8Yerudieresiscyrillic","04F9yerudieresiscyrillic","0531Aybarmenian","0532Benarmenian","0533Gimarmenian","0534Daarmenian","0535Echarmenian","0536Zaarmenian","0537Eharmenian","0538Etarmenian","0539Toarmenian","053AZhearmenian","053BIniarmenian","053CLiwnarmenian","053DXeharmenian","053ECaarmenian","053FKenarmenian","0540Hoarmenian","0541Jaarmenian","0542Ghadarmenian","0543Cheharmenian","0544Menarmenian","0545Yiarmenian","0546Nowarmenian","0547Shaarmenian","0548Voarmenian","0549Chaarmenian","054APeharmenian","054BJheharmenian","054CRaarmenian","054DSeharmenian","054EVewarmenian","054FTiwnarmenian","0550Reharmenian","0551Coarmenian","0552Yiwnarmenian","0553Piwrarmenian","0554Keharmenian","0555Oharmenian","0556Feharmenian","0559ringhalfleftarmenian","055Aapostrophearmenian","055Bemphasismarkarmenian","055Cexclamarmenian","055Dcommaarmenian","055Equestionarmenian","055Fabbreviationmarkarmenian","0561aybarmenian","0562benarmenian","0563gimarmenian","0564daarmenian","0565echarmenian","0566zaarmenian","0567eharmenian","0568etarmenian","0569toarmenian","056Azhearmenian","056Biniarmenian","056Cliwnarmenian","056Dxeharmenian","056Ecaarmenian","056Fkenarmenian","0570hoarmenian","0571jaarmenian","0572ghadarmenian","0573cheharmenian","0574menarmenian","0575yiarmenian","0576nowarmenian","0577shaarmenian","0578voarmenian","0579chaarmenian","057Apeharmenian","057Bjheharmenian","057Craarmenian","057Dseharmenian","057Evewarmenian","057Ftiwnarmenian","0580reharmenian","0581coarmenian","0582yiwnarmenian","0583piwrarmenian","0584keharmenian","0585oharmenian","0586feharmenian","0587echyiwnarmenian","0589periodarmenian","0591etnahtahebrew","0592segoltahebrew","0593shalshelethebrew","0594zaqefqatanhebrew","0595zaqefgadolhebrew","0596tipehahebrew","0597reviahebrew","0598zarqahebrew","0599pashtahebrew","059Ayetivhebrew","059Btevirhebrew","059Cgereshaccenthebrew","059Dgereshmuqdamhebrew","059Egershayimaccenthebrew","059Fqarneyparahebrew","05A0telishagedolahebrew","05A1pazerhebrew","05A3munahhebrew","05A4mahapakhhebrew","05A5merkhahebrew","05A6merkhakefulahebrew","05A7dargahebrew","05A8qadmahebrew","05A9telishaqetanahebrew","05AAyerahbenyomohebrew","05ABolehebrew","05ACiluyhebrew","05ADdehihebrew","05AEzinorhebrew","05AFmasoracirclehebrew","05B0afii57799","05B1afii57801","05B2afii57800","05B3afii57802","05B4afii57793","05B5afii57794","05B6afii57795","05B7afii57798","05B8afii57797","05B9afii57806","05BBafii57796","05BCafii57807","05BDafii57839","05BEafii57645","05BFafii57841","05C0afii57842","05C1afii57804","05C2afii57803","05C3afii57658","05C4upperdothebrew","05D0afii57664","05D1afii57665","05D2afii57666","05D3afii57667","05D4afii57668","05D5afii57669","05D6afii57670","05D7afii57671","05D8afii57672","05D9afii57673","05DAafii57674","05DBafii57675","05DCafii57676","05DDafii57677","05DEafii57678","05DFafii57679","05E0afii57680","05E1afii57681","05E2afii57682","05E3afii57683","05E4afii57684","05E5afii57685","05E6afii57686","05E7afii57687","05E8afii57688","05E9afii57689","05EAafii57690","05F0afii57716","05F1afii57717","05F2afii57718","05F3gereshhebrew","05F4gershayimhebrew","060Cafii57388","061Bafii57403","061Fafii57407","0621afii57409","0622afii57410","0623afii57411","0624afii57412","0625afii57413","0626afii57414","0627afii57415","0628afii57416","0629afii57417","062Aafii57418","062Bafii57419","062Cafii57420","062Dafii57421","062Eafii57422","062Fafii57423","0630afii57424","0631afii57425","0632afii57426","0633afii57427","0634afii57428","0635afii57429","0636afii57430","0637afii57431","0638afii57432","0639afii57433","063Aafii57434","0640afii57440","0641afii57441","0642afii57442","0643afii57443","0644afii57444","0645afii57445","0646afii57446","0647afii57470","0648afii57448","0649afii57449","064Aafii57450","064Bafii57451","064Cafii57452","064Dafii57453","064Eafii57454","064Fafii57455","0650afii57456","0651afii57457","0652afii57458","0660afii57392","0661afii57393","0662afii57394","0663afii57395","0664afii57396","0665afii57397","0666afii57398","0667afii57399","0668afii57400","0669afii57401","066Aafii57381","066Bdecimalseparatorarabic","066Cthousandsseparatorarabic","066Dafii63167","0679afii57511","067Eafii57506","0686afii57507","0688afii57512","0691afii57513","0698afii57508","06A4afii57505","06AFafii57509","06BAafii57514","06C1hehaltonearabic","06D1yehthreedotsbelowarabic","06D2afii57519","06D5afii57534","06F0zeropersian","06F1onepersian","06F2twopersian","06F3threepersian","06F4fourpersian","06F5fivepersian","06F6sixpersian","06F7sevenpersian","06F8eightpersian","06F9ninepersian","0901candrabindudeva","0902anusvaradeva","0903visargadeva","0905adeva","0906aadeva","0907ideva","0908iideva","0909udeva","090Auudeva","090Brvocalicdeva","090Clvocalicdeva","090Decandradeva","090Eeshortdeva","090Fedeva","0910aideva","0911ocandradeva","0912oshortdeva","0913odeva","0914audeva","0915kadeva","0916khadeva","0917gadeva","0918ghadeva","0919ngadeva","091Acadeva","091Bchadeva","091Cjadeva","091Djhadeva","091Enyadeva","091Fttadeva","0920tthadeva","0921ddadeva","0922ddhadeva","0923nnadeva","0924tadeva","0925thadeva","0926dadeva","0927dhadeva","0928nadeva","0929nnnadeva","092Apadeva","092Bphadeva","092Cbadeva","092Dbhadeva","092Emadeva","092Fyadeva","0930radeva","0931rradeva","0932ladeva","0933lladeva","0934llladeva","0935vadeva","0936shadeva","0937ssadeva","0938sadeva","0939hadeva","093Cnuktadeva","093Davagrahadeva","093Eaavowelsigndeva","093Fivowelsigndeva","0940iivowelsigndeva","0941uvowelsigndeva","0942uuvowelsigndeva","0943rvocalicvowelsigndeva","0944rrvocalicvowelsigndeva","0945ecandravowelsigndeva","0946eshortvowelsigndeva","0947evowelsigndeva","0948aivowelsigndeva","0949ocandravowelsigndeva","094Aoshortvowelsigndeva","094Bovowelsigndeva","094Cauvowelsigndeva","094Dviramadeva","0950omdeva","0951udattadeva","0952anudattadeva","0953gravedeva","0954acutedeva","0958qadeva","0959khhadeva","095Aghhadeva","095Bzadeva","095Cdddhadeva","095Drhadeva","095Efadeva","095Fyyadeva","0960rrvocalicdeva","0961llvocalicdeva","0962lvocalicvowelsigndeva","0963llvocalicvowelsigndeva","0964danda","0965dbldanda","0966zerodeva","0967onedeva","0968twodeva","0969threedeva","096Afourdeva","096Bfivedeva","096Csixdeva","096Dsevendeva","096Eeightdeva","096Fninedeva","0970abbreviationsigndeva","0981candrabindubengali","0982anusvarabengali","0983visargabengali","0985abengali","0986aabengali","0987ibengali","0988iibengali","0989ubengali","098Auubengali","098Brvocalicbengali","098Clvocalicbengali","098Febengali","0990aibengali","0993obengali","0994aubengali","0995kabengali","0996khabengali","0997gabengali","0998ghabengali","0999ngabengali","099Acabengali","099Bchabengali","099Cjabengali","099Djhabengali","099Enyabengali","099Fttabengali","09A0tthabengali","09A1ddabengali","09A2ddhabengali","09A3nnabengali","09A4tabengali","09A5thabengali","09A6dabengali","09A7dhabengali","09A8nabengali","09AApabengali","09ABphabengali","09ACbabengali","09ADbhabengali","09AEmabengali","09AFyabengali","09B0rabengali","09B2labengali","09B6shabengali","09B7ssabengali","09B8sabengali","09B9habengali","09BCnuktabengali","09BEaavowelsignbengali","09BFivowelsignbengali","09C0iivowelsignbengali","09C1uvowelsignbengali","09C2uuvowelsignbengali","09C3rvocalicvowelsignbengali","09C4rrvocalicvowelsignbengali","09C7evowelsignbengali","09C8aivowelsignbengali","09CBovowelsignbengali","09CCauvowelsignbengali","09CDviramabengali","09D7aulengthmarkbengali","09DCrrabengali","09DDrhabengali","09DFyyabengali","09E0rrvocalicbengali","09E1llvocalicbengali","09E2lvocalicvowelsignbengali","09E3llvocalicvowelsignbengali","09E6zerobengali","09E7onebengali","09E8twobengali","09E9threebengali","09EAfourbengali","09EBfivebengali","09ECsixbengali","09EDsevenbengali","09EEeightbengali","09EFninebengali","09F0ramiddlediagonalbengali","09F1ralowerdiagonalbengali","09F2rupeemarkbengali","09F3rupeesignbengali","09F4onenumeratorbengali","09F5twonumeratorbengali","09F6threenumeratorbengali","09F7fournumeratorbengali","09F8denominatorminusonenumeratorbengali","09F9sixteencurrencydenominatorbengali","09FAissharbengali","0A02bindigurmukhi","0A05agurmukhi","0A06aagurmukhi","0A07igurmukhi","0A08iigurmukhi","0A09ugurmukhi","0A0Auugurmukhi","0A0Feegurmukhi","0A10aigurmukhi","0A13oogurmukhi","0A14augurmukhi","0A15kagurmukhi","0A16khagurmukhi","0A17gagurmukhi","0A18ghagurmukhi","0A19ngagurmukhi","0A1Acagurmukhi","0A1Bchagurmukhi","0A1Cjagurmukhi","0A1Djhagurmukhi","0A1Enyagurmukhi","0A1Fttagurmukhi","0A20tthagurmukhi","0A21ddagurmukhi","0A22ddhagurmukhi","0A23nnagurmukhi","0A24tagurmukhi","0A25thagurmukhi","0A26dagurmukhi","0A27dhagurmukhi","0A28nagurmukhi","0A2Apagurmukhi","0A2Bphagurmukhi","0A2Cbagurmukhi","0A2Dbhagurmukhi","0A2Emagurmukhi","0A2Fyagurmukhi","0A30ragurmukhi","0A32lagurmukhi","0A35vagurmukhi","0A36shagurmukhi","0A38sagurmukhi","0A39hagurmukhi","0A3Cnuktagurmukhi","0A3Eaamatragurmukhi","0A3Fimatragurmukhi","0A40iimatragurmukhi","0A41umatragurmukhi","0A42uumatragurmukhi","0A47eematragurmukhi","0A48aimatragurmukhi","0A4Boomatragurmukhi","0A4Caumatragurmukhi","0A4Dhalantgurmukhi","0A59khhagurmukhi","0A5Aghhagurmukhi","0A5Bzagurmukhi","0A5Crragurmukhi","0A5Efagurmukhi","0A66zerogurmukhi","0A67onegurmukhi","0A68twogurmukhi","0A69threegurmukhi","0A6Afourgurmukhi","0A6Bfivegurmukhi","0A6Csixgurmukhi","0A6Dsevengurmukhi","0A6Eeightgurmukhi","0A6Fninegurmukhi","0A70tippigurmukhi","0A71addakgurmukhi","0A72irigurmukhi","0A73uragurmukhi","0A74ekonkargurmukhi","0A81candrabindugujarati","0A82anusvaragujarati","0A83visargagujarati","0A85agujarati","0A86aagujarati","0A87igujarati","0A88iigujarati","0A89ugujarati","0A8Auugujarati","0A8Brvocalicgujarati","0A8Decandragujarati","0A8Fegujarati","0A90aigujarati","0A91ocandragujarati","0A93ogujarati","0A94augujarati","0A95kagujarati","0A96khagujarati","0A97gagujarati","0A98ghagujarati","0A99ngagujarati","0A9Acagujarati","0A9Bchagujarati","0A9Cjagujarati","0A9Djhagujarati","0A9Enyagujarati","0A9Fttagujarati","0AA0tthagujarati","0AA1ddagujarati","0AA2ddhagujarati","0AA3nnagujarati","0AA4tagujarati","0AA5thagujarati","0AA6dagujarati","0AA7dhagujarati","0AA8nagujarati","0AAApagujarati","0AABphagujarati","0AACbagujarati","0AADbhagujarati","0AAEmagujarati","0AAFyagujarati","0AB0ragujarati","0AB2lagujarati","0AB3llagujarati","0AB5vagujarati","0AB6shagujarati","0AB7ssagujarati","0AB8sagujarati","0AB9hagujarati","0ABCnuktagujarati","0ABEaavowelsigngujarati","0ABFivowelsigngujarati","0AC0iivowelsigngujarati","0AC1uvowelsigngujarati","0AC2uuvowelsigngujarati","0AC3rvocalicvowelsigngujarati","0AC4rrvocalicvowelsigngujarati","0AC5ecandravowelsigngujarati","0AC7evowelsigngujarati","0AC8aivowelsigngujarati","0AC9ocandravowelsigngujarati","0ACBovowelsigngujarati","0ACCauvowelsigngujarati","0ACDviramagujarati","0AD0omgujarati","0AE0rrvocalicgujarati","0AE6zerogujarati","0AE7onegujarati","0AE8twogujarati","0AE9threegujarati","0AEAfourgujarati","0AEBfivegujarati","0AECsixgujarati","0AEDsevengujarati","0AEEeightgujarati","0AEFninegujarati","0E01kokaithai","0E02khokhaithai","0E03khokhuatthai","0E04khokhwaithai","0E05khokhonthai","0E06khorakhangthai","0E07ngonguthai","0E08chochanthai","0E09chochingthai","0E0Achochangthai","0E0Bsosothai","0E0Cchochoethai","0E0Dyoyingthai","0E0Edochadathai","0E0Ftopatakthai","0E10thothanthai","0E11thonangmonthothai","0E12thophuthaothai","0E13nonenthai","0E14dodekthai","0E15totaothai","0E16thothungthai","0E17thothahanthai","0E18thothongthai","0E19nonuthai","0E1Abobaimaithai","0E1Bpoplathai","0E1Cphophungthai","0E1Dfofathai","0E1Ephophanthai","0E1Ffofanthai","0E20phosamphaothai","0E21momathai","0E22yoyakthai","0E23roruathai","0E24ruthai","0E25lolingthai","0E26luthai","0E27wowaenthai","0E28sosalathai","0E29sorusithai","0E2Asosuathai","0E2Bhohipthai","0E2Clochulathai","0E2Doangthai","0E2Ehonokhukthai","0E2Fpaiyannoithai","0E30saraathai","0E31maihanakatthai","0E32saraaathai","0E33saraamthai","0E34saraithai","0E35saraiithai","0E36sarauethai","0E37saraueethai","0E38sarauthai","0E39sarauuthai","0E3Aphinthuthai","0E3Fbahtthai","0E40saraethai","0E41saraaethai","0E42saraothai","0E43saraaimaimuanthai","0E44saraaimaimalaithai","0E45lakkhangyaothai","0E46maiyamokthai","0E47maitaikhuthai","0E48maiekthai","0E49maithothai","0E4Amaitrithai","0E4Bmaichattawathai","0E4Cthanthakhatthai","0E4Dnikhahitthai","0E4Eyamakkanthai","0E4Ffongmanthai","0E50zerothai","0E51onethai","0E52twothai","0E53threethai","0E54fourthai","0E55fivethai","0E56sixthai","0E57seventhai","0E58eightthai","0E59ninethai","0E5Aangkhankhuthai","0E5Bkhomutthai","1E00Aringbelow","1E01aringbelow","1E02Bdotaccent","1E03bdotaccent","1E04Bdotbelow","1E05bdotbelow","1E06Blinebelow","1E07blinebelow","1E08Ccedillaacute","1E09ccedillaacute","1E0ADdotaccent","1E0Bddotaccent","1E0CDdotbelow","1E0Dddotbelow","1E0EDlinebelow","1E0Fdlinebelow","1E10Dcedilla","1E11dcedilla","1E12Dcircumflexbelow","1E13dcircumflexbelow","1E14Emacrongrave","1E15emacrongrave","1E16Emacronacute","1E17emacronacute","1E18Ecircumflexbelow","1E19ecircumflexbelow","1E1AEtildebelow","1E1Betildebelow","1E1CEcedillabreve","1E1Decedillabreve","1E1EFdotaccent","1E1Ffdotaccent","1E20Gmacron","1E21gmacron","1E22Hdotaccent","1E23hdotaccent","1E24Hdotbelow","1E25hdotbelow","1E26Hdieresis","1E27hdieresis","1E28Hcedilla","1E29hcedilla","1E2AHbrevebelow","1E2Bhbrevebelow","1E2CItildebelow","1E2Ditildebelow","1E2EIdieresisacute","1E2Fidieresisacute","1E30Kacute","1E31kacute","1E32Kdotbelow","1E33kdotbelow","1E34Klinebelow","1E35klinebelow","1E36Ldotbelow","1E37ldotbelow","1E38Ldotbelowmacron","1E39ldotbelowmacron","1E3ALlinebelow","1E3Bllinebelow","1E3CLcircumflexbelow","1E3Dlcircumflexbelow","1E3EMacute","1E3Fmacute","1E40Mdotaccent","1E41mdotaccent","1E42Mdotbelow","1E43mdotbelow","1E44Ndotaccent","1E45ndotaccent","1E46Ndotbelow","1E47ndotbelow","1E48Nlinebelow","1E49nlinebelow","1E4ANcircumflexbelow","1E4Bncircumflexbelow","1E4COtildeacute","1E4Dotildeacute","1E4EOtildedieresis","1E4Fotildedieresis","1E50Omacrongrave","1E51omacrongrave","1E52Omacronacute","1E53omacronacute","1E54Pacute","1E55pacute","1E56Pdotaccent","1E57pdotaccent","1E58Rdotaccent","1E59rdotaccent","1E5ARdotbelow","1E5Brdotbelow","1E5CRdotbelowmacron","1E5Drdotbelowmacron","1E5ERlinebelow","1E5Frlinebelow","1E60Sdotaccent","1E61sdotaccent","1E62Sdotbelow","1E63sdotbelow","1E64Sacutedotaccent","1E65sacutedotaccent","1E66Scarondotaccent","1E67scarondotaccent","1E68Sdotbelowdotaccent","1E69sdotbelowdotaccent","1E6ATdotaccent","1E6Btdotaccent","1E6CTdotbelow","1E6Dtdotbelow","1E6ETlinebelow","1E6Ftlinebelow","1E70Tcircumflexbelow","1E71tcircumflexbelow","1E72Udieresisbelow","1E73udieresisbelow","1E74Utildebelow","1E75utildebelow","1E76Ucircumflexbelow","1E77ucircumflexbelow","1E78Utildeacute","1E79utildeacute","1E7AUmacrondieresis","1E7Bumacrondieresis","1E7CVtilde","1E7Dvtilde","1E7EVdotbelow","1E7Fvdotbelow","1E80Wgrave","1E81wgrave","1E82Wacute","1E83wacute","1E84Wdieresis","1E85wdieresis","1E86Wdotaccent","1E87wdotaccent","1E88Wdotbelow","1E89wdotbelow","1E8AXdotaccent","1E8Bxdotaccent","1E8CXdieresis","1E8Dxdieresis","1E8EYdotaccent","1E8Fydotaccent","1E90Zcircumflex","1E91zcircumflex","1E92Zdotbelow","1E93zdotbelow","1E94Zlinebelow","1E95zlinebelow","1E96hlinebelow","1E97tdieresis","1E98wring","1E99yring","1E9Aarighthalfring","1E9Bslongdotaccent","1EA0Adotbelow","1EA1adotbelow","1EA2Ahookabove","1EA3ahookabove","1EA4Acircumflexacute","1EA5acircumflexacute","1EA6Acircumflexgrave","1EA7acircumflexgrave","1EA8Acircumflexhookabove","1EA9acircumflexhookabove","1EAAAcircumflextilde","1EABacircumflextilde","1EACAcircumflexdotbelow","1EADacircumflexdotbelow","1EAEAbreveacute","1EAFabreveacute","1EB0Abrevegrave","1EB1abrevegrave","1EB2Abrevehookabove","1EB3abrevehookabove","1EB4Abrevetilde","1EB5abrevetilde","1EB6Abrevedotbelow","1EB7abrevedotbelow","1EB8Edotbelow","1EB9edotbelow","1EBAEhookabove","1EBBehookabove","1EBCEtilde","1EBDetilde","1EBEEcircumflexacute","1EBFecircumflexacute","1EC0Ecircumflexgrave","1EC1ecircumflexgrave","1EC2Ecircumflexhookabove","1EC3ecircumflexhookabove","1EC4Ecircumflextilde","1EC5ecircumflextilde","1EC6Ecircumflexdotbelow","1EC7ecircumflexdotbelow","1EC8Ihookabove","1EC9ihookabove","1ECAIdotbelow","1ECBidotbelow","1ECCOdotbelow","1ECDodotbelow","1ECEOhookabove","1ECFohookabove","1ED0Ocircumflexacute","1ED1ocircumflexacute","1ED2Ocircumflexgrave","1ED3ocircumflexgrave","1ED4Ocircumflexhookabove","1ED5ocircumflexhookabove","1ED6Ocircumflextilde","1ED7ocircumflextilde","1ED8Ocircumflexdotbelow","1ED9ocircumflexdotbelow","1EDAOhornacute","1EDBohornacute","1EDCOhorngrave","1EDDohorngrave","1EDEOhornhookabove","1EDFohornhookabove","1EE0Ohorntilde","1EE1ohorntilde","1EE2Ohorndotbelow","1EE3ohorndotbelow","1EE4Udotbelow","1EE5udotbelow","1EE6Uhookabove","1EE7uhookabove","1EE8Uhornacute","1EE9uhornacute","1EEAUhorngrave","1EEBuhorngrave","1EECUhornhookabove","1EEDuhornhookabove","1EEEUhorntilde","1EEFuhorntilde","1EF0Uhorndotbelow","1EF1uhorndotbelow","1EF2Ygrave","1EF3ygrave","1EF4Ydotbelow","1EF5ydotbelow","1EF6Yhookabove","1EF7yhookabove","1EF8Ytilde","1EF9ytilde","2002enspace","200Bzerowidthspace","200Cafii61664","200Dafii301","200Eafii299","200Fafii300","2010hyphentwo","2012figuredash","2013endash","2014emdash","2015afii00208","2016dblverticalbar","2017underscoredbl","2018quoteleft","2019quoteright","201Aquotesinglbase","201Bquotereversed","201Cquotedblleft","201Dquotedblright","201Equotedblbase","2020dagger","2021daggerdbl","2022bullet","2024onedotenleader","2025twodotenleader","2026ellipsis","202Cafii61573","202Dafii61574","202Eafii61575","2030perthousand","2032minute","2033second","2035primereversed","2039guilsinglleft","203Aguilsinglright","203Breferencemark","203Cexclamdbl","203Eoverline","2042asterism","2044fraction","2070zerosuperior","2074foursuperior","2075fivesuperior","2076sixsuperior","2077sevensuperior","2078eightsuperior","2079ninesuperior","207Aplussuperior","207Cequalsuperior","207Dparenleftsuperior","207Eparenrightsuperior","207Fnsuperior","2080zeroinferior","2081oneinferior","2082twoinferior","2083threeinferior","2084fourinferior","2085fiveinferior","2086sixinferior","2087seveninferior","2088eightinferior","2089nineinferior","208Dparenleftinferior","208Eparenrightinferior","20A1colonmonetary","20A2cruzeiro","20A3franc","20A4afii08941","20A7peseta","20A9won","20AAafii57636","20ABdong","20ACEuro","2103centigrade","2105afii61248","2109fahrenheit","2111Ifraktur","2113afii61289","2116afii61352","2118weierstrass","211CRfraktur","211Eprescription","2121telephone","2122trademark","2126Omega","212Bangstrom","212Eestimated","2135aleph","2153onethird","2154twothirds","215Boneeighth","215Cthreeeighths","215Dfiveeighths","215Eseveneighths","2160Oneroman","2161Tworoman","2162Threeroman","2163Fourroman","2164Fiveroman","2165Sixroman","2166Sevenroman","2167Eightroman","2168Nineroman","2169Tenroman","216AElevenroman","216BTwelveroman","2170oneroman","2171tworoman","2172threeroman","2173fourroman","2174fiveroman","2175sixroman","2176sevenroman","2177eightroman","2178nineroman","2179tenroman","217Aelevenroman","217Btwelveroman","2190arrowleft","2191arrowup","2192arrowright","2193arrowdown","2194arrowboth","2195arrowupdn","2196arrowupleft","2197arrowupright","2198arrowdownright","2199arrowdownleft","21A8arrowupdnbse","21B5carriagereturn","21BCharpoonleftbarbup","21C0harpoonrightbarbup","21C4arrowrightoverleft","21C5arrowupleftofdown","21C6arrowleftoverright","21CDarrowleftdblstroke","21CFarrowrightdblstroke","21D0arrowdblleft","21D1arrowdblup","21D2arrowdblright","21D3arrowdbldown","21D4arrowdblboth","21DEpageup","21DFpagedown","21E0arrowdashleft","21E1arrowdashup","21E2arrowdashright","21E3arrowdashdown","21E4arrowtableft","21E5arrowtabright","21E6arrowleftwhite","21E7arrowupwhite","21E8arrowrightwhite","21E9arrowdownwhite","21EAcapslock","2200universal","2202partialdiff","2203existential","2205emptyset","2206Delta","2207gradient","2208element","2209notelement","220Bsuchthat","220Cnotcontains","220Fproduct","2211summation","2212minus","2213minusplus","2215divisionslash","2217asteriskmath","2219bulletoperator","221Aradical","221Dproportional","221Einfinity","221Forthogonal","2220angle","2223divides","2225parallel","2226notparallel","2227logicaland","2228logicalor","2229intersection","222Aunion","222Bintegral","222Cdblintegral","222Econtourintegral","2234therefore","2235because","2236ratio","2237proportion","223Csimilar","223Dreversedtilde","2243asymptoticallyequal","2245congruent","2248approxequal","224Callequal","2250approaches","2251geometricallyequal","2252approxequalorimage","2253imageorapproximatelyequal","2260notequal","2261equivalence","2262notidentical","2264lessequal","2265greaterequal","2266lessoverequal","2267greateroverequal","226Amuchless","226Bmuchgreater","226Enotless","226Fnotgreater","2270notlessnorequal","2271notgreaternorequal","2272lessorequivalent","2273greaterorequivalent","2276lessorgreater","2277greaterorless","2279notgreaternorless","227Aprecedes","227Bsucceeds","2280notprecedes","2281notsucceeds","2282propersubset","2283propersuperset","2284notsubset","2285notsuperset","2286reflexsubset","2287reflexsuperset","228Asubsetnotequal","228Bsupersetnotequal","2295circleplus",
10
+ "2296minuscircle","2297circlemultiply","2299circleot","22A3tackleft","22A4tackdown","22A5perpendicular","22BFrighttriangle","22C5dotmath","22CEcurlyor","22CFcurlyand","22DAlessequalorgreater","22DBgreaterequalorless","22EEellipsisvertical","2302house","2303control","2305projective","2310revlogicalnot","2312arc","2318propellor","2320integraltp","2321integralbt","2325option","2326deleteright","2327clear","2329angleleft","232Aangleright","232Bdeleteleft","2423blank","2460onecircle","2461twocircle","2462threecircle","2463fourcircle","2464fivecircle","2465sixcircle","2466sevencircle","2467eightcircle","2468ninecircle","2469tencircle","246Aelevencircle","246Btwelvecircle","246Cthirteencircle","246Dfourteencircle","246Efifteencircle","246Fsixteencircle","2470seventeencircle","2471eighteencircle","2472nineteencircle","2473twentycircle","2474oneparen","2475twoparen","2476threeparen","2477fourparen","2478fiveparen","2479sixparen","247Asevenparen","247Beightparen","247Cnineparen","247Dtenparen","247Eelevenparen","247Ftwelveparen","2480thirteenparen","2481fourteenparen","2482fifteenparen","2483sixteenparen","2484seventeenparen","2485eighteenparen","2486nineteenparen","2487twentyparen","2488oneperiod","2489twoperiod","248Athreeperiod","248Bfourperiod","248Cfiveperiod","248Dsixperiod","248Esevenperiod","248Feightperiod","2490nineperiod","2491tenperiod","2492elevenperiod","2493twelveperiod","2494thirteenperiod","2495fourteenperiod","2496fifteenperiod","2497sixteenperiod","2498seventeenperiod","2499eighteenperiod","249Anineteenperiod","249Btwentyperiod","249Caparen","249Dbparen","249Ecparen","249Fdparen","24A0eparen","24A1fparen","24A2gparen","24A3hparen","24A4iparen","24A5jparen","24A6kparen","24A7lparen","24A8mparen","24A9nparen","24AAoparen","24ABpparen","24ACqparen","24ADrparen","24AEsparen","24AFtparen","24B0uparen","24B1vparen","24B2wparen","24B3xparen","24B4yparen","24B5zparen","24B6Acircle","24B7Bcircle","24B8Ccircle","24B9Dcircle","24BAEcircle","24BBFcircle","24BCGcircle","24BDHcircle","24BEIcircle","24BFJcircle","24C0Kcircle","24C1Lcircle","24C2Mcircle","24C3Ncircle","24C4Ocircle","24C5Pcircle","24C6Qcircle","24C7Rcircle","24C8Scircle","24C9Tcircle","24CAUcircle","24CBVcircle","24CCWcircle","24CDXcircle","24CEYcircle","24CFZcircle","24D0acircle","24D1bcircle","24D2ccircle","24D3dcircle","24D4ecircle","24D5fcircle","24D6gcircle","24D7hcircle","24D8icircle","24D9jcircle","24DAkcircle","24DBlcircle","24DCmcircle","24DDncircle","24DEocircle","24DFpcircle","24E0qcircle","24E1rcircle","24E2scircle","24E3tcircle","24E4ucircle","24E5vcircle","24E6wcircle","24E7xcircle","24E8ycircle","24E9zcircle","2500SF100000","2502SF110000","250CSF010000","2510SF030000","2514SF020000","2518SF040000","251CSF080000","2524SF090000","252CSF060000","2534SF070000","253CSF050000","2550SF430000","2551SF240000","2552SF510000","2553SF520000","2554SF390000","2555SF220000","2556SF210000","2557SF250000","2558SF500000","2559SF490000","255ASF380000","255BSF280000","255CSF270000","255DSF260000","255ESF360000","255FSF370000","2560SF420000","2561SF190000","2562SF200000","2563SF230000","2564SF470000","2565SF480000","2566SF410000","2567SF450000","2568SF460000","2569SF400000","256ASF540000","256BSF530000","256CSF440000","2580upblock","2584dnblock","2588block","258Clfblock","2590rtblock","2591ltshade","2592shade","2593dkshade","25A0filledbox","25A1H22073","25A3squarewhitewithsmallblack","25A4squarehorizontalfill","25A5squareverticalfill","25A6squareorthogonalcrosshatchfill","25A7squareupperlefttolowerrightfill","25A8squareupperrighttolowerleftfill","25A9squarediagonalcrosshatchfill","25AAH18543","25ABH18551","25ACfilledrect","25B2triagup","25B3whiteuppointingtriangle","25B4blackuppointingsmalltriangle","25B5whiteuppointingsmalltriangle","25B6blackrightpointingtriangle","25B7whiterightpointingtriangle","25B9whiterightpointingsmalltriangle","25BAtriagrt","25BCtriagdn","25BDwhitedownpointingtriangle","25BFwhitedownpointingsmalltriangle","25C0blackleftpointingtriangle","25C1whiteleftpointingtriangle","25C3whiteleftpointingsmalltriangle","25C4triaglf","25C6blackdiamond","25C7whitediamond","25C8whitediamondcontainingblacksmalldiamond","25C9fisheye","25CAlozenge","25CBcircle","25CCdottedcircle","25CEbullseye","25CFH18533","25D0circlewithlefthalfblack","25D1circlewithrighthalfblack","25D8invbullet","25D9invcircle","25E2blacklowerrighttriangle","25E3blacklowerlefttriangle","25E4blackupperlefttriangle","25E5blackupperrighttriangle","25E6openbullet","25EFlargecircle","2605blackstar","2606whitestar","260Etelephoneblack","260Fwhitetelephone","261Cpointingindexleftwhite","261Dpointingindexupwhite","261Epointingindexrightwhite","261Fpointingindexdownwhite","262Fyinyang","263Asmileface","263Binvsmileface","263Csun","2640female","2641earth","2642male","2660spade","2661heartsuitwhite","2662diamondsuitwhite","2663club","2664spadesuitwhite","2665heart","2666diamond","2667clubsuitwhite","2668hotsprings","2669quarternote","266Amusicalnote","266Bmusicalnotedbl","266Cbeamedsixteenthnotes","266Dmusicflatsign","266Fmusicsharpsign","2713checkmark","278Aonecircleinversesansserif","278Btwocircleinversesansserif","278Cthreecircleinversesansserif","278Dfourcircleinversesansserif","278Efivecircleinversesansserif","278Fsixcircleinversesansserif","2790sevencircleinversesansserif","2791eightcircleinversesansserif","2792ninecircleinversesansserif","279Earrowrightheavy","3000ideographicspace","3001ideographiccomma","3002ideographicperiod","3003dittomark","3004jis","3005ideographiciterationmark","3006ideographicclose","3007ideographiczero","3008anglebracketleft","3009anglebracketright","300Adblanglebracketleft","300Bdblanglebracketright","300Ccornerbracketleft","300Dcornerbracketright","300Ewhitecornerbracketleft","300Fwhitecornerbracketright","3010blacklenticularbracketleft","3011blacklenticularbracketright","3012postalmark","3013getamark","3014tortoiseshellbracketleft","3015tortoiseshellbracketright","3016whitelenticularbracketleft","3017whitelenticularbracketright","3018whitetortoiseshellbracketleft","3019whitetortoiseshellbracketright","301Cwavedash","301Dquotedblprimereversed","301Equotedblprime","3020postalmarkface","3021onehangzhou","3022twohangzhou","3023threehangzhou","3024fourhangzhou","3025fivehangzhou","3026sixhangzhou","3027sevenhangzhou","3028eighthangzhou","3029ninehangzhou","3036circlepostalmark","3041asmallhiragana","3042ahiragana","3043ismallhiragana","3044ihiragana","3045usmallhiragana","3046uhiragana","3047esmallhiragana","3048ehiragana","3049osmallhiragana","304Aohiragana","304Bkahiragana","304Cgahiragana","304Dkihiragana","304Egihiragana","304Fkuhiragana","3050guhiragana","3051kehiragana","3052gehiragana","3053kohiragana","3054gohiragana","3055sahiragana","3056zahiragana","3057sihiragana","3058zihiragana","3059suhiragana","305Azuhiragana","305Bsehiragana","305Czehiragana","305Dsohiragana","305Ezohiragana","305Ftahiragana","3060dahiragana","3061tihiragana","3062dihiragana","3063tusmallhiragana","3064tuhiragana","3065duhiragana","3066tehiragana","3067dehiragana","3068tohiragana","3069dohiragana","306Anahiragana","306Bnihiragana","306Cnuhiragana","306Dnehiragana","306Enohiragana","306Fhahiragana","3070bahiragana","3071pahiragana","3072hihiragana","3073bihiragana","3074pihiragana","3075huhiragana","3076buhiragana","3077puhiragana","3078hehiragana","3079behiragana","307Apehiragana","307Bhohiragana","307Cbohiragana","307Dpohiragana","307Emahiragana","307Fmihiragana","3080muhiragana","3081mehiragana","3082mohiragana","3083yasmallhiragana","3084yahiragana","3085yusmallhiragana","3086yuhiragana","3087yosmallhiragana","3088yohiragana","3089rahiragana","308Arihiragana","308Bruhiragana","308Crehiragana","308Drohiragana","308Ewasmallhiragana","308Fwahiragana","3090wihiragana","3091wehiragana","3092wohiragana","3093nhiragana","3094vuhiragana","309Bvoicedmarkkana","309Csemivoicedmarkkana","309Diterationhiragana","309Evoicediterationhiragana","30A1asmallkatakana","30A2akatakana","30A3ismallkatakana","30A4ikatakana","30A5usmallkatakana","30A6ukatakana","30A7esmallkatakana","30A8ekatakana","30A9osmallkatakana","30AAokatakana","30ABkakatakana","30ACgakatakana","30ADkikatakana","30AEgikatakana","30AFkukatakana","30B0gukatakana","30B1kekatakana","30B2gekatakana","30B3kokatakana","30B4gokatakana","30B5sakatakana","30B6zakatakana","30B7sikatakana","30B8zikatakana","30B9sukatakana","30BAzukatakana","30BBsekatakana","30BCzekatakana","30BDsokatakana","30BEzokatakana","30BFtakatakana","30C0dakatakana","30C1tikatakana","30C2dikatakana","30C3tusmallkatakana","30C4tukatakana","30C5dukatakana","30C6tekatakana","30C7dekatakana","30C8tokatakana","30C9dokatakana","30CAnakatakana","30CBnikatakana","30CCnukatakana","30CDnekatakana","30CEnokatakana","30CFhakatakana","30D0bakatakana","30D1pakatakana","30D2hikatakana","30D3bikatakana","30D4pikatakana","30D5hukatakana","30D6bukatakana","30D7pukatakana","30D8hekatakana","30D9bekatakana","30DApekatakana","30DBhokatakana","30DCbokatakana","30DDpokatakana","30DEmakatakana","30DFmikatakana","30E0mukatakana","30E1mekatakana","30E2mokatakana","30E3yasmallkatakana","30E4yakatakana","30E5yusmallkatakana","30E6yukatakana","30E7yosmallkatakana","30E8yokatakana","30E9rakatakana","30EArikatakana","30EBrukatakana","30ECrekatakana","30EDrokatakana","30EEwasmallkatakana","30EFwakatakana","30F0wikatakana","30F1wekatakana","30F2wokatakana","30F3nkatakana","30F4vukatakana","30F5kasmallkatakana","30F6kesmallkatakana","30F7vakatakana","30F8vikatakana","30F9vekatakana","30FAvokatakana","30FBdotkatakana","30FCprolongedkana","30FDiterationkatakana","30FEvoicediterationkatakana","3105bbopomofo","3106pbopomofo","3107mbopomofo","3108fbopomofo","3109dbopomofo","310Atbopomofo","310Bnbopomofo","310Clbopomofo","310Dgbopomofo","310Ekbopomofo","310Fhbopomofo","3110jbopomofo","3111qbopomofo","3112xbopomofo","3113zhbopomofo","3114chbopomofo","3115shbopomofo","3116rbopomofo","3117zbopomofo","3118cbopomofo","3119sbopomofo","311Aabopomofo","311Bobopomofo","311Cebopomofo","311Dehbopomofo","311Eaibopomofo","311Feibopomofo","3120aubopomofo","3121oubopomofo","3122anbopomofo","3123enbopomofo","3124angbopomofo","3125engbopomofo","3126erbopomofo","3127ibopomofo","3128ubopomofo","3129iubopomofo","3131kiyeokkorean","3132ssangkiyeokkorean","3133kiyeoksioskorean","3134nieunkorean","3135nieuncieuckorean","3136nieunhieuhkorean","3137tikeutkorean","3138ssangtikeutkorean","3139rieulkorean","313Arieulkiyeokkorean","313Brieulmieumkorean","313Crieulpieupkorean","313Drieulsioskorean","313Erieulthieuthkorean","313Frieulphieuphkorean","3140rieulhieuhkorean","3141mieumkorean","3142pieupkorean","3143ssangpieupkorean","3144pieupsioskorean","3145sioskorean","3146ssangsioskorean","3147ieungkorean","3148cieuckorean","3149ssangcieuckorean","314Achieuchkorean","314Bkhieukhkorean","314Cthieuthkorean","314Dphieuphkorean","314Ehieuhkorean","314Fakorean","3150aekorean","3151yakorean","3152yaekorean","3153eokorean","3154ekorean","3155yeokorean","3156yekorean","3157okorean","3158wakorean","3159waekorean","315Aoekorean","315Byokorean","315Cukorean","315Dweokorean","315Ewekorean","315Fwikorean","3160yukorean","3161eukorean","3162yikorean","3163ikorean","3164hangulfiller","3165ssangnieunkorean","3166nieuntikeutkorean","3167nieunsioskorean","3168nieunpansioskorean","3169rieulkiyeoksioskorean","316Arieultikeutkorean","316Brieulpieupsioskorean","316Crieulpansioskorean","316Drieulyeorinhieuhkorean","316Emieumpieupkorean","316Fmieumsioskorean","3170mieumpansioskorean","3171kapyeounmieumkorean","3172pieupkiyeokkorean","3173pieuptikeutkorean","3174pieupsioskiyeokkorean","3175pieupsiostikeutkorean","3176pieupcieuckorean","3177pieupthieuthkorean","3178kapyeounpieupkorean","3179kapyeounssangpieupkorean","317Asioskiyeokkorean","317Bsiosnieunkorean","317Csiostikeutkorean","317Dsiospieupkorean","317Esioscieuckorean","317Fpansioskorean","3180ssangieungkorean","3181yesieungkorean","3182yesieungsioskorean","3183yesieungpansioskorean","3184kapyeounphieuphkorean","3185ssanghieuhkorean","3186yeorinhieuhkorean","3187yoyakorean","3188yoyaekorean","3189yoikorean","318Ayuyeokorean","318Byuyekorean","318Cyuikorean","318Daraeakorean","318Earaeaekorean","3200kiyeokparenkorean","3201nieunparenkorean","3202tikeutparenkorean","3203rieulparenkorean","3204mieumparenkorean","3205pieupparenkorean","3206siosparenkorean","3207ieungparenkorean","3208cieucparenkorean","3209chieuchparenkorean","320Akhieukhparenkorean","320Bthieuthparenkorean","320Cphieuphparenkorean","320Dhieuhparenkorean","320Ekiyeokaparenkorean","320Fnieunaparenkorean","3210tikeutaparenkorean","3211rieulaparenkorean","3212mieumaparenkorean","3213pieupaparenkorean","3214siosaparenkorean","3215ieungaparenkorean","3216cieucaparenkorean","3217chieuchaparenkorean","3218khieukhaparenkorean","3219thieuthaparenkorean","321Aphieuphaparenkorean","321Bhieuhaparenkorean","321Ccieucuparenkorean","3220oneideographicparen","3221twoideographicparen","3222threeideographicparen","3223fourideographicparen","3224fiveideographicparen","3225sixideographicparen","3226sevenideographicparen","3227eightideographicparen","3228nineideographicparen","3229tenideographicparen","322Aideographicmoonparen","322Bideographicfireparen","322Cideographicwaterparen","322Dideographicwoodparen","322Eideographicmetalparen","322Fideographicearthparen","3230ideographicsunparen","3231ideographicstockparen","3232ideographichaveparen","3233ideographicsocietyparen","3234ideographicnameparen","3235ideographicspecialparen","3236ideographicfinancialparen","3237ideographiccongratulationparen","3238ideographiclaborparen","3239ideographicrepresentparen","323Aideographiccallparen","323Bideographicstudyparen","323Cideographicsuperviseparen","323Dideographicenterpriseparen","323Eideographicresourceparen","323Fideographicallianceparen","3240ideographicfestivalparen","3242ideographicselfparen","3243ideographicreachparen","3260kiyeokcirclekorean","3261nieuncirclekorean","3262tikeutcirclekorean","3263rieulcirclekorean","3264mieumcirclekorean","3265pieupcirclekorean","3266sioscirclekorean","3267ieungcirclekorean","3268cieuccirclekorean","3269chieuchcirclekorean","326Akhieukhcirclekorean","326Bthieuthcirclekorean","326Cphieuphcirclekorean","326Dhieuhcirclekorean","326Ekiyeokacirclekorean","326Fnieunacirclekorean","3270tikeutacirclekorean","3271rieulacirclekorean","3272mieumacirclekorean","3273pieupacirclekorean","3274siosacirclekorean","3275ieungacirclekorean","3276cieucacirclekorean","3277chieuchacirclekorean","3278khieukhacirclekorean","3279thieuthacirclekorean","327Aphieuphacirclekorean","327Bhieuhacirclekorean","327Fkoreanstandardsymbol","328Aideographmooncircle","328Bideographfirecircle","328Cideographwatercircle","328Dideographwoodcircle","328Eideographmetalcircle","328Fideographearthcircle","3290ideographsuncircle","3294ideographnamecircle","3296ideographicfinancialcircle","3298ideographiclaborcircle","3299ideographicsecretcircle","329Dideographicexcellentcircle","329Eideographicprintcircle","32A3ideographiccorrectcircle","32A4ideographichighcircle","32A5ideographiccentrecircle","32A6ideographiclowcircle","32A7ideographicleftcircle","32A8ideographicrightcircle","32A9ideographicmedicinecircle","3300apaatosquare","3303aarusquare","3305intisquare","330Dkaroriisquare","3314kirosquare","3315kiroguramusquare","3316kiromeetorusquare","3318guramusquare","331Ekooposquare","3322sentisquare","3323sentosquare","3326dorusquare","3327tonsquare","332Ahaitusquare","332Bpaasentosquare","3331birusquare","3333huiitosquare","3336hekutaarusquare","3339herutusquare","333Bpeezisquare","3342hoonsquare","3347mansyonsquare","3349mirisquare","334Amiribaarusquare","334Dmeetorusquare","334Eyaadosquare","3351rittorusquare","3357wattosquare","337Bheiseierasquare","337Csyouwaerasquare","337Dtaisyouerasquare","337Emeizierasquare","337Fcorporationsquare","3380paampssquare","3381nasquare","3382muasquare","3383masquare","3384kasquare","3385KBsquare","3386MBsquare","3387GBsquare","3388calsquare","3389kcalsquare","338Apfsquare","338Bnfsquare","338Cmufsquare","338Dmugsquare","338Esquaremg","338Fsquarekg","3390Hzsquare","3391khzsquare","3392mhzsquare","3393ghzsquare","3394thzsquare","3395mulsquare","3396mlsquare","3397dlsquare","3398klsquare","3399fmsquare","339Anmsquare","339Bmumsquare","339Csquaremm","339Dsquarecm","339Esquarekm","339Fmmsquaredsquare","33A0cmsquaredsquare","33A1squaremsquared","33A2kmsquaredsquare","33A3mmcubedsquare","33A4cmcubedsquare","33A5mcubedsquare","33A6kmcubedsquare","33A7moverssquare","33A8moverssquaredsquare","33A9pasquare","33AAkpasquare","33ABmpasquare","33ACgpasquare","33ADradsquare","33AEradoverssquare","33AFradoverssquaredsquare","33B0pssquare","33B1nssquare","33B2mussquare","33B3mssquare","33B4pvsquare","33B5nvsquare","33B6muvsquare","33B7mvsquare","33B8kvsquare","33B9mvmegasquare","33BApwsquare","33BBnwsquare","33BCmuwsquare","33BDmwsquare","33BEkwsquare","33BFmwmegasquare","33C0kohmsquare","33C1mohmsquare","33C2amsquare","33C3bqsquare","33C4squarecc","33C5cdsquare","33C6coverkgsquare","33C7cosquare","33C8dbsquare","33C9gysquare","33CAhasquare","33CBHPsquare","33CDKKsquare","33CEsquarekmcapital","33CFktsquare","33D0lmsquare","33D1squareln","33D2squarelog","33D3lxsquare","33D4mbsquare","33D5squaremil","33D6molsquare","33D8pmsquare","33DBsrsquare","33DCsvsquare","33DDwbsquare","5344twentyhangzhou","F6BEdotlessj","F6BFLL","F6C0ll","F6C3commaaccent","F6C4afii10063","F6C5afii10064","F6C6afii10192","F6C7afii10831","F6C8afii10832","F6C9Acute","F6CACaron","F6CBDieresis","F6CCDieresisAcute","F6CDDieresisGrave","F6CEGrave","F6CFHungarumlaut","F6D0Macron","F6D1cyrBreve","F6D2cyrFlex","F6D3dblGrave","F6D4cyrbreve","F6D5cyrflex","F6D6dblgrave","F6D7dieresisacute","F6D8dieresisgrave","F6D9copyrightserif","F6DAregisterserif","F6DBtrademarkserif","F6DConefitted","F6DDrupiah","F6DEthreequartersemdash","F6DFcentinferior","F6E0centsuperior","F6E1commainferior","F6E2commasuperior","F6E3dollarinferior","F6E4dollarsuperior","F6E5hypheninferior","F6E6hyphensuperior","F6E7periodinferior","F6E8periodsuperior","F6E9asuperior","F6EAbsuperior","F6EBdsuperior","F6ECesuperior","F6EDisuperior","F6EElsuperior","F6EFmsuperior","F6F0osuperior","F6F1rsuperior","F6F2ssuperior","F6F3tsuperior","F6F4Brevesmall","F6F5Caronsmall","F6F6Circumflexsmall","F6F7Dotaccentsmall","F6F8Hungarumlautsmall","F6F9Lslashsmall","F6FAOEsmall","F6FBOgoneksmall","F6FCRingsmall","F6FDScaronsmall","F6FETildesmall","F6FFZcaronsmall","F721exclamsmall","F724dollaroldstyle","F726ampersandsmall","F730zerooldstyle","F731oneoldstyle","F732twooldstyle","F733threeoldstyle","F734fouroldstyle","F735fiveoldstyle","F736sixoldstyle","F737sevenoldstyle","F738eightoldstyle","F739nineoldstyle","F73Fquestionsmall","F760Gravesmall","F761Asmall","F762Bsmall","F763Csmall","F764Dsmall","F765Esmall","F766Fsmall","F767Gsmall","F768Hsmall","F769Ismall","F76AJsmall","F76BKsmall","F76CLsmall","F76DMsmall","F76ENsmall","F76FOsmall","F770Psmall","F771Qsmall","F772Rsmall","F773Ssmall","F774Tsmall","F775Usmall","F776Vsmall","F777Wsmall","F778Xsmall","F779Ysmall","F77AZsmall","F7A1exclamdownsmall","F7A2centoldstyle","F7A8Dieresissmall","F7AFMacronsmall","F7B4Acutesmall","F7B8Cedillasmall","F7BFquestiondownsmall","F7E0Agravesmall","F7E1Aacutesmall","F7E2Acircumflexsmall","F7E3Atildesmall","F7E4Adieresissmall","F7E5Aringsmall","F7E6AEsmall","F7E7Ccedillasmall","F7E8Egravesmall","F7E9Eacutesmall","F7EAEcircumflexsmall","F7EBEdieresissmall","F7ECIgravesmall","F7EDIacutesmall","F7EEIcircumflexsmall","F7EFIdieresissmall","F7F0Ethsmall","F7F1Ntildesmall","F7F2Ogravesmall","F7F3Oacutesmall","F7F4Ocircumflexsmall","F7F5Otildesmall","F7F6Odieresissmall","F7F8Oslashsmall","F7F9Ugravesmall","F7FAUacutesmall","F7FBUcircumflexsmall","F7FCUdieresissmall","F7FDYacutesmall","F7FEThornsmall","F7FFYdieresissmall","F884maihanakatleftthai","F885saraileftthai","F886saraiileftthai","F887saraueleftthai","F888saraueeleftthai","F889maitaikhuleftthai","F88Amaiekupperleftthai","F88Bmaieklowrightthai","F88Cmaieklowleftthai","F88Dmaithoupperleftthai","F88Emaitholowrightthai","F88Fmaitholowleftthai","F890maitriupperleftthai","F891maitrilowrightthai","F892maitrilowleftthai","F893maichattawaupperleftthai","F894maichattawalowrightthai","F895maichattawalowleftthai","F896thanthakhatupperleftthai","F897thanthakhatlowrightthai","F898thanthakhatlowleftthai","F899nikhahitleftthai","F8E5radicalex","F8E6arrowvertex","F8E7arrowhorizex","F8E8registersans","F8E9copyrightsans","F8EAtrademarksans","F8EBparenlefttp","F8ECparenleftex","F8EDparenleftbt","F8EEbracketlefttp","F8EFbracketleftex","F8F0bracketleftbt","F8F1bracelefttp","F8F2braceleftmid","F8F3braceleftbt","F8F4braceex","F8F5integralex","F8F6parenrighttp","F8F7parenrightex","F8F8parenrightbt","F8F9bracketrighttp","F8FAbracketrightex","F8FBbracketrightbt","F8FCbracerighttp","F8FDbracerightmid","F8FEbracerightbt","F8FFapple","FB00ff","FB01fi","FB02fl","FB03ffi","FB04ffl","FB1Fafii57705","FB20ayinaltonehebrew","FB2Aafii57694","FB2Bafii57695","FB2Cshindageshshindot","FB2Dshindageshsindot","FB2Ealefpatahhebrew","FB2Falefqamatshebrew","FB30alefdageshhebrew","FB31betdagesh","FB32gimeldagesh","FB33daletdagesh","FB34hedagesh","FB35afii57723","FB36zayindagesh","FB38tetdagesh","FB39yoddagesh","FB3Afinalkafdagesh","FB3Bkafdagesh","FB3Clameddagesh","FB3Ememdagesh","FB40nundagesh","FB41samekhdagesh","FB43pefinaldageshhebrew","FB44pedagesh","FB46tsadidagesh","FB47qofdagesh","FB48reshdageshhebrew","FB49shindagesh","FB4Atavdagesh","FB4Bafii57700","FB4Cbetrafehebrew","FB4Dkafrafehebrew","FB4Eperafehebrew","FB4Faleflamedhebrew","FB57pehfinalarabic","FB58pehinitialarabic","FB59pehmedialarabic","FB67ttehfinalarabic","FB68ttehinitialarabic","FB69ttehmedialarabic","FB6Bvehfinalarabic","FB6Cvehinitialarabic","FB6Dvehmedialarabic","FB7Btchehfinalarabic","FB7Ctchehinitialarabic","FB7Dtchehmedialarabic","FB89ddalfinalarabic","FB8Bjehfinalarabic","FB8Drrehfinalarabic","FB93gaffinalarabic","FB94gafinitialarabic","FB95gafmedialarabic","FB9Fnoonghunnafinalarabic","FBA4hehhamzaaboveisolatedarabic","FBA5hehhamzaabovefinalarabic","FBA7hehfinalaltonearabic","FBA8hehinitialaltonearabic","FBA9hehmedialaltonearabic","FBAFyehbarreefinalarabic","FC08behmeemisolatedarabic","FC0Btehjeemisolatedarabic","FC0Ctehhahisolatedarabic","FC0Etehmeemisolatedarabic","FC48meemmeemisolatedarabic","FC4Bnoonjeemisolatedarabic","FC4Enoonmeemisolatedarabic","FC58yehmeemisolatedarabic","FC5Eshaddadammatanarabic","FC5Fshaddakasratanarabic","FC60shaddafathaarabic","FC61shaddadammaarabic","FC62shaddakasraarabic","FC6Dbehnoonfinalarabic","FC73tehnoonfinalarabic","FC8Dnoonnoonfinalarabic","FC94yehnoonfinalarabic","FC9Fbehmeeminitialarabic","FCA1tehjeeminitialarabic","FCA2tehhahinitialarabic","FCA4tehmeeminitialarabic","FCC9lamjeeminitialarabic","FCCAlamhahinitialarabic","FCCBlamkhahinitialarabic","FCCClammeeminitialarabic","FCD1meemmeeminitialarabic","FCD2noonjeeminitialarabic","FCD5noonmeeminitialarabic","FCDDyehmeeminitialarabic","FD3Eparenleftaltonearabic","FD3Fparenrightaltonearabic","FD88lammeemhahinitialarabic","FDF2lamlamhehisolatedarabic","FDFAsallallahoualayhewasallamarabic","FE30twodotleadervertical","FE31emdashvertical","FE32endashvertical","FE33underscorevertical","FE34wavyunderscorevertical","FE35parenleftvertical","FE36parenrightvertical","FE37braceleftvertical","FE38bracerightvertical","FE39tortoiseshellbracketleftvertical","FE3Atortoiseshellbracketrightvertical","FE3Bblacklenticularbracketleftvertical","FE3Cblacklenticularbracketrightvertical","FE3Ddblanglebracketleftvertical","FE3Edblanglebracketrightvertical","FE3Fanglebracketleftvertical","FE40anglebracketrightvertical","FE41cornerbracketleftvertical","FE42cornerbracketrightvertical","FE43whitecornerbracketleftvertical","FE44whitecornerbracketrightvertical","FE49overlinedashed","FE4Aoverlinecenterline","FE4Boverlinewavy","FE4Coverlinedblwavy","FE4Dlowlinedashed","FE4Elowlinecenterline","FE4Funderscorewavy","FE50commasmall","FE52periodsmall","FE54semicolonsmall","FE55colonsmall","FE59parenleftsmall","FE5Aparenrightsmall","FE5Bbraceleftsmall","FE5Cbracerightsmall","FE5Dtortoiseshellbracketleftsmall","FE5Etortoiseshellbracketrightsmall","FE5Fnumbersignsmall","FE61asterisksmall","FE62plussmall","FE63hyphensmall","FE64lesssmall","FE65greatersmall","FE66equalsmall","FE69dollarsmall","FE6Apercentsmall","FE6Batsmall","FE82alefmaddaabovefinalarabic","FE84alefhamzaabovefinalarabic","FE86wawhamzaabovefinalarabic","FE88alefhamzabelowfinalarabic","FE8Ayehhamzaabovefinalarabic","FE8Byehhamzaaboveinitialarabic","FE8Cyehhamzaabovemedialarabic","FE8Ealeffinalarabic","FE90behfinalarabic","FE91behinitialarabic","FE92behmedialarabic","FE94tehmarbutafinalarabic","FE96tehfinalarabic","FE97tehinitialarabic","FE98tehmedialarabic","FE9Athehfinalarabic","FE9Bthehinitialarabic","FE9Cthehmedialarabic","FE9Ejeemfinalarabic","FE9Fjeeminitialarabic","FEA0jeemmedialarabic","FEA2hahfinalarabic","FEA3hahinitialarabic","FEA4hahmedialarabic","FEA6khahfinalarabic","FEA7khahinitialarabic","FEA8khahmedialarabic","FEAAdalfinalarabic","FEACthalfinalarabic","FEAErehfinalarabic","FEB0zainfinalarabic","FEB2seenfinalarabic","FEB3seeninitialarabic","FEB4seenmedialarabic","FEB6sheenfinalarabic","FEB7sheeninitialarabic","FEB8sheenmedialarabic","FEBAsadfinalarabic","FEBBsadinitialarabic","FEBCsadmedialarabic","FEBEdadfinalarabic","FEBFdadinitialarabic","FEC0dadmedialarabic","FEC2tahfinalarabic","FEC3tahinitialarabic","FEC4tahmedialarabic","FEC6zahfinalarabic","FEC7zahinitialarabic","FEC8zahmedialarabic","FECAainfinalarabic","FECBaininitialarabic","FECCainmedialarabic","FECEghainfinalarabic","FECFghaininitialarabic","FED0ghainmedialarabic","FED2fehfinalarabic","FED3fehinitialarabic","FED4fehmedialarabic","FED6qaffinalarabic","FED7qafinitialarabic","FED8qafmedialarabic","FEDAkaffinalarabic","FEDBkafinitialarabic","FEDCkafmedialarabic","FEDElamfinalarabic","FEDFlaminitialarabic","FEE0lammedialarabic","FEE2meemfinalarabic","FEE3meeminitialarabic","FEE4meemmedialarabic","FEE6noonfinalarabic","FEE7nooninitialarabic","FEE8noonmedialarabic","FEEAhehfinalarabic","FEEBhehinitialarabic","FEEChehmedialarabic","FEEEwawfinalarabic","FEF0alefmaksurafinalarabic","FEF2yehfinalarabic","FEF3yehinitialarabic","FEF4yehmedialarabic","FEF5lamalefmaddaaboveisolatedarabic","FEF6lamalefmaddaabovefinalarabic","FEF7lamalefhamzaaboveisolatedarabic","FEF8lamalefhamzaabovefinalarabic","FEF9lamalefhamzabelowisolatedarabic","FEFAlamalefhamzabelowfinalarabic","FEFBlamalefisolatedarabic","FEFClamaleffinalarabic","FEFFzerowidthjoiner","FF01exclammonospace","FF02quotedblmonospace","FF03numbersignmonospace","FF04dollarmonospace","FF05percentmonospace","FF06ampersandmonospace","FF07quotesinglemonospace","FF08parenleftmonospace","FF09parenrightmonospace","FF0Aasteriskmonospace","FF0Bplusmonospace","FF0Ccommamonospace","FF0Dhyphenmonospace","FF0Eperiodmonospace","FF0Fslashmonospace","FF10zeromonospace","FF11onemonospace","FF12twomonospace","FF13threemonospace","FF14fourmonospace","FF15fivemonospace","FF16sixmonospace","FF17sevenmonospace","FF18eightmonospace","FF19ninemonospace","FF1Acolonmonospace","FF1Bsemicolonmonospace","FF1Clessmonospace","FF1Dequalmonospace","FF1Egreatermonospace","FF1Fquestionmonospace","FF20atmonospace","FF21Amonospace","FF22Bmonospace","FF23Cmonospace","FF24Dmonospace","FF25Emonospace","FF26Fmonospace","FF27Gmonospace","FF28Hmonospace","FF29Imonospace","FF2AJmonospace","FF2BKmonospace","FF2CLmonospace","FF2DMmonospace","FF2ENmonospace","FF2FOmonospace","FF30Pmonospace","FF31Qmonospace","FF32Rmonospace","FF33Smonospace","FF34Tmonospace","FF35Umonospace","FF36Vmonospace","FF37Wmonospace","FF38Xmonospace","FF39Ymonospace","FF3AZmonospace","FF3Bbracketleftmonospace","FF3Cbackslashmonospace","FF3Dbracketrightmonospace","FF3Easciicircummonospace","FF3Funderscoremonospace","FF40gravemonospace","FF41amonospace","FF42bmonospace","FF43cmonospace","FF44dmonospace","FF45emonospace","FF46fmonospace","FF47gmonospace","FF48hmonospace","FF49imonospace","FF4Ajmonospace","FF4Bkmonospace","FF4Clmonospace","FF4Dmmonospace","FF4Enmonospace","FF4Fomonospace","FF50pmonospace","FF51qmonospace","FF52rmonospace","FF53smonospace","FF54tmonospace","FF55umonospace","FF56vmonospace","FF57wmonospace","FF58xmonospace","FF59ymonospace","FF5Azmonospace","FF5Bbraceleftmonospace","FF5Cbarmonospace","FF5Dbracerightmonospace","FF5Easciitildemonospace","FF61periodhalfwidth","FF62cornerbracketlefthalfwidth","FF63cornerbracketrighthalfwidth","FF64ideographiccommaleft","FF65middledotkatakanahalfwidth","FF66wokatakanahalfwidth","FF67asmallkatakanahalfwidth","FF68ismallkatakanahalfwidth","FF69usmallkatakanahalfwidth","FF6Aesmallkatakanahalfwidth","FF6Bosmallkatakanahalfwidth","FF6Cyasmallkatakanahalfwidth","FF6Dyusmallkatakanahalfwidth","FF6Eyosmallkatakanahalfwidth","FF6Ftusmallkatakanahalfwidth","FF70katahiraprolongmarkhalfwidth","FF71akatakanahalfwidth","FF72ikatakanahalfwidth","FF73ukatakanahalfwidth","FF74ekatakanahalfwidth","FF75okatakanahalfwidth","FF76kakatakanahalfwidth","FF77kikatakanahalfwidth","FF78kukatakanahalfwidth","FF79kekatakanahalfwidth","FF7Akokatakanahalfwidth","FF7Bsakatakanahalfwidth","FF7Csikatakanahalfwidth","FF7Dsukatakanahalfwidth","FF7Esekatakanahalfwidth","FF7Fsokatakanahalfwidth","FF80takatakanahalfwidth","FF81tikatakanahalfwidth","FF82tukatakanahalfwidth","FF83tekatakanahalfwidth","FF84tokatakanahalfwidth","FF85nakatakanahalfwidth","FF86nikatakanahalfwidth","FF87nukatakanahalfwidth","FF88nekatakanahalfwidth","FF89nokatakanahalfwidth","FF8Ahakatakanahalfwidth","FF8Bhikatakanahalfwidth","FF8Chukatakanahalfwidth","FF8Dhekatakanahalfwidth","FF8Ehokatakanahalfwidth","FF8Fmakatakanahalfwidth","FF90mikatakanahalfwidth","FF91mukatakanahalfwidth","FF92mekatakanahalfwidth","FF93mokatakanahalfwidth","FF94yakatakanahalfwidth","FF95yukatakanahalfwidth","FF96yokatakanahalfwidth","FF97rakatakanahalfwidth","FF98rikatakanahalfwidth","FF99rukatakanahalfwidth","FF9Arekatakanahalfwidth","FF9Brokatakanahalfwidth","FF9Cwakatakanahalfwidth","FF9Dnkatakanahalfwidth","FF9Evoicedmarkkanahalfwidth","FF9Fsemivoicedmarkkanahalfwidth","FFE0centmonospace","FFE1sterlingmonospace","FFE3macronmonospace","FFE5yenmonospace","FFE6wonmonospace"];this._standardFontCharsNames=[];for(let e=0;e<i.length;e++){let t=parseInt(i[e].substr(0,4),16);this._standardFontCharsNames[t]=i[e].substr(4)}}return this._standardFontCharsNames}}Wwa.sRGBprofile=[0,0,12,72,76,105,110,111,2,16,0,0,109,110,116,114,82,71,66,32,88,89,90,32,7,206,0,2,0,9,0,6,0,49,0,0,97,99,115,112,77,83,70,84,0,0,0,0,73,69,67,32,115,82,71,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,214,0,1,0,0,0,0,211,45,72,80,32,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,99,112,114,116,0,0,1,80,0,0,0,51,100,101,115,99,0,0,1,132,0,0,0,108,119,116,112,116,0,0,1,240,0,0,0,20,98,107,112,116,0,0,2,4,0,0,0,20,114,88,89,90,0,0,2,24,0,0,0,20,103,88,89,90,0,0,2,44,0,0,0,20,98,88,89,90,0,0,2,64,0,0,0,20,100,109,110,100,0,0,2,84,0,0,0,112,100,109,100,100,0,0,2,196,0,0,0,136,118,117,101,100,0,0,3,76,0,0,0,134,118,105,101,119,0,0,3,212,0,0,0,36,108,117,109,105,0,0,3,248,0,0,0,20,109,101,97,115,0,0,4,12,0,0,0,36,116,101,99,104,0,0,4,48,0,0,0,12,114,84,82,67,0,0,4,60,0,0,8,12,103,84,82,67,0,0,4,60,0,0,8,12,98,84,82,67,0,0,4,60,0,0,8,12,116,101,120,116,0,0,0,0,67,111,112,121,114,105,103,104,116,32,40,99,41,32,49,57,57,56,32,72,101,119,108,101,116,116,45,80,97,99,107,97,114,100,32,67,111,109,112,97,110,121,0,0,100,101,115,99,0,0,0,0,0,0,0,18,115,82,71,66,32,73,69,67,54,49,57,54,54,45,50,46,49,0,0,0,0,0,0,0,0,0,0,0,18,115,82,71,66,32,73,69,67,54,49,57,54,54,45,50,46,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,89,90,32,0,0,0,0,0,0,243,81,0,1,0,0,0,1,22,204,88,89,90,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,89,90,32,0,0,0,0,0,0,111,162,0,0,56,245,0,0,3,144,88,89,90,32,0,0,0,0,0,0,98,153,0,0,183,133,0,0,24,218,88,89,90,32,0,0,0,0,0,0,36,160,0,0,15,132,0,0,182,207,100,101,115,99,0,0,0,0,0,0,0,22,73,69,67,32,104,116,116,112,58,47,47,119,119,119,46,105,101,99,46,99,104,0,0,0,0,0,0,0,0,0,0,0,22,73,69,67,32,104,116,116,112,58,47,47,119,119,119,46,105,101,99,46,99,104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,101,115,99,0,0,0,0,0,0,0,46,73,69,67,32,54,49,57,54,54,45,50,46,49,32,68,101,102,97,117,108,116,32,82,71,66,32,99,111,108,111,117,114,32,115,112,97,99,101,32,45,32,115,82,71,66,0,0,0,0,0,0,0,0,0,0,0,46,73,69,67,32,54,49,57,54,54,45,50,46,49,32,68,101,102,97,117,108,116,32,82,71,66,32,99,111,108,111,117,114,32,115,112,97,99,101,32,45,32,115,82,71,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,101,115,99,0,0,0,0,0,0,0,44,82,101,102,101,114,101,110,99,101,32,86,105,101,119,105,110,103,32,67,111,110,100,105,116,105,111,110,32,105,110,32,73,69,67,54,49,57,54,54,45,50,46,49,0,0,0,0,0,0,0,0,0,0,0,44,82,101,102,101,114,101,110,99,101,32,86,105,101,119,105,110,103,32,67,111,110,100,105,116,105,111,110,32,105,110,32,73,69,67,54,49,57,54,54,45,50,46,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,118,105,101,119,0,0,0,0,0,19,164,254,0,20,95,46,0,16,207,20,0,3,237,204,0,4,19,11,0,3,92,158,0,0,0,1,88,89,90,32,0,0,0,0,0,76,9,86,0,80,0,0,0,87,31,231,109,101,97,115,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,143,0,0,0,2,115,105,103,32,0,0,0,0,67,82,84,32,99,117,114,118,0,0,0,0,0,0,4,0,0,0,0,5,0,10,0,15,0,20,0,25,0,30,0,35,0,40,0,45,0,50,0,55,0,59,0,64,0,69,0,74,0,79,0,84,0,89,0,94,0,99,0,104,0,109,0,114,0,119,0,124,0,129,0,134,0,139,0,144,0,149,0,154,0,159,0,164,0,169,0,174,0,178,0,183,0,188,0,193,0,198,0,203,0,208,0,213,0,219,0,224,0,229,0,235,0,240,0,246,0,251,1,1,1,7,1,13,1,19,1,25,1,31,1,37,1,43,1,50,1,56,1,62,1,69,1,76,1,82,1,89,1,96,1,103,1,110,1,117,1,124,1,131,1,139,1,146,1,154,1,161,1,169,1,177,1,185,1,193,1,201,1,209,1,217,1,225,1,233,1,242,1,250,2,3,2,12,2,20,2,29,2,38,2,47,2,56,2,65,2,75,2,84,2,93,2,103,2,113,2,122,2,132,2,142,2,152,2,162,2,172,2,182,2,193,2,203,2,213,2,224,2,235,2,245,3,0,3,11,3,22,3,33,3,45,3,56,3,67,3,79,3,90,3,102,3,114,3,126,3,138,3,150,3,162,3,174,3,186,3,199,3,211,3,224,3,236,3,249,4,6,4,19,4,32,4,45,4,59,4,72,4,85,4,99,4,113,4,126,4,140,4,154,4,168,4,182,4,196,4,211,4,225,4,240,4,254,5,13,5,28,5,43,5,58,5,73,5,88,5,103,5,119,5,134,5,150,5,166,5,181,5,197,5,213,5,229,5,246,6,6,6,22,6,39,6,55,6,72,6,89,6,106,6,123,6,140,6,157,6,175,6,192,6,209,6,227,6,245,7,7,7,25,7,43,7,61,7,79,7,97,7,116,7,134,7,153,7,172,7,191,7,210,7,229,7,248,8,11,8,31,8,50,8,70,8,90,8,110,8,130,8,150,8,170,8,190,8,210,8,231,8,251,9,16,9,37,9,58,9,79,9,100,9,121,9,143,9,164,9,186,9,207,9,229,9,251,10,17,10,39,10,61,10,84,10,106,10,129,10,152,10,174,10,197,10,220,10,243,11,11,11,34,11,57,11,81,11,105,11,128,11,152,11,176,11,200,11,225,11,249,12,18,12,42,12,67,12,92,12,117,12,142,12,167,12,192,12,217,12,243,13,13,13,38,13,64,13,90,13,116,13,142,13,169,13,195,13,222,13,248,14,19,14,46,14,73,14,100,14,127,14,155,14,182,14,210,14,238,15,9,15,37,15,65,15,94,15,122,15,150,15,179,15,207,15,236,16,9,16,38,16,67,16,97,16,126,16,155,16,185,16,215,16,245,17,19,17,49,17,79,17,109,17,140,17,170,17,201,17,232,18,7,18,38,18,69,18,100,18,132,18,163,18,195,18,227,19,3,19,35,19,67,19,99,19,131,19,164,19,197,19,229,20,6,20,39,20,73,20,106,20,139,20,173,20,206,20,240,21,18,21,52,21,86,21,120,21,155,21,189,21,224,22,3,22,38,22,73,22,108,22,143,22,178,22,214,22,250,23,29,23,65,23,101,23,137,23,174,23,210,23,247,24,27,24,64,24,101,24,138,24,175,24,213,24,250,25,32,25,69,25,107,25,145,25,183,25,221,26,4,26,42,26,81,26,119,26,158,26,197,26,236,27,20,27,59,27,99,27,138,27,178,27,218,28,2,28,42,28,82,28,123,28,163,28,204,28,245,29,30,29,71,29,112,29,153,29,195,29,236,30,22,30,64,30,106,30,148,30,190,30,233,31,19,31,62,31,105,31,148,31,191,31,234,32,21,32,65,32,108,32,152,32,196,32,240,33,28,33,72,33,117,33,161,33,206,33,251,34,39,34,85,34,130,34,175,34,221,35,10,35,56,35,102,35,148,35,194,35,240,36,31,36,77,36,124,36,171,36,218,37,9,37,56,37,104,37,151,37,199,37,247,38,39,38,87,38,135,38,183,38,232,39,24,39,73,39,122,39,171,39,220,40,13,40,63,40,113,40,162,40,212,41,6,41,56,41,107,41,157,41,208,42,2,42,53,42,104,42,155,42,207,43,2,43,54,43,105,43,157,43,209,44,5,44,57,44,110,44,162,44,215,45,12,45,65,45,118,45,171,45,225,46,22,46,76,46,130,46,183,46,238,47,36,47,90,47,145,47,199,47,254,48,53,48,108,48,164,48,219,49,18,49,74,49,130,49,186,49,242,50,42,50,99,50,155,50,212,51,13,51,70,51,127,51,184,51,241,52,43,52,101,52,158,52,216,53,19,53,77,53,135,53,194,53,253,54,55,54,114,54,174,54,233,55,36,55,96,55,156,55,215,56,20,56,80,56,140,56,200,57,5,57,66,57,127,57,188,57,249,58,54,58,116,58,178,58,239,59,45,59,107,59,170,59,232,60,39,60,101,60,164,60,227,61,34,61,97,61,161,61,224,62,32,62,96,62,160,62,224,63,33,63,97,63,162,63,226,64,35,64,100,64,166,64,231,65,41,65,106,65,172,65,238,66,48,66,114,66,181,66,247,67,58,67,125,67,192,68,3,68,71,68,138,68,206,69,18,69,85,69,154,69,222,70,34,70,103,70,171,70,240,71,53,71,123,71,192,72,5,72,75,72,145,72,215,73,29,73,99,73,169,73,240,74,55,74,125,74,196,75,12,75,83,75,154,75,226,76,42,76,114,76,186,77,2,77,74,77,147,77,220,78,37,78,110,78,183,79,0,79,73,79,147,79,221,80,39,80,113,80,187,81,6,81,80,81,155,81,230,82,49,82,124,82,199,83,19,83,95,83,170,83,246,84,66,84,143,84,219,85,40,85,117,85,194,86,15,86,92,86,169,86,247,87,68,87,146,87,224,88,47,88,125,88,203,89,26,89,105,89,184,90,7,90,86,90,166,90,245,91,69,91,149,91,229,92,53,92,134,92,214,93,39,93,120,93,201,94,26,94,108,94,189,95,15,95,97,95,179,96,5,96,87,96,170,96,252,97,79,97,162,97,245,98,73,98,156,98,240,99,67,99,151,99,235,100,64,100,148,100,233,101,61,101,146,101,231,102,61,102,146,102,232,103,61,103,147,103,233,104,63,104,150,104,236,105,67,105,154,105,241,106,72,106,159,106,247,107,79,107,167,107,255,108,87,108,175,109,8,109,96,109,185,110,18,110,107,110,196,111,30,111,120,111,209,112,43,112,134,112,224,113,58,113,149,113,240,114,75,114,166,115,1,115,93,115,184,116,20,116,112,116,204,117,40,117,133,117,225,118,62,118,155,118,248,119,86,119,179,120,17,120,110,120,204,121,42,121,137,121,231,122,70,122,165,123,4,123,99,123,194,124,33,124,129,124,225,125,65,125,161,126,1,126,98,126,194,127,35,127,132,127,229,128,71,128,168,129,10,129,107,129,205,130,48,130,146,130,244,131,87,131,186,132,29,132,128,132,227,133,71,133,171,134,14,134,114,134,215,135,59,135,159,136,4,136,105,136,206,137,51,137,153,137,254,138,100,138,202,139,48,139,150,139,252,140,99,140,202,141,49,141,152,141,255,142,102,142,206,143,54,143,158,144,6,144,110,144,214,145,63,145,168,146,17,146,122,146,227,147,77,147,182,148,32,148,138,148,244,149,95,149,201,150,52,150,159,151,10,151,117,151,224,152,76,152,184,153,36,153,144,153,252,154,104,154,213,155,66,155,175,156,28,156,137,156,247,157,100,157,210,158,64,158,174,159,29,159,139,159,250,160,105,160,216,161,71,161,182,162,38,162,150,163,6,163,118,163,230,164,86,164,199,165,56,165,169,166,26,166,139,166,253,167,110,167,224,168,82,168,196,169,55,169,169,170,28,170,143,171,2,171,117,171,233,172,92,172,208,173,68,173,184,174,45,174,161,175,22,175,139,176,0,176,117,176,234,177,96,177,214,178,75,178,194,179,56,179,174,180,37,180,156,181,19,181,138,182,1,182,121,182,240,183,104,183,224,184,89,184,209,185,74,185,194,186,59,186,181,187,46,187,167,188,33,188,155,189,21,189,143,190,10,190,132,190,255,191,122,191,245,192,112,192,236,193,103,193,227,194,95,194,219,195,88,195,212,196,81,196,206,197,75,197,200,198,70,198,195,199,65,199,191,200,61,200,188,201,58,201,185,202,56,202,183,203,54,203,182,204,53,204,181,205,53,205,181,206,54,206,182,207,55,207,184,208,57,208,186,209,60,209,190,210,63,210,193,211,68,211,198,212,73,212,203,213,78,213,209,214,85,214,216,215,92,215,224,216,100,216,232,217,108,217,241,218,118,218,251,219,128,220,5,220,138,221,16,221,150,222,28,222,162,223,41,223,175,224,54,224,189,225,68,225,204,226,83,226,219,227,99,227,235,228,115,228,252,229,132,230,13,230,150,231,31,231,169,232,50,232,188,233,70,233,208,234,91,234,229,235,112,235,251,236,134,237,17,237,156,238,40,238,180,239,64,239,204,240,88,240,229,241,114,241,255,242,140,243,25,243,167,244,52,244,194,245,80,245,222,246,109,246,251,247,138,248,25,248,168,249,56,249,199,250,87,250,231,251,119,252,7,252,152,253,41,253,186,254,75,254,220,255,109,255,255],Wwa.hatchData=["000000FF00000000","1010101010101010","8040201008040201","0102040810204080","101010FF10101010","8142241818244281","8000000008000000","0010000100100001","2200880022008800","2288228822882288","2255885522558855","AA558A55AA55A855","AA55AA55AA55AA55","BB55EE55BB55EE55","DD77DD77DD77DD77","FFDDFF77FFDDFF77","FF7FFFF7FF7FFFF7","FF7FFFFFFFF7FFFF","8844221188442211","1122448811224488","CC663399CC663399","993366CC993366CC","E070381C0E0783C1","C183070E1C3870E0","4040404040404040","00FF000000FF0000","AAAAAAAAAAAAAAAA","FF00FF00FF00FF00","CCCCCCCCCCCCCCCC","FFFF0000FFFF0000","8844221100000000","1122448800000000","F00000000F000000","8080808008080808","0240088004200110","0C8DB130031BD8C0","8403304884033048","00304A8100304A81","0102040818244281","202020FF020202FF","1422518854224588","F0F0F0F0AA55AA55","0100201020000102","AA00800080008000","0020008800020088","8448300C02010103","33FFCCFF33FFCCFF","98F8F877898F8F77","111111FF111111FF","3333CCCC3333CCCC","0F0F0F0FF0F0F0F0","0502058850205088","10387CFE7C381000","0000000000000000"],Wwa.standardFontWidths=null,Wwa.standardFontInfo=null,Wwa._standardFontCharsNames=null,__.c.StiPdfResources=Wwa}{class $wa{padPassword(t){let e=[],i=0;for(;i<t.length;i++)e[i]=t.charCodeAt(i);for(let t=0;t<$wa.paddingString.length;t++)e[i++]=$wa.paddingString[t];let r=[];for(i=0;i<32;i++)r[i]=e[i];return r}computingCryptoValues(t,e,i,r,n){this.securityFlags=4294967232;let a=0,o=(0!=(t&__.c.StiUserAccessPrivileges.PrintDocument)&&(a|=1<<2),0!=(t&__.c.StiUserAccessPrivileges.ModifyContents)&&(a|=1<<3),0!=(t&__.c.StiUserAccessPrivileges.CopyTextAndGraphics)&&(a|=1<<4),0!=(t&__.c.StiUserAccessPrivileges.AddOrModifyTextAnnotations)&&(a|=1<<5),this.securityFlags|=a,null==i&&(i=""),this.passwordOwner=e=null==e?"":e,this.passwordUser=i,this.keyLength=r,this.IDValue=n,!1);if(0<this.passwordOwner.length||0<this.passwordUser.length||t!=__.c.StiUserAccessPrivileges.All){o=!0;let t=this.computingCryptoValues2();t||(o=!1,this.throwEncryptionError(0,"Encryption not work!"))}return o}computingCryptoValues2(){if(this.keyLength==__.c.StiPdfEncryptionKeyLength.Bit128_r4)return this.computingCryptoValuesV4();if(this.keyLength==__.c.StiPdfEncryptionKeyLength.Bit256_r5||this.keyLength==__.c.StiPdfEncryptionKeyLength.Bit256_r6)return this.computingCryptoValuesV5();let t=this.passwordOwner,e=(StiString.isNullOrEmpty(this.passwordOwner)&&(t=this.passwordUser),this.padPassword(t)),r=this.computeHashMD5(e);if(this.keyLength==__.c.StiPdfEncryptionKeyLength.Bit128)for(let t=0;t<50;t++)r=this.computeHashMD5(r);if(this.keyLength==__.c.StiPdfEncryptionKeyLength.Bit40){let t=[];t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],r=t}let i=this.padPassword(this.passwordUser);if(i=this.rc4(i,r),this.keyLength==__.c.StiPdfEncryptionKeyLength.Bit128)for(let e=1;e<=19;e++){for(let t=0;t<16;t++)r[t]^=e-1,r[t]^=e;i=this.rc4(i,r)}i[Stimulsoft.System.StiObject.stimulsoft]().copyTo(this.ownerValue,0);let n=this.passwordUser,a=this.padPassword(n),o=this.getBytesUInt32(this.securityFlags),s=[];if(s.push(...a),s.push(...i),s.push(...o),s.push(...this.IDValue),r=this.computeHashMD5(s),this.keyLength==__.c.StiPdfEncryptionKeyLength.Bit128)for(let t=0;t<50;t++)r=this.computeHashMD5(r);this.encryptionKey=[],this.encryptionKeyLength=this.keyLength==__.c.StiPdfEncryptionKeyLength.Bit128?16:5;for(let t=0;t<this.encryptionKeyLength;t++)this.encryptionKey[t]=r[t];let l=[];if(this.keyLength==__.c.StiPdfEncryptionKeyLength.Bit128){(s=[]).push(...$wa.paddingString),s.push(...this.IDValue),r=this.computeHashMD5(s),r=this.rc4(r,this.encryptionKey);let i=[];for(let e=1;e<=19;e++){for(let t=0;t<16;t++)i[t]=this.encryptionKey[t]^e;r=this.rc4(r,i)}$wa.paddingString[Stimulsoft.System.StiObject.stimulsoft]().copyTo(l,0),r[Stimulsoft.System.StiObject.stimulsoft]().copyTo(l,0)}else $wa.paddingString[Stimulsoft.System.StiObject.stimulsoft]().copyTo(l,0),l=this.rc4(l,this.encryptionKey);return l[Stimulsoft.System.StiObject.stimulsoft]().copyTo(this.userValue,0),!0}computingCryptoValuesV4(){let t=this.passwordOwner,e=(StiString.isNullOrEmpty(this.passwordOwner)&&(t=this.passwordUser),this.padPassword(t)),i=this.computeHashMD5(e);for(let t=0;t<50;t++)i=this.computeHashMD5(i);let r=this.padPassword(this.passwordUser);r=this.rc4(r,i);for(let e=1;e<=19;e++){for(let t=0;t<16;t++)i[t]^=e-1,i[t]^=e;r=this.rc4(r,i)}r[Stimulsoft.System.StiObject.stimulsoft]().copyTo(this.ownerValue,0);let n=this.passwordUser,a=this.padPassword(n),o=this.getBytesUInt32(this.securityFlags),s=[];s.push(...a),s.push(...r),s.push(...o),s.push(...this.IDValue),i=this.computeHashMD5(s);for(let t=0;t<50;t++)i=this.computeHashMD5(i);this.encryptionKey=[],this.encryptionKeyLength=16;for(let t=0;t<this.encryptionKeyLength;t++)this.encryptionKey[t]=i[t];let l=[],m=((s=[]).push(...$wa.paddingString),s.push(...this.IDValue),i=this.computeHashMD5(s),i=this.rc4(i,this.encryptionKey),[]);for(let e=1;e<=19;e++){for(let t=0;t<16;t++)m[t]=this.encryptionKey[t]^e;i=this.rc4(i,m)}return $wa.paddingString[Stimulsoft.System.StiObject.stimulsoft]().copyTo(l,0),i[Stimulsoft.System.StiObject.stimulsoft]().copyTo(l,0),l[Stimulsoft.System.StiObject.stimulsoft]().copyTo(this.userValue,0),!0}computingCryptoValuesV5(){let t=new Stimulsoft.System.Crypt.SecureRandom,e=null,i=null,r=t.createNextBytes(32),n=t.createNextBytes(8),a=t.createNextBytes(8),o=t.createNextBytes(8),s=t.createNextBytes(8),l=Stimulsoft.System.Text.Encoding.UTF8.getBytes(this.passwordUser);if(127<l.length){let t=[];StiArray.copy2(l,0,t,0,127),l=t}(i=this.getHashV5(l,n,null))[Stimulsoft.System.StiObject.stimulsoft]().copyTo(this.userValue,0),n[Stimulsoft.System.StiObject.stimulsoft]().copyTo(this.userValue,32),a[Stimulsoft.System.StiObject.stimulsoft]().copyTo(this.userValue,40),i=this.getHashV5(l,a,null),this.encodeKeyDataV5(i,r,!0)[Stimulsoft.System.StiObject.stimulsoft]().copyTo(this.userExtendedValue,0);let m=this.passwordOwner,h=(StiString.isNullOrEmpty(this.passwordOwner)&&(m=this.passwordUser),Stimulsoft.System.Text.Encoding.UTF8.getBytes(m));if(127<h.length){let t=[];StiArray.copy2(h,0,t,0,127),h=t}return(i=this.getHashV5(h,o,this.userValue))[Stimulsoft.System.StiObject.stimulsoft]().copyTo(this.ownerValue,0),o[Stimulsoft.System.StiObject.stimulsoft]().copyTo(this.ownerValue,32),s[Stimulsoft.System.StiObject.stimulsoft]().copyTo(this.ownerValue,40),i=this.getHashV5(h,s,this.userValue),this.encodeKeyDataV5(i,r,!0)[Stimulsoft.System.StiObject.stimulsoft]().copyTo(this.ownerExtendedValue,0),e=t.createNextBytes(16),this.getBytesUInt32(this.securityFlags)[Stimulsoft.System.StiObject.stimulsoft]().copyTo(e,0),e[4]=255,e[5]=255,e[6]=255,e[7]=255,e[8]=84,e[9]=97,e[10]=100,e[11]=98,this.permsValue=this.encodeKeyDataV5(r,e,!1),i=this.getHashV5(l,a,null),this.encryptionKey=this.decodeKeyDataV5(i,this.userExtendedValue,!0),97==(e=this.decodeKeyDataV5(this.encryptionKey,this.permsValue,!1))[9]&&100==e[10]&&98==e[11]||this.throwEncryptionError(102,"Verifying key calculation failed"),!0}encodeKeyDataV5(i,r,t){let n=null;if(t){let t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=new Stimulsoft.ExternalLibrary.aesjs.ModeOfOperation.cbc(i,t);n=e.encrypt(r)}else{let t=new Stimulsoft.ExternalLibrary.aesjs.ModeOfOperation.ecb(i);n=t.encrypt(r)}let e=[];for(let t=0;t<n.length;t++)e[t]=n[t];return e}decodeKeyDataV5(i,r,t){let n=null;if(t){let t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=new Stimulsoft.ExternalLibrary.aesjs.ModeOfOperation.cbc(i,t);n=e.decrypt(r)}else{let t=new Stimulsoft.ExternalLibrary.aesjs.ModeOfOperation.ecb(i);n=t.decrypt(r)}let e=[];for(let t=0;t<n.length;t++)e[t]=n[t];return e}getHashV5(t,e,i){return this.keyLength==__.c.StiPdfEncryptionKeyLength.Bit256_r5?$wa.calculate_hash_r5(t,e,i):$wa.calculate_hash_r6(t,e,i)}static calculate_hash_r5(t,e,i){let r=[];return r.push(...t),r.push(...e),null!=i&&r.push(...i),Stimulsoft.System.Crypt.SHA2.SHA256(r)}static calculate_hash_r6(r,t,n){let a=[],o=[],s=32,l=0,m=null,h=[],c=[],g=new Stimulsoft.System.Crypt.SHA2;(m=[]).push(...r),m.push(...t),null!=n&&m.push(...n),g.SHA2_256(m)[Stimulsoft.System.StiObject.stimulsoft]().copyTo(o,0);for(let t=0;t<64||t<a[64*l-1]+32;t++){m[Stimulsoft.System.StiObject.stimulsoft]().clear(),m.push(...r);for(let t=0;t<s;t++)m.push(o[t]);l=r.length+s,null!=n&&(m.push(...n),l+=48);for(let t=0;t<64;t++)m[Stimulsoft.System.StiObject.stimulsoft]().copyTo(a,t*l);StiArray.copy2(o,0,h,0,16),StiArray.copy2(o,16,c,0,16);let t=new Stimulsoft.ExternalLibrary.aesjs.ModeOfOperation.cbc(h,c),e=t.encrypt(a.slice(0,64*l));for(let t=0;t<e.length;t++)a[t]=e[t];let i=0;for(let t=0;t<16;t++)i+=a[t];switch(s=32+i%3*16){case 32:g.SHA2_256(a.slice(0,64*l))[Stimulsoft.System.StiObject.stimulsoft]().copyTo(o,0);break;case 48:g.SHA2_384(a.slice(0,64*l))[Stimulsoft.System.StiObject.stimulsoft]().copyTo(o,0);break;case 64:g.SHA2_512(a.slice(0,64*l))[Stimulsoft.System.StiObject.stimulsoft]().copyTo(o,0);break}}let e=[];return StiArray.copy2(o,0,e,0,32),e}encryptData(s,l,m){if(this.keyLength==__.c.StiPdfEncryptionKeyLength.Bit40||this.keyLength==__.c.StiPdfEncryptionKeyLength.Bit128){let t=l,e=m,i=[],r=(this.encryptionKey[Stimulsoft.System.StiObject.stimulsoft]().copyTo(i,0),this.getBytesUInt32(t)[Stimulsoft.System.StiObject.stimulsoft]().copyTo(i,this.encryptionKeyLength),this.getBytesUint16(e)[Stimulsoft.System.StiObject.stimulsoft]().copyTo(i,this.encryptionKeyLength+3),this.computeHashMD5(i));this.keyLength==__.c.StiPdfEncryptionKeyLength.Bit40&&(r=r.slice(0,10)),s=this.rc4(s,r)}else if(this.keyLength==__.c.StiPdfEncryptionKeyLength.Bit128_r4){let t=l,e=m,i=[],r=(this.encryptionKey[Stimulsoft.System.StiObject.stimulsoft]().copyTo(i,0),this.getBytesUInt32(t)[Stimulsoft.System.StiObject.stimulsoft]().copyTo(i,16),this.getBytesUint16(e)[Stimulsoft.System.StiObject.stimulsoft]().copyTo(i,19),i[21]=115,i[22]=65,i[23]=108,i[24]=84,this.computeHashMD5(i)),n=(new Stimulsoft.System.Crypt.SecureRandom).createNextBytes(16),a=[],o=(a.push(...n),a.push(...s),a=new Stimulsoft.ExternalLibrary.aesjs.padding.pkcs7.pad(a),new Stimulsoft.ExternalLibrary.aesjs.ModeOfOperation.cbc(r,n));s=o.encrypt(a)}else{let t=(new Stimulsoft.System.Crypt.SecureRandom).createNextBytes(16),e=[],i=(e.push(...t),e.push(...s),e=new Stimulsoft.ExternalLibrary.aesjs.padding.pkcs7.pad(e),new Stimulsoft.ExternalLibrary.aesjs.ModeOfOperation.cbc(this.encryptionKey,t));s=i.encrypt(e)}return s}throwEncryptionError(t,e){throw new Error(StiString.format("EncryptionError at step {0} : {1}",t,e))}renderEncodeRecord(r,n){let t="",e="",i=32,a=(this.keyLength!=__.c.StiPdfEncryptionKeyLength.Bit256_r5&&this.keyLength!=__.c.StiPdfEncryptionKeyLength.Bit256_r6||(i=48),0);for(a=0;a<i;a++)t+=String.fromCharCode(this.ownerValue[a]),e+=String.fromCharCode(this.userValue[a]);if(r.writeLine("/Filter /Standard"),this.keyLength==__.c.StiPdfEncryptionKeyLength.Bit128)r.writeLine("/CF<</StdCF<</AuthEvent/DocOpen/CFM/V2/Length 16>>>>"),r.writeLine("/StmF /StdCF"),r.writeLine("/StrF /StdCF"),r.writeLine("/R 3"),r.writeLine("/V 2"),r.writeLine("/Length 128");else if(this.keyLength==__.c.StiPdfEncryptionKeyLength.Bit128_r4)r.writeLine("/CF<</StdCF<</AuthEvent/DocOpen/CFM/AESV2/Length 16>>>>"),r.writeLine("/StmF /StdCF"),r.writeLine("/StrF /StdCF"),r.writeLine("/R 4"),r.writeLine("/V 4"),r.writeLine("/Length 128");else if(this.keyLength==__.c.StiPdfEncryptionKeyLength.Bit256_r5||this.keyLength==__.c.StiPdfEncryptionKeyLength.Bit256_r6){r.writeLine("/CF<</StdCF<</AuthEvent/DocOpen/CFM/AESV3/Length 32>>>>"),r.writeLine("/StmF /StdCF"),r.writeLine("/StrF /StdCF"),r.writeLine1("/R {0}",this.keyLength==__.c.StiPdfEncryptionKeyLength.Bit256_r5?5:6),r.writeLine("/V 5"),r.writeLine("/Length 256");let t="",e="";for(a=0;a<32;a++)t+=String.fromCharCode(this.ownerExtendedValue[a]),e+=String.fromCharCode(this.userExtendedValue[a]);let i="";for(a=0;a<16;a++)i+=String.fromCharCode(this.permsValue[a]);n.storeString(StiString.format("/OE ({0})",__.c.StiPdfExportService.convertToEscapeSequencePlusTabs(t))),n.storeString(StiString.format("/UE ({0})",__.c.StiPdfExportService.convertToEscapeSequencePlusTabs(e))),n.storeString(StiString.format("/Perms ({0})",__.c.StiPdfExportService.convertToEscapeSequencePlusTabs(i)))}else r.writeLine("/R 2"),r.writeLine("/V 1"),r.writeLine("/Length 40");n.storeString(StiString.format("/O ({0})",__.c.StiPdfExportService.convertToEscapeSequencePlusTabs(t))),n.storeString(StiString.format("/U ({0})",__.c.StiPdfExportService.convertToEscapeSequencePlusTabs(e))),r.writeLine1("/P {0}",this.securityFlags)}getBytesUInt32(t){let e=[];return e.push(255&t),e.push(t>>8&255),e.push(t>>16&255),e.push(t>>24&255),e}getBytesUint16(t){let e=[];return e.push(255&t),e.push(t>>8&255),e}rc4(e,t){let i=[],r=0,n=0,a,o=[],s=t.length,l=e.length;for(r=0;r<256;r++)i[r]=r;for(r=0;r<256;r++)n=(n+i[r]+t[r%s])%256,a=i[r],i[r]=i[n],i[n]=a;r=0;for(let t=n=0;t<l;t++)r=(r+1)%256,n=(n+i[r])%256,a=i[r],i[r]=i[n],i[n]=a,o.push(e[t]^i[(i[r]+i[n])%256]);return o}computeHashMD5(e){let i="";for(let t=0;t<e.length;t++)i+=String.fromCharCode(e[t]);return Stimulsoft.Base.StiMD5Helper.MD5(i,!1)}constructor(t){this.ownerValue=[],this.userValue=[],this.ownerExtendedValue=[],this.userExtendedValue=[],this.permsValue=[],this.IDValue=null,this.encryptionKey=null,this.encryptionKeyLength=0,this.passwordOwner="",this.passwordUser="",this.securityFlags=0,this.keyLength=__.c.StiPdfEncryptionKeyLength.Bit40,this.pdfService=null,this.pdfService=t}}$wa.paddingString=[40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122],__.c.StiPdfSecurity=$wa}{class Rza{constructor(){this.ref=-1,this.info=null}get isUsed(){return!(-1==this.ref)}addRef(){this.info.addRef(this)}toString(){if(-1==this.ref)return"-";return StiString.format("ref = {0}",this.ref)}}__.c.StiPdfObjInfo=Rza;class Sza extends Rza{}__.c.StiPdfContentObjInfo=Sza;class Tza extends Rza{}__.c.StiPdfXObjectObjInfo=Tza;class Uza extends Rza{}__.c.StiPdfFontObjInfo=Uza;class Vza extends Rza{}__.c.StiPdfOutlinesObjInfo=Vza;class Wza extends Rza{}__.c.StiPdfPatternsObjInfo=Wza;class Xza extends Rza{}__.c.StiPdfAnnotObjInfo=Xza;class Yza{}__.c.StiPdfCheckBoxObjInfo=Yza;class Zza extends Rza{}__.c.StiPdfAcroFormObjInfo=Zza,__.c.StiPdfStructure=class{addRef(t){this.objectsCounter++,t.ref=this.objectsCounter}createObject(t=!1){let e=new Rza;return e.info=this,t&&this.addRef(e),e}createContentObject(t=!1){let e=new Sza;return e.info=this,t&&this.addRef(e),e.content=this.createObject(t),e}createXObject(t=!1,e=!1){let i=new Tza;return i.info=this,t&&this.addRef(i),i.mask=this.createObject(t&&e),i}createFontObject(t=!1,e=!0,i=!1,r=!0,n=!1){let a=new Uza;return a.info=this,t&&this.addRef(a),a.descendantFont=this.createObject(t&&e),a.toUnicode=this.createObject(t&&e),a.cIDSet=this.createObject(t&&e),a.encoding=this.createObject(t&&!e&&!n),a.fontDescriptor=this.createObject(t&&!i),a.fontFile2=this.createObject(t&&r),a}createOutlinesObject(t=!1){let e=new Vza;return e.info=this,t&&this.addRef(e),e.items=[],e}createPatternsObject(t=!1){let e=new Wza;return e.info=this,e.resources=this.createObject(t),e.first=this.createObject(t),e.hatchItems=[],e.shadingItems=[],e.shadingFunctionItems=[],e}createAcroFormObject(t=!1){let e=new Zza;return e.info=this,t&&this.addRef(e),e.annots=[],e.checkBoxes=[],e.unsignedSignatures=[],e.signatures=[],e.tooltips=[],e.annotFontItems=[],e.fontHelvetica=this.createObject(t),e}createAnnotObject(e=!1,t=!1,i=0){let r=new Xza;r.info=this,e&&this.addRef(r),r.aP=this.createObject(e&&t),r.aA=[];for(let t=0;t<i;t++)r.aA.push(this.createObject(e));return r}constructor(){this.objectsCounter=0,this.objects=null,this.objectsCounter=0,this.objects=[],this.root=this.createObject(!0),this.info=this.createObject(!0),this.colorSpace=this.createObject(!0),this.pages=this.createObject(!0),this.structTreeRoot=this.createObject(!0),this.optionalContentGroup=this.createObject(!0),this.pageList=[],this.xObjectList=[],this.fontList=[],this.linkList=[],this.embeddedFilesList=[]}}}{class xAa{static encode(n,a){let o="";for(let r=0;r<n.length;r++){let t=n.charCodeAt(r),e=63,i=this.unicodeToCodePageArray[t];(i==a&&1!=i||0==i)&&(e=this.unicodeToAnsiArray[t]),o+=String.fromCharCode(e)}return o}static StiEncode(){this.codePagesTable=[[1033,1252,1],[1049,1251,204],[1045,1250,238],[1025,1256,178]],this.codePagesDataTable=[[8364,1026,8364,8364,8364,8364,8364,8364,8364],[0,1027,0,0,0,0,1662,0,0],[8218,8218,8218,8218,8218,8218,8218,8218,8218],[402,1107,0,402,402,402,402,0,402],[8222,8222,8222,8222,8222,8222,8222,8222,8222],[8230,8230,8230,8230,8230,8230,8230,8230,8230],[8224,8224,8224,8224,8224,8224,8224,8224,8224],[8225,8225,8225,8225,8225,8225,8225,8225,8225],[710,8364,0,0,710,710,710,0,710],[8240,8240,8240,8240,8240,8240,8240,8240,8240],[352,1033,352,0,352,0,1657,0,0],[8249,8249,8249,8249,8249,8249,8249,8249,8249],[338,1034,346,0,338,0,338,0,338],[0,1036,356,0,0,0,1670,168,0],[381,1035,381,0,0,0,1688,711,0],[0,1039,377,0,0,0,1672,184,0],[0,1106,0,0,0,0,1711,0,0],[8216,8216,8216,8216,8216,8216,8216,8216,8216],[8217,8217,8217,8217,8217,8217,8217,8217,8217],[8220,8220,8220,8220,8220,8220,8220,8220,8220],[8221,8221,8221,8221,8221,8221,8221,8221,8221],[8226,8226,8226,8226,8226,8226,8226,8226,8226],[8211,8211,8211,8211,8211,8211,8211,8211,8211],[8212,8212,8212,8212,8212,8212,8212,8212,8212],[732,0,0,0,732,732,1705,0,732],[8482,8482,8482,8482,8482,8482,8482,8482,8482],[353,1113,353,0,353,0,1681,0,0],[8250,8250,8250,8250,8250,8250,8250,8250,8250],[339,1114,347,0,339,0,339,0,339],[0,1116,357,0,0,0,8204,175,0],[382,1115,382,0,0,0,8205,731,0],[376,1119,378,0,376,0,1722,0,376],[160,160,160,160,160,160,160,160,160],[161,1038,711,901,161,161,1548,0,161],[162,1118,728,902,162,162,162,162,162],[163,1032,321,163,163,163,163,163,163],[164,164,164,164,164,8362,164,164,164],[165,1168,260,165,165,165,165,0,165],[166,166,166,166,166,166,166,166,166],[167,167,167,167,167,167,167,167,167],[168,1025,168,168,168,168,168,216,168],[169,169,169,169,169,169,169,169,169],[170,1028,350,0,170,215,1726,342,170],[171,171,171,171,171,171,171,171,171],[172,172,172,172,172,172,172,172,172],[173,173,173,173,173,173,173,173,173],[174,174,174,174,174,174,174,174,174],[175,1031,379,8213,175,175,175,198,175],[176,176,176,176,176,176,176,176,176],[177,177,177,177,177,177,177,177,177],[178,1030,731,178,178,178,178,178,178],[179,1110,322,179,179,179,179,179,179],[180,1169,180,900,180,180,180,180,180],[181,181,181,181,181,181,181,181,181],[182,182,182,182,182,182,182,182,182],[183,183,183,183,183,183,183,183,183],[184,1105,184,904,184,184,184,248,184],[185,8470,261,905,185,185,185,185,185],[186,1108,351,906,186,247,1563,343,186],[187,187,187,187,187,187,187,187,187],[188,1112,317,908,188,188,188,188,188],[189,1029,733,189,189,189,189,189,189],[190,1109,318,910,190,190,190,190,190],[191,1111,380,911,191,191,1567,230,191],[192,1040,340,912,192,1456,1729,260,192],[193,1041,193,913,193,1457,1569,302,193],[194,1042,194,914,194,1458,1570,256,194],[195,1043,258,915,195,1459,1571,262,258],[196,1044,196,916,196,1460,1572,196,196],[197,1045,313,917,197,1461,1573,197,197],[198,1046,262,918,198,1462,1574,280,198],[199,1047,199,919,199,1463,1575,274,199],[200,1048,268,920,200,1464,1576,268,200],[201,1049,201,921,201,1465,1577,201,201],[202,1050,280,922,202,0,1578,377,202],[203,1051,203,923,203,1467,1579,278,203],[204,1052,282,924,204,1468,1580,290,768],[205,1053,205,925,205,1469,1581,310,205],[206,1054,206,926,206,1470,1582,298,206],[207,1055,270,927,207,1471,1583,315,207],[208,1056,272,928,286,1472,1584,352,272],[209,1057,323,929,209,1473,1585,323,209],[210,1058,327,0,210,1474,1586,325,777],[211,1059,211,931,211,1475,1587,211,211],[212,1060,212,932,212,1520,1588,332,212],[213,1061,336,933,213,1521,1589,213,416],[214,1062,214,934,214,1522,1590,214,214],[215,1063,215,935,215,1523,215,215,215],[216,1064,344,936,216,1524,1591,370,216],[217,1065,366,937,217,0,1592,321,217],[218,1066,218,938,218,0,1593,346,218],[219,1067,368,939,219,0,1594,362,219],[220,1068,220,940,220,0,1600,220,220],[221,1069,221,941,304,0,1601,379,431],[222,1070,354,942,350,0,1602,381,771],[223,1071,223,943,223,0,1603,223,223],[224,1072,341,944,224,1488,224,261,224],[225,1073,225,945,225,1489,1604,303,225],[226,1074,226,946,226,1490,226,257,226],[227,1075,259,947,227,1491,1605,263,259],[228,1076,228,948,228,1492,1606,228,228],[229,1077,314,949,229,1493,1607,229,229],[230,1078,263,950,230,1494,1608,281,230],[231,1079,231,951,231,1495,231,275,231],[232,1080,269,952,232,1496,232,269,232],[233,1081,233,953,233,1497,233,233,233],[234,1082,281,954,234,1498,234,378,234],[235,1083,235,955,235,1499,235,279,235],[236,1084,283,956,236,1500,1609,291,769],[237,1085,237,957,237,1501,1610,311,237],[238,1086,238,958,238,1502,238,299,238],[239,1087,271,959,239,1503,239,316,239],[240,1088,273,960,287,1504,1611,353,273],[241,1089,324,961,241,1505,1612,324,241],[242,1090,328,962,242,1506,1613,326,803],[243,1091,243,963,243,1507,1614,243,243],[244,1092,244,964,244,1508,244,333,244],[245,1093,337,965,245,1509,1615,245,417],[246,1094,246,966,246,1510,1616,246,246],[247,1095,247,967,247,1511,247,247,247],[248,1096,345,968,248,1512,1617,371,248],[249,1097,367,969,249,1513,249,322,249],[250,1098,250,970,250,1514,1618,347,250],[251,1099,369,971,251,0,251,363,251],[252,1100,252,972,252,0,252,252,252],[253,1101,253,973,305,8206,8206,380,432],[254,1102,355,974,351,8207,8207,382,8363],[255,1103,729,0,255,0,1746,729,255]];for(let t=0;t<128;t++)this.unicodeToCodePageArray[t]=0,this.unicodeToAnsiArray[t]=t;for(let t=128;t<65536;t++)this.unicodeToCodePageArray[t]=0,this.unicodeToAnsiArray[t]=63;let t,r="";for(let t=0;t<65536;t++)r+=String.fromCharCode(t);for(let i=this.codePagesTableSize;0<i;i--){let e=(t=Encoding.getEncoding(this.codePagesTable[i-1][1])).getBytes(r);for(let t=128;t<65536;t++)127<e[t]?(this.unicodeToCodePageArray[t]=i,this.unicodeToAnsiArray[t]=e[t]):63!=e[t]&&(0==this.unicodeToCodePageArray[t]||127<this.unicodeToCodePageArray[t])&&(this.unicodeToCodePageArray[t]=i+128,this.unicodeToAnsiArray[t]=e[t])}for(let t=128;t<65536;t++)127<this.unicodeToCodePageArray[t]&&(this.unicodeToCodePageArray[t]-=128);for(let i=this.codePagesCount;0<i;i--)for(let e=0;e<128;e++){let t=this.codePagesDataTable[e][i-1];this.unicodeToCodePageArray[t]=i,this.unicodeToAnsiArray[t]=e+128}for(let t=0;t<10;t++)this.unicodeToCodePageArray[t+1632]=0,this.unicodeToAnsiArray[t+1632]=63,this.unicodeToCodePageArray[t+1776]=0,this.unicodeToAnsiArray[t+1776]=63}}xAa.unicodeToCodePageArray=[],xAa.unicodeToAnsiArray=[],xAa.codePagesCount=9,xAa.codePagesTableSize=4,(__.c.StiEncode=xAa).StiEncode()}{class SAa{static run(r,n){if(void 0===r)return void SAa.run(Stimulsoft,"Stimulsoft");if("Stimulsoft.ExternalLibrary"==n||"Stimulsoft.Blockly"==n||"Stimulsoft.Report.StiOptions"==n||"Stimulsoft.StiOptions"==n)return;n=n.replace("Stimulsoft.System","System");for(let i in r){let t=r[i],e=typeof t;"function"==e?(t.ssTypeName=i,t.ssNamespace=n):"object"==e&&SAa.run(t,n+`.`+i)}}}__.b.StiTypesHelper=SAa}__.b.StiTypesHelper.run();export{Stimulsoft};