js-pkg
Version:
Npm package of Syncfusion.JavaScript.
10 lines • 988 kB
JavaScript
/*!
* filename: ej.documenteditor.min.js
* version : 15.3.0.33
* Copyright Syncfusion Inc. 2001 - 2017. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
(function(n){typeof define=="function"&&define.amd?define(["./../common/ej.core.min","./../common/ej.data.min","./../common/ej.draggable.min","./../common/ej.scroller.min","./../common/ej.globalize.min","./ej.button.min","./ej.checkbox.min","./ej.dialog.min","./ej.dropdownlist.min","./ej.listbox.min","./ej.editor.min","./ej.menu.min","./ej.splitbutton.min","./ej.togglebutton.min","./ej.tab.min","./ej.colorpicker.min"],n):n()})(function(){"use strict";var n=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},t=ej.browserInfo().name=="msie"&&parseInt(ej.browserInfo().version)<9,r=function(r){function u(){r.apply(this,arguments);this.rootCSS="e-documenteditor";this.PluginName="ejDocumentEditor";this._id="null";this.defaults={importExportSettings:{importUrl:"",importHtmlUrl:"",exportUrl:""},isReadOnly:!1,layoutType:0,selection:{characterFormat:{bold:undefined,italic:undefined,fontSize:undefined,underline:undefined,strikeThrough:undefined,baselineAlignment:undefined,highlightColor:undefined,fontColor:undefined,fontFamily:undefined},paragraphFormat:{leftIndent:undefined,rightIndent:undefined,firstLineIndent:undefined,afterSpacing:undefined,beforeSpacing:undefined,lineSpacing:undefined,lineSpacingType:undefined,textAlignment:undefined},tableFormat:{leftIndent:undefined,background:undefined,tableAlignment:undefined,cellSpacing:undefined,leftMargin:undefined,rightMargin:undefined,topMargin:undefined,bottomMargin:undefined,preferredWidth:undefined,preferredWidthType:undefined},cellFormat:{verticalAlignment:undefined,leftMargin:undefined,rightMargin:undefined,topMargin:undefined,bottomMargin:undefined,background:undefined,preferredWidth:undefined,preferredWidthType:undefined},rowFormat:{height:undefined,heightType:undefined,isHeader:undefined,allowRowBreakAcrossPages:undefined},sectionFormat:{headerDistance:undefined,footerDistance:undefined,differentFirstPage:undefined,differentOddAndEvenPages:undefined,pageWidth:undefined,pageHeight:undefined,leftMargin:undefined,topMargin:undefined,rightMargin:undefined,bottomMargin:undefined}},documentChange:null,zoomFactorChange:null,requestNavigate:null,selectionChange:null,contentChange:null};this._documentEditorHelper=null;this.model=this.defaults}return n(u,r),u.prototype._init=function(){t||ej.isNullOrUndefined(this.element)||(this._documentEditorHelper=new i.DocumentEditorHelper(this,ej),this._documentEditorHelper.Document=this._createEmptyDocument(),this._documentEditorHelper.IsReadOnly=this.model.isReadOnly)},u.prototype._destroy=function(){t||(window.removeEventListener("resize",this._documentEditorHelper.Viewer.windowResizeHandler),window.removeEventListener("mousedown",this._documentEditorHelper.Viewer.windowMouseDownHandler),window.removeEventListener("keyup",this._documentEditorHelper.Viewer.windowKeyUpHandler))},u.prototype._setModel=function(n){if(t||this._documentEditorHelper!=undefined||this._documentEditorHelper!=null){var r,i;for(r in n){i=n[r];switch(r){case"isReadOnly":this._documentEditorHelper.IsReadOnly=i;break;case"layoutType":this._documentEditorHelper.LayoutType=i;break;case"selection":this._setSelection(i)}}}},u.prototype._setSelection=function(n){if(!this._documentEditorHelper.IsReadOnlyMode&&this._documentEditorHelper.IsDocumentLoaded){var i,t;for(i in n){t=n[i];switch(i){case"characterFormat":this._setCharacterFormat(t);break;case"paragraphFormat":this._setParagraphFormat(t);break;case"tableFormat":this._setTableFormat(t);break;case"cellFormat":this._setCellFormat(t);break;case"rowFormat":this._setRowFormat(t);break;case"sectionFormat":this._setSectionFormat(t)}}}},u.prototype._setCharacterFormat=function(n){var i,t;for(i in n){t=n[i];switch(i){case"bold":t!=null&&t!=undefined&&(t==!0||t==!1)&&(this._documentEditorHelper.Selection.CharacterFormat.Bold=t);break;case"italic":t!=null&&t!=undefined&&(t==!0||t==!1)&&(this._documentEditorHelper.Selection.CharacterFormat.Italic=t);break;case"fontSize":t!=null&&t!=undefined&&(this._documentEditorHelper.Selection.CharacterFormat.FontSize=t);break;case"underline":t!=null&&t!=undefined&&(this._documentEditorHelper.Selection.CharacterFormat.Underline=t);break;case"strikeThrough":t!=null&&t!=undefined&&(this._documentEditorHelper.Selection.CharacterFormat.StrikeThrough=t);break;case"baselineAlignment":t!=null&&t!=undefined&&(this._documentEditorHelper.Selection.CharacterFormat.BaselineAlignment=t);break;case"highlightColor":t!=null&&t!=undefined&&(this._documentEditorHelper.Selection.CharacterFormat.HighlightColor=t);break;case"fontColor":t!=null&&t!=undefined&&(this._documentEditorHelper.Selection.CharacterFormat.FontColor=t);break;case"fontFamily":t!=null&&t!=undefined&&(this._documentEditorHelper.Selection.CharacterFormat.FontFamily=t)}}},u.prototype._setParagraphFormat=function(n){var i,t;for(i in n){t=n[i];switch(i){case"firstLineIndent":t!=null&&t!=undefined&&(this._documentEditorHelper.Selection.ParagraphFormat.FirstLineIndent=t);break;case"afterSpacing":t!=null&&t!=undefined&&(this._documentEditorHelper.Selection.ParagraphFormat.AfterSpacing=t);break;case"beforeSpacing":t!=null&&t!=undefined&&(this._documentEditorHelper.Selection.ParagraphFormat.BeforeSpacing=t);break;case"lineSpacing":t!=null&&t!=undefined&&(this._documentEditorHelper.Selection.ParagraphFormat.LineSpacing=t);break;case"lineSpacingType":t!=null&&t!=undefined&&(this._documentEditorHelper.Selection.ParagraphFormat.LineSpacingType=t);break;case"textAlignment":t!=null&&t!=undefined&&(this._documentEditorHelper.Selection.ParagraphFormat.TextAlignment=t)}}},u.prototype._setTableFormat=function(n){if(this._documentEditorHelper.Selection.EditingContext.Type==ej.DocumentEditor.EditingContextType.Table){var i,t;for(i in n){t=n[i];switch(i){case"background":this._documentEditorHelper.Selection.TableFormat.Background=t;break;case"bottomMargin":this._documentEditorHelper.Selection.TableFormat.BottomMargin=t;break;case"cellSpacing":this._documentEditorHelper.Selection.TableFormat.CellSpacing=t;break;case"leftIndent":this._documentEditorHelper.Selection.TableFormat.LeftIndent=t;break;case"leftMargin":this._documentEditorHelper.Selection.TableFormat.LeftMargin=t;break;case"preferredWidth":this._documentEditorHelper.Selection.TableFormat.PreferredWidth=t;break;case"preferredWidthType":this._documentEditorHelper.Selection.TableFormat.PreferredWidthType=t;break;case"rightMargin":this._documentEditorHelper.Selection.TableFormat.RightMargin=t;break;case"tableAlignment":this._documentEditorHelper.Selection.TableFormat.TableAlignment=t;break;case"topMargin":this._documentEditorHelper.Selection.TableFormat.TopMargin=t}}}},u.prototype._setCellFormat=function(n){if(this._documentEditorHelper.Selection.EditingContext.Type==ej.DocumentEditor.EditingContextType.Table){var i,t;for(i in n){t=n[i];switch(i){case"background":this._documentEditorHelper.Selection.CellFormat.Background=t;break;case"bottomMargin":this._documentEditorHelper.Selection.CellFormat.BottomMargin=t;break;case"leftMargin":this._documentEditorHelper.Selection.CellFormat.LeftMargin=t;break;case"preferredWidth":this._documentEditorHelper.Selection.CellFormat.PreferredWidth=t;break;case"preferredWidthType":this._documentEditorHelper.Selection.CellFormat.PreferredWidthType=t;break;case"rightMargin":this._documentEditorHelper.Selection.CellFormat.RightMargin=t;break;case"topMargin":this._documentEditorHelper.Selection.CellFormat.TopMargin=t;break;case"verticalAlignment":this._documentEditorHelper.Selection.CellFormat.VerticalAlignment=t}}}},u.prototype._setRowFormat=function(n){if(this._documentEditorHelper.Selection.EditingContext.Type==ej.DocumentEditor.EditingContextType.Table){var i,t;for(i in n){t=n[i];switch(i){case"allowRowBreakAcrossPages":this._documentEditorHelper.Selection.RowFormat.AllowBreakAcrossPages=t;break;case"height":this._documentEditorHelper.Selection.RowFormat.Height=t;break;case"heightType":this._documentEditorHelper.Selection.RowFormat.HeightType=t;break;case"isHeader":this._documentEditorHelper.Selection.RowFormat.IsHeader=t}}}},u.prototype._setSectionFormat=function(n){var i,t;for(i in n){t=n[i];switch(i){case"bottomMargin":this._documentEditorHelper.Selection.SectionFormat.BottomMargin=t;break;case"differentFirstPage":this._documentEditorHelper.Selection.SectionFormat.DifferentFirstPage=t;break;case"footerDistance":this._documentEditorHelper.Selection.SectionFormat.FooterDistance=t;break;case"headerDistance":this._documentEditorHelper.Selection.SectionFormat.HeaderDistance=t;break;case"leftMargin":this._documentEditorHelper.Selection.SectionFormat.LeftMargin=t;break;case"pageHeight":this._documentEditorHelper.Selection.SectionFormat.PageHeight=t;break;case"pageWidth":this._documentEditorHelper.Selection.SectionFormat.PageWidth=t;break;case"rightMargin":this._documentEditorHelper.Selection.SectionFormat.RightMargin=t;break;case"topMargin":this._documentEditorHelper.Selection.SectionFormat.TopMargin=t;break;case"differentOddAndEvenPages":this._documentEditorHelper.Selection.SectionFormat.DifferentOddAndEvenPages=t}}},u.prototype._createEmptyDocument=function(){var n=new i.DocumentAdv(null),t=new i.SectionAdv(null),r=new i.ParagraphAdv(null);return t.Blocks.push(r),n.Sections.push(t),n},u.prototype._loadDocument=function(n){this._documentEditorHelper._ParseDocument(n)},u.prototype._raiseClientEvent=function(n,t){var f=null,r,u,e;if(t===null||(f=t),n=="documentChange")r="";else if(n=="selectionChange")r="",this._copySelectionFormats();else if(n=="zoomFactorChange")r="";else if(n=="requestNavigate"){u="";switch(f.Hyperlink.LinkType){case i.HyperlinkType.Bookmark:u="bookmark";break;case i.HyperlinkType.Email:u="email";break;case i.HyperlinkType.File:u="file";break;default:u="webpage"}e={navigationLink:f.Hyperlink.navigationLink,linkType:u};r={hyperlink:e}}else n=="contentChange"&&(r="");this._trigger(n,r)},u.prototype._copySelectionFormats=function(){this.model.selection.characterFormat.bold=this._documentEditorHelper.Selection.CharacterFormat.Bold;this.model.selection.characterFormat.italic=this._documentEditorHelper.Selection.CharacterFormat.Italic;this.model.selection.characterFormat.fontSize=this._documentEditorHelper.Selection.CharacterFormat.FontSize;this.model.selection.characterFormat.underline=this._documentEditorHelper.Selection.CharacterFormat.Underline;this.model.selection.characterFormat.baselineAlignment=this._documentEditorHelper.Selection.CharacterFormat.BaselineAlignment;this.model.selection.characterFormat.strikeThrough=this._documentEditorHelper.Selection.CharacterFormat.StrikeThrough;this.model.selection.characterFormat.highlightColor=this._documentEditorHelper.Selection.CharacterFormat.HighlightColor;this.model.selection.characterFormat.fontFamily=this._documentEditorHelper.Selection.CharacterFormat.FontFamily;this.model.selection.characterFormat.fontColor=this._documentEditorHelper.Selection.CharacterFormat.FontColor;this.model.selection.paragraphFormat.afterSpacing=this._documentEditorHelper.Selection.ParagraphFormat.AfterSpacing;this.model.selection.paragraphFormat.beforeSpacing=this._documentEditorHelper.Selection.ParagraphFormat.BeforeSpacing;this.model.selection.paragraphFormat.leftIndent=this._documentEditorHelper.Selection.ParagraphFormat.LeftIndent;this.model.selection.paragraphFormat.rightIndent=this._documentEditorHelper.Selection.ParagraphFormat.RightIndent;this.model.selection.paragraphFormat.firstLineIndent=this._documentEditorHelper.Selection.ParagraphFormat.FirstLineIndent;this.model.selection.paragraphFormat.lineSpacing=this._documentEditorHelper.Selection.ParagraphFormat.LineSpacing;this.model.selection.paragraphFormat.lineSpacingType=this._documentEditorHelper.Selection.ParagraphFormat.LineSpacingType;this.model.selection.paragraphFormat.textAlignment=this._documentEditorHelper.Selection.ParagraphFormat.TextAlignment;this.model.selection.tableFormat.background=this._documentEditorHelper.Selection.TableFormat.Background;this.model.selection.tableFormat.bottomMargin=this._documentEditorHelper.Selection.TableFormat.BottomMargin;this.model.selection.tableFormat.cellSpacing=this._documentEditorHelper.Selection.TableFormat.CellSpacing;this.model.selection.tableFormat.leftIndent=this._documentEditorHelper.Selection.TableFormat.LeftIndent;this.model.selection.tableFormat.leftMargin=this._documentEditorHelper.Selection.TableFormat.LeftMargin;this.model.selection.tableFormat.preferredWidth=this._documentEditorHelper.Selection.TableFormat.PreferredWidth;this.model.selection.tableFormat.preferredWidthType=this._documentEditorHelper.Selection.TableFormat.PreferredWidthType;this.model.selection.tableFormat.rightMargin=this._documentEditorHelper.Selection.TableFormat.RightMargin;this.model.selection.tableFormat.tableAlignment=this._documentEditorHelper.Selection.TableFormat.TableAlignment;this.model.selection.tableFormat.topMargin=this._documentEditorHelper.Selection.TableFormat.TopMargin;this.model.selection.cellFormat.background=this._documentEditorHelper.Selection.CellFormat.Background;this.model.selection.cellFormat.bottomMargin=this._documentEditorHelper.Selection.CellFormat.BottomMargin;this.model.selection.cellFormat.leftMargin=this._documentEditorHelper.Selection.CellFormat.LeftMargin;this.model.selection.cellFormat.preferredWidth=this._documentEditorHelper.Selection.CellFormat.PreferredWidth;this.model.selection.cellFormat.preferredWidthType=this._documentEditorHelper.Selection.CellFormat.PreferredWidthType;this.model.selection.cellFormat.rightMargin=this._documentEditorHelper.Selection.CellFormat.RightMargin;this.model.selection.cellFormat.topMargin=this._documentEditorHelper.Selection.CellFormat.TopMargin;this.model.selection.cellFormat.verticalAlignment=this._documentEditorHelper.Selection.CellFormat.VerticalAlignment;this.model.selection.rowFormat.allowRowBreakAcrossPages=this._documentEditorHelper.Selection.RowFormat.AllowBreakAcrossPages;this.model.selection.rowFormat.height=this._documentEditorHelper.Selection.RowFormat.Height;this.model.selection.rowFormat.heightType=this._documentEditorHelper.Selection.RowFormat.HeightType;this.model.selection.rowFormat.isHeader=this._documentEditorHelper.Selection.RowFormat.IsHeader;this.model.selection.sectionFormat.bottomMargin=this._documentEditorHelper.Selection.SectionFormat.BottomMargin;this.model.selection.sectionFormat.differentFirstPage=this._documentEditorHelper.Selection.SectionFormat.DifferentFirstPage;this.model.selection.sectionFormat.differentOddAndEvenPages=this._documentEditorHelper.Selection.SectionFormat.DifferentOddAndEvenPages;this.model.selection.sectionFormat.footerDistance=this._documentEditorHelper.Selection.SectionFormat.FooterDistance;this.model.selection.sectionFormat.headerDistance=this._documentEditorHelper.Selection.SectionFormat.HeaderDistance;this.model.selection.sectionFormat.leftMargin=this._documentEditorHelper.Selection.SectionFormat.LeftMargin;this.model.selection.sectionFormat.pageHeight=this._documentEditorHelper.Selection.SectionFormat.PageHeight;this.model.selection.sectionFormat.pageWidth=this._documentEditorHelper.Selection.SectionFormat.PageWidth;this.model.selection.sectionFormat.rightMargin=this._documentEditorHelper.Selection.SectionFormat.RightMargin;this.model.selection.sectionFormat.topMargin=this._documentEditorHelper.Selection.SectionFormat.TopMargin},u.prototype._getExportProperties=function(){var t=this._documentEditorHelper.Document,n={BackgroundColor:[],CharacterFormat:[],ParagraphFormat:[],Sections:[],AbstractLists:[],Lists:[]},i,r,u;return n.BackgroundColor=t._SerializeBackgroundColor(),n.CharacterFormat=t.CharacterFormat._SerializeCharacterFormat(),n.ParagraphFormat=t.ParagraphFormat._SerializeParagraphFormat(),i=t._SerializeDocument(),n.Sections=i.Sections,r=t._SerializeAbstractList(),n.AbstractLists=r,u=t._SerializeList(),n.Lists=u,{data:JSON.stringify(n)}},u.prototype._getExtension=function(n){switch(n){case ej.DocumentEditor.FormatType.Docx:return"docx";case ej.DocumentEditor.FormatType.Doc:return"doc";case ej.DocumentEditor.FormatType.Rtf:return"rtf";case ej.DocumentEditor.FormatType.Txt:return"txt";case ej.DocumentEditor.FormatType.Html:return"html";case ej.DocumentEditor.FormatType.WordML:return"xml"}return"docx"},u.prototype.newDocument=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||(this._documentEditorHelper.Document=this._createEmptyDocument())},u.prototype.load=function(n){var r,i;t||(r=this,this._documentEditorHelper._InitDocumentLoad(),i=null,ej.browserInfo().name=="msie"&&parseInt(ej.browserInfo().version)==9?i="":(i=new FormData,i.append("files",n)),$.ajax({type:"POST",async:!0,processData:!1,contentType:!1,crossDomain:!0,data:i,url:this.model.importExportSettings.importUrl,dataType:"JSON",success:function(n){r._loadDocument(n)}}))},u.prototype.save=function(n,i){if(!t&&this._documentEditorHelper!=null&&this._documentEditorHelper!=undefined){var h=this.model.importExportSettings,e,r,u,f,o,s;o=this.model.importExportSettings.exportUrl;e={action:o,method:"post"};r=ej.buildTag("form","",null,e);s=this._getExportProperties();u={name:"DocumentData",type:"hidden",value:s.data};f=ej.buildTag("input","",null,u);r.append(f);u={name:"FileName",type:"hidden",value:n};f=ej.buildTag("input","",null,u);r.append(f);u={name:"Format",type:"hidden",value:this._getExtension(i)};f=ej.buildTag("input","",null,u);r.append(f);$("body").append(r);r.submit()}},u.prototype.print=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper._Print()},u.prototype.cut=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.IsReadOnlyMode||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.Selection==null||this._documentEditorHelper.Selection.IsCleared||this._documentEditorHelper.Selection.IsEmpty||this._documentEditorHelper.Selection._Cut()},u.prototype.copy=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.Selection==null||this._documentEditorHelper.Selection.IsCleared||this._documentEditorHelper.Selection.IsEmpty||this._documentEditorHelper.Selection._Copy()},u.prototype.paste=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.Selection==null||this._documentEditorHelper.isReadOnly||!this._documentEditorHelper.Selection.CanPaste||this._documentEditorHelper.Selection._PasteInternal()},u.prototype.canPaste=function(){return t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.Selection==null||this._documentEditorHelper.isReadOnly?!1:this._documentEditorHelper.Selection.CanPaste},u.prototype.setTimeoutForClipboardPaste=function(n){!t&&typeof n=="number"&&n>0&&this._documentEditorHelper!=null&&this._documentEditorHelper!=undefined&&(this._documentEditorHelper._pasteTimeOut=n*1e3)},u.prototype.canUndo=function(){return t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.History==null||this._documentEditorHelper.History==undefined?!1:this._documentEditorHelper.History.CanUndo},u.prototype.canRedo=function(){return t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.History==null||this._documentEditorHelper.History==undefined?!1:this._documentEditorHelper.History.CanRedo},u.prototype.undo=function(){this.canUndo()&&this._documentEditorHelper.history._Undo()},u.prototype.redo=function(){this.canRedo()&&this._documentEditorHelper.History._Redo()},u.prototype.toggleBold=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.isReadOnly||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.Selection._OnBold()},u.prototype.toggleItalic=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.isReadOnly||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.Selection._OnItalic()},u.prototype.toggleUnderline=function(n){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.isReadOnly||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.Selection._ToggleUnderline(n)},u.prototype.increaseIndent=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.isReadOnly||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.Selection._OnLeftIndentInternal(this._documentEditorHelper.Document.DefaultTabWidth,!0)},u.prototype.decreaseIndent=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.isReadOnly||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.Selection._OnLeftIndentInternal(-this._documentEditorHelper.Document.DefaultTabWidth,!0)},u.prototype.applyBullet=function(n,i){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.IsReadOnly||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.Selection._ApplyBullet(n,i)},u.prototype.applyNumbering=function(n,i){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.IsReadOnly||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.Selection._ApplyNumbering(n,i)},u.prototype.getEditingContextType=function(){return t||this._documentEditorHelper==null||this._documentEditorHelper==undefined?ej.DocumentEditor.EditingContextType.Text:this._documentEditorHelper.Selection.EditingContext.Type},u.prototype.getStart=function(){return t||this._documentEditorHelper==null||this._documentEditorHelper==undefined?"0;0;0":this._documentEditorHelper.Selection._GetStart()},u.prototype.getEnd=function(){return t||this._documentEditorHelper==null||this._documentEditorHelper==undefined?"0;0;0":this._documentEditorHelper.Selection._GetEnd()},u.prototype.getDocumentStart=function(){return t||this._documentEditorHelper==null||this._documentEditorHelper==undefined?"0;0;0":this._documentEditorHelper._GetDocumentStart()},u.prototype.getDocumentEnd=function(){return t||this._documentEditorHelper==null||this._documentEditorHelper==undefined?"0;0;1":this._documentEditorHelper._GetDocumentEnd()},u.prototype.select=function(n,i){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.Selection._SelectPositionBy(n,i)},u.prototype.insertText=function(n){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.isReadOnly||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper._InsertText(n)},u.prototype.insertImage=function(n,i,r){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.isReadOnly||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper._InsertPicture(n,i,r)},u.prototype.insertTable=function(n,i){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.isReadOnly||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.Selection==null||this._documentEditorHelper.Selection.IsCleared||this._documentEditorHelper._InsertTableInBlocks(n,i)},u.prototype.insertRow=function(n){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.isReadOnly||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.Selection==null||this._documentEditorHelper.Selection.IsCleared||this._documentEditorHelper.Selection.EditingContext.Type!=ej.DocumentEditor.EditingContextType.Table||this._documentEditorHelper._InsertRowInTable(n)},u.prototype.insertColumn=function(n){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.isReadOnly||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.Selection==null||this._documentEditorHelper.Selection.IsCleared||this._documentEditorHelper.Selection.EditingContext.Type!=ej.DocumentEditor.EditingContextType.Table||this._documentEditorHelper._InsertColumnInTable(n)},u.prototype.deleteTable=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.isReadOnly||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.Selection!=null&&!this._documentEditorHelper.Selection.IsCleared&&this._documentEditorHelper.Selection.Start!=null&&this._documentEditorHelper.Selection.Start.Paragraph!=null&&this._documentEditorHelper.Selection.Start.Paragraph.IsInsideTable&&this._documentEditorHelper._DeleteTableFromBlocks()},u.prototype.deleteRow=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.isReadOnly||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.Selection!=null&&!this._documentEditorHelper.Selection.IsCleared&&this._documentEditorHelper.Selection.Start!=null&&this._documentEditorHelper.Selection.Start.Paragraph!=null&&this._documentEditorHelper.Selection.Start.Paragraph.IsInsideTable&&this._documentEditorHelper._DeleteRowFromTable()},u.prototype.deleteColumn=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.isReadOnly||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.Selection==null||this._documentEditorHelper.Selection.IsCleared||this._documentEditorHelper._DeleteColumnFromTable()},u.prototype.isSelectionInComment=function(){return t||this._documentEditorHelper==null||this._documentEditorHelper==undefined?!1:this._documentEditorHelper.Selection._IsInComment()},u.prototype.getCommentsCount=function(){return t||this._documentEditorHelper==null||this._documentEditorHelper==undefined?0:this._documentEditorHelper.Document.Comments.Count},u.prototype.addComment=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.IsReadOnly||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.isReadOnly||this._documentEditorHelper.LayoutType!=ej.DocumentEditor.LayoutType.Pages||this._documentEditorHelper.Selection==null||this._documentEditorHelper.Selection.IsCleared||this._documentEditorHelper.Selection._IsInComment()||this._documentEditorHelper._InsertComment()},u.prototype.deleteComment=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.IsReadOnly||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.isReadOnly||this._documentEditorHelper.Selection==null||this._documentEditorHelper.Selection.IsCleared||!this._documentEditorHelper.Selection._IsInComment()||this._documentEditorHelper._DeleteComment()},u.prototype.deleteAllComments=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.IsReadOnly||!this._documentEditorHelper.IsDocumentLoaded||!this._documentEditorHelper.isReadOnly&&this._documentEditorHelper.Selection!=null&&!this._documentEditorHelper.Selection.IsCleared&&this._documentEditorHelper.Document!=null&&this._documentEditorHelper.Document.Comments.Count>0&&this._documentEditorHelper._DeleteAllComments()},u.prototype.navigateToNextComment=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.IsReadOnly||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.Selection!=null&&!this._documentEditorHelper.Selection.IsCleared&&this._documentEditorHelper.Selection._IsInComment()&&this._documentEditorHelper._NavigateNextComment()},u.prototype.navigateToPreviousComment=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.IsReadOnly||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.Selection!=null&&!this._documentEditorHelper.Selection.IsCleared&&this._documentEditorHelper.Selection._IsInComment()&&this._documentEditorHelper._NavigatePreviousComment()},u.prototype.getSelectedText=function(){if(!t&&this._documentEditorHelper!=null&&this._documentEditorHelper!=undefined)return this._documentEditorHelper.Selection.Text},u.prototype.find=function(n,i){return t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||!this._documentEditorHelper.IsDocumentLoaded?!1:((i==null||i==undefined)&&(i=ej.DocumentEditor.FindOptions.None),n!=undefined&&n!=null&&n!="")?this._documentEditorHelper._Find(n.toString(),i):!1},u.prototype.findAll=function(n,i){if(!t&&this._documentEditorHelper!=null&&this._documentEditorHelper!=undefined&&this._documentEditorHelper.IsDocumentLoaded)return(i==null||i==undefined)&&(i=ej.DocumentEditor.FindOptions.None),this._documentEditorHelper.Viewer._ClearSearchHighlight(),n!=undefined&&n!=null&&n!=""?this._documentEditorHelper._FindAll(n.toString(),i):this._documentEditorHelper.textSearchResults!=null&&this._documentEditorHelper.textSearchResults.Count>0&&this._documentEditorHelper.textSearchResults._ClearResults(),this._documentEditorHelper.textSearchResults!=null&&this._documentEditorHelper.textSearchResults.Count>0?this._documentEditorHelper.textSearchResults.Count:0},u.prototype.replace=function(n,i,r){return t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.IsReadOnly||!this._documentEditorHelper.IsDocumentLoaded?!1:((i==null||i==undefined)&&(i=ej.DocumentEditor.FindOptions.None),this._documentEditorHelper._Replace(n,i,r))},u.prototype.replaceAll=function(n,i,r){return t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.IsReadOnly||!this._documentEditorHelper.IsDocumentLoaded?0:((i==null||i==undefined)&&(i=ej.DocumentEditor.FindOptions.None),this._documentEditorHelper._ReplaceAll(n,i,r))},u.prototype._navigateNextTextSearchResult=function(){if(!t&&this._documentEditorHelper!=null&&this._documentEditorHelper!=undefined&&this._documentEditorHelper.IsDocumentLoaded)return this._documentEditorHelper.textSearchResults!=null&&this._documentEditorHelper.textSearchResults.Count>0?(this._documentEditorHelper.textSearchResults.CurrentIndex<this._documentEditorHelper.textSearchResults.Count-1?this._documentEditorHelper.textSearchResults.CurrentIndex++:this._documentEditorHelper.textSearchResults.CurrentIndex=0,this._documentEditorHelper.textSearchResults.CurrentSearchResult._Navigate(),{count:this._documentEditorHelper.textSearchResults.Count,currentIndex:this._documentEditorHelper.textSearchResults.CurrentIndex+1}):{count:0,currentIndex:-1}},u.prototype._navigatePreviousTextSearchResult=function(){if(!t&&this._documentEditorHelper!=null&&this._documentEditorHelper!=undefined&&this._documentEditorHelper.IsDocumentLoaded)return this._documentEditorHelper.textSearchResults!=null&&this._documentEditorHelper.textSearchResults.Count>0?(this._documentEditorHelper.textSearchResults.CurrentIndex>0?this._documentEditorHelper.textSearchResults.CurrentIndex--:this._documentEditorHelper.textSearchResults.CurrentIndex=this._documentEditorHelper.textSearchResults.Count-1,this._documentEditorHelper.textSearchResults.CurrentSearchResult._Navigate(),{count:this._documentEditorHelper.textSearchResults.Count,currentIndex:this._documentEditorHelper.textSearchResults.CurrentIndex+1}):{count:0,currentIndex:-1}},u.prototype.showOptionsPane=function(){!t&&this._documentEditorHelper!=null&&this._documentEditorHelper!=undefined&&this._documentEditorHelper.IsDocumentLoaded&&this._documentEditorHelper.Viewer!=null&&this._documentEditorHelper.Viewer!=undefined&&this._documentEditorHelper.Viewer._ShowHideOptionsPane(!0)},u.prototype.showHyperlinkDialog=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.IsReadOnlyMode||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.Selection==null||this._documentEditorHelper.Selection.IsCleared||this._documentEditorHelper.Selection.Start.Paragraph==null||this._documentEditorHelper.Selection.End.Paragraph==null||this._documentEditorHelper.Selection.Start.Paragraph.AssociatedCell!=this._documentEditorHelper.Selection.End.Paragraph.AssociatedCell||this._documentEditorHelper.Selection.SelectionRanges.Count!=1||this._documentEditorHelper.Viewer._ShowHyperlinkDialog()},u.prototype.showFindAndReplaceDialog=function(n){!t&&this._documentEditorHelper!=null&&this._documentEditorHelper!=undefined&&this._documentEditorHelper.IsDocumentLoaded&&(n&&this._documentEditorHelper.IsReadOnlyMode||this._documentEditorHelper.Viewer._ShowFindAndReplaceDialog(n))},u.prototype.showFontDialog=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.IsReadOnlyMode||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.Viewer._ShowFontDialog()},u.prototype.showParagraphDialog=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.IsReadOnlyMode||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.Viewer._ShowParagraphDialog()},u.prototype.showInsertTableDialog=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.IsReadOnlyMode||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.Selection==null||this._documentEditorHelper.Selection.IsCleared||this._documentEditorHelper.Viewer._ShowTableDialog()},u.prototype.showTablePropertiesDialog=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.IsReadOnlyMode||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.Selection==null||this._documentEditorHelper.Selection.IsCleared||this._documentEditorHelper.Selection.EditingContext.Type!=ej.DocumentEditor.EditingContextType.Table||this._documentEditorHelper.Viewer._ShowTablePropertiesDialog()},u.prototype.showCellMarginsDialog=function(){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper.IsReadOnlyMode||!this._documentEditorHelper.IsDocumentLoaded||this._documentEditorHelper.Selection==null||this._documentEditorHelper.Selection.IsCleared||this._documentEditorHelper.Selection.EditingContext.Type!=ej.DocumentEditor.EditingContextType.Table||this._documentEditorHelper.Viewer._ShowCellMarginsDialog()},u.prototype.getCurrentPageNumber=function(){return t||!this._documentEditorHelper.IsDocumentLoaded?1:this._documentEditorHelper.CurrentPageNumber},u.prototype.getPageCount=function(){return t||!this._documentEditorHelper.IsDocumentLoaded?1:this._documentEditorHelper.PageCount},u.prototype.getZoomFactor=function(){return t?1:this._documentEditorHelper.ZoomFactor},u.prototype.setZoomFactor=function(n){t||(this._documentEditorHelper.ZoomFactor=n)},u.prototype.fitPage=function(n){t||this._documentEditorHelper==null||this._documentEditorHelper==undefined||this._documentEditorHelper._FitPage(n)},u}(ej.WidgetBase),i;ej.widget("ejDocumentEditor","ej.DocumentEditor",new r);ej.DocumentEditor.LayoutType={Pages:0,Continuous:1};ej.DocumentEditor.FormatType={Doc:0,Docx:1,Html:2,Rtf:3,Txt:4,WordML:5};ej.DocumentEditor.EditingContextType={Text:0,Table:1};ej.DocumentEditor.PageFitType={None:0,FitFullPage:1,FitMultiplePages:2,FitPageWidth:3};ej.DocumentEditor.StrikeThrough={None:0,SingleStrike:1,DoubleStrike:2};ej.DocumentEditor.BaselineAlignment={Normal:0,Superscript:1,Subscript:2};ej.DocumentEditor.Underline={None:0,Single:1,Words:2,Double:3,Dotted:4,Thick:6,Dash:7,DashLong:39,DotDash:9,DotDotDash:10,Wavy:11,DottedHeavy:20,DashHeavy:23,DashLongHeavy:55,DotDashHeavy:25,DotDotDashHeavy:26,WavyHeavy:27,WavyDouble:43};ej.DocumentEditor.HighlightColor={NoColor:0,Yellow:1,BrightGreen:2,Turquoise:3,Pink:4,Blue:5,Red:6,DarkBlue:7,Teal:8,Green:9,Violet:10,DarkRed:11,DarkYellow:12,Gray50:13,Gray25:14,Black:15};ej.DocumentEditor.LineSpacingType={AtLeast:0,Exactly:1,Multiple:2};ej.DocumentEditor.TextAlignment={Center:0,Left:1,Right:2,Justify:3};ej.DocumentEditor.FindOptions={None:0,WholeWord:1,CaseSensitive:2,CaseSensitiveWholeWord:3};ej.DocumentEditor.RowPlacement={Above:0,Below:1};ej.DocumentEditor.ColumnPlacement={Left:0,Right:1};ej.DocumentEditor.TableAlignment={Left:0,Center:1,Right:2};ej.DocumentEditor.WidthType={Auto:0,Percent:1,Pixel:2};ej.DocumentEditor.CellVerticalAlignment={Top:0,Center:1,Bottom:2};ej.DocumentEditor.HeightType={Auto:0,Atleast:1,Exactly:2};ej.DocumentEditor.ListLevelPattern={Arabic:0,UpRoman:1,LowRoman:2,UpLetter:3,LowLetter:4,Ordinal:5,Number:6,OrdinalText:7,LeadingZero:22,Bullet:23,FarEast:20,Special:58,None:255};t=ej.browserInfo().name=="msie"&&ej.browserInfo().version<9;t||(n=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(t){var kr=function(){function n(){}return n.DocumentChange="documentChange",n.SelectionChange="selectionChange",n.ZoomFactorChange="zoomFactorChange",n.RequestNavigate="requestNavigate",n.ContentChange="contentChange",n}(),f,di,v,ft,kt,wi,ui,eo,re,ue,uf,h,ni,fe,fi,sr,yt,ff,nu,lu,au,vu,yu,pr,pu,wu,ur,bu,ee,ku,du,ti,ct,d,gu,hi,e,bt,ef,ot,oe,se,he,of,u,k,s,pt,sf,y,l,yi,b,ce,nf,nt,lr,wr,p,tt,le,hf,ae,ve,cf,lf,tu,af,vf,ye,pe,we,be,iu,ke,de,ge,no,yf,w,st,to,pf,oi,wt,wf,ci,li,ii,ri,ru,ar,bf,io,uu,it,dt,gi,br,fr,nr,lt,dr,kf,fu,o,a,bi,df,vr,er,ut,at,tr,ai,vi,g,ir,hr,eu,gf,ro,uo,ne,ou,te,ie,fo,i,r,oo,so,si,yr,su,hu,tf,ho,pi,co,rf,cu,cr,vt,ki,gt,ei,rt,gr,rr,ht,or,et,c;t.DocumentEditorEvents=kr;f=function(){function n(){}return n.DocumentEditor="e-documenteditor",n.ContextMenuItem="e-documenteditor-contextmenuitem",n.DisabledContextMenuItem="e-documenteditor-disabledcontextmenuitem",n.OptionsPane="e-documenteditor-optionspane",n.HiddenContextMenuItem="e-documenteditor-hiddencontextmenuitem",n.ContextMenuCut="e-documenteditor-contextmenu-cut",n.ContextMenuCopy="e-documenteditor-contextmenu-copy",n.ContextMenuPaste="e-documenteditor-contextmenu-paste",n.ContextMenuCopyHyperlink="e-documenteditor-contextmenu-copyheperlink",n.ContextMenuOpenHyperlink="e-documenteditor-contextmenu-openhyperlink",n.ContextMenuEditHyperlink="e-documenteditor-contextmenu-edithyperlink",n.ContextMenuHyperlink="e-documenteditor-contextmenu-hyperlink",n.ContextMenuRemoveHyperlink="e-documenteditor-contextmenu-removehyperlink",n.ContextMenuFont="e-documenteditor-contextmenu-font",n.ContextMenuParagraph="e-documenteditor-contextmenu-paragraph",n.ContextMenuTableProperties="e-documenteditor-contextmenu-tableproperties",n}();t.DocumentEditorThemeHelper=f;di=function(){function n(n,t){this.isDocumentLoaded=!0;this.currentPageNumber=1;this.pageCount=1;this.ej=null;this.isShiftingEnabled=!1;this.isLayoutEnabled=!0;this.isPastingContent=!1;this.disableHistory=!1;this.ShowComments=!0;this.isReviewPanelShown=!1;this.layoutType=pi.Pages;this.isReadOnly=!1;this.isReadOnlyInternal=!1;this.SelectedResizeElement=null;this.ResizerPosition=-1;this.CurrentResizingTable=null;this.IsRowOrCellResizing=!1;this.findResultsList=null;this._pasteTimeOut=12e3;this.DocumentEditor=n;this.ej=t;this.LayoutType=this.DocumentEditor.model.layoutType;this.viewer=this.LayoutType==pi.Pages?new w(this):new st(this);this.selection=new cf(this);this.textSearchResults=new ue(this);this.history=new fo(this);this.stackSize=500;this.ImageResizerPoints=new no;this.TableDialog=new he(this);this.TableBoderShadingDialog=new of(this);this.InitialPoint=new p(0,0);this.findResultsList=new h}return Object.defineProperty(n.prototype,"DocumentEditorElement",{get:function(){return this.DocumentEditor.element[0]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"ContainerId",{get:function(){return this.DocumentEditor._id},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"CurrentPageNumber",{get:function(){return this.Viewer==null||this.Viewer.SelectionEndPage==null?1:this.Viewer.Pages.indexOf(this.Viewer.SelectionEndPage)+1},set:function(n){this.currentPageNumber=n;this._RaiseClientEvent(kr.SelectionChange,null)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"PageCount",{get:function(){if(this.Viewer!=null)return this.Viewer.Pages.Count},set:function(n){this.pageCount=n},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"ZoomFactor",{get:function(){return this.Viewer.ZoomFactor},set:function(n){this.Viewer.ZoomFactor=n},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"Document",{get:function(){return this.document},set:function(n){this._onDocumentChanged(n)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"IsDocumentLoaded",{get:function(){return this.isDocumentLoaded},set:function(n){n&&this.Document!=null&&this.Document._ClearUnlinkedFields();this.isDocumentLoaded=n},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"Selection",{get:function(){return this.selection},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"Viewer",{get:function(){return this.viewer},set:function(n){this.viewer=n;this._OnViewerChanged(this.viewer)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"IsShiftingEnabled",{get:function(){return this.isShiftingEnabled},set:function(n){this.isShiftingEnabled=n},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"IsLayoutEnabled",{get:function(){return this.isLayoutEnabled},set:function(n){this.isLayoutEnabled=n},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"IsPastingContent",{get:function(){return this.isPastingContent},set:function(n){this.isPastingContent=n},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"History",{get:function(){return this.history},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"StackSize",{get:function(){return this.stackSize},set:function(n){this.stackSize=n},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"DisableHistory",{get:function(){return this.disableHistory},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"LayoutType",{get:function(){return this.layoutType},set:function(n){this.layoutType=n},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"IsReadOnly",{get:function(){return this.isReadOnly},set:function(n){this.isReadOnly=n;this.Viewer._ShowCaret(!1);this.Selection._UpdateFocus()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"IsReadOnlyMode",{get:function(){return this.isReadOnly||this.isReadOnlyInternal},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"IsReadOnlyInternal",{get:function(){return this.isReadOnlyInternal},set:function(n){this.isReadOnlyInternal=n},enumerable:!0,configurable:!0}),n.prototype._AddSearchResultItems=function(n){n!=null&&n!=""&&(this.findResultsList==null&&(this.findResultsList=new h),this.findResultsList._Add(n))},n.prototype._ClearSearchResultItems=function(){this.findResultsList!=null&&this.findResultsList._Clear()},n.prototype._OnViewerChanged=function(){this.Selection.Start!=null&&(this.Selection._UpdatePhysicalPosition(),this.Selection._FireSelectionChanged(!0))},n.prototype._RaiseClientEvent=function(n,t){this.DocumentEditor._raiseClientEvent(n,t)},n.prototype._InsertComment=function(){this.Selection._InsertComment()},n.prototype._DeleteAllComments=function(){this.Selection._DeleteAllComments()},n.prototype._DeleteComment=function(){var n=this.Selection;n._DeleteComment(n.Start.Paragraph._GetOwnerComment())},n.prototype._NavigateNextComment=function(){this.Selection._NavigateNextComment()},n.prototype._NavigatePreviousComment=function(){this.Selection._NavigatePreviousComment()},n.prototype._CanAddNewComment=function(){return!this.IsReadOnlyMode&&this.LayoutType==pi.Pages&&this.Selection!=null&&!this.Selection.IsCleared&&!this.Selection._IsInComment()?!0:!1},n.prototype._CanDeleteComment=function(){return!this.IsReadOnlyMode&&this.Selection!=null&&!this.Selection.IsCleared&&this.Selection._IsInComment()||this.Document!=null&&this.Document.Comments.Count>0?!0:!1},n.prototype._CanNavigateToPrevComment=function(){if(this.Selection!=null&&this.Document!=null&&!this.Selection.IsCleared&&this.Selection._IsInComment()){var n=this.Selection.Start.Paragraph._GetOwnerComment(),t=null,i=this.Document.Comments._IndexOf(n);if(i>0&&(n=this.Document.Comments[i-1],t=n._GetFirstParagraph(),t!=null))return!0}return!1},n.prototype._CanNavigateToNextComment=function(){if(this.Selection!=null&&!this.Selection.IsCleared&&this.Document!=null&&this.Selection._IsInComment()){var n=this.Selection.Start.Paragraph._GetOwnerComment(),t=null,i=this.Document.Comments._IndexOf(n);if(i<this.Document.Comments.Count-1&&(n=this.Document.Comments[i+1],t=n._GetFirstParagraph(),t!=null))return!0}return!1},n.prototype._CanInsertHyperlink=function(){return this.Document!=null&&this.IsDocumentLoaded&&!this.Selection._CanMergeSelectedCells()&&this.Selection!=null?!0:!1},n.prototype._GetDocumentStart=function(){var n=this.Document.DocumentStart;return n==null?"0;0;0":n._GetHierarchicalIndexInternal()},n.prototype._GetDocumentEnd=function(){var n=this.Document.DocumentEnd;return n==null?"0;0;1":n._GetHierarchicalIndexInternal()},n.prototype._Paste=function(){this.viewer._OnPasteMenuClick()},n.prototype._Print=function(){this.viewer._Print()},n.prototype._FitPage=function(n){this.viewer.PageFitType=n},n.prototype._FireRequestNavigate=function(n){var t=new nf(n),i=new ce(t);this._RaiseClientEvent(kr.RequestNavigate,i)},n.prototype._onDocumentChanged=function(n){this.document!=null&&this.document._Dispose();this.history!=null&&this.history._Dispose();this.document=n;this.IsDocumentLoaded=!0;this.document!=null&&(this.document.OwnerControl=this,this.document._LayoutItems(this.viewer));this.PageCount=this.Viewer.Pages.Count>0?this.viewer.Pages.Count:1;this.Selection!=null&&(this.Selection.EditingContext.Type=rf.Text);this._RaiseClientEvent(kr.DocumentChange,null);this.viewer._ShowHideOptionsPane(!1)},n.prototype._InitDocumentLoad=function(){this.IsDocumentLoaded=!1;this.viewer._ClearContainer()},n.prototype._parseDocumentInternal=function(n){var t=new ti(null),i,r;return n.BackgroundColor!=null&&n.BackgroundColor!=undefined&&(t.BackgroundColor=n.BackgroundColor),n.hasOwnProperty("CharacterFormat")&&n.CharacterFormat!=undefined&&n.CharacterFormat!=null&&this._parseCharacterFormat(n.CharacterFormat,t.CharacterFormat),i=new ni,r=new ni,this._parseSections(n.Sections,t,i,r),this._parseAbstractList(n,t),this._parseList(n,t),t},n.prototype._ParseDocument=function(n){this.Document=this._parseDocumentInternal(n);this.Selection._SelectRange(this.Document.DocumentStart,this.Document.DocumentStart,!0)},n.prototype._parseSections=function(n,t,i,r){for(var f,u=0;u<n.length;u++)f=new ct(null),this._parseSectionFormat(n[u].SectionFormat,f.SectionFormat),this._parseHeaderFooter(n[u].HeaderFooters,f.HeaderFooters,i,r),this._parseTextBody(n[u].Blocks,f.Blocks,i,r),t.Sections._Push(f)},n.prototype._parseSectionFormat=function(n,t){t.PageWidth=n.PageWidth;t.PageHeight=n.PageHeight;t.LeftMargin=n.LeftMargin;t.TopMargin=n.TopMargin;t.RightMargin=n.RightMargin;t.BottomMargin=n.BottomMargin;t.HeaderDistance=n.HeaderDistance;t.FooterDistance=n.FooterDistance;t.DifferentFirstPage=n.DifferentFirstPage;t.DifferentOddAndEvenPages=n.DifferentOddAndEvenPages},n.prototype._parseHeaderFooter=function(n,t,i,r){this._parseTextBody(n.Header.Blocks,t.Header.Blocks,i,r);this._parseTextBody(n.Footer.Blocks,t.Footer.Blocks,i,r);this._parseTextBody(n.EvenHeader.Blocks,t.EvenHeader.Blocks,i,r);this._parseTextBody(n.EvenFooter.Blocks,t.EvenFooter.Blocks,i,r);this._parseTextBody(n.FirstPageHeader.Blocks,t.FirstPageHeader.Blocks,i,r);this._parseTextBody(n.FirstPageFooter.Blocks,t.FirstPageFooter.Blocks,i,r)},n.prototype._parseTextBody=function(n,t,i,r){for(var f,e,o=0;o<n.length;o++)f=n[o],f.hasOwnProperty("Inlines")?(e=new u(null),f.hasOwnProperty("ParagraphFormat")&&this._parseParagraphFormat(f.ParagraphFormat,e.ParagraphFormat),f.hasOwnProperty("CharacterFormat")&&this._parseCharacterFormat(f.CharacterFormat,e.CharacterFormat),f.Inlines.length>0&&this._parseParagraph(f.Inlines,e,i,r),t._Push(e)):f.hasOwnProperty("Rows")&&this._parseTable(f,t,i,r)},n.prototype._parseTable=function(n,t,i,r){var o=new e(null),u,f,s,h;for(this._parseTableFormat(n.TableFormat,o.TableFormat),o.Title=n.Title,o.Description=n.Description,u=0;u<n.Rows.length;u++){if(f=new bt(null),n.Rows[u].hasOwnProperty("RowFormat"))for(this._parseRowFormat(n.Rows[u].RowFormat,f.RowFormat),f.GridBefore=n.Rows[u].GridBefore,f.GridBeforeWidth=n.Rows[u].GridBeforeWidth,f.GridAfter=n.Rows[u].GridAfter,f.GridAfterWidth=n.Rows[u].GridAfterWidth,s=0;s<n.Rows[u].Cells.length;s++)h=new ot(null),f.Cells._Push(h),n.Rows[u].Cells[s].hasOwnProperty("CellFormat")&&this._parseCellFormat(n.Rows[u].Cells[s].CellFormat,h.CellFormat),this._parseTextBody(n.Rows[u].Cells[s].Blocks,h.Blocks,i,r);o.Rows._Push(f)}o!=null&&t._Push(o)},n.prototype._parseParagraph=function(n,t,i,r){for(var u,p,h,f,v,o,c,a,e,k,w,y=0;y<n.length;y++)u=n[y],u.hasOwnProperty("Text")?(p=new s(null),u.hasOwnProperty("CharacterFormat")&&this._parseCh